Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Active Topics - (replaces New Posts) Sorted By [x] Amount Of Time Details »»
Active Topics - (replaces New Posts) Sorted By [x] Amount Of Time
Version: 1.00, by trevelyn1015 trevelyn1015 is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 01-05-2005 Last Update: 01-05-2005 Installs: 38
 
No support by the author.

This is something I never saw on any vbulletin sites before, and loved it when I used to be a member of a snitz forum. It is the 'Active Topics' feature...


What does it do?

It replaces your 'New Posts' link in your navbar with a drop down list of times to view posts, from all forums(depending on user permissions, which they can and cannot see).

What will it look like?


View live version, here.

How many templates do i have to edit?
You only have to edit your 'navbar' template. Very easy to do.

How many phrases do I have to add?
It depends on how specific you want your Active Topics bar to be.

How many .php files will I have to edit?
You only have to edit your search.php in one little area. Very simple.

Good luck with this hack, and I hope you enjoy it as much as I do.

================================================== =======
================================================== =======
================================================== =======
================================================== =======
Active Topics - compiled from multiple hacks(credit given at bottom) and tweaked by Trevelyn1015

This small template mod is for the vB 3.0.3 navbar template.
This mod replaces the Today's Posts/New Posts links with an 'Active Topics' dropdown menu.
It only works when vB dropdowns are allowed, otherwise the default vB link is displayed.

1) Go to the vB Phrase Manager and add the following Global phrases (see vB help for further directions). If you want different times, adjust accordingly:

Code:
$vbphrase[active_topics_nav] = "Active Topics";
$vbphrase[get_fifteen_minutes] = "Last 15 Minutes";
$vbphrase[get_thirty_minutes] = "Last 30 Minutes";
$vbphrase[get_fortyfive_minutes] = "Last 45 Minutes";
$vbphrase[get_one_hour] = "Last Hour";
$vbphrase[get_three_hours] = "Last 3 Hours";
$vbphrase[get_six_hours] = "Last 6 Hours";
$vbphrase[get_twelve_hours] = "Last 12 Hours";
$vbphrase[get_one_day] = "Last Day";
$vbphrase[get_three_days] = "Last 3 Days";
$vbphrase[get_one_week] = "Last Week";
$vbphrase[get_three_weeks] = "Last 3 Weeks";
$vbphrase[get_one_month] = "Last Month";

2) Go to the vB Phrase Manager and edit the following phrase:

'new_posts_nav' - edit the translation to be "Since Last Visit"


3) Make the following TWO edits to the vB 3.0.3 navbar template:

EDIT ONE: Find the following:

<if condition="$show['popups']">
<if condition="$show['searchbuttons']">
<if condition="$show['member']">
<td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]</a></td>
<else />
<td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getdaily" accesskey="2">$vbphrase[todays_posts]</a></td>
</if>

And REPLACE with the following:

<if condition="$show['popups']">
<if condition="$show['searchbuttons']">
<td id="navbar_posts" class="vbmenu_control"><a href="search.php?$session[sessionurl]" accesskey="2">$vbphrase[active_topics_nav]</a> <script type="text/javascript"> vbmenu_register("navbar_posts"); </script></td>

EDIT TWO: Find the following:

Code:
<if condition="$show['popups']">
<!-- NAVBAR POPUP MENUS -->
And AFTERWARDS ADD the following:

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[active_topics_nav]</td></tr>
			<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]</a></td></tr>
			<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&minutes=15" accesskey="2">$vbphrase[get_fifteen_minutes]</a></td></tr>
			<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&minutes=30" accesskey="2">$vbphrase[get_thirty_minutes]</a></td></tr>
			<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&minutes=45" accesskey="2">$vbphrase[get_fortyfive_minutes]</a></td></tr>
			<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&hours=1" accesskey="2">$vbphrase[get_one_hour]</a></td></tr>
			<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&hours=3" accesskey="2">$vbphrase[get_three_hours]</a></td></tr>
			<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&hours=6" accesskey="2">$vbphrase[get_six_hours]</a></td></tr>
			<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&hours=12" accesskey="2">$vbphrase[get_twelve_hours]</a></td></tr>
			<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&days=1" accesskey="2">$vbphrase[get_one_day]</a></td></tr>			
			<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&days=3" accesskey="2">$vbphrase[get_three_days]</a></td></tr>			
			<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&days=7" accesskey="2">$vbphrase[get_one_week]</a></td></tr>
			<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&days=21" accesskey="2">$vbphrase[get_three_weeks]</a></td></tr>
			<tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily&days=31=" accesskey="2">$vbphrase[get_one_month]</a></td></tr>

			</table>
		</div>
	</if>

4) In your search.php:

Find:

Code:
'days' => INT,
Below, add:

Code:
'hours' => INT, 
'minutes' => INT,
'seconds' => INT,

Then, find:


Code:
// get date:
	if ($_REQUEST['do'] == 'getnew' AND $bbuserinfo['lastvisit'] != 0)
	{
		// if action = getnew and last visit date is set
		$datecut = $bbuserinfo['lastvisit'];
	}
	else
	{
		$_REQUEST['do'] = 'getdaily';
		if ($days < 1)
		{
			$days = 1;
		}
		$datecut = TIMENOW - (24 * 60 * 60 * $days);
	}
Replace with:

Code:
// get date: 
     if ($_REQUEST['do'] == 'getnew' AND $bbuserinfo['lastvisit'] != 0) 
     { 
          // if action = getnew and last visit date is set 
          $datecut = $bbuserinfo['lastvisit']; 
     } 
    else
	{
		$_REQUEST['do'] = 'getdaily';
		if (($days < 1)AND(!$hours)AND(!$minutes)AND(!$seconds))
		{
			$days = 1;
                        $hours = 0;
                         $minutes = 0;
                         $seconds = 0;
			
		}
		elseif($days < 1) {
                       $days = 0;
                }
		$datecut = TIMENOW - (($days*24*60*60) + ($hours*60*60) + ($minutes*60) + $seconds);
		
	}
then upload your search.php back into your forum directory and "voila"... you are done.

If you have installed this hack, please click ==>
================================================== =======
================================================== =======
================================================== =======
================================================== =======

Thanks to:
amykhar and sabret00the for helping me with the search.php editing.
waxed, from vbulletintemplates, for a hack released to create a "since [x] amount of days", which was the foundation of how i put this together.

Show Your Support

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

Comments
  #32  
Old 01-09-2005, 08:33 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay guys and girls, you're getting me involved now.

First of all, trevelyn1015 did give credit to amykhar, sabret00the and waxed for helping him put the hack together.

