[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
manuxtreme
Registered User
Posts: 48
Joined: Tue Aug 23, 2005 11:54 am

Post by manuxtreme »

Is there any way to make this compatiible with CH 2.1.6? as this is an awesome feature to have
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Post by lefty74 »

markus_petrux, nice mod :)

if i wanted to give only my registered users this option, what change would i have to do?

cheers
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
thehawke
Registered User
Posts: 108
Joined: Thu Nov 03, 2005 12:32 pm
Contact:

Post by thehawke »

OK I am back in the saddle again and still trying to track down the problem in ptifo template. Here is the code:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="{S_CONTENT_DIRECTION}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}">
<meta http-equiv="Content-Style-Type" content="text/css">
{META}
{NAV_LINKS}
<title>{SITENAME} :: {PAGE_TITLE}</title>
<link rel="stylesheet" href="{S_ROOT}templates/ptifo/{T_HEAD_STYLESHEET}" type="text/css">
<!-- start mod : Resize Avatars Based on Max Width and Height -->
<script type="text/javascript" src="{U_RMWA_JSLIB}"></script>
<!-- fin mod : Resize Avatars Based on Max Width and Height -->

<!-- BEGIN switch_enable_pm_popup -->
<script language="Javascript" type="text/javascript">
<!--
	if ( {PRIVATE_MESSAGE_NEW_FLAG} )
	{
		window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
	}
//-->
</script>
<!-- END switch_enable_pm_popup -->
</head>
<body>
{QBARS}
<a name="top"></a>

<table width="100%" cellspacing="0" cellpadding="10" border="0" align="center"> 
<tr>
	<td class="bodyline"><table width="100%" cellspacing="0" cellpadding="0" border="0">
	<tr> 
		<td><a href="{U_INDEX}"><img src="{I_LOGO}" border="0" alt="{L_INDEX}" vspace="1" /></a>
		</td>
		<td align="center" width="100%" valign="middle"><span class="maintitle">{SITENAME}</span><span class="gen"><br />&nbsp;{SITE_DESCRIPTION}&nbsp;<br /></span>
			<table cellspacing="0" cellpadding="2" border="0">
			<tr>
				<td align="center" valign="top" nowrap="nowrap"><span class="mainmenu">
					<!-- BEGIN topic_calendar -->&nbsp;<a href="{U_CALENDAR}" class="mainmenu"><img src="{I_CALENDAR}" border="0" alt="{L_CALENDAR}" hspace="3" />{L_CALENDAR}</a>&nbsp; <!-- END topic_calendar -->&nbsp;<a href="{U_FAQ}" class="mainmenu"><img src="{I_FAQ}" border="0" alt="{L_FAQ}" hspace="3" />{L_FAQ}</a>&nbsp; &nbsp;<a href="{U_SEARCH}" class="mainmenu"><img src="{I_SEARCH}" border="0" alt="{L_SEARCH}" hspace="3" />{L_SEARCH}</a>&nbsp; &nbsp;<a href="{U_MEMBERLIST}" class="mainmenu"><img src="{I_MEMBERLIST}" border="0" alt="{L_MEMBERLIST}" hspace="3" />{L_MEMBERLIST}</a>&nbsp; &nbsp;<a href="{U_GROUP_CP}" class="mainmenu"><img src="{I_GROUP_CP}" border="0" alt="{L_USERGROUPS}" hspace="3" />{L_USERGROUPS}</a>&nbsp;<a href="./chat" class="mainmenu" target="_blank"><img src="templates/subSilver/images/icon_mini_chat.gif" width="12" height="13" border="0" alt="Chat" hspace="3" />Chat&nbsp;(&nbsp;<img src="./chat/online.php?font_size=10&size_y=10&red=00&green=66&blue=99" border="0" align="absmiddle">)</a>
				</span></td>
			</tr>
			<tr>
				<td align="center" valign="top" nowrap="nowrap"><span class="mainmenu">
					<!-- BEGIN switch_user_logged_out -->&nbsp;<a href="{U_REGISTER}" class="mainmenu"><img src="{I_REGISTER}" border="0" alt="{L_REGISTER}" hspace="3" />{L_REGISTER}</a>&nbsp; <!-- BEGINELSE switch_user_logged_out -->&nbsp;<a href="{U_PROFILE}" class="mainmenu"><img src="{I_PROFILE}" border="0" alt="{L_PROFILE}" hspace="3" />{L_PROFILE}</a>&nbsp; &nbsp;<a href="{U_PREFERENCES}" class="mainmenu"><img src="{I_PREFERENCES}" border="0" alt="{L_PREFERENCES}" hspace="3" />{L_PREFERENCES}</a>&nbsp; &nbsp;<a href="{U_PRIVATEMSGS}" class="mainmenu"><img src="{PRIVMSG_IMG}" border="0" alt="{PRIVATE_MESSAGE_INFO}" hspace="3" />{PRIVATE_MESSAGE_INFO}</a>&nbsp; <!-- END switch_user_logged_out -->&nbsp;<a href="{U_LOGIN_LOGOUT}" class="mainmenu"><img src="<!-- BEGIN switch_user_logged_out -->{I_LOGIN}<!-- BEGINELSE switch_user_logged_out -->{I_LOGOUT}<!-- END switch_user_logged_out -->" width="12" height="13" border="0" alt="{L_LOGIN_LOGOUT}" hspace="3" />{L_LOGIN_LOGOUT}</a>&nbsp;
				</span></td>
			</tr>
			<!-- BEGIN user_is_admin -->
			<tr>
				<td align="center" valign="top" nowrap="nowrap"><span class="mainmenu">
					&nbsp;<a href="{U_ADMIN_LINK}" class="mainmenu"><img src="{I_ADMIN_LINK}" border="0" alt="{L_ADMIN_LINK}" hspace="3" />{L_ADMIN_LINK}</a>&nbsp;
				</span></td>
			</tr>
			<!-- END user_is_admin -->
			</table>
		</td>
	</tr>
	</table>

	<br class="nav" />
	<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">
	<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 />
			{S_TIMEZONE}
		</span></td>
		<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 />

		<!-- 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 -->

		<!-- +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 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>
	</tr>
	<!-- BEGIN full_month_ELSE -->
	<tr><td colspan="2">{CALENDAR_BOX}</td></tr>
	<!-- END full_month_ELSE -->
	</table>
