View Full Version : Making a new "view new posts" link that only shows new posts in certain forums?
Gutspiller
04-03-2002, 03:39 PM
OK Firefly helped me with part of what my users wanted. They didn't want to click the "view new posts" and get all the news posts that don't have any replys in them. So FireFly helped me take those out. Now they want another button/link that will only show the new news posts, but they don't want it to replace the "view new posts" they want a new link for "view new news posts"
The way FireFly helped me before is just a few threads down in the forum currently, but is all he did was make it so that I could put in the forumid and exclude that forum from being in the "getnew" results. I was thinking I could just copy my search.php and do the exact opposite and exclude all the forums, except the news forums, but I was wondering if there was an easier way or if that WOULD be the easy way?
Any help would be great. Thanks!
Admin
04-03-2002, 03:44 PM
Next time post this in the same thread please. :)
Anyway, in search.php find this:
$datesql=" AND thread.lastpost>=".$bbuserinfo[lastvisit];
$wheresql="1=1".$forumsql.$datesql;
$wheresql.=" AND thread.open<>10";
Note: the middle line was changed due to what I helped you with before.
Replace that with this:
$datesql=" AND thread.lastpost>=".$bbuserinfo[lastvisit];
if ($newsonly) {
$wheresql="1=1 AND forumid=XX".$datesql;
} else {
$wheresql="1=1".$forumsql.$datesql;
}
$wheresql.=" AND thread.open<>10";
Again, the line there is changed in your code.
Change XX to the ID of your news forum, then link to search.php?action=getnew&newsonly=1.
Gutspiller
04-03-2002, 04:58 PM
OK I am a little confused. So where do I put the forumid numbers for the news forum TO search? The ones that I have blocked where you helped me firsted, aren't the exact same ones that I want to be searched in the new news posts. I need two different sets of forumid places. Ones to exclude in the new posts link and one to include in the new news link.
Or did I not understand the instructions?
Oh and I didn't post it in the same thread, because I didn't want you to feel like I was only asking for your help, but if you don't mind then I will always bug you for help. :D
Admin
04-04-2002, 05:03 AM
Ok never mind my first post, I was tired last night. :p
Just link to search.php?action=getnew&forumid=XX where XX is your news forum's ID.
Gutspiller
04-04-2002, 06:24 AM
Originally posted by FireFly
Ok never mind my first post, I was tired last night. :p
Just link to search.php?action=getnew&forumid=XX where XX is your news forum's ID.
Nope I tried linking to http://www.theforumz.com/forumz/search.php?action=getnew&forumid=143,162,161,163,145,153,164,155,167,168,15 8,165,166
and it still didn't work. it might help if you take a look what I have going on. :nervous: http://www.theforumz.com
I don't have one single news forum, I have 13 news forums. I am starting to think my original idea with coping the search.php might not be so bad after all. :cool:
Or are you sleepy again? :rolleyes:
Admin
04-04-2002, 06:32 AM
Just link to http://www.theforumz.com/forumz/search.php?action=getnew&forumid=150. It will get subforums.
Gutspiller
04-04-2002, 02:10 PM
Originally posted by FireFly
Just link to http://www.theforumz.com/forumz/search.php?action=getnew&forumid=150. It will get subforums.
Those forums that it's showing posts from are not even in the news catagory... What gives? :paranoid:
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.