Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Recently Viewed Threads Details »»
Recently Viewed Threads
Version: 1.2 Beta, by Logikos Logikos is offline
Developer Last Online: Sep 2023 Show Printable Version Email this Page

Version: 3.5.3 Rating:
Released: 02-10-2006 Last Update: 02-11-2006 Installs: 24
DB Changes Uses Plugins Template Edits
Is in Beta Stage  
No support by the author.

Recently Viewed Threads


What this does
This will show each user a list of Recently Viewed Threads. The idea came from www.SitePoint.com. I found myself using it alot when I came back to the site to check up on some threads I forgot about, or just couldn't find. AJAX enabled - (quick thread title edit and open/close works!)

This was coded to be placed on the forumhome, though you can edit to your needs if you know what your doing.

How this plugin works
The concept of this plugin is simple. When a user clicks on a thread, it will log the user and thread info in the database. The thread will then be marked as viewed using a conditional timestamp comparison. In lamens terms this means that when a user views a thread, it will log the time the thread was viewed. It will not relog the thread information if the user views the same thread within a certain amount of wait time. (Admin CP setting). Default is 5 minutes.

Descriptive Example
LiveWire clicks on a thread titled 'New Hack Posted'. 1 small query is performed to see if I have recently viewed this thread yet.

If I have viewed this thread already, it will check and see when I viewed it. If it was longer then 5 minutes ago, then it will add the new information using 1 more query.

If I have never viewed this thread before, then it will insert it into the database using 1 query.

To do list...
  • Time to install: 2 minutes or less
  • Queries to run: 1 (Installer Controlled)
  • File Mods: 0
  • Templates to edit: 1 (forumhome)
  • Templates to add: 1 (Installer Controlled 'forumhome_recentbit')
  • New Phrases: 0
  • New Plugins: 2
Click It For Support!
Install This Product

Important Note
This product of mine is marked as beta as I'm still working on some code for future releases. vBCron to clean up Database will be released soon as an addon in the below post.

