Keyword

What is wrong?

  • Ivo Apostolov
  • Ivo Apostolov's Avatar Topic Author
  • Offline
  • Senior Member
More
15 years 4 weeks ago #81940 by Ivo Apostolov
What is wrong? was created by Ivo Apostolov
Can someone help me, what is wrong with this code and why it doesn't work?
I am trying to create a plugin to cut the number of words in a similar way as the module does.

function onK2PrepareContent ( & $item, $params, $limitstart ) {
global $mainframe;
$plugin = & JPluginHelper::getPlugin('k2', 'cut');
$pluginParams = new JParameter($plugin->params);
$words = $params->get('words', 0);
$option = JRequest::getCmd('option');
$layout = JRequest::getCmd('layout');
$task   = JRequest::getCmd('task');
if ($option == 'com_k2' && $layout == 'category' && $task=='category')
{
$item->text = '';
if ($params->get('words')>0) {
$item->text .= K2HelperUtilities::wordLimit($item->introtext, $params->get('words'));

else {
$item->text .= $item->introtext;
}
$item->introtext = $item->text;
}

Please Log in or Create an account to join the conversation.

More
15 years 4 weeks ago #81941 by JoomlaWorks
Replied by JoomlaWorks on topic What is wrong?
Did you include the required file that carries in the K2HelperUtilities class?

Please Log in or Create an account to join the conversation.

  • Ivo Apostolov
  • Ivo Apostolov's Avatar Topic Author
  • Offline
  • Senior Member
More
15 years 4 weeks ago #81942 by Ivo Apostolov
Replied by Ivo Apostolov on topic What is wrong?
Yes I did

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum