Announcement

Collapse
No announcement yet.

How To Display Sponsor Links For Categories

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How To Display Sponsor Links For Categories

    See attached image for what the end result looks like.

    Go to your:

    Admin CP -> Styles & Templates -> Style Manager -> -> Forum Home Templates -> forumhome_forumbit_level1_nopost

    Add the red code:

    Code:
    	<tr>
    		<td class="tcat" colspan="2">
    			<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumbit_$forumid')"><img id="collapseimg_forumbit_$forumid" src="$stylevar[imgdir_button]/collapse_tcat{$collapseimg_forumid}.gif" alt="" border="0" /></a>
    			<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">$forum[title]</a>
    			<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
    			<if condition="$show['subforums']"><div class="smallfont"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
    		</td>
    		<td class="tcat" align="right" colspan="<if condition="$vboptions[showmoderatorcolumn]">4<else />3</if>">
    			SPONSOR CODE HERE
    		</td>
    	</tr>
    This will create the basic separation so there is room for an sponsor link. There are many ways to add a sponsor link to each category. One way is to define the links in your phpinclude_start template.

    The $forum[forumid] variable in the forumhome_forumbit_level1_nopost template parses into the forumid of the category, so it can be used in the templates as an index into an array that contains your sponsor links.

    Go to your:

    Admin CP -> Styles & Templates -> Style Manager -> -> PHP Include Code Templates -> phpinclude_start

    Add this code to that template:

    Code:
    $sponsor[1] = 'Sponsored by <a href="LINK" target="_blank"><img src="sponsor1.gif" alt="" border="0" /></a>';
    Change the red code appropriately, where the number inside brackets is the forumid of the category to which this sponsor link belongs. If you have more categories with sponsors, simply add more instances of the above code.

    Then go back to your forumhome_forumbit_level1_nopost template. Add the blue code in the sponsor link space:

    Code:
    	<tr>
    		<td class="tcat" colspan="2">
    			<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumbit_$forumid')"><img id="collapseimg_forumbit_$forumid" src="$stylevar[imgdir_button]/collapse_tcat{$collapseimg_forumid}.gif" alt="" border="0" /></a>
    			<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">$forum[title]</a>
    			<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
    			<if condition="$show['subforums']"><div class="smallfont"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
    		</td>
    		<td class="tcat" align="right" colspan="<if condition="$vboptions[showmoderatorcolumn]">4<else />3</if>">
    			{$GLOBALS[sponsor][$forum[forumid]]}
    		</td>
    	</tr>
    Now the categories for which sponsor links are defined in the phpinclude_start template will display their respective links.

    edit: changed phpinclude_start code to use single quotes to enclose the string, so you don't have to escape the double quotes.
    Attached Files
    Last edited by Jake Bunce; Mon 14th Feb '05, 12:55am.
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X