This is a quick tutorial on how to mod your phpLB directory to prevent long descriptions for listed sites messing your design.
This is only releavant to those people using this mod to improve the descriptions. When someone writes a long description for their submission, it can affect the design when shown on the homepage and category page. Just look how I messed up a directory this morning.

As you can see, the long description made the nice vertically aligned listings look outof place.
To fix this, we can add a [read more…] style feature to those sites whose descriptions are too long.

This is the fix that has been applied on Zorg Links for the past few weeks.
To do this to your own bidding directory, do the following :
In FTP/File Manager mode, go to file inc/bootstrap.php
Find :
$kytoo_version = file_get_contents(PATH_BASE . 'version.txt');
$cfg->setVar('kytoo_version', $kytoo_version);
$cfg->setVar('regexp_urlsafe', 'A-Za-z0-9');
after it add :
function wordCut($text, $limit, $msg){
if (strlen($text) > $limit){
$txt1 = wordwrap($text, $limit, '[cut]');
$txt2 = explode('[cut]', $txt1);
$ourTxt = $txt2[0];
$finalTxt = $ourTxt.$msg;
}else{
$finalTxt = $text;
}
return $finalTxt;
}
Save and upload the file.
Edit header.php
Find :
$bid_url = DIR_BASE . $bid_url;
after it add :
$rs->fields['link_description'] = wordCut($rs->fields['link_description'], 150,
'<a href='.$bid_url.'>... read more</a>');
Save and upload the file.
Edit index.php
Find :
$tpl->assign_array_d('link_row', $rs->fields, 1);
remove it.
Find :
$bid_url = DIR_BASE . $bid_url;
after it add
$rs->fields['link_description'] = wordCut($rs->fields['link_description'], 150,
'<a href='.$bid_url.'>... read more</a>'); $tpl->assign_array_d('link_row', $rs->fields, 1);
Thats it. All we did was add a function in a config file, and use it to snip descriptions that are too long and replace them with a …readmore feature. This has been tested and seems to work fine on Zorg Links. However as always make sure you make a backup of the files we edit before you change them, incase this mod doesn’t work out for you.
~Mike
If you enjoyed this post, make sure you subscribe to my RSS feed!

September 7th, 2007 at 10:55 pm
Thanks for excellent mod Mike! I always wondered how you did that. Can’t wait to try it out!
September 18th, 2007 at 7:25 pm
Edit header.php
Find :
$bid_url = DIR_BASE . $bid_url;
After it add
$rs->fields[’link_description’] = wordCut($rs->fields[’link_description’], 150, ‘[…]’);
$btpl->assign_array_d(’link_row’, $rs->fields, 1);
He is working for the main page.
October 20th, 2007 at 8:49 am
[…] Demo - More Details. […]
November 13th, 2007 at 4:45 am
I have follow all you step correctly.. Its work fine on directory folder but did’t work on homepages.. Can you update to make its work on homepages..??