System-Wide Variables - in templates? - Joomla! Forum - community, help and support


i've been building highly custom site past several weeks, , while i've been making progress, i'm starting come against errors.
to explain:
one module uses $user = $user->username;
but module uses same variable - , calls jfactory::getuser();
the same can go database object called multiple times.
i've noticed can cause conflicts, problems, , various little bugs. in order minimize these conflicts, possible put most-used variables directly template , have modules reference them there?

okay.. small bump , better explamation. in terms of conflicts, have been trying greetbar print out person's statistics on website working - such cash, points, rank, etc. backend in place this, i've been trying figure out how thing work globally. greetbar has 2 states - "would register?" reminder, , membership information when logged in. user can safely log in , gets directed custom user page.

past that, however, greetbar enabled navigates on different menu item, they're logged out. same happens trying view pm's - requests log in. greetbar uses user->username, , custom user page, i've never had conflicts double variables before. occurs when greetbar enabled, , appears in code.

code: select all

<?php
defined(’_jexec’) or die (’direct access not allowed’);
?>
<style type="text/css">
<!--
#notifybox {
   position:absolute;
   width:600px;
   height:30px;
   z-index:1;
}
-->
</style>
<strong><div id="notifybox">
<?php
$user =& jfactory::getuser();
if ($user = $user->username) {
echo "testing notification plugin.";
echo " yet test of system.";
} else {
echo "welcome greet system! register?";
};
?>
</div></strong>





Comments

Popular posts from this blog

Joomla site hacked, cant see front and - Joomla! Forum - community, help and support

Christian Home School Programs - Joomla! Forum - community, help and support

Trouble with PF_OutFlag_I_USE_AUDIO and PF_CHECKOUT_LAYER_AUDIO