[2.0.17] Search latest 24h 48h 72h

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
20
91%
Very Good
1
5%
Good
1
5%
Fair
0
No votes
Poor
0
No votes
 
Total votes: 22

Extensions Robot
Extensions Robot
Extensions Robot
Posts: 27361
Joined: Sat Aug 16, 2003 7:36 am

[2.0.17] Search latest 24h 48h 72h

Post by Extensions Robot » Fri Jun 17, 2005 2:21 pm

MOD Name: Search latest 24h 48h 72h
Author: markus_petrux
MOD Description: This MOD adds a new search feature so it allows to search for posts from latest XX hours. The list of latest hours can be specified from the ACP, also whether to show results as posts or topics.


MOD Version: 1.1.0 (Updated 07/26/05)

Download File: search_latest_24h_48h_72h_v1.1.0.zip
mods overview page: View
File Size: 6026 Bytes

Security Score: 0
Last edited by Extensions Robot on Mon Apr 30, 2007 12:28 am, edited 1 time in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)

User avatar
wGEric
Former Team Member
Posts: 8805
Joined: Sun Oct 13, 2002 3:01 am
Location: Friday
Name: Eric Faerber
Contact:

Post by wGEric » Wed Jun 29, 2005 12:58 am

MOD Validated/Released

Notes:
This MOD allows people to search for posts that were made recently on your board.
Eric

User avatar
markus_petrux
Former Team Member
Posts: 1887
Joined: Wed Apr 23, 2003 7:11 am
Location: Girona, Catalunya (Spain)
Contact:

Post by markus_petrux » Wed Jun 29, 2005 1:11 am

Thanks a lot to all phpBB MODs Team members for your hard work.

~~~~~~~~~~

Space reserved for future comments regarding this MOD.

~~~~~~~~~~

Frech translation can be found here (thanks, Galixte de EzCom):
http://www.phpbb.com/phpBB/viewtopic.ph ... 11#1778511

~~~~~~~~~~

Enjoy! :)
Last edited by markus_petrux on Thu Sep 22, 2005 7:23 pm, edited 1 time in total.
EasyMOD Standards | MOD Template Actions | MODs in Development Rules
Useful information for MOD Authors | MOD Queue Stats | Search MODs
Write SQL/DDL portable to all SQL servers supported by phpBB!
Get EasyMOD 0.3.0! | Suport al phpBB en Català!
8)

User avatar
3Di
Registered User
Posts: 11869
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milano - Frankfurt
Name: Marco
Contact:

Post by 3Di » Wed Jun 29, 2005 1:29 am

Sounds good, i'll try.

Compatibility to CH?

thanks.
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades

User avatar
markus_petrux
Former Team Member
Posts: 1887
Joined: Wed Apr 23, 2003 7:11 am
Location: Girona, Catalunya (Spain)
Contact:

Post by markus_petrux » Wed Jun 29, 2005 1:41 am

3Di wrote: Compatibility to CH?

Not tested, but browsing the CH code it looks 100% compatible.
EasyMOD Standards | MOD Template Actions | MODs in Development Rules
Useful information for MOD Authors | MOD Queue Stats | Search MODs
Write SQL/DDL portable to all SQL servers supported by phpBB!
Get EasyMOD 0.3.0! | Suport al phpBB en Català!
8)

devinliao
Registered User
Posts: 92
Joined: Wed Jun 29, 2005 1:58 am

Post by devinliao » Wed Jun 29, 2005 2:00 am

Parse error: parse error, unexpected T_BOOLEAN_OR in /home/devin/public_html/forum/search.php on line 160

and line 162

thats what i keep getting

#-----[ OPEN ]------------------------------------------------
#
search.php
#
#-----[ FIND ]-----------------------------------------
#
//
// Cycle through options ...
//
if ( $search_id == 'newposts' ||
#
# NOTE --- the previous is a partial search. The line should something like this:
# if ( $search_id == 'newposts' || $search_id == 'egosearch' || $search_id == 'unanswered' || $search_keywords != '' || $search_author != '' )
#
#
#-----[ IN-LINE FIND ]----------------------------------------
#
$search_id == 'newposts'
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
|| $search_id == 'latest'
#
#-----[ FIND ]-----------------------------------------
#
if ( $search_id == 'newposts' ||
#
# NOTE --- the previous is a partial search. The line should something like this:
# if ( $search_id == 'newposts' || $search_id == 'egosearch' || ( $search_author != '' && $search_keywords == '' ) )
#
#
#-----[ IN-LINE FIND ]----------------------------------------
#
$search_id == 'newposts'
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
|| $search_id == 'latest'
#

User avatar
markus_petrux
Former Team Member
Posts: 1887
Joined: Wed Apr 23, 2003 7:11 am
Location: Girona, Catalunya (Spain)
Contact:

Post by markus_petrux » Wed Jun 29, 2005 2:12 am

Make sure you have correctly applied the IN-LINE actions. You might want to check this KB article:
http://www.phpbb.com/kb/article.php?article_id=150


The result of both changes (around lines 160-162) should (more or less) look like:

Code: Select all

	//
	// Cycle through options ...
	//
	if ( $search_id == 'newposts' || $search_id == 'latest' || $search_id == 'egosearch' || $search_id == 'unanswered' || $search_keywords != '' || $search_author != '' )
	{
		if ( $search_id == 'newposts' || $search_id == 'latest' || $search_id == 'egosearch' || ( $search_author != '' && $search_keywords == '' )  )
		{
EasyMOD Standards | MOD Template Actions | MODs in Development Rules
Useful information for MOD Authors | MOD Queue Stats | Search MODs
Write SQL/DDL portable to all SQL servers supported by phpBB!
Get EasyMOD 0.3.0! | Suport al phpBB en Català!
8)

devinliao
Registered User
Posts: 92
Joined: Wed Jun 29, 2005 1:58 am

Post by devinliao » Thu Jun 30, 2005 3:26 am

will it work if i use easymod to install it?

devinliao
Registered User
Posts: 92
Joined: Wed Jun 29, 2005 1:58 am

Post by devinliao » Thu Jun 30, 2005 3:48 am

Parse error: parse error, unexpected T_BOOLEAN_OR in /home/devin/public_html/forum/search.php on line 157

whihc is || $search_id == 'latest' //

devinliao
Registered User
Posts: 92
Joined: Wed Jun 29, 2005 1:58 am

Post by devinliao » Thu Jun 30, 2005 3:52 am

it looks fine after deleting that line.

Looks like a eay mod error

User avatar
rungok
Registered User
Posts: 50
Joined: Mon Sep 29, 2003 9:39 pm
Location: Oslo

Post by rungok » Thu Jun 30, 2005 4:11 am

This mod was a very good extension to "Keep unread"-mod, since you will also see the posts you have read in this overview. My wife will be happy now!

:D

devinliao
Registered User
Posts: 92
Joined: Wed Jun 29, 2005 1:58 am

Post by devinliao » Thu Jun 30, 2005 4:17 am

just not sure, because when i used easy mod it made 2 parts of each line.
Now i just don't see a difference in the board.


http://www.devinliao.2freegigs.com/forum/
http://www.devinliao.2freegigs.com/forum/search.php

language/lang_english/lang_main.php a part of the source

Code: Select all

//
// SQR
//
$lang['Quick_reply_panel'] = 'Super Quick Reply Mod';
$lang['Quick_Reply'] = 'Quick Reply';
$lang['Show_quick_reply'] = 'Show Quick Reply Form';
$lang['sqr']['0'] = 'No';
$lang['sqr']['1'] = 'Yes';
$lang['sqr']['2'] = 'On last page only';
$lang['Quick_reply_mode'] = 'Quick Reply Mode';
$lang['Quick_reply_mode_basic'] = 'Basic';
$lang['Quick_reply_mode_advanced'] = 'Advanced';
$lang['Show_hide_quick_reply_form'] = 'Show/hide quick reply form';


$lang['Admin_reauthenticate'] = 'To administer the board you must re-authenticate yourself.';
$lang['Search_for'] = "Search for";
$lang['Submit_search'] = "Submit Search";

$lang['Global_Announcements'] = 'Global Announcements';
$lang['Announcements'] = 'Announcements';
$lang['Sticky_Topics'] = 'Sticky Topics';
//+MOD: Search latest 24h 48h 72h
$lang['Search_latest'] = "View latest";
$lang['Search_latest_24h'] = "24h";
$lang['Search_latest_48h'] = "48h";
$lang['Search_latest_72h'] = "72h";
//-MOD: Search latest 24h 48h 72h

// ezDownloads MOD
$lang['File_Name'] = 'File Name';
$lang['File_Description'] = 'File Description';
$lang['Uploaded_On'] = 'Uploaded';
$lang['Download_Count'] = 'Downloaded';
$lang['View_File_Comments'] = 'Comments';
$lang['Add_File_Comments'] = 'Add/View';
$lang['Downloads'] = 'Downloads Page';
$lang['Download'] = 'Downloads';
$lang['No_Downloads'] = 'No Downloads Are Currently Available';

//+MOD: Search latest 24h 48h 72h
$lang['Search_latest'] = "View latest";
$lang['Search_latest_24h'] = "24h";
$lang['Search_latest_48h'] = "48h";
$lang['Search_latest_72h'] = "72h";
//-MOD: Search latest 24h 48h 72h

//
// That's all, Folks!
// -------------------------------------------------

//+MOD: DHTML Collapsible FAQ MOD
// Please note: %sHERE%s is used to dynamically building the A HREF tag, do not remove the percent signs (%) around HERE!
$lang['dhtml_faq_noscript'] = "It appears that your browser does not support javascript or it has been disabled in your browser's settings.<br /><br />Please, click %sHERE%s to view a plain HTML version of this FAQ.";
//-MOD: DHTML Collapsible FAQ MOD

?>

includes/page_header.php

Code: Select all

'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#' . $theme['fontcolor3'] . '">', '</span>'),
	'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#' . $theme['fontcolor2'] . '">', '</span>'),
//+MOD: Search latest 24h 48h 72h
	'L_SEARCH_LATEST' => $lang['Search_latest'],
	'L_SEARCH_LATEST_24H' => $lang['Search_latest_24h'],
	'U_SEARCH_LATEST_24H' => append_sid('search.'.$phpEx.'?search_id=latest&hours=24'),
	'L_SEARCH_LATEST_48H' => $lang['Search_latest_48h'],
	'U_SEARCH_LATEST_48H' => append_sid('search.'.$phpEx.'?search_id=latest&hours=48'),
	'L_SEARCH_LATEST_72H' => $lang['Search_latest_72h'],
	'U_SEARCH_LATEST_72H' => append_sid('search.'.$phpEx.'?search_id=latest&hours=72'),
//-MOD: Search latest 24h 48h 72h
	'U_SEARCH_UNANSWERED' => append_sid('search.'.$phpEx.'?search_id=unanswered'),
	'U_SEARCH_SELF' => append_sid('search.'.$phpEx.'?search_id=egosearch'),
	'U_SEARCH_NEW' => append_sid('search.'.$phpEx.'?search_id=newposts'),
	'U_INDEX' => append_sid('index.'.$phpEx),

templates/subSilver/index_body.tpl

Code: Select all

  <tr> 
	<td align="left" valign="bottom"><span class="gensmall">
	<!-- BEGIN switch_user_logged_in -->
	{LAST_VISIT_DATE}<br />
	<!-- END switch_user_logged_in -->
	{CURRENT_TIME}<br /></span><span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a></span></td>
	<td align="right" valign="bottom" class="gensmall">
		<!-- BEGIN switch_user_logged_in -->
		<a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br /><a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_SELF}</a><br />
		<!-- END switch_user_logged_in -->
		{L_SEARCH_LATEST}:&nbsp;<a href="{U_SEARCH_LATEST_24H}" class="gensmall">{L_SEARCH_LATEST_24H}</a>&nbsp;<a href="{U_SEARCH_LATEST_48H}" class="gensmall">{L_SEARCH_LATEST_48H}</a>&nbsp;<a href="{U_SEARCH_LATEST_72H}" class="gensmall">{L_SEARCH_LATEST_72H}</a><br />
		<a href="{U_SEARCH_UNANSWERED}" class="gensmall">{L_SEARCH_UNANSWERED}</a></td>
  </tr>
</table>
search.php

Code: Select all

   //
   // Cycle through options ...
   //
   if ( $search_id == 'newposts' || $search_id == 'latest' || $search_id == 'egosearch' || $search_id == 'unanswered' || $search_keywords != '' || $search_author != '' )
   {
      if ( $search_id == 'newposts' || $search_id == 'latest' || $search_id == 'egosearch' || ( $search_author != '' && $search_keywords == '' )  )
      { 
			if ( $search_id == 'newposts' )
			{
				if ( $userdata['session_logged_in'] )
				{
					$sql = "SELECT post_id 
						FROM " . POSTS_TABLE . " 
						WHERE post_time >= " . $userdata['user_lastvisit'];
				}
				else
				{
					redirect(append_sid("login.$phpEx?redirect=search.$phpEx&search_id=newposts", true));
				}

				$show_results = 'topics';
				$sort_by = 0;
				$sort_dir = 'DESC';
			}
//+MOD: Search latest 24h 48h 72h
			else if ( $search_id == 'latest' )
			{
				$latest_hours = intval( isset($HTTP_GET_VARS['hours']) ? $HTTP_GET_VARS['hours'] : 24 );
				$latest_hours = ( ( $latest_hours == 24 || $latest_hours == 48 || $latest_hours == 72 ) ? $latest_hours : 24 );

				$sql = "SELECT post_id 
					FROM " . POSTS_TABLE . " 
					WHERE post_time > " . ( time() - ($latest_hours * 60 * 60) );

				$show_results = 'topics';
				$sort_by = 0;
				$sort_dir = 'DESC';
			}
//-MOD: Search latest 24h 48h 72h
			else if ( $search_id == 'egosearch' )
			{

User avatar
markus_petrux
Former Team Member
Posts: 1887
Joined: Wed Apr 23, 2003 7:11 am
Location: Girona, Catalunya (Spain)
Contact:

Post by markus_petrux » Thu Jun 30, 2005 9:27 am

devinliao wrote: just not sure, because when i used easy mod it made 2 parts of each line.

If you're running EasyMOD 0.2.0a, then you might want to take a look at this fix, affecting IN-LINE actions:
http://area51.phpbb.com/phpBB/viewtopic ... 767#121767

Though, at a first sight, the code you have posted above looks correct.
EasyMOD Standards | MOD Template Actions | MODs in Development Rules
Useful information for MOD Authors | MOD Queue Stats | Search MODs
Write SQL/DDL portable to all SQL servers supported by phpBB!
Get EasyMOD 0.3.0! | Suport al phpBB en Català!
8)

devinliao
Registered User
Posts: 92
Joined: Wed Jun 29, 2005 1:58 am

Post by devinliao » Thu Jun 30, 2005 11:05 pm

ok, will try that, just going to reinstall my forum.

GTI WR6
Registered User
Posts: 1
Joined: Fri Jul 01, 2005 6:38 am

Post by GTI WR6 » Fri Jul 01, 2005 6:41 am

Hi,

I'm new to the forum Mod uploading process. I just backed up the database and saved it on my pc. then do i apply this mod to the file i just downloaded? and then restore the database by uploading this new file?

I'm sorry for being so ignorant, but I really want to try this. Please help me out if you can.

Thanks.

Post Reply

Return to “[2.0.x] MOD Database Releases”

Who is online

Users browsing this forum: No registered users and 4 guests

cron