function blocnotes($typeBlocNote = "shared", $nomBlocNote = "", $largeur = "100%", $nblBlocNote = "5", $gifbgcolor = "", $affiche = true) { global $REQUEST_URI; if ($typeBlocNote == "shared") { if ($nomBlocNote == "\$username") { global $cookie; $nomBlocNote = $cookie[1]; } $bouton = ""; $bnid = md5($nomBlocNote); } elseif ($typeBlocNote == "context") { if ($nomBlocNote == "\$username") { global $cookie, $admin; $nomBlocNote = $cookie[1]; $cur_admin = explode(":", base64_decode($admin)); if ($cur_admin) { $nomBlocNote = $cur_admin[0]; } } if (stristr($REQUEST_URI, "article.php")) { $bnid = md5($nomBlocNote . substr($REQUEST_URI, 0, strpos($REQUEST_URI, "&"))); } else { $bnid = md5($nomBlocNote . $REQUEST_URI); } } else { $nomBlocNote = ""; } if ($nomBlocNote) { global $theme; if ($affiche) { $aff = "<style type=\"text/css\">"; if (@file_exists("themes/{$theme}/style/bloc-note.css")) { $aff .= file_get_contents("themes/{$theme}/style/bloc-note.css"); } else { $aff .= file_get_contents("modules/bloc-notes/bloc-note.css"); } $aff .= "</style>"; } else { $aff = ""; } $aff .= "<table width=\"" . $largeur . "\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\"><tr align=\"center\" valign=\"middle\"><td>"; $aff .= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"; if ($affiche) { $aff .= "\n <tr>\n <td class=\"bn_head_g\" valign=\"middle\"> {$nomBlocNote}</td>\n <td width=\"51\" height=\"20\">"; if ($ibid = theme_image("modules/bloc-note.gif")) { $imgtmpPI = $ibid; } else { $imgtmpPI = "modules/bloc-notes/bloc-note.gif"; } $aff .= "<img src=\"{$imgtmpPI}\" alt=\"\"></td>\n </tr>"; } $aff .= "\n <tr valign=\"top\">\n <td colspan=\"2\" class=\"bn_corps\">\n <form method=\"post\" action=\"modules.php?ModPath=bloc-notes&ModStart=blocnotes\" name=\"A" . $bnid . "\">" . "<textarea class=\"bn_textbox_no_mceEditor\" cols=\"20\" rows=\"" . $nblBlocNote . "\" name=\"texteBlocNote\" ></textarea><br />\n <input type=\"hidden\" name=\"uriBlocNote\" value=\"" . urlencode($REQUEST_URI) . "\" />\n <input type=\"hidden\" name=\"typeBlocNote\" value=\"" . $typeBlocNote . "\" />\n <input type=\"hidden\" name=\"nomBlocNote\" value=\"" . $nomBlocNote . "\" />\n <input type=\"submit\" name=\"okBlocNote\" value=\"Ok\" class=\"bouton_standard bn_bouton_standard\" /> <input type=\"submit\" name=\"supBlocNote\" value=\"RAZ\" class=\"bouton_standard bn_bouton_standard\" />\n </form><script type=\"text/javascript\" src=\"modules.php?ModPath=bloc-notes&ModStart=blocnotes-read&bnid=" . $bnid . "\"></script>\n </td>\n </tr><tr><td colspan=\"2\" class=\"bn_foot\"> </td></tr>\n </table>\n"; $aff .= "</td></tr></table>"; } if ($affiche) { themesidebox("no-title", $aff); } else { return $aff; } }
function render_blocks($blockfile, $blocktitle, $content, $bid, $bposition, $allow_hide) { global $showbanners, $allow_block_hide; global $foot; if ($blockfile != "") { if (file_exists("blocks/" . $blockfile . "")) { if (!defined('BLOCK_FILE')) { define('BLOCK_FILE', 1); } require "blocks/" . $blockfile . ""; } else { $content = "<center>Существует проблема с этим блоком!</center>"; } } if (!(isset($content) and !empty($content))) { $content = "<center>Существует проблема с этим блоком!</center>"; } if ($allow_block_hide && ($allow_hide || get_user_class() >= UC_ADMINISTRATOR)) { $hidden_blocks = isset($_COOKIE['hb']) && !empty($_COOKIE['hb']) ? unserialize($_COOKIE['hb']) : array(); $display = 'block'; $picture = 'minus'; $alt = 'Скрыть'; if (in_array($bid, $hidden_blocks)) { $display = 'none'; $picture = 'plus'; $alt = 'Показать'; } $blocktitle = $blocktitle . ' <span style="cursor: pointer;" onclick="javascript: block_switch(\'' . $bid . '\');"><img border="0" src="pic/' . $picture . '.gif" id="picb' . $bid . '" title="' . $alt . '"></span>'; $content = '<span id="sb' . $bid . '" style="display: ' . $display . ';">' . $content . '</span>'; } themesidebox($blocktitle, $content, $bposition); return null; }
function blocnotes($typeBlocNote = "shared", $nomBlocNote = "", $largeur = "100%", $nblBlocNote = "5", $gifbgcolor = "", $affiche = true) { global $REQUEST_URI; $aff = ''; if ($typeBlocNote == "shared") { if ($nomBlocNote == "\$username") { global $cookie; $nomBlocNote = $cookie[1]; } $bnid = md5($nomBlocNote); } elseif ($typeBlocNote == "context") { if ($nomBlocNote == "\$username") { global $cookie, $admin; $nomBlocNote = $cookie[1]; $cur_admin = explode(":", base64_decode($admin)); if ($cur_admin) { $nomBlocNote = $cur_admin[0]; } } if (stristr($REQUEST_URI, "article.php")) { $bnid = md5($nomBlocNote . substr($REQUEST_URI, 0, strpos($REQUEST_URI, "&"))); } else { $bnid = md5($nomBlocNote . $REQUEST_URI); } } else { $nomBlocNote = ''; } if ($nomBlocNote) { global $theme; if ($block_title == '') { $title = $nomBlocNote; } else { $title = $block_title; } $aff .= ' <form method="post" action="modules.php?ModPath=bloc-notes&ModStart=blocnotes" name="A' . $bnid . '"> <div class="form-group"> <textarea class="form-control" cols="20" rows="' . $nblBlocNote . '" name="texteBlocNote" ></textarea> </div> <div class="form-group"> <input type="hidden" name="uriBlocNote" value="' . urlencode($REQUEST_URI) . '" /> <input type="hidden" name="typeBlocNote" value="' . $typeBlocNote . '" /> <input type="hidden" name="nomBlocNote" value="' . $nomBlocNote . '" /> <div class="row"> <div class="col-xs-12"> <button type="submit" name="okBlocNote" class="btn btn-primary-outline btn-sm btn-block" > <i class="fa fa-check"></i> Valider</button> <button type="submit" name="supBlocNote" class="btn btn-danger-outline btn-sm btn-block" value="RAZ"><i class="fa fa-remove"></i> Effacer</button> </div> </div> </div> </form> <script type="text/javascript" src="modules.php?ModPath=bloc-notes&ModStart=blocnotes-read&bnid=' . $bnid . '"></script>'; } if ($affiche) { themesidebox($title, $aff); } else { return $aff; } }
function marquetapage() { global $cookie; if ($cookie[0] != '') { global $REQUEST_URI, $title, $post, $NPDS_Prefix; if ($ibid = theme_image("modules/add.gif")) { $add = $ibid; } else { $add = "modules/marquetapage/add.gif"; } if ($ibid = theme_image("modules/addj.gif")) { $addj = $ibid; } else { $addj = "modules/marquetapage/addj.gif"; } $result = sql_query("SELECT uri, topic FROM " . $NPDS_Prefix . "marquetapage WHERE uid='{$cookie['0']}' ORDER BY topic ASC"); if (sql_num_rows($result)) { $tmp_toggle = '<a class="tog" id="show_fav" title="' . translate("Show list") . '"><i id="i_lst_fav" class="fa fa-caret-right fa-2x" ></i></a>'; $content = "\n <script type=\"text/javascript\">\n //<![CDATA[\n tog = function(lst,sho,hid){\n \$(document).on('click', 'a.tog', function() {\n var buttonID = \$(this).attr('id');\n lst_id = \$('#'+lst);\n i_id=\$('#i_'+lst);\n btn_show=\$('#'+sho);\n btn_hide=\$('#'+hid);\n if (buttonID == sho) {\n lst_id.fadeIn(1000);//show();\n btn_show.attr('id',hid)\n btn_show.attr('title','" . translate("Hide list") . "');\n i_id.attr('class','fa fa-caret-up fa-2x');\n } else if (buttonID == hid) {\n lst_id.fadeOut(1000);//hide();\n btn_hide=\$('#'+hid);\n btn_hide.attr('id',sho);\n btn_hide.attr('title','" . translate("Show list") . "');\n i_id.attr('class','fa fa-caret-down fa-2x');\n }\n });\n };\n //]]>\n </script>"; $content .= ' <h6> <a class="tog" id="show_fav" title="' . translate("Show list") . '"><i id="i_lst_fav" class="fa fa-caret-right fa-2x" ></i> Bookmarks </a><span class="tag tag-pill tag-default pull-right">' . sql_num_rows($result) . '</span> </h6> <ul id="lst_fav" style="display:none;" > <a href="modules.php?ModPath=marquetapage&ModStart=marquetapage&op=supp_all&uri=' . $_SERVER['PHP_SELF'] . '"><i class="fa fa-trash-o text-danger" title="' . translate("Delete") . '" data-toggle="tooltip"></i></a>'; while (list($uri, $topic) = sql_fetch_row($result)) { $content .= ' <li><a href="' . $uri . '" style="font-size:.7rem;">' . $topic . '</a> <span class="float-xs-right"><a href="modules.php?ModPath=marquetapage&ModStart=marquetapage&op=supp&uri=' . urlencode($uri) . '"><i class="fa fa-trash-o text-danger" title="' . translate("Delete") . '" data-toggle="tooltip"></i></a></span></li>'; } $content .= ' </ul> <script type="text/javascript"> //<![CDATA[ tog("lst_fav","show_fav","hide_fav"); //]]> </script>'; } global $block_title; $uri = urlencode($REQUEST_URI); if ($post) { $title .= "/" . $post; } if ($title == '') { $title_MTP = basename(urldecode($uri)); } else { $title_MTP = $title; } $boxTitle = '<span><a href="modules.php?ModPath=marquetapage&ModStart=marquetapage&op=add&uri=' . $uri . '&topic=' . urlencode($title_MTP) . '"><i class="fa fa-bookmark-o " title="' . translate("Add") . ' ' . translate("favourite") . '" data-toggle="tooltip"></i></a></span>'; if ($block_title == '') { $boxTitle .= ' MarqueTaPage'; } else { $boxTitle .= ' ' . $block_title; } themesidebox($boxTitle, $content); } }
function ChangeStatus($bid, $ok = 0) { global $prefix, $db, $admin_file; $bid = intval($bid); $row = $db->sql_fetchrow($db->sql_query("select active from " . $prefix . "_blocks where bid='{$bid}'")); $active = intval($row['active']); if ($ok or $active == 1) { if ($active == 0) { $active = 1; } elseif ($active == 1) { $active = 0; } $result2 = $db->sql_query("update " . $prefix . "_blocks set active='{$active}' where bid='{$bid}'"); Header("Location: " . $admin_file . ".php?op=BlocksAdmin"); } else { $row3 = $db->sql_fetchrow($db->sql_query("select title, content from " . $prefix . "_blocks where bid='{$bid}'")); $title = filter($row3['title'], "nohtml"); $content = filter($row3['content']); include "header.php"; GraphicAdmin(); echo "<br>"; OpenTable(); echo "<center><font class=\"option\"><b>" . _BLOCKACTIVATION . "</b></font></center>"; CloseTable(); echo "<br>"; OpenTable(); if (!empty($content)) { echo "<center>" . _BLOCKPREVIEW . " <i>{$title}</i><br><br>"; themesidebox($title, $content); } else { echo "<center><i>{$title}</i><br><br>"; } echo "<br>" . _WANT2ACTIVATE . "<br><br>" . "[ <a href=\"" . $admin_file . ".php?op=BlocksAdmin\">" . _NO . "</a> | <a href=\"" . $admin_file . ".php?op=ChangeStatus&bid={$bid}&ok=1\">" . _YES . "</a> ]" . "</center>"; CloseTable(); include "footer.php"; } }
function loginbox() { if (!is_user()) { $title = 'Login'; $boxstuff = '<form name="login" action="' . $GLOBALS['phpgw_info']['server']['webserver_url'] . '/login.php" method="post">'; $boxstuff .= '<input type="hidden" name="passwd_type" value="text">'; $boxstuff .= '<center><font class="content">Login Name<br>'; $boxstuff .= '<input type="text" name="login" size="8" value=""><br>'; $boxstuff .= 'Password<br>'; $boxstuff .= '<input name="passwd" size="8" type="password"><br>'; $boxstuff .= '<input type="submit" value="Login" name="submitit">'; $boxstuff .= '</font></center></form>'; $boxstuff .= "<center><font class=\"content\">Don't have an account? Maybe in a future version you can create one. :-)</font></center>"; themesidebox($title, $boxstuff); } }
} else { $rate = 0; $the_image = "</center><br>"; } $ratetitle = "" . _RATEARTICLE . ""; $ratecontent = "<center>" . _AVERAGESCORE . ": <b>{$rate}</b><br>" . _VOTES . ": <b>{$ratings}</b>{$the_image}"; $ratecontent .= "<form action=\"modules.php?name={$module_name}\" method=\"post\"><center>" . _RATETHISARTICLE . "</center><br>"; $ratecontent .= "<input type=\"hidden\" name=\"sid\" value=\"{$sid}\">"; $ratecontent .= "<input type=\"hidden\" name=\"op\" value=\"rate_article\">"; $ratecontent .= "<input type=\"radio\" name=\"score\" value=\"5\"> <img src=\"images/articles/stars-5.gif\" border=\"0\" alt=\"" . _EXCELLENT . "\" title=\"" . _EXCELLENT . "\"><br>"; $ratecontent .= "<input type=\"radio\" name=\"score\" value=\"4\"> <img src=\"images/articles/stars-4.gif\" border=\"0\" alt=\"" . _VERYGOOD . "\" title=\"" . _VERYGOOD . "\"><br>"; $ratecontent .= "<input type=\"radio\" name=\"score\" value=\"3\"> <img src=\"images/articles/stars-3.gif\" border=\"0\" alt=\"" . _GOOD . "\" title=\"" . _GOOD . "\"><br>"; $ratecontent .= "<input type=\"radio\" name=\"score\" value=\"2\"> <img src=\"images/articles/stars-2.gif\" border=\"0\" alt=\"" . _REGULAR . "\" title=\"" . _REGULAR . "\"><br>"; $ratecontent .= "<input type=\"radio\" name=\"score\" value=\"1\"> <img src=\"images/articles/stars-1.gif\" border=\"0\" alt=\"" . _BAD . "\" title=\"" . _BAD . "\"><br><br>"; $ratecontent .= "<center><input type=\"submit\" value=\"" . _CASTMYVOTE . "\"></center></form>"; themesidebox($ratetitle, $ratecontent); $optiontitle = "" . _OPTIONS . ""; $optionbox = "<br>"; $optionbox .= " <img src='images/print.gif' border='0' alt='" . _PRINTER . "' title='" . _PRINTER . "'> <a href=\"modules.php?name={$module_name}&file=print&sid={$sid}\">" . _PRINTER . "</a><br><br>"; $optionbox .= " <img src='images/friend.gif' border='0' alt='" . _FRIEND . "' title='" . _FRIEND . "'> <a href=\"modules.php?name={$module_name}&file=friend&op=FriendSend&sid={$sid}\">" . _FRIEND . "</a><br><br></center>\n"; if (is_admin($admin)) { $optionbox .= "<center><b>" . _ADMIN . "</b><br>[ <a href=\"admin.php?op=adminStory\">" . _ADD . "</a> | <a href=\"admin.php?op=EditStory&sid={$sid}\">" . _EDIT . "</a> | <a href=\"admin.php?op=RemoveStory&sid={$sid}\">" . _DELETE . "</a> ]<br><br></center>"; } themesidebox($optiontitle, $optionbox); echo "</td></tr></table>\n"; cookiedecode($user); include "modules/{$module_name}/associates.php"; if ($mode != "nocomments" or $acomm == 0 or $articlecomm == 1) { include "modules/News/comments.php"; } include "footer.php";
/** * Display a block based on the current theme * */ function themesideblock($row) { if (!isset($row['bid'])) { $row['bid'] = ''; } if (!isset($row['title'])) { $row['title'] = ''; } // check for collapsable menus being enabled, and setup the collapsable menu image. if (file_exists('themes/' . pnVarPrepForOS(pnUserGetTheme()) . '/images/upb.gif')) { $upb = '<img src="themes/' . pnVarPrepForOS(pnUserGetTheme()) . '/images/upb.gif" alt="" />'; } else { $upb = '<img src="images/global/upb.gif" alt="" />'; } if (file_exists('themes/' . pnVarPrepForOS(pnUserGetTheme()) . '/images/downb.gif')) { $downb = '<img src="themes/' . pnVarPrepForOS(pnUserGetTheme()) . '/images/downb.gif" alt="" />'; } else { $downb = '<img src="images/global/downb.gif" alt="" />'; } if (pnUserLoggedIn() && pnModGetVar('Blocks', 'collapseable') == 1 && isset($row['collapsable']) && $row['collapsable'] == '1') { if (pnCheckUserBlock($row) == '1') { if (!empty($row['title'])) { $row['minbox'] = '<a href="' . pnVarPrepForDisplay(pnModURL('Blocks', 'user', 'changestatus', array('bid' => $row['bid'], 'authid' => pnSecGenAuthKey()))) . '">' . $upb . '</a>'; } } else { $row['content'] = ''; if (!empty($row['title'])) { $row['minbox'] = '<a href="' . pnVarPrepForDisplay(pnModURL('Blocks', 'user', 'changestatus', array('bid' => $row['bid'], 'authid' => pnSecGenAuthKey()))) . '">' . $downb . '</a>'; } } } else { $row['minbox'] = ''; } // end collapseable menu config return themesidebox($row); }
function pollMain($pollID) { global $boxTitle, $boxContent, $pollcomm, $user, $cookie, $prefix, $module_name, $db, $userinfo; $pollID = intval($pollID); if (!isset($pollID)) { $pollID = 1; } $boxContent .= "<form action=\"modules.php?name={$module_name}\" method=\"post\">"; $boxContent .= "<input type=\"hidden\" name=\"pollID\" value=\"" . $pollID . "\">"; $result_a = $db->sql_query("SELECT pollTitle, voters FROM " . $prefix . "_poll_desc WHERE pollID='{$pollID}'"); list($pollTitle, $voters) = $result_a->fetch_row(); $boxTitle = _SURVEY; $boxContent .= "<font class=\"content\"><b>{$pollTitle}</b></font><br><br>\n"; $boxContent .= "<table border=\"0\" width=\"100%\">"; for ($i = 1; $i <= 12; $i++) { $result = $db->sql_query("SELECT pollID, optionText, optionCount, voteID FROM " . $prefix . "_poll_data WHERE pollID='{$pollID}' AND voteID='{$i}'"); $row = $db->sql_fetchrow($result); $optionText = $row['optionText']; if (!empty($optionText)) { $boxContent .= "<tr><td valign=\"top\"><input type=\"radio\" name=\"voteID\" value=\"" . $i . "\"></td><td width=\"100%\"><font class=\"content\">{$optionText}</font></td></tr>\n"; } } $boxContent .= "</table><br><center><font class=\"content\"><input type=\"submit\" value=\"" . _VOTE . "\"></font><br>"; if (is_user($user)) { cookiedecode($user); getusrinfo($user); } $sum = 0; for ($i = 0; $i < 12; $i++) { $result2 = $db->sql_query("SELECT optionCount FROM " . $prefix . "_poll_data WHERE pollID='{$pollID}' AND voteID='{$i}'"); $row2 = $db->sql_fetchrow($result2); $optionCount = $row2['optionCount']; $sum = (int) $sum + $optionCount; } $boxContent .= "<br><font class=\"content\"><a href=\"modules.php?name={$module_name}&op=results&pollID={$pollID}&mode=" . $userinfo['umode'] . "&order=" . $userinfo['uoder'] . "&thold=" . $userinfo['thold'] . "\"><b>" . _RESULTS . "</b></a><br><a href=\"modules.php?name={$module_name}\"><b>" . _POLLS . "</b></a><br>"; if ($pollcomm) { list($numcom) = $db->sql_query("select count(*) from " . $prefix . "_pollcomments where pollID='{$pollID}'")->fetch_row(); $boxContent .= "<br>" . _VOTES . ": <b>{$sum}</b> <br> " . _PCOMMENTS . " <b>{$numcom}</b>\n\n"; } else { $boxContent .= "<br>" . _VOTES . " <b>{$sum}</b>\n\n"; } $boxContent .= "</font></center></form>\n\n"; themesidebox($boxTitle, $boxContent); }
function RecentForumPosts($title, $maxforums, $maxtopics, $displayposter = false, $topicmaxchars = 15, $hr = false, $decoration = "") { $boxstuff = RecentForumPosts_fab($title, $maxforums, $maxtopics, $displayposter, $topicmaxchars, $hr); global $block_title; if ($title == '') { if ($block_title == '') { $title = translate("Forums infos"); } else { $title = $block_title; } } themesidebox($title, $boxstuff); }
function themesideblock($row) { global $postnuke_theme, $pntheme; if (!isset($row['bid'])) { $row['bid'] = ''; } if (!isset($row['title'])) { $row['title'] = ''; } // check for collapseable menus being enabled. if (pnModGetVar('Blocks', 'collapseable') == 1) { if (pnUserLoggedIn()) { if (checkuserblock($row) == '1') { if (!empty($row['title'])) { $row['title'] .= " <a href=\"modules.php?op=modload&name=Blocks&file=index&req=ChangeStatus&bid={$row['bid']}&authid=" . pnSecGenAuthKey() . "\"><img src=\"images/global/upb.gif\" border=\"0\" alt=\"\"></a>"; } } else { $row['content'] = ''; if (!empty($row['title'])) { $row['title'] .= " <a href=\"modules.php?op=modload&name=Blocks&file=index&req=ChangeStatus&bid={$row['bid']}&authid=" . pnSecGenAuthKey() . "\"><img src=\"images/global/downb.gif\" border=\"0\" alt=\"\"></a>"; } } } } // end collapseable menu config if ($postnuke_theme || $pntheme['support_blocks2']) { return themesidebox($row); } else { return themesidebox($row['title'], $row['content']); } }
function selectlanguage() { global $useflags, $currentlang; if ($useflags == 1) { $title = _SELECTLANGUAGE; $content = "<center><font class=\"content\">" . _SELECTGUILANG . "<br><br>"; $langdir = dir("language"); while ($func = $langdir->read()) { if (substr($func, 0, 5) == "lang-") { $menulist .= "{$func} "; } } closedir($langdir->handle); $menulist = explode(" ", $menulist); sort($menulist); for ($i = 0; $i < sizeof($menulist); $i++) { if ($menulist[$i] != "") { $tl = ereg_replace("lang-", "", $menulist[$i]); $tl = ereg_replace(".php", "", $tl); $altlang = ucfirst($tl); $content .= "<a href=\"index.php?newlang={$tl}\"><img src=\"images/language/flag-{$tl}.png\" border=\"0\" alt=\"{$altlang}\" title=\"{$altlang}\" hspace=\"3\" vspace=\"3\"></a> "; } } $content .= "</font></center>"; themesidebox($title, $content); } else { $title = _SELECTLANGUAGE; $content = "<center><font class=\"content\">" . _SELECTGUILANG . "<br><br></font>"; $content .= "<form action=\"index.php\" method=\"get\"><select name=\"newlanguage\" onChange=\"top.location.href=this.options[this.selectedIndex].value\">"; $handle = opendir('language'); while ($file = readdir($handle)) { if (preg_match("/^lang\\-(.+)\\.php/", $file, $matches)) { $langFound = $matches[1]; $languageslist .= "{$langFound} "; } } closedir($handle); $languageslist = explode(" ", $languageslist); sort($languageslist); for ($i = 0; $i < sizeof($languageslist); $i++) { if ($languageslist[$i] != "") { $content .= "<option value=\"index.php?newlang={$languageslist[$i]}\" "; if ($languageslist[$i] == $currentlang) { $content .= " selected"; } $content .= ">" . ucfirst($languageslist[$i]) . "</option>\n"; } } $content .= "</select></form></center>"; themesidebox($title, $content); } }
function pollMain($pollID) { global $boxTitle, $boxContent, $pollcomm, $user, $cookie, $prefix, $dbi, $module_name, $db; $pollID = intval($pollID); if (!isset($pollID)) { $pollID = 1; } if (!isset($url)) { $url = sprintf("modules.php?name={$module_name}&op=results&pollID=%d", $pollID); } $boxContent .= "<form action=\"modules.php?name={$module_name}\" method=\"post\">"; $boxContent .= "<input type=\"hidden\" name=\"pollID\" value=\"" . $pollID . "\">"; $boxContent .= "<input type=\"hidden\" name=\"forwarder\" value=\"" . $url . "\">"; $result_a = $db->sql_query("SELECT pollTitle, voters FROM " . $prefix . "_poll_desc WHERE pollID='{$pollID}'"); list($pollTitle, $voters) = $db->sql_fetchrow($result_a); $boxTitle = _SURVEY; $boxContent .= "<font class=\"content\"><b>{$pollTitle}</b></font><br><br>\n"; $boxContent .= "<table border=\"0\" width=\"100%\">"; for ($i = 1; $i <= 12; $i++) { $result = sql_query("SELECT pollID, optionText, optionCount, voteID FROM " . $prefix . "_poll_data WHERE pollID='{$pollID}' AND voteID='{$i}'", $dbi); $object = sql_fetch_object($result, $dbi); if (is_object($object)) { $optionText = $object->optionText; if ($optionText != "") { $boxContent .= "<tr><td valign=\"top\"><input type=\"radio\" name=\"voteID\" value=\"" . $i . "\"></td><td width=\"100%\"><font class=\"content\">{$optionText}</font></td></tr>\n"; } } } $boxContent .= "</table><br><center><font class=\"content\"><input type=\"submit\" value=\"" . _VOTE . "\"></font><br>"; if (is_user($user)) { cookiedecode($user); } for ($i = 0; $i < 12; $i++) { $result2 = sql_query("SELECT optionCount FROM " . $prefix . "_poll_data WHERE pollID='{$pollID}' AND voteID='{$i}'", $dbi); $object = sql_fetch_object($result2, $dbi); $optionCount = $object->optionCount; $sum = (int) $sum + $optionCount; } $boxContent .= "<br><font class=\"content\"><a href=\"modules.php?name={$module_name}&op=results&pollID={$pollID}&mode={$cookie['4']}&order={$cookie['5']}&thold={$cookie['6']}\"><b>" . _RESULTS . "</b></a><br><a href=\"modules.php?name={$module_name}\"><b>" . _POLLS . "</b></a><br>"; if ($pollcomm) { list($numcom) = $db->sql_fetchrow($db->sql_query("select count(*) from " . $prefix . "_pollcomments where pollID='{$pollID}'")); $boxContent .= "<br>" . _VOTES . ": <b>{$sum}</b> <br> " . _PCOMMENTS . " <b>{$numcom}</b>\n\n"; } else { $boxContent .= "<br>" . _VOTES . " <b>{$sum}</b>\n\n"; } $boxContent .= "</font></center></form>\n\n"; themesidebox($boxTitle, $boxContent); }
function member_block() { global $db, $module_prefix; if (isset($_GET['id'])) { $page_id = intval($_GET['id']); $page = $db->sql_ufetchrow("SELECT id, parent_id, title FROM " . $module_prefix . "_pages WHERE id={$page_id}"); $sub = list_all($page['id'], false); if (count($sub) > 0) { $page['sub'] = $sub; } unset($sub); $pages = list_all($page['parent_id'], false); for ($i = 0; $i < count($pages); $i++) { if ($pages[$i]['id'] == $page_id) { $pages[$i] = $page; } } $pages = go_up($page_id, $parents); } themesidebox('Wiki Content', $content, 10000); }
function marquetapage() { global $cookie; if ($cookie[0] != "") { global $REQUEST_URI, $title, $post, $NPDS_Prefix; if ($ibid = theme_image("modules/add.gif")) { $add = $ibid; } else { $add = "modules/marquetapage/add.gif"; } if ($ibid = theme_image("modules/addj.gif")) { $addj = $ibid; } else { $addj = "modules/marquetapage/addj.gif"; } $result = sql_query("select uri, topic from " . $NPDS_Prefix . "marquetapage where uid='{$cookie['0']}' order by topic ASC"); if (sql_num_rows($result)) { $tmp_toggle = '<span id="show_fav" title="' . translate("Show list") . '"><img src="images/admin/ws/toggle_plus.gif" style="vertical-align:middle;" alt="' . translate("Show list") . '" /></span>'; $content = "<script type=\"text/javascript\" src=\"lib/yui/build/yui/yui-min.js\"></script>"; $content .= "<script type=\"text/javascript\">\n //<![CDATA[\n tog =function(lst,sho,hid){\n YUI().use('transition', 'node-event-delegate', function (Y) {\n Y.delegate('click', function(e) {\n var buttonID = e.currentTarget.get('id'),\n lst_id = Y.one('#'+lst);\n btn_show=Y.one('#'+sho);\n btn_hide=Y.one('#'+hid);\n if (buttonID === sho) {\n lst_id.show(true);\n btn_show.set('id',hid);\n btn_show.set('title','" . translate("Hide list") . "');\n btn_show.setContent('<img src=\"images/admin/ws/toggle_minus.gif\" style=\"vertical-align:middle;\" alt=\"" . translate("Hide list") . "\" />');\n } else if (buttonID == hid) {\n lst_id.transition({\n duration: 0.2,\n easing: 'ease-out',\n opacity: 0\n });\n btn_hide=Y.one('#'+hid);\n lst_id.hide(true);\n btn_hide.set('id',sho);\n btn_hide.set('title','" . translate("Show list") . "');\n btn_hide.setContent('<img src=\"images/admin/ws/toggle_plus.gif\" style=\"vertical-align:middle;\" alt=\"" . translate("Show list") . "\" />');\n }\n }, document, 'span');\n });\n }\n //]]>\n </script>"; $content .= "\n<table width=\"100%\" id=\"lst_fav\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\" style=\"display:none;\" >\n<thead>\n<tr>\n<th><img src=\"{$addj}\" border=\"0\" style=\"vertical-align:middle\" alt=\"" . translate("Add") . " " . translate("favourite") . "\" title=\"" . translate("Add") . " " . translate("favourite") . "\" /> Bookmarks [" . sql_num_rows($result) . "]</th><th align=\"right\"><a href=\"modules.php?ModPath=marquetapage&ModStart=marquetapage&op=supp_all&uri=" . $_SERVER['PHP_SELF'] . "\"><img src=\"modules/marquetapage/del.gif\" border=\"0\" alt=\"" . translate("Delete") . "\" title=\"" . translate("Delete") . "\" style=\"vertical-align: middle;\" /></a></th>\n</tr>\n</thead>\n<tbody>"; while (list($uri, $topic) = sql_fetch_row($result)) { $content .= "\n<tr>\n<td align=\"left\" width=\"95%\"><a href=\"{$uri}\" style=\"font-size: 10px;\">" . $topic . "</a></td>\n"; $content .= "<td align=\"right\"><a href=\"modules.php?ModPath=marquetapage&ModStart=marquetapage&op=supp&uri=" . urlencode($uri) . "\"><img src=\"modules/marquetapage/del.gif\" border=\"0\" alt=\"" . translate("Delete") . "\" title=\"" . translate("Delete") . "\" style=\"vertical-align: middle;\" /></a></td>\n</tr>\n"; } $content .= "</tbody>\n</table>\n"; $content .= "\n<script type=\"text/javascript\">\n //<![CDATA[\n tog('lst_fav','show_fav','hide_fav');\n //]]>\n </script>\n"; } global $block_title; $uri = urlencode($REQUEST_URI); if ($post) { $title .= "/" . $post; } if ($title == "") { $title_MTP = basename(urldecode($uri)); } else { $title_MTP = $title; } $boxTitle = "<span><a href=\"modules.php?ModPath=marquetapage&ModStart=marquetapage&op=add&uri={$uri}&topic=" . urlencode($title_MTP) . "\"><img src=\"{$add}\" name=\"image\" onmouseover=\"image.src='{$addj}';\" onmouseout=\"image.src='{$add}';\" border=\"0\" style=\"vertical-align:middle\" alt=\"" . translate("Add") . " " . translate("favourite") . "\" title=\"" . translate("Add") . " " . translate("favourite") . "\" /></a></span>"; if ($block_title == "") { $boxTitle .= " MarqueTaPage " . $tmp_toggle; } else { $boxTitle .= " " . $block_title . " " . $tmp_toggle; } themesidebox($boxTitle, $content); } }
function make_sidebar($side) { global $xoopsUser; $xoopsblock = new XoopsBlock(); if ($side == "left") { $side = XOOPS_SIDEBLOCK_LEFT; } elseif ($side == "right") { $side = XOOPS_SIDEBLOCK_RIGHT; } else { $side = XOOPS_SIDEBLOCK_BOTH; } if (is_object($xoopsUser)) { $block_arr = $xoopsblock->getAllBlocksByGroup($xoopsUser->getGroups(), true, $side, XOOPS_BLOCK_VISIBLE); } else { $block_arr = $xoopsblock->getAllBlocksByGroup(XOOPS_GROUP_ANONYMOUS, true, $side, XOOPS_BLOCK_VISIBLE); } $block_count = count($block_arr); if (!isset($GLOBALS['xoopsTpl']) || !is_object($GLOBALS['xoopsTpl'])) { include_once XOOPS_ROOT_PATH . '/class/template.php'; $xoopsTpl = new XoopsTpl(); } else { $xoopsTpl =& $GLOBALS['xoopsTpl']; } $xoopsLogger =& XoopsLogger::instance(); for ($i = 0; $i < $block_count; $i++) { $bcachetime = intval($block_arr[$i]->getVar('bcachetime')); if (empty($bcachetime)) { $xoopsTpl->xoops_setCaching(0); } else { $xoopsTpl->xoops_setCaching(2); $xoopsTpl->xoops_setCacheTime($bcachetime); } $btpl = $block_arr[$i]->getVar('template'); if ($btpl != '') { if (empty($bcachetime) || !$xoopsTpl->is_cached('db:' . $btpl)) { $xoopsLogger->addBlock($block_arr[$i]->getVar('name')); $bresult =& $block_arr[$i]->buildBlock(); if (!$bresult) { continue; } $xoopsTpl->assign_by_ref('block', $bresult); $bcontent =& $xoopsTpl->fetch('db:' . $btpl); $xoopsTpl->clear_assign('block'); } else { $xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true, $bcachetime); $bcontent =& $xoopsTpl->fetch('db:' . $btpl); } } else { $bid = $block_arr[$i]->getVar('bid'); if (empty($bcachetime) || !$xoopsTpl->is_cached('db:system_dummy.html', 'blk_' . $bid)) { $xoopsLogger->addBlock($block_arr[$i]->getVar('name')); $bresult =& $block_arr[$i]->buildBlock(); if (!$bresult) { continue; } $xoopsTpl->assign_by_ref('dummy_content', $bresult['content']); $bcontent =& $xoopsTpl->fetch('db:system_dummy.html', 'blk_' . $bid); $xoopsTpl->clear_assign('block'); } else { $xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true, $bcachetime); $bcontent =& $xoopsTpl->fetch('db:system_dummy.html', 'blk_' . $bid); } } switch ($block_arr[$i]->getVar('side')) { case XOOPS_SIDEBLOCK_LEFT: themesidebox($block_arr[$i]->getVar('title'), $bcontent); break; case XOOPS_SIDEBLOCK_RIGHT: if (function_exists("themesidebox_right")) { themesidebox_right($block_arr[$i]->getVar('title'), $bcontent); } else { themesidebox($block_arr[$i]->getVar('title'), $bcontent); } break; } unset($bcontent); } }
function bloc_espace_groupe($gr, $i_gr) { global $NPDS_Prefix, $block_title; if ($block_title == '') { $rsql = sql_fetch_assoc(sql_query("SELECT groupe_name FROM " . $NPDS_Prefix . "groupes WHERE groupe_id='{$gr}'")); $title = $rsql['groupe_name']; } else { $title = $block_title; } themesidebox($title, fab_espace_groupe($gr, "0", $i_gr)); }
function headlines($bid, $cenbox = 0) { global $prefix, $db; $bid = intval($bid); $result = $db->sql_query("SELECT title, content, url, refresh, time FROM " . $prefix . "_blocks WHERE bid='{$bid}'"); $row = $db->sql_fetchrow($result); $title = filter($row['title'], "nohtml"); $content = filter($row['content']); $url = filter($row['url'], "nohtml"); $refresh = intval($row['refresh']); $otime = $row['time']; $past = time() - $refresh; $cont = 0; if ($otime < $past) { $btime = time(); $rdf = parse_url($url); $fp = fsockopen($rdf['host'], 80, $errno, $errstr, 15); if (!$fp) { $content = ""; $db->sql_query("UPDATE " . $prefix . "_blocks SET content='{$content}', time='{$btime}' WHERE bid='{$bid}'"); $cont = 0; if ($cenbox == 0) { themesidebox($title, $content); } else { themecenterbox($title, $content); } return; } if ($fp) { if (!empty($rdf['query'])) { $rdf['query'] = "?" . $rdf['query']; } fputs($fp, "GET " . $rdf['path'] . $rdf['query'] . " HTTP/1.0\r\n"); fputs($fp, "HOST: " . $rdf['host'] . "\r\n\r\n"); $string = ""; while (!feof($fp)) { $pagetext = fgets($fp, 300); $string .= chop($pagetext); } fputs($fp, "Connection: close\r\n\r\n"); fclose($fp); $items = explode("</item>", $string); $content = "<font class=\"content\">"; for ($i = 0; $i < 10; $i++) { $link = ereg_replace(".*<link>", "", $items[$i]); $link = ereg_replace("</link>.*", "", $link); $title2 = ereg_replace(".*<title>", "", $items[$i]); $title2 = ereg_replace("</title>.*", "", $title2); $title2 = stripslashes($title2); if (empty($items[$i]) and $cont != 1) { $content = ""; $db->sql_query("UPDATE " . $prefix . "_blocks SET content='{$content}', time='{$btime}' WHERE bid='{$bid}'"); $cont = 0; if ($cenbox == 0) { themesidebox($title, $content); } else { themecenterbox($title, $content); } return; } else { if (strcmp($link, $title2) and !empty($items[$i])) { $cont = 1; $content .= "<strong><big>·</big></strong><a href=\"{$link}\" target=\"new\">{$title2}</a><br>\n"; } } } } $db->sql_query("UPDATE " . $prefix . "_blocks SET content='{$content}', time='{$btime}' WHERE bid='{$bid}'"); } $siteurl = str_replace("http://", "", $url); $siteurl = explode("/", $siteurl); if ($cont == 1 or !empty($content)) { $content .= "<br><a href=\"http://{$siteurl['0']}\" target=\"blank\"><b>" . _HREADMORE . "</b></a></font>"; } elseif ($cont == 0 or empty($content)) { $content = "<font class=\"content\">" . _RSSPROBLEM . "</font>"; } if ($cenbox == 0) { themesidebox($title, $content); } else { themecenterbox($title, $content); } }
function atBlockLoad($location = "", $title = "") { if (!defined('BLOCK_FILE')) { define('BLOCK_FILE', true); } $runningconfig = atGetRunningConfig(); $blocklist = $runningconfig['blocklist']; if ($location) { foreach ($blocklist as $block) { if ($block['position'] == $location && $block['active'] == 1) { $blocks[] = $block; } } } elseif ($title) { if ($blocklist[$title]['active'] == 1) { $blocks[] = $blocklist[$title]; } } if (is_array($blocks)) { foreach ($blocks as $theblock) { atRunningSetVar("block", $theblock); extract($theblock); if ($bkey == "admin") { adminblock(); } elseif ($bkey == "userbox") { userblock(); } elseif ($bkey == "") { $displaythis = 0; if ($view == 0) { $displaythis = 1; } elseif ($view == 1 && atIsLoggedIn() || atIsAdminUser()) { $displaythis = 1; } elseif ($view == 2 && atIsAdminUser()) { $displaythis = 1; } elseif ($view == 3 && !atIsLoggedIn() || atIsAdminUser()) { $displaythis = 1; } if ($displaythis) { if ($url == "") { if ($blockfile == "") { themesidebox($title, $content); } else { blockfileinc($title, $blockfile); } } else { headlines($bid); } } } } } }
} } } //$boxContent .= "</table><br><center><font class=\"content\"><input type=\"submit\" value=\""._VOTE."\"></font><br>"; if (is_user($user)) { cookiedecode($user); } for ($i = 0; $i < 12; $i++) { $row5 = $db->sql_fetchrow($db->sql_query("SELECT optionCount FROM " . $prefix . "_poll_data WHERE (pollID='{$pollID}') AND (voteID='{$i}')")); $optionCount = $row5['optionCount']; $sum = (int) $sum + $optionCount; } $boxContent .= "<font class=\"content\">[ <a href=\"modules.php?name=Surveys&op=results&pollID={$pollID}&mode=" . $userinfo['umode'] . "&order=" . $userinfo['uorder'] . "&thold=" . $userinfo['thold'] . "\"><b>" . _RESULTS . "</b></a> | <a href=\"modules.php?name=Surveys\"><b>" . _POLLS . "</b></a> ]<br>"; if ($pollcomm) { $result6 = $db->sql_query("select * from " . $prefix . "_pollcomments where pollID='{$pollID}'"); $numcom = $db->sql_numrows($result6); $boxContent .= "<br>" . _VOTES . ": <b>{$sum}</b><br>" . _PCOMMENTS . " <b>{$numcom}</b>\n\n"; } else { $boxContent .= "<br>" . _VOTES . " <b>{$sum}</b>\n\n"; } $boxContent .= "</font></center></form>\n\n"; themesidebox($boxTitle, $boxContent); } /* old modules */ //echo "</td></tr></table>\n"; cookiedecode($user); include "modules/{$module_name}/associates.php"; if (empty($mode) or $mode != "nocomments" or $acomm == 0 or $articlecomm == 1) { include "modules/News/comments.php"; } include "footer.php";