Friday 2 November 2007

Additions to CategoryBoxes Mod - Game Text Links

I added Devons CategoryBoxes Mod - Game Text Links mod, excellent and works perfectly. I made a few small amendments. I made it adjustable from themeconfig. It might make it something that could be added to the next update of GSS.

What I did was add a new variable in themeconfig.php:

Code:

$themecfg['newestgameboximagenumber'] = 2;

This is the number of game thumbnail images and description you want listed before the text link list is started. In the above example (as on my site) you will have 2 games listed with thumbnail and descriptions.

Code:

$themecfg['newestgameboxnumber'] = 7;

newestgameboxnumber has to now be set at the number of games you want in total in each category box. As I have set my thumbnail list to 2, to have 5 games listed below in the text list. I have to set newestgameboxnumber to 7. 5+2 = 7.

Save themeconfig.php.

I made no changes to the code that Devon provided for categoryboxes.php (or in my case homecat.php as I was using theme 21).

Open up themefunctions.php find:

Code:

function dispgametd

Now find the following in Devon's code:

Code:

} else {
if($amount <= '1'){
echo "<table class='gltable' cellpadding='0' cellspacing='0'><tr><td><a href='".$link."' class='gamelink'><img src='[imgdir]".$game['nameid'].".png' alt='".$game['name']."' width='[twidth]' height='[theight]' class='gamethumb' align='left' /></a>
<a href='".$link."' class='gamelink'>".$game['name']."</a>";
echo "<br />";

Replace with:

Code:

} else {
global $themecfg;

if($amount <= $themecfg['newestgameboximagenumber']){
echo "<table class='gltable' cellpadding='0' cellspacing='0'><tr><td><a href='".$link."' class='gamelink'><img src='[imgdir]".$game['nameid'].".png' alt='".$game['name']."' width='[twidth]' height='[theight]' class='gamethumb' align='left' /></a>
<a href='".$link."' class='gamelink'>".$game['name']."</a>";
echo "<br />";

Now find (again in Devon's code):

Code:

} elseif($amount > '1') {

Replace with:

Code:

} elseif($amount > $themecfg['newestgameboximagenumber']) {

Save themefunctions.php

Upload the amended files to your server and away you go.

Hope that helps someone somewhere.

All the best.
Michael.

No comments: