vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Expanded Get New Posts - Hours, Minutes and Even Seconds (https://vborg.vbsupport.ru/showthread.php?t=82872)

amykhar 06-10-2005 10:00 PM

Expanded Get New Posts - Hours, Minutes and Even Seconds
 
OK. I'll admit it. The seconds is overkill. Sue me. ;)

This little mod (unfortunately, it can't be a plugin) requires you to edit one file and a template or two. I have included a suggested template edit, but how you use the search links is up to you.

It is similar to the getdaily feature of vbulletin, which allows users to search for posts submitted in x number of days. This expansion allows users to search for posts submitted within x hours, x minutes or even x seconds. It also allows users to search for any combination thereof.

amykhar 06-11-2005 01:37 AM

This post reserved for a FAQ

.Tim 06-12-2005 04:38 AM

Nice!

Andreas 06-13-2005 11:30 PM

Quote:

Originally Posted by amykhar
This little mod (unfortunately, it can't be a plugin)

Hmm ... are you sure?

Hookname: search_getnew_start
PHP Code:

if ($_REQUEST['do'] == 'getdaily')
{
    
$vbulletin->input->clean_array_gpc('r', array(
        
'hours'     => TYPE_UINT,
        
'minutes'   => TYPE_UINT,
        
'seconds'   => TYPE_UINT
    
));

    if ((
$vbulletin->GPC['days'] < 1) AND(!($vbulletin->GPC['hours']))AND(!($vbulletin->GPC['minutes']))AND(!($vbulletin->GPC['seconds'])))
    {
        
$vbulletin->GPC['days'] = 1;
        
$vbulletin->GPC['hours'] = 0;
        
$vbulletin->GPC['minutes'] = 0;
        
$vbulletin->GPC['seconds'] = 1;
    }
    elseif(
$vbulletin->GPC['days']<1)
    {
        
$vbulletin->GPC['days'] = 0;
    }
    
$datecut TIMENOW - (($vbulletin->GPC['days']*24*60*60) + ($vbulletin->GPC['hours']*60*60) + ($vbulletin->GPC['minutes']*60) + $vbulletin->GPC['seconds']);


Btw: There is a small typo in the instructions: 'seconds' => TYPT_UINT instead of 'seconds' => TYPE_UINT :)

amykhar 06-13-2005 11:46 PM

OK. I guess I just didn't see the point of repeating the code twice - felt it better to replace the existing.

Amy

kall 07-01-2005 07:36 AM

Cool, but it shows "posts from last day" in the header of the search results, regardless of how many days were searched.

amykhar 07-03-2005 06:27 PM

Quote:

Originally Posted by kall
Cool, but it shows "posts from last day" in the header of the search results, regardless of how many days were searched.

All you have to do is change the posts_from_last_day phrase to something more appropriate. The phrasing would be up to you. I changed mine to "Updated Posts"

Beermonster 07-07-2005 12:14 PM

Thanks for this, just a little mistake in your get hours, you had 2 4's instead of 4 & 8 :)

anyway for a little more overkill use this, it add's
Find all your posts
Find all your threads
Get all unanswered posts

:)

Code:

        <if condition="$show['searchbuttons']">
                <div class="vbmenu_popup" id="navbar_posts_menu" style="display:none">
                        <table cellpadding="4" cellspacing="1" border="0">
<tr><td class="thead">$vbphrase[get_posts_nav]</td></tr>
<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">Get All New Posts</a></td></tr>
<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&minutes=15" accesskey="2">Last 15 Minutes</a></td></tr>
<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&minutes=30" accesskey="2">Last 30 Minutes</a></td></tr>
                       
<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&hours=1" accesskey="2">Last Hour</a></td></tr>
<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&hours=2" accesskey="2">2 Hours</a></td></tr>
<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&hours=4" accesskey="2">4 Hours</a></td></tr>
<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&hours=8" accesskey="2">8 Hours</a></td></tr>
<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&hours=12" accesskey="2">12 Hours</a></td></tr>
<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&days=1" accesskey="2">1 Day</a></td></tr>
<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&days=2" accesskey="2">2 Days</a></td></tr>
<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&days=3" accesskey="2">3 Days</a></td></tr>
<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&days=4" accesskey="2">4 Days</a></td></tr>
<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=process&amp;showposts=0&amp;starteronly=1&amp;exactname=1&amp;searchuser=$bbuserinfo[urlusername]"><phrase 1="$bbuserinfo[username]">Find All Your Threads</phrase></a></td></tr>
<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=finduser&amp;u=$bbuserinfo[userid]"><phrase 1="$bbuserinfo[username]">Find All Your Posts</phrase></a></td></tr>
<tr><td class="vbmenu_option"><a href="search.php?do=process&replyless=1&replylimit=0&dontcache=1">Get Unanswered Posts</a></td></tr>
                        </table>
                </div>
        </if>


amykhar 07-07-2005 12:48 PM

Thanks for contributing :)

FleaBag 08-25-2005 11:50 AM

Amy have you had this running with RC2?


All times are GMT. The time now is 06:22 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.01124 seconds
  • Memory Usage 1,760KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete