phplb mod - making sure a long description does not mess up the design

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!

12 Responses to “phplb mod - making sure a long description does not mess up the design”

  1. LanceT Says:

    Thanks for excellent mod Mike! I always wondered how you did that. Can’t wait to try it out!

  2. Maxx Says:

    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.

  3. PhpLinkBid, PhpLB Mods Indexed Says:

    […] Demo - More Details. […]

  4. Viral Video Says:

    I do think this can be among the list of lots major information in my situation. Exactly what content looking through the content. Mathura web seo Yet choose to opinion upon several general issues, The website design and style is perfect, your reports is at fact outstanding : Deb. Superior course of action, kind regards

  5. ray ban occhiali da sole saldi Says:

    http://overseasoverwhelmed.com/about.php?p=mbt-prezzi-scarpescarpe mbt

  6. longchamp sac Says:

    Peut être nocif durante cas d’absorption nike tn pas cher percutanéeL’avis signifiant RicochetRio Janeiro, Aujourd’hui. Uolace, Délaissé componen une mère alcoolique, se débrouille are generallyul dans rue dom avec chaussures louboutin essentis ux copains et mendicité. Jean victor habite un petit appartement, virtual assistant à l’école, Couvé an elemen une mère persuadée que l’éducation mène à are generally richesse. Ava

  7. Dion Kidner Says:

    It is not my first time to go to see this site, i am visiting this web page daillyand get good facts from here daily.Feel free to visit my page whats is fighter abs (Annetta)

  8. online marketing jobs in mumbai Says:

    online marketing jobs in mumbai…

    Zorg Links Bidding Web Directory - Blog » Blog Archive » phplb mod - making sure a long description does not mess up the design…

  9. marketing online courses canada Says:

    marketing online courses canada…

    Zorg Links Bidding Web Directory - Blog » Blog Archive » phplb mod - making sure a long description does not mess up the design…

  10. digital marketing online classes Says:

    digital marketing online classes…

    Zorg Links Bidding Web Directory - Blog » Blog Archive » phplb mod - making sure a long description does not mess up the design…

  11. online marketing jobs london Says:

    online marketing jobs london…

    Zorg Links Bidding Web Directory - Blog » Blog Archive » phplb mod - making sure a long description does not mess up the design…

  12. www.gamunu.info Says:

    You’ve maade soome ddcent points there. I looked on the web for more info about
    the issue andd found most people will go along with yyour views on this website.

Leave a Reply