PDA

View Full Version : images on category


bentong
04-29-2006, 02:52 PM
I tried searching the forum for thread on how to add images on category but still got no luck.

can someone direct me on the thread. :)

thanks in advance.

Neticus
04-29-2006, 03:43 PM
This question was asked in the supporters forum a while back.

You can try this, haven't tried it myself however you can see what was accomplished (http://www.bigvertiser.com/)

Content visible to registered users only.

Main.tpl

Content visible to registered users only.

.

bentong
04-30-2006, 06:48 PM
thank you for the resource. :)

fworth
05-02-2006, 06:04 PM
Content visible to registered users only.

Main.tpl

Content visible to registered users only.

.[/quote]



Could you insert the code where it belong and i can copy and upload it.....


{* Calculate title from path *}
{capture name="title"}
{if count($path)>1} - {/if}
{foreach from=$path item=category name=path}
{if $smarty.foreach.path.iteration gt 2}
>
{/if}
{if not $smarty.foreach.path.first}
{$category.TITLE}
{/if}
{/foreach}
{/capture}
{strip}
{assign var="in_page_title" value=$category.TITLE}
{assign var="description" value=$category.DESCRIPTION}
{include file="header.tpl"}

{include file="top_bar.tpl"}

<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="17" class="l-rep"></td>
<td>






{* Calculate the number of categories per row *}
{php}
$this->assign('cats_per_col', ceil(count($this->get_template_vars('categs'))/ CATS_PER_ROW)); {/php} {* Display categories heading if not on homepage *} {if $category.ID gt 0 and count($categs) gt 0}


<h3>{l}Categories{/l}</h3>{/if}

{* Categories *}




<table border="0" cellpadding="0" cellspacing="2"><tr>
{foreach from=$categs item=cat name=categs}
{if ($smarty.foreach.categs.iteration mod $cats_per_col eq 1 and $cats_per_col gt 1) or $smarty.foreach.categs.first}<td valign="top"><ul>{/if}
<h1>{$cat.TITLE} ({if $smarty.const.ENABLE_REWRITE}{$cat.TITLE_URL}/{else}index.php?c={$cat.ID}{/if}){if $smarty.const.CATS_COUNT} <span class="count">({$cat.COUNT})</span>{/if}</h1>

{* Display subcategories *}

{if $cat.SUBCATS}
{foreach from=$cat.SUBCATS item=scat name=scategs}
<a href="{if $smarty.const.ENABLE_REWRITE}{$cat.TITLE_URL}/{$scat.TITLE_URL}/{else}index.php?c={$scat.ID}{/if}">
{$scat.TITLE}</a>, {/foreach} ...

{/if}


{if ($smarty.foreach.categs.iteration mod $cats_per_col eq 0 and $cats_per_col gt 1) or $smarty.foreach.categs.last}[/list]</td>{/if}
{/foreach}
</tr></table>
{if $smarty.const.FTR_ENABLE==1 and count($feat_links) gt 0}

<h2>{l}Featured Links{/l} </h2>


{foreach from=$feat_links item=link name=links} {include file="link.tpl" link=$link} {/foreach} {/if}

{if $category.ID gt 0 or $qu}
{include file="googlead.tpl"}
{/if}


{* Links heading and sorting*} {if ($qu or $category.ID gt 0 or $p) and count($links) gt 0}

<h2>{l}Standard Listings{/l}{if not $p}<span class="small" style="margin-left: 50px">{l}Sort by{/l}:
{if $smarty.const.ENABLE_PAGERANK and $smarty.const.SHOW_PAGERANK}{if $sort eq 'P'}<span class="sort"> {l}PageRank{/l}</span>{else} {l}PageRank{/l} (?s=P{if not $smarty.const.ENABLE_REWRITE}&c={$category.ID}{/if}{if $qu}&q={$qu}{/if}){/if} |{/if}
{if $sort eq 'H'} <span class="sort">{l}Hits{/l}</span>{else} {l}Hits{/l} (?s=H{if not $smarty.const.ENABLE_REWRITE}&c={$category.ID}{/if}{if $qu}&q={$qu}{/if}){/if}
{if $sort eq 'A'} | <span class="sort">{l}Alphabetical{/l}</span>{else} | {l}Alphabetical{/l} (?s=A{if not $smarty.const.ENABLE_REWRITE}&c={$category.ID}{/if}{if $qu}&q={$qu}{/if}){/if}
</span>{/if}</h2>
<div id="links">








{foreach from=$links item=link name=links}
{include file="link.tpl" link=$link}
{/foreach}
</div>
{/if}

{* Javascript for tracking link clicks *}
<script type="text/javascript">
var root = '{$smarty.const.DOC_ROOT}';
{literal}
var a = document.getElementsByTagName("a");
for(i=0; i<a.length; i++)if(a[i].id != '')
a[i].onclick = count_link;
function count_link(){
i = new Image();
i.src= root+'/cl.php?id='+this.id;
return true;
}
{/literal}
</script></td>
<td width="17" align="right" class="r-rep"></td>
</tr>
</table>










{include file="footer.tpl"}
{/strip}

KoverPL
11-19-2006, 05:42 PM
where to add the code of 2nd post ? thx.
does it work in 3.0.6 ?