PDA

View Full Version : On.gif = Link to latest threads in forum


Austin Dea
08-16-2002, 10:00 PM
Requested by Boofo (https://vborg.vbsupport.ru/member.php?s=&action=getinfo&userid=9948) in this (https://vborg.vbsupport.ru/showthread.php?s=&threadid=42381) thread =P.


This will make the on.gif a link to get the latest threads in that forum. It will not affect the off.gif. It's just like the "Get New Posts" link, only forum specific :). File edits: 6 (2 in root/index.php, 2 in root/forumdisplay.php, 2 in root/usercp.php)
Template edits: 5 (forumhome_forumbit_level1_post, forumhome_forumbit_level2_post,forumdisplay_forumb it_level1_post, forumdisplay_forumbit_level2_post, usercp_forumbit)
New templates: 1 (forumhome_onlink)
Install time: 5 minutes


ADDED: On.gif = link to latest threads for subscribed forums in user cp. (Thanks Boofo) It's steps 10, 11, and 12 from version 1.3.

Tim Wheatley
08-17-2002, 06:57 PM
Can't you just do this in the template? I have had the buttons linking to 'make new post', but surely if you link it to: http://yourforum/showthread.php?s=&goto=lastpost&forumid=xx

Just replacing the forum id with the forum id call $.

I'm also not sure why you need this when there's a link next to the name in the 'last post' column which does the same thing? Bit confused. :)

Austin Dea
08-17-2002, 06:59 PM
That's not what this does ;). It's a link to search.php to show the latest threads post in that forum. Like the "Get New Posts" link, but specific to the forum you click. You could make it just a template edit, but that would make both on.gif AND off.gif a link and the off.gif would come up with a "No matches - try some other terms" error message.

If you wanna see, click the on.gif link here at vb.org on the forumhome.

Velocd
08-17-2002, 07:08 PM
Good idea ;)
*clicks install*

Austin Dea
08-17-2002, 07:19 PM
Whoops, forgot to add the code to forumdisplay.php. Just do the same edit as you did for index.php ;).

Originally posted by Velocd
Good idea ;)
*clicks install*
It was Boofo's idea ;).

Link14716
08-17-2002, 08:04 PM
Nice, will install later :)

joeboo
08-17-2002, 11:04 PM
Pretty cool idea, i might just install this

Boofo
08-17-2002, 11:26 PM
Austin Dea, there are 2 instances of the code to replace in "forumhome_forumbit_level1_post". Both should be replaced, right? And, aslo, I added the "forumhome_onlink" template the the templateused section of both the index.php and the fourmdisplay.php to cut the 2 queries for it. :)

BTW: Thank you very much for taking the time to do this. It is greatly appreciated. :)

Austin Dea
08-18-2002, 02:05 AM
Ok, thanks a bunch. My second hack >_<. Instrucs are updated.

Boofo
08-18-2002, 02:31 AM
No problem. You did all the hard work. :)

Originally posted by Austin Dea
Ok, thanks a bunch. My second hack >_<. Insturctions are updated in the first post.

Boofo
08-18-2002, 04:43 AM
I found something that would look better on a mouseover. :)

Replace this:

Get New Posts in this Forum

with this:

There are NO new posts in this forum

in both the root/index.php and /root/forumdisplay.php.

Austin Dea
08-18-2002, 03:40 PM
o_O...you mean for the off.gif? "Get new posts in this forum" is for the on.gif...

Edit: Oh, I see. It's because I copied the other and forgot to change >_<.

Unknown553
08-18-2002, 04:33 PM
Bug found with the locked forum icons.

Unknown553
08-18-2002, 04:58 PM
Thanks, that worked :)

Austin Dea
08-18-2002, 04:59 PM
{sorry, deleted the post above his thanks >_<)


Oh thanks. In both forumdisplay.php and root/index.php

Replace: if ((!$forumperms['canpostnew'] and $showlocks) or $forum['allowposting']==0) {
$forum['onoff'].='lock';
}

With: if ((!$forumperms['canpostnew'] and $showlocks) or $forum['allowposting']==0) {
$forum['onoff']='<img src="{ imagesfolder}/lock.gif" border="0" alt="This forum is locked">';
}

And remember to take out the space in { imagesfolder} :).



UPDATED INSTRUCTIONS IN FIRST POST

kenny@ecn
08-19-2002, 04:17 AM
Can you point out the differences in the updates? I think i have you're first version installed- and its a b*tch to go through everything...

kenny@ecn
08-19-2002, 04:19 AM
Please point out the differences in the update as opposed to the previous version.

Austin Dea
08-19-2002, 04:28 AM
Well, I fixed the errors mentioned above...

kenny@ecn
08-19-2002, 04:29 AM
Is there a version that you can make of the installer to update the previously installed version instead of going through the whole entire process again?>

Austin Dea
08-19-2002, 04:35 AM
Updates:
[8/16] - Added the code to forumdisplay.php
[8/16] - Added 2 template for subforums in forumdisplay.php
[8/17] - Fixed lock.gif issue


And no...

From the first version, do these steps.

-------------------------------------------
In root/index.php find:
-------------------------------------------

forumhome_forumbit_level2_post,forumhome,

-------------------------------------------
Replace it with:
-------------------------------------------

forumhome_forumbit_level2_post,forumhome,forumhome _onlink,

-------------------------------------------
Still in root/index.php find:
-------------------------------------------
if ((!$forumperms['canpostnew'] and $showlocks) or $forum['allowposting']==0) {
$forum['onoff'].='lock';
}

-------------------------------------------
Replace it with:
-------------------------------------------

if ((!$forumperms['canpostnew'] and $showlocks) or $forum['allowposting']==0) {
$forum['onoff']='<img src="{ imagesfolder}/lock.gif" border="0" alt="This forum is locked">';
}

+====================================+
|NOTE:Remove space in { imagesfolder}|
+====================================+
-------------------------------------------
In root/forumdisplay.php find:
-------------------------------------------

forumdisplay_forumbit_level1_nopost,forumdisplay_f orumbit_level2_post,

-------------------------------------------
Replace it with:
-------------------------------------------

forumdisplay_forumbit_level1_nopost,forumdisplay_f orumbit_level2_post,forumhome_onlink,

-------------------------------------------
*******************************************
Step 4
*******************************************
-------------------------------------------
Still in root/forumdisplay.php find:
-------------------------------------------

if ($userlastvisit<$forum['lastpost']) {
$forum['onoff']='on';
} else {
$forum['onoff']='off';
}
}

if ((!$forumperms['canpostnew'] and $showlocks) or $forum['allowposting']==0) {
$forum['onoff'].='lock';
}

-------------------------------------------
Replace it with:
-------------------------------------------

// on/off link hack
if ($userlastvisit<$forum['lastpost']) {
eval("\$forum['onoff'] = \"".gettemplate('forumhome_onlink')."\";");
} else {
$forum['onoff']='<img src="{ imagesfolder}/off.gif" border="0" alt="There are no new posts in this forum">';
}

}

if ((!$forumperms['canpostnew'] and $showlocks) or $forum['allowposting']==0) {
$forum['onoff']='<img src="{ imagesfolder}/lock.gif" border="0" alt="This forum is locked">';
}
// end on/off link hack

+====================================+
|NOTE:Remove space in { imagesfolder}|
+====================================+
-------------------------------------------
In template "forumdisplay_forumbit_level1_post" find:
-------------------------------------------

<img src="{ imagesfolder}/$forum[onoff].gif" border="0" alt="">

+===============================================+
|NOTE:Remove space in { imagesfolder}, then find|
+===============================================+
-------------------------------------------
Replace it with
-------------------------------------------

$forum[onoff]

-------------------------------------------
-------------------------------------------
In template "forumdisplay_forumbit_level2_post" find:
-------------------------------------------

<img src="{ imagesfolder}/$forum[onoff].gif" border="0" alt="">

+===============================================+
|NOTE:Remove space in { imagesfolder}, then find|
+===============================================+
-------------------------------------------
Replace it with
-------------------------------------------

$forum[onoff]

-------------------------------------------

Boofo
08-21-2002, 11:52 PM
Austin Dea, I have an update for you to add to this hack. If you want the images linked in the usercp for the Subscribed Forums, do the following:

In usercp.php, replace

if ($userlastvisit<$forum['lastpost']) {
$forum['onoff']='on';
} else {
$forum['onoff']='off';
}
}

if ((!$forumperms['canpostnew'] and $showlocks) or $forum['allowposting']==0) {
$forum['onoff'].='lock';
}

with:

// on/off link hack
if ($userlastvisit<$forum['lastpost']) {
eval("\$forum['onoff'] = \"".gettemplate('forumhome_onlink')."\";");
} else {
$forum['onoff']='<img src="{ imagesfolder}/off.gif" border="0" alt="There are no new posts in this forum">';
}
}

if ((!$forumperms['canpostnew'] and $showlocks) or $forum['allowposting']==0) {
$forum['onoff']='<img src="{ imagesfolder}/lock.gif" border="0" alt="This forum is locked!">';
}
// end on/off link hack

and in the "usercp_forumbit" template, change this:

<img src="{ imagesfolder}/$forum[onoff].gif" border="0" alt="">

to this:

$forum[onoff]

and don't forget to add forumhome_onlink to the templatesused line if the usercp.php file.

NOTE: Don't forget to take the spaces out between the { and imagesfolder.

That's all! :)

Austin Dea
08-22-2002, 02:55 AM
I never use the Subscribed forums personally, but great idea ;).

Boofo
08-22-2002, 03:15 AM
I usually don't use them either but sooner or later, someone would catch it. So, better to take care of it now, huh? :)

Originally posted by Austin Dea
I never use the Subscribed forums personally, but great idea ;).

Austin Dea
08-22-2002, 02:38 PM
Yes, I'll add to the instructions :).

leon2u
09-10-2002, 07:20 PM
Look at my snapshot plz...

I have installed a hack which shows the latest threads on my homepage. What I want is that in each posted thread titel is a ligtbulb on which I can click and go to the last post in that Thread!

This is one step further then what you have, with your hack you go to the last post in the whole forum...i need to go to the last post of every thread...

So on the left of the snapshot under Laatste Topics there are the 5 latest threads on the forum. In each of them I will have later on a picture on which I can click and go directly to the latest post in that thread.

Could you gimme the code for that???

Thanx

Austin Dea
09-11-2002, 12:35 AM
Just make that image link to this in whatever template shows that. "showthread.php?s=$session[sessionhash]&goto=lastpost&threadid=$thread[threadid]"

leon2u
09-11-2002, 05:44 AM
Thanx for your reply but I managed to fix that on my own :)
I used this for the 'replier' part in the snapshot (on your left)
showthread.php?s=&goto=lastpost&threadid=$thread[threadid]"

You posted this Originally posted by Austin Dea
$session[sessionhash]

Q 1: What does the $session mean and the [sessionhash]? Does it has a function in this one??? It seems to be here...

Q2: Besides that how do I get the the lightbulb picture for if there is a new post in that particular thread, what code do I need for that?

Q3: Then I want to have another function for when my mouse is over the Thread link in the menu...when my mouse rests on the link then I would love to have a popup information screen in which forum it has been posted...could you get me this code...I think it has to with a mouse over event but then I still need the code to fill out for the forum it has been post in....

Thanx for your effort...

Austin Dea
09-12-2002, 01:12 AM
I think you should ask for this in the Request forum, since it is a totally different hack.

Alien
04-10-2003, 04:59 PM
Anyone have a copy of the exact file listed in post #1 here? The link is completely dead now.

-Jason

Austin Dea
04-11-2003, 04:04 PM
Sorry ^_^;. Check the first post.

Boofo
04-11-2003, 04:12 PM
Hello Austin Dea. I haven't run into you for a while. ;)

You forgot to add:

forumhome_onlink

to the templatesused line in the usercp.php. ;)

Austin Dea
04-11-2003, 10:05 PM
Thanks ;)

Alien
04-13-2003, 10:04 PM
Thanks, I'll check it now and give it a whirl! :D

Alien
04-13-2003, 10:35 PM
Works great in 2.3.0!

/me clicks install.

Austin Dea
04-13-2003, 11:38 PM
;D