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?

Xplorer4x4 10-13-2005 01:23 PM

In the admin CP, go to your plug in manager. Find the two plug ins called latest threads on forum home. There will be two drop down menus. One says title and the one below says Hook Location. Open the drop down menu and search for "forumhome"

Chris, again, is there a way to make the forum show up in the latest thread tbale?

Vierie 10-13-2005 01:46 PM

If I do that, I get :

Quote:

Fatal error: Call to undefined function: fetch_iconinfo() in /home/www/web1/html/politikpla.net/forum/global.php(349) : eval()'d code on line 48
How do I resolve that?

twitch 10-13-2005 04:28 PM

how do I "Create a GLOBAL phrase called latest_threads"

nevermind, I found it.

thetoolman 10-17-2005 07:02 PM

Hi
Is there a way i can display the latest threads on one line instead of a new line for each thread?

albarq 10-18-2005 07:16 PM

Chris M ,

Is this hack work with forumpermission[canviewothers] ?

i am using this hack since you have released but it isnt working fine with this permission.

Xplorer4x4 10-20-2005 07:16 AM

Chris, sorry to make this repetive posts but it would be a huge help if you could tell me how to print the forum names?

Vierie 10-22-2005 04:06 PM

If somebody wants to use that on a different page than forumhome, you have to add require_once('./includes/functions_forumlist.php'); to the php code of the xml and change the hook to global_start.

VaaKo 10-22-2005 10:38 PM

I'm facing this annoying problem
the post icon isn't showing, it's giving me an X, when I right click it gives me this address:
http://www.lebforces.org/forum/http:...cons/icon1.gif

I tried to fix it from the post icons admincp but didn't work
it's showing me the X when there are no replies on the topic!
any suggestions?

Chris M 10-23-2005 12:18 AM

Open the [high]forumhome_latestthreadbit[/high] template:
Change:
HTML Code:

<img src="$vboptions[bburl]/$thread[threadiconpath]" border="0" alt="$thread[threadicontitle]" title="$thread[threadicontitle]" style="vertical-align: text-middle" />
to:
HTML Code:

<img src="$thread[threadiconpath]" border="0" alt="$thread[threadicontitle]" title="$thread[threadicontitle]" style="vertical-align: text-middle" />
That should work :)

Chris

VaaKo 10-23-2005 09:57 AM

thank you!
it worked

nobita 10-23-2005 03:08 PM

How to I can change from 5 to 10 threads show on forumhome?

igoravr 10-23-2005 03:43 PM

Uncached templates: forumhome_latestthreadbit (5)

How to fix?

p.s. vb 3.5 gold

Vierie 10-23-2005 08:46 PM

Quote:

Originally Posted by nobita
How to I can change from 5 to 10 threads show on forumhome?

Find DESC LIMIT 5 in the xml-file and change that number to 10.

Vierie 10-23-2005 08:49 PM

Quote:

Originally Posted by igoravr
Uncached templates: forumhome_latestthreadbit (5)

How to fix?

p.s. vb 3.5 gold

You have to create a template forumhome_latestthreadbit.

Put
Code:

<div class="smallfont">         
<if condition="$show['firstnew']">                 
<a href="showthread.php?t=$thread[threadid]&amp;goto=newpost"><img src="$stylevar[imgdir_button]/firstnew.gif" alt="$vbphrase[go_to_first_new_post]" border="0" /></a>
        </if>
          <if condition="$show['icon'] && !$show['firstnew']">
                  <img src="$vboptions[bburl]/$thread[threadiconpath]" border="0" alt="$thread[threadicontitle]" title="$thread[threadicontitle]" style="vertical-align: text-middle" />
          </if>         
<a href="showthread.php?t=$thread[threadid]" title="$thread[preview]"><strong>$thread[title]</strong></a>         
<em>$vbphrase[last_post]:</em> $thread[date] <if condition="$vboptions['yestoday'] != 2"><span class="time">$thread[time]</span></if> <phrase 1="member.php?find=lastposter&amp;t=$thread[threadid]" 2="$thread[lastposter]">$vbphrase[by_x]</phrase>         
&raquo; $vbphrase[replies]: $thread[replycount] 
        &raquo; $vbphrase[views]: $thread[views] 
</div>

into it.

Chris M 10-23-2005 10:53 PM

I forgot to add the "cache_templates" plugin to the product :p

Re-download it, uninstall the previous product and install this new one :)

Chris

nobita 10-24-2005 03:37 AM

How to I can place latest threads in under navbar?

Xplorer4x4 10-25-2005 06:47 AM

Just put the template edit for forumhome and aply it to your navbar. Thats what I did.

Any chance of getting this to display the forum name as well?

Chris M 10-25-2005 12:34 PM

In the main plugin code, find:
PHP Code:

    $thread['title'] = fetch_censored_text(fetch_trimmed_title(unhtmlspecialchars($thread['title']), 22)); 

Add below:
PHP Code:

    $forumdata fetch_foruminfo($thread['forumid']), 1)); 

Then alter the template to add $forumdata[title] where you want it to show :)

That should work but it's untested :)

Chris

shardex 10-25-2005 07:22 PM

That syntax was close but did not work.

Try this:

Find:
PHP Code:

$thread['views'] = vb_number_format($thread['views']); 

Add Below:
PHP Code:

$forumdata fetch_foruminfo($thread['forumid']); 

