vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   New Posts in Subscribed Forums (https://vborg.vbsupport.ru/showthread.php?t=32267)

mister 11-08-2001 10:00 PM

New Posts in Subscribed Forums
Originaly Released: 11-09-2001
Last Updated: 11-09-2001
Author: mister
Demo: Sorry, no demo...
Installation Instructions are as follows:

1) Backup your database and all forum files, just in case
2) Add this new template

name: error_not_subscribed

stuff:
You are not subscribed to any forums. This search is only for those who are subscribed to forums. You can subscribe to forums by clicking on the 'Subscribe to this forum' link at the top of each individual forum.

3) Edit search.php as noted below

NOTE: All Additions happen in this if-block: if ($action=="getnew") {
If you put them in the other if's (i.e. newdaily, etc) it won't work properly.



FIND:

PHP Code:

if ($action=="getnew") {
  
// generate query
  // do it!
  
if ($bbuserinfo[userid]!=or $bbuserinfo[lastvisit]!=0) {
    
$forumsql=getallforumsql(); 

AFTER IT, PUT THIS:

PHP Code:

//New Subscribed Posts Hack
if ($getsubscribed) {
  
$subscr_where=getsubscribedforumsql();
  if (!
$subscr_where) {
    eval(
"standarderror(\"".gettemplate("error_not_subscribed")."\");");
    exit;
  }
}
//End New Subscribed Posts Hack 


IN THAT SAME "getnew" IF-BLOCK FIND:

PHP Code:

$wheresql="1=1".$forumsql.$datesql;
$wheresql.=" AND thread.open<>10"


AFTER IT, PUT THIS:

PHP Code:

//New Subscribed Posts Hack
if ($getsubscribed) {
  
$wheresql.=" AND thread.forumid IN ".$subscr_where;
}
//End New Subscribed Posts Hack 

PUT THIS SOMEWHERE IN THE FILE:
PHP Code:

// ###################### Start get subscribed forum sql #############
function getsubscribedforumsql() {
   global 
$bbuserinfo,$DB_site;
   
$forums=$DB_site->query("SELECT * FROM forum,subscribeforum WHERE subscribeforum.forumid=forum.forumid AND userid=$bbuserinfo[userid] ORDER BY title");
      
   if (
$DB_site->num_rows($forums)) {
      
$ret '(';
      while (
$forum=$DB_site->fetch_array($forums)) {
         
$ret .= $forum[forumid] . ',';
      }
      
$ret substr($ret,0,strlen($ret)-1);
      
$ret .= ')';
   } else {
      
$ret '';
   }
   return 
$ret;  


4) Edit your forumhome_newposts template

Add this

PHP Code:

 | <a href="search.php?s=$session[sessionhash]&action=getnew&getsubscribed=1">View New Subscribed Posts</a

5) Enjoy!

LuBi 11-14-2001 04:08 AM

So what's this do? Search thread your subsribed to..? How do I select which forum to search..? no demo or ss... sounds great but I need more info I'll be sure to install..

Admin 11-14-2001 09:50 AM

LuBi, it just shows you all threads you are subscribed to that have new posts in them.
Like the "View New Posts" search, only this only returns subscribed threads.

mister, I think you forgot a function you wrote, getsubscribedforumsql(). :)

LuBi 11-14-2001 05:50 PM

Quote:

LuBi, it just shows you all threads you are subscribed to that have new posts in them.
All the time when you search or is it selectable?

Admin 11-14-2001 06:07 PM

[QUOTE]Originally posted by LuBi
All the time when you search or is it selectable?

red_baron2000 04-05-2003 06:30 AM

anyone mind finishing this ?
please :)

mister 04-05-2003 05:03 PM

Sorry about forgetting to add that one function.
My bad. Thanks for reminding me, red_barron2000.

Should work now once you add that function to search.php

Boofo 04-05-2003 05:18 PM

I'm getting this error after adding the function.

Parse error: parse error, unexpected ',' in /home/bear/public_html/forum/search.php on line 578

It has to do with this line.

$ret = $ret,0,$ret)-1);

red_baron2000 04-05-2003 07:46 PM

Quote:

Today at 07:18 PM Boofo said this in Post #8
I'm getting this error after adding the function.

Parse error: parse error, unexpected ',' in /home/bear/public_html/forum/search.php on line 578

It has to do with this line.

$ret = $ret,0,$ret)-1);


same here :confused:


All times are GMT. The time now is 05:59 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01826 seconds
  • Memory Usage 1,749KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete