TinyPortal
Development => Support => Topic started by: Heero on September 30, 2011, 09:56:22 PM
Hello,
I was just wondering..
Using the premade php code for showing recent topics is not working?
Whenever I want to insert it and overwriting, it return this code:
global $context, $modSettings;
$context[\'TPortal\'][\'recentboxnum\'] = \'15\';
if(isset($modSettings[\'recycle_board\']))
$bb = $modSettings[\'recycle_board\'];
$what = ssi_recentTopics($context[\'TPortal\'][\'recentboxnum\'], NULL, NULL, \'array\');
$counter=1;
$cmax = count($what);
echo \'
<div style=\"width: 100%; overflow: auto; height: 30ex;\">\';
foreach($what as $w)
{
echo \'
<div class=\"smalltext\"><a href=\"\'.$w[\'href\'].\'\">\' . $w[\'short_subject\'] . \'</a></div>
<div class=\"smalltext\">\', $txt[\'by\'], \' <b>\', $w[\'poster\'][\'link\'], \'</b></div>
<div class=\"smalltext\">\';
if(!$w[\'new\'])
echo \'<a href=\"\'.$w[\'href\'].\'\"><img border=\"0\" src=\"\'.$settings[\'images_url\'].\'/\'.$context[\'user\'][\'language\'].\'/new.gif\" alt=\"new\" /></a> \';
echo \'[\'.$w[\'time\'].\']
</div>\';
if($counter != $cmax)
echo \'<hr />\';
$counter++;
}
echo \'
</div>\';
When I remove all of the "\", it still bugs (it is a bug?).
I'd like to have a block with the latest recent topics. The ones I am using are not working.
The one used here, is it available somewhere?
Thanks in advance!
Note: Latest version of TP, used on SMF 2.0.1.
The on used here is a built in block. You don't need to add any code, just select the recent topics block type.
Why does your code have all the extra back slashes?
Oh Thanks IchBin, I didn't noticed it was the same.
And like I said, those extra back slashes are automatically added whenever I use the premade php code for showing recent topics.
Not certain why this happens.