View Full Version : Last post WITH icon on first page (no database modifications needed)
DR2000
11-13-2001, 10:00 PM
#### Subject Preview by DR2000 ####
I looked at all other hack avaliable for this, and all of them
are trying to do too much by editing your database structure,
and modifying the way data is inserted. Why overcomplicate
things, when all data is already there, and it only needs to be
extracted...
#### DEMO ####
To see this hack in action take a look at
http://forum.4adrive.com
#### FEATURES ####
- Shows the subject of the last active post on the front page
- Shows the icon of the last active post on the front page
- No need to alter database, and risk to screwing something up
- Only one file to change
- If the subject was very long, shows trunkated version of it,
and replaces the rest with '...', preventing your main page
layout from being screwed up.
#### #### ####
Nov 14, 2001
#### #### ####
Note: Tested with 2.0.3, 2.2.0 and 2.2.1.
Scott MacVicar
11-14-2001, 03:49 PM
I was just against all the extra long queries that needed to be done as it increased loading time on a board with 40 forums :)
DR2000
11-14-2001, 04:07 PM
Well, actually all those queries are processed on the server side, and none of that is being sent to the client. So it doesn't affect bandwith.
This is exactly what I was looking for. I even posted a question in PPN's thread and no one helped me... but this comeso ut of the box pretty much the way i like it! Thanks I'll install this ASAP. goodjob!
*Edit - 2.0.3 :eek: AHHH!!! 2.2 needed, back to asking people on PPN's thread... :(
DR2000
11-14-2001, 08:16 PM
I'll try to get v2.2.0 this weekend, and see if it's really different. I don't have time to update my board, but I'll let you know if that thing will work.
Originally posted by DR2000
I'll try to get v2.2.0 this weekend, and see if it's really different. I don't have time to update my board, but I'll let you know if that thing will work.
Thanks from me and everyoner with 2.2, goodluck!
DR2000
11-15-2001, 12:55 AM
Ok, I just tested it with 2.2.0, and everything works fine. I also added the number of the lines which need to be modified for 2.2.0, as well as for 2.0.3. Basically that's the only difference.
Have fun.
SgtSling
11-15-2001, 03:59 AM
i usually have 100 people online at a time
wouldnt this kill my server?
DR2000
11-15-2001, 12:18 PM
Why would it kill your server? Would running vBulletin kill your server?? What's changed?
TheComputerGuy
11-15-2001, 06:59 PM
Well I like the way it looks personally...
lol I can't mek my thread titles look like links, who stole my underlines!?!?!?! :confused: :D I dunno what to do :eek:
Originally posted by LuBi
lol I can't mek my thread titles look like links, who stole my underlines!?!?!?! :confused: :D I dunno what to do :eek: See if you have an id="ltlink" in the <tr> or <td> for that cell. That can pick up CSS from the headinclude and kill the underline. If you have it, remove it and your links will look normal.
Originally posted by LuBi
Thanks Very Much! Hey, it looks like it worked. :)
fonzerelli_79
11-15-2001, 08:22 PM
when i change the template the thread name doesnt truncate
have anyone got an idea whats wrong
NYI Fan
11-15-2001, 10:01 PM
thanks!
This was easy, and looks great :)
The Realist
11-15-2001, 10:09 PM
Yes........
Anyone not using php3 please delete the no 3 from any referance within the script for the forumhome_lastpostby template.
I.E.
by <a href="member.php3?s=$session etc, etc
Just delete anything thats says php3 to read php
Works great on 2.2.0
:)
DR2000
11-16-2001, 12:06 AM
Originally posted by The Realist
Anyone not using php3 please delete the no 3 from any referance within the script for the forumhome_lastpostby template.
I.E.
by <a href="member.php3?s=$session etc, etc
Just delete anything thats says php3 to read php
Thanks. Didn't think about that one.
Alien
11-16-2001, 03:26 AM
So which one of these similiar hacks (between this and PPN's) uses the least amount of server resources and end user loadtime? :D
Mr. X
11-16-2001, 04:15 AM
Also I suggest to change the time format to 24:00 instead of 12:00 AM.
Why would this be?
Originally posted by Alien
So which one of these similiar hacks (between this and PPN's) uses the least amount of server resources and end user loadtime? :D
I had PPN's code, and it's great and all but you edit way to many files and it has no icons. With this hack you edit index.php then setup lastpostby template and boom you have yourself a thread title hack ;)
DR2000
11-16-2001, 03:42 PM
Originally posted by Mr. X
Why would this be?
If you use the default template change (the one I suggested), then with a shorter time format (24:00) it looks better. Otherwise your last post by takes up too much space. But that's only my opinion.
JTMON
11-16-2001, 03:58 PM
Installed it on my board running 2.2.0 and it works great. I noticed in the code that the max number of characters was set at 23 so I upped it. But I also saw a zero before that 23, what does that 0 control?
DR2000
11-16-2001, 05:26 PM
0 stands for the begging of string, so leave it. And you are right about 23. The title is being trunkated to 23 symbols. If you want to make it longer just change 23 to something else.
thanx will give this one a go when I'm awake next!!
Syphin
11-17-2001, 11:47 PM
I cant get this to work on 2.2.1 for some reason... >_< it just wont show up... O.o
-Syphin
Originally posted by Syphin
I cant get this to work on 2.2.1 for some reason... >_< it just wont show up... O.o
-Syphin That's weird. The only file you edit is index.php and that didn't change from 2.2.0 to 2.2.1. Are you sure you have the forumhome_lastpostby template edited correctly?
Syphin
11-18-2001, 01:06 AM
Yup im positive... =/
I got mine to work :D
I updated but it wasn't good enough, I had to instal lthat damn prefix hack and now I'm waitin for the creator to get back to me to fix his syntax error... :( :( :(
Sufian
11-18-2001, 01:57 PM
Hi,
I tried using the hack with 2.2.0 and I got this when I loaded up the forum:
Database error in vBulletin 2.2.0:
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 'WHEN icon.iconpath IS NULL THEN '' ELSE icon.iconpath END as icon, thread.title ' at line 1
What should I do? :confused:
DR2000
11-19-2001, 12:21 AM
Originally posted by LuBi
I got mine to work :D
I updated but it wasn't good enough, I had to instal lthat damn prefix hack and now I'm waitin for the creator to get back to me to fix his syntax error... :( :( :(
Er, what wasn't good enough, and what syntax error are you speaking off? I'm not aware of any.
Originally posted by DR2000
Er, what wasn't good enough, and what syntax error are you speaking off? I'm not aware of any.
lol sorry two different things, the I got mine working is to you. The other statement was personal problems, I was making a remark to the fact I tried to install this Prefix hack and it caused me a lot of trouble. Your hack and the prefix hack were the last 2 I was installing of the 20+ that were in already... ;) Thanks the hack worked great no complaints!
Sufian
11-19-2001, 09:49 AM
Can someone please help me? Again, I installed the hack and all on 2.2.0, but I got this error when I went to my forum:
Database error in vBulletin 2.2.0:
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 'WHEN icon.iconpath IS NULL THEN '' ELSE icon.iconpath END as icon, thread.title ' at line 1
DR2000
11-19-2001, 12:21 PM
Originally posted by Sufian
Can someone please help me? Again, I installed the hack and all on 2.2.0, but I got this error when I went to my forum:
Database error in vBulletin 2.2.0:
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 'WHEN icon.iconpath IS NULL THEN '' ELSE icon.iconpath END as icon, thread.title ' at line 1
Eh, don't know what you did wrong. Make sure when you were inserting lines, you didn't insert any extra line breaks... That's the only thing I could think of at this moment. Maybe some one else will have an idea where you did wrong.
Syphin
11-19-2001, 12:43 PM
I cant get this to work on any 2.2.1 forum, and ive tried on diffrent servers too... >_<
-Syphin
It's just an index.php and template hack..? Worked fine on my forum... try again I gues. goodluck ;)
Syphin
11-19-2001, 02:32 PM
i know its just a index.php and templete hack... And trust me, ive tried it on 4 diffrent boards...
Ive copy and pasted, and typed it in myself.... for some damn reason it wont work... >_< lol
-Syphin
xware
11-19-2001, 07:47 PM
bug:Can't display sub forum's last title .
but I've fixed it .
thanks. ;)
Originally posted by xware
bug:Can't display sub forum's last title .
but I've fixed it .
thanks. ;) What was the fix?
xware
11-19-2001, 08:15 PM
I'll release a new version some time later. :p
xware
11-19-2001, 09:14 PM
Originally posted by FWC
What was the fix?
in index.php and formdisplay.php
above this hack's code:
$forum['dots'] = '';
add the below code:
if($forum['thtitle']=='') {
$newtitle=$DB_site->fetch_array($DB_site->query("SELECT thread.title AS title FROM thread WHERE lastposter='$forum[lastposter]' AND thread.lastpost=$forum[lastpost]"));
$forum['thtitle']=$newtitle[title];
}
else {
$forum['thtitle']=$forum['thtitle'];
}
and I have released a hack my own.you can try that one.
DR2000
11-19-2001, 09:23 PM
I wouldn't recommend doing that. If you have 30 forums, this will query the database 30 times everytime a page is opened, and database query is a very expensive operation (speed, and load wise).
bigstar
11-19-2001, 09:32 PM
Awesome hack.. much better then all the others I have tried. The others tend to screw up if you delete/move posts.
Just one question, I don't want to show the post icons, how could I change the query code to remove that?
xware
11-19-2001, 09:38 PM
Originally posted by DR2000
I wouldn't recommend doing that. If you have 30 forums, this will query the database 30 times everytime a page is opened, and database query is a very expensive operation (speed, and load wise).
I see,but if not do this, the last title in sub forum will miss in forumhome. ;)
and this fixed code I post is only work when you have sub forum.
Originally posted by bigstar
Just one question, I don't want to show the post icons, how could I change the query code to remove that? I took the lazy way out and commented the code for the icon out in the template. :)
DR2000
11-20-2001, 01:55 AM
Originally posted by FWC
I took the lazy way out and commented the code for the icon out in the template. :)
Yep. Just edit the template.
bigstar
11-20-2001, 04:14 AM
I was referring to the sql query, surely I can remove the fragment that requests the icon. I just don't know exactly what needs to be removed.
Bitmap
11-24-2001, 05:17 AM
works great :) thanks ... tried to install ppns hack first, but all i got were parse errors. but this one is REALLY easy to install. well done
how can i exclude private forums from show their last title to every one?
Bitmap
11-25-2001, 03:58 PM
oeh ... arn't they excluded already? i have a private forum ... it isn't showing on the front page
No, they aren't... can look in my forum ( http://www.spassforen.de ). The Team-Forum is private. At the moment we make Points in the threadt title like these ...
please help... we can't use our team-forum as we want to at the moment. :(
DR2000
11-27-2001, 04:30 PM
Originally posted by AlexD
No, they aren't... can look in my forum ( http://www.spassforen.de ). The Team-Forum is private. At the moment we make Points in the threadt title like these ...
Here:
Find this:
if (!$hideprivateforums) {
and right before that line insert this:
if (!$forumperms['canview']) {
$forum['dots'] = '';
$forum['thtitle'] = 'Subject Hidden';
}
This will do it. Admins (or whoever got permissions to see that forum) will see the subject, everyone else won't. Tell me how it works out.
Thank you very much! :) That worked fine!
SugarChick
11-29-2001, 12:33 AM
Great script DR2000, fast easy install and it's great addition, ty.
Prince
11-29-2001, 05:53 PM
There is a problem with this hack, check out my screen shot!
The thread that I have circled, it says that w8lifter was the last member to post, well she was not.
She did not vote in the poll, and there are 2 posts after hers in that thread.
any ideas?
Prince
11-29-2001, 05:55 PM
here!
Prince
11-30-2001, 04:40 PM
bump!
For some reason my dost don't show up, I believei t's because I have one really long topic down at the bottom of my site... could anyone take a look at assist me in fixing this problem?
Suprascene.com (http://www.suprascene.com)
Basically one title takes up to much room so now everything is spaced wrong.. :(
DR2000
12-12-2001, 06:21 PM
Just use the html that I've provided. It optimizes the space use. I don't want to put anyone down, but if you are not really proficient with HTML why change something that works?
Because I don't want it on the right.. I had a code that I did the html to before and it worked but now with 2.2.1 that code no longer works or atleast is more of a hog. Could you make the code for me since some are not as proficient as others.. :rolleyes: ;)
Island Roots
12-13-2001, 02:39 AM
Is there a way to add this hack but keep the Last Post icon instead of replacing it with the post icon selected by the author? I ask this because I don't want to have a blank space if there is no post icon selected. So basically what I'm asking is...is there a hack that enables you to just show the latest thread name, but not replace the Last Post icon? I'll go look in the text file and see if I can tweak it around a little bit.
Well I fixed my problem with the hack, but now I need to know:
If I can get this hack to display the icon put up by this one.
https://vborg.vbsupport.ru/showthread.php?s=&threadid=19739? Thanks!
DR2000
12-13-2001, 04:43 PM
Guys, look at the code. It really isn't hard to figure out.
See where it says /some_path/clear.gif? Just replace that with any other image url, and that's it. For example, vbulletin substitues icon1 when you enable an option. So you can change clear.gif to that icon1.gif. I think that's a lot of hint.
If you guys don't figure it out, ask again, I'll help you out.
P.S. See, I'm teaching you how to mess with other people's code too, so later on you'll be creating your own hacks. :)
Thanks very kindly sir, what I ended up doing was create my own custom image 15x15pix then have the code substitute that whenever there is no icon. In postbit I added a clear to each side of where the icon would be and also justified that cell to the left. So now it's a clean look with space enough for titles and icons. Lookin sharp!
Also my problem before was I changed one of the numbers in the code to like 15 and the other was 23, if you change the amount of characters shown make sure to change both to the same.
Thanks for all your help DR2000! sweet hack! :D
Island Roots
12-14-2001, 02:14 AM
Whenever I make the lastpost icon the default image instead of clear.gif, it keeps making the image with a black bar on the right and bottom sides of the image...like the size isn't right. I tooled around with it earlier to no avail.
DR2000
12-14-2001, 04:03 AM
That's because the image is 14 x 14, not 15 x 15, but looks like you already figured that one out.
Sorry I should have made that more clear I used the https://vborg.vbsupport.ru/external/2011/06/14.gif to make my custom clear image.. :D
Lesane
12-18-2001, 08:50 PM
DR2000, xware showed some posts before how u can display subforums aswell on the main page. That code will slow the database because of the many extra querys. Do you know a other way, that dont affect the database that much, that will work?
Originally posted by Lesane
DR2000, xware showed some posts before how u can display subforums aswell on the main page. That code will slow the database because of the many extra querys. Do you know a other way, that dont affect the database that much, that will work?
This code slows the forums down? Or are you asking of a way to make this code do what the code you speak of does?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.