PDA

View Full Version : Latest Thread (in index and forumdisplay)


TECK
04-26-2002, 10:00 PM
This hack will add the latest thread in index.php and forumdisplay.php files, above the date and time of each forum latest post.
There is no need to alter any table and also, it adds only one query.

ESTIMATED INSTALL TIME: 2 minutes
TESTED IN VERSION: 2.2.5

NOTE: As a thank you for using my hack, please click on the INSTALL button. You will receive updates in your email, whenever I add new features to it and it will let me evaluate better the quality of my hacks.
Also post a reply with your comments. Your oppinion is important to me.

UPDATE
After the evaluation made by FireFly and PPN, we all came to the conclusion that this hack is reliable ONLY if it's used on medium or small boards. Busy boards SHOULD install PPN's hack (https://vborg.vbsupport.ru/showthread.php?s=&threadid=28561).
I requested to have this hack removed from the database, but I guess FireFly is right. The code is still good and it will bring your board to it's knees only if you have alot of forums and ALOT of members browsing to them.

To download the latest version of this hack, click below:

TECK
04-27-2002, 08:46 PM
A screenshot... ;)

Demascus
04-27-2002, 08:47 PM
thanks looks a nice hack

wooolF[RM]
04-27-2002, 09:03 PM
]installed... working damn nice *g* 5 stars hack :D

Dark Odin
04-27-2002, 09:15 PM
I thought PPN already did this?

TECK
04-27-2002, 09:17 PM
you are correct. however, PPN's version require to alter a table. this code is a different aproach, that eliminates the need to mod the database. for people who only want to edit 2 files with 2 small code segments.

Dark Odin
04-27-2002, 09:19 PM
Oh, I see. I'll install this one instead then.

Floris
04-28-2002, 10:16 AM
Originally posted by nakkid
you are correct. however, PPN's version require to alter a table. this code is a different aproach, that eliminates the need to mod the database. for people who only want to edit 2 files with 2 small code segments.

So, it is still the same hack. Couldn't you use the thread he started and gave it as a add-on or alternative?

TECK
04-28-2002, 10:21 AM
true. any of the admins or mods could move this thread and apendice it to PPN's thread? thanks.

Admin
04-28-2002, 10:27 AM
I'll keep this hack in its own thread for now, there are many hacks that do this (each in its own way).

Anyway, was this tested in a large board? I don't like the sound of joining a big thread table in that query.

TECK
04-28-2002, 10:36 AM
i cannot answer you on this firefly. as you know, i do all my hacks on localhost. before i posted the hack, i had Zzed testing it. wooolF also test it on his board. he usually have over 100 members online.

can you please explain us why you think the query is not reliable?
maybe you could try it only temporarely at vB.org just to see it's stability. thanks.

Scott MacVicar
04-28-2002, 10:38 AM
I'll try it on my local board, has alot of forums on the forum home and 90,000 posts should be ok for a test.

See if it brings my computer to its knees :D

TECK
04-28-2002, 10:40 AM
thanks PPN. :) i'm curious to find out the results.

adtestvb
04-28-2002, 10:44 AM
its not showing anything :( i had all the code the install file said to find. edited the index and forumdisplay and the template

i tried it on 2.2.2 and 2.2.5

Admin
04-28-2002, 10:55 AM
BTW what's the purpose of this code?
(forum.lastpost-forum.daysprune)
You don't need to substract daysprune from it, the units are not even the same (lastpost is in UNIX time stamp, daysprune is a number of days).

TECK
04-28-2002, 11:02 AM
firefly, i tried this:LEFT JOIN thread ON (thread.forumid=forum.forumid AND thread.lastpost=forum.lastpost)and i encountered one problem:
if the post is made other then today, it will not show. so i went with the logic and added a value to the default days that the forum is pruned.

this is the only way i could think of it. let me know if you have in mind something that will pull the trick better.

Admin
04-28-2002, 11:05 AM
Using = is just fine.

Chris M
04-28-2002, 11:10 AM
@nakkid - Does this provide a link to the Topic itself, or is it just the name and who created it?

Other than that question, great hack...

Satan

TECK
04-28-2002, 11:13 AM
i try it.. it didn't work well on wooolF's live board, but it did ok on my local one.
so you recommend me to keep the query like this?$forums=$DB_site->query('SELECT forum.*, thread.title AS threadtitle FROM forum LEFT JOIN thread ON (thread.forumid=forum.forumid AND thread.lastpost=(forum.lastpost-forum.daysprune)) WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');let me know please.

satan, it doesnt provide a link to the thread because it would add extra queries, wich is not recommended on a large board. i think the link to the latest post will do just fine. the title of the post is more informative, for the users to see what is going on in that forum.
let us know what you think.

Chris M
04-28-2002, 11:19 AM
Ok will do...

I'll get back to you after I see how the guys like it...

Satan

TECK
04-28-2002, 11:23 AM
still waiting for PPN's test...
if it doesnt hold well... i tried at least.. and we still have his version available, right? :)
at least i learned something new about it.

Admin
04-28-2002, 11:26 AM
Originally posted by nakkid
i try it.. it didn't work well on wooolF's live board, but it did ok on my local one.
so you recommend me to keep the query like this?$forums=$DB_site->query('SELECT forum.*, thread.title AS threadtitle FROM forum LEFT JOIN thread ON (thread.forumid=forum.forumid AND thread.lastpost=(forum.lastpost-forum.daysprune)) WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');let me know please.
No, remove the illogical code. (the part I was talkin about...)

TECK
04-28-2002, 11:38 AM
ok.. :)
illogical.. hehe you made me smile, because i said earlier that i went with the logic.
so what should i do... leave it like that? :$forums=$DB_site->query('SELECT forum.*, thread.title AS threadtitle FROM forum LEFT JOIN thread ON (thread.forumid=forum.forumid AND thread.lastpost=forum.lastpost) WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');it will not show any threads posted yesterday. i tried that first.

Admin
04-28-2002, 11:41 AM
Of course it will show threads from yesterday. And if your board is not very busy, the chances two posts would be posted at the very same second are very low, so you can also drop the thread.forumid=forum.forumid part our of the query.

TECK
04-28-2002, 11:45 AM
ic... is wierd. i swear i thought the same way. but when wooolF tried the code it didnt work. you think if would be related to some other hacks he installed?

anyway.. i will update the file with the final query listed above. thanks for the help.
btw, do you plan adding it here? vB.org have alot of posts and traffic. probably a good place to see if the query keep everything tight...

ok.. i updated the file.

Admin
04-28-2002, 11:53 AM
I'll probably install Scott's, if I decide to add that functionality.

TECK
04-28-2002, 12:05 PM
np. one more time thanks, firefly.

Scott MacVicar
04-28-2002, 01:18 PM
It wasn't too bad on my local computer seemed to go fine, but when i put it on my live board with 16 browsing the load time went up and server load jumped from 0.46 to 1.63

TECK
04-28-2002, 01:36 PM
ok. thanks PPN. what about your hack?
not that i try to compare. but i'm sure you test it. what are the results for yours? after all, i dont mind at all installing yours on my new board. let me know please.

Admin
04-28-2002, 01:46 PM
His hack just adds another field to the forum table, which is already selected so the overload is nil. And since the forum table isn't big (unless you have thousands of forums), another field doesn't matter.

TECK
04-28-2002, 01:51 PM
ic.. that makes alot of sense... firefly or any mods, can you please delete this thread? i rather have the people install PPN's hack. i thought my hack it will look simplier.. but from what you and PPN tell me, i'm way better with his hack. :)

Chris M
04-28-2002, 04:14 PM
Server load went to 1.62 or something?

Our Server load hovers around 4 and 5, and I swear I saw 9.12 the other day...

Satan

TECK
04-28-2002, 04:18 PM
well.. on a normal day 5 is considered high.
i'm concerned with my hack for busy boards. the hack above will do great on medium to small boards.
PPN's hack might require aditional settings and is alot longer to install it.. but if you have a busy board, that's a MUST, to install his hack, not mines.

Chris M
04-28-2002, 05:04 PM
Hmmm...

Our board just seems to have a very high server load...

Satan

Eniyi
04-29-2002, 02:11 PM
This hack is cool, especially if you are used to UBB interface, it makes things better.

Gutspiller
05-03-2002, 08:30 PM
Would it be possible to modify this hack so that it shows the latest 5 threads on the forum?

Does this hack have the ability to block some forums if you don't want posts in there shown?

Also from the pic you showned all the text isn't on the same line, is it still possible to get it so that it was on the same line and the 5 latest threads were one ontop of each other?

This would be a really cool hack that I could use really bad.

PLEASE PLEASE PLEASE. :D

PET
05-11-2002, 11:31 PM
I have installed the hack but the text loks badly. See the creenshot. The text is not near the image... :alien: :alien:

wintz
05-18-2002, 02:56 PM
I`ve just installed this hack and think it`s great, but it seems to have made the forum tables go out of line (see pic below) anyone know how i can fix this? cheers

wintz
05-19-2002, 10:49 AM
Any help would be appreciated with this, thanks

Hellburn
06-17-2002, 10:57 AM
i become follow error when i installed the hack:

Parse error: parse error in /is/htdocs/13535/www.********.com/vb/index.php on line 285

285 = $forum['threadtitle']=substr($forum['threadtitle'],0,$title

lenght);

P.S. i have vB 2.2.6