Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-03-2001, 01:11 PM
Pyro Pyro is offline
 
Join Date: May 2002
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok,

I'm sure I'm blind but didn't fount what I am looking for. I am looking for an simple hack, that produces a combobox with three choices:

messages of today
messages since yesterday
messages of the last three days

You can find a German version of this hack on http://forum.traum-projekt.com (that box with the yellow "go"-button on the top of that page.
The responsible guy there is on vacation so I cannot ask him directly for that hack.

Im sure it's pretty simple - any ideas?
Thanks in advance
Markus
Reply With Quote
  #2  
Old 08-10-2001, 02:41 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In search.php find
PHP Code:
// ###################### Start posts by user x ####################### 
And above it put
PHP Code:
// ###################### Start get double-daily #######################
if ($action=="getddaily") {
  
// get allowable forums:
  
$forumsql=getallforumsql();

  
// get date:
  
$datesql=" AND thread.lastpost>=".(time()-24*60*60*2);

  
$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_searchfloodcheck")."\");");
                                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\");");
}

// ###################### Start get triple-daily #######################
if ($action=="gettdaily") {
  
// get allowable forums:
  
$forumsql=getallforumsql();

  
// get date:
  
$datesql=" AND thread.lastpost>=".(time()-24*60*60*3);

  
$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_searchfloodcheck")."\");");
                                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\");");

Now just link to search.php?action=getddaily (note: two d's) for posts from two days ago, and search.php?action=gettdaily (note: two t's) for posts from three days ago. Posts from today are search.php?action=getdaily.
You can make the box itself by yourself.

Hope I helped.
Reply With Quote
  #3  
Old 09-04-2001, 02:19 PM
Pyro Pyro is offline
 
Join Date: May 2002
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks,

just had the time to check your hack - great! Exactly what I was looking for...

Markus
Reply With Quote
  #4  
Old 12-26-2001, 04:46 PM
Meta's Avatar
Meta Meta is offline
 
Join Date: Nov 2001
Location: Germany (north)
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes ... just what i have been looking for.

A few more questions:

1. Is there any possibility to make this more variable? So the user can make a choice as he wants ... last 17 days or last 10 days or something like that. And so we dont have to do for each day one long code ... but only a variable?

2. Is there a possibility to get the results like if i click on "postsonly"? So with the posts and a little preview on it? That i am missing also on the getdaily-function.

3. One problem - or at least for me it seems so - is, if we dont get the posts a "last three days"-function (or a "last ten days"-function even more) isn't such as useful as it could be. E.g the last three days result could be not so differant from the last two day result ... means there are the same threads on the results ... and the user has to find the right posts by himself. He can jump to the beginning ... or jump to the end. But not to the post which has been written three days ago.

I tried a bit playing around which varios ideas on the search.php ... but i didn't find clue. It's not so hard to change the searchresultbit ... but the result isn't that what i wanted. At least until now. Same threats ... no preview ... but i'm a very poor coder also.

So ... nice try ... i had even almost the same idea (i multiplicated the hours ... 48 hrs, 72 hrs and so on) ... but it's not so useful as i would wish ... without the posts.

Any ideas?

(Hm? Yes ... in other words ... what i wish is a real "search by date"-function. Like at least Discus has it.)
Reply With Quote
  #5  
Old 12-26-2001, 04:52 PM
Meta's Avatar
Meta Meta is offline
 
Join Date: Nov 2001
Location: Germany (north)
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

(Ooh hell ... i'm a member now. I have to tell all my friends about it.)
Reply With Quote
  #6  
Old 01-04-2002, 04:22 PM
Meta's Avatar
Meta Meta is offline
 
Join Date: Nov 2001
Location: Germany (north)
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh ... you can stop searching now. I find my clues for having a "last x days"-view with posts instaed of threads.

If somebody is interested ... i will write them down ... it's mostly three changes in the search.php
Reply With Quote
  #7  
Old 03-23-2003, 02:11 AM
Gutspiller's Avatar
Gutspiller Gutspiller is offline
 
Join Date: Dec 2001
Posts: 1,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What do I need to add so that I can assign which forum IDs it does and doesn't do this from?
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:33 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.04117 seconds
  • Memory Usage 2,260KB
  • 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
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete