![]() |
Changing $getnewpost and $getnewthread variable (exclude forums)
Hi all,
I want to change the following code in index.php: $getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]'"); $getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'"); I want to exclude two forums from these queries, how? Thank you! |
Add this to the query:
[sql] ...AND forumid != forumid1AND forumid != forumid2 [/sql] |
Quote:
Can you please be more specific? Must I add this to the query: AND forumid != forumid1 AND forumid != forumid2 Where 1 and 2 must be the forumid's wich are going to be excluded? Where in the query must I add this? $getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]'"); Thank you! |
Can someone please answer my question since I'm puzzled how to do this. :(
|
Yes, the forumid 1/2 are the forumid's that you don't want to be included, and your queries would look like this:
$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit] AND forumid!=forumid1 AND forumid!=forumid2 '"); $getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit] AND forumid!=forumid1 AND forumid!=forumid2 '"); |
Quote:
Thanks a lot! :) Too bad none of the other members feeled the need to answer this question. :( |
I don't find that in the 2.2.9 index.php. Is that an addon?
|
Quote:
Anyways, I thought it did work but it stildoes the same as before so this isn't the way to go... |
I think you want to do it in the search.php, anyway. This is for "Todays Active Threads".
Find: PHP Code:
PHP Code:
PHP Code:
|
Quote:
I allready fixed this in search.php where I excluded three forums from the search and that's why I need to remove these three forums also from this query. When people click on new posts they get less new posts to see because new threads and new posts on index.php still include the three forums excluded from search.php I hope someone can come up with the solution for this. |
That's going to get complicated.
Are you trying to make these forums invisible, or only make it possible for users to search for new topics but exclude certain forums? I could see a cool hack out of this (but the index thing sounds too hard). -modify search.php to look in a new user profile field "view_new_posts_ignored" and explode(",", $bbuserinfo['view_new_posts_ignored']); or something to get an array of forumids they want ignored. -modify forumdisplay template to have a "exclude this forum from searches" button. Clicking the button takes you to the user_cp with &ignoreforumid=XX in the URL. -modify usercp to recognize the ignoreforumid and paste/append it into the "View New Posts Ignored" user profile field. Is this out of left field? |
All times are GMT. The time now is 05:07 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|