本文整理汇总了PHP中can_admin函数的典型用法代码示例。如果您正苦于以下问题:PHP can_admin函数的具体用法?PHP can_admin怎么用?PHP can_admin使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了can_admin函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: themeheader
function themeheader()
{
global $slogan, $sitename, $banners, $mainindex, $adminindex, $cpgtpl, $db, $prefix, $site_logo, $MAIN_CFG, $CPG_SESS, $Blocks;
if ($MAIN_CFG['global']['admingraphic'] & 4) {
include 'includes/cssmainmenu.php';
}
$imgr = $imgl = '';
// left blocks ?
if ($Blocks->l && $Blocks->showblocks & 1) {
$img = $Blocks->hideblock('600') ? 'plus.gif' : 'minus.gif';
$imgl = '<img alt="' . _TOGGLE . '" title="' . _TOGGLE . '" id="pic600" src="themes/' . $CPG_SESS['theme'] . '/images/' . $img . '" onclick="blockswitch(\'600\');" style="cursor:pointer; float:left; padding-top:3px;" />';
}
// right blocks ?
if ($Blocks->r && $Blocks->showblocks & 2) {
$img = $Blocks->hideblock('601') ? 'plus.gif' : 'minus.gif';
$imgr = '<img alt="' . _TOGGLE . '" title="' . _TOGGLE . '" id="pic601" src="themes/' . $CPG_SESS['theme'] . '/images/' . $img . '" onclick="blockswitch(\'601\');" style="cursor:pointer; float:right; padding-top:3px;" />';
}
$result = $db->sql_uquery("SELECT topicid, topictext FROM " . $prefix . "_topics ORDER BY topictext");
while ($row = $db->sql_fetchrow($result, SQL_NUM)) {
$toplist[$row[0]] = $row[1];
}
$user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
$css_ie = ereg('MSIE 7.0', $user_agent) ? 'ie7' : (ereg('MSIE ([0-6].[0-9]{1,2})', $user_agent) ? 'ie6' : (isset($_SESSION['SECURITY']['UA']) && $_SESSION['SECURITY']['UA'] == 'Safari' ? 'safari' : (isset($_SESSION['SECURITY']['UA']) && $_SESSION['SECURITY']['UA'] == 'Opera' ? 'opera' : '')));
$cpgtpl->assign_vars(array('CSS_IE' => $css_ie ? '<link rel="stylesheet" type="text/css" href="themes/' . $CPG_SESS['theme'] . '/style/' . $css_ie . '.css" />' : '', 'PUBLIC_HEADER' => !defined('ADMIN_PAGES'), 'B_L_VISIBLE' => $Blocks->hideblock('600') ? 'style="display: none"' : '', 'BLOG_ENABLED' => is_active('Blogs'), 'G_LEFTIMAGE' => $imgl, 'G_RIGHTIMAGE' => $imgr, 'S_TOGGLE' => _TOGGLE, 'S_SEARCH' => _SEARCH, 'S_IS_ADMIN' => is_admin(), 'S_CAN_ADMIN' => can_admin(), 'S_IS_USER' => is_user(), 'S_LOGO' => $site_logo, 'S_SITENAME' => $sitename, 'S_WELCOME' => _WELCOMETO, 'S_HOME' => _HOME, 'S_BLOG' => _BlogsLANG, 'S_DOWNLOADS' => _DownloadsLANG, 'S_GALLERY' => _coppermineLANG, 'S_FORUMS' => _ForumsLANG, 'S_MY_ACCOUNT' => _Your_AccountLANG, 'S_NEWS' => _NewsLANG, 'S_ADMIN' => _ADMINISTRATION, 'S_BANNER' => $banners ? viewbanner() : '', 'U_MAININDEX' => $mainindex, 'U_NEWS' => getlink('News'), 'U_SEARCH' => getlink('Search'), 'U_DOWNLOADS' => getlink('Downloads'), 'U_FORUMS' => getlink('Forums'), 'U_GALLERY' => getlink('coppermine'), 'U_BLOG' => getlink('Blogs'), 'U_MY_ACCOUNT' => getlink('Your_Account'), 'U_ADMININDEX' => $adminindex, 'S_MAIN_MENU' => isset($mmcontent) ? $mmcontent : false));
$Blocks->display('l');
}
示例2: message_box
function message_box()
{
global $prefix, $MAIN_CFG, $currentlang, $db, $userinfo;
require_once CORE_PATH . 'nbbcode.php';
$query = $MAIN_CFG['global']['multilingual'] ? "AND (mlanguage='{$currentlang}' OR mlanguage='')" : '';
if (!is_admin()) {
if (is_user()) {
$query .= ' AND view!=2 AND view!=3';
} else {
$query .= ' AND (view=0 OR view=3)';
}
}
$result = $db->sql_query('SELECT mid, title, content, date, expire, view FROM ' . $prefix . "_message WHERE active='1' {$query} ORDER BY date DESC");
while (list($mid, $title, $content, $date, $expire, $view) = $db->sql_fetchrow($result)) {
$content = decode_bb_all($content, 1, true);
if (!empty($title) && !empty($content)) {
$output = '';
if ($view == 0) {
$output = _MVIEWALL;
} elseif ($view == 1) {
$output = _MVIEWUSERS;
} elseif ($view == 2) {
$output = _MVIEWADMIN;
} elseif ($view == 3) {
$output = _MVIEWANON;
} elseif ($view > 3 && (in_group($view - 3) || is_admin())) {
// <= phpBB User Groups Integration
$view = $view - 3;
if (!in_group($view)) {
list($output) = $db->sql_ufetchrow("SELECT group_name FROM " . $prefix . "_bbgroups WHERE group_id='{$view}'", SQL_NUM);
} else {
$output = in_group($view);
}
}
if ($output != '') {
$remain = '';
if (can_admin()) {
if ($expire == 0) {
$remain = _UNLIMITED;
} else {
$etime = ($date + $expire - time()) / 3600;
$etime = intval($etime);
$remain = $etime < 1 ? _EXPIRELESSHOUR : _EXPIREIN . " {$etime} " . _HOURS;
}
}
global $cpgtpl;
$cpgtpl->assign_block_vars('messageblock', array('S_TITLE' => $title, 'S_CONTENT' => $content, 'S_OUTPUT' => $output, 'S_DATE' => _POSTEDON . ' ' . formatDateTime($date, _DATESTRING2), 'S_REMAIN' => $remain, 'S_EDIT' => _EDIT, 'U_EDITMSG' => URL::admin('messages&edit=' . $mid)));
}
if ($expire != 0) {
if ($date + $expire < time()) {
$db->sql_query("UPDATE " . $prefix . "_message SET active='0' WHERE mid='{$mid}'");
}
}
}
}
$db->sql_freeresult($result);
}
示例3: session_pagestart
function session_pagestart()
{
global $userinfo, $module_name;
if (can_admin($module_name)) {
$userinfo['user_level'] = ADMIN;
}
$userdata =& $userinfo;
return $userdata;
}
示例4: viewdownloadcomments
function viewdownloadcomments()
{
global $downloadsprefix, $db, $bgcolor2, $module_name;
$lid = intval($_GET['lid']);
include "header.php";
downl_menu_tpl(1);
echo '<br />';
$result = $db->sql_query("SELECT ratinguser, rating, ratingcomments, ratingtimestamp FROM " . $downloadsprefix . "_votedata WHERE ratinglid = {$lid} AND ratingcomments != '' ORDER BY ratingtimestamp DESC");
$totalcomments = $db->sql_numrows($result);
$transfertitle = ereg_replace("_", " ", $ttitle);
$displaytitle = $transfertitle;
OpenTable();
echo "<center><font class=\"option\"><b>" . _DOWNLOADPROFILE . ": {$displaytitle}</b></font><br /><br />";
downl_infomenu_tpl($lid, $ttitle);
echo "<br /><br /><br />" . _TOTALOF . " {$totalcomments} " . _COMMENTS . "</font></center><br />" . "<table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"450\">";
$x = 0;
while (list($ratinguser, $rating, $ratingcomments, $ratingtimestamp) = $db->sql_fetchrow($result)) {
ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $ratingtimestamp, $ratingtime);
$ratingtime = strftime("%F", mktime($ratingtime[4], $ratingtime[5], $ratingtime[6], $ratingtime[2], $ratingtime[3], $ratingtime[1]));
$date_array = explode("-", $ratingtime);
$timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]);
$formatted_date = date("F j, Y", $timestamp);
/* Individual user information */
$result2 = $db->sql_query("SELECT rating FROM " . $downloadsprefix . "_votedata WHERE ratinguser = '{$ratinguser}'");
$usertotalcomments = $db->sql_numrows($result2);
$useravgrating = 0;
while (list($rating2) = $db->sql_fetchrow($result2)) {
$useravgrating = $useravgrating + $rating2;
}
$useravgrating = $useravgrating / $usertotalcomments;
$useravgrating = number_format($useravgrating, 1);
echo "<tr><td bgcolor=\"{$bgcolor2}\">" . "<font class=\"content\"><b> " . _USER . ": </b><a href=\"{$nukeurl}/" . getlink("Your_Account&op=userinfo&username={$ratinguser}") . "\">{$ratinguser}</a></font></td>" . "<td bgcolor=\"{$bgcolor2}\"><font class=\"content\"><b>" . _RATING . ": </b>{$rating}</font></td>" . "<td bgcolor=\"{$bgcolor2}\" align=\"right\"><font class=\"content\">{$formatted_date}</font></td>" . "</tr><tr>" . "<td valign=\"top\"><font class=\"tiny\">" . _USERAVGRATING . ": {$useravgrating}</font></td>" . "<td valign=\"top\" colspan=\"2\"><font class=\"tiny\">" . _NUMRATINGS . ": {$usertotalcomments}</font></td>" . "</tr><tr>" . "<td colspan=\"3\">" . "<font class=\"content\">";
if (can_admin('downloads')) {
echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/editicon.gif\" border=\"0\" alt=\"" . _EDITTHISDOWNLOAD . "\"></a>";
}
echo " {$ratingcomments}</font><br /><br /><br /></td></tr>";
$x++;
}
echo "</table><br /><br /><center>";
downloadfooter($lid);
echo "</center>";
CloseTable();
include "footer.php";
}
示例5: substr
if ($story['ratings'] > 0) {
$rate = substr($story['score'] / $story['ratings'], 0, 4);
$r_image = round($rate);
$the_image = '<br /><br /><img src="' . (file_exists('themes/' . $CPG_SESS['theme'] . '/images/news/stars-' . $r_image . '.gif') ? 'themes/' . $CPG_SESS['theme'] . '/images/news/stars-' . $r_image . '.gif' : 'images/news/stars-' . $r_image . '.gif') . '" alt="" /><br />';
} else {
$rate = 0;
$the_image = '<br />';
}
$content = "<div style=\"text-align:center;\">" . _AVERAGESCORE . ": <b>{$rate}</b><br />" . _VOTES . ": <b>{$story['ratings']}</b>{$the_image}" . _RATETHISARTICLE . "</div><br />";
$content .= '<form action="' . URL::index() . '" method="post"><div>';
$content .= '<input type="hidden" name="sid" value="' . $sid . '" />';
$content .= '<input type="radio" name="score" value="5" /> <img src="' . (file_exists('themes/' . $CPG_SESS['theme'] . '/images/news/stars-5.gif') ? 'themes/' . $CPG_SESS['theme'] . '/images/news/stars-5.gif' : 'images/news/stars-5.gif') . '" alt="' . _EXCELLENT . '" title="' . _EXCELLENT . '" /><br />';
$content .= '<input type="radio" name="score" value="4" /> <img src="' . (file_exists('themes/' . $CPG_SESS['theme'] . '/images/news/stars-4.gif') ? 'themes/' . $CPG_SESS['theme'] . '/images/news/stars-4.gif' : 'images/news/stars-4.gif') . '" alt="' . _VERYGOOD . '" title="' . _VERYGOOD . '" /><br />';
$content .= '<input type="radio" name="score" value="3" /> <img src="' . (file_exists('themes/' . $CPG_SESS['theme'] . '/images/news/stars-3.gif') ? 'themes/' . $CPG_SESS['theme'] . '/images/news/stars-3.gif' : 'images/news/stars-3.gif') . '" alt="' . _GOOD . '" title="' . _GOOD . '" /><br />';
$content .= '<input type="radio" name="score" value="2" /> <img src="' . (file_exists('themes/' . $CPG_SESS['theme'] . '/images/news/stars-2.gif') ? 'themes/' . $CPG_SESS['theme'] . '/images/news/stars-2.gif' : 'images/news/stars-2.gif') . '" alt="' . _REGULAR . '" title="' . _REGULAR . '" /><br />';
$content .= '<input type="radio" name="score" value="1" /> <img src="' . (file_exists('themes/' . $CPG_SESS['theme'] . '/images/news/stars-1.gif') ? 'themes/' . $CPG_SESS['theme'] . '/images/news/stars-1.gif' : 'images/news/stars-1.gif') . '" alt="' . _BAD . '" title="' . _BAD . '" /><br /><br /></div>';
$content .= '<div style="text-align:center;"><input type="submit" value="' . _CASTMYVOTE . '" /></div></form>';
$block = array('bid' => 10003, 'view' => 0, 'side' => 'r', 'title' => _RATEARTICLE, 'content' => $content);
$Blocks->custom($block);
$content = '<br /> <img src="images/news/print.gif" style="width:16px; height:11px;" alt="' . _PRINTER . '" title="' . _PRINTER . '" /> <a href="' . URL::index('&file=print&sid=' . $sid) . '">' . _PRINTER . '</a><br /><br />';
if (can_admin('news')) {
$content .= '<div style="text-align:center;"><b>' . _ADMIN . '</b><br />[ <a href="' . URL::admin('&mode=add') . '">' . _ADD . '</a> | <a href="' . URL::admin('&edit=' . $sid) . '">' . _EDIT . '</a> | <a href="' . URL::admin('&del=' . $sid) . '">' . _DELETE . '</a> ]</div>';
}
$block = array('bid' => 10004, 'view' => 0, 'side' => 'r', 'title' => _OPTIONS, 'content' => $content);
$Blocks->custom($block);
require_once 'header.php';
$cpgtpl->display('body');
if ($story['acomm'] && $MAIN_CFG['global']['articlecomm'] && $userinfo['umode'] != 'nocomments') {
require_once "modules/{$module_name}/comments.php";
DisplayComments($sid, $story['title']);
}
示例6: die
| eMail: support at myndworx dot com |
| Website: http://www.nexoscms.org and http://www.myndworx.com |
+-------------------------------------------------------------------+
|Original Copyright below |
+-------------------------------------------------------------------+
| CPG Dragonfly™ CMS |
| Copyright © 2004 - 2005 by CPG-Nuke Dev Team |
| http://www.dragonflycms.com |
| Dragonfly is released under the terms and conditions of the GNU |
| GPL version 2 or any later version |
+-------------------------------------------------------------------+
*/
if (!defined('ADMIN_PAGES')) {
exit;
}
if (!can_admin('referers')) {
die('Access Denied');
}
$pagetitle .= ' ' . _BC_DELIM . ' ' . _HTTPREFERERS;
global $bgcolor3, $db, $prefix;
if (isset($_GET['del']) && $_GET['del'] == 'all') {
$db->sql_query('DELETE FROM ' . $prefix . '_referer');
URL::redirect(URL::admin());
} else {
require_once 'header.php';
GraphicAdmin('_AMENU6');
$result = $db->sql_query('SELECT url FROM ' . $prefix . '_referer');
$bgcolor = '';
if ($db->sql_numrows($result) > 0) {
$cpgtpl->assign_vars(array('U_DELREFERERS' => URL::admin('&del=all')));
while (list($url) = $db->sql_fetchrow($result)) {
示例7: phpversion
<div style="text-align:center; width:600px;">
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="maintable">
<tr>
<td valign="top" bgcolor="#EFEFEF"><img src="' . $dirlogo . '/logo.gif"><br />
</td>
</tr>
</table><br />';
$phpver = phpversion();
$phpver = "{$phpver['0']}{$phpver['2']}";
if ($phpver < 41) {
echo "You need atl east PHP version 4.1 to use Coppermine 4 CMS</a>";
cpgfooter();
die;
}
// check if user has access
if (!can_admin()) {
echo "You don't have permission to access this file !<p><a href=\"{$login_url}\">Login as Admin</a>";
cpgfooter();
die;
}
$installtype = 0;
// 0 = new, 1 = 1.1D, 2 = 1.2, 3 = 1.2 RC, 4 = 1.2 RC5, 5 = 1.2.2 / 1.2.2a
// check if this is an upgrade
if (file_exists($CPG_M_DIR . "/include/config.inc.php")) {
include $CPG_M_DIR . "/include/config.inc.php";
if ($CONFIG['TABLE_PREFIX']) {
// CPG 1.1D
$cpg_prefix = $CONFIG['TABLE_PREFIX'];
$installtype = 1;
} else {
$installtype = 2;
示例8: newsletter_selection
| eMail: support at myndworx dot com |
| Website: http://www.nexoscms.org and http://www.myndworx.com |
+-------------------------------------------------------------------+
|Original Copyright below |
+-------------------------------------------------------------------+
| CPG Dragonfly™ CMS |
| Copyright © 2004 - 2005 by CPG-Nuke Dev Team |
| http://www.dragonflycms.com |
| Dragonfly is released under the terms and conditions of the GNU |
| GPL version 2 or any later version |
+-------------------------------------------------------------------+
*/
if (!defined('ADMIN_PAGES')) {
exit;
}
if (!can_admin('newsletter')) {
die('Access Denied');
}
$pagetitle .= ' ' . _BC_DELIM . ' ' . _NEWSLETTER;
function newsletter_selection($fieldname, $current)
{
static $groups;
if (!isset($groups)) {
global $db, $prefix;
$groups = array(0 => _NL_ALLUSERS, 1 => _SUBSCRIBEDUSERS, 2 => _NL_ADMINS);
$groupsResult = $db->sql_query("SELECT group_id, group_name FROM " . $prefix . "_bbgroups WHERE group_single_user=0");
while (list($groupID, $groupName) = $db->sql_fetchrow($groupsResult)) {
$groups[$groupID + 2] = $groupName;
}
}
$tmpgroups = $groups;
示例9: trigger_error
| Dragonfly is released under the terms and conditions of the GNU |
| GPL version 2 or any later version |
+-------------------------------------------------------------------+
*/
if (!defined('CPG_NUKE')) {
exit;
}
global $db, $prefix;
# how many referers should the block display?
$ref = 10;
$a = 1;
$content = '';
$result = $db->sql_query("SELECT url FROM " . $prefix . "_referer ORDER BY lasttime DESC LIMIT {$ref}");
$total = $db->sql_numrows($result);
if ($total < 1) {
$content = 'ERROR';
return trigger_error(sprintf(_ERROR_NONE_TO_DISPLAY, strtolower(_HTTPREFERERS)), E_USER_WARNING);
}
while (list($url) = $db->sql_fetchrow($result)) {
$url2 = str_replace('_', ' ', $url);
if (strlen($url2) > 18) {
$url2 = substr($url, 0, 20);
$url2 .= '..';
}
$content .= "{$a}: \n" . "<a href=\"{$url}\" target=\"_blank\">{$url2}</a>\n" . "<br />\n";
$a++;
}
if (can_admin()) {
$content .= "<br />\n" . "<div style=\"text-align:center;\">\n" . "{$total} " . _HTTPREFERERS . "\n" . "<br /><br />\n" . "[ <a href=\"" . URL::admin('referers&del=all') . "\">" . _DELETE . "</a> ]\n" . "</div>\n";
}
$db->sql_freeresult($result);
示例10: cpg_error
of the GNU GPL version 2 or any later version
$Source: /cvs/modules/Wiki/modules/Wiki/manage.php,v $
$Revision: 1.9 $
$Author: phoenix $
$Date: 2010/11/27 06:40:04 $
**********************************************/
if (!defined('CPG_NUKE')) {
exit;
}
require_once "modules/{$module_name}/inc/functions.php";
require CORE_PATH . 'wysiwyg/wysiwyg.inc';
if (!is_user()) {
cpg_error('You are not allowed to edit/create documents, please login or register');
} elseif (isset($_POST['content']) && !(isset($_POST['wysiwyg']) || isset($_POST['preview']))) {
if (!can_admin($module_name)) {
$msg = intval($_POST['page_id']) > 0 ? 'replace the current page.' : 'be added.';
$db->sql_query('INSERT INTO ' . $module_prefix . "_pages_wait (page_id, parent_id, title, user_id, comment, body) VALUES (" . intval($_POST['page_id']) . ", " . intval($_POST['parent_id']) . ", '" . Fix_Quotes($_POST['title']) . "', " . is_user() . ", '" . Fix_Quotes($_POST['comment']) . "', '" . Fix_Quotes($_POST['content']) . "')");
cpg_error('Page is added and is awaiting approval to ' . $msg, '', $MAIN_CFG['server']['path'] . URL::index());
}
// page_id is used for modifications
if (intval($_POST['page_id']) > 0) {
$id = intval($_POST['page_id']);
$sql = 'UPDATE ' . $module_prefix . "_pages SET" . ' parent_id=' . intval($_POST['parent_id']) . ', active=1' . ", title='" . Fix_Quotes($_POST['title']) . "', version=version+1" . ', supercede=' . time() . ', upd_user_id=' . is_user() . ", upd_author='" . Fix_Quotes($userinfo['username']) . "', comment='" . Fix_Quotes($_POST['comment']) . "', body='" . Fix_Quotes($_POST['content']) . "' WHERE id={$id}";
$db->sql_query($sql);
} else {
list($pos) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $module_prefix . "_pages WHERE parent_id=" . intval($_POST['parent_id']));
$sql = 'INSERT INTO ' . $module_prefix . '_pages (parent_id, active, pos, title, time, user_id, author, comment, body) VALUES (' . intval($_POST['parent_id']) . ', 1, ' . ($pos + 1) . ", '" . Fix_Quotes($_POST['title']) . "', " . time() . ', ' . is_user() . ", '" . Fix_Quotes($userinfo['username']) . "', '" . Fix_Quotes($_POST['comment']) . "', '" . Fix_Quotes($_POST['content']) . "')";
$db->sql_query($sql);
$id = $db->sql_nextid('id');
}
示例11: pollResults
function pollResults($poll_id)
{
global $db, $prefix, $ThemeSel;
if (!isset($poll_id)) {
$poll_id = 1;
}
$holdtitle = $db->sql_ufetchrow('SELECT poll_title, artid FROM ' . $prefix . "_poll_desc WHERE poll_id='{$poll_id}'", SQL_NUM);
echo "<b>{$holdtitle['0']}</b><br /><br />";
list($sum) = $db->sql_ufetchrow('SELECT SUM(option_count) FROM ' . $prefix . "_poll_data WHERE poll_id='{$poll_id}'", SQL_NUM);
echo '<table border="0">';
/* cycle through all options */
$result = $db->sql_query("SELECT option_text, option_count FROM " . $prefix . "_poll_data WHERE poll_id='{$poll_id}' AND option_text!='' ORDER BY vote_id");
while (list($option_text, $option_count) = $db->sql_fetchrow($result)) {
echo "<tr><td>{$option_text}</td>";
$percent = 0;
if ($sum) {
$percent = 100 * $option_count / $sum;
}
echo '<td>';
$percentInt = (int) $percent * 4 * 1;
$percent2 = (int) $percent;
if (file_exists("themes/{$ThemeSel}/images/survey_leftbar.gif") && file_exists("themes/{$ThemeSel}/images/survey_mainbar.gif") && file_exists("themes/{$ThemeSel}/images/survey_rightbar.gif")) {
$l_size = getimagesize("themes/{$ThemeSel}/images/survey_leftbar.gif");
$m_size = getimagesize("themes/{$ThemeSel}/images/survey_mainbar.gif");
$r_size = getimagesize("themes/{$ThemeSel}/images/survey_rightbar.gif");
$leftbar = 'survey_leftbar.gif';
$mainbar = 'survey_mainbar.gif';
$rightbar = 'survey_rightbar.gif';
} else {
$l_size = getimagesize("themes/{$ThemeSel}/images/leftbar.gif");
$m_size = getimagesize("themes/{$ThemeSel}/images/mainbar.gif");
$r_size = getimagesize("themes/{$ThemeSel}/images/rightbar.gif");
$leftbar = 'leftbar.gif';
$mainbar = 'mainbar.gif';
$rightbar = 'rightbar.gif';
}
if (file_exists("themes/{$ThemeSel}/images/survey_mainbar_d.gif")) {
$m1_size = getimagesize("themes/{$ThemeSel}/images/survey_mainbar_d.gif");
$mainbar_d = 'survey_mainbar_d.gif';
if ($percent2 > 0 && $percent2 <= 23) {
$salto = "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m_size['1']}\" width=\"{$percentInt}\" />";
} elseif ($percent2 > 24 && $percent2 < 50) {
$a = $percentInt - 100;
$salto = "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m_size['1']}\" width=\"70\" />" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar_d}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m1_size['1']}\" width=\"30\" />" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m_size['1']}\" width=\"{$a}\" />";
} elseif ($percent2 > 49 && $percent2 < 75) {
$a = $percentInt - 200;
$salto = "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m_size['1']}\" width=\"70\" />" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar_d}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m1_size['1']}\" width=\"30\" />" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m_size['1']}\" width=\"70\" />" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar_d}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m1_size['1']}\" width=\"30\" />" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m_size['1']}\" width=\"{$a}\" />";
} elseif ($percent2 > 74 && $percent2 <= 100) {
$a = $percentInt - 300;
$salto = "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m_size['1']}\" width=\"70\" />" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar_d}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m1_size['1']}\" width=\"30\" />" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m_size['1']}\" width=\"70\" />" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar_d}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m1_size['1']}\" width=\"30\" />" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m_size['1']}\" width=\"70\" />" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar_d}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m1_size['1']}\" width=\"30\" />" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m_size['1']}\" width=\"{$a}\" />";
}
}
if ($percent > 0) {
echo "<img src=\"themes/{$ThemeSel}/images/{$leftbar}\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" />";
if (file_exists("themes/{$ThemeSel}/images/survey_mainbar_d.gif")) {
echo "{$salto}";
} else {
echo "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" height=\"{$m_size['1']}\" width=\"{$percentInt}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" />";
}
echo "<img src=\"themes/{$ThemeSel}/images/{$rightbar}\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" />";
} else {
echo "<img src=\"themes/{$ThemeSel}/images/{$leftbar}\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" />";
if (!file_exists("themes/{$ThemeSel}/images/survey_mainbar_d.gif")) {
echo "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" height=\"{$m_size['1']}\" width=\"{$m_size['0']}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" />";
}
echo "<img src=\"themes/{$ThemeSel}/images/{$rightbar}\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" />";
}
printf(" %.2f%% (%s)", $percent, $option_count);
echo "</td></tr>";
}
$db->sql_freeresult($result);
echo '</table><br />
<center><font class="content">' . _TOTALVOTES . ' <b>' . $sum . '</b>
<br /><br />';
$article = '';
if ($holdtitle[1] > 0) {
$article = "<br /><br />" . _GOBACK;
}
echo '[ <a href="' . URL::index("&pollid={$poll_id}") . "\">" . _VOTING . "</a> | " . '<a href="' . URL::index() . '">' . _OTHERPOLLS . "</a> ] {$article} </font></center>";
if (can_admin('surveys')) {
echo '<br /><center>[ <a href="' . URL::admin('Surveys&mode=add') . '">' . _ADD . '</a> | <a href="' . URL::admin("Surveys&mode=edit&id={$poll_id}") . '">' . _EDIT . '</a> ]</center>';
}
return $holdtitle[0];
}
示例12: die
| eMail: support at myndworx dot com |
| Website: http://www.nexoscms.org and http://www.myndworx.com |
+-------------------------------------------------------------------+
|Original Copyright below |
+-------------------------------------------------------------------+
| CPG Dragonfly™ CMS |
| Copyright © 2004 - 2005 by CPG-Nuke Dev Team |
| http://www.dragonflycms.com |
| Dragonfly is released under the terms and conditions of the GNU |
| GPL version 2 or any later version |
+-------------------------------------------------------------------+
*/
if (!defined('ADMIN_PAGES')) {
exit;
}
if (!can_admin('history')) {
die('Access Denied');
}
$pagetitle .= ' ' . _BC_DELIM . ' ' . _EPHEMADMIN;
if (isset($_POST['createEntry'])) {
$day = intval($_POST['day']);
$month = intval($_POST['month']);
$year = Fix_Quotes($_POST['year'], 1);
$content = Fix_Quotes($_POST['content']);
$entry_language = $_POST['language'];
$db->sql_query("INSERT INTO " . $prefix . "_history (eid, did, mid, yid, content, language) VALUES (DEFAULT, '{$day}', '{$month}', '{$year}', '{$content}', '{$entry_language}')");
URL::redirect(URL::admin());
} elseif (isset($_POST['saveEntry'])) {
$id = intval($_POST['entry_id']);
$year = Fix_Quotes($_POST['entry_year'], 1);
$content = Fix_Quotes($_POST['entry_content']);
示例13: getlink
echo '<a href="' . getlink('Your_Account&profile=' . $row[1]) . '"><strong>' . $row[1] . ':</strong></a>';
if ($shoutconf['date']) {
echo formatDateTime($row[3], '%d-%b-%Y ');
}
// date
if ($shoutconf['time']) {
echo formatDateTime($row[3], '%H:%M:%S');
}
// time
echo '<br />' . $row[2] . '</div><hr />';
}
$db->sql_freeresult($result);
$number = 0;
}
$pagetitle .= 'Shoutblock';
require_once 'header.php';
OpenTable();
if ($shoutconf['themecolors']) {
$shoutconf['color1'] = $bgcolor1;
$shoutconf['color2'] = $bgcolor2;
}
$offset = isset($_GET['offset']) ? $_GET['offset'] : 0;
if (is_numeric($offset)) {
$offset = intval($offset);
nav_shouts();
} else {
all_shouts();
}
$admin = can_admin('shoutblock') ? ' | <a href="' . adminlink('&mode=manage') . '">Manage Shouts</a>' : '';
echo '<p align="right"><a href="' . getlink('&offset=' . $number) . '">Next</a> - <a href="' . getlink('&offset=all') . '">All</a>' . $admin . '</p>';
CloseTable();
示例14: removeSubComments
$count += removeSubComments($tid, 'comments');
$db->sql_query("UPDATE " . $prefix . "_stories SET comments=comments-{$count} WHERE sid={$sid}");
$db->sql_query("DELETE FROM " . $prefix . "_comments WHERE tid='{$tid}'");
URL::redirect(URL::index("News&file=article&sid={$sid}"));
} else {
require 'header.php';
GraphicAdmin('_AMENU3');
OpenTable();
echo '<div style="text-align:center;" class="title">' . _REMOVECOMMENTS . '</div>';
CloseTable();
OpenTable();
echo '<center>' . _SURETODELCOMMENTS . '<br /><br />[ <a href="javascript:history.go(-1)">' . _NO . '</a> | <a href="' . URL::admin("&del={$tid}&ok=1") . '">' . _YES . '</a> ]</center>';
CloseTable();
}
} else {
if (isset($_GET['polldel']) && can_admin('surveys')) {
$tid = intval($_GET['polldel']);
if (isset($_GET['ok'])) {
$result = $db->sql_query("SELECT poll_id FROM " . $prefix . "_pollcomments WHERE tid={$tid}");
list($poll_id) = $db->sql_fetchrow($result);
removeSubComments($poll_id, 'pollcomments');
$db->sql_query("DELETE FROM " . $prefix . "_pollcomments WHERE tid='{$tid}'");
URL::redirect(URL::index("Surveys&op=results&pollid={$poll_id}"));
} else {
require 'header.php';
GraphicAdmin('_AMENU3');
OpenTable();
echo '<div style="text-align:center;" class="title">' . _REMOVECOMMENTS . '</div>';
CloseTable();
OpenTable();
echo '<center>' . _SURETODELCOMMENTS . '<br /><br />[ <a href="javascript:history.go(-1)">' . _NO . '</a> | <a href="' . URL::admin("&polldel={$tid}&ok=1") . '">' . _YES . '</a> ]</center>';
示例15: add_result
function add_result($row)
{
global $db, $dl_prefix, $cpgtpl, $module_name;
$this->result[$this->result_count++] = $row;
$rating_info = get_rating($row['score'], $row['votes']);
if ($row['date'] >= $row['updated']) {
$row['date'] = _DLP_PUBLISHED . ': ' . generate_date($row['date']) . mark_date($row['date'], 3, 1, '', 2);
} else {
$row['date'] = _DLP_UPDATED . ': ' . generate_date($row['updated']) . mark_date($row['updated'], 3, 2, '', 2);
}
if (can_download($row['active'], $row['access'])) {
$img = dl_image($row['access'] > 0 ? 'download_small_yes.png' : 'download_small.png');
$img_title = _DLP_DLNOW;
} else {
$img = dl_image('download_small_no.png');
$img_title = _DLP_DLFORBIDDEN;
}
if ($row['img_url']) {
if (ereg('://', $row['img_url'])) {
$row['img_url'] .= '" width="100';
} else {
$row['img_url'] = dl_thumbimage($row['img_url']) . '" width="100';
}
}
$cpgtpl->assign_block_vars('dl_item', array('TITLE' => $row['title'], 'U_INFO' => URL::index('&file=details&id=' . $row['lid']), 'U_GET' => URL::index('&get=' . $row['lid']), 'U_IMG' => $row['screen'] ? URL::index('&screen=' . $row['screen']) : '', 'U_HOME' => $row['homepage'], 'U_WRITE' => URL::index('&review=' . $row['lid']), 'U_REVIEWS' => URL::index('&file=details&id=' . $row['lid'] . '#reviews'), 'NO_REVIEWS' => $row['votes'] == 0 && is_user(), 'REVIEWS' => sprintf($row['votes'] == 1 ? '%s review' : '%s reviews', $row['votes']), 'VERSION' => !empty($row['version']) ? _VERSION . ' ' . $row['version'] : '', 'NOT_ACTIVE' => $row['active'] == 0 && can_admin($module_name) ? _DLP_INACTIVE : '', 'E_PICK' => $row['pick'] ? _DLP_EDPICK : '', 'SECURE' => isset($row['cpgcs']) && $row['cpgcs'] ? 'Certified Secure' : '', 'SUBMITTER' => is_numeric($row['submitter']) ? '<a href="' . URL::index('&file=search&sa=' . $row['submitter']) . '">' . $row['username'] . '</a>' : $row['submitter'], 'DL_IMG' => $img, 'DL_IMG_TITLE' => $img_title, 'RATING_IMG' => $rating_info['image'], 'POP_IMG' => popularity($row['lid']), 'DATE' => $row['date'], 'DESC' => nl2br($row['desc_short']), 'U_SCREEN' => URL::index('&screen=' . $row['screen']), 'IMG_SCREEN' => $row['img_url'], 'IMG_MISSING' => dl_image('missing.png'), 'L_VIEWALLSCREENS' => _DLP_VIEWALLSCREENS, 'L_NOSCREENS' => _DLP_NOSCREENSHOTS, 'L_SUBMITTEDBY' => _DLP_SUBMITTEDBY));
}