vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Latest Threads On Forum Home (https://vborg.vbsupport.ru/showthread.php?t=83230)

Bytecon 10-08-2005 07:13 PM

Thank you

*installed*

ScooterQ 10-09-2005 04:37 PM

Is anyone else seeing a problem with new post icons? I'm seeing posts marked as new in the latest threads display, but if I click on "new posts" it says "Sorry, there are no new threads to view." That is correct - the new post icon in latest threads is wrong for me. Thus far the only way I've found to clear the new posts icon is to mark my forums read.

For example, I can log in as a test user and see 10 threads as unread using "new posts". If I click on a thread title it takes me to the thread. If I click on "new posts" again the thread is no longer listed, but if I go to my forum home the thread is still showing up as unread in the latest threads block. I'm using the database with automatic thread marking to track unread items.

I'm guessing that I need to modify the SQL to look at the threadread table for each post and add it to the show goto new post section (listed below).

Code:

        // show goto new post
        $show['firstnew'] = false;
        $bbforumview = fetch_bbarray_cookie('forum_view', $thread['forumid']);

        if ($bbforumview > $vbulletin->userinfo['lastvisit']) {
                $lastread = $bbforumview;
        } else {
                $lastread = $vbulletin->userinfo['lastvisit'];
        }

        if ($thread['lastpost'] > $lastread) {

                $threadview = fetch_bbarray_cookie('thread_lastview', $thread['threadid']);

                if ($thread['lastpost'] > $threadview) {
                        $show['firstnew'] = true;
                        $show['icon'] = false;
                }
        }

Am I alone here? If so, I'll just quietly go fix my problem on my forum, but if not I'd like to solve this for all of us, not just me.

ScooterQ 10-09-2005 05:30 PM

I've pretty much figured out that the problem I'm seeing has to do with the forum_view cookie not being set, thus causing my unread status to fall back to using lastvisit instead. The forum_view cookie is only set in two places in all of the VB3.5 code and in both cases it's only set if you **are not** using threadmarking.

function_bigthree.php
Code:

        if ($vbulletin->options['threadmarking'] AND $userid)
        {

                $db->query_write("
                        REPLACE INTO " . TABLE_PREFIX . "forumread
                                (forumid, userid, readtime)
                        VALUES
                                ($foruminfo[forumid], $userid, $time)
                ");

                if (!$check_parents)
                {
                        return;
                }

                // check to see if any parent forums should be marked as read as well
                $parents = array();
                $parents_sql = $db->query_read("
                        SELECT forum.forumid
                        FROM " . TABLE_PREFIX . "forum AS forum
                        LEFT JOIN " . TABLE_PREFIX . "forumread AS forumread ON (forum.forumid = forumread.forumid AND forumread.userid = $userid)
                        WHERE forum.forumid IN ($foruminfo[parentlist])
                                AND forum.forumid NOT IN ($foruminfo[forumid], -1)
                                AND (forum.lastpost = 0 OR
                                        IF(forumread.readtime IS NULL, " . (TIMENOW - ($vbulletin->options['markinglimit'] * 86400)) . ", forumread.readtime) > forum.lastpost
                                )
                ");
                while ($parent = $db->fetch_array($parents_sql))
                {
                        $parents[] = "($parent[forumid], $userid, $time)";
                }

                if ($parents)
                {
                        $db->query_write("
                                REPLACE INTO " . TABLE_PREFIX . "forumread
                                        (forumid, userid, readtime)
                                VALUES
                                        " . implode(', ', $parents)
                        );
                }
        }
        else
        {
                set_bbarray_cookie('forum_view', $foruminfo['forumid'], $time);

        }

So it looks like I may just have to modify the getthreads query for this plugin.

Basit 10-09-2005 05:39 PM

Does this work with 3.5.0 Gold ?

Mr Chad 10-09-2005 05:50 PM

Quote:

Originally Posted by Basit
Does this work with 3.5.0 Gold ?

doesnt look like it.

Chris M 10-09-2005 06:45 PM

It should do, but it's untested on my end - I haven't had time to install 3.5 Gold yet :)

Chris

albarq 10-10-2005 09:45 AM

ya it does work :)

thetoolman 10-13-2005 11:13 AM

will this hack work if i put it in the header or footer?

Chris M 10-13-2005 11:57 AM

You will need to make it a global plugin location not a forumhome location ;)

Chris

Vierie 10-13-2005 12:13 PM

And how would I do that?


All times are GMT. The time now is 01:42 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01463 seconds
  • Memory Usage 1,749KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete