PDA

View Full Version : Last Active Thread Display


fastforward
25 May 2001, 01:47
This is for vB 2.01

This little hack allows the display of the last active thread on the forums pages. This is the 'UBB like' feature. You can see an example at http://dbforums.com.

NOTES
It requires two extra column to be added in the forum table a few code additions and then the thread title and iconid can be referenced using the variables $forum[lastactivethread] and icon$forum[lastactiveiconid].gif. Instructions are in the attachment.

This was originally part of my usenet hack and due to popular request ( all two of them :D ) I'm releasing it seperately.

eva2000
25 May 2001, 06:34
nice but what happesn with very long thread titles ?

h4p3
25 May 2001, 07:53
I think they are cut off, if they are too long.

Degen
25 May 2001, 08:20
Looks like an awesome hack, and I really want to get it going, but I have no idea how to :

1) Run the following SQL statement:

ALTER TABLE forum ADD lastactivethread VARCHAR (64);

Is their an easy way to do this?

Thanks

eva2000
25 May 2001, 08:26
Originally posted by Degen
Looks like an awesome hack, and I really want to get it going, but I have no idea how to :

1) Run the following SQL statement:

ALTER TABLE forum ADD lastactivethread VARCHAR (64);

Is their an easy way to do this?

Thanks you can run that via phpmyadmin you can get it from www.phpwizard.net

nuno
25 May 2001, 11:21
great hack fastforward
any chance to show last post icon also?:D
tx

h4p3
25 May 2001, 12:39
Hm, i noticed that it doesn't work correctly at dbforums.com. If you click on the last post icon, you will get only a blank page.

fastforward
25 May 2001, 13:30
Originally posted by h4p3
Hm, i noticed that it doesn't work correctly at dbforums.com. If you click on the last post icon, you will get only a blank page.
That's a template issue. It has nothing to do with the hack. All the hack does is create a new variable that can be accesed via the forum home pages.

fastforward
25 May 2001, 13:33
Originally posted by eva2000
nice but what happesn with very long thread titles ?
The default length of the title is 45. This is controlled by the variable $lastactivethread_length.

If you want it longer, add a line to your config_inc.php that reads

$lastactivethread_length=64;

or whatever. If you need it longer than 128, you will also need to increase the table column width.

eva2000
25 May 2001, 13:36
Originally posted by fastforward

The default length of the title is 45. This is controlled by the variable $lastactivethread_length.

If you want it longer, add a line to your config_inc.php that reads

$lastactivethread_length=64;

or whatever. If you need it longer than 128, you will also need to increase the table column width. thanks gonna try this out locally first :)

h4p3
25 May 2001, 13:46
Originally posted by fastforward

That's a template issue. It has nothing to do with the hack. All the hack does is create a new variable that can be accesed via the forum home pages.

Ok, i just wanted to mention it ;)

h4p3
25 May 2001, 16:47
Tested it on my local server and it works fine.

Thx fastforward!

Hm, one suggestion: if you move/delete a Topic, then you will see still the Title on the main site, or the wrong one if you have moved it.

Perhaps you can improve it a little :)

fastforward
25 May 2001, 17:48
Originally posted by h4p3
Tested it on my local server and it works fine.

Thx fastforward!

Hm, one suggestion: if you move/delete a Topic, then you will see still the Title on the main site, or the wrong one if you have moved it.

Perhaps you can improve it a little :)
Yeah... this is a problem with the location of the call to the indexpost() function from the move thread vB functions. I actually moved the call on my setup but that was with RC3 I was hoping it may not be an issue with the release version. I didn't move it on the hack release because I'm not sure what other implications it may have. I'll do some more testing and see if it's safe to move the function call.

h4p3
25 May 2001, 17:51
Great! :D

*waiting*

fastforward
25 May 2001, 17:53
Originally posted by nuno
great hack fastforward
any chance to show last post icon also?:D
tx
I knew someone was going to ask for that :)

The reason it's not there already is because I wanted to keep this as simple as possible, but mainly because I didn't want to cause the thread listings to generate any more queries than other than the standard vB ones.

Having said that, it wouldn't be too difficult to add an additional column containing the icon reference that could be called from the template in the same way as the title. The trouble is, with every column added and every extra line of code there's more to go wrong :)

I'll provide optional additions to the existing hack that will allow the title icon this weekend. That way people will have a choice of whether to implement it.

amykhar
25 May 2001, 19:13
I am seeing a bug. It is consistantly displaying the title of the post one post BEFORE the last post. It worked the first time through, meaning that the first post that was made after the hack was installed registered correctly. Now, it is consistantly one behind.

Amy

fastforward
25 May 2001, 21:27
Originally posted by amykhar
I am seeing a bug. It is consistantly displaying the title of the post one post BEFORE the last post. It worked the first time through, meaning that the first post that was made after the hack was installed registered correctly. Now, it is consistantly one behind.

Amy
:confused:

Anybody else seeing this? I can't seem to reproduce it.

h4p3
26 May 2001, 07:21
Nope, don't noticed such a problem.

nuno
26 May 2001, 13:06
fastforward
this shouldnt show private forums threadtitles :confused:

h4p3
26 May 2001, 14:18
Originally posted by nuno
fastforward
this shouldnt show private forums threadtitles :confused:

If you enable "Private forum (Invisible to all except moderators and admins; user access masks must be on!) - YES", then only Mods, Admins and authorized Users can view the forum and so the thread titles.

nuno
26 May 2001, 14:43
Originally posted by h4p3


If you enable "Private forum (Invisible to all except moderators and admins; user access masks must be on!) - YES", then only Mods, Admins and authorized Users can view the forum and so the thread titles.

yup, but i dont want to hide them, i just want to hide threadtitles

h4p3
26 May 2001, 14:44
Hm, maybe fastforward will think of this for the next updated release :)

fastforward
26 May 2001, 16:47
I never actually considered this as I don't use private forums. But, I agree, they shouldn't be shown. I'll add the option this weekend.

h4p3
26 May 2001, 17:28
fastforward is tha man! :D

nuno
26 May 2001, 17:30
tx ;)

antilife
26 May 2001, 17:41
I've had some luck installing a few other hacks but I can't work out what you mean by running a SQL statement. Could you explain again how to set this hack up for a novice.

Cheers

h4p3
28 May 2001, 17:26
Hm, still waiting for an updated version ;)

nuno
01 Jun 2001, 20:11
Originally posted by h4p3
Hm, still waiting for an updated version ;)
yup me too :D

fastforward
01 Jun 2001, 20:37
OK.. OK! I'll do something this weekend. I can't remember what I was supposed to be doing though :rolleyes:

Someone remind me.

h4p3
01 Jun 2001, 20:42
Hehe,

Correct displaying of the last replied Thread on the forum main site, if a thread was deleted or moved.

Someone wanted the feature with the right icons too, i think.

nuno
01 Jun 2001, 21:36
- posticons (new feature) :D
- hide private forums threadtitles (fix) :confused:

huythuy
03 Jun 2001, 01:44
I find error . Whenever users edit their post subject it won't update the lastthread . Any workaround?

fastforward
03 Jun 2001, 02:56
Originally posted by huythuy
I find error . Whenever users edit their post subject it won't update the lastthread . Any walkaround?
There is a work round, but it will complicate the hack unnecesarily. At the moment, it simply updates whenever vB re-indexes that thread. I'm sorry, but I don't want to over-complicate this hack by making changes to allow for something that happens so rarely. Every additional change means more testing, more supporting, more things to go wrong, etc etc. :)

Actually, this is really a vB bug as it should re-index the the post if the title changes.

If you want to make the changes yourself, you should look at the postings.php and the editthread routine.

huythuy
03 Jun 2001, 03:02
no thanks :D hehe

Have a happy weekend man ;)

h4p3
03 Jun 2001, 07:48
Originally posted by huythuy
I find error . Whenever users edit their post subject it won't update the lastthread . Any workaround?

The hack doesn't have the bug, it is vbulletin ;)

fastforward
06 Jun 2001, 04:18
I've finally got around to adding the icon. The new version is in the first post of this thread.

I haven't added an option to hide private forums and probably never will. It will add too much complexity as you will have to check against the user and permissions for each page view. At the moment, there is only one file to edit and there are no extra queries to do; it simply gets the information from the forum table along with everything else.

fastforward
06 Jun 2001, 04:56
Looks like there is a bug with attachments. It deleted my attachement and won't let me add another. I'll have to start a new thread.

Raptor
30 Jun 2001, 00:42
Originally posted by fastforward

:confused:

Anybody else seeing this? I can't seem to reproduce it.

yep i'm getting the exact same thing

if I make a new post it shows up correctly - but after a while it seems to log the name of the SECOND thread down not the LAST one

weird ?

http://digital-forums.com/forum/