 |
 |
 |
 |
#228972 - 06/13/03 02:39 PM
Re: The Panel Generator
[Re: egor]
|
Member
Registered: 03/09/03
Posts: 171
Loc: Southern California
|
Please tell me where the error is that is not letting this work. <br /> [] <br /> <br /> // ##################################################################### <br /> // Create the instant graemlin/ubbcode <br /> // ##################################################################### <br /> <br /> function instant_ubbcode() { <br /> <br /> global $theme,$config,${$config['cookieprefix']."w3t_language"},$thispath,$tempstyle,$ubbt_lang,$debug,$dbh;$user; <br /> <br /> $langfile = ${$config['cookieprefix']."w3t_language"}; <br /> if (!$langfile) { <br /> $langfile = $config['language']; <br /> } <br /> require ("$thispath/languages/$langfile/instant_markup.php"); <br /> <br /> // -------------------------------------------------- <br /> // We need to grab all of the graemlins out of the db <br /> $query = " <br /> SELECT G_Code,G_Smiley,G_Image <br /> FROM {$config['tbprefix']}Graemlins <br /> "; <br /> $sth = $dbh -> do_query($query); <br /> $i=0; <br /> $gnum = 0; <br /> $remotelink = ""; <br /> $graemlinlist=""; <br /> while (list($code,$smiley,$image) = $dbh -> fetch_array($sth)) { <br /> if ($smiley) { <br /> $code = $smiley; <br /> } else { <br /> if (stristr("$code","$")) { <br /> eval("\$code = $code;"); <br /> } <br /> $code = ":$code:"; <br /> } <br /> if ($gnum < $theme['max_graemlins']) { <br /> $graemlinlist .= <<<EOF <br /> <a href="javascript:void(0)" onclick="insertAtCaret(document.replier.Body, ' $code'); document.replier.Body.focus();"><img src="{$config['images']}/graemlins/$image" border="0" alt="$code" /></a> <br />EOF; <br /> } <br /> else { <br /> $remotelink = "<a href=\"javascript:void(0)\" onclick=\"openGraemlinPanel()\">{$ubbt_lang['MORE_G']} >>></a>"; <br /> } <br />EOF; <br /> $i++; <br /> $gnum++; <br /> if ($i==6) { <br /> $i=0; <br /> if ($gnum < ($theme['max_graemlins'] +1)) { <br /> $graemlinlist .= "<br />"; <br /> } <br /> if( (preg_match("/-1-/",$user['U_Groups'])) or (preg_match("/-2-/",$user['U_Groups'])) or (preg_match("/-3-/",$user['U_Groups']))) { <br /> $showpanelgenerator="<p align=\"center\"><a href=\"javascript: x()\" onclick=\"window.open('pano/popup.php','panelpopup','Width=510,height=320');\">Panel Generator</a></p>"; <br /> }else{ <br /> $showpanelgenerator=""; <br /> } <br /> } <br /> } <br /> <br /> $graemlinlist .= $remotelink; <br /> <br /> if (!$debug) { <br /> include("$thispath/templates/$tempstyle/ubbt_instant_ubbcode.tmpl"); <br /> } <br /> return $template; <br /> <br /> } <br />[/] <br /> <br /> <br /> <br /> <br />And yes, I am NEW <img src="/forum/images/graemlins/wink.gif" alt="" /> <br /> <br />
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#228979 - 06/13/03 03:56 PM
Re: The Panel Generator
[Re: vajraman]
|
I type Like navaho
Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
|
Are you trying to restrict it to specific groups - <br />if not maybe take the group restriction thing out to eliminate stuff until you get it working<br /><br />Change this:<br /> <br />if( (preg_match("/-1-/",$user['U_Groups'])) or (preg_match("/-2-/",$user['U_Groups'])) or (preg_match("/-3-/",$user['U_Groups']))) { <br /> $showpanelgenerator="<p align=\"center\"><a href=\"javascript: x()\" onclick=\"window.open('pano/popup.php','panelpopup','Width=510,height=320');\">Panel Generator</a></p>"; <br /> }else{ <br /> $showpanelgenerator=""; <br /> } <br /><br /><br />To this:<br /> <br /> $showpanelgenerator="<p align=\"center\"><a href=\"javascript: x()\" onclick=\"window.open('pano/popup.php','panelpopup','Width=510,height=320');\">Panel Generator</a></p>"; <br />
|
|
Top
|
|
|
|
 |
 |
 |
 |
|
|