From: <ny...@us...> - 2007-10-04 22:18:15
|
Update of /cvsroot/tikiwiki/tiki/templates/plugins In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv13540/templates/plugins Modified Files: plugin-topfriends.tpl Log Message: [ENH] prefs: Manage preferences in an array stored in session The impact is : * accelerate each page load when using sessions (prefs are not set again and again + no need to ask again for prefs in database) * reduce memory used by tikiwiki (the prefs array is assigned to smarty as a reference and not a copy) * get rid of two useless "foreach" on prefs (default values are directly defined in prefs array and are overrided by values from database) * reduce the risk of accidentally overrided var in smarty Be warned that : * now, preferences need to be called through the $prefs smarty variable (e.g. $prefs.feature_wiki) * prefs are not anymore in tiki-setup.php, but in a specific file in lib/setup/prefs.php (this is the first commit of tiki-setup.php cleaning). Index: plugin-topfriends.tpl =================================================================== RCS file: /cvsroot/tikiwiki/tiki/templates/plugins/plugin-topfriends.tpl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- plugin-topfriends.tpl 3 Jun 2007 01:40:14 -0000 1.3 +++ plugin-topfriends.tpl 4 Oct 2007 22:17:48 -0000 1.4 @@ -2,10 +2,10 @@ <table class="userlist"> <tr> <td class="userlistheading"><a class="userlistheading" href="tiki-list_users.php?offset=0&sort_mode={if $sort_mode eq 'login_desc'}login_asc{else}login_desc{/if}">{tr}Login{/tr}</a></td> -{if $user_show_realnames neq 'y'} +{if $prefs.user_show_realnames neq 'y'} <td class="userlistheading"><a class="userlistheading" href="tiki-list_users.php?offset=0&sort_mode={if $sort_mode eq 'realName_desc'}realName_asc{else}realName_desc{/if}">{tr}Real Name{/tr}</a></td> {/if} -{if $feature_score eq 'y'} +{if $prefs.feature_score eq 'y'} <td class="userlistheading"><a class="userlistheading" href="tiki-list_users.php?offset=0&sort_mode={if $sort_mode eq 'score_desc'}score_asc{else}score_desc{/if}">{tr}Score{/tr}</a></td> {/if} </tr> @@ -13,10 +13,10 @@ {section name=changes loop=$listusers} <tr> <td class="userlist{cycle advance=false}"> {$listusers[changes].login|userlink} </td> -{if $user_show_realnames neq 'y'} +{if $prefs.user_show_realnames neq 'y'} <td class="userlist{cycle advance=false}"> {$listusers[changes].login|username} </td> {/if} -{if $feature_score eq 'y'} +{if $prefs.feature_score eq 'y'} <td class="userlist{cycle advance=true}"> {$listusers[changes].score} </td> {/if} </tr> |