I'm having a problem with variables being set through functions.
It all starts after a user logs into the website and directs them to user.php. User.php has:
require_once('config.inc.php');
require_once('modules.php');
config.inc.php includes the code:
/ GET USER VARIABLES. /
list($id,$user,$theme) = mysql_fetch_array(mysql_query("SELECT id,user,theme FROM staffconfig WHERE user='$user'"));
/ GET THEME VARIABLES /
$result = mysql_query("SELECT id,themename,mainimg,newsicon,tblborder,tblheader,textcolor,bgcolor,link,vlink,alink FROM themeconfig where themename='$theme'");
list($id,$themename,$mainimg,$newsicon,$tblborder,$tblheader,$textcolor,$bgcolor,$link,$vlink,$alink) = mysql_fetch_array($result);
modules.php includes the functions which are called from user.php
for example...user.php includes this:
/ NEWS MODULE /
newsmod();
the function is then called from modules.php where:
require_once('config.inc.php');
function newsmod() {
/News Module/
print '<table border="1" cellpadding="0" cellspacing="0" width="100%" bordercolorlight="' .$tblborder. '" bgcolor="' .$tblheader. '">
<tr>
<td width="100%">
<b><p align="center"><font face="Arial" size="2">.: News Module :.</font></p></b>
</td>
</tr>
</table>';
}
It will print the table and .: News Module :. on the user.php page where the function is called but it wont set the table colors right. The code to get the theme does work from config.inc.php because it shows up correct on user.php, just doesnt show up correct when it calls the functions from module.php. Is there a way to fix this without having to put the modules directly on user.php without eliminating the functions?