Can anyone figure out what the nested tag is that I need to change in order to get the URLs for the hours to show after the label of View Latest? The website in question is http://unfilterednewsnetwork.com/phpBB/index.php
markus_petrux
Former Team Member
Posts: 1887
Joined: Wed Apr 23, 2003 7:11 am
Location: Girona, Catalunya (Spain)
Contact:

Post by markus_petrux »

Hi,

I believe it is not the code in the template that needs to be adapted, but the PHP code that builds the template entries. ie. if I am not wrong, the line that needs to be changed is:

Code: Select all

$template->assign_block_vars('search_latest', array(
Unfortunately, I do not have the CH code nor time to grab it right now. If anyone can figure this out, I'll update my first post on this topic for future references.

Cheers
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 »

OK I just updated my board and CH to the latest versions (s.0.21 for PHPBB and 2.1.6 for CH). It appears this mod is no longer compatible with said versions as search.php has been completely rewritten. Any chance of making this compatible? I hope so because it is one of the most popular mods with our users.
markus_petrux
Former Team Member
Posts: 1887
Joined: Wed Apr 23, 2003 7:11 am
Location: Girona, Catalunya (Spain)
Contact:

Post by markus_petrux »

thehawke wrote: OK I just updated my board and CH to the latest versions (s.0.21 for PHPBB and 2.1.6 for CH). It appears this mod is no longer compatible with said versions as search.php has been completely rewritten. Any chance of making this compatible? I hope so because it is one of the most popular mods with our users.

Unfortunatelly, I'm very busy in real life. Sorry.

Please, let me know if you can finally find a workaround, I can add a pointer to it from the first post of this topic, so that may help others in the future.
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 »

I'll be testing something tomorrow. If it works. I will post our findings here and let you know.
KE5EHI
Registered User
Posts: 68
Joined: Mon Aug 28, 2006 5:55 pm
Location: Tulsa, OK

Post by KE5EHI »

I'm still trying to overcome the nested tags problem with the

Code: Select all

<!-- switch_user_logged_in -->

and

<!-- search_latest -->
I don't want the "View latest" to be visible unless the user is logged in.

Anyone figure out how to fix this?
p5x
Registered User
Posts: 18
Joined: Thu Sep 07, 2006 9:16 pm

Post by p5x »

I'd be interested in seeing a version of this mod to work with 2.0.21 if possible :D
markus_petrux
Former Team Member
Posts: 1887
Joined: Wed Apr 23, 2003 7:11 am
Location: Girona, Catalunya (Spain)
Contact:

Post by markus_petrux »

@KE5EHI: I can't check it now, but I believe I can help you... assuming you have already installed this MOD, try this:

OPEN: index.php
FIND:

Code: Select all

		$template->assign_block_vars('search_latest', array(
REPLACE WITH:

Code: Select all

		$template->assign_block_vars('switch_user_logged_in.search_latest', array(
OPEN: templates/subSilver/index_body.tpl
FIND:

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 -->
REPLACE WITH:

Code: Select all

		<!-- +MOD: Search latest 24h 48h 72h -->
		<!-- BEGIN switch_user_logged_in -->
		{L_SEARCH_LATEST}:
		<!-- BEGIN search_latest -->
		<a href="{switch_user_logged_in.search_latest.U_SEARCH_LATEST_XXH}" class="gensmall">{switch_user_logged_in.search_latest.L_SEARCH_LATEST_XXH}</a>
		<!-- END search_latest -->
		<a href="{U_SEARCH_LATEST_XXH}" class="gensmall">{L_SEARCH_LATEST_XXH}</a><br />
		<!-- END switch_user_logged_in -->
		<!-- -MOD: Search latest 24h 48h 72h -->
@p5x: This MOD, as downloaded from this site, supports phpBB 2.0.21
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)
KE5EHI
Registered User
Posts: 68
Joined: Mon Aug 28, 2006 5:55 pm
Location: Tulsa, OK

Post by KE5EHI »

markus_petrux wrote: @KE5EHI: I can't check it now, but I believe I can help you... assuming you have already installed this MOD, try this:


Markus, that's what I tried earlier (and again) along with a few variations of it. Then end result looks like this when the user is logged out. Take note that none of the switch_user_logged_in switches work when I try a nested switch like that. Also, I'm using PHPBB 2.0.19

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

Post by markus_petrux »

hmm... maybe using another flag then?

OPEN: index.php

FIND:

Code: Select all

//+MOD: Search latest 24h 48h 72h
	$search_latest_hours = explode(',', $board_config['search_latest_hours']);

	for( $search_i = 0; $search_i < (count($search_latest_hours)-1); $search_i++ )
	{
		$template->assign_block_vars('search_latest', array(
			'L_SEARCH_LATEST_XXH' => sprintf($lang['Search_latest_XXh'], $search_latest_hours[$search_i]),
			'U_SEARCH_LATEST_XXH' => append_sid('search.'.$phpEx.'?search_id=latest&hours=' . $search_latest_hours[$search_i])
		));
	}
	$template->assign_vars(array(
		'L_SEARCH_LATEST' => $lang['Search_latest'],
		'L_SEARCH_LATEST_XXH' => sprintf($lang['Search_latest_XXh'], $search_latest_hours[$search_i]),
		'U_SEARCH_LATEST_XXH' => append_sid('search.'.$phpEx.'?search_id=latest&hours=' . $search_latest_hours[$search_i])
	));
//-MOD: Search latest 24h 48h 72h
REPLACE WITH:

Code: Select all

//+MOD: Search latest 24h 48h 72h
	if ($userdata['session_logged_in'])
	{
		$template->assign_block_vars('search_user_logged_in', array());

		$search_latest_hours = explode(',', $board_config['search_latest_hours']);

		for( $search_i = 0; $search_i < (count($search_latest_hours)-1); $search_i++ )
		{
			$template->assign_block_vars('search_user_logged_in.search_latest', array(
				'L_SEARCH_LATEST_XXH' => sprintf($lang['Search_latest_XXh'], $search_latest_hours[$search_i]),
				'U_SEARCH_LATEST_XXH' => append_sid('search.'.$phpEx.'?search_id=latest&hours=' . $search_latest_hours[$search_i])
			));
		}
		$template->assign_vars(array(
			'L_SEARCH_LATEST' => $lang['Search_latest'],
			'L_SEARCH_LATEST_XXH' => sprintf($lang['Search_latest_XXh'], $search_latest_hours[$search_i]),
			'U_SEARCH_LATEST_XXH' => append_sid('search.'.$phpEx.'?search_id=latest&hours=' . $search_latest_hours[$search_i])
		));
	}
//-MOD: Search latest 24h 48h 72h
And then use search_user_logged_in rather than switch_user_logged_in in index_body.tpl, as described in my previous messge.

Sorry, I'm writing from a PC that has no way to test that.
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)
KE5EHI
Registered User
Posts: 68
Joined: Mon Aug 28, 2006 5:55 pm
Location: Tulsa, OK

Post by KE5EHI »

markus_petrux wrote: hmm... maybe using another flag then?


Woohoo, that worked! Thank you so much.

Image
"First rule in government spending: why build one when you can have two at twice the price?"
Bacchus1
Registered User
Posts: 45
Joined: Thu Dec 16, 2004 4:29 am

Post by Bacchus1 »

Awesome mod! No problems installing it with easyMod.
yeni
Registered User
Posts: 3
Joined: Sat Jan 06, 2007 5:33 am

Post by yeni »

thehawke wrote: I'll be testing something tomorrow. If it works. I will post our findings here and let you know.


Looks like you got it working. Please share what you did.
Post Reply

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