1. Crux
  2. Monday, 02 July 2012
Hello,

A standard installation of Quickstart of Crux give :

Parse error: syntax error, unexpected $end in /homez.420/dmsabqwe/www/modules/mod_news_show_sp2/k2helper.php on line 1

is there a way to correct it ?

Thanks for help
Responses (22)
Me to^^

Parse error: syntax error, unexpected $end in /homez.527/uracing/www/modules/mod_news_show_sp2/k2helper.php on line 1
  1. more than a month ago
  2. Crux
  3. # 1
Have you resolved this bug? 3 days bloced for this :(
  1. more than a month ago
  2. Crux
  3. # 2
not resolved..... grrrr :angry:
  1. more than a month ago
  2. Crux
  3. # 3
OK, here is the solution.

Download the Extensions (in the same place as the quickstart) and install the mod_news_show_sp2_j25

I hate to pay licences for packages not working 100%......
  1. more than a month ago
  2. Crux
  3. # 4
and when you do that, you have to change the module position of mainmenu to position-7.... right is not good, but position-7 is working... don't ask me why lol


pffff franchement ça craint
  1. more than a month ago
  2. Crux
  3. # 5
tu es Français aussi ^^ je me demande si j'ai bien fait de m'inscrire ici :(
  1. more than a month ago
  2. Crux
  3. # 6
j'ai bien pensé que tu étais français avec le lien de chez ovh que tu as mis ... homez... c'est du ovh ça ^^

Bah disons que ça a l'air plutôt bien ici, mais pour le support ils ont pas l'air de se sortir les pouces du cul...

Avant j'utilisais rockettheme.com j'ai jamais eu ce genre de soucis (mais c'est cher), mais comme je prépare un site en vue de la sortie de planetside 2, le crux me semblait vraiment génial.

Si je rencontre des soucis ou toi, on peut échanger sur le site ici et on devrait bien trouver une solution.

Bonne soirée à toi
  1. more than a month ago
  2. Crux
  3. # 7
Extremely Sorry for late. This is the short tag problem of php. Some servers turn off the short tag option of php.


Please go to crux\modules\mod_news_show_sp2\common.php line 182 you can find a " ?> " . Please delete it, this the solution.

And tell us if the problem still remaining.
  1. more than a month ago
  2. Crux
  3. # 8
I tried this solution and it did not fix the problem for me.

Any other suggestions?
  1. more than a month ago
  2. Crux
  3. # 9
Update to the latest version will solve the issue.
  1. more than a month ago
  2. Crux
  3. # 10
Completely wiped out files from hosting directory. Downloaded Crux Quickstart again, and uploaded to folder. Ran the configuration, and installed it again. The administration side works as it should, but viewing the site still results in the error:

Parse error: syntax error, unexpected $end in /home/content/e/x/p/MYDIRECTORY/html/SUBDIRECTORY/MYSITE/modules/mod_news_show_sp2/k2helper.php on line 1

I have installed two other QuickStart packs for other templates and they work normally.

I have also made sure Helix is updated again. Although I just started downloading all of these in the last few days, so I'm assuming I had the updated versions to begin with.

I also tried reverting from PHP 5.3 to PHP 5.2 and this did not correct the issue either.

I tried removing the short code in the Common.php file again (as suggested above), and this did not work also.

I see a lot of short code in other documents, but I'm not sure that is the issue, since I assume other Template Quickpacks also have short code in them.

Holding off on Crux and will work on other projects until a solution can be found. If I happen to discover the issue later on and fix it, I will post my results.

Thanks for the suggestions...

P.S. You guys do great work. Despite the occasional code glitch here and there, your templates and framework are really awesome. I've been watching your progress for a few years, and I finally decided to go with your products over a lot of others. I appreciate all of the hard work you guys put into this site and products.
  1. more than a month ago
  2. Crux
  3. # 11
Thank you very much, This worked - I too hate paying for things that doesn't work as advertised.
  1. more than a month ago
  2. Crux
  3. # 12
here is the code required.

<?php


// no direct access
defined('_JEXEC') or die('Restricted access');
$k2route = JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'route.php';
$k2utilities = JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'utilities.php';
if (file_exists($k2route))
require_once($k2route);

if (file_exists($k2utilities))
require_once($k2utilities);

abstract class modNSSP2K2Helper {

static function getList($params,$count){

$catids = $params->get('k2catids', array());
$ordering = $params->get('ordering', 'a.ordering');
$ordering_direction = $params->get('ordering_direction', 'ASC');
$user_id = $params->get('user_id');
$show_featured = $params->get('show_featured');

$user = JFactory::getUser();
$aid = $user->get('aid');
$db = JFactory::getDBO();

$jnow = JFactory::getDate();
$now = $jnow->toMySQL();
$nullDate = $db->getNullDate();

$query = "SELECT a.*, c.name as categoryname,c.id as categoryid, c.alias as categoryalias, c.params as categoryparams".
" FROM #__k2_items as a".
" LEFT JOIN #__k2_categories c ON c.id = a.catid";
$query .= " WHERE a.published = 1 AND a.access IN(".implode(',', $user->authorisedLevels()).";) AND a.trash = 0 AND c.published = 1 AND c.access IN(".implode(',', $user->authorisedLevels()).";) AND c.trash = 0";

// User filter
$userId = JFactory::getUser()->get('id');
switch ($params->get('user_id'))
{
case 'by_me':
$query .= ' AND (a.created_by = ' . (int) $userId . ' OR a.modified_by = ' . (int) $userId . ')';
break;
case 'not_me':
$query .= ' AND (a.created_by <> ' . (int) $userId . ' AND a.modified_by <> ' . (int) $userId . ')';
break;

case '0':
break;

default:
$query .= ' AND (a.created_by = ' . (int) $userId . ' OR a.modified_by = ' . (int) $userId . ')';
break;
}

//Added Category
if (!is_null($catids)) {
if (is_array($catids)) {
JArrayHelper::toInteger($catids);
$query .= " AND a.catid IN(".implode(',', $catids).";)";
} else {
$query .= " AND a.catid=".(int)$catids;
}
}

// Featured items filter
if ($show_featured == '0')
$query .= " AND a.featured != 1";

if ($show_featured == '1')
$query .= " AND a.featured = 1";

// ensure should be published
$query .= " AND ( a.publish_up = ".$db->Quote($nullDate)." OR a.publish_up <= ".$db->Quote($now)." )";
$query .= " AND ( a.publish_down = ".$db->Quote($nullDate)." OR a.publish_down >= ".$db->Quote($now)." )";

//Ordering
$orderby = $ordering . ' ' . $ordering_direction; //ordering

$query .= " ORDER BY ".$orderby;
$db->setQuery($query, 0, $count);
$items = $db->loadObjectList();

require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'models'.DS.'item.php');
$model = new K2ModelItem;
if (count($items)) {
foreach ($items as $item) {

if (! empty($item->created_by_alias)) {
$item->author = $item->created_by_alias;
} else {
$author = &JFactory::getUser($item->created_by);
$item->author = $author->name;
}

$item->created = $item->created;
$item->hits = $item->hits;
$item->category = $item->categoryname;
$item->cat_link = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($item->catid.':'.urlencode($item->categoryalias))));
$item->image = modNSSP2K2Helper::getImage($item->id, $item->introtext);
$item->title = htmlspecialchars($item->title);
$item->introtext = $item->introtext;
$item->link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($item->id.':'.urlencode($item->alias), $item->catid.':'.urlencode($item->categoryalias))));
$item->comment = '<a class="ns2-comments" href="' . $item->link . '#itemCommentsAnchor">' . JText::_('COMMENTS_TEXT') . ' (' . $model->countItemComments($item->id) . ')</a>';
$item->rating = $model->getVotesPercentage($item->id);
if ($params->get('article_extra_fields')) {
$item->extra_fields = $model->getItemExtraFields($item->extra_fields);
}

$rows[] = $item;
}
return $rows;
}
}

//retrive k2 image
function getImage($id, $text) {
if (JFile::exists(JPATH_SITE . DS . 'media' . DS . 'k2' . DS . 'items' . DS . 'cache' . DS . md5("Image" . $id) . '_XL.jpg')) {
return 'media/k2/items/cache/' . md5("Image" . $id) . '_XL.jpg';
} else {
preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $text, $matches);
if (isset($matches[1])) {
return $matches[1];
}
}
}

}
?>
  1. more than a month ago
  2. Crux
  3. # 13
ok so this is what the code must look like.

<?php


// no direct access
defined('_JEXEC') or die('Restricted access');
$k2route = JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'route.php';
$k2utilities = JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'utilities.php';
if (file_exists($k2route))
require_once($k2route);

if (file_exists($k2utilities))
require_once($k2utilities);

abstract class modNSSP2K2Helper {

static function getList($params,$count){

$catids = $params->get('k2catids', array());
$ordering = $params->get('ordering', 'a.ordering');
$ordering_direction = $params->get('ordering_direction', 'ASC');
$user_id = $params->get('user_id');
$show_featured = $params->get('show_featured');

$user = JFactory::getUser();
$aid = $user->get('aid');
$db = JFactory::getDBO();

$jnow = JFactory::getDate();
$now = $jnow->toMySQL();
$nullDate = $db->getNullDate();

$query = "SELECT a.*, c.name as categoryname,c.id as categoryid, c.alias as categoryalias, c.params as categoryparams".
" FROM #__k2_items as a".
" LEFT JOIN #__k2_categories c ON c.id = a.catid";
$query .= " WHERE a.published = 1 AND a.access IN(".implode(',', $user->authorisedLevels()).";) AND a.trash = 0 AND c.published = 1 AND c.access IN(".implode(',', $user->authorisedLevels()).";) AND c.trash = 0";

// User filter
$userId = JFactory::getUser()->get('id');
switch ($params->get('user_id'))
{
case 'by_me':
$query .= ' AND (a.created_by = ' . (int) $userId . ' OR a.modified_by = ' . (int) $userId . ')';
break;
case 'not_me':
$query .= ' AND (a.created_by <> ' . (int) $userId . ' AND a.modified_by <> ' . (int) $userId . ')';
break;

case '0':
break;

default:
$query .= ' AND (a.created_by = ' . (int) $userId . ' OR a.modified_by = ' . (int) $userId . ')';
break;
}

//Added Category
if (!is_null($catids)) {
if (is_array($catids)) {
JArrayHelper::toInteger($catids);
$query .= " AND a.catid IN(".implode(',', $catids).";)";
} else {
$query .= " AND a.catid=".(int)$catids;
}
}

// Featured items filter
if ($show_featured == '0')
$query .= " AND a.featured != 1";

if ($show_featured == '1')
$query .= " AND a.featured = 1";

// ensure should be published
$query .= " AND ( a.publish_up = ".$db->Quote($nullDate)." OR a.publish_up <= ".$db->Quote($now)." )";
$query .= " AND ( a.publish_down = ".$db->Quote($nullDate)." OR a.publish_down >= ".$db->Quote($now)." )";

//Ordering
$orderby = $ordering . ' ' . $ordering_direction; //ordering

$query .= " ORDER BY ".$orderby;
$db->setQuery($query, 0, $count);
$items = $db->loadObjectList();

require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'models'.DS.'item.php');
$model = new K2ModelItem;
if (count($items)) {
foreach ($items as $item) {

if (! empty($item->created_by_alias)) {
$item->author = $item->created_by_alias;
} else {
$author = &JFactory::getUser($item->created_by);
$item->author = $author->name;
}

$item->created = $item->created;
$item->hits = $item->hits;
$item->category = $item->categoryname;
$item->cat_link = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($item->catid.':'.urlencode($item->categoryalias))));
$item->image = modNSSP2K2Helper::getImage($item->id, $item->introtext);
$item->title = htmlspecialchars($item->title);
$item->introtext = $item->introtext;
$item->link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($item->id.':'.urlencode($item->alias), $item->catid.':'.urlencode($item->categoryalias))));
$item->comment = '<a class="ns2-comments" href="' . $item->link . '#itemCommentsAnchor">' . JText::_('COMMENTS_TEXT') . ' (' . $model->countItemComments($item->id) . ')</a>';
$item->rating = $model->getVotesPercentage($item->id);
if ($params->get('article_extra_fields')) {
$item->extra_fields = $model->getItemExtraFields($item->extra_fields);
}

$rows[] = $item;
}
return $rows;
}
}

//retrive k2 image
function getImage($id, $text) {
if (JFile::exists(JPATH_SITE . DS . 'media' . DS . 'k2' . DS . 'items' . DS . 'cache' . DS . md5("Image" . $id) . '_XL.jpg')) {
return 'media/k2/items/cache/' . md5("Image" . $id) . '_XL.jpg';
} else {
preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $text, $matches);
if (isset($matches[1])) {
return $matches[1];
}
}
}

}
?>
  1. more than a month ago
  2. Crux
  3. # 14
Only 3 months late replying and saying Thank You! B)

So instead of removing the ?> as suggested previously, I needed to actually add that to the end of the K2Helper.php file.

I also received the error from the vmhelper.php file, and so I added the closing argument to it as well, and this fixed my errors, letting the page load.

Whereas removing the argument may have fixed the issue for other users (perhaps depending on the hosting server they are using?), my issue was fixed by adding it to two other documents.

Thanks for your help...
  1. more than a month ago
  2. Crux
  3. # 15
I'm new here trying to get the quickstart up and running and fairly new to joomla so my issues may seem basic, I apologize,

Right now after doing a clean install of the quickstart I receive this message:

Forbidden

You don't have permission to access / on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache Server at ninfest.com Port 80

