TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,167
  • Total Topics: 21,346
  • Online today: 518
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 96
  • Total: 97
  • @rjen

Recent Topics not working?

Started by Heero, September 30, 2011, 09:56:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Heero

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.

IchBin

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?

Heero

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.

This website is proudly hosted on Crocweb Cloud Website Hosting.