If you wanted to add a link to the forum name add this to your template:
HTML Code:

<phrase 1="member.php?find=lastposter&amp;t=$thread[threadid]" 2="$thread[lastposter]">$vbphrase[by_x]</phrase>
in the <a href="http://www.YOUR_SITE_HERE.com/forumdisplay.php?f=$thread[forumid]"> $forumdata[title] forum</a>.


nobita 10-26-2005 01:45 AM

Quote:

Originally Posted by Vierie
Find DESC LIMIT 5 in the xml-file and change that number to 10.

Thank a lot ;)

Quote:

Originally Posted by Xplorer4x4
Any chance of getting this to display the forum name as well?

Plz send me your code, i have placed it under navbar but it show isn't good.https://vborg.vbsupport.ru/external/2005/10/3.gif

Xplorer4x4 10-26-2005 12:34 PM

@ Chris thanks for the effort.
@ Shardex thanks for the fix.
@ Nobita. Sorry my navbar template isn't really a good example as it is bassicly fully customized. Sorry..

lairnoc 10-26-2005 07:26 PM

this is more latest thread replies

Is there a hack about the latest threads posted.?

akanevsky 10-27-2005 09:26 PM

I'm not quite sure you need to globalize $vbulletin in forumhome_complete ;)

Also, don't write
PHP Code:

$forumperms[$forum["forumid"]] 

... write
PHP Code:

$forumperms["$forum[forumid]"

Reason: the first one doesn't necessarily work on all the systems... Had troubles with that way of writing. The second way of writing works everywhere ;)

akanevsky 10-27-2005 10:09 PM

In case you want it, here is an updated XML and an updated FORUMHOME html that needs to be inserted according to Chris M's instructions:

HTML Code:

<!-- latest threads -->
<if condition="$show['latestthreads']">
<tbody>
<tr>
        <td class="thead" colspan="2">
                <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_latestthreads')"><img id="collapseimg_forumhome_latestthreads" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_latestthreads].gif" alt="" border="0" /></a>
                $vbphrase[latest_threads]
        </td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_latestthreads" style="$vbcollapse[collapseobj_forumhome_latestthreads]">
        <tr>
                <td class="alt2"><img src="$stylevar[imgdir_statusicon]/forum_new.gif" alt="$vbphrase[latest_threads]" /></td>
                <td class="alt1"><table width="100%">$threadbits</table></td>
        </tr>
</tbody>
</if>
<!-- /latest threads -->

I have changed the template, which is now perceived better (see screenshot), and I've changed a few things in the code, you might wanna compare ;) Anyhow, this is a great hack, and I did click "Install". ;)

http://img271.imageshack.us/img271/8...hot16xc.th.png

admiralapril 11-02-2005 04:35 AM

Thank you Chris M and Dark Visor. I've installed this and it works perfectly. :)

Xplorer4x4 11-02-2005 04:42 AM

I could of sworn I replied to this thread about your version Dark Visor mentioning that the first new icon was showing up but not the default post icon. Either way it was because of the way i set the image directorey in vB options to work for my portal.

Dark Visor, may i suggest making note that people can edit the table pixels to control the size.

@Chris AND Shardex niether of your variables for forum names worked as far as the link goes. The forum names show up fine but they only link to www.yourstie.com/showthread and not www.youstie.com/forums/showthread.

Anyways this is defenitley on the top of my list for favorite hacks. :)

joelc73 11-03-2005 07:01 PM

This is a great hack - Thanks! How can I move it up higher on the page? Just below (or above possibly) the Nav bar?

Thanks,

Chris M 11-03-2005 07:06 PM

Quote:

Originally Posted by Xplorer4x4
I could of sworn I replied to this thread about your version Dark Visor mentioning that the first new icon was showing up but not the default post icon. Either way it was because of the way i set the image directorey in vB options to work for my portal.

Dark Visor, may i suggest making note that people can edit the table pixels to control the size.

@Chris AND Shardex niether of your variables for forum names worked as far as the link goes. The forum names show up fine but they only link to www.yourstie.com/showthread and not www.youstie.com/forums/showthread.

Anyways this is defenitley on the top of my list for favorite hacks. :)

Change the link to:
HTML Code:

<a href="$vboptions[bburl]/forumdisplay.php?f=$thread[forumid]"> $forumdata[title] forum</a>.
:)

Chris

shardex 11-07-2005 06:05 PM

Quote:

Originally Posted by Xplorer4x4

@Chris AND Shardex niether of your variables for forum names worked as far as the link goes. The forum names show up fine but they only link to www.yourstie.com/showthread and not www.youstie.com/forums/showthread.

That's because my forum lives at the root level, and that was the example I was basing it off of. You would just need to modify the URL to match your own site but the concept should work OK.

I actually added two of these bad boys to my homepage so that one displays the latest posts from all the general forums and the other one displays the latest posts from my blog.

Check it out at: http://www.shardex.com

This is a great hack.

Xplorer4x4 11-07-2005 07:31 PM

As you can see I had already made the changes. ;) Yeah I migh consider that if my members wouldn;t kill me. Then again I could proabbly do it at the bottom of my forum as i put this in my navbar.


All times are GMT. The time now is 09:33 PM.

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.01632 seconds
  • Memory Usage 1,862KB
  • 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
  • (3)bbcode_code_printable
  • (5)bbcode_html_printable
  • (6)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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