PDA

View Full Version : LastTitleHack


Afterburner
15 Jul 2001, 21:44
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
15 Jul 2001, 21:47
here is a screenshot:

NanoEntity
15 Jul 2001, 23:15
Nice hack, dose this limit how long the topic can be?

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

Afterburner
15 Jul 2001, 23:29
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
15 Jul 2001, 23:58
I see, thanks, very nice!

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

Znaper
16 Jul 2001, 07:44
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
16 Jul 2001, 11:26
ive done everything word for word-but it all looks the same

any more suggestions?

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

Afterburner
16 Jul 2001, 12:48
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
17 Jul 2001, 11:13
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
17 Jul 2001, 11:24
Thank You!!

Afterburner
17 Jul 2001, 18:57
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
17 Jul 2001, 22:41
is there a way to make this hack appear in the forum Discription?

mojotim
18 Jul 2001, 02:58
Thanks, very useful hack!

Afterburner
18 Jul 2001, 16:01
yes, you have to insert the:

$showlastpostingtitle

in the board description template

Ajnabi
18 Jul 2001, 18:56
thx man.... it worked!

Mr. X
19 Jul 2001, 16:10
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
19 Jul 2001, 16:23
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
19 Jul 2001, 16:29
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
19 Jul 2001, 16:45
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
20 Jul 2001, 06:25
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
20 Jul 2001, 08:28
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
20 Jul 2001, 15:57
alright... i'll try that... thx for all the help!

joecrow
24 Aug 2001, 12:07
does it work with vbb 2.0.3?

Afterburner
24 Aug 2001, 12:28
yes

LuBi
02 Sep 2001, 15:02
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
03 Sep 2001, 06:03
Really Need Some Help on This one...In the middle of my hacking, and am now stuck with no forum and no hack.

Afterburner
03 Sep 2001, 08:38
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
03 Sep 2001, 16:59
I'm using 2.0.3, I don;t have that paragraph in my index.php

LuBi
03 Sep 2001, 17:20
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
03 Sep 2001, 20:03
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
04 Sep 2001, 00:07
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
04 Sep 2001, 00:21
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
05 Sep 2001, 19:33
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
05 Sep 2001, 21:24
OK I set it to my TODO list

Chen
05 Sep 2001, 21:29
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
I don't know the code, and I'm not gonna go thru all posts in this thread, but anyway.
To select the first X characters from a field, select "LEFT(fieldname,X)".
So bascially you'd need to select the first 17 chars, and then manually add ... at the end.

Thomas P
06 Sep 2001, 13:19
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
07 Sep 2001, 09:25
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
07 Sep 2001, 19:10
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
07 Sep 2001, 19:58
OK I uploaded the hack, to download the new version of this hack go to the first post

Thomas P
08 Sep 2001, 10:29
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
08 Sep 2001, 10:46
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
08 Sep 2001, 10:51
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
08 Sep 2001, 11:09
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
08 Sep 2001, 12:31
great hack Afterburner!
Thank you - Danke!

Afterburner
08 Sep 2001, 14:53
@ Lian

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

Lian
08 Sep 2001, 15:48
Hi,
ja, ich gehöre -wie Tom- zum Forenstaff.
Lian

Baptizer
10 Sep 2001, 15:43
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
10 Sep 2001, 16:04
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
10 Sep 2001, 16:08
very sweet...thank you afterburner!

Phil
10 Sep 2001, 17:17
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
10 Sep 2001, 17:23
Did you upload this symblos into ASCII Mode ? If yes upload the symbols in BINARY Mode

Phil
10 Sep 2001, 17:34
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
10 Sep 2001, 17:42
OK I understand and will try to fix this

Phil
10 Sep 2001, 17:53
Originally posted by Afterburner
OK I understand and will try to fix this


Excellent, Thanks :D

fury
22 Sep 2001, 05:27
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
23 Sep 2001, 11:58
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
28 Sep 2001, 00:52
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
02 Oct 2001, 12:59
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
08 Oct 2001, 00:00
the last post <td> larger. I looks a little crowded and I want to make it larger.

hacker
10 Oct 2001, 08:15
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 Oct 2001, 09:26
where do you get this error ?

hacker
10 Oct 2001, 11:47
Nevermind, I reinstalled the whole thing.... :).

nuno
13 Oct 2001, 17:00
dang
gr8 hack m8
does it show lastpost icon also?
TIA :)

Afterburner
14 Oct 2001, 09:16
Originally posted by nuno
dang
gr8 hack m8
does it show lastpost icon also?
TIA :)

no, not at the moment

Mr. X
14 Oct 2001, 09:52
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
14 Oct 2001, 10:07
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
14 Oct 2001, 10:08
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
14 Oct 2001, 10:13
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
14 Oct 2001, 12:45
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
14 Oct 2001, 14:42
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
26 Oct 2001, 06:38
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
27 Oct 2001, 12:31
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
03 Nov 2001, 00:37
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
03 Nov 2001, 05:05
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
04 Nov 2001, 10:54
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
04 Nov 2001, 11:01
The one within my sig is working on vb 2.2.x and 2.0.x

Thomas P
04 Nov 2001, 11:06
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
04 Nov 2001, 11:27
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
01 May 2003, 20:05
*years later*

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