PDA

View Full Version : LastTitleHack


Afterburner
07-14-2001, 10:00 PM
Deutsch:

Dieser Hack zeigt in der Spalte Letzter Beitrag unter dem Datum und den Usernamen des letzten Posters auch den Titel des Topics an.

um euch den hack anzusehen klickt hier:

www.the-afterburner.de

English:

This hack shows in the row "last post" on the mainpage below the date and the username of the last posting also the title of the last posting.

to see the hack in action click here:

www.the-afterburner.de

UPDATE: 8. September 2001 to Version 2
New:

You can set the length of the title in your CP
If a word is loger than your settings there are ... at the end
works also in subcategories
Link to the last posting

Afterburner
07-15-2001, 07:47 PM
here is a screenshot:

NanoEntity
07-15-2001, 09:15 PM
Nice hack, dose this limit how long the topic can be?

like to 25 characters then it breaks it with a seperator like >

Afterburner
07-15-2001, 09:29 PM
the text can contain only 20 letters but you can change this in your MySQL Database.

forum
--> lasttitle

and set it to a higher one

NanoEntity
07-15-2001, 09:58 PM
I see, thanks, very nice!

ztsky
07-16-2001, 05:27 AM
I've done everything,but it does not change,why?:( :(

Znaper
07-16-2001, 05:44 AM
Open yout lasttitlehack.php and change the line


$DB_site->query("ALTER TABLE forum ADD lasttitle VARCHAR (20) not null");


to


$DB_site->query("ALTER TABLE forum ADD lasttitle VARCHAR (25) not null");

maverick1236
07-16-2001, 09:26 AM
ive done everything word for word-but it all looks the same

any more suggestions?

mojotim
07-16-2001, 10:17 AM
Checked and triple checked, still no go for me.
Getting no data in the lasttitle column in the database on new posts.

Afterburner
07-16-2001, 10:48 AM
sorry I forgot a little bit, I think it was to late yesterday.


If you have already installed this hack and nothing is shown on the manpage please download the hack again or follow this instructions:


download the "newthread.php" into ASCII Mode and backup this file.


look for this code (ca. line 230):


// update forum stuff
if ($visible==1) {
$DB_site->query("UPDATE forum SET replycount=replycount+1,threadcount=threadcount+1, lastpost='".time()."',lastposter='".addslashes($postusername)."' WHERE forumid IN ($foruminfo[parentlist])");
}


replace it with:


// update forum stuff
if ($visible==1) {
$DB_site->query("UPDATE forum SET replycount=replycount+1,threadcount=threadcount+1, lastpost='".time()."',lastposter='".addslashes($postusername)."', lasttitle='".addslashes(htmlspecialchars($subject))."' WHERE forumid IN ($foruminfo[parentlist])");
}


save the "newthread.php" and upload it into ASCII Mode.


download the "newreply.php" into ASCII Mode and backup this file.


look for this code (ca. line 278):


// update forum stuff
if ($visible==1) {
$DB_site->query("UPDATE forum SET replycount=replycount+1,lastpost='".time()."',lastposter='".addslashes($postusername)."' WHERE forumid IN ($foruminfo[parentlist])");
}


replace it with:


// update forum stuff neuster beitrag auf der startseite
if ($visible==1) {
$DB_site->query("UPDATE forum SET replycount=replycount+1,lastpost='".time()."',lastposter='".addslashes($postusername)."', lasttitle='".addslashes(htmlspecialchars($threadinfo[title]))."' WHERE forumid IN ($foruminfo[parentlist])");
}


save the "newreply.php" and upload it into ASCII Mode.

ztsky
07-17-2001, 09:13 AM
thank you.
works well.
but two bugs:
1.the hack is work for new post after install this hack.
2.when you tansfer a thread to other post ,the LastTitle on resorce forum doen't change.

maverick1236
07-17-2001, 09:24 AM
Thank You!!

Afterburner
07-17-2001, 04:57 PM
the first isn't a bug because the lasttitle table in your database will create with the hack, thats mean earlier there aren´t any entrys

2. I will try to fix this

Ajnabi
07-17-2001, 08:41 PM
is there a way to make this hack appear in the forum Discription?

mojotim
07-18-2001, 12:58 AM
Thanks, very useful hack!

Afterburner
07-18-2001, 02:01 PM
yes, you have to insert the:

$showlastpostingtitle

in the board description template

Ajnabi
07-18-2001, 04:56 PM
thx man.... it worked!

Mr. X
07-19-2001, 02:10 PM
Im having problems. What template do I hack? in the instructions it says:

"forumhome_lastpostby"

what is this file? Where do I get it? Keep in mind Im a total idiot when it comes to this stuff :)

Afterburner
07-19-2001, 02:23 PM
go to your ControlPanel
go to the Templates section and click edit
click on expand list in your choosen template
click on expand in Forum Home Page Templates
click on edit in forumhome_lastpostby

Mr. X
07-19-2001, 02:29 PM
Thanx, I was able to figure out after posting that :)

But I had a major problem. When I got done with that part, I tried to enter my Control Panel. When I logged in, it showed me a very messed up version of my board, all graphics missing, default colors etc. I had to restore the index.php3 file from a backup I made before editing. I did everything from your instructions.txt. Were those updated with the new code that you repliied down below?

Btw, heres how I editied my template. Is it correct?

<table cellpadding="0" cellspacing="0" border="0" width="100%" id="ltlink"><tr align="right">
<td nowrap><smallfont>$forum[lastpostdate] <font color="{timecolor}">$forum[lastposttime]</font><br>
by <a href="member.php3?s=$session[sessionhash]&action=getinfo&find=lastposter&forumid=$forum[forumid]"><b>$forum[lastposter]</b></a><br><b>$showlastpostingtitle</b></smallfont></td>
<td nowrap>&nbsp;<a href="showthread.php3?s=$session[sessionhash]&goto=lastpost&forumid=$forum[forumid]"><img src="{imagesfolder}/lastpost.gif" border="0" alt="Go to last post"></a></td>
</tr></table>

Afterburner
07-19-2001, 02:45 PM
did you changed your template to another template ?
I cant see an problem if you follow the instructions
if you want, contact me on ICQ (please remember I am from Germany so choose easy words)

Ajnabi
07-20-2001, 04:25 AM
ok... it worked on a test forum.... but when i tried it on the real thing i got this error

Database error in vBulletin Control Panel: Invalid SQL: ALTER TABLE forum ADD showlasttitle CHAR (3) not null
mysql error: Duplicate column name 'showlasttitle'
mysql error number: 1060


Any suggestions?

Afterburner
07-20-2001, 06:28 AM
the error: "Duplicate column name" means you have installed the hack before (means opened already the lasttitlehack.php) and the "showlasttitle" entry is already in your database. You can see this if you go to your mysql database and look into the forum table. There must be the entrys:

showlasttitle and lasttitle

if there are both entrys you have only to mofidy the code in the files and the templates and not to run the lasttitlehack.php file

Ajnabi
07-20-2001, 01:57 PM
alright... i'll try that... thx for all the help!

joecrow
08-24-2001, 10:07 AM
does it work with vbb 2.0.3?

Afterburner
08-24-2001, 10:28 AM
yes

LuBi
09-02-2001, 01:02 PM
Read it works on 2.0.3, yet I'm at the part in my instructions to edit the index.php and cannot find the proper code that needs to be replaced that it says can be found around Line 264. How can I edit this to work properly?

LuBi
09-03-2001, 04:03 AM
Really Need Some Help on This one...In the middle of my hacking, and am now stuck with no forum and no hack.

Afterburner
09-03-2001, 06:38 AM
line 264 is correct, there starts the code:

// dates
if ($forum['lastpost']>0) {
$forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
$forum['lastposttime']=vbdate($timeformat,$forum['lastpost']);
eval("\$forum['lastpostinfo'] = \"".gettemplate('forumhome_lastpostby')."\";");
} else {
$forum['lastpostinfo']='Never';
}

LuBi
09-03-2001, 02:59 PM
I'm using 2.0.3, I don;t have that paragraph in my index.php

LuBi
09-03-2001, 03:20 PM
Found my problem I was using the wrong index.php you should clearly state to leave /admin and edit the other index.php. In any case great gack works now. But how do I make the title a link to the thread and then go to newest one, or that thread. Also how do I make it look like this

http://www.suprascene.com/images/infopop.gif

I want a UBB style last post coulmn, mostly my problem is adding the users icon and also putting it in what seems to be a different cell or something.

LuBi
09-03-2001, 06:03 PM
See below is a picture of my forums current Last Post coulmn. I made it so when you click the title of lastpost it takes you to the post. What I now need to do is move that table or cell over to the left and not be on the right side.

http://www.suprascene.com/images/vbulletin.gif

Need some bigtime help, also below is my current forumhome_lastpostby template.

<table cellpadding="0" cellspacing="0" border="0" width="100%" id="ltlink"><tr align="right">
<td nowrap><smallfont>$forum[lastpostdate] <font color="{timecolor}">$forum[lastposttime]</font><br>
by <a href="member.php?s=$session[sessionhash]&action=getinfo&find=lastposter&forumid=$forum[forumid]"><b>$forum[lastposter]</b></a><br></smallfont></td>
<td nowrap>&nbsp;<a href="showthread.php?s=$session[sessionhash]&goto=lastpost&forumid=$forum[forumid]"><smallfont><b>$showlastpostingtitle</b> <alt="Go to last post"></a></smallfont></td>
</tr></table>

Make from that what you can, if you wish edit it and either email it to me or repost it with the correct script/code.

THANKS YOU SOOOOO MUCH!?!

Bane
09-03-2001, 10:07 PM
Give this a try

<table cellpadding="0" cellspacing="0" border="0" width="100%" id="ltlink"><tr align="right">
<td nowrap><smallfont><a href="showthread.php?s=$session[sessionhash]&goto=lastpost&forumid=$forum[forumid]"><smallfont><b>$showlastpostingtitle</b> <alt="Go to last post"></a>(<a href="member.php?s=$session[sessionhash]&action=getinfo&find=lastposter&forumid=$forum[forumid]"><b>$forum[lastposter]</b></a>)<br>
$forum[lastpostdate] <font color="#666686">$forum[lastposttime]</font><br></smallfont></td>
</tr></table>

LuBi
09-03-2001, 10:21 PM
Great as usual bane, now my next step is how do I put the icon of the thread to the left of everything.

Also how do I make it so when the title of the thread passes the set 20 letters it like makes the last 3 "..."

So for instance my Title Thread is "Welcome to the best forum" which is 26 characters long. My default length is 20 so it makes it look like "Welcome to the best". But I need it to make it look like "Welcome to the be.." I dunno how to explain more. Any help would be great

Thomas P
09-05-2001, 05:33 PM
Hi Afterburner,
great hack, as usual :)
Thanx for the hack, what LuBi suggested sounds good to me, is that doable?

Funzt ohne Ende, gute Arbeit - wie immer eigentlich.
Das was Lubi da vorschl?gt, den Titel "auszupunkten" ab
einer bestimmten L?nge klingt ?brigens supi - ist das ?berhaupt machbar?

Danke f?r den hack!

cu & Gr??e,
-Tom

Afterburner
09-05-2001, 07:24 PM
OK I set it to my TODO list

Admin
09-05-2001, 07:29 PM
[QUOTE]Originally posted by LuBi
Also how do I make it so when the title of the thread passes the set 20 letters it like makes the last 3 "..."

So for instance my Title Thread is "Welcome to the best forum" which is 26 characters long. My default length is 20 so it makes it look like "Welcome to the best". But I need it to make it look like "Welcome to the be.." I dunno how to explain more. Any help would be great

Thomas P
09-06-2001, 11:19 AM
Originally posted by Afterburner
OK I set it to my TODO list

Thanks Afterburner :)

How difficult would it be to get the last title of posts into the category view (when you click on a category containing forums e.g.)?
thx,
-Tom

Afterburner
09-07-2001, 07:25 AM
I think this isn?t difficult. But at the moment my wife is at home and I need silence *g* for my work :D and not "Hello Baby", "Do you love me", "Please tell me..." and so on :p

Afterburner
09-07-2001, 05:10 PM
OK, I finised the hack and will upload the new version as soon as possible.

New:

You can set the length of the title in your CP
If a word is loger than your settings there are ... at the end
works also in subcategories

Afterburner
09-07-2001, 05:58 PM
OK I uploaded the hack, to download the new version of this hack go to the first post

Thomas P
09-08-2001, 08:29 AM
Perfect!
Works very well! :D

Small question: Is there a possibility to update old threads to show the title...?

<german>
Sorry, ist ein wenig bl?d zu erkl?ren und eigentlich nicht wichtig - bin nur neugierig ;)
Kann man den lasttitle auch f?r alte Beitr?ge updaten, so da?
die ?nderungen nicht erst f?r neue Beitr?ge wirksam werden?
<german>

thx,
-Tom

Afterburner
09-08-2001, 08:46 AM
at the moment: no

<german>
Geht im Moment nicht, ich habe mir gerade mal Dein Board angesehen udn Du hast ja gar nicht meinen Hack eingebaut sondern einen anderen. Danke noch für den Tip mit der update datei, ist unwichtig die meldung aber ich werde es rausnehmen.
<german>

Thomas P
09-08-2001, 08:51 AM
Originally posted by Afterburner
<german>
Geht im Moment nicht, ich habe mir gerade mal Dein Board angesehen udn Du hast ja gar nicht meinen Hack eingebaut sondern einen anderen. Danke noch f?r den Tip mit der update datei, ist unwichtig die meldung aber ich werde es rausnehmen.
<german>

<german>
?hhh?? Klaro ist das Deiner! So doof bin ich nu wirklich nicht ;)
Habe nur Apostrophe hinzugef?gt, die Farbe ge?ndert und den Text kursiv gesetzt- das ist alles.
Nichts f?r ungut :D und danke f?r die M?he!
-Tom
</german>

Afterburner
09-08-2001, 09:09 AM
next addon:

If you want to use the last title as a link to the last posting go to your cp and edit the forumhome_lastpostby template

look for:

<b>$showlastpostingtitle</b>

replace it with:

<a href="showthread.php?s=$session[sessionhash]&goto=lastpost&forumid=$forum[forumid]"><b>$showlastpostingtitle</b></a>

I insert this in the hack at 12:11 o´clock German time (8.September 2001)

Lian
09-08-2001, 10:31 AM
great hack Afterburner!
Thank you - Danke!

Afterburner
09-08-2001, 12:53 PM
@ Lian

<german>
Du linkst ja zum selben Board wie Thomas P :D
<german>

Lian
09-08-2001, 01:48 PM
Hi,
ja, ich gehöre -wie Tom- zum Forenstaff.
Lian

Baptizer
09-10-2001, 01:43 PM
great hack afterburner!!! i have a quick question, after installing the new updated version, exactly where in the control panel can we change the number of characters to be displayed? i cant seem to find the option...

Afterburner
09-10-2001, 02:04 PM
Forums and Moderators
-> modify
--> Edit the settings for the Last-Title-Hack

and this is a screenshot:



http://www.the-afterburner.de/lastshot.JPG

Baptizer
09-10-2001, 02:08 PM
very sweet...thank you afterburner!

Phil
09-10-2001, 03:17 PM
Excellent, Thanks you for another great hack :) I wonder if you can help me solve a small prob? When posts have symbols in the title, they are rendered as ACSII in the last title area. Is it possible for these symbols to be rendered correctly?

Afterburner
09-10-2001, 03:23 PM
Did you upload this symblos into ASCII Mode ? If yes upload the symbols in BINARY Mode

Phil
09-10-2001, 03:34 PM
What I mean is, we have a thread titled ">>All posts here Siggy<<" but it gets rendered on the front page by your hack as "&gt;&gt;All posts here siggy&lt;&lt;"

Afterburner
09-10-2001, 03:42 PM
OK I understand and will try to fix this

Phil
09-10-2001, 03:53 PM
Originally posted by Afterburner
OK I understand and will try to fix this


Excellent, Thanks :D

fury
09-22-2001, 03:27 AM
Great hack, d00d :D

I second this bug notification by ztsky on the first page: 2.when you tansfer a thread to other post ,the LastTitle on resorce forum doen't change.

If this could be fixed, that'd be very appreciated by me since threads get moved to other forums quite a bit on the board I installed this hack on (ygm, btw)

bbqfan
09-23-2001, 09:58 AM
wow, another... i found...
i have posted the new code of similar hack:
http://www.vbulletin.com/forum/showthread.php?s=&threadid=28489

maybe it interests you... :)

P@ul_tje
09-27-2001, 10:52 PM
DAMMN i would really like 2 get the hack but i got a failure @

look for this code:

// dates
if ($forum['lastpost']>0) {
$forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
$forum['lastposttime']=vbdate($timeformat,$forum['lastpost']);
eval("\$forum['lastpostinfo'] = \"".gettemplate('forumhome_lastpostby')."\";");
} else {
$forum['lastpostinfo']='Never';
}

i could not find it in Index.php3 :(

hacker
10-02-2001, 10:59 AM
Originally posted by ztsky
thank you.
works well.
but two bugs:
1.the hack is work for new post after install this hack.
2.when you tansfer a thread to other post ,the LastTitle on resorce forum doen't change.

This is indeed one of the best hacks even though it took such a long time to complete. If you have installed the Sponsor hack, remember to check the code before you simply replace them.

Just to add on regarding point (2), when you delete the post, the Title still remains...

JZarate
10-07-2001, 10:00 PM
the last post <td> larger. I looks a little crowded and I want to make it larger.

hacker
10-10-2001, 06:15 AM
Strange error when installed.... ???

Database error in vBulletin Control Panel: Invalid SQL: UPDATE forum SET parentlist=',51,-1' WHERE forumid=
mysql error: You have an error in your SQL syntax near '' at line 1
mysql error number: 1064
Date: Sunday 07th of October 2001 08:34:37 AM
Script: /forums/admin/forum.php

Afterburner
10-10-2001, 07:26 AM
where do you get this error ?

hacker
10-10-2001, 09:47 AM
Nevermind, I reinstalled the whole thing.... :).

nuno
10-13-2001, 03:00 PM
dang
gr8 hack m8
does it show lastpost icon also?
TIA :)

Afterburner
10-14-2001, 07:16 AM
Originally posted by nuno
dang
gr8 hack m8
does it show lastpost icon also?
TIA :)

no, not at the moment

Mr. X
10-14-2001, 07:52 AM
I had some probs installing the hack as you can see from my previous post, but I will wait until you fix the delete/move features. I hope you do that, cuz I cant wait to install this hack again (on my own system first :)).

Afterburner
10-14-2001, 08:07 AM
Originally posted by Mr. X
I had some probs installing the hack as you can see from my previous post, but I will wait until you fix the delete/move features. I hope you do that, cuz I cant wait to install this hack again (on my own system first :)).

do you have more than one template ?
then you have to modify all templates, this hack doesn?t change any colors or remove any graphics

Mr. X
10-14-2001, 08:08 AM
Not that Im aware of. I have several themes if thats what you mean, but no hacks installed. Hell I dont think I ever touched templates before so my board is running stock code.

It was probly just a dumb error on my part. I dont understand any of this, I just cut and paste, and I probly made some syntax mistakes somewhere.

Afterburner
10-14-2001, 08:13 AM
Originally posted by Mr. X
I probly made some syntax mistakes somewhere.

I think this catched it.
If you did the changes only in one template the last posting title is only in this template available.

If you are a amateur let it be to change the template or make a complett backup of the database and all files before trying again.

Thomas P
10-14-2001, 10:45 AM
Hi Afterburner,
your hack works awesome on our forums, just two questions:

Any chance to get an "update 'last thread title'" feature and a correct handling of special chars like " (instead of &quot;

I have no idea if this is hard to do, that's why I am asking...
Thanks,
-Tom

Afterburner
10-14-2001, 12:42 PM
I know the problem and will fix it as soon as possible but no time at the moment to do this because I have another project (www.jg-scripts.de)

CEDsoft
10-26-2001, 04:38 AM
Awesome hack!

I have noticed one problem, perhaps I did something wrong, but when the last post is deleted the topic still shows it as last title.

[update]

Also It appears moving a topic doesn't update the last title either.

jamie
10-27-2001, 10:31 AM
great hack :D

installed on my test board fine, i'll just play about to try and get the icos and the & character things done...hehe.

gmtalk
11-02-2001, 10:37 PM
Any one test this out on 2.2.0? i had it on my 2.0.3 and it ran well. have not tried it in 2.2.0.

:)

webhost
11-03-2001, 03:05 AM
Yea think it needs a little work, had problems with it on 2.2 If I remember right in was in functions.php didn't like it much will look at it tomorrow.

Thomas P
11-04-2001, 08:54 AM
Works in 2.2.0 for me, I had problems replying to a poll, but it proved to be from another hack.
cu,
-Tom

Scott MacVicar
11-04-2001, 09:01 AM
The one within my sig is working on vb 2.2.x and 2.0.x

Thomas P
11-04-2001, 09:06 AM
Well ... this one, too :D

Why don't you both work together on a more perfect "Lasttitle hack"? We don't need two, do we. ;)
But thanks for offering your alternative!

Just two questions to your implementation:
-What happens with the lasttitle if you move/delete or change threads?
-What happens if the thread title contains chars like " or ' etc.?

Thanks so far,
-Tom

Scott MacVicar
11-04-2001, 09:27 AM
if you delete or move it goes back to the next newest one in the forum and if you have characters like " it just uses the htmlspecialchars function then the unhtmlspecialchars function before showing it, this version also works on forumdisplay if you have sub forums within a forum.

Mine is based on a modification to the function that updates the post counts, thread counts and last poster name for the forum home page.

It also modifies the newreply, postreply and editpost files.

Killsparer
05-01-2003, 06:05 PM
*years later*

Does this hack still work with 2.3.0,
or does anybody know a alternative modification?