-
AuthorPosts
-
January 9, 2013 at 3:27 pm #183809
Good Morning
Dear your work is amazing, I really liked the staff, but I would like a little help with K2?K2
As I can limit the number of characters in the description in the intro of the article, when I do it from the category configuarcion works but I lost the image of introduction?I look forward to your prompt help?
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
January 10, 2013 at 4:27 am #479209You can try with my solutions:
<blockquote>templates/ja_wall/template_tools.php</blockquote>
Add new script front public static function getExClass($k2item)
public static function DropText($title, $max=100)
{
if($title!=''){
if(is_array($title)) list($string, $match_to) = $title;
else { $string = $title; $match_to = $title{0}; }$match_start = stristr($string, $match_to);
$match_compute = strlen($string) - strlen($match_start);if (strlen($string) > $max)
{
if ($match_compute < ($max - strlen($match_to)))
{
$pre_string = substr($string, 0, $max);
$pos_end = strrpos($pre_string, " ");
if($pos_end === false) $string = $pre_string."...";
else $string = substr($pre_string, 0, $pos_end)."...";
}
else if ($match_compute > (strlen($string) - ($max - strlen($match_to))))
{
$pre_string = substr($string, (strlen($string) - ($max - strlen($match_to))));
$pos_start = strpos($pre_string, " ");
$string = "...".substr($pre_string, $pos_start);
if($pos_start === false) $string = "...".$pre_string;
else $string = "...".substr($pre_string, $pos_start);
}
else
{
$pre_string = substr($string, ($match_compute - round(($max / 3))), $max);
$pos_start = strpos($pre_string, " "); $pos_end = strrpos($pre_string, " ");
$string = "...".substr($pre_string, $pos_start, $pos_end)."...";
if($pos_start === false && $pos_end === false) $string = "...".$pre_string."...";
else $string = "...".substr($pre_string, $pos_start, $pos_end)."...";
}$match_start = stristr($string, $match_to);
$match_compute = strlen($string) - strlen($match_start);
}return $string;
}else{
return $string ='';
}
}<blockquote>templates/ja_wall/html/com_k2/ja_wall/category_item.php</blockquote>
from
$introtext = '<p>'.$introtext.'</p>';
change to
$introtext = '<p>'.WallHelper::DropText($this->item->introtext).'</p>';
Or you can apply this fix with all customize view k2 component
<blockquote>templates/ja_wall/html/com_k2</blockquote> -
AuthorPosts
This topic contains 3 replies, has 2 voices, and was last updated by cyan 12 years ago.
We moved to new unified forum. Please post all new support queries in our New Forum