[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

User avatar
noth
Registered User
Posts: 2481
Joined: Fri Jan 07, 2005 7:10 pm
Location: North Surrey
Contact:

Post by noth » Thu Sep 01, 2005 5:27 pm

markus did you notice that my board had this mod Search latest 24h 48h 72h ?

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 Sep 01, 2005 5:37 pm

Oh, yes. But it is not quite good for a demo since it has been modified using that getdaily.php script. Don't see the need for posting user/password either, this MOD is available for all users.

If you wish to post a link to a demo, fine, though. But please, unmodified, so people don't get confused.
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
Galixte de EzCom
Registered User
Posts: 1041
Joined: Mon Oct 04, 2004 11:14 pm
Location: France
Name: Raphaël M.
Contact:

Post by Galixte de EzCom » Thu Sep 22, 2005 4:31 pm

Hi,

the french translation of keys of language :

Code: Select all

# 
#------[ OPEN ]-------------------------------------- 
# 
language/lang_french/lang_main.php 
# 
#------[ FIND ]-------------------------------------- 
# 
// 
// That's all, Folks! 
// ------------------------------------------------- 
# 
#------[ BEFORE, ADD ]----------------------------- 
# 
//+MOD: Search latest 24h 48h 72h 
$lang['Search_latest'] = 'Voir les derniers messages'; 
$lang['Search_latest_XXh'] = '%dh'; 
//-MOD: Search latest 24h 48h 72h 

# 
#------[ OPEN ]-------------------------------------- 
# 
language/lang_french/lang_admin.php 
# 
#------[ FIND ]-------------------------------------- 
# 
// 
// That's all Folks! 
// ------------------------------------------------- 
# 
#------[ BEFORE, ADD ]----------------------------- 
# 
//+MOD: Search latest 24h 48h 72h 
$lang['Search_latest_hours'] = 'Heures de recherche des messages'; 
$lang['Search_latest_hours_explain'] = 'Veuillez spécifier la liste de heures, séparées par une virgule. Ces heures seront utilisées pour établir la recherche des derniers messages sur votre forum.'; 
$lang['Search_latest_hours_error'] = 'Les données entrées dans le champ de la recherche des derniers messages (selon l\'heure), sont incorrectes.<br /><br />Veuilez indiquer la liste des heures, séparées par une virgule.'; 
$lang['Search_latest_results'] = 'Résulats de la recherche des derniers messages'; 
$lang['Search_latest_results_explain'] = 'Veuillez spécifier comment les résulats de la recherche des derniers messages, seront affichés.'; 
//-MOD: Search latest 24h 48h 72h
SOURCE : http://forum.phpbb.biz/viewtopic.php?p=971785#971785

Goodbye.
Last edited by Galixte de EzCom on Thu Sep 22, 2005 5:54 pm, edited 1 time in total.
Communau EzCom
📖 « Traductions d’extensions & styles pour phpBB 3.1.x & 3.2.x ».
📋 Lists of all extensions identified for phpBB 3.1.x & 3.2.x.
📋 Lists of all styles identified for phpBB 3.1.x & 3.2.x.
Image Tu as un forum et tu veux aussi un site web ? Regarde par ici.

Capmaster
Registered User
Posts: 69
Joined: Tue Jul 05, 2005 1:26 pm

Post by Capmaster » Thu Sep 22, 2005 4:56 pm

Kudos to markus_petrux. Very handy little mod. My members like it.

All I did was add "6h" to the times.

Bravo!!!
Image
Some mornings, it's just not worth chewing through the leather straps

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 Sep 22, 2005 7:24 pm

Galixte de EzCom wrote: the french translation of keys of language : ...

Thank you

I have updated my first post on this topic with a reference to your post:
http://www.phpbb.com/phpBB/viewtopic.ph ... 85#1641585
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)

vxchev
Registered User
Posts: 37
Joined: Sun May 29, 2005 12:33 pm
Contact:

Post by vxchev » Wed Oct 05, 2005 4:21 am

Thanks works great

P71
Registered User
Posts: 16
Joined: Tue Aug 26, 2003 9:06 am

Why dind't I discover this tool earlier?

Post by P71 » Wed Nov 02, 2005 3:05 pm

Hi there!

I looked for a similar tool for a while then I gave it up and coded by myself.
See this: [SPAM]
Anyway, Thanks for this tool,
Peter

thehawke
Registered User
Posts: 108
Joined: Thu Nov 03, 2005 12:32 pm
Contact:

Post by thehawke » Fri Dec 09, 2005 8:27 pm

I have an interesting quandary here.

On my site in the sig which is my test area, the view latest 24, 48, 72 shows up on index.tpl for all templates except what is real. There, only view latest: 72 shows up. Any idea how i can fix this temp so the 24h, and 48h shows?

Oh, another interesting bug is nothing but the colon after View Latest Posts shows on the ptifo template.

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

Post by markus_petrux » Sat Dec 10, 2005 11:19 am

You should probably check manually the templates to look at the little HTML snippet added by this MOD. Take as reference the one that works.
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)

thehawke
Registered User
Posts: 108
Joined: Thu Nov 03, 2005 12:32 pm
Contact:

Post by thehawke » Sat Dec 10, 2005 10:43 pm

yup the code is exactly the same.

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

Post by markus_petrux » Sat Dec 10, 2005 11:09 pm

The one in the default template looks ok, it's hard to tell on the others. The PHP side is the same for all. As per the code in templates, it's just HTML. If it doesn't show the links... well, I guess there should be something missing.
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)

thehawke
Registered User
Posts: 108
Joined: Thu Nov 03, 2005 12:32 pm
Contact:

Post by thehawke » Sun Dec 11, 2005 12:55 am

this is the code in the ptifo template. Not that in that particular template, the search code is in the overall_header.tpl instead of index_body.tpl. I don't know if that makes a difference or not.

Code: Select all

		<!-- BEGIN switch_user_logged_in -->
			<a href="{U_SEARCH_SELF_BY_TOPIC}" class="gensmall">{L_SEARCH_SELF_BY_TOPIC}</a><br /><a href="{U_SEARCH_SELF_BY_POST}" class="gensmall">{L_SEARCH_SELF_BY_POST}</a><br />
		<!-- +MOD: Search latest 24h 48h 72h -->
		{L_SEARCH_LATEST}:
		<!-- BEGIN search_latest -->
		<a href="{search_latest.U_SEARCH_LATEST_XXH}" class="gensmall">{search_latest.L_SEARCH_LATEST_XXH}</a>
		<!-- END search_latest -->
		<a href="{U_SEARCH_LATEST_XXH}" class="gensmall">{L_SEARCH_LATEST_XXH}</a><br />
		<!-- -MOD: Search latest 24h 48h 72h -->
Here is the code from index_body.tpl for whatisreal template:

Code: Select all

		<!-- +MOD: Search latest 24h 48h 72h -->
		{L_SEARCH_LATEST}:
		<!-- BEGIN search_latest -->
		<a href="{search_latest.U_SEARCH_LATEST_XXH}" class="gensmall">{search_latest.L_SEARCH_LATEST_XXH}</a>
		<!-- END search_latest -->
		<a href="{U_SEARCH_LATEST_XXH}" class="gensmall">{L_SEARCH_LATEST_XXH}</a><br />
		<!-- -MOD: Search latest 24h 48h 72h -->

GaryW
Registered User
Posts: 27
Joined: Tue Oct 11, 2005 6:11 am
Location: Adelaide, South Australia
Contact:

Post by GaryW » Mon Dec 12, 2005 11:59 am

thehawke ..

I had the same problem ..

Finally found what the problem was after reading some tutorials in the knowledge base ..

http://www.phpbb.com/kb/article.php?article_id=200

you will probably find you have nested switch loops ...

ie.

<!-- BEGIN switch_user_logged_in -->
::::::
<!-- BEGIN search_latest -->
:::::::::::
<!-- END search_latest -->
::::::::::
<!-- END switch_user_logged_in -->

did not display the 24h or 48h ....

When I changed my code to :-

<!-- BEGIN switch_user_logged_in -->
::::::
<!-- END switch_user_logged_in -->

<!-- BEGIN search_latest -->
:::::::::::
<!-- END search_latest -->


the 24h 48h and 72h started to appear OK ..

Regards,

GaryW

thehawke
Registered User
Posts: 108
Joined: Thu Nov 03, 2005 12:32 pm
Contact:

Post by thehawke » Mon Dec 12, 2005 12:14 pm

OK you are right. That fixed whatisreal but still no love on ptifo (installed template for CH).

Here's my overall header, the search part.

Code: Select all

		<td align="right" valign="bottom" class="gensmall">

			<a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br />
			<a href="{U_SEARCH_UNANSWERED}" class="gensmall">{L_SEARCH_UNANSWERED}</a><br />
		<!-- +MOD: Search latest 24h 48h 72h -->
		{L_SEARCH_LATEST}:
		<!-- BEGIN search_latest -->
		<a href="{search_latest.U_SEARCH_LATEST_XXH}" class="gensmall">{search_latest.L_SEARCH_LATEST_XXH}</a>
		<!-- END search_latest -->
		<a href="{U_SEARCH_LATEST_XXH}" class="gensmall">{L_SEARCH_LATEST_XXH}</a><br />
		<!-- -MOD: Search latest 24h 48h 72h -->
		<!-- BEGIN switch_user_logged_in -->
			<a href="{U_SEARCH_SELF_BY_TOPIC}" class="gensmall">{L_SEARCH_SELF_BY_TOPIC}</a><br /><a href="{U_SEARCH_SELF_BY_POST}" class="gensmall">{L_SEARCH_SELF_BY_POST}</a><br />
		<!-- END switch_user_logged_in -->

			<!-- BEGIN full_month_ELSE --><!-- BEGIN java --><a href="#" onClick="dom_toggle.toggle('calrow','calrow_pic', '{DOWN_ARROW}', '{UP_ARROW}'); return false;" class="gensmall"><img src="{TOGGLE_ICON}" id="calrow_pic" hspace="2" border="0" align="middle" alt="" />{L_CALENDAR}</a><!-- END java --><!-- END full_month_ELSE -->
		</td>

Rudy64
Registered User
Posts: 37
Joined: Mon Apr 08, 2002 5:18 am
Location: Canton, MI USA

Post by Rudy64 » Fri Mar 10, 2006 3:12 am

GaryW wrote: thehawke ..

I had the same problem ..

Finally found what the problem was after reading some tutorials in the knowledge base ..

http://www.phpbb.com/kb/article.php?article_id=200

you will probably find you have nested switch loops ...


Same problem here. Thing is, I need nested loops, since I want only logged in users to be able to use the search.

In page_header.php, I tried doing the following...

Code: Select all

FIND:
	$template->assign_block_vars('switch_user_logged_in', array());

AFTER, ADD:

	$template->assign_block_vars('switch_user_logged_in.search_latest', array());
I got partial success: if I use a list of three or more numbers, it only uses the first and last number. So if I had 24, 48, 72, 168, only 24 and 168 show up.

The assign_block_vars line I added tells it to expect a switch_user_logged_in tag followed by a search_latest nested inside of it. Seems like there is one step missing here to get it to work properly.

Oh, and I also changed it to days, rather than hours. This is a simple change in search.php:

Code: Select all


FIND:

WHERE post_time > " . ( time() - ($latest_hours * 60 * 60) );

REPLACE WITH:

WHERE post_time > " . ( time() - ($latest_hours * 24 * 60 * 60) );
Then, change the appropriate entries in the language files. Of course, you want to enter the number of days in the database after you do this, rather than the hours.

Now if I could just get this nested thing to work...
-= N =-

Definition of oxymoron: good internet provider

Post Reply

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