× If you expect answers you should describe your problem and give as much information's as possible. (SQL-Structure, Template Code, Joomla Version ...) Please read this before posting: joodb.feenders.de/support.html

Error

  • mbedard
14 years 1 month ago #107 by mbedard
Error was created by mbedard
I received this error

Warning: strpos() [function.strpos]: Offset not contained in string in /components/com_joodb/helpers/joodb.php on line 124

Whats wrong??

Please Log in to join the conversation.

  • iftee
13 years 9 months ago #140 by iftee
Replied by iftee on topic Re:Error
Error message is saying "The value of $start is greater than the length of $textlength". Add an "if" statement to bypass the function if $start is greater than the length of $textlength. +Put this code just before the mentioned line:

if (strlen($text) <= $maxlen) $maxlen = strlen($text);

and this should work. It will look probably like this:

function wrapText($text,$maxlen=120) {
if (strlen($text)>$maxlen) {
$text = strip_tags($text);
if (strlen($text) <= $maxlen) $maxlen = strlen($text);
$len = strpos($text," ",$maxlen);
if ($len) $text = substr($text,0,$len).' &hellip;';
}
return $text;
}

Cheers

Please Log in to join the conversation.

  • iftee
13 years 9 months ago #142 by iftee
Replied by iftee on topic Re:Re:Error


this needs to be done in /httpdocs/components/com_joodb/helpers/joodb.php






[iftee 2010-07-30 01:25:37]:



Error message is saying "The value of $start is greater than the length of $textlength". Add an "if" statement to bypass the function if $start is greater than the length of $textlength. +Put this code just before the mentioned line:

if (strlen($text) <= $maxlen) $maxlen = strlen($text);

and this should work. It will look probably like this:

function wrapText($text,$maxlen=120) {
if (strlen($text)>$maxlen) {
$text = strip_tags($text);
if (strlen($text) <= $maxlen) $maxlen = strlen($text);
$len = strpos($text," ",$maxlen);
if ($len) $text = substr($text,0,$len).' &hellip;';
}
return $text;
}

Cheers



Please Log in to join the conversation.

  • gracias
13 years 5 months ago #214 by gracias
Replied by gracias on topic Re:Error
hi ja!

!Very Thxs for your anwser!! It's works!

Please Log in to join the conversation.

Moderators: Dirkjoest