Secondly, he should have probably made the font thanking them a bit bigger (it's tiny font right at the bottom of the first post) but that's his prerogative. None of us should judge him - the choice on how he gives credit is up to him. If it was me, I would have put their names in bold and right at the top, but hey, that's me.

Thirdly, although none of the code may have originally come from him, this is how most coders start out - by taking bits of code from other places and putting them together. The more you do this, the more you learn, and after a while, you start to write your own code. So we shouldn't be too hard on trevelyn1015.

Fourthly, vBulletin.org does not condone the copy of other people's code without permission - that would be illegal and a breach of copyright. However, in this case, I gather that he did have permission, or at least, permission was implied as the code he used was given to him to be used.

Fifthly, we are not all 5-year olds here. Let's all apologize to each other, and move on. There are more important things in life than to bicker over a few lines of code that is in the end free and not costing anyone any money.

I darn sure hope this is the LAST post on this issue. Let's talk about the hack instead, which is, btw, a good idea.
Reply With Quote
  #33  
Old 01-09-2005, 09:51 AM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

good post, and just so everyone knows, i figured out where to put the code w00t to me lmao, oh and i can't say i care that he released it, my input turned out to be a finger sticking out at the end of an extended arm saying do something like that. i must say though in good taste travelyn should pm amy and set things right with an apology for not notifying her that he was gonna release the code. all in all it's a handy hack and it does differ from the vBT version as it does so much more, it's kinda like saying no one can run with a concept just check out the world we live in, it's built on people taking a basic thing and building it up into a more useable product, alas the nature of the world we live in. lets all have fun and hope that we get many more hacks from everyone in the future.
Reply With Quote
  #34  
Old 01-09-2005, 05:19 PM
trevelyn1015 trevelyn1015 is offline
 
Join Date: Dec 2004
Posts: 147
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<apology pm sent to amy>


and to set other things straight...

Quote:
Originally Posted by waxed
that is alright with me - thanks for asking.

Quote:
Originally Posted by Trevelyn1015
your "view posts since [x] amount of time" hack...

i modified it to be able to show:

15 minutes
30 minutes
45 minutes
1 hour
3 hours
6 hours
12 hours
one day
three days
one week
3 weeks
one month

and was wondering if you minded me posting it on vbulletin.org and giving you credit for creating the original hack? and giving myself credit for modifying it, and i will post both versions of the hack on there...

is that alright with you?

-christian dorton
Reply With Quote
  #35  
Old 01-10-2005, 09:05 AM
Zenith Zenith is offline
 
Join Date: Dec 2001
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool. Been wanting this for a while. Thanks.

Has anyone figured how to adjust the "Posts From Last Day" that is always displayed at the top of the search results to "Posts In Last Hour" or whatever is appropriate?

TIA
Reply With Quote
  #36  
Old 01-10-2005, 09:30 AM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it's easy modify the phrase like <$phrase time phrase="1"> or however vB does it and then in the search .php has $timephrase = "time" ofcouse you'd use a confidtional for that, then in the phrase just change it to add {1} where the timeframe was
Reply With Quote
  #37  
Old 01-21-2005, 09:26 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sabret00the
it's easy modify the phrase like <$phrase time phrase="1"> or however vB does it and then in the search .php has $timephrase = "time" ofcouse you'd use a confidtional for that, then in the phrase just change it to add {1} where the timeframe was
Could you please provide us with an example? I love this menu, and have it installed already, but I would like to change the phrase that appears on the results, to show the proper selection of the user. However, I am not that good with phrases etc.

Any help would be appreciated.

Rgds
Reply With Quote
  #38  
Old 01-21-2005, 09:40 AM
trevelyn1015 trevelyn1015 is offline
 
Join Date: Dec 2004
Posts: 147
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

which phrase do you want to change?
Reply With Quote
  #39  
Old 01-21-2005, 12:18 PM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by trevelyn1015
which phrase do you want to change?
Don't worry, after some experimentation, I got it solved.

Here is what I posted before, just for the records.

When you do a search for post since 6 hours or 3 days or whatever, when it shows the results, at the header of the table, it always says "Search : Posts From Last Day". I would like that to show the search that you performed actually, like if you searched for posts in the last 3 hours, to say "Search : Posts from the last 3 hours".

I tried adding some switch in the getdaily routine, which sets the value of a string to the proper contents, but the string value is lost somewhere between the getdaily and the template which shows the results.

Any help would be appreciated.


Thanks and regards
Reply With Quote
  #40  
Old 03-08-2005, 08:41 PM
skogen skogen is offline
 
Join Date: Mar 2005
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is it possible to modify so that the active topics-page reloads after 2 mins?

I also wonder if there are some way to get the topics sorted by forum (like the way active topics works for Snitz)

/Fredrik
Reply With Quote
  #41  
Old 03-19-2005, 01:12 PM
wrang wrang is offline
 
Join Date: Oct 2004
Location: Sweden
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

does it works for Vb 3.0.7??
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 12:30 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07156 seconds
  • Memory Usage 2,338KB
  • Queries Executed 25 (?)
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
  • (7)bbcode_code
  • (4)bbcode_quote
  • (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
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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
  • 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