View Full Version : Detailed Latest Posts - Version 2
Albus
03-25-2005, 10:00 PM
I finally got around to addressing some issues with the 'Detailed Latest Posts' hack I posted last year. This version uses a cron file to generate and cache the required data, saving your index from having to do all the work. This should also reduce the cpu load on large boards since the timing of the update is now controlled by the cron task. This has been tested and is live on my own board. Full instructions for installation are included in the download. For a demo please visit my board via the homepage listed in my profile.
All comments, suggestions, and other related discussion are welcome. Please inform me immediately upon discovering an error, either with the hack or the documentation.
BigIke
03-26-2005, 02:18 PM
thanks so much, I visited your site a couple days ago and looked all around for that hack because I thought it existed somewhere else, but I couldn't find anything. Thanks for the hack
Albus
03-26-2005, 02:21 PM
thanks so much, I visited your site a couple days ago and looked all around for that hack because I thought it existed somewhere else, but I couldn't find anything. Thanks for the hack
Let me know if you need any assistance in setting it up, or need questions answered.
nexialys
03-26-2005, 02:24 PM
hum.. interesting technique.. would be good to apply this to a block or two in vBadvanced...
Albus
03-26-2005, 02:32 PM
Thought I'd take a minute to post an 'overview' for those not familiar with vbulletin crons.
When you schedule a task in vbulletin, the time you set for execution is not an interval, but a specific time. For example, if you create a single task and set m=5, leaving the rest of the timing options alone, the task will run 5 minutes after every hour, not every five minutes.
Therefore, you will need to create as many tasks for this as you need. For example, if you want it updated every fifteen minutes, you need four tasks, setting m=0/15/30/45. This is how it breaks down:
For a five minute interval: 12 tasks where m=0/5/10/15/20/25/30/35/40/45/50/55.
For a ten minute interval: 6 tasks where m=0/10/20/30/40/50.
For a fifteen minute interval: 4 tasks where m=0/15/30/45.
For a thirty minute interval: 2 tasks where m=0/30.
This is much more preferable to running the queries on the index because adding a few more row to the tasks table is negligible in comparison.
Hope this answers some questions before they are asked.
BigIke
03-26-2005, 02:36 PM
So does this work as a module for vBAdvanced? Specifically as a module on the left or right side? I'm thinking it would look weird..
Albus
03-26-2005, 02:38 PM
So does this work as a module for vBAdvanced? Specifically as a module on the left or right side? I'm thinking it would look weird..
I honestly have no clue. I do not use vBAdvanced. You can try asking a user who has both installed perhaps?
My initial though is this:
Alter the templates included at your discretion, and change the target for the modifications section from index.php to whatever vbadvanced uses. This includes the additions to $specialtemplates, $globaltemplates and the hack code.
Theoretically it should still work. There's nothing tricky going on here. It's all built using stock vB functions and tables/fields. Nothing is altered or added.
Let me know if you get it working in vba, so I can post a compliancy note.
BigIke
03-26-2005, 03:38 PM
I think I'm going to install it as a module at the top, not left or right. It makes more sense on my site on top in the center.
The Realist
03-26-2005, 06:54 PM
Can you explain how to install the phrases please.
Albus
03-26-2005, 07:10 PM
Can you explain how to install the phrases please.
AdminCP -> Language & Phrases -> Phrase Manager
Click 'Search in Phrases' to see what's already there and 'Add New Phrase' to create a new one. Each presents a dialog with options and explanations.
This is a stock vB function. Hope that helps.
alderwazeh
03-27-2005, 02:08 PM
Honestly this is very nice hack and before saying that your site is even nicer ..decent design and layout ..and the hack looks like a super star in this romantic sky..great work although the hack is rather complicated in installation but this coding having said though deserve it. thanks a lot.
Albus
03-27-2005, 02:57 PM
Honestly this is very nice hack and before saying that your site is even nicer ..decent design and layout ..and the hack looks like a super star in this romantic sky..great work although the hack is rather complicated in installation but this coding having said though deserve it. thanks a lot.
Thanks for the kind words. It's not that difficult to install really. There's two arrays you have to add one item too, one template to edit, one to create, one cut-n-paste, one upload, setup some vbphrases and some tasks, and that's it. Is there a way I could've made my instructions read better perhaps? Of course, I'm going to try and have an installer by the time all intended features are worked in.
:)
lasto
03-30-2005, 02:15 AM
so if someone replys to a new thread or post it dont auto update on the stats till the cron job is run is that correct ?
Albus
03-30-2005, 02:40 AM
so if someone replys to a new thread or post it dont auto update on the stats till the cron job is run is that correct ?
That is correct. It may not be realtime, but it saves a ton of cpu load, especially for large boards.
Great hack .. clicked install.
How can I exclude certain forum ID's from being shown on the updated list.
I have 4 categorys that provide RSS news feeds and don't want those to appear.
Albus
04-14-2005, 09:30 PM
Great hack .. clicked install.
How can I exclude certain forum ID's from being shown on the updated list.
I have 4 categorys that provide RSS news feeds and don't want those to appear.
Edit /includes/cron/detailedlatestposts.php and add the following...
and
f.forumid not in (1, 2, 3, 4)
...so that it reads...
$dlp_query = "
select
t.threadid,
t.title as threadtitle,
f.forumid,
f.title as forumtitle,
t.postuserid,
t.postusername,
p.username,
t.replycount,
t.views
from
" . TABLE_PREFIX . "thread as t
left join " . TABLE_PREFIX . "forum as f on f.forumid = t.forumid
left join " . TABLE_PREFIX . "post as p on p.dateline = t.lastpost and p.threadid = t.threadid
left join " . TABLE_PREFIX . "deletionlog AS d ON d.primaryid = t.threadid and d.type = 'thread'
where
t.open = '1'
and
t.visible = '1'
and
d.primaryid is null
and
f.forumid not in (1, 2, 3, 4)
order by
t.lastpost desc
limit $dlp_limit
";
...replacing 1, 2, 3, and 4 with your four values. Let me know if this does not do the trick.
[EDIT]
Just make sure that whatever ID''syou use are for the forums the posts directly reside in, and not a parent forum, or one that is marked as no-post.
Thanks Albus .. that solved it :)
Albus
04-14-2005, 10:30 PM
Thanks Albus .. that solved it :)
Looks good on your cafe too. Personally, I think I'd switch the alt class used though. Your darker color might look better.
;)
Expect a minor update either tonight or tomorrow that will add this feature as a variable and one or two minor xhtml url goofs. You can change these manually if you wish. In the forumhome_latestpostbits template, there are some urls that use & instead of & .
Albus
04-26-2005, 05:12 PM
Looks good on your cafe too. Personally, I think I'd switch the alt class used though. Your darker color might look better.
;)
Expect a minor update either tonight or tomorrow that will add this feature as a variable and one or two minor xhtml url goofs. You can change these manually if you wish. In the forumhome_latestpostbits template, there are some urls that use & instead of & .
Just a quick update...
I am going through a major overhaul, both in format and concept, of my forum. Until that is complete, I am putting further development of this on hold. Please be patient with me during this time. I will post the update mentioned earlier shortly after the renovation is complete.
Thanks.
Piratos
05-30-2008, 02:56 PM
any Demo!!!
Please :(
RagingPenguin
05-30-2008, 03:04 PM
Um, this is like three years old. I'm not even sure if I will ever revisit this. The vBa CMPS has a recent news module that has more options. There's no point really. But you never know...
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.