Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by Ryan Little (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 02-27-2001 Last Update: Never Installs: 0
 
No support by the author.

I want to search for new posts within a certain forum, but not within each and every forum.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 02-27-2001, 01:57 AM
Guest
 
Posts: n/a
Default

Achieving that wasn't really that hard. In the old 1.1.X version it was a simple link. However with the new search engine the link wouldn't work anymore.

What I did is went in and look at the "GetNew" function in the search engine. This brings all the new posts for all forums the member can see. Too broad for this application.

So I changed it to:
Code:
// ###################### Start get latest #######################
if ($action=="getlatest") {
  // generate query
  // do it!
  if ($bbuserinfo[userid]!=0 or $bbuserinfo[lastvisit]!=0) {
    $forumsql=" AND forumid=$forumid";

    // get date:
    $datesql=" AND thread.lastpost>=".$bbuserinfo[lastvisit];

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

    if ($getsearch=$DB_site->query_first("SELECT searchid FROM search WHERE query='".addslashes($wheresql)."'")) {
      $searchid=$getsearch[searchid];
    } else {
      // get last search for this user and check floodcheck
      if ($prevsearch=$DB_site->query_first("SELECT searchid,dateline FROM search WHERE ".iif($bbuserinfo[userid]==0,"ipaddress='$ipaddress'","userid=$bbuserinfo[userid]")." ORDER BY dateline DESC LIMIT 1")) {
        if (time()-$prevsearch[dateline]<$searchfloodcheck and $searchfloodcheck!=0) { // and !ismoderator()) {
          eval("standarderror(\"".gettemplate("error_pmfloodcheck")."\");");
          exit;
        }
      }
      // insert query into db
      $DB_site->query("INSERT INTO search (searchid,query,dateline,querystring,showposts,userid,ipaddress) VALUES (NULL,'".addslashes($wheresql)."',".time().",'".addslashes($query)."',0,$bbuserinfo[userid],'".addslashes($ipaddress)."')");
      $searchid=$DB_site->insert_id();
    }


    eval("standardredirect(\"".gettemplate("redirect_search")."\",\"search.php?s=$session[sessionhash]&action=showresults&getnew=true&searchid=$searchid\");");
  } else {
    $action="getdaily";
  }
}
Copy the above code into search.php and you will be able to get the latest posts for a single forum.

The url to use would be:
http://www.yourforumdomain.com/patht...est&forumid=XX

Where XX equals the forum. I simply stuck this in my "forumhome_forumbit_levelX_post" and "forumdisplay_forumbit_levelX_post" templates.
Reply With Quote
  #3  
Old 02-27-2001, 02:01 AM
Guest
 
Posts: n/a
Default

Thanks for the code wayne!

(dev team, is there a reason this isnt standard in v2?)
Reply With Quote
  #4  
Old 03-01-2001, 07:40 AM
Guest
 
Posts: n/a
Default

exactly what i need as well
Reply With Quote
  #5  
Old 03-01-2001, 09:59 AM
Guest
 
Posts: n/a
Default

wayne, how could i do it to get new posts from a number of forums? I don't mind hard coding it so setting an array in searchphp for say $stargate=3,4,63,23,53,34; and then search.php?group=stargate

would be fine but i am not quite sure how to.

Is it just a change of

Code:
$forumsql=" AND forumid=$forumid";
or do i need to do more?
Reply With Quote
  #6  
Old 03-19-2001, 03:38 PM
Guest
 
Posts: n/a
Default

Any update on this one?

I also need to search more than one forum (but not all) for new posts.

/j
Reply With Quote
  #7  
Old 03-19-2001, 04:22 PM
Guest
 
Posts: n/a
Default

I was about to ask for this, Wayne. I saw it on SitePoint and spent a while the other night trying to cobble together my own little version of it and failed miserably.
Reply With Quote
  #8  
Old 03-20-2001, 02:59 PM
Guest
 
Posts: n/a
Default

thx for the code. i needed that one
Reply With Quote
  #9  
Old 05-01-2001, 06:00 AM
GimmeTech
Guest
 
Posts: n/a
Default

WLuke,

This function is fabulous and I having working. My question is if you meant to "change" the Get new as you mention on top or just "Copy the above code into search.php" as you mentioned below. I did the second of the two. I didn't change the Get New but added the new code underneath that part of the code. It works, I just wanted to see if having both of the codes in the search.php would cause any problems that you know of.

Thank You for sharing your knowledge.
Reply With Quote
  #10  
Old 05-01-2001, 08:48 PM
the_sisko's Avatar
the_sisko the_sisko is offline
 
Join Date: Oct 2001
Location: Hamburg,Germany
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How can I protect my private forums???
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 11:21 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.05697 seconds
  • Memory Usage 2,271KB
  • Queries Executed 23 (?)
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
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)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
  • (9)postbit
  • (1)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
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_imicons
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete