Author Topic: Call Image description and cut # characters. how?  (Read 3984 times)

0 Members and 1 Guest are viewing this topic.

Offline live@ct

  • Sr. Member
  • ****
  • Posts: 348
    • View Profile
Call Image description and cut # characters. how?
« on: May 04, 2007, 07:39:16 PM »
Hi, in the index I like to show a part of the image_description but only 50 chars of all the description, I copy the last images function to create a new last images of a specified categorie, for that categorie i like to show in the thumb the image_description, im trying adding this code in the function:

Code: [Select]
$text_len = 50;
$text = $row['image_description'];
  if (strlen($text) > $text_len) {
    $text = substr($text, 0, $text_len)." ...";
  }

and this template var
Code: [Select]
$site_template->register_vars(array(
"image_desccut" => format_text($text, $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments'], 1, 0)));

but it doesn work, can someone help me please?!?!?!

thank you!!
Existen 10 tipos de personas, los que entienden el codigo binario y los que no.