What is my problem here? my site is ninfest.com

Also, not sure if this matters but my hosting is through godaddy

EDIT:
figured out my issue. Had to move all files up one level for the index.php to be read.
  1. more than a month ago
  2. Crux
  3. # 16
Update to the latest version will solve the issue.


Ok the problem I have now after updating to the latest version is this error message:

Fatal error: Class 'modNSSP2K2Helper' not found in /home/content/51/9547651/html/modules/mod_news_show_sp2/mod_news_show_sp2.php on line 126

What do I change to fix this?
  1. more than a month ago
  2. Crux
  3. # 17
Please, PM your admin access.
  1. more than a month ago
  2. Crux
  3. # 18
Parse error: syntax error, unexpected $end in /home/delhidir/public_html/iwitness2/modules/mod_sp_news_highlighter/k2helper.php on line 1

tried adding and removing closing tags but not working but same error.
Using Joomla! 2.5.6

need a solution
  1. more than a month ago
  2. Crux
  3. # 19
Hi Tarun Khanna,
Please install update sp news highlighter module. Can you share your website URL

Thanks
  1. more than a month ago
  2. Crux
  3. # 20
Hi Jakir, Thanks for response . I have already update the respective module. but error remains same.

http://www.delhidirectoryonline.com/iwitness2 is link of my website
  1. more than a month ago
  2. Crux
  3. # 21
Hi Tarun Khanna,
Did you download update highlighter module from our website??? 2 weeks ago we released update express template and all modules.... May be you have downloaded express template few month ago..... So, now you should install update all modules and helix system plugin 1.9.6

Thanks
  1. more than a month ago
  2. Crux
  3. # 22


There are no replies made for this post yet.
Be one of the first to reply to this post!


This forum is archived

This forum has been archived. Please use JoomShaper official support system.