Beste mensen,
ik heb een script geinstalleerd op mijn Joomla website maar dat geeft deze error:
Dit is de code:Code:Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/sites/santosbikes.nl/test/modules/mod_dmarticletitleslist/helper.php on line 9
Kan iemand mij helpen met deze error weg te krijgen?PHP Code:
<?php
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
require_once (JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
class ModArticleList {
public function getArticleList($args){
$db = &JFactory::getDBO();
$section_id = $args['section_id'];
$category_id = $args['category_id'];
$mode = $args['mode'];
$no_of_items = $args['no_of_items'];
$no_of_chars = $args['no_of_chars'];
$order_field = $args['order_field'];
$order_by = $args['order_by'];
if ($no_of_chars == 0){
$no_of_chars=999;
}
}
if ($mode === "category")
{
$query =
"SELECT CONCAT_WS('-',cn.id,cn.alias) AS slug, " .
"CONCAT_WS('-',ca.id,ca.alias) AS catslug, " .
"cn.id AS cnid, " .
"cn.created, " .
"cn.sectionid, " .
"cn.catid, " .
"ca.alias AS catalias, " .
"cn.alias AS conalias, " .
"IF (length(cn.title)>".$no_of_chars.",concat(substring(cn.title,1,".$no_of_chars."),'...'),cn.title) as title " .
"FROM #__content AS cn, " .
"#__categories AS ca " .
"WHERE cn.catid=".$category_id." " .
"AND cn.state = 1 " .
"AND ((publish_down = 0) or (publish_down > '" . date('Y-m-d') . "')) " .
"AND ca.id=cn.catid " .
"ORDER BY cn.".$order_field." ".$order_by;
} else {
$query =
"SELECT CONCAT_WS('-',cn.id,cn.alias) AS slug, " .
"CONCAT_WS('-',se.id,se.alias) AS secslug, " .
"cn.id AS cnid, " .
"cn.created, " .
"cn.sectionid, " .
"cn.catid, " .
"se.alias AS secalias, " .
"cn.alias AS conalias, " .
"IF (length(cn.title)>".$no_of_chars.",concat(substring(cn.title,1,".$no_of_chars."),'...'),cn.title) as title " .
"FROM #__content AS cn, " .
"#__sections AS se " .
"WHERE cn.sectionid=".$section_id." " .
"AND cn.state = 1 " .
"AND ((publish_down = 0) or (publish_down > '" . date('Y-m-d') . "')) " .
"AND se.id=cn.sectionid " .
"ORDER BY cn.".$order_field." ".$order_by;
}
if ($no_of_items != 0) {
$query .= " limit ".$no_of_items;
}
$db->setQuery($query);
$items = ($items = $db->loadObjectList())?$items:array();
return $items;
}
}
Mvg,
Dylan
- Parse error, hoe te corrigeren?
-
26-03-2010, 15:21 #1
- Berichten
- 47
- Lid sinds
- 15 Jaar
Parse error, hoe te corrigeren?
-
-
26-03-2010, 17:12 #2
- Berichten
- 21
- Lid sinds
- 15 Jaar
Hoi Dylan,
Je sluit public function getArticleList($args) te vroeg af. Hierdoor komt: if ($mode === "category") { buiten de functie te liggen en dat kan dus niet in een class..
Groeten.
Plaats een
- + Advertentie
- + Onderwerp
Marktplaats
Webmasterforum
- Websites algemeen
- Sitechecks
- Marketing
- Domeinen algemeen
- Waardebepaling
- CMS
- Wordpress
- Joomla
- Magento
- Google algemeen
- SEO
- Analytics
- Adsense
- Adwords
- HTML / XHTML
- CSS
- Programmeren
- PHP
- Javascript
- JQuery
- MySQL
- Ondernemen algemeen
- Belastingen
- Juridisch
- Grafisch ontwerp
- Hosting Algemeen
- Hardware Info
- Offtopic