Product History
Sun, Feb 12 2006 - Forumhome Recent Table is can be collapsed
Sun, Feb 12 2006 - Added plugins (The two plugins didn't export for some reason)
Sat, Feb 11 2006 - Beta Released


Help & Support
Before asking for support Please make sure you have done all necessary changes! If you still need support please post a reply here and double check that you have clicked the Install Button.

Please post bugs and errors here. Hope you like, feedback welcomed!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 02-12-2006, 06:55 PM
bashy bashy is offline
 
Join Date: Nov 2005
Posts: 2,544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Whats the text box with Test in it in your image Livewire?
Reply With Quote
  #23  
Old 02-12-2006, 07:16 PM
Logikos Logikos is offline
 
Join Date: Jan 2003
Posts: 2,924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This post marks a newer version

v1.2 Beta Released

The forumhome Recent table can now be collapsed. The Main Zip file has been updated. For those who wish to upgrade there templates, please follow these Template Instructions:

Template Forumhome:
------------------------------
Find:
HTML Code:
        <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center" id="threadslist">
        <tr>
                <td colspan="6" class="tcat">Recently Viewed Threads</td>
        </tr>
        <tr>
                <td class="thead" colspan="2">&nbsp;</td>
                <td class="thead" width="100%">$vbphrase[thread] / $vbphrase[thread_starter]</td>
                <td class="thead" width="150" align="center" nowrap="nowrap"><span style="white-space:nowrap">$vbphrase[last_post]</span></td>
                <td class="thead" align="center" nowrap="nowrap"><span style="white-space:nowrap">$vbphrase[replies]</span></td>
                <td class="thead" align="center" nowrap="nowrap"><span style="white-space:nowrap">$vbphrase[views]</span></td>
        </tr>

        $recentbits
        </table>
Replace With
HTML Code:
        <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center" id="threadslist">
        <tbody>
        <tr>
                <td colspan="6" class="tcat">
                        <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_recent')"><img id="collapseimg_forumhome_recent" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_forumhome_recent].gif" alt="" border="0" /></a>
                        Recently Viewed Threads
                </td>
        </tr>
        </tbody>
        <tbody id="collapseobj_forumhome_recent" style="$vbcollapse[collapseobj_forumhome_recent]">
        <tr>
                <td class="thead" colspan="2">&nbsp;</td>
                <td class="thead" width="100%">$vbphrase[thread] / $vbphrase[thread_starter]</td>
                <td class="thead" width="150" align="center" nowrap="nowrap"><span style="white-space:nowrap">$vbphrase[last_post]</span></td>
                <td class="thead" align="center" nowrap="nowrap"><span style="white-space:nowrap">$vbphrase[replies]</span></td>
                <td class="thead" align="center" nowrap="nowrap"><span style="white-space:nowrap">$vbphrase[views]</span></td>
        </tr>
        $recentbits
        </tbody>
        </table>
Reply With Quote
  #24  
Old 02-12-2006, 07:17 PM
Logikos Logikos is offline
 
Join Date: Jan 2003
Posts: 2,924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bashy
Whats the text box with Test in it in your image Livewire?
That is a title of a thread. You can use AJAX to edit the titles and close threads.
Reply With Quote
  #25  
Old 02-12-2006, 07:19 PM
bashy bashy is offline
 
Join Date: Nov 2005
Posts: 2,544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great m8, thanks for doing this
Works well
Reply With Quote
  #26  
Old 02-12-2006, 11:00 PM
Bison's Avatar
Bison Bison is offline
 
Join Date: Jun 2002
Location: Virginia Beach, Virginia
Posts: 522
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good work! *Installed*
Reply With Quote
  #27  
Old 02-13-2006, 08:33 PM
sonicdriven sonicdriven is offline
 
Join Date: Dec 2004
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I was going to try and create this hack myslef but why when yours works perfect! Install was smooth as can be! I'm going to try and extend this so it can be used on the pages created with the Drupal Plugin..

Awesome Job, not shabby at all, a much needed mod for VB IMO.
Reply With Quote
  #28  
Old 02-15-2006, 01:35 PM
dxguru dxguru is offline
 
Join Date: May 2005
Location: England
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Could this be done so that it shows on the users MEMBERPROFILE page?
ie when I look at someone elses profile I see the threads they have recently viewed.
Reply With Quote
  #29  
Old 02-16-2006, 03:27 PM
bashy bashy is offline
 
Join Date: Nov 2005
Posts: 2,544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi

It appears that i am now getting this DB error whilst using your hack

Code:
Database error in vBulletin 3.5.3:

Invalid SQL:

                        SELECT post.pagetext AS preview,
                                thread.threadid, thread.title AS threadtitle, lastpost, forumid, pollid, open, replycount, postusername, postuserid, lastposter,
                                thread.dateline, views, thread.iconid AS threadiconid, notes, thread.visible
                                

                        FROM thread AS thread
                        
                        LEFT JOIN recentlyviewed AS recentlyviewed ON(recentlyviewed.threadid = thread.threadid)
                        LEFT JOIN post AS post ON(post.postid = thread.firstpostid)
                        WHERE thread.threadid IN(132,1550,1584,1580,1585,1573,1586,1587,1588,1381,1589,1559,1590,1591,1579,92,1594,1595,1597,1562,1596,1599,1600,1565,1602,1603,1577,1605,1608,1623,1625,1624,1627,1628,1629,1622,1630,1643,1645,1644,1641,1647,942,362,509,1581,1606,1648,1345,1620,1089,1649,130,1651,1650,1505,1658,1668,1666,1413,1667,1660,1663,1669,554,993,1384,1670,1672,1673,1390,1635,1677,1675,1676)
                        ORDER BY recentlyviewed.dateline DESC
                        LIMIT 5;

MySQL Error  : The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay Error Number : 1104
Date         : Thursday, February 16th 2006 @ 02:11:15 PM
Script       : http://www.bashys-place.com/forums/
Referrer     :
Please advise?
Reply With Quote
  #30  
Old 02-16-2006, 05:02 PM
Logikos Logikos is offline
 
Join Date: Jan 2003
Posts: 2,924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bashy. Log into the Admincp and go to Execute SQL Query and run this query:

[sql]
DELETE FROM recentlyviewed
WHERE dateline < (1140115611 - 3600)
[/sql]
This should fix it for a couple of days. When I get home I'll create a maintance script.
Reply With Quote
  #31  
Old 02-16-2006, 05:09 PM
bashy bashy is offline
 
Join Date: Nov 2005
Posts: 2,544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok m8 thanks for that....
I take it without a main fix i will get the issue again, if ya not done the main fix by then do i run that again if i get the same issue?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:53 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04843 seconds
  • Memory Usage 2,325KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (2)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete