18.5. Modifying the PHP-Nuke Web_Links module

Figure 18-4. Administration panel: Web Links.

Administration panel: Web Links.

In this section we modify the PHP-Nuke Web Links module:

18.5.1. How to display Web Links in the same window

The Web_Links module will display each web link in a separate window. To change this behaviour and make it display the link in the same window, you have to change each occurence of

target=\"new\"

to

target=\"_self\"

in the modules/Web_Links/index.php file. This is a straightforward search and replace procedure. In vi, you would do

1,$s/target=\\"new\\"/target=\\"_self\\"/g

18.5.2. How to change the number of Web Links per page

You can change the number of Web Links that are displayed per page very easily - no programming necessary!

Just change the value of $perpage in modules/Web_Links/l_config.php:

$perpage = 10;

TipMake use of the module configuration files!
 

It definitely pays off to have a look at the configuration files of the various modules! The l_config.php file, for example, located in the Web_Links folder under the modules directory, offers many variables that can be used to achieve the desired appearence of the Web Links module:

  • $perpage: How many links to show on each page?

  • $popular: How many hits need a link to be listed as popular?

  • $newlinks: How many links to display in the New Links Page?

  • $toplinks: How many links to display in The Best Links Page? (Most Popular)

  • $linksresults: How many links to display on each search result page?

  • $links_anonaddlinklock: Lock Unregistered users from Suggesting New Links? (0=Yes 1=No)

  • $anonwaitdays: Number of days anonymous users need to wait to vote on a link

  • $outsidewaitdays: Number of days outside users need to wait to vote on a link (checks IP)

  • $useoutsidevoting: Allow Webmasters to put vote links on their site (1=Yes 0=No)

  • $anonweight: How many Unregistered User vote per 1 Registered User Vote?

  • $outsideweight: How many Outside User vote per 1 Registered User Vote?

  • $detailvotedecimal: Let Detailed Vote Summary Decimal out to N places. (no max)

  • $mainvotedecimal: Let Main Vote Summary Decimal show out to N places. (max 4)

  • $toplinkspercentrigger: 1 to Show Top Links as a Percentage (else # of links)

  • $toplinks: Either # of links OR percentage to show (percentage as whole number. #/100)

  • $mostpoplinkspercentrigger: 1 to Show Most Popular Links as a Percentage (else # of links)

  • $mostpoplinks: Either # of links OR percentage to show (percentage as whole number. #/100)

  • $featurebox: 1 to Show Feature Link Box on links Main Page? (1=Yes 0=No)

  • $linkvotemin: Number votes needed to make the 'top 10' list

  • $blockunregmodify: Block unregistered users from suggesting links changes? (1=Yes 0=No)