Differences from version 1 to 2



@@ -28,4 +28,29 @@

 
 
 !! .htaccess
-This file, placeed in Bitweaver's root directory, usually addresses ((Bitweaver Performance|performance)) and ((Bitweaver Security|security)). There's a page discussing ((The perfect .htaccess file)) for Bitweaver.
+This file, placeed in Bitweaver's root directory, usually addresses ((Bitweaver Performance|performance)) and ((Bitweaver Security|security)). There's a page discussing ((The perfect .htaccess file)) for Bitweaver. See also ((The perfect robots.txt)).
+
+!! If user
+You can examine your source code and find equivalent chunks in the templates, and then block them depending on the status of the user, using something like __-+{if $gBitUser->IsRegistered()}+-__.
+
+This can be an advantage on smaller sites, where all the community features are reserved for a few admins or editors, and "the regular user" doesn't log in. For instance, there a some wiki pages to represent the company, looking like "normal pages", and then there's a photo gallery, but only when members of that company log in, they're actually using the power of wiki editing, version control, commenting and so on.
+
+{code source=php title="kernel/templates/header.tpl"}
+{$gBitSystem->isFeatureActive( 'site_help_popup' )}
+ {popup_init src="`$smarty.const.UTIL_PKG_URL`javascript/libs/overlib.js"}
+{/if}
+{/code}
+
+{code source=php title="yourstyle/kernel/header.tpl"}
+{if $gBitUser->IsRegistered() and $gBitSystem->isFeatureActive( 'site_help_popup' )}
+ {popup_init src="`$smarty.const.UTIL_PKG_URL`javascript/libs/overlib.js"}
+{/if}
+{/code}
+
+The second code overwrites the original because of the placement of the file in the site's style folder. It avoids including a Javascript library to display help popups, although the feature is activated. You save one HTTP request and some byte overhead, making your site faster. You could do the same for the "spinner" at the bottom which belongs to the rich text editor, displaying an animated GIF. Another HTTP request gone.
+
+Another possibility is a low-key login. This code presents a simple text link to get to the login page, or just logs the user out, if he/she was logged in already:
+
+{code source=php}
+<a href="{$smarty.const.BIT_ROOT_URL}users/log{if $gBitUser->IsRegistered()}out.php">Logout{else}in.php">Login</a>{/if}
+{/code}
Page History
Date/CommentUserIPVersion
17 Feb 2010 (16:03 UTC)
added if user
laetzer85.178.14.1692
Current • Source
laetzer85.178.0.1701
View • Compare • Difference • Source