| Re: Need help with a code |
| by deka87 on 2010/4/28 7:09:44 le="color: #000000"><?php global $xoopsDB; you made my day, zyspec! notifications on my website now respect user groups thanks!
|
| Re: Need help with a code |
| by zyspec on 2010/4/27 20:41:35 There's a couple of possibilities depending on where this code is being placed... 1) near the top of the file add the following line: le="color: #000000"><?php global $xoopsDB; OR 2) everywhere you see le="color: #000000"><?php $xoopsDB replace it with le="color: #000000"><?php $GLOBALS['xoopsDB'] If neither of these work, like if you're trying this in a custom page, etc. then it could be a little more involved... but I'd try one of the above methods first. |
| Need help with a code |
| by deka87 on 2010/4/27 19:06:43 hi guys, i've got a notifications hack which doesn't work giving a blank page. here is the part of it: le="color: #000000"><?php //notifications hack ... $uids = array(); $sql = "SELECT DISTINCT uid FROM ".$xoopsDB->prefix("groups_users_link")." WHERE groupid = 6"; $result = $xoopsDB->query($sql); while($row = $xoopsDB->fetchArray($result)) { $uids[] = $row['uid']; } ... the debug says le="color: #000000"><?php Notice: Undefined variable: xoopsDB in file /modules/catads/admin/adsmod.php line 159 the 159 line is le="color: #000000"><?php $sql = "SELECT DISTINCT uid FROM ".$xoopsDB->prefix("groups_users_link")." WHERE groupid = 6"; $result = $xoopsDB->query($sql); any idea how to fix this? thanks in advance! |