collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 256
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Thanks for having an interest with our portal. If you have any requests for features, have a look at the Feature Requests board.

Author Topic: number of recent topics decreasing  (Read 4065 times)

0 Members and 1 Guest are viewing this topic.

Offline LP

  • Semi Newbie
  • *
  • Posts: 23
  • SMF Version: 2 RC1.2
  • SP Version: 2.3.1
number of recent topics decreasing
« on: December 15, 2009, 05:57:09 PM »
Hello,

I am using SP 2.3.1 with SMF 2 RC1.2.

I use a "Recent Topics" block on my forum. I have noticed that when one topic is a "hot" topic and gets many posts in a short period of time, the number of topics shown in the Recent Topics block starts decreasing.

I run a sports forum and when there is a big game happening, there are many users posting in the current game topic.  By the time the game is halfway over, the game topic is the only topic (maybe one or two more) listed in the Recent Topics block, even though it has its properties set to include the 30 most recent topics.  I have also seen the number of topic decrease if a lot of topics have been created and then deleted (for instance, when testing a feedbot and deleting the topics it creates).

Do you have any suggestions for me as to how I might fix this issue so that there are always the correct number of topics shown in the block?

Thanks!
LP

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: number of recent topics decreasing
« Reply #1 on: December 15, 2009, 07:02:21 PM »
I have been unable to replicate that issue with SMF 2 RC1.2 and SP 2.3.1, although I would recommend that you upgrade to SMF 2 RC2.

Could you please post a link to your website? (you can send it to me via PM if you don't want to publically post it.)
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline LP

  • Semi Newbie
  • *
  • Posts: 23
  • SMF Version: 2 RC1.2
  • SP Version: 2.3.1
Re: number of recent topics decreasing
« Reply #2 on: December 16, 2009, 12:57:27 AM »
I would send you a PM, but I am apparently not allowed to send PMs.  Maybe I will reach the limit with this post or the next.

I will at some point upgrade to SMF 2 RC2.  Unfortunately it is not a simple upgrade and will cost me a good bit of time to make sure my numerous customizations are successfully transferred.  I am actually considering waiting until the official release of SMF 2 to do any further upgrades.

Offline LP

  • Semi Newbie
  • *
  • Posts: 23
  • SMF Version: 2 RC1.2
  • SP Version: 2.3.1
Re: number of recent topics decreasing
« Reply #3 on: December 16, 2009, 01:03:16 AM »
Nope, 10 posts does not appear to be enough.

Offline LP

  • Semi Newbie
  • *
  • Posts: 23
  • SMF Version: 2 RC1.2
  • SP Version: 2.3.1
Re: number of recent topics decreasing
« Reply #4 on: December 16, 2009, 01:11:33 AM »
I am less concerned about the deleted topics issue than the "hot" topics issue.  Please keep in  mind that I am using a "Recent Posts/Topics" block using the options "Display: Topics" and "Display type: Compact".

Offline LP

  • Semi Newbie
  • *
  • Posts: 23
  • SMF Version: 2 RC1.2
  • SP Version: 2.3.1
Re: number of recent topics decreasing
« Reply #5 on: December 17, 2009, 12:58:33 PM »
Well, I sent a PM but it does not show in my "Sent Items" area, so I am not sure if it was actually sent or not.  Please let me know if you did not receive a PM from me Nathaniel.

Thanks.

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: number of recent topics decreasing
« Reply #6 on: December 17, 2009, 07:36:29 PM »
I received the PM, although as you say, the issue doesn't appear on your site at the moment.

Do you have any mods that edit the SSI.php files functions? SimplePortal uses the SSI.php functions to pull the data for the topics for that block, any edits could be causing this issue.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline LP

  • Semi Newbie
  • *
  • Posts: 23
  • SMF Version: 2 RC1.2
  • SP Version: 2.3.1
Re: number of recent topics decreasing
« Reply #7 on: December 17, 2009, 09:08:30 PM »
I received the PM, although as you say, the issue doesn't appear on your site at the moment.

Do you have any mods that edit the SSI.php files functions? SimplePortal uses the SSI.php functions to pull the data for the topics for that block, any edits could be causing this issue.

I am not aware of any that might edit the SSI.php file.  I'll compare a SSI file from a new install to my SSI file and see if there are any differences.

Offline LP

  • Semi Newbie
  • *
  • Posts: 23
  • SMF Version: 2 RC1.2
  • SP Version: 2.3.1
Re: number of recent topics decreasing
« Reply #8 on: December 20, 2009, 01:01:20 AM »
OK, there are some additions to SSI.php, functions added at the end.  I can't see any way they would affect the recent topics block.  The functions are: ssi_chatOnline, ssi_customPage, and ssi_recentPages.  I'll add that code at the end of this post.

Other than that, the only modifications to SSI.php are those made by SP:
Code: [Select]
require_once($sourcedir . '/Subs-Portal.php'); and
Code: [Select]
// Load some SP stuff.
sportal_init();

The problem occurred again today, there was a game this afternoon and another event of interest this evening.  When the game thread this afternoon reached about 100 posts or so the number of recent topics started shrinking.  By the end of the game the number of topics displayed was 14, while the setting was still 32.


Here are the other additions to SSI.php:
Code: [Select]
function ssi_chatOnline($output_method = 'echo')
{
global $smcFunc, $scripturl, $txt;

$users = array();
$userIDs = chatOnlineUsers();
$users['links'] = array();
if (count($userIDs) > 0){
if (count($userIDs) == 1){
$result = $smcFunc['db_query']('', '
    SELECT mem.ID_MEMBER, mem.real_name, mem.ID_GROUP, mg.online_color, mg.ID_GROUP
FROM {db_prefix}members AS mem
LEFT JOIN {db_prefix}membergroups AS mg ON
(mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP)) WHERE mem.ID_MEMBER = {int:the_id}' ,
  array(
      'the_id' => $userIDs[0],
    )
  );
}else{
$result = $smcFunc['db_query']('', '
    SELECT mem.ID_MEMBER, mem.real_name, mem.ID_GROUP, mg.online_color, mg.ID_GROUP
FROM {db_prefix}members AS mem
LEFT JOIN {db_prefix}membergroups AS mg ON
(mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP)) WHERE mem.ID_MEMBER IN ({array_int:the_ids})',
    array(
      'the_ids' => $userIDs,
  )
  );
}
while ($row =$smcFunc['db_fetch_assoc']($result))
{
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'];
if($row['online_color'] != ""){
$link.= '" style="color: ' . $row['online_color'];
}
$link.= '">' . $row['real_name'] . '</a>';
    array_push($users['links'], $link);
}
$smcFunc['db_free_result']($result);
}
if ($output_method != 'echo')
return $users;
else{
if (count($users['links']) == 0 )
  echo $txt['chat_no_user'];
elseif (count($users['links']) == 1 )
  echo '1' . $txt['chat_aUser']. ':<br />', implode($users['links']);
else
  echo count($users['links']). $txt['chat_users']. ':<br />', implode(', ', $users['links']);
}
}


// Show a Custom Page outside of the forum.
function ssi_customPage($id, $output_method = 'echo')
{
    global $sourcedir, $context, $txt;
   
    // Require the Custom Pages file that contains the function we need.
    require_once($sourcedir . '/Subs-CustomPages.php');
   
    // Load the page.
    $page = loadPage($id);
   
    // If $page returned false then the page doesn't exist.
    if($page === false)
        $page = array(
            'id' => 'error',
            'title' => $txt['cp_error'],
            'body' => $context['user']['is_admin'] ? $txt['cp_error3'] : $txt['cp_error2'],
            'perms' => 'everybody',
            'views' => false,
        );
    // If they are not aloud to view the page then make a new array with data telling them that.
    elseif(!allowedToViewPage($page['perms']))
        $page = array(
            'id' => 'denied',
            'title' => $txt['cp_denied'],
            'body' => $txt['cp_denied2'],
            'perms' => 'everybody',
            'views' => false,
        );
    // Otherwise parse any bbc.
    elseif($page['code'] == 'bbcode')
        $page['body'] = parse_bbc($page['body'], 1, $page['id']);
       
    // Are we printing this?
    if($output_method == 'echo')
        echo '
        <table class="ssi_table" width="100%" border="0">
            <tr><td width="100%"><b>', $page['title'], '</b>', $page['views'] === false ? '' : '<span class="smalltext" style="padding-left: 8px;">(' . sprintf($txt['cp_viewed'], $page['views']) . ')</span>', '</tr>
            <tr><td>', $page['body'], '</td></tr>
        </table>';
    // Otherwise return the array.
    else
        return $page;
}

// Show recently added pages
function ssi_recentPages($limit = 5, $output_method = 'echo')
{
    global $context, $txt, $smcFunc, $scripturl, $sourcedir;
   
    // Require the Custom Pages file that contains the functions we need.
    require_once($sourcedir . '/Subs-CustomPages.php');
   
    // Grab all the pages
    $request = $smcFunc['db_query']('', '
        SELECT id_page, page_title, page_body, page_perms, page_views, page_format, page_time
        FROM {db_prefix}pages
        ORDER BY page_time DESC',
        array()
    );
   
    // Now start looping through everything
    $i = 0;
    $ret = array();
    while($page = $smcFunc['db_fetch_assoc']($request))
    {
        // Are we aloud to view this page?
        if(allowedToViewPage($page['page_perms']))
        {
            // Add the page to the array
            $ret[] = array(
                'id' => $page['id_page'],
                'title' => $page['page_title'],
                'body' => $page['page_body'],
                'perms' => $page['page_perms'],
                'views' => $page['page_views'],
                'format' => $page['page_format'],
                'time_created' => $page['page_time'],
            );
            $i++;
        }
       
        // Limit the number we show
        if($i >= $limit) break;
    }
   
    $smcFunc['db_free_result']($request);
   
    // Echoing it?
    if($output_method == 'echo')
    {
        echo '
            <table class="ssi_table">
                <tr>
                    <th align="left">', $txt['cp_page'], '</th>
                    <th align="left">', $txt['cp_views'], '</th>
                </tr>';
               
        if(count($ret))
            foreach($ret as $page)
                echo '
                    <tr>
                        <td><a href="', $scripturl, '?action=page;sa=', $page['id'], '">', $page['title'], '</a></td>
                        <td align="right">', $page['views'], '</td>
                    </tr>';
        else
            echo '
                    <tr><td colspan="2">', $txt['cp_no_pages'], '</td></tr>';
        echo '
            </table>';
    }
    else
        return $ret;
}

Offline LP

  • Semi Newbie
  • *
  • Posts: 23
  • SMF Version: 2 RC1.2
  • SP Version: 2.3.1
Re: number of recent topics decreasing
« Reply #9 on: December 24, 2009, 04:35:11 PM »
I have been able to reproduce this on a test site.  I posted 30 new topics and then set the number of recent topics to show in the "recent topics" block at 30.  So topics 1-30 were all showing in the block.

I then started replying to topic #30 repeatedly.  When I posted reply #146 topics began disappearing from the bottom of the list at the rate of 1 topic per post.  So now after 166 replies to the same thread, the number of topics displayed is down to 10.

Nathaniel, I will pm you a link to my test forum so you can see what is happening.

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: number of recent topics decreasing
« Reply #10 on: January 12, 2010, 08:24:26 PM »
After some testing of my own, I can confirm that this issue does occur. It would appear to be an issue with SMF code for the 'ssi_recentTopics' function. Essentially, that SMF function will only check the last 175 posts to see if they should be listed. You can override that functionality with the edit below.

Code: ("Find (SSI.php)") [Select]
WHERE t.id_last_msg >= {int:min_message_id}
Code: ("Replace") [Select]
WHERE 1=1
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline LP

  • Semi Newbie
  • *
  • Posts: 23
  • SMF Version: 2 RC1.2
  • SP Version: 2.3.1
Re: number of recent topics decreasing
« Reply #11 on: January 14, 2010, 12:30:49 AM »
Thank you for the help, Nathaniel, I appreciate it very much.  The change has been effective.

I wonder, though, if it will have a negative impact on forum performance to be considering all posts instead of the most recent 175.  Maybe there is a way that I can adjust the number of posts to be considered instead of just opening it up to all posts?  Maybe the effect will be negligible, I'm not sure.

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: number of recent topics decreasing
« Reply #12 on: January 14, 2010, 07:07:57 AM »
Well, SMF does it for a reason, to avoid looking through large numbers of messages.

Try a higher number, like this:
Code: ("Replace") [Select]
WHERE t.id_last_msg >= 500
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline LP

  • Semi Newbie
  • *
  • Posts: 23
  • SMF Version: 2 RC1.2
  • SP Version: 2.3.1
Re: number of recent topics decreasing
« Reply #13 on: January 14, 2010, 10:55:23 AM »
Well, SMF does it for a reason, to avoid looking through large numbers of messages.

Try a higher number, like this:
Code: ("Replace") [Select]
WHERE t.id_last_msg >= 500

That doesn't seem to work.  The number used should be a message ID (id_msg from "messages" table), so this essentially limits the messages to those that have an id_msg > 500 (~500,000 messages on my site).  On my test site, this results in no messages being displayed at all as there are less than 500 messages total.

I changed mine to this and it seems to work:
Code: ("Replace") [Select]
WHERE t.id_last_msg >= ({int:min_message_id} - 500)
Thanks for your help!
 :applause:

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: number of recent topics decreasing
« Reply #14 on: January 14, 2010, 07:59:11 PM »
Oh, whoops. Glad that you got it working. :)
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline Afro

  • Semi Newbie
  • *
  • Posts: 37
    • The African Forum
  • SMF Version: 2.0.11
  • SP Version: 2.3.2
Re: number of recent topics decreasing
« Reply #15 on: June 29, 2010, 05:17:41 PM »
Helpful tip