![]() |
| |||||||
| Mods and contribution Discussion This forum is only for discussion of modding phpLD. For specific mod releases, please see the appropriate forum. |
![]() |
| | Thread Tools | Display Modes |
| | #1 |
| Supporter Join Date: Dec 2005 Posts: 487 | Just basic code to help make user experience easier. When a search term is searched it disappears from the search field after submit. To keep search term in the search field use this: In top_bar.tpl place this: Code: {php}
if ( isset( $_GET['q'] ) ) {
$sQ = $_GET['q'];
} else {
$sQ = '';
}
{/php} Find: Code: {* Search form *}
<form action="{$smarty.const.DOC_ROOT}/index.php" method="get">
<input type="text" name="q" size="20" class="text" /> <input type="submit" value="{l}Search{/l}" class="btn"/>
</form>
</span> Place this code after class="text" : Code: value="{$smarty.get.q|default:""}" And thats all folks :) - Neticus Edited to give post appropriate title no code has been changed. |
| |
| | #2 |
| Join Date: Aug 2005 Location: Dhaka, Bangladesh Posts: 854 | Thanks for this good mod |
| |
| | #3 |
| Supporter Join Date: Dec 2005 Posts: 487 | No probs. |
| |
| | #4 |
| Join Date: Feb 2006 Location: Orlando, Florida Posts: 12 | In 3.0.2 it looks like this; Code: <input type="text" name="q" size="45" class="input" /> Code: <input type="text" name="q" size="45" class="input" value="{if !empty($q)}{$q}{/if}" /> |
| |
| | #5 |
| Supporter Moderator Join Date: Dec 2005 Location: Cluj-Napoca/Sighisoara (Romania) Posts: 4,468 | Why not use a variable that is allready set? Code: <input type="text" name="q" size="20" class="text" value="{if !empty($q)}{$q}{/if}" /> __________________ wanna say thank you?
|
| |
| | #6 | |
| Supporter Join Date: Dec 2005 Posts: 487 | Quote:
Code: value="{if !empty($q)}{$q}{/if}" Less code same effect. Much better Thanks Net. | |
| |
| | #7 | |
| Join Date: Sep 2005 Posts: 678 | Quote:
__________________ Please check your sig links | |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|