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

Reply
 
Thread Tools Display Modes
  #11  
Old 06-07-2002, 09:17 PM
Carthriller Carthriller is offline
 
Join Date: May 2002
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I used <a href="search.php?action=getlatest&forumid=$forum[forumid]">Read New Posts</a> and that didn't work. It just sent to a page where the search can't be found, even though there were some new posts. Please help.
Reply With Quote
  #12  
Old 06-07-2002, 09:32 PM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by hellsatan
Here are the lines...

PHP Code:
$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 <[url]http://www.php.net/addslashes[/url]>($wheresql)."'")) { 
$searchid=$getsearch[searchid]; 
} else { 
// get last search for this user and check floodcheck 
Satan
Somehow you get some vbulletin and php.net stuff in it, copy and paste the code wich i posted again.
Reply With Quote
  #13  
Old 06-07-2002, 09:34 PM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Carthriller
I used <a href="search.php?action=getlatest&forumid=$forum[forumid]">Read New Posts</a> and that didn't work. It just sent to a page where the search can't be found, even though there were some new posts. Please help.
Wich vb version are you using?
Reply With Quote
  #14  
Old 06-07-2002, 09:40 PM
Carthriller Carthriller is offline
 
Join Date: May 2002
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm using VB2.2.5 integrated with Vbportal3.0
Reply With Quote
  #15  
Old 06-07-2002, 09:48 PM
Carthriller Carthriller is offline
 
Join Date: May 2002
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just edited template forumhome_forumbit_level2_post and not forumhome_forumbit_level1_post...which shouldn't matter right?
Reply With Quote
  #16  
Old 06-07-2002, 10:24 PM
Carthriller Carthriller is offline
 
Join Date: May 2002
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

After playing with it, is strange, the first two category shows the lastest posts, but the rest of the categories don't work. Why is this so?
Reply With Quote
  #17  
Old 06-07-2002, 10:58 PM
Carthriller Carthriller is offline
 
Join Date: May 2002
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I figured something out. The reason why the first couple of categories worked for this hack is cause there were not any embedded categories in them...while in the other categories, there are sub-categories, how do I go about fixing this(to make it work for subcategories too), thanks.
Reply With Quote
  #18  
Old 06-07-2002, 11:59 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks...

It works now...

It must be because I copied it straight in, not into a Notepad file first...

Satan
Reply With Quote
  #19  
Old 06-09-2002, 09:22 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How would you do this for the New Posts icon at the left of the forum description where it would only link to the icon if there were new posts in that thread (like they do here on vb.org)?

Quote:
Originally posted by Lesane
Open root/search.php and find:

PHP Code:
// ###################### Start getsearchforums ####################### 
Add BEFORE it:

PHP Code:
// ###################### Start get latest #######################
if ($action=="getlatest") {
  
// generate query
  // do it!
  
if ($bbuserinfo[userid]!=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";
  }

Now u can use this link to get the results of a specific forum:

PHP Code:
search.php?action=getlatest&forumid=XX 
Where xx is the forumid.

As you can see on my forum i putted it in the template: "Forum Home Page Templates -> forumhome_forumbit_level1_post & forumhome_forumbit_level2_post with the following code:

PHP Code:
<a href="search.php?action=getlatest&&forumid=$forum[forumid]">Read New Posts</a
Done.
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 09:56 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
  • Page Generation 0.05495 seconds
  • Memory Usage 2,288KB
  • Queries Executed 13 (?)
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
  • (5)bbcode_php
  • (3)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
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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