Пример #1
0
function smile_edit($smile_data, $s_hidden_fields, $filename_list, $smiley_image)
{
    global $smilies_path, $modheader;
    $modheader .= '<script type="text/javascript">
function update_smiley(newimage)
{
	document.getElementById("smiley_image").src = "' . $smilies_path . '" + newimage;
}
</script>';
    showheader();
    echo '
<form method="post" action="' . URL::admin('smilies') . '" enctype="multipart/form-data" accept-charset="utf-8">
<table class="forumline" cellspacing="1" cellpadding="4" border="0">
	<tr>
		<th class="thHead" colspan="2">Smiley Configuration</th>
	</tr>
	<tr>
		<td class="row2">Smiley Code</td>
		<td class="row2"><input type="text" name="smile_code" value="' . (isset($smile_data['code']) ? $smile_data['code'] : '') . '" /></td>
	</tr>
	<tr>
		<td class="row1">Smiley Image File</td>
		<td class="row1"><select name="smile_url" onchange="update_smiley(this.options[selectedIndex].value);">' . $filename_list . '</select> &nbsp; <img id="smiley_image" name="smiley_image" src="' . $smilies_path . $smiley_image . '" border="0" alt="" /> &nbsp;</td>
	</tr>
	<tr>
		<td class="row2">Smiley Emotion</td>
		<td class="row2"><input type="text" name="smile_emotion" value="' . (isset($smile_data['emoticon']) ? $smile_data['emoticon'] : '') . '" /></td>
	</tr>
	<tr>
		<td class="catBottom" colspan="2" align="center">' . $s_hidden_fields . '<input class="mainoption" type="submit" value="' . _SAVECHANGES . '" /></td>
	</tr>
</table></form>';
}
Пример #2
0
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&amp;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
0
 private function index()
 {
     $GLOBALS['cpgtpl']->set_handle('body_cache', 'admin/cache.html');
     $GLOBALS['cpgtpl']->assign_vars(array('S_ACTION' => URL::admin('cache'), 'S_IS_INDEX' => empty($this->compiler), 'S_COMPILER' => $this->compiler, 'S_CALL' => $this->call, 'S_CURRENT_FILE' => $this->current_file));
     foreach ($this->installed as $data) {
         $GLOBALS['cpgtpl']->assign_block_vars('installed', array_change_key_case($data, CASE_UPPER));
         //$cpgtpl->assign_block_vars('installed', array_combine(preg_replace('#([a-z\-_]+)#ei', 'strtoupper(\'S_$1\')', array_keys($data)), $data));
     }
     foreach ($this->supported as $data) {
         $GLOBALS['cpgtpl']->assign_block_vars('supported', array_change_key_case($data, CASE_UPPER));
         //$cpgtpl->assign_block_vars('supported', array_combine(preg_replace('#([a-z\-_]+)#ei', 'strtoupper(\'S_$1\')', array_keys($data)), $data));
     }
 }
Пример #4
0
function cpg_mm_admin_header($title, $content = '')
{
    global $pagetitle, $cpgtpl, $modheader;
    $pagetitle .= ' ' . _BC_DELIM . ' ' . _CPG_MMADMIN;
    $modheader .= '
<link rel="stylesheet" href="themes/default/style/tabletree.css" type="text/css" media="screen"/>
<script type="text/javascript" src="includes/javascript/framework.js"></script>
<script type="text/javascript" src="includes/javascript/dragndrop.js"></script>
<script type="text/javascript" src="includes/javascript/tabletree.js"></script>
<script type="text/javascript" src="includes/javascript/tree.js"></script>
';
    require 'header.php';
    GraphicAdmin('_AMENU1');
    $cpgtpl->assign_vars(array('L_CPGMM' => URL::admin('cpgmm'), 'ICON_SELECT' => 'images/blocks/CPG_Main_Menu/icon_select.gif', 'ICON_FORBID' => 'images/blocks/CPG_Main_Menu/icon_cantselect.gif', 'ICON_HIDDEN' => 'images/blocks/CPG_Main_Menu/icon_hideselect.gif', 'HEAD_TITLE' => $title, 'HEAD_CONTENT' => $content));
    $cpgtpl->set_handle('head', 'admin/cpgmm_header.html');
    $cpgtpl->display('head');
}
Пример #5
0
function df_delete_cache()
{
    if (preg_match('#^(a_|bb_|config_)[a-z]+$#i', $GLOBALS['AdminCache']->file) && unlink(BASEDIR . 'cache/' . $GLOBALS['AdminCache']->file . '.php')) {
        cpg_error($GLOBALS['AdminCache']->file . '.php gone.', _DELETE, URL::admin('cache'));
    } else {
        if ($tpl = glob(BASEDIR . 'cache/tpl_' . $GLOBALS['AdminCache']->file . '*.html.inc')) {
            while ($file = array_shift($tpl)) {
                if (!unlink($file)) {
                    trigger_error(str_replace(BASEDIR . 'cache/', '', $file) . ' couldn\'t be deleted.', E_USER_WARNING);
                }
            }
        } else {
            if ($tpl = glob(BASEDIR . 'cache/' . $GLOBALS['AdminCache']->file . '*.php')) {
                while ($file = array_shift($tpl)) {
                    if (!unlink($file)) {
                        trigger_error(str_replace(BASEDIR . 'cache/', '', $file) . ' couldn\'t be deleted.', E_USER_WARNING);
                    }
                }
            }
        }
    }
    global $pagetitle;
    cpg_error(_TASK_COMPLETED, $pagetitle, URL::admin('cache'));
}
Пример #6
0
  | 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}:&nbsp;\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&amp;del=all') . "\">" . _DELETE . "</a> ]\n" . "</div>\n";
}
$db->sql_freeresult($result);
Пример #7
0
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('&amp;del=all')));
        while (list($url) = $db->sql_fetchrow($result)) {
            $bgcolor = $bgcolor == '' ? ' style="background: ' . $bgcolor3 . '"' : '';
            $cpgtpl->assign_block_vars('referer', array('URL' => $url, 'CLR' => $bgcolor));
        }
        $cpgtpl->set_filenames(array('body' => 'admin/referers.html'));
        $cpgtpl->display('body');
        $cpgtpl->__destruct();
    } else {
        OpenTable();
        echo sprintf(_ERROR_NONE_TO_DISPLAY, strtolower(_HTTPREFERERS));
        CloseTable();
    }
}
Пример #8
0
    $content .= '<div style="text-align:center;"><img src="images/blocks/no_avatar.gif" alt="" /><br />' . _BWEL . ' <b>' . _ANONYMOUS . '</b></div>
	<hr /><form action="' . $redirect . '" method="post" enctype="multipart/form-data" accept-charset="utf-8" style="margin:0;"><div>
	<span style="float:left; height:25px;">' . _NICKNAME . '</span><span style="float:right; height:25px;"><input type="text" name="ulogin" size="10" maxlength="25" /></span><br />
	<span style="float:left; height:25px;">' . _PASSWORD . '</span><span style="float:right; height:25px;"><input type="password" name="user_password" size="10" maxlength="20" /></span><br />
	';
    if ($MAIN_CFG['debug']['sec_code'] & 2) {
        $content .= '<span style="float:left; height:25px;">' . _SECURITYCODE . '</span><span style="float:right; height:25px;">' . generate_secimg() . '</span><br style="clear:left;" />
		<span style="float:left; height:25px;">' . _TYPESECCODE . '</span><span style="float:right; height:25px;"><input type="text" name="gfx_check" size="8" maxlength="8" /></span><br />';
    }
    // don't show register link unless allowuserreg is yes
    $content .= '<span style="float:left; height:25px;">' . ($MAIN_CFG['member']['allowuserreg'] ? '<input type="button" value="' . _BREG . '" onclick="window.location=\'' . URL::index('Your_Account&amp;file=register', 1, 1) . '\'" />' : '') . '</span>
	<span style="float:right; height:25px;"><input type="submit" value="' . _LOGIN . '" />
	</span></div></form>';
}
if (is_admin()) {
    $content .= '<br style="clear:left;"/><a title="' . _LOGOUTADMINACCT . '" href="' . URL::admin('logout') . '"><img src="images/blocks/login.gif" alt="" /></a>&nbsp;<a title="' . _LOGOUTADMINACCT . '" href="' . URL::admin('logout') . '">' . _ADMIN . ' ' . _LOGOUT . "</a><br />\n";
}
$day = L10NTime::tolocal(mktime(0, 0, 0, date('n'), date('j'), date('Y')) - date('Z'), $userinfo['user_dst'], $userinfo['user_timezone']);
list($last[0]) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $user_prefix . "_users \n\tWHERE user_regdate>='" . $day . "'", SQL_NUM);
list($last[1]) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $user_prefix . "_users \n\tWHERE user_regdate<'" . $day . "' AND user_regdate>='" . ($day - 86400) . "'", SQL_NUM);
list($lastuser) = $db->sql_ufetchrow("SELECT username FROM " . $user_prefix . "_users \n\tWHERE user_active = 1 AND user_level > 0 \n\tORDER BY user_id DESC", SQL_NUM);
list($numusers) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $user_prefix . "_users \nWHERE user_id > 1 AND user_level > 0", SQL_NUM);
$content .= '<hr /><span style="font-weight:bold; text-decoration:underline;">' . _BMEMP . ":</span><br />\n";
$content .= '<img src="images/blocks/ur-moderator.gif" alt="" /> ' . _BLATEST . ': <a href="' . URL::index("Your_Account&amp;profile={$lastuser}") . '"><b>' . $lastuser . '</b></a><br />
<img src="images/blocks/ur-author.gif" alt="" /> ' . _BTD . ': <b>' . $last[0] . '</b><br />
<img src="images/blocks/ur-admin.gif" alt="" /> ' . _BYD . ': <b>' . $last[1] . '</b><br />
<img src="images/blocks/ur-guest.gif" alt="" /> ' . _BOVER . ': <b>' . $numusers . '</b><br />
<hr />
<img src="images/blocks/group-1.gif" alt="" /> <span style="font-weight:bold; text-decoration:underline;">' . _BVISIT . ':</span><br />
<img src="images/blocks/ur-member.gif" alt="" /> ' . _BMEM . ': <b>' . $online_num[0] . '</b><br />
<img src="images/blocks/ur-anony.gif" alt="" /> ' . _BVIS . ': <b>' . $online_num[1] . '</b><br />
Пример #9
0
             $max_add_filesize = round($max_add_filesize / 1024 * 100) / 100;
         }
     }
     $template->assign_vars(array('L_MANAGE_QUOTAS_TITLE' => $lang['Manage_quotas'], 'L_MANAGE_QUOTAS_EXPLAIN' => $lang['Manage_quotas_explain'], 'L_SUBMIT' => $lang['Submit'], 'L_RESET' => $lang['Reset'], 'L_EDIT' => $lang['Edit'], 'L_VIEW' => $lang['View'], 'L_DESCRIPTION' => $lang['Description'], 'L_SIZE' => $lang['Max_filesize_attach'], 'L_ADD_NEW' => $lang['Add_new'], 'L_DELETE' => $lang['Delete'], 'MAX_FILESIZE' => $max_add_filesize, 'QUOTA_LIMIT_SETTINGS' => '', 'S_FILESIZE' => size_select('add_size_select', $size), 'L_REMOVE_SELECTED' => $lang['Remove_selected'], 'S_HIDDEN_FIELDS' => '', 'S_ATTACH_ACTION' => URL::admin("&amp;do=attachments&amp;mode=quota")));
     $result = $db->sql_query("SELECT * FROM " . QUOTA_LIMITS_TABLE . " ORDER BY quota_limit DESC");
     $rows = $db->sql_fetchrowset($result);
     for ($i = 0; $i < count($rows); $i++) {
         $size_format = $rows[$i]['quota_limit'] >= 1048576 ? 'mb' : ($rows[$i]['quota_limit'] >= 1024 ? 'kb' : 'b');
         if ($rows[$i]['quota_limit'] >= 1048576) {
             $rows[$i]['quota_limit'] = round($rows[$i]['quota_limit'] / 1048576 * 100) / 100;
         } else {
             if ($rows[$i]['quota_limit'] >= 1024) {
                 $rows[$i]['quota_limit'] = round($rows[$i]['quota_limit'] / 1024 * 100) / 100;
             }
         }
         $template->assign_block_vars('limit_row', array('QUOTA_NAME' => $rows[$i]['quota_desc'], 'QUOTA_ID' => $rows[$i]['quota_limit_id'], 'S_FILESIZE' => size_select('size_select_list[]', $size_format), 'U_VIEW' => URL::admin("&amp;do=attachments&amp;mode={$mode}&amp;e_mode=view_quota&amp;quota_id=" . $rows[$i]['quota_limit_id']), 'MAX_FILESIZE' => $rows[$i]['quota_limit']));
     }
 } else {
     if ($mode == 'quota' && $e_mode == 'view_quota') {
         if (isset($_POST['quota_id']) || isset($_GET['quota_id'])) {
             $quota_id = isset($_POST['quota_id']) ? intval($_POST['quota_id']) : intval($_GET['quota_id']);
         } else {
             message_die(GENERAL_MESSAGE, 'Invalid Call');
             return;
         }
         $template->assign_block_vars('switch_quota_limit_desc', array());
         $result = $db->sql_query("SELECT * FROM " . QUOTA_LIMITS_TABLE . " WHERE quota_limit_id = " . $quota_id . " LIMIT 1");
         $row = $db->sql_fetchrow($result);
         $template->assign_vars(array('L_QUOTA_LIMIT_DESC' => $row['quota_desc'], 'L_ASSIGNED_USERS' => $lang['Assigned_users'], 'L_ASSIGNED_GROUPS' => $lang['Assigned_groups'], 'L_UPLOAD_QUOTA' => $lang['Upload_quota'], 'L_PM_QUOTA' => $lang['Pm_quota']));
         $sql = "SELECT q.user_id, u.username, q.quota_type\n\tFROM " . QUOTA_TABLE . " q, " . USERS_TABLE . " u\n\tWHERE q.quota_limit_id = " . $quota_id . " AND q.user_id <> 0 AND q.user_id = u.user_id";
         $result = $db->sql_query($sql);
Пример #10
0
        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("&amp;del={$tid}&amp;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("&amp;polldel={$tid}&amp;ok=1") . '">' . _YES . '</a> ]</center>';
            CloseTable();
        }
    } else {
        die('Access Denied');
    }
}
Пример #11
0
     $forum_perm[0]['forum_name'] = $lang['Perm_all_forums'];
 } else {
     $forum_p = array();
     $act_id = 0;
     $forum_p = auth_unpack($allowed_forums);
     $result = $db->sql_query("SELECT forum_id, forum_name FROM " . FORUMS_TABLE . " WHERE forum_id IN (" . implode(', ', $forum_p) . ")");
     while ($row = $db->sql_fetchrow($result)) {
         $forum_perm[$act_id]['forum_id'] = $row['forum_id'];
         $forum_perm[$act_id]['forum_name'] = $row['forum_name'];
         $act_id++;
     }
 }
 for ($i = 0; $i < count($forum_perm); $i++) {
     $template->assign_block_vars('allow_option_values', array('VALUE' => $forum_perm[$i]['forum_id'], 'OPTION' => $forum_perm[$i]['forum_name']));
 }
 $template->assign_vars(array('L_GROUP_PERMISSIONS_TITLE' => sprintf($lang['Group_permissions_title'], trim($group_name)), 'L_GROUP_PERMISSIONS_EXPLAIN' => $lang['Group_permissions_explain'], 'L_REMOVE_SELECTED' => $lang['Remove_selected'], 'L_CLOSE_WINDOW' => $lang['Close_window'], 'L_ADD_FORUMS' => $lang['Add_forums'], 'L_ADD_SELECTED' => $lang['Add_selected'], 'L_RESET' => $lang['Reset'], 'S_HIDDEN_FIELDS' => '', 'A_PERM_ACTION' => URL::admin("&amp;do=extensions&amp;mode=groups&amp;e_mode=perm&amp;e_group={$group}")));
 $forum_option_values = array(GPERM_ALL => $lang['Perm_all_forums']);
 $result = $db->sql_query("SELECT forum_id, forum_name FROM " . FORUMS_TABLE);
 while ($row = $db->sql_fetchrow($result)) {
     $forum_option_values[intval($row['forum_id'])] = $row['forum_name'];
 }
 reset($forum_option_values);
 while (list($value, $option) = each($forum_option_values)) {
     $template->assign_block_vars('forum_option_values', array('VALUE' => $value, 'OPTION' => $option));
 }
 $template->assign_var_from_handle('GROUP_PERMISSIONS_BOX', 'perm_box');
 $empty_perm_forums = array();
 $f_result = $db->sql_query("SELECT forum_id, forum_name FROM " . FORUMS_TABLE . " WHERE auth_attachments < " . AUTH_ADMIN);
 while ($row = $db->sql_fetchrow($f_result)) {
     $forum_id = $row['forum_id'];
     $sql = "SELECT forum_permissions FROM " . EXTENSION_GROUPS_TABLE . "\n\t\tWHERE allow_group = 1 ORDER BY group_name ASC";
Пример #12
0
$rating_info = get_rating($row['score'], $row['votes']);
if (!is_admin() && $row['submitter'] != is_user()) {
    update_views($global_id);
}
//$modheader .= '<link rel="stylesheet" type="text/css" href="modules/'.$module_name.'/include/style.css" />';
$pagetitle .= $module_title . ' ' . _BC_DELIM . ' ' . $row['title'];
if ($row['img_url']) {
    if (ereg('://', $row['img_url'])) {
        $row['img_url'] .= '" width="' . $dl_config['dimension_thumb'];
    } else {
        $row['img_url'] = dl_thumbimage($row['img_url']);
    }
}
$can_dl = can_download($row['active'], $row['access']);
//$submitter_count = $db->sql_count($dl_prefix.'_downloads', "submitter='".Fix_Quotes($row['submitter'])."'")-1;
$cpgtpl->assign_vars(array('L_SUBMITTEDBY' => _DLP_SUBMITTEDBY, 'L_AUTHORNAME' => _AUTHORNAME, 'L_AUTHOREMAIL' => _AUTHOREMAIL, 'L_PUBLISHED' => _DLP_PUBLISHED, 'L_UPDATED' => _DLP_UPDATED, 'L_DESCRIPTION' => _DESCRIPTION, 'L_CATEGORY' => _CATEGORY, 'L_RATING' => _RATING, 'L_VOTES' => _VOTES, 'L_DOWNLOADS' => _DOWNLOADS, 'L_ACTIVE' => _ACTIVE, 'L_EDIT' => _EDIT, 'L_DELETE' => _DELETE, 'L_ISDLOWNER' => sprintf(_DLP_ISDLOWNER, URL::index('&amp;file=manage&amp;edit=' . $global_id)), 'L_MIRSUB' => sprintf(_DLP_MIRSUB, URL::index('&amp;file=manage&amp;mirrors=' . $global_id)), 'L_EDNOTE' => _DLP_EDNOTE, 'L_MEMREVIEWS' => _DLP_MEMREVIEWS, 'L_PENDREVIEWS' => _DLP_PENDREVIEWS, 'L_BY' => _BY, 'L_ON' => _ON, 'L_PAGE' => _DLP_PAGE, 'L_VIEWALLSCREENS' => _DLP_VIEWALLSCREENS, 'L_POPULARITY' => _POPULARITY, 'L_PAGEVIEWS' => _DLP_PAGEVIEWS, 'L_ADMINTOOLS' => _ADMINISTRATION, 'L_EDPICK' => _DLP_EDPICK, 'DL_MENU' => dl_detail_menu($global_id, $row['title'], $row['pick'], $row['active'], 1), 'DL_CATEGORY' => DL_Cat::breadcrumb($row['cid']), 'DL_SUBMITTER' => is_numeric($row['submitter']) ? '<a href="' . URL::index('&amp;file=search&amp;sa=' . $row['submitter']) . '">' . $row['username'] . '</a>' : $row['submitter'], 'DL_AUTHORNAME' => $row['name'], 'DL_AUTHOREMAIL' => $row['email'] ? spam_protect($row['email']) : false, 'DL_PUBLISHED' => generate_date($row['date']), 'DL_PUBLISHTYPE' => mark_date($row['date'], 3, 1, 'right'), 'DL_UPDATED' => $row['updated'] > $row['date'] ? generate_date($row['updated']) : false, 'DL_UPDATE_TYPE' => $row['updated'] > $row['date'] ? mark_date($row['updated'], 3, 2, 'right') : false, 'DL_DESCRIPTION' => nl2br($row['desc_short']) . (!empty($row['desc_long']) ? decode_bbcode("\n\n" . $row['desc_long'], true) : ''), 'DL_NOTES' => decode_bbcode($row['notes']), 'DL_REVIEWS_ACTIVE' => $dl_config['r_active'], 'IMG_DL_RATING' => $rating_info['image'], 'DL_VOTES' => intval($row['votes']), 'DL_POPULARITY' => popularity($global_id), 'DL_HITS' => intval($row['hits']), 'DL_VIEWS' => intval($row['views']), 'DL_SUB_MIRRORS' => $dl_config['pub_mirror'], 'U_DL_SCREENSHOT' => URL::index('&amp;screen=' . $row['screen']), 'IMG_DL_SCREENSHOT' => $row['img_url'], 'B_DL_ADMIN' => can_admin($module_name), 'DL_IS_OWNER' => $row['submitter'] == $userinfo['user_id'], 'U_DL_DELETE' => URL::admin('&amp;del_dl=' . $global_id), 'U_DL_EDIT' => URL::index('&amp;file=manage&amp;edit=' . $global_id), 'U_DL_MIRSUB' => URL::index('&amp;file=manage&amp;mirrors=' . $global_id), 'U_DL_MIRROR' => URL::index('&amp;mirror=' . $global_id), 'U_DL_MIRRORS' => URL::index('&amp;get=' . $global_id), 'U_DL_ACTIVE' => URL::admin('&amp;active=' . $global_id), 'U_DL_PICK' => URL::admin('&amp;pick=' . $global_id), 'IMG_DL_MIRRORS' => dl_image($can_dl ? 'download.png' : 'register.png'), 'IMG_DL_ACTIVE' => dl_image($row['active'] == 1 ? 'checked.png' : 'unchecked.png'), 'IMG_DL_PICK' => dl_image($row['pick'] ? 'checked.png' : 'unchecked.png'), 'S_DL_ACTIVE' => $row['active'] == 1 ? _YES : _NO, 'S_DL_PICK' => $row['pick'] ? _YES : _NO, 'S_DL_MIRRORS' => $can_dl ? _DLP_DLNOW : _DLP_NADL));
$result = $db->sql_query("SELECT field, title, type FROM " . $dl_prefix . "_fields \n\tWHERE type!=3 AND visible > 0");
if ($db->sql_numrows($result)) {
    while ($row2 = $db->sql_fetchrow($result)) {
        if ($row2['type'] == 1) {
            $row[$row2['field']] = $row[$row2['field']] ? _YES : _NO;
        }
        if ($row[$row2['field']]) {
            $row2['title'] = defined($row2['title']) ? constant($row2['title']) : $row2['title'];
            if ($row2['field'] == 'homepage' && $row[$row2['field']]) {
                $row[$row2['field']] = '<a href="' . $row[$row2['field']] . '" target="_blank">' . shrink_url($row[$row2['field']]) . '</a>';
            }
            $cpgtpl->assign_block_vars('dl_field', array('TITLE' => $row2['title'], 'VALUE' => $row[$row2['field']]));
        }
    }
}
Пример #13
0
 function pagination_link($url)
 {
     if (defined('ADMIN_PAGES')) {
         return URL::admin($url);
     }
     return URL::index($url);
 }
Пример #14
0
    if (empty($_POST[POST_FORUM_URL])) {
        //
        // Output a selection table if no forum id has been specified.
        //
        $template->set_filenames(array('body' => 'forums/admin/forum_prune_select_body.html'));
        $select_list = '<select name="' . POST_FORUM_URL . '">';
        $select_list .= '<option value="-1">' . $lang['All_Forums'] . '</option>';
        for ($i = 0; $i < count($forum_rows); $i++) {
            $select_list .= '<option value="' . $forum_rows[$i]['forum_id'] . '">' . $forum_rows[$i]['forum_name'] . '</option>';
        }
        $select_list .= '</select>';
        //
        // Assign the template variables.
        //
        $template->assign_vars(array('L_FORUM_PRUNE' => $lang['Forum_Prune'], 'L_SELECT_FORUM' => $lang['Select_a_Forum'], 'L_LOOK_UP' => $lang['Look_up_Forum'], 'S_FORUMPRUNE_ACTION' => URL::admin("&amp;do=forum_prune"), 'S_FORUMS_SELECT' => $select_list));
    } else {
        $forum_id = intval($_POST[POST_FORUM_URL]);
        //
        // Output the form to retrieve Prune information.
        //
        $template->set_filenames(array('body' => 'forums/admin/forum_prune_body.html'));
        $forum_name = $forum_id == -1 ? $lang['All_Forums'] : $forum_rows[0]['forum_name'];
        $prune_data = $lang['Prune_topics_not_posted'] . " ";
        $prune_data .= '<input class="post" type="text" name="prunedays" size="4"> ' . $lang['Days'];
        $hidden_input = '<input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '">';
        //
        // Assign the template variables.
        //
        $template->assign_vars(array('FORUM_NAME' => $forum_name, 'L_FORUM' => $lang['Forum'], 'L_FORUM_PRUNE' => $lang['Forum_Prune'], 'L_FORUM_PRUNE_EXPLAIN' => $lang['Forum_Prune_explain'], 'L_DO_PRUNE' => $lang['Do_Prune'], 'S_FORUMPRUNE_ACTION' => URL::admin("&amp;do=forum_prune"), 'S_PRUNE_DATA' => $prune_data, 'S_HIDDEN_VARS' => $hidden_input));
    }
}
Пример #15
0
function saveuser(&$userinfo)
{
    global $db, $user_prefix, $MAIN_CFG, $allowusertheme, $CPG_SESS, $SESS;
    $mode = isset($_POST['save']) ? $_POST['save'] : 'profile';
    if ($mode == 'admin' && !defined('ADMIN_PAGES')) {
        $mode = 'profile';
    }
    if ($mode == 'profile') {
        $section = 'section=1 OR section=2';
    } elseif ($mode == 'private') {
        $section = 'section=3';
    } elseif ($mode == 'prefs') {
        $section = 'section=5';
    }
    $sql = $pass_change = false;
    if ($mode == 'reg_details') {
        global $allowmailchange;
        $current_password = isset($_POST['current_password']) ? md5($_POST['current_password']) : '';
        if (isset($_POST['new_password'])) {
            $new_password = $_POST['new_password'];
            $verify_password = isset($_POST['verify_password']) ? $_POST['verify_password'] : '';
            if ($new_password != $verify_password) {
                cpg_error(_PASSDIFFERENT, 'ERROR: Password mismatch');
            } elseif ($new_password != '') {
                if (strlen($new_password) < $MAIN_CFG['member']['minpass']) {
                    cpg_error(_YOUPASSMUSTBE . ' <b>' . $MAIN_CFG['member']['minpass'] . '</b> ' . _CHARLONG, 'ERROR: Password too short');
                }
                $new_password = md5($new_password);
                if ($new_password != $userinfo['user_password']) {
                    if (!defined('ADMIN_PAGES') && $current_password != $userinfo['user_password']) {
                        cpg_error('Password incorrect');
                    }
                    $sql = " user_password='******'";
                    $pass_change = true;
                }
            }
        }
        $user_email = isset($_POST['user_email']) ? $_POST['user_email'] : $userinfo['user_email'];
        if (($allowmailchange || defined('ADMIN_PAGES')) && $user_email != $userinfo['user_email']) {
            if ($current_password != $userinfo['user_password'] && !defined('ADMIN_PAGES')) {
                cpg_error('Password incorrect');
            }
            if (is_email($user_email) < 1) {
                cpg_error(_ERRORINVEMAIL);
            }
            if ($sql) {
                $sql .= ', ';
            }
            $sql .= "user_email='{$user_email}'";
        }
        if (defined('ADMIN_PAGES') && isset($_POST['username']) && $_POST['username'] != $userinfo['username']) {
            if (preg_match('#(\\ |\\*|#|\\\\|%|"|\'|`|&|\\^|@)', $_POST['username'])) {
                cpg_error(_ERRORINVNICK);
            }
            if ($db->sql_count($user_prefix . '_users u, ' . $user_prefix . '_users_temp t', "u.username='******'username']}' OR t.username='******'username']}' LIMIT 1") > 0) {
                cpg_error(_NICKTAKEN);
            }
            if ($sql) {
                $sql .= ', ';
            }
            $sql .= "username='******'username']}'";
        }
    } elseif ($mode == 'avatar') {
        require_once 'modules/' . basename(dirname(__FILE__)) . '/avatars.php';
        // Local avatar?
        $avatar_local = isset($_POST['user_avatar']) ? $_POST['user_avatar'] : '';
        // Remote avatar?
        $avatar_remoteurl = !empty($_POST['avatarremoteurl']) ? htmlprepare($_POST['avatarremoteurl']) : '';
        // Upload avatar thru remote or upload?
        $avatar_upload = !empty($_POST['avatarurl']) ? trim($_POST['avatarurl']) : (!empty($_FILES['avatar']) && $_FILES['avatar']['tmp_name'] != "none" ? $_FILES['avatar']['tmp_name'] : '');
        $avatar_name = !empty($_FILES['avatar']['name']) ? $_FILES['avatar']['name'] : '';
        // 0 = USER_AVATAR_NONE
        if (isset($_POST['avatardel']) || $avatar_local == '') {
            $sql = avatar_delete($userinfo);
        }
        // 1 = USER_AVATAR_UPLOAD
        if ((!empty($avatar_upload) || !empty($avatar_name)) && $MAIN_CFG['avatar']['allow_upload']) {
            if (!empty($avatar_upload)) {
                $sql = avatar_upload(empty($avatar_name), $userinfo, $avatar_upload, $_FILES['avatar']);
            } elseif (!empty($avatar_name)) {
                cpg_error(sprintf(_AVATAR_FILESIZE, round($MAIN_CFG['avatar']['filesize'] / 1024)), 'ERROR: Filesize');
            }
        } elseif ($avatar_remoteurl != $userinfo['user_avatar'] && $avatar_remoteurl != '' && $MAIN_CFG['avatar']['allow_remote']) {
            if (!preg_match('#^(http)|(ftp):\\/\\/#i', $avatar_remoteurl)) {
                $avatar_remoteurl = 'http://' . $avatar_remoteurl;
            }
            if (preg_match('#^((http)|(ftp):\\/\\/[\\w\\-]+?\\.([\\w\\-]+\\.)+[\\w]+(:[0-9]+)*\\/.*?\\.(gif|jpg|jpeg|png)$)#is', $avatar_remoteurl)) {
                if (in_array('getimagesize', explode(',', ini_get('disable_functions'))) || ini_get('disable_functions') == 'getimagesize') {
                    cpg_error('getimagesize is disabled', _AVATAR_ERR_URL);
                } elseif (!getimagesize($avatar_remoteurl)) {
                    cpg_error('Image has wrong filetype', _AVATAR_ERR_URL);
                } elseif (!($file_data = get_fileinfo($avatar_remoteurl, !$MAIN_CFG['avatar']['animated']))) {
                    cpg_error(_AVATAR_ERR_URL);
                } elseif ($file_data['size'] > $MAIN_CFG['avatar']['filesize']) {
                    cpg_error(sprintf(_AVATAR_FILESIZE, round($MAIN_CFG['avatar']['filesize'] / 1024)));
                } elseif (!$MAIN_CFG['avatar']['animated'] && $file_data['animation']) {
                    cpg_error('Animated avatar not allowed');
                }
                if (avatar_size($avatar_remoteurl)) {
                    avatar_delete($userinfo);
                    $sql = "user_avatar='{$avatar_remoteurl}', user_avatar_type=2";
                }
            } else {
                cpg_error('Image has wrong filetype', 'ERROR: Image filetype');
            }
        } elseif ($avatar_local != $userinfo['user_avatar'] && $avatar_local != '' && $MAIN_CFG['avatar']['allow_local'] && file_exists($MAIN_CFG['avatar']['gallery_path'] . '/' . $avatar_local)) {
            avatar_delete($userinfo);
            $sql = "user_avatar='{$avatar_local}', user_avatar_type=3";
        }
    } elseif ($mode == 'admin') {
        $sql = 'user_allow_pm=' . intval($_POST['user_allow_pm']) . ', user_allowavatar=' . intval($_POST['user_allowavatar']) . ', user_rank=' . intval($_POST['user_rank']);
        $suspendreason = isset($_POST['suspendreason']) ? $_POST['suspendreason'] : 'no reason';
        if ($_POST['suspendreason'] != $userinfo['susdel_reason']) {
            $sql .= ', susdel_reason=\'' . Fix_Quotes($suspendreason) . "'";
        }
        if (intval($_POST['user_suspend']) == 0 && $userinfo['user_level'] == 0) {
            $sql .= ', user_level=1';
        } elseif (intval($_POST['user_suspend']) > 0 && $userinfo['user_level'] > 0) {
            $message = _SORRYTO . ' ' . $MAIN_CFG['global']['sitename'] . ' ' . _HASSUSPEND;
            if ($suspendreason > '') {
                $message .= "\n\n" . _SUSPENDREASON . "\n{$suspendreason}";
            }
            $from = 'noreply@' . str_replace('www.', '', $MAIN_CFG['server']['domain']);
            if (!send_mail($mailer_message, $message, 0, _ACCTSUSPEND, $userinfo['user_email'], $userinfo['username'], $from)) {
                trigger_error($mailer_message, E_USER_WARNING);
            }
            $sql .= ', user_level=0, susdel_reason=\'' . Fix_Quotes($suspendreason) . "'";
        }
    } else {
        $result = $db->sql_query('SELECT field, type FROM ' . $user_prefix . '_users_fields WHERE ' . $section);
        if ($db->sql_numrows($result) > 0) {
            while ($row = $db->sql_fetchrow($result)) {
                $field = $row['field'] == 'name' ? 'realname' : $row['field'];
                $value = Fix_Quotes($_POST[$field], 1);
                if ($row['field'] == 'user_lang' && !$MAIN_CFG['global']['multilingual']) {
                    continue;
                }
                if ($row['type'] == 1 || $row['type'] == 4) {
                    $value = intval($value);
                } else {
                    if ($field == 'user_website') {
                        if (!preg_match('#^http[s]?:\\/\\/#i', $value)) {
                            $value = 'http://' . $value;
                        }
                        if (!preg_match('#^(http[s]?\\:\\/\\/)?([a-z0-9\\-\\.]+)?[a-z0-9\\-]+\\.[a-z]{2,4}$#i', $value)) {
                            $value = '';
                        }
                    }
                }
                if ($row['type'] == 7 && !$allowusertheme) {
                    $value = $MAIN_CFG['global']['Default_Theme'];
                }
                if ($row['type'] == 6) {
                    $value = date_raw($value);
                    if (checkdate(substr($value, 4, 2), substr($value, 6, 2), substr($value, 0, 4))) {
                        $sql .= ", {$row['field']}='{$value}'";
                    }
                } elseif (array_key_exists($row['field'], $userinfo) && $userinfo[$row['field']] != $value) {
                    $sql .= ", {$row['field']}='{$value}'";
                }
                if ($field == 'user_timezone') {
                    $sql .= ', user_dst=' . intval($_POST['user_dst']);
                }
            }
            if ($sql) {
                $sql = substr($sql, 2);
            }
        }
    }
    if ($sql) {
        $db->sql_query('UPDATE ' . $user_prefix . '_users SET ' . $sql . " WHERE user_id=" . intval($userinfo['user_id']));
        $_SESSION['CPG_USER'] = false;
        unset($_SESSION['CPG_USER']);
        if (!defined('ADMIN_PAGES')) {
            if ($pass_change) {
                global $CLASS;
                $CLASS['member']->setmemcookie($userinfo['user_id'], $userinfo['username'], $new_password);
            }
            if (isset($_POST['theme']) && $allowusertheme) {
                $CPG_SESS['theme'] = $_POST['theme'];
                unset($CPG_SESS['prevtheme']);
            }
            cpg_error(_TASK_COMPLETED, _TB_INFO, URL::index('&edit=' . $mode));
        } else {
            cpg_error(_TASK_COMPLETED, _TB_INFO, URL::admin('users&mode=edit&edit=' . $mode . '&id=' . $userinfo['user_id']));
        }
    }
    if (!defined('ADMIN_PAGES')) {
        URL::redirect(URL::index('&edit=' . $mode));
    } else {
        cpg_error('Nothing changed', 'No update', URL::admin('users&mode=edit&edit=' . $mode . '&id=' . $userinfo['user_id']));
    }
}
Пример #16
0
 private function get_content()
 {
     global $menuitems, $adminindex, $adlinks;
     if (!Cache::array_load('adlinks')) {
         $adlinks = array();
         $linksdir = dir('admin/links');
         while ($file = $linksdir->read()) {
             // CPG-Nuke system							 PHP-Nuke system
             if (preg_match('/^adlnk_.*?\\.php$/', $file) || preg_match('/^links\\..*?\\.php$/', $file)) {
                 $adlinks[] = 'admin/links/' . $file;
             }
         }
         $linksdir->close();
         // Dragonfly system
         $linksdir = dir('modules');
         while ($module = $linksdir->read()) {
             if (false === strpos($module, '.') && $module != 'CVS' && file_exists("modules/{$module}/admin/adlinks.inc")) {
                 $adlinks[$module] = 'modules/' . $module . '/admin/adlinks.inc';
             }
         }
         $linksdir->close();
         Cache::array_save('adlinks');
     }
     foreach ($adlinks as $module => $path) {
         if (is_file($path)) {
             include $path;
         }
     }
     $this->items = is_array($menuitems) ? $menuitems : array();
     ksort($this->items);
     $this->items[_ADMIN][_MENU]['URL'] = $adminindex;
     $this->items[_ADMIN][_MENU]['IMG'] = '';
     $this->items[_ADMIN][_ADMINLOGOUT]['URL'] = URL::admin('logout');
     $this->items[_ADMIN][_ADMINLOGOUT]['IMG'] = '';
     unset($menuitems);
 }
Пример #17
0
function group_msg($message)
{
    cpg_error($message, 'Groups', URL::admin('groups'));
}
Пример #18
0
    echo '</select> &nbsp;';
    $nday = 1;
    echo _DAY . ': <select name="day">';
    while ($nday <= 31) {
        echo '<option value="' . $nday . '">' . $nday . '</option>';
        $nday++;
    }
    echo '</select> &nbsp;' . _YEAR . ': <input type="text" name="year" size="5" maxlength="4" /><br /><br />';
    if ($MAIN_CFG['global']['multilingual']) {
        echo _LANGUAGE . ': ' . lang_selectbox($MAIN_CFG['global']['language'], 'language') . '<br /><br />';
    } else {
        echo '<input type="hidden" name="language" value="' . $MAIN_CFG['global']['language'] . '" />';
    }
    echo _EPHEMDESC . ':<br />
	<textarea name="content" cols="60" rows="10"></textarea><br /><br />
	<input type="submit" name="createEntry" value="' . _ADD . '" />' . close_form() . '<br />' . open_form(URL::admin(), false, _EPHEMMAINT);
    $nmonth = array(1 => _JANUARY, _FEBRUARY, _MARCH, _APRIL, _MAY, _JUNE, _JULY, _AUGUST, _SEPTEMBER, _OCTOBER, _NOVEMBER, _DECEMBER);
    echo _UMONTH . ': <select name="month">';
    while (list($nmonth_key, $nmonth_name) = each($nmonth)) {
        echo '<option value="' . $nmonth_key . '">' . $nmonth_name . '</option>';
    }
    echo '</select> &nbsp;';
    $nday = 1;
    echo _DAY . ': <select name="day">';
    while ($nday <= 31) {
        echo '<option value="' . $nday . '">' . $nday . '</option>';
        $nday++;
    }
    echo '</select> &nbsp;
	<input type="submit" name="transferEntry" value="' . _EDIT . '" />' . close_form();
    CloseTable();
Пример #19
0
                $act_alt = _ACTIVE;
            } else {
                $act_img = 'unchecked.gif';
                $act_alt = _INACTIVE;
            }
            echo '<tr' . $bgcolor . '>
		<td align="center"><strong>' . $mid . '</strong></td>
		<td align="left" style="width:100%;">' . $title . '</td>
		<td align="center">' . $mlanguage . '</td>
		<td align="center" style="white-space:nowrap;">' . $mview . '</td>
		<td align="center"><a href="' . URL::admin('&amp;status=' . $mid) . '"><img src="images/' . $act_img . '" alt="' . $act_alt . '" title="' . $act_alt . '" /></a></td>
		<td align="right" style="white-space:nowrap;"><a href="' . URL::admin('&amp;edit=' . $mid) . '">' . _EDIT . '</a> / <a href="' . URL::admin('&amp;del=' . $mid) . '">' . _DELETE . '</a>
		</td></tr>';
        }
        echo '</table><br />';
        CloseTable();
        echo '<br />';
        OpenTable();
        echo '<div style="text-align:center;" class="option">' . _ADDMSG . '</div><br />
	<form name="message" action="' . URL::admin('messages&amp;save=0') . '" method="post" enctype="multipart/form-data" accept-charset="utf-8">' . '<strong>' . _MESSAGETITLE . '</strong><br />' . '<input type="text" name="title" value="" size="50" maxlength="100" /><br /><br />' . '<strong>' . _MESSAGECONTENT . '</strong><br />' . bbcode_table('content', 'message', 1) . '<div style="float:left;">
	<textarea name="content" rows="15" wrap="virtual" cols="63" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);"></textarea></div>
	<div style="float: left; margin-left: 5px">' . smilies_table('inline', 'content', 'message') . '</div><br /><br />';
        if ($MAIN_CFG['global']['multilingual']) {
            echo '<strong>' . _LANGUAGE . '</strong> ' . lang_selectbox($MAIN_CFG['global']['language'], 'language') . '<br /><br />';
        } else {
            echo '<input type="hidden" name="language" value="" />';
        }
        echo '<strong>' . _EXPIRATION . '</strong> ' . select_box('expire', 0, array(86400 => '1 ' . _DAY, 172800 => '2 ' . _DAYS, 432000 => '5 ' . _DAYS, 1296000 => '15 ' . _DAYS, 2592000 => '30 ' . _DAYS, 0 => _UNLIMITED)) . '<br /><br />' . '<strong>' . _ACTIVATE2 . '</strong> ' . yesno_option('active', 1) . '<br /><br /><strong>' . _VIEWPRIV . '</strong> ' . group_selectbox('view', 0, true) . '<br /><br /><input type="submit" value="' . _ADDMSG . '" /></form>';
    }
}
CloseTable();
Пример #20
0
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("&amp;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&amp;mode=add') . '">' . _ADD . '</a> | <a href="' . URL::admin("Surveys&amp;mode=edit&amp;id={$poll_id}") . '">' . _EDIT . '</a> ]</center>';
    }
    return $holdtitle[0];
}
Пример #21
0
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 />&nbsp;<img src="images/news/print.gif" style="width:16px; height:11px;" alt="' . _PRINTER . '" title="' . _PRINTER . '" />&nbsp;&nbsp;<a href="' . URL::index('&amp;file=print&amp;sid=' . $sid) . '">' . _PRINTER . '</a><br /><br />';
if (can_admin('news')) {
    $content .= '<div style="text-align:center;"><b>' . _ADMIN . '</b><br />[ <a href="' . URL::admin('&amp;mode=add') . '">' . _ADD . '</a> | <a href="' . URL::admin('&amp;edit=' . $sid) . '">' . _EDIT . '</a> | <a href="' . URL::admin('&amp;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']);
}
Пример #22
0
            } else {
                mmcache_encode_file($source, $target, $force, $copy, 1);
            }
            if (empty($web_error)) {
                echo '<br /><b>DONE</b>';
                return;
            } else {
                $error = $web_error;
            }
        }
    }
}
echo '
<h1 align="center">Turck MMCache Encoder ' . MMCACHE_VERSION . '</h1>
<h3 align="center"><font color="#ff0000">' . $error . '</font></h3>
<form method="post" action="' . URL::admin() . '" enctype="multipart/form-data" accept-charset="utf-8">
<input type="hidden" name="mode" value="Encode" />
<table border="0" cellpadding="3" cellspacing="1" width="600" bgcolor="#000000" align="center">
<tr valign="baseline" bgcolor="#cccccc"><td width="50%" bgcolor="#ccccff"><b>Source file or directory name:</b></td><td width="50%"><input type="text" name="source" size="32" value="' . $source . '" style="width:100%" /></td></tr>
<tr valign="baseline" bgcolor="#cccccc"><td width="50%" bgcolor="#ccccff"><b>Target file or directory name:</b></td><td width="50%"><input type="text" name="target" size="32" value="' . $target . '" style="width:100%" /></td></tr>
<tr valign="baseline" bgcolor="#cccccc"><td width="50%" bgcolor="#ccccff"><b>PHP suffixies <small>(comma separated list)</small>:</b></td><td width="50%"><input type="text" name="suffixies" size="32" value="' . $suffixies . '" style="width:100%" /></td></tr>
<tr valign="baseline" bgcolor="#cccccc"><td width="50%" bgcolor="#ccccff"><b>Options:</b></td><td width="50%">
	<input type="checkbox" id="all" name="all"' . (empty($all) ? '' : ' checked="checked"') . ' /> - <label for="all">encode all files</label><br />
	<input type="checkbox" id="links" name="links"' . (empty($links) ? '' : ' checked="checked"') . ' /> - <label for="links">follow symbolic links</label><br />
	<input type="checkbox" id="recursive" name="recursive"' . (empty($recursive) ? '' : ' checked="checked"') . ' /> - <label for="recursive">encode directories recursively</label><br />
	<input type="checkbox" id="copy" name="copy"' . (empty($copy) ? '' : ' checked="checked"') . ' /> - <label for="copy">copy files those shouldn\'t be encoded</label><br />
	<input type="checkbox" id="force" name="force"' . (empty($force) ? '' : ' checked="checked"') . ' /> - <label for="force">overwrite existing files</label><br />
</td></tr>
<tr><td colspan="2" align="center" bgcolor="#cccccc"><input class="button" type="submit" name="submit" value="OK" /></td></tr>
</table>
</form>';
Пример #23
0
function run_ranks()
{
    global $db, $lang, $template, $op, $bgcolor1, $bgcolor2;
    if (isset($_GET['mode']) || isset($_POST['mode'])) {
        $mode = htmlprepare(isset($_GET['mode']) ? $_GET['mode'] : $_POST['mode']);
    } else {
        if (isset($_POST['add'])) {
            $mode = 'add';
        } else {
            if (isset($_POST['save'])) {
                $mode = 'save';
            } else {
                $mode = '';
            }
        }
    }
    if ($mode != '') {
        if ($mode == 'edit' || $mode == 'add') {
            //
            // They want to add a new rank, show the form.
            //
            $rank_id = isset($_GET['id']) ? intval($_GET['id']) : 0;
            $s_hidden_fields = '';
            if ($mode == 'edit') {
                if (empty($rank_id)) {
                    message_die(GENERAL_MESSAGE, $lang['Must_select_rank']);
                }
                $result = $db->sql_query("SELECT * FROM {$db->TBL->bbranks} WHERE rank_id = {$rank_id}");
                $rank_info = $db->sql_fetchrow($result);
                $s_hidden_fields .= '<input type="hidden" name="id" value="' . $rank_id . '" />';
            } else {
                $rank_info['rank_special'] = 0;
            }
            $s_hidden_fields .= '<input type="hidden" name="mode" value="save" />';
            $rank_is_special = $rank_info['rank_special'] ? "checked=\"checked\"" : "";
            $rank_is_not_special = !$rank_info['rank_special'] ? "checked=\"checked\"" : "";
            $template->set_filenames(array('body' => 'forums/admin/ranks_edit_body.html'));
            $template->assign_vars(array("RANK" => isset($rank_info['rank_title']) ? $rank_info['rank_title'] : '', "SPECIAL_RANK" => $rank_is_special, "NOT_SPECIAL_RANK" => $rank_is_not_special, "MINIMUM" => $rank_is_special ? "" : isset($rank_info['rank_min']) ? $rank_info['rank_min'] : '', "IMAGE" => isset($rank_info['rank_image']) && $rank_info['rank_image'] != "" ? $rank_info['rank_image'] : "", "IMAGE_DISPLAY" => isset($rank_info['rank_image']) && $rank_info['rank_image'] != "" ? '<img src="' . $rank_info['rank_image'] . '" alt="" />' : "", "L_RANKS_TITLE" => $lang['Ranks_title'], "L_RANKS_TEXT" => $lang['Ranks_explain'], "L_RANK_TITLE" => $lang['Rank_title'], "L_RANK_SPECIAL" => $lang['Rank_special'], "L_RANK_MINIMUM" => $lang['Rank_minimum'], "L_RANK_IMAGE" => $lang['Rank_image'], "L_RANK_IMAGE_EXPLAIN" => $lang['Rank_image_explain'], "L_SUBMIT" => $lang['Submit'], "L_RESET" => $lang['Reset'], "L_YES" => $lang['Yes'], "L_NO" => $lang['No'], "S_RANK_ACTION" => URL::admin("{$op}"), "S_HIDDEN_FIELDS" => $s_hidden_fields));
        } else {
            if ($mode == "save") {
                //
                // Ok, they sent us our info, let's update it.
                //
                $rank_id = isset($_POST['id']) ? intval($_POST['id']) : 0;
                $rank_title = isset($_POST['title']) ? trim($_POST['title']) : "";
                $special_rank = $_POST['special_rank'] == 1 ? TRUE : 0;
                $min_posts = isset($_POST['min_posts']) ? intval($_POST['min_posts']) : -1;
                $rank_image = isset($_POST['rank_image']) ? trim($_POST['rank_image']) : "";
                if ($rank_title == "") {
                    message_die(GENERAL_MESSAGE, $lang['Must_select_rank']);
                }
                if ($special_rank == 1) {
                    $max_posts = -1;
                    $min_posts = -1;
                }
                //
                // The rank image has to be a jpg, gif or png
                //
                if ($rank_image != "") {
                    if (!preg_match("/(\\.gif|\\.png|\\.jpg)\$/is", $rank_image)) {
                        $rank_image = "";
                    }
                }
                if ($rank_id) {
                    if (!$special_rank) {
                        $db->sql_query("UPDATE " . USERS_TABLE . " SET user_rank = 0 WHERE user_rank = {$rank_id}");
                    }
                    $sql = "UPDATE {$db->TBL->bbranks}\n\t\t\t\t\tSET rank_title = '" . Fix_Quotes($rank_title) . "', rank_special = {$special_rank}, rank_min = {$min_posts}, rank_image = '" . Fix_Quotes($rank_image) . "'\n\t\t\t\t\tWHERE rank_id = {$rank_id}";
                    $message = $lang['Rank_updated'];
                } else {
                    $sql = "INSERT INTO {$db->TBL->bbranks} (rank_title, rank_special, rank_min, rank_image)\n\t\t\t\t\tVALUES ('" . Fix_Quotes($rank_title) . "', {$special_rank}, {$min_posts}, '" . Fix_Quotes($rank_image) . "')";
                    $message = $lang['Rank_added'];
                }
                $db->sql_query($sql);
                $message .= "<br /><br />" . sprintf($lang['Click_return_rankadmin'], "<a href=\"" . URL::admin("{$op}") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . URL::admin($op) . "\">", "</a>");
                message_die(GENERAL_MESSAGE, $message);
            } else {
                if ($mode == "delete") {
                    //
                    // Ok, they want to delete their rank
                    //
                    if (isset($_POST['id']) || isset($_GET['id'])) {
                        $rank_id = isset($_POST['id']) ? intval($_POST['id']) : intval($_GET['id']);
                    } else {
                        $rank_id = 0;
                    }
                    if ($rank_id) {
                        $db->sql_query("DELETE FROM {$db->TBL->bbranks} WHERE rank_id = {$rank_id}");
                        $db->sql_query("UPDATE " . USERS_TABLE . " SET user_rank = 0 WHERE user_rank = {$rank_id}");
                        $message = $lang['Rank_removed'] . "<br /><br />" . sprintf($lang['Click_return_rankadmin'], "<a href=\"" . URL::admin("{$op}") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . URL::admin($op) . "\">", "</a>");
                        message_die(GENERAL_MESSAGE, $message);
                    } else {
                        message_die(GENERAL_MESSAGE, $lang['Must_select_rank']);
                    }
                } else {
                    //
                    // They didn't feel like giving us any information. Oh, too bad, we'll just display the
                    // list then...
                    //
                    $template->set_filenames(array('body' => 'forums/admin/ranks_list_body.html'));
                    $result = $db->sql_query("SELECT * FROM {$db->TBL->bbranks} ORDER BY rank_min, rank_title");
                    $rank_rows = $db->sql_fetchrowset($result);
                    $rank_count = count($rank_rows);
                    $template->assign_vars(array("L_RANKS_TITLE" => $lang['Ranks_title'], "L_RANKS_TEXT" => $lang['Ranks_explain'], "L_RANK" => $lang['Rank_title'], "L_RANK_MINIMUM" => $lang['Rank_minimum'], "L_SPECIAL_RANK" => $lang['Special_rank'], "L_EDIT" => $lang['Edit'], "L_DELETE" => $lang['Delete'], "L_ADD_RANK" => $lang['Add_new_rank'], "L_ACTION" => $lang['Action'], "S_RANKS_ACTION" => URL::admin("{$op}")));
                    for ($i = 0; $i < $rank_count; $i++) {
                        $rank = $rank_rows[$i]['rank_title'];
                        $special_rank = $rank_rows[$i]['rank_special'];
                        $rank_id = $rank_rows[$i]['rank_id'];
                        $rank_min = $rank_rows[$i]['rank_min'];
                        if ($special_rank) {
                            $rank_min = $rank_max = "-";
                        }
                        $row_color = !($i % 2) ? $bgcolor2 : $bgcolor1;
                        $row_class = !($i % 2) ? 'row1' : 'row2';
                        $template->assign_block_vars("ranks", array("ROW_COLOR" => $row_color, "ROW_CLASS" => $row_class, "RANK" => $rank, "RANK_MIN" => $rank_min, "SPECIAL_RANK" => $special_rank == 1 ? $lang['Yes'] : $lang['No'], "U_RANK_EDIT" => URL::admin("{$op}&amp;mode=edit&amp;id={$rank_id}"), "U_RANK_DELETE" => URL::admin("{$op}&amp;mode=delete&amp;id={$rank_id}")));
                    }
                }
            }
        }
    } else {
        //
        // Show the default page
        //
        $template->set_filenames(array('body' => 'forums/admin/ranks_list_body.html'));
        $result = $db->sql_query("SELECT * FROM {$db->TBL->bbranks} ORDER BY rank_min ASC, rank_special ASC");
        $rank_count = $db->sql_numrows($result);
        $rank_rows = $db->sql_fetchrowset($result);
        $template->assign_vars(array("L_RANKS_TITLE" => $lang['Ranks_title'], "L_RANKS_TEXT" => $lang['Ranks_explain'], "L_RANK" => $lang['Rank_title'], "L_RANK_MINIMUM" => $lang['Rank_minimum'], "L_SPECIAL_RANK" => $lang['Rank_special'], "L_EDIT" => $lang['Edit'], "L_DELETE" => $lang['Delete'], "L_ADD_RANK" => $lang['Add_new_rank'], "L_ACTION" => $lang['Action'], "S_RANKS_ACTION" => URL::admin($op)));
        for ($i = 0; $i < $rank_count; $i++) {
            $rank = $rank_rows[$i]['rank_title'];
            $special_rank = $rank_rows[$i]['rank_special'];
            $rank_id = $rank_rows[$i]['rank_id'];
            $rank_min = $rank_rows[$i]['rank_min'];
            if ($special_rank == 1) {
                $rank_min = $rank_max = "-";
            }
            $row_color = !($i % 2) ? $bgcolor2 : $bgcolor1;
            $row_class = !($i % 2) ? 'row1' : 'row2';
            $rank_is_special = $special_rank ? $lang['Yes'] : $lang['No'];
            $template->assign_block_vars("ranks", array("ROW_COLOR" => $row_color, "ROW_CLASS" => $row_class, "RANK" => $rank, "SPECIAL_RANK" => $rank_is_special, "RANK_MIN" => $rank_min, "U_RANK_EDIT" => URL::admin("{$op}&amp;mode=edit&amp;id={$rank_id}"), "U_RANK_DELETE" => URL::admin("{$op}&amp;mode=delete&amp;id={$rank_id}")));
        }
    }
    $template->display('body');
    CloseTable();
}
Пример #24
0
define('_MODULEUSERS', 'We\'re sorry, but we have reserved this area of our site for <i>registered users</i> only<br /><br />');
define('_MODULEUSERS2', 'You can register for free by following <a href="' . URL::index('Your_Account&amp;file=register') . '">this</a> link, thus granting you permission to access this area of our site.<br /><br />Thank you for your understanding');
define('_MODULESADMINS', 'We\'re sorry, but we have reserved this area of our site for <i>administrators</i> only<br /><br />Thank you for your understanding');
define('_MODULESGROUPS', 'group access required');
define('_HOME', 'Home');
define('_HOMEPROBLEM', 'It appears that the homepage has disappeared');
define('_ADDAHOME', 'Assign a new default homepage module');
define('_HOMEPROBLEMUSER', 'We\'re experiencing some difficulties with our system<br />Please check back soon');
define('_MORENEWS', 'More in News Section');
define('_ALLCATEGORIES', 'All Categories');
define('_SPAMGUARDPROTECTED', 'SpamGuard has blocked this email from being sent');
define('_M_CHARS', 'Maximum: %s characters');
define('_SYS_MESSAGE', 'System Message');
define('_SYS_MESSAGES', 'System Messages');
define('_SYS_MAINTENANCE', 'You are running under maintenance mode');
define('_SYS_DEMO', 'You are running under administration demo mode<br />You cannot make any changes to the database<br /><a href="' . URL::admin('logout') . '">Log me out!</a>');
define('_DATE', 'Date');
define('_HOUR', 'Hour');
define('_UMONTH', 'Month');
define('_YEAR', 'Year');
define('_JANUARY', 'January');
define('_FEBRUARY', 'February');
define('_MARCH', 'March');
define('_APRIL', 'April');
define('_MAY', 'May');
define('_JUNE', 'June');
define('_JULY', 'July');
define('_AUGUST', 'August');
define('_SEPTEMBER', 'September');
define('_OCTOBER', 'October');
define('_NOVEMBER', 'November');
Пример #25
0
</tr>';
    $submit = ' &nbsp;
	<input type="submit" name="send" value="' . _SEND . '&nbsp;' . _NEWSLETTER . '" class="mainoption"' . $status . ' /> &nbsp;
	<input type="submit" name="discard" value="' . _DISCARD . '" class="liteoption" />
	<input type="hidden" name="n_group" value="' . $group . '" />';
}
// Load the required wysiwyg class
require CORE_PATH . 'wysiwyg/wysiwyg.inc';
// Create as many wysiwyg instances as you need
$wysiwyg = new Wysiwyg('newsletter', 'content', '90%', '300px', $content);
// Set all the required wysiwyg headers
$wysiwyg->setHeader();
require 'header.php';
GraphicAdmin('_AMENU5');
OpenTable();
echo '<form name="newsletter" action="' . URL::admin() . '" method="post" enctype="multipart/form-data" accept-charset="utf-8">
' . $wysiwyg->getSelect() . '
<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline" style="margin:auto;">
<tr>
	<td align="center" class="catleft" colspan="2"><b><span class="gen">' . $title . '</span></b></td>
</tr>' . $preview . '<tr>
	<td class="row1"><span class="gen">' . _SUBJECT . '</span></td>
	<td class="row2"><input type="text" name="subject" size="50" maxlength="255" value="' . htmlprepare($subject) . '" /></td>
</tr><tr>
	<td class="row1"><span class="gen">' . _CONTENT . '</span></td>
	<td class="row2">' . $wysiwyg->getHTML() . '</td>
</tr><tr>
	<td class="row1"><span class="gen">' . _NL_RECIPS . '</span></td>
	<td class="row2">' . newsletter_selection('group', $group) . '</td>
</tr>' . $notes . '<tr>
	<td class="catbottom" colspan="2" align="center" height="28">
Пример #26
0
function adminlink($url = '', $full = false)
{
    depricated_warning();
    return URL::admin($url, $full);
}
Пример #27
0
             //
             $result = $db->sql_query("SELECT sum(filesize) as total_size FROM " . ATTACHMENTS_DESC_TABLE . " WHERE attach_id IN (" . implode(', ', $attach_id) . ")");
             $row = $db->sql_fetchrow($result);
             $members[$i]['total_size'] = $row['total_size'];
         }
         if ($mode == 'filesize') {
             $members = sort_multi_array($members, 'total_size', $sort_order, FALSE);
             $members = limit_array($members, $start, $board_config['topics_per_page']);
         }
         for ($i = 0; $i < count($members); $i++) {
             $username = $members[$i]['username'];
             $total_attachments = $members[$i]['total_attachments'];
             $total_size = $members[$i]['total_size'];
             $row_color = !($i % 2) ? $bgcolor2 : $bgcolor1;
             $row_class = !($i % 2) ? 'row1' : 'row2';
             $template->assign_block_vars('memberrow', array('ROW_NUMBER' => $i + ($_GET['start'] + 1), 'ROW_COLOR' => $row_color, 'ROW_CLASS' => $row_class, 'USERNAME' => $username, 'TOTAL_ATTACHMENTS' => $total_attachments, 'TOTAL_SIZE' => round($total_size / MEGABYTE, 2), 'U_VIEW_MEMBER' => URL::admin('&amp;do=attach_cp&amp;view=attachments&amp;uid=' . $members[$i]['user_id'])));
         }
     }
     $result = $db->sql_query("SELECT user_id_1 FROM " . ATTACHMENTS_TABLE . " GROUP BY user_id_1");
     $total_rows = $db->sql_numrows($result);
 } else {
     if ($view == 'attachments') {
         $user_based = !empty($uid) ? TRUE : FALSE;
         $search_based = $_POST['search'] ? TRUE : FALSE;
         $hidden_fields = '';
         $template->set_filenames(array('body' => 'forums/admin/attach_cp_attachments.html'));
         $template->assign_vars(array('L_SELECT_SORT_METHOD' => $lang['Select_sort_method'], 'L_ORDER' => $lang['Order'], 'L_FILENAME' => $lang['File_name'], 'L_FILECOMMENT' => $lang['File_comment_cp'], 'L_EXTENSION' => $lang['Extension'], 'L_SIZE' => $lang['Size_in_kb'], 'L_DOWNLOADS' => $lang['Downloads'], 'L_POST_TIME' => $lang['Post_time'], 'L_POSTED_IN_TOPIC' => $lang['Posted_in_topic'], 'L_DELETE' => $lang['Delete'], 'L_DELETE_MARKED' => $lang['Delete_marked'], 'L_SUBMIT_CHANGES' => $lang['Submit_changes'], 'L_MARK_ALL' => $lang['Mark_all'], 'L_UNMARK_ALL' => $lang['Unmark_all'], 'S_MODE_SELECT' => $select_sort_mode, 'S_ORDER_SELECT' => $select_sort_order));
         $total_rows = 0;
         //
         // Are we called from Username ?
         //
Пример #28
0
            $data .= "\n\$indexes['{$table}'] = array(\n";
            foreach ($index as $name => $val) {
                $data .= "{$space}'{$name}' => array('unique' => " . intval($val['unique']) . ", 'type' => '{$val['type']}',\n";
                $cols = $val['columns'];
                $n = count($cols);
                for ($i = 0; $i < $n; ++$i) {
                    $data .= "{$space} {$i} => array('name' => '{$cols[$i]['name']}', 'Sub_part' => '', 'Null' => 0)";
                    if ($i + 1 < $n) {
                        $data .= ",\n";
                    } else {
                        $data .= "),\n";
                    }
                }
            }
            $data .= ");\n";
            $data .= "*/";
            file_write($filename, $data);
        }
        URL::redirect(URL::admin('cache'));
        break;
    default:
        require_once 'header.php';
        GraphicAdmin('_AMENU0');
        $cpgtpl->assign_vars(array('U_ACTION' => URL::admin(), 'S_DBTYPE' => DB_TYPE, 'S_DATABASE' => $dbname, 'ZLIB' => extension_loaded('zlib')));
        foreach ($tablelist as $table) {
            $cpgtpl->assign_block_vars('tables', array('S_NAME' => $table));
        }
        $cpgtpl->set_handle('body', 'admin/database.html');
        $cpgtpl->display('body');
        break;
}
Пример #29
0
                if (isset($_POST['id']) || isset($_GET['id'])) {
                    $word_id = isset($_POST['id']) ? $_POST['id'] : $_GET['id'];
                    $word_id = intval($word_id);
                } else {
                    $word_id = 0;
                }
                if ($word_id) {
                    $db->sql_query("DELETE FROM " . WORDS_TABLE . " WHERE word_id = {$word_id}");
                    $message = $lang['Word_removed'] . "<br /><br />" . sprintf($lang['Click_return_wordadmin'], "<a href=\"" . URL::admin("&amp;do=words") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . URL::admin($op) . "\">", "</a>");
                    message_die(GENERAL_MESSAGE, $message);
                } else {
                    message_die(GENERAL_MESSAGE, $lang['No_word_selected']);
                }
            }
        }
    }
} else {
    $template->set_filenames(array('body' => 'forums/admin/words_list_body.html'));
    $result = $db->sql_query("SELECT * FROM " . WORDS_TABLE . " ORDER BY word");
    $word_rows = $db->sql_fetchrowset($result);
    $word_count = count($word_rows);
    $template->assign_vars(array("L_WORDS_TITLE" => $lang['Words_title'], "L_WORDS_TEXT" => $lang['Words_explain'], "L_WORD" => $lang['Word'], "L_REPLACEMENT" => $lang['Replacement'], "L_EDIT" => $lang['Edit'], "L_DELETE" => $lang['Delete'], "L_ADD_WORD" => $lang['Add_new_word'], "L_ACTION" => $lang['Action'], "S_WORDS_ACTION" => URL::admin("&amp;do=words"), "S_HIDDEN_FIELDS" => ''));
    for ($i = 0; $i < $word_count; $i++) {
        $word = $word_rows[$i]['word'];
        $replacement = $word_rows[$i]['replacement'];
        $word_id = $word_rows[$i]['word_id'];
        $row_color = !($i % 2) ? $bgcolor2 : $bgcolor1;
        $row_class = !($i % 2) ? 'row1' : 'row2';
        $template->assign_block_vars("words", array("ROW_COLOR" => $row_color, "ROW_CLASS" => $row_class, "WORD" => $word, "REPLACEMENT" => $replacement, "U_WORD_EDIT" => URL::admin("&amp;do=words&amp;mode=edit&amp;id={$word_id}"), "U_WORD_DELETE" => URL::admin("&amp;do=words&amp;mode=delete&amp;id={$word_id}")));
    }
}
Пример #30
0
                //and display them
                while (list($key, $val) = each($topic_icons)) {
                    $template->assign_block_vars('catrow.forumrow.icon', array('ICON_SRC' => $val['icon_url'], 'U_REMOVE_ICON' => URL::admin("&amp;do=topic_icons&amp;remove=true&amp;id=" . $val['icon_id'])));
                }
            }
            // if ... forumid == catid
        }
        // for ... forums
    }
    // for ... categories
}
// if ... total_categories
//get global custom icons
$topic_icons = get_topic_icons(-1, false);
//and display them
while (list($key, $val) = each($topic_icons)) {
    $template->assign_block_vars('globalicon', array('ICON_SRC' => $val['icon_url'], 'U_REMOVE_GLOBAL_ICON' => URL::admin("&amp;do=topic_icons&amp;remove=true&amp;id=" . $val['icon_id'])));
}
$template->set_filenames(array('body' => 'forums/admin/topic_icons_select_body.html'));
$lang_icons_admin['display001'] = 'Topic Icons';
$lang_icons_admin['display002'] = 'This page allows you to add and remove topic icons from your forums. To add an icon, check the box for each forum you wish to add the icon to, and fill in the details at the bottom of this page. To remove an icon, click on it. This will also remove that icon from all topics using that icon, which may be quite a big change so you will need to give confirmation. Removing an icon is not reversible - you may want to take a database backup first.';
$lang_icons_admin['display003'] = 'Forum Icons';
$lang_icons_admin['display004'] = 'Add';
$lang_icons_admin['display005'] = 'Global Icons';
$lang_icons_admin['add001'] = 'Add an icon';
$lang_icons_admin['add002'] = 'Icon path (from root) EG \'images/icons/icon1.gif\'';
$lang_icons_admin['add003'] = 'Icon name';
$lang_icons_admin['add004'] = "Global?";
$lang_icons_admin['add005'] = 'Add icon';
$template->assign_vars(array('L_TITLE' => $lang_icons_admin['display001'], 'L_INSTRUCTIONS' => $lang_icons_admin['display002'], 'L_FORUM_TITLE' => $lang_icons_admin['display003'], 'L_FORUM_ADD' => $lang_icons_admin['display004'], 'L_GLOBAL_ICONS_TEXT' => $lang_icons_admin['display005'], 'L_ADD_TITLE' => $lang_icons_admin['add001'], 'L_ADD_PATH' => $lang_icons_admin['add002'], 'L_ADD_NAME' => $lang_icons_admin['add003'], 'L_ADD_GLOBAL' => $lang_icons_admin['add004'], 'L_ADD' => $lang_icons_admin['add005'], 'S_ACTION' => URL::admin("&amp;do=topic_icons")));