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

Recent

Welcome to TinyPortal. Please login or sign up.

April 19, 2024, 07:48:12 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 266
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 125
  • Total: 126
  • @rjen

"recent topics" in SMF style

Started by Lesmond, August 17, 2005, 12:01:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jacortina

Quote from: Bloc on November 25, 2006, 10:45:28 PM
Uhm..I am gonna let J.A.Cortina answer that...but it might be some shared setting that does this.

I'm quite confused on what version of the code is being used.

None of the iterations of the code I've posted use the SSI functions at all, though it DOES use the forum's 'Recent Post' number as the default count to display.

bloc

I think thats the issue...that he sets that to a high number and of course it will then also show that in Info center.

hartiberlin

Quote from: J.A.Cortina on November 25, 2006, 10:49:48 PM
Quote from: Bloc on November 25, 2006, 10:45:28 PM
Uhm..I am gonna let J.A.Cortina answer that...but it might be some shared setting that does this.

None of the iterations of the code I've posted use the SSI functions at all, though it DOES use the forum's 'Recent Post' number as the default count to display.

Well, yes, that is the issue.

How can I set it differently from the Info Center that means
from the setting from the admin panel ?

Maybe I can it set it directly somehow in the code ?

I want in the Info Center only about 10 recent posts and
on the Front page about 100 to 200 recent postings.

Many thanks.

jacortina

And you said you were using code which called the SSI function.

Quote from: hartiberlin on November 25, 2006, 08:19:36 PM
$what=ssi_recentTopics('99', NULL, 'array');

As mentioned, none of the code I posted uses that. It quite specifically builds the topic array iteself and NOT by calling any SSI function.

Therefore, I'm not familiar with the code you are using.

If you were using the code I posted in http://www.tinyportal.net/smf/index.php?topic=596.msg75309#msg75309 , it would depend on how you were using it. In an article, you could include the "count=XX" in the calling URL. If using in a block, you'd supply the proper 'Limit clause' as is documented in the code block itself.

pvcblue

ok I am using this code -


global $scripturl;

echo '
                        <table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
                               <tr><td colspan="3" class="titlebg">Recent topics</td></tr> ';
       $what=ssi_recentTopics('10', NULL, 'array');


        foreach ($what as $topic)
        {
                echo '
                                <tr>
                                        <td class="windowbg" valign="middle">
                                                ', $topic['link'];

                // Is this topic new? (assuming they are logged in!)
                if (!$topic['new'] && $context['user']['is_logged'])
                        echo '
                                                <a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';

                echo '
                                        </td>
                                        <td class="windowbg2" valign="middle" width="20%">
                                                ', $topic['poster']['link'], '
                                        </td>
                                        <td class="windowbg2" valign="middle" width="35%">';
                if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
                        echo '
                                        <a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" border="0" style="float: right;" /></a>';
                echo '
                                                <span class="smalltext">
                                                        ', $topic['time'], '
                                                </span>
                                        </td>
                                </tr>';
        }

        echo '
                        </table>';


now the problem is - it does not mark the post/topic read. It does on the tP front page in the recent block, but not when you go back to the forum page, you see a page full of new image indicators! How do you fix this??????????

pvcblue

Quote from: pvcblue on November 26, 2006, 05:18:46 AM
ok I am using this code -


global $scripturl;

echo '
                        <table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
                               <tr><td colspan="3" class="titlebg">Recent topics</td></tr> ';
       $what=ssi_recentTopics('10', NULL, 'array');


        foreach ($what as $topic)
        {
                echo '
                                <tr>
                                        <td class="windowbg" valign="middle">
                                                ', $topic['link'];

                // Is this topic new? (assuming they are logged in!)
                if (!$topic['new'] && $context['user']['is_logged'])
                        echo '
                                                <a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';

                echo '
                                        </td>
                                        <td class="windowbg2" valign="middle" width="20%">
                                                ', $topic['poster']['link'], '
                                        </td>
                                        <td class="windowbg2" valign="middle" width="35%">';
                if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
                        echo '
                                        <a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" border="0" style="float: right;" /></a>';
                echo '
                                                <span class="smalltext">
                                                        ', $topic['time'], '
                                                </span>
                                        </td>
                                </tr>';
        }

        echo '
                        </table>';


now the problem is - it does not mark the post/topic read. It does on the tP front page in the recent block, but not when you go back to the forum page, you see a page full of new image indicators! How do you fix this??????????

NoOne can or knows how to fix this?

jacortina

This piece seems to put out the 'new' image for topics which AREN'T new???

                // Is this topic new? (assuming they are logged in!)
                if (!$topic['new'] && $context['user']['is_logged'])


Does changing it to this help?
                // Is this topic new? (assuming they are logged in!)
                if ($topic['new'] && $context['user']['is_logged'])


pvcblue

#197
Quote from: J.A.Cortina on November 26, 2006, 10:34:38 PM
This piece seems to put out the 'new' image for topics which AREN'T new???

Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  // Is this topic new? (assuming they are logged in!)
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  if (!$topic['new'] && $context['user']['is_logged'])


Does changing it to this help?
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  // Is this topic new? (assuming they are logged in!)
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  if ($topic['new'] && $context['user']['is_logged'])



The problem is not with the block itself perse J.A. . The block "new" image dissapears after it has been read, the new image on the forum itself does not change to the read image, you have to go back to the forum itself and "mark all as read" to get the images to switch.

hartiberlin

Hello,
thanks for all the updates,
but I know have an urgent problem with my hoster.

It says:
There has been a problem with the database!
MySQL reported:
User "hartiberlin" has exceeded the 'max_questions' resource (current value: 70000)

This is a notice email to let you know that SMF could not connect to the database, contact your host if this continues.


Does this Recent Topic use so many queries to the database ?

It seems, my just 39 onliline users at the moment generate
more than 70.000 queries in ONE HOUR ?!

Could this be, or is someone trying to download the whole
forum with a tool or is Google spidering the whole website ?

Techdomain

wow! that sounds like a whole new topic to me!