News:

Wondering if this will always be free?  See why free is better.

Main Menu

showing latest post link in key stats box

Started by meraj, November 25, 2004, 04:56:06 PM

Previous topic - Next topic

meraj

hi,

i have been tweaking and customizing my theme for smf... heres what i have so far:

http://www.uabmsa.org/forum [nofollow]

my question is... if you look in the stats box at the top right, i added a "latest post" link... i achieved it by modyfing this code in index.template.php:

// The "key stats" box.
echo '
<td width="262" style="padding-left: 5px;" valign="top">
<div class="headertitles" style="width: 260px;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="width: 260px; position: relative; background-image: url(', $settings['images_url'], '/box_bg.gif);">
<img src="', $settings['images_url'], '/', $context['user']['language'], '/keystats.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
<div style="height: 64px; padding: 5px;" class="smalltext">
<b>', $modSettings['totalMessages'], '</b> ', $txt[95], ' ', $txt['smf88'], ' <b>', $modSettings['totalTopics'], '</b> ', $txt[64], ' ', $txt[525], ' <b>', $modSettings['memberCount'], '</b> ',  $txt[19], '<br />
' . $txt[659] . ': &quot;' . $context['latest_post']['link'] . '&quot;<br />
', $txt[656], ': <b> <a href="', $scripturl, '?action=profile;u=', $modSettings['latestMember'], '">', $modSettings['latestRealName'], '</a></b>
</div>
</div>';

echo '
</td>


it works fine on the front page of the forum.. but any other page of the forum, the link wont show... how can i fix this so it shows up on every page of the forum?

A.M.A

in index.template.php look for:
function template_init()
{
global $context, $settings, $options, $txt;

add after:
require_once('Recent.php');
$context['latest_post'] = getLastPost();
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

Advertisement: