View Full Version : Recently Viewed Threads
Logikos
02-10-2006, 10:00 PM
https://vborg.vbsupport.ru/ (http://www.vbhackers.com)
Recently Viewed Threads
www.vBHackers.com (http://www.vBHackers.com)
What this does
This will show each user a list of Recently Viewed Threads. The idea came from www.SitePoint.com (http://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: 2Click It For Support!
Install This Product
(https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=107739)
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 (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=107739).
Please post bugs and errors here. Hope you like, feedback welcomed! :)
Logikos
02-11-2006, 08:45 PM
-Post Reserved-
-=Sniper=-
02-11-2006, 09:32 PM
nice, will be using it for sure :)
FleaBag
02-11-2006, 10:23 PM
The recently viewed threads don't show up but the shell of the template does. Nothing else seems to work incorrectly.
Logikos
02-12-2006, 04:40 AM
Recently Viewed Threads
Version 1.1 Beta
There was a strange bug on my end when exporting the product. It didn't add the plugins to the product, anyway I fixed the little buggy for everyone.
Upgrade
For those of you who installed the 1.0 Beta version and wish to upgrade to v1.1 Beta, please import product-recentlyviewed.xml via AdminCP -> Plugin System -> Manage Products And make sure Allow Overwrite is set to YES
The recently viewed threads don't show up but the shell of the template does. Nothing else seems to work incorrectly.
Same here. No threads show up for me. :(
Logikos
02-12-2006, 06:21 AM
Read the post directly above you.
Hmm, I re-uploaded it and it worked this time. Odd.
The Realist
02-12-2006, 08:06 AM
Dont work for me its blank.
Installed the new version from scratch as well.
bashy
02-12-2006, 08:34 AM
Working oK for me :)
Those that think it aint...go view a thread then goo look..(refresh just in case)
Could you please make this collapseable?
Nice hack btw
The Realist
02-12-2006, 08:44 AM
looked at a thread and still nowt?
Akagi
02-12-2006, 08:57 AM
It'll be interesting if you could implement this into the UserCP like IPB2
bashy
02-12-2006, 09:39 AM
Very strange...Mine worked 1st time..
I then moved the hack further up the template and still
works 100%....I dont know what to suggest..
Have you turned it on in your admincp?
looked at a thread and still nowt?
KMxRetro
02-12-2006, 09:58 AM
Installed - shows "Recently Viewed Threads" even when there are none to show...very shabby. Also, turns the Thread count in the "Threads/Posts/Users" at the top of my page to however many recently viewed threads there are.
Threads: 1, Posts: 2,303, Members, 2,700 for example.
Oh, and there's no AJAX to be found.
Uninstalled.
Snake
02-12-2006, 10:22 AM
Thank you, I'm gonna install this... :D
bashy
02-12-2006, 10:30 AM
Installed - shows "Recently Viewed Threads" even when there are none to show...very shabby. Also, turns the Thread count in the "Threads/Posts/Users" at the top of my page to however many recently viewed threads there are.
Threads: 1, Posts: 2,303, Members, 2,700 for example.
Oh, and there's no AJAX to be found.
Uninstalled.
Hi
I beg to differ, mine is working 100%
please see www.bashys-place.com or to skip the brill intro use www.bashys-place.com/forums i am afraid you will need to register by the looks of it
as its a members only hack, wich is a shame as guest could make use of this as well
Fancy inplementing this LiveWire, Guest as well?
The Realist
02-12-2006, 10:46 AM
Uninstalled.
Sorry.
FleaBag
02-12-2006, 01:57 PM
Working for me! Thanks for the update LiveWire. To call someone's hack shabby is a bit lame! I think it's top notch. As far as moving to the UserCP is concerned, a little fiddling with the plugins could probably achieve this. I'm gonna try to get it working in CMPS. :)
Logikos
02-12-2006, 06:51 PM
I've just downloaded and installed this hack on a fresh vBulletin 3.5.3 install and it works perfect. Ajax is working also (Here is another screenshot of me using it) You have to remember to save your settings in the admincp before this to work. The active staus is turned off by default.
vBulletin Options -> Recently Viewed Threads -> Recently Viewed Active -> Set to Yes
bashy
02-12-2006, 06:55 PM
Whats the text box with Test in it in your image Livewire?
Logikos
02-12-2006, 07:16 PM
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:
<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"> </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
<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"> </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>
Logikos
02-12-2006, 07:17 PM
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.
bashy
02-12-2006, 07:19 PM
Great m8, thanks for doing this :)
Works well
Bison
02-12-2006, 11:00 PM
Good work! *Installed*
sonicdriven
02-13-2006, 08:33 PM
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.
dxguru
02-15-2006, 01:35 PM
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.
bashy
02-16-2006, 03:27 PM
Hi
It appears that i am now getting this DB error whilst using your hack
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,138 1,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,108 9,1649,130,1651,1650,1505,1658,1668,1666,1413,1667 ,1660,1663,1669,554,993,1384,1670,1672,1673,1390,1 635,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?
Logikos
02-16-2006, 05:02 PM
Bashy. Log into the Admincp and go to Execute SQL Query and run this query:
DELETE FROM recentlyviewed
WHERE dateline < (1140115611 - 3600)
This should fix it for a couple of days. When I get home I'll create a maintance script. :)
bashy
02-16-2006, 05:09 PM
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?
bashy
02-16-2006, 05:11 PM
All seems ok again :)
Cheers for the quick response an all that :)
bashy
02-19-2006, 06:44 PM
Just had this error
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(1701,1699,1698,1697,1693,1692,1691,1687,1703,17 04,1705,1706,1708,1707,1712,1714,194,1732,1103,172 9,1718,1725,1717,1736,1051,1741,1647,1625,1346,157 9,1688,1742,1743,1744,184,1670,1754,1753,1758,1759 ,1577,1757,1546,1391,1760,1761,1762,1764,1766,1765 ,1749,1747,1748,1755,1767,1768,1769,1770,1771,1773 ,1774,1775,1776,1751,1678,1657,1640,1611,1607,1561 ,1540,1528,1777,1778,1779,132,1781,1782,1783,1784, 1785,1786,1787,1788,1789,1790,1791,1792,1685,1715, 1772,1816,1621)
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 : Sunday, February 19th 2006 @ 08:35:01 PM
Script : http://www.bashys-place.com/forums/
Referrer : http://www.bashys-place.com/forums/
I tried to run that sql ya gave me but didnt work this time...
Please advise as i have to keep this turned off now :(
Wongod
03-15-2006, 08:25 AM
Is this hack working?
thanh
03-30-2006, 06:52 PM
me too
I had the errrors
Database error in vBulletin 3.5.4:
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(4,5,1,2,3,15,19,8,22,23,28,29,11,34,18,24,25,20 ,40,42,57,59,60,62,31,64,65,35 ,66,6,7,67,41,73,63,72,74,75,76,77,78,79,80,81,82, 83,84,85,86,87,88,89,90,91,92, 93,94,95,96,97,98,99,100,101,102,103,104,105,106,1 07,71,111,115,117,127,157,134, 181,156,120,186,141,159,197,234,217,216,187,237,19 6,192,243,211,244,215,133,212, 246,158,268,270,272,274,276,277,278,279,280,281,28 2,283,284,285,286,287,289,290, 291,292,294,295,296,298,299,300,301,302,303,68,304 ,307,308,309,310,312,313,314,3 15,316,317,318,320,321,322,323,324,325,326,327,328 ,180,330,152,331,333,221,335,3 36,337,188,338,341,342,347,340,359,384,379,386,155 ,385,362,344,390,391,358,396,4 15,441,458,463,436,474,476,429,269,461,484,487,493 ,488,491,502,509,511,512,513,5 14,515,516,517,519,521,522,523,524,504,424,496,492 ,154,421,537,531,470,420,560,5 58,564,477,466,426,542,430,494,475,561,566,520,568 ,604,596,574,600,618,615,614,6 23,624,585,619,622,598,563,577,261,645,423,706,670 ,757,756,866,937,802,808,841,6 92,960,904,829,1030,1014,1029,1034,1046,377,1036,1 044,1033,1018,375,1022,1051,20 6,401,409,367,378,387,13,453,951,1143,1217,1219,11 49,1195,1042,1272,1275,1305,63 2,275,241,675,1658,373,1303)
ORDER BY recentlyviewed.dateline DESC
LIMIT 5;
MySQL Error : Got error 28 from table handler
Error Number : 1030
Date : Thursday, March 30th 2006 @ 03:30:52 PM
Script : http://xxxxxxxxxxxxxx/forums/index.php
Referrer : http://xxxxxxxxxx/forums/showthread.php?t=1679
IP Address : xxxxxxxxxxxxxx
Username : admin
Classname : vb_database
thanh
03-30-2006, 07:00 PM
@LiveWire
When run
DELETE FROM recentlyviewed
WHERE dateline < (1140115611 - 3600)
The member access forum OK w/o any error but when iam, the administrator loggin in the error still apear :(
thanh
03-30-2006, 07:02 PM
AHA, when i'm trying TRUNCATE TABLE `recentlyviewed`
all become the normal now:)
xspazx
04-03-2006, 09:10 PM
The hook for this plugin made my forums stats say threads: 5. Maybe you should update that?. I wont click uninstall in hopes that you do fix the slight bug. But it's going to be disabled on my site for now. Thanks.
Logikos
04-04-2006, 02:33 AM
I'll be updating this in the next day or so, as I need to fix it for my site. ;)
Wongod
04-24-2006, 05:00 PM
Hi LiveWire, any progress? This seems like a great feature.
FleaBag
05-23-2006, 05:17 AM
I get the issue where it says I have 5 threads too. Also, recently this seems to slow down my forumhome loading. Normally <1 second to over a minute. I had to disable even with it only showing 3 threads updating every 30 minutes. Hope you know about this issue and how to fix. :D
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.