Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-28-2003, 10:52 AM
Domenico Domenico is offline
 
Join Date: Oct 2001
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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!
Reply With Quote
  #2  
Old 01-28-2003, 01:03 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Add this to the query:
[sql]
...AND forumid != forumid1AND forumid != forumid2
[/sql]
Reply With Quote
  #3  
Old 01-29-2003, 01:36 PM
Domenico Domenico is offline
 
Join Date: Oct 2001
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by filburt1
Add this to the query:
[sql]
...AND forumid != forumid1AND forumid != forumid2
[/sql]
Thanks for answering!

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!
Reply With Quote
  #4  
Old 02-22-2003, 09:38 AM
Domenico Domenico is offline
 
Join Date: Oct 2001
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can someone please answer my question since I'm puzzled how to do this.
Reply With Quote
  #5  
Old 02-25-2003, 01:18 AM
Silenced Soul's Avatar
Silenced Soul Silenced Soul is offline
 
Join Date: Apr 2002
Location: holdin' it down for tha 303
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
'");
Reply With Quote
  #6  
Old 02-27-2003, 10:07 AM
Domenico Domenico is offline
 
Join Date: Oct 2001
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Silenced Soul
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
'");
This worked.
Thanks a lot!

Too bad none of the other members feeled the need to answer this question.
Reply With Quote
  #7  
Old 02-27-2003, 10:44 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't find that in the 2.2.9 index.php. Is that an addon?
Reply With Quote
  #8  
Old 02-27-2003, 02:45 PM
Domenico Domenico is offline
 
Join Date: Oct 2001
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Boofo
I don't find that in the 2.2.9 index.php. Is that an addon?
I still have 2.2.6 and because it has so many hacks I don't upgrade it anymore. My next upgrade will be to 3.x I think.

Anyways, I thought it did work but it stildoes the same as before so this isn't the way to go...
Reply With Quote
  #9  
Old 02-27-2003, 02:55 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think you want to do it in the search.php, anyway. This is for "Todays Active Threads".

Find:

PHP Code:
$wheresql.=" AND thread.open<>10"
and replace it as:

PHP Code:
$wheresql.=" AND thread.open<>10 AND thread.forumid!=X"
If you want to do more than one forum, change it to this:

PHP Code:
$wheresql.=" AND thread.open<>10 AND thread.forumid!=X AND thread.forumid!=X"
There are 2 instances, one is for members, the other is for guests. If you want to exclude forums for both of them, change both lines.
Reply With Quote
  #10  
Old 02-28-2003, 06:36 AM
Domenico Domenico is offline
 
Join Date: Oct 2001
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Boofo
I think you want to do it in the search.php, anyway. This is for "Todays Active Threads".

Find:

PHP Code:
$wheresql.=" AND thread.open<>10"
and replace it as:

PHP Code:
$wheresql.=" AND thread.open<>10 AND thread.forumid!=X"
If you want to do more than one forum, change it to this:

PHP Code:
$wheresql.=" AND thread.open<>10 AND thread.forumid!=X AND thread.forumid!=X"
There are 2 instances, one is for members, the other is for guests. If you want to exclude forums for both of them, change both lines.
Hi boofo, thanks for replying!

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:35 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04192 seconds
  • Memory Usage 2,262KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete