View Full Version : Last thread with last post icon instead of clear image
Island Roots
12-14-2001, 10:00 PM
(The creator of the original hack (https://vborg.vbsupport.ru/showthread.php?s=&threadid=32403) is DR2000; I have since then modified it further)
Here's the hack in a handy dandy text file:
https://vborg.vbsupport.ru/external/2009/01/38.gifHack:lastthreadlastposticon.txt (https://vborg.vbsupport.ru/attachment.php?s=&postid=207180)
It is incredibly simple...you need only edit one file and one template! It can be done in a couple minutes!
###Features###
- Shows the thread name of the last active post on the front page
- Shows the lastpost.gif icon for the theme you're using, instead of either A, using a clear (invisible) image, or using the default lastpost.gif image for the lastpost icon
- If the subject is long enough to start stretching the field on the index page, it'll show a shrinked version (i.e. "I need help with version.....).
Note: This has only been tested on version 2.2.1!
To see it in action, just visit www.ConsoleBoards.com !
<img src="images/lastpost.gif" border="0" alt="Go to last post"></a></td>
hmmm
shouldnt this be replaced by
$forum[icon]
just a thought :rolleyes:
Island Roots
12-15-2001, 04:03 AM
Well, I was tweaking the hack for about a day, and I ended up with that and it works...no broken links or broken images, so no. :)
By the way, sorry about stretching out the board...I don't know how to add .txt or .zip files. :(
TheComputerGuy
12-15-2001, 12:01 PM
its all good...
Island Roots
12-15-2001, 06:00 PM
Alright, now I've got the hack in a text file so it doesn't stretch the boards! :cool:
Xsentrik.com
12-15-2001, 09:05 PM
great hack thanks alot
Sadie Frost
12-15-2001, 09:59 PM
When I try to open your text file, it tells me "no attachment specified" - am I doing something wrong already? Thanks! :)
Island Roots
12-15-2001, 10:52 PM
The link is wrong. Let me fix it. You can also get it by clicking here:
Sadie Frost
12-15-2001, 11:53 PM
Thank you! :)
when i install this hack i got a error at this line
$forums=$DB_site->query('SELECT forum.*, CASE WHEN icon.iconpath IS NULL THEN '' ELSE icon.iconpath END as icon, thread.title as thtitle FROM forum left outer join thread on thread.forumid = forum.forumid and thread.lastpost >= (forum.lastpost-30) LEFT OUTER JOIN icon ON icon.iconid=thread.iconid WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');
no other info.Can u help me?
Island Roots
12-17-2001, 09:24 PM
Hmmm...are you sure you don't have any other hacks that have effected that line or need that line in order to function properly? This has been installed numerous times at my forums as well as at other vB forums, so it isn't an error in the hack. Try it again.
no any other hacks ! :rolleyes:
Lesane
12-18-2001, 08:17 PM
[QUOTE]Originally posted by epic
when i install this hack i got a error at this line
$forums=$DB_site->query('SELECT forum.*, CASE WHEN icon.iconpath IS NULL THEN '' ELSE icon.iconpath END as icon, thread.title as thtitle FROM forum left outer join thread on thread.forumid = forum.forumid and thread.lastpost >= (forum.lastpost-30) LEFT OUTER JOIN icon ON icon.iconid=thread.iconid WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');
no other info.Can u help me?
Lesane
12-18-2001, 08:31 PM
hmm.. somehow the forum dont shows \ \ in the code.
Epic, change in the select code in index.php this:
THEN ''
to:
THEN \ ' \ '
(without spaces)
[QUOTE]Originally posted by Lesane
hmm.. somehow the forum dont shows \ \ in the code.
Epic, change in the select code in index.php this:
THEN ''
to:
THEN \ ' \ '
(without spaces)
LeThaLNjEcTiOn
12-19-2001, 07:53 AM
Nice Hack. How do I get to my index.php file to make the changes?? My friend installed my vbulletin for me and I am just learning the ins and outs of the thing myself. Also, does this hack work for php3, I think that was the problem we had when we tried to install a version of this a while back. Where do I got to find the .php3 files to edit them??
~LeThaLNjEcTiOn
Sadie Frost
12-19-2001, 11:06 AM
Well, I am just learning as well, but here's how I do it. You need an FTP program, and using that you have to download the user.php file to your computer, then open it using a text editor (ie Notepad - don't use Word as I just did and it screwed up my files! lol)
Make the changes in the instructions, and then re-upload the file.
Also be sure to make a backup copy of the file before you make changes to it.
I think (but I'm sure someone else could tell you better) for php3 you just rename file extensions to "php3"
Hope that helps!
:)
Lesane
12-19-2001, 02:12 PM
[QUOTE]Originally posted by epic
This has a db error!
Island Roots
12-19-2001, 11:49 PM
Hmmm...are you sure you are running 2.2.1? As I stated in the file, it has only been tested on 2.2.1.
[QUOTE]Originally posted by Lesane
Epic, try to change the select code in index.php to:
$forums=$DB_site->query('SELECT forum.*, CASE WHEN icon.iconpath IS NULL THEN \'\' ELSE icon.iconpath END as icon, thread.title as thtitle FROM forum left outer join thread on thread.forumid = forum.forumid and thread.lastpost >= (forum.lastpost-30) LEFT OUTER JOIN icon ON icon.iconid=thread.iconid WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');
Lesane
12-20-2001, 11:51 AM
[QUOTE]Originally posted by Lesane
hmm.. somehow the forum dont shows \ \ in the code.
Epic, change in the select code in index.php this:
THEN ''
to:
THEN \ ' \ '
(without spaces)
I have a db error when use THEN \ ' \ '
no other hacks!
Island Roots
12-20-2001, 05:50 PM
[QUOTE]Originally posted by epic
I have a db error when use THEN \ ' \ '
no other hacks!
My server is php 4.0.4pl1 and MySql3.22.32
My vbb is 2.2.1
When i use this line
$forums=$DB_site->query('SELECT forum.*, CASE WHEN icon.iconpath IS NULL THEN \'\' ELSE icon.iconpath END as icon, thread.title as thtitle FROM forum left outer join thread on thread.forumid = forum.forumid and thread.lastpost >= (forum.lastpost-30) LEFT OUTER JOIN icon ON icon.iconid=thread.iconid WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');
generate a Database error,like this
Database error in vBulletin 2.2.1:
Invalid SQL: SELECT forum.*, CASE WHEN icon.iconpath IS NULL THEN '' ELSE icon.iconpath END as icon, thread.title as thtitle FROM forum left outer join thread on thread.forumid = forum.forumid and thread.lastpost >= (forum.lastpost-30) LEFT OUTER JOIN icon ON icon.iconid=thread.iconid WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder
mysql error: You have an error in your SQL syntax near 'icon.iconpath IS NULL THEN '' ELSE icon.iconpath END as icon, thread.title as th' at line 1
When i use this line
$forums=$DB_site->query('SELECT forum.*, CASE WHEN icon.iconpath IS NULL THEN '' ELSE icon.iconpath END as icon, thread.title as thtitle FROM forum left outer join thread on thread.forumid = forum.forumid and thread.lastpost >= (forum.lastpost-30) LEFT OUTER JOIN icon ON icon.iconid=thread.iconid WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');
generate a error,info is
Parse error: parse error in /home/vb/index.php on line 92
Who can help me?
Island Roots
12-21-2001, 02:26 PM
<i>Make sure</i> you didn't overwrite any other code besides the one you were suppose to edit. If that doesn't work, then I can't help you. It has worked perfectly on all other boards.
trilOByte
12-22-2001, 04:21 PM
Getting the same parse error here too! Wierd!
find (index.php):
//Forum info
$forums=$DB_site->query('SELECT * FROM forum WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');
replace it with:
//Forum info
$forums=$DB_site->query('SELECT forum.*, CASE WHEN icon.iconpath IS NULL THEN \'\' ELSE icon.iconpath END as icon, thread.title as thtitle FROM forum left outer join thread on thread.forumid = forum.forumid and thread.lastpost >= (forum.lastpost-30) LEFT OUTER JOIN icon ON icon.iconid=thread.iconid WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');
trilOByte
12-22-2001, 10:47 PM
Thanks man, that worked a treat ;)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.