1
pessi
wordbook module.
  • 2006/6/13 21:16

  • pessi

  • Quite a regular

  • Posts: 204

  • Since: 2004/5/16


Dear All

I was trying to modify the wordbook module to suit my needs and I found this code in the template file.

<{foreach item=eachentry from=$entriesarray2.single}>

<{$eachentry.microlinks}><{$eachentry.term}> <{if $multicats == 1}>[<{$eachentry.catname}>]<{/if}>


<{$eachentry.definition}>


<{/foreach}>

which I changed to


<{foreach item=eachentry from=$entriesarray2.single}>





<{$eachentry.term}> <{$eachentry.definition}>




<{/foreach}>




The only problem is that, it is displaying only a part of the definition in the index page. I want to see the full definition in the entry page. I checked the database to see
if number of characters are restrcited there but couldnot find it.

Can someone suggest how to have the ful definition be displayed in the entries page?

see it here.
http://telugu-cards.com/modules/wordbook/letter.php?init=A

thanks in advance,
prasad.

2
tcnet
Re: wordbook module.
  • 2006/6/14 12:41

  • tcnet

  • Friend of XOOPS

  • Posts: 297

  • Since: 2006/5/12


The length of the abbreviated definition is set in the module's system preferences in "12. Length of string to show in random definitions". This variable sets the description length used in the module's blocks and in the letters and category pages.

An easy fix would be to set that variable to a high enough number so that it includes the full definition in the letters and category views. Unfortunately that would cause the full definition to display in the module's blocks as well.

If you want to reserve the short definition variable for block use, you will have to modify letters.php and category.php to use the full definition.

Somewhere around lines 106 and 192 in letters.php you will find the random length variable in use.

if ( !XOOPS_USE_MULTIBYTES )
{
$deftemp = cleanTags($definition);
$deftemp = $myts -> displayTarea ( substr ( $deftemp, 0, ( $xoopsModuleConfig['rndlength'] -1 ))) . "...";
$eachentry['definition'] = $deftemp;
}


The "clean tags line" removes images, links and other html tags from the short definition and the "rndlength" variable limits the string length.

Comment out those lines and replace with code that will display the full definition:

if ( !XOOPS_USE_MULTIBYTES )
{
// HACK for full definition
//$deftemp = cleanTags($definition);
//$deftemp = $myts -> displayTarea ( substr ( $deftemp, 0, ( $xoopsModuleConfig['rndlength'] -1 ))) . "...";

$deftemp = $myts -> displayTarea( $definition, $html, $smiley, $xcodes, 1, $breaks );

// END HACK for full definition
$eachentry['definition'] = $deftemp;
}


You may want to modify this code in category.php (line 139) to show the full definition in category view as well.

3
pessi
Re: wordbook module.
  • 2006/6/17 16:43

  • pessi

  • Quite a regular

  • Posts: 204

  • Since: 2004/5/16


wonderful! thanks buddy. in which other forum would someone be so considerate to give such an elaborate answer?

it happens only at XOOPS community.

thanks all.

cheers
prasad..

4
tcnet
Re: wordbook module.
  • 2006/6/17 18:05

  • tcnet

  • Friend of XOOPS

  • Posts: 297

  • Since: 2006/5/12


My pleasure!

Login

Who's Online

348 user(s) are online (295 user(s) are browsing Support Forums)


Members: 0


Guests: 348


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits