(2009-04-15, 08:49 AM)Dennis Tsang Wrote: [ -> ]I'm confused. PHP doesn't work in templates, and so I'm not sure where you want to put the above code, much less understand what you're trying to do with the code
ok, I explain my problem:
In my "forumbit_depth2_forum" i added a forum icon near the forum name and description, like this:
but i added also a link on icon searching:
<td class="{$bgcolor}" valign="top">
<strong>
<a href="{$forum_url}">
{$forum['name']}
</a>
</strong>
{$forum_viewers_text}
<div class="smalltext">
{$forum['description']}
{$modlist}
{$subforums}
</div>
</td>
and replacing with:
<td class="{$bgcolor}" valign="top">
<a href="{$forum_url}">
<img src="{$theme['imgdir']}/icon_{$forum['fid']}.gif" align="left">
</a>
<strong>
<a href="{$forum_url}">{$forum['name']}
</a>
</strong>
{$forum_viewers_text}
<div class="smalltext">
{$forum['description']}
{$modlist}
{$subforums}
</div>
</td>
well, now, i want to give to some icons another link (cause my mybb redirect on forum can't works) and i tried to use that code:
i created a new template called icon, and after i wrote that code inside:
$forumicon = {$theme['imgdir']}/icons/icon_{$forum['fid']}.png;
$forumiconurl = {$forum_url};
<a href="{$forumiconurl}"><img src="{$forumicon}" align="left" title="{$forum['name']}"></a>
if ($forumiconurl = {$theme['imgdir']}/icons/icon_71.png){
$forumiconurl = redirectlink;
}
and after i tried to install the php template mod (link over this post) using that:
<?php $immaginetarghetta = {$theme['imgdir']}/targhettesezioni/icon_{$forum['fid']}.png; ?>
<?php $forumurltarghetta = {$theme['imgdir']}/targhettesezioni/icon_{$forum['fid']}.png; ?>
<div class="iconeblink"><a href="{$$forumurltarghetta}"><img src="{$immaginetarghetta}" align="left" title="{$forum['name']}"></a></div>
<?php if ($immaginetarghetta = {$theme['imgdir']}/targhettesezioni/icon_71.png){ ?>
$forumurltarghetta = redirectlink;
<?php } ?>
In practice i want to replace this code in "forumbit_depth2_forum"
<td class="{$bgcolor}" valign="top">
<a href="{$forum_url}">
<img src="{$theme['imgdir']}/icon_{$forum['fid']}.gif" align="left">
</a>
<strong>
<a href="{$forum_url}">{$forum['name']}
</a>
</strong>
{$forum_viewers_text}
<div class="smalltext">
{$forum['description']}
{$modlist}
{$subforums}
</div>
</td>
with this, calling the template
<td class="{$bgcolor}" valign="top">
{$icon}
<strong>
<a href="{$forum_url}">{$forum['name']}
</a>
</strong>
{$forum_viewers_text}
<div class="smalltext">
{$forum['description']}
{$modlist}
{$subforums}
</div>
</td>
did you understand now?
can anyone help me?
(sorry for not perfect english)