本文整理汇总了PHP中USES_lib_admin函数的典型用法代码示例。如果您正苦于以下问题:PHP USES_lib_admin函数的具体用法?PHP USES_lib_admin怎么用?PHP USES_lib_admin使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了USES_lib_admin函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PAYPAL_history
/**
* Purchase History View.
* Displays the purchase history for the current user. Admins
* can view any user's histor, or all users
*
* @param boolean $admin True if called for admin access, False otherwise
* @param integer $uid User ID to view, current user by default
* @return string HTML for order list
*/
function PAYPAL_history($admin = false, $uid = '')
{
global $_CONF, $_PP_CONF, $_TABLES, $LANG_PP, $_USER;
// Not available to anonymous users
if (COM_isAnonUser()) {
return '';
}
USES_lib_admin();
$isAdmin = $admin == true ? 1 : 0;
$sql = "SELECT \n p.*, UNIX_TIMESTAMP(p.expiration) AS exptime, \n d.name, d.short_description, d.file, d.prod_type,\n {$isAdmin} as isAdmin, \n u.uid, u.username\n FROM {$_TABLES['paypal.purchases']} AS p \n LEFT JOIN {$_TABLES['paypal.products']} AS d \n ON d.id = p.product_id \n LEFT JOIN {$_TABLES['users']} AS u \n ON p.user_id = u.uid ";
$base_url = PAYPAL_ADMIN_URL;
if (!$isAdmin) {
$where = " WHERE p.user_id = '" . (int) $_USER['uid'] . "'";
$base_url = PAYPAL_URL;
} elseif (!empty($uid)) {
$where = " WHERE p.user_id = '" . (int) $uid . "'";
}
$header_arr = array(array('text' => $LANG_PP['product_id'], 'field' => 'name', 'sort' => true), array('text' => $LANG_PP['qty'], 'field' => 'quantity', 'sort' => true), array('text' => $LANG_PP['description'], 'field' => 'short_description', 'sort' => true), array('text' => $LANG_PP['purch_date'], 'field' => 'purchase_date', 'sort' => true), array('text' => $LANG_PP['txn_id'], 'field' => 'txn_id', 'sort' => true), array('text' => $LANG_PP['expiration'], 'field' => 'expiration', 'sort' => true), array('text' => $LANG_PP['prod_type'], 'field' => 'prod_type', 'sort' => true));
if ($isAdmin) {
$header_arr[] = array('text' => $LANG_PP['username'], 'field' => 'username', 'sort' => true);
}
$defsort_arr = array('field' => 'p.purchase_date', 'direction' => 'DESC');
$display = COM_startBlock('', '', COM_getBlockTemplate('_admin_block', 'header'));
$query_arr = array('table' => 'paypal.purchases', 'sql' => $sql, 'query_fields' => array('d.name', 'd.short_description', 'p.txn_id'), 'default_filter' => $where);
$text_arr = array('has_extras' => true, 'form_url' => $base_url . '/index.php?history=x');
if (!isset($_REQUEST['query_limit'])) {
$_GET['query_limit'] = 20;
}
$display .= ADMIN_list('paypal', 'PAYPAL_getPurchaseHistoryField', $header_arr, $text_arr, $query_arr, $defsort_arr);
$display .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
return $display;
}
示例2: forum_admin_list
function forum_admin_list()
{
global $_TABLES, $LANG_ADMIN, $LANG_GF00, $LANG_GF91, $LANG_GF06, $_CONF, $_FF_CONF;
USES_lib_admin();
$retval = '';
$selected = '';
$menu_arr = array();
$admin_list = new Template($_CONF['path'] . 'plugins/forum/templates/admin/');
$admin_list->set_file('admin-list', 'index.thtml');
$admin_list->set_var('block_start', COM_startBlock($LANG_GF91['gfstats']));
$menu_arr = FF_adminNav($LANG_GF06['1']);
$admin_list->set_var('admin_menu', ADMIN_createMenu($menu_arr, $LANG_GF00['instructions'], $_CONF['site_url'] . '/forum/images/forum.png'));
// CATEGORIES
$numcats = DB_query("SELECT id FROM {$_TABLES['ff_categories']}");
$totalcats = DB_numRows($numcats);
// FORUMS
$numforums = DB_query("SELECT forum_id FROM {$_TABLES['ff_forums']}");
$totalforums = DB_numRows($numforums);
// TOPICS
$numtopics = DB_query("SELECT id FROM {$_TABLES['ff_topic']} WHERE pid = 0");
$totaltopics = DB_numRows($numtopics);
// POSTS
$numposts = DB_query("SELECT id FROM {$_TABLES['ff_topic']}");
$totalposts = DB_numRows($numposts);
// VIEWS
$numviews = DB_query("SELECT SUM(views) AS TOTAL FROM {$_TABLES['ff_topic']}");
$totalviews = DB_fetchArray($numviews);
// AVERAGE POSTS
if ($totalposts != 0) {
$avgcposts = $totalposts / $totalcats;
$avgcposts = round($avgcposts);
$avgfposts = $totalposts / $totalforums;
$avgfposts = round($avgfposts);
$avgtposts = $totalposts / $totaltopics;
$avgtposts = round($avgtposts);
} else {
$avgcposts = 0;
$avgfposts = 0;
$avgtposts = 0;
}
// AVERAGE VIEWS
if ($totalviews['TOTAL'] != 0) {
$avgcviews = $totalviews['TOTAL'] / $totalcats;
$avgcviews = round($avgcviews);
$avgfviews = $totalviews['TOTAL'] / $totalforums;
$avgfviews = round($avgfviews);
$avgtviews = $totalviews['TOTAL'] / $totaltopics;
$avgtviews = round($avgtviews);
} else {
$avgcviews = 0;
$avgfviews = 0;
$avgtviews = 0;
}
$admin_list->set_var(array('statsmsg' => $LANG_GF91['statsmsg'], 'totalcatsmsg' => $LANG_GF91['totalcats'], 'totalcats' => $totalcats, 'totalforumsmsg' => $LANG_GF91['totalforums'], 'totalforums' => $totalforums, 'totaltopicsmsg' => $LANG_GF91['totaltopics'], 'totaltopics' => $totaltopics, 'totalpostsmsg' => $LANG_GF91['totalposts'], 'totalposts' => $totalposts, 'totalviewsmsg' => $LANG_GF91['totalviews'], 'totalviews' => $totalviews['TOTAL'], 'category' => $LANG_GF91['category'], 'forum' => $LANG_GF91['forum'], 'topic' => $LANG_GF91['topic'], 'avgpmsg' => $LANG_GF91['avgpmsg'], 'avgcposts' => $avgcposts, 'avgfposts' => $avgfposts, 'avgtposts' => $avgtposts, 'avgvmsg' => $LANG_GF91['avgvmsg'], 'avgcviews' => $avgcviews, 'avgfviews' => $avgfviews, 'avgtviews' => $avgtviews));
$admin_list->set_var('block_end', COM_endBlock());
$admin_list->parse('output', 'admin-list');
$retval .= $admin_list->finish($admin_list->get_var('output'));
return $retval;
}
示例3: DBADMIN_list
/**
* List all backups, i.e. all files ending in .sql
*
* @return string HTML for the list of files or an error when not writable
*
*/
function DBADMIN_list()
{
global $_CONF, $_TABLES, $_IMAGE_TYPE, $LANG08, $LANG_ADMIN, $LANG_DB_BACKUP;
USES_lib_admin();
$retval = '';
if (is_writable($_CONF['backup_path'])) {
$backups = array();
$fd = opendir($_CONF['backup_path']);
$index = 0;
while (false !== ($file = @readdir($fd))) {
if ($file != '.' && $file != '..' && $file != 'CVS' && preg_match('/\\.sql$/i', $file)) {
$index++;
clearstatcache();
$backups[] = $file;
}
}
// AS, 2004-03-29 - Sort backup files by date, newest first.
// Order given by 'readdir' might not be correct.
usort($backups, 'DBADMIN_compareBackupFiles');
$data_arr = array();
$thisUrl = $_CONF['site_admin_url'] . '/database.php';
$diskIconUrl = $_CONF['layout_url'] . '/images/admin/disk.' . $_IMAGE_TYPE;
$attr['title'] = $LANG_DB_BACKUP['download'];
$alt = $LANG_DB_BACKUP['download'];
$num_backups = count($backups);
for ($i = 0; $i < $num_backups; $i++) {
$downloadUrl = $thisUrl . '?download=x&file=' . urlencode($backups[$i]);
$downloadLink = COM_createLink(COM_createImage($diskIconUrl, $alt, $attr), $downloadUrl, $attr);
$downloadLink .= ' ';
$attr['style'] = 'vertical-align:top;';
$downloadLink .= COM_createLink($backups[$i], $downloadUrl, $attr);
$backupfile = $_CONF['backup_path'] . $backups[$i];
$backupfilesize = COM_numberFormat(filesize($backupfile)) . ' <b>' . $LANG_DB_BACKUP['bytes'] . '</b>';
$data_arr[$i] = array('file' => $downloadLink, 'size' => $backupfilesize, 'filename' => $backups[$i]);
}
$token = SEC_createToken();
$menu_arr = array(array('url' => $_CONF['site_admin_url'] . '/database.php?backup=x&' . CSRF_TOKEN . '=' . $token, 'text' => $LANG_ADMIN['create_new']), array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
$retval .= COM_startBlock($LANG_DB_BACKUP['last_ten_backups'], '', COM_getBlockTemplate('_admin_block', 'header'));
$retval .= ADMIN_createMenu($menu_arr, "<p>{$LANG_DB_BACKUP['db_explanation']}</p>" . '<p>' . sprintf($LANG_DB_BACKUP['total_number'], $index) . '</p>', $_CONF['layout_url'] . '/images/icons/database.' . $_IMAGE_TYPE);
$header_arr = array(array('text' => $LANG_DB_BACKUP['backup_file'], 'field' => 'file'), array('text' => $LANG_DB_BACKUP['size'], 'field' => 'size'));
$text_arr = array('form_url' => $thisUrl);
$form_arr = array('bottom' => '', 'top' => '');
if ($num_backups > 0) {
$form_arr['bottom'] = '<input type="hidden" name="delete" value="x"' . XHTML . '>' . '<input type="hidden" name="' . CSRF_TOKEN . '" value="' . $token . '"' . XHTML . '>' . LB;
}
$options = array('chkselect' => true, 'chkminimum' => 0, 'chkfield' => 'filename');
$retval .= ADMIN_simpleList('', $header_arr, $text_arr, $data_arr, $options, $form_arr);
$retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
} else {
$retval .= COM_startBlock($LANG08[06], '', COM_getBlockTemplate('_msg_block', 'header'));
$retval .= $LANG_DB_BACKUP['no_access'];
COM_errorLog($_CONF['backup_path'] . ' is not writable.', 1);
$retval .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
}
return $retval;
}
示例4: _listUsers
function _listUsers()
{
global $LANG28, $_CONF, $_TABLES, $LANG_ADMIN, $LANG_GF98;
USES_lib_admin();
$retval = '';
$header_arr = array(array('text' => $LANG_GF98['uid'], 'field' => 'uid', 'sort' => true), array('text' => $LANG28[3], 'field' => 'username', 'sort' => true), array('text' => $LANG28[4], 'field' => 'fullname', 'sort' => true), array('text' => $LANG28[7], 'field' => 'email', 'sort' => true), array('text' => $LANG_GF98['rating'], 'field' => 'rating', 'sort' => true));
$defsort_arr = array('field' => $_TABLES['users'] . '.uid', 'direction' => 'ASC');
$text_arr = array('has_extras' => true, 'form_url' => $_CONF['site_admin_url'] . '/plugins/forum/userrating.php', 'help_url' => '');
$sql = "SELECT {$_TABLES['users']}.uid, username,fullname,email,status,rating FROM {$_TABLES['users']} LEFT JOIN {$_TABLES['ff_userinfo']} on {$_TABLES['users']}.uid={$_TABLES['ff_userinfo']}.uid";
$query_arr = array('table' => 'users', 'sql' => $sql, 'query_fields' => array($_TABLES['users'] . '.username', $_TABLES['users'] . '.email', $_TABLES['users'] . '.fullname'), 'default_filter' => " WHERE {$_TABLES['users']}.uid > 1");
$form_arr = array('bottom' => '<div style="text-align:center;padding:5px;"><input type="submit" value="submit" name="submit" /></div>');
$retval .= ADMIN_list('user', 'ADMIN_getListField_ratings', $header_arr, $text_arr, $query_arr, $defsort_arr, '', '', '', $form_arr);
return $retval;
}
示例5: POLLS_pollList
/**
* Shows all polls in system
*
* List all the polls on the system if no $pid is provided
*
* @return string HTML for poll listing
*
*/
function POLLS_pollList()
{
global $_CONF, $_TABLES, $_USER, $_PO_CONF, $LANG25, $LANG_LOGIN, $LANG_POLLS;
$retval = '';
if (COM_isAnonUser() && ($_CONF['loginrequired'] == 1 || $_PO_CONF['pollsloginrequired'] == 1)) {
$retval .= SEC_loginRequiredForm();
} else {
USES_lib_admin();
$header_arr = array(array('text' => $LANG25[9], 'field' => 'topic', 'sort' => true), array('text' => $LANG25[20], 'field' => 'voters', 'sort' => true, 'align' => 'center'), array('text' => $LANG25[3], 'field' => 'unixdate', 'sort' => true, 'align' => 'center'), array('text' => $LANG_POLLS['open_poll'], 'field' => 'is_open', 'sort' => true, 'align' => 'center'));
$defsort_arr = array('field' => 'unixdate', 'direction' => 'desc');
$text_arr = array('has_menu' => false, 'title' => $LANG_POLLS['pollstitle'], 'instructions' => "", 'icon' => '', 'form_url' => '');
$query_arr = array('table' => 'polltopics', 'sql' => $sql = "SELECT *,UNIX_TIMESTAMP(date) AS unixdate, display " . "FROM {$_TABLES['polltopics']} WHERE 1=1", 'query_fields' => array('topic'), 'default_filter' => COM_getPermSQL(), 'query' => '', 'query_limit' => 0);
$retval .= ADMIN_list('polls', 'POLLS_getListField', $header_arr, $text_arr, $query_arr, $defsort_arr, '', $token = 'dummy');
}
return $retval;
}
示例6: EXP_adminList
/**
* Build the admin list of pages
* @return string HTML content
*/
function EXP_adminList()
{
global $_CONF, $_TABLES, $LANG_ADMIN, $LANG_ACCESS, $_CONF_EXP, $LANG_EX00;
USES_lib_admin();
$retval = '';
$header_arr = array(array('text' => $LANG_ADMIN['edit'], 'field' => 'edit', 'sort' => false), array('text' => 'Page ID', 'field' => 'exid', 'sort' => true), array('text' => 'Title', 'field' => 'title', 'sort' => true), array('text' => 'URL', 'field' => 'url', 'sort' => true), array('text' => 'Hits', 'field' => 'hits', 'sort' => true));
$menu_arr = array(array('url' => $_CONF['site_admin_url'] . '/plugins/' . $_CONF_EXP['pi_name'] . '/edit.php?exid=0', 'text' => 'Add New'), array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
$defsort_arr = array('field' => 'exid', 'direction' => 'asc');
$header_str = $LANG_EX00['header'] . ' ' . $LANG_EX00['version'] . ' ' . $_CONF_EXP['pi_version'];
$retval .= COM_startBlock($header_str, '', COM_getBlockTemplate('_admin_block', 'header'));
$retval .= ADMIN_createMenu($menu_arr, 'Administer External Pages', plugin_geticon_external());
$text_arr = array('has_extras' => true, 'form_url' => "{$_CONF['site_admin_url']}/plugins/{$_CONF_EXP['pi_name']}/index.php");
$query_arr = array('table' => 'external', 'sql' => "SELECT * FROM {$_TABLES['external']} ", 'query_fields' => array('title', 'url'), 'default_filter' => COM_getPermSql());
$retval .= ADMIN_list('external', 'EXP_getAdminListField', $header_arr, $text_arr, $query_arr, $defsort_arr, '', '', '', $form_arr);
$retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
return $retval;
}
示例7: _listUserVotes
function _listUserVotes($uid)
{
global $LANG28, $_CONF, $_TABLES, $LANG_ADMIN, $LANG_GF98;
USES_lib_admin();
$retval = '';
$header_arr = array(array('text' => 'User Rated', 'field' => 'user_id', 'sort' => false), array('text' => 'Grade', 'field' => 'grade', 'sort' => false), array('text' => 'Topic', 'field' => 'topic_id', 'sort' => false));
$defsort_arr = array('field' => 'user_id', 'direction' => 'ASC');
$text_arr = array('has_extras' => false, 'form_url' => $_CONF['site_admin_url'] . '/plugins/forum/userrating_detail.php', 'help_url' => '');
$sql = "SELECT * FROM {$_TABLES['ff_rating_assoc']} WHERE voter_id = " . $uid;
$query_arr = array('table' => 'ff_rating_assoc', 'sql' => $sql, 'query_fields' => array('uid'), 'default_filter' => " WHERE voter_id = " . $uid);
$retval .= ADMIN_list('user', 'ADMIN_getListField_ratings', $header_arr, $text_arr, $query_arr, $defsort_arr);
return $retval;
}
示例8: MAIL_displayForm
/**
* Shows the form the admin uses to send glFusion members a message. Now you
* can email a user or an entire group depending upon whether uid or grp_id is
* set. if both arguments are >0, the group send function takes precedence
*
* @return string HTML for the email form
*
*/
function MAIL_displayForm($uid = 0, $grp_id = 0, $from = '', $replyto = '', $subject = '', $message = '')
{
global $_CONF, $_TABLES, $_USER, $LANG31, $LANG03, $LANG_ADMIN;
USES_lib_admin();
$retval = '';
if (isset($_POST['postmode'])) {
$postmode = COM_applyFilter($_POST['postmode']);
if ($postmode != 'html' || $postmode != 'plaintext') {
$postmode = $_CONF['postmode'];
}
} else {
$postmode = $_CONF['postmode'];
}
$mail_templates = new Template($_CONF['path_layout'] . 'admin/mail');
$mail_templates->set_file('form', 'mailform.thtml');
if ($postmode == 'html') {
$mail_templates->set_var('show_htmleditor', true);
} else {
$mail_templates->unset_var('show_htmleditor');
}
$mail_templates->set_var('postmode', $postmode);
$mail_templates->set_var('lang_postmode', $LANG03[2]);
$mail_templates->set_var('postmode_options', COM_optionList($_TABLES['postmodes'], 'code,name', $postmode));
$mail_templates->set_var('startblock_email', COM_startBlock($LANG31[1], '', COM_getBlockTemplate('_admin_block', 'header')));
$mail_templates->set_var('php_self', $_CONF['site_admin_url'] . '/mail.php');
$usermode = $uid > 0 && $grp_id == 0 ? true : false;
$send_to_group = $usermode ? '' : '1';
$mail_templates->set_var('send_to_group', $send_to_group);
$menu_arr = array(array('url' => $_CONF['site_admin_url'] . '/user.php', 'text' => $LANG_ADMIN['admin_users']), array('url' => $_CONF['site_admin_url'] . '/group.php', 'text' => $LANG_ADMIN['admin_groups']), array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
$instructions = $usermode ? $LANG31[28] : $LANG31[19];
$icon = $_CONF['layout_url'] . '/images/icons/mail.png';
$admin_menu = ADMIN_createMenu($menu_arr, $instructions, $icon);
$mail_templates->set_var('admin_menu', $admin_menu);
if ($usermode) {
// we're sending e-Mail to a specific user
$mail_templates->set_var('lang_instructions', $LANG31[28]);
$mail_templates->set_var('lang_to', $LANG31[18]);
$to_user = '';
$lang_warning = $LANG31[29];
$warning = '';
// get the user data, and check the privacy settings
$result = DB_query("SELECT username,fullname,email FROM {$_TABLES['users']} WHERE uid = " . (int) $uid);
$nrows = DB_numRows($result);
if ($nrows > 0) {
$A = DB_fetchArray($result);
$username = $_CONF['show_fullname'] ? $A['fullname'] : $A['username'];
$to_user = $username . ' (' . $A['email'] . ')';
$emailfromadmin = DB_getItem($_TABLES['userprefs'], 'emailfromadmin', "uid = " . (int) $uid);
$warning = $emailfromadmin == 1 ? '' : $LANG31[30];
}
$mail_templates->set_var('to_user', $to_user);
$mail_templates->set_var('to_uid', $uid);
$mail_templates->set_var('lang_warning', $lang_warning);
$mail_templates->set_var('warning', $warning);
} else {
// we're sending e-Mail to a group of users
$mail_templates->set_var('lang_instructions', $LANG31[19]);
$mail_templates->set_var('lang_to', $LANG31[27]);
$mail_templates->set_var('lang_selectgroup', $LANG31[25]);
// build group options select, allow for possibility grp_id has been supplied
$group_options = '';
$result = DB_query("SELECT grp_id, grp_name FROM {$_TABLES['groups']} WHERE grp_name <> 'All Users'");
$nrows = DB_numRows($result);
$groups = array();
for ($i = 0; $i < $nrows; $i++) {
$A = DB_fetchArray($result);
$groups[$A['grp_id']] = ucwords($A['grp_name']);
}
asort($groups);
foreach ($groups as $groupID => $groupName) {
if (SEC_inGroup('Root') || SEC_inGroup($groupName) && $groupName != 'Logged-in Users' && $groupName != 'Mail Admin') {
$group_options .= '<option value="' . $groupID . '"';
$group_options .= $groupID == $grp_id ? ' selected="selected"' : '';
$group_options .= '>' . $groupName . '</option>';
}
}
$mail_templates->set_var('group_options', $group_options);
}
$mail_templates->set_var('lang_from', $LANG31[2]);
$frm = empty($from) ? $_CONF['site_name'] : $from;
$mail_templates->set_var('site_name', $frm);
$mail_templates->set_var('lang_replyto', $LANG31[3]);
$rto = empty($replyto) ? $_CONF['site_mail'] : $replyto;
$mail_templates->set_var('site_mail', $rto);
$mail_templates->set_var('lang_subject', $LANG31[4]);
$mail_templates->set_var('subject', $subject);
$mail_templates->set_var('lang_body', $LANG31[5]);
$mail_templates->set_var('message_text', $message);
$mail_templates->set_var('message_html', $message);
$mail_templates->set_var('lang_sendto', $LANG31[6]);
$mail_templates->set_var('lang_allusers', $LANG31[7]);
$mail_templates->set_var('lang_admin', $LANG31[8]);
//.........这里部分代码省略.........
示例9: FEED_newFeed
/**
* Create a new feed. This is an extra step to take once you have a plugin
* installed that supports the new Feed functions in the Plugin API. This
* will let you select for which plugin (or glFusion) you're creating the feed.
*
* @return string HTML for the complete page (selection or feed editor)
*
*/
function FEED_newFeed()
{
global $_CONF, $LANG33, $LANG_ADMIN, $_IMAGE_TYPE;
USES_lib_admin();
$retval = '';
$plugins = PLG_supportingFeeds();
if (sizeof($plugins) == 0) {
// none of the installed plugins are supporting feeds
// - go directly to the feed editor
$retval = COM_siteHeader('menu', $LANG33[11]) . FEED_edit(0, 'article') . COM_siteFooter();
} else {
$selection = '<select name="type">' . LB;
$selection .= '<option value="article">' . $LANG33[55] . '</option>' . LB;
foreach ($plugins as $p) {
$selection .= '<option value="' . $p . '">' . ucwords($p) . '</option>' . LB;
}
$selection .= '</select>' . LB;
$menu_arr = array(array('url' => $_CONF['site_admin_url'] . '/syndication.php', 'text' => $LANG33[57]), array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
$feed_template = new Template($_CONF['path_layout'] . 'admin/syndication');
$feed_template->set_file('type', 'selecttype.thtml');
$feed_template->set_var('type_selection', $selection);
$feed_template->set_var('lang_explain', $LANG33[54]);
$feed_template->set_var('lang_go', $LANG33[1]);
$retval .= COM_siteHeader('menu', $LANG33[11]);
$retval .= COM_startBlock($LANG33[36], '', COM_getBlockTemplate('_admin_block', 'header'));
$retval .= ADMIN_createMenu($menu_arr, $LANG33[54], $_CONF['layout_url'] . '/images/icons/syndication.' . $_IMAGE_TYPE);
$retval .= $feed_template->finish($feed_template->parse('output', 'type'));
$retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
$retval .= COM_siteFooter();
}
return $retval;
}
示例10: X_EVLIST_adminRSVP
function X_EVLIST_adminRSVP($rp_id)
{
global $LANG_EVLIST, $LANG_ADMIN, $_TABLES;
USES_lib_admin();
USES_evlist_class_repeat();
$Ev = new evRepeat($rp_id);
if ($Ev->rp_id == 0) {
return '';
}
$sql = "SELECT rsvp_id, uid, rp_id, FROM_UNIXTIME(dt_reg) as dt\n FROM {$_TABLES['evlist_rsvp']}\n WHERE ev_id = '{$Ev->Event->id}' ";
$title = $LANG_EVLIST['pi_title'] . ': ' . $LANG_EVLIST['admin_rsvp'] . ' -- ' . COM_createLink($Ev->Event->Detail->title . ' (' . $Ev->date_start . ')', EVLIST_URL . '/event.php?eid=' . $rp_id);
if ($Ev->Event->options['use_rsvp'] == EV_RSVP_REPEAT) {
$sql .= " rp_id = '{$Ev->rp_id}' ";
}
$defsort_arr = array('field' => 'dt_reg', 'direction' => 'ASC');
$text_arr = array('has_menu' => false, 'has_extras' => false, 'title' => $title, 'form_url' => EVLIST_ADMIN_URL . '/index.php?rp_id=' . $rp_id, 'help_url' => '');
$query_arr = array('table' => 'evlist_calendars', 'sql' => $sql);
$header_arr = array(array('text' => $LANG_EVLIST['date'], 'field' => 'dt', 'sort' => true), array('text' => 'Name', 'field' => 'uid', 'sort' => false));
$options_arr = array('chkdelete' => true, 'chkfield' => 'rsvp_id', 'chkname' => 'delrsvp');
$retval .= ADMIN_list('evlist', 'EVLIST_getField_rsvp', $header_arr, $text_arr, $query_arr, $defsort_arr, '', '', $options_arr);
return $retval;
}
示例11: processPluginUpload
//.........这里部分代码省略.........
return processOldPlugin($tmp);
}
if (!isset($pluginData['id']) || !isset($pluginData['version'])) {
return processOldPlugin($tmp);
}
// proper glfusion version
if (!COM_checkVersion(GVERSION, $pluginData['glfusionversion'])) {
_pi_deleteDir($_CONF['path_data'] . $tmp);
return _pi_errorBox(sprintf($LANG32[49], $pluginData['glfusionversion']));
}
if (!COM_checkVersion(phpversion(), $pluginData['phpversion'])) {
$retval .= sprintf($LANG32[50], $pluginData['phpversion']);
_pi_deleteDir($_CONF['path_data'] . $tmp);
return _pi_errorBox(sprintf($LANG32[50], $pluginData['phpversion']));
}
// check prerequisites
$errors = '';
if (isset($pluginData['requires']) && is_array($pluginData['requires'])) {
foreach ($pluginData['requires'] as $reqPlugin) {
list($reqPlugin, $required_ver) = explode(',', $reqPlugin);
if (!isset($_PLUGIN_INFO[$reqPlugin])) {
// required plugin not installed
$errors .= sprintf($LANG32[51], $pluginData['id'], $reqPlugin, $reqPlugin);
} elseif (!empty($required_ver)) {
$installed_ver = $_PLUGIN_INFO[$reqPlugin];
if (!COM_checkVersion($installed_ver, $required_ver)) {
// required plugin installed, but wrong version
$errors .= sprintf($LANG32[90], $required_ver, $reqPlugin, $installed_ver, $reqPlugin);
}
}
}
}
if ($errors != '') {
_pi_deleteDir($_CONF['path_data'] . $tmp);
return _pi_errorBox($errors);
}
// check if plugin already exists
// if it does, check that this is an upgrade
// if not, error
// else validate we really want to upgrade
$result = DB_query("SELECT * FROM {$_TABLES['plugins']} WHERE pi_name='" . DB_escapeString($pluginData['id']) . "'");
if (DB_numRows($result) > 0) {
$P = DB_fetchArray($result);
if ($P['pi_version'] == $pluginData['version']) {
_pi_deleteDir($_CONF['path_data'] . $tmp);
return _pi_errorBox(sprintf($LANG32[52], $pluginData['id']));
}
// if we are here, it must be an upgrade or disabled plugin....
$rc = COM_checkVersion($pluginData['version'], $P['pi_version']);
if ($rc < 1) {
_pi_deleteDir($_CONF['path_data'] . $tmp);
return _pi_errorBox(sprintf($LANG32[53], $pluginData['id'], $pluginData['version'], $P['pi_version']));
}
if ($P['pi_enabled'] != 1) {
_pi_deleteDir($_CONF['path_data'] . $tmp);
return _pi_errorBox($LANG32[72]);
}
$upgrade = true;
}
$permError = 0;
$permErrorList = '';
if (function_exists('set_time_limit')) {
@set_time_limit(30);
}
// test copy to proper directories
list($rc, $failed) = _pi_test_copy($_CONF['path_data'] . $tmp . '/' . $pluginData['id'] . '/', $_CONF['path'] . 'plugins/' . $pluginData['id']);
if ($rc > 0) {
$permError = 1;
foreach ($failed as $filename) {
$permErrorList .= sprintf($LANG32[41], $filename);
}
}
list($rc, $failed) = _pi_test_copy($_CONF['path_data'] . $tmp . '/' . $pluginData['id'] . '/admin/', $_CONF['path_html'] . 'admin/plugins/' . $pluginData['id']);
if ($rc > 0) {
$permError = 1;
foreach ($failed as $filename) {
$permErrorList .= sprintf($LANG32[41], $filename);
}
}
list($rc, $failed) = _pi_test_copy($_CONF['path_data'] . $tmp . '/' . $pluginData['id'] . '/public_html/', $_CONF['path_html'] . $pluginData['id']);
if ($rc > 0) {
$permError = 1;
foreach ($failed as $filename) {
$permErrorList .= sprintf($LANG32[41], $filename);
}
}
if ($permError != 0) {
$errorMessage = '<h2>' . $LANG32[42] . '</h2>' . $LANG32[43] . $permErrorList . '<br />' . $LANG32[44];
_pi_deleteDir($_CONF['path_data'] . $tmp);
return _pi_errorBox($errorMessage);
}
USES_lib_admin();
$menu_arr = array(array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
$T = new Template($_CONF['path_layout'] . 'admin/plugins');
$T->set_file('form', 'plugin_upload_confirm.thtml');
$T->set_var('admin_menu', ADMIN_createMenu($menu_arr, $pluginData['id'] . ' ' . $LANG32[62], $_CONF['layout_url'] . '/images/icons/plugins.' . $_IMAGE_TYPE));
$T->set_var(array('form_action_url' => $_CONF['site_admin_url'] . '/plugin_upload.php', 'action' => 'processupload', 'pi_name' => $pluginData['id'], 'pi_version' => $pluginData['version'], 'pi_url' => $pluginData['url'], 'pi_gl_version' => $pluginData['glfusionversion'], 'pi_desc' => $pluginData['description'], 'pi_author' => $pluginData['author'], 'plugin_old_version' => $P['pi_version'], 'upgrade' => $upgrade, 'temp_dir' => $tmp));
$retval .= $T->parse('output', 'form');
return $retval;
}
示例12: USER_batchAdmin
/**
* This function allows the batch deletion of users that are inactive
* It shows the form that will filter user that will be deleted
*
* @return string HTML Form
*/
function USER_batchAdmin()
{
global $_CONF, $_TABLES, $LANG_ADMIN, $LANG01, $LANG28, $_IMAGE_TYPE;
$display = '';
USES_lib_admin();
$usr_type = '';
if (isset($_REQUEST['usr_type'])) {
$usr_type = COM_applyFilter($_REQUEST['usr_type']);
} else {
$usr_type = 'phantom';
}
if (!in_array($usr_type, array('phantom', 'old', 'recent', 'short'))) {
$usr_type = 'phantom';
}
$usr_time_arr = array();
$usr_time = '';
$usr_time_arr['phantom'] = 2;
$usr_time_arr['short'] = 6;
$usr_time_arr['old'] = 24;
$usr_time_arr['recent'] = 1;
if (isset($_POST['usr_time'])) {
$usr_time_arr = $_POST['usr_time'];
} elseif (isset($_GET['usr_time'])) {
$usr_time_arr[$usr_type] = $_GET['usr_time'];
} else {
$usr_time_arr['phantom'] = 2;
$usr_time_arr['short'] = 6;
$usr_time_arr['old'] = 24;
$usr_time_arr['recent'] = 1;
}
$usr_time = $usr_time_arr[$usr_type];
// list of options for user display
// sel => form-id
// desc => title
// txt1 => text before input-field
// txt2 => text after input field
$opt_arr = array(array('sel' => 'phantom', 'desc' => $LANG28[57], 'txt1' => $LANG28[60], 'txt2' => $LANG28[61]), array('sel' => 'short', 'desc' => $LANG28[58], 'txt1' => $LANG28[62], 'txt2' => $LANG28[63]), array('sel' => 'old', 'desc' => $LANG28[59], 'txt1' => $LANG28[64], 'txt2' => $LANG28[65]), array('sel' => 'recent', 'desc' => $LANG28[74], 'txt1' => $LANG28[75], 'txt2' => $LANG28[76]));
$user_templates = new Template($_CONF['path_layout'] . 'admin/user');
$user_templates->set_file(array('form' => 'batchadmin.thtml', 'options' => 'batchadmin_options.thtml'));
$user_templates->set_var('site_admin_url', $_CONF['site_admin_url']);
$user_templates->set_var('layout_url', $_CONF['layout_url']);
$user_templates->set_var('usr_type', $usr_type);
$user_templates->set_var('usr_time', $usr_time);
$user_templates->set_var('lang_instruction', $LANG28[56]);
$user_templates->set_var('lang_updatelist', $LANG28[66]);
$num_opts = count($opt_arr);
for ($i = 0; $i < $num_opts; $i++) {
$selector = '';
if ($usr_type == $opt_arr[$i]['sel']) {
$selector = ' checked="checked"';
}
$user_templates->set_var('sel_id', $opt_arr[$i]['sel']);
$user_templates->set_var('selector', $selector);
$user_templates->set_var('lang_description', $opt_arr[$i]['desc']);
$user_templates->set_var('lang_text_start', $opt_arr[$i]['txt1']);
$user_templates->set_var('lang_text_end', $opt_arr[$i]['txt2']);
$user_templates->set_var('id_value', $usr_time_arr[$opt_arr[$i]['sel']]);
$user_templates->parse('options_list', 'options', true);
}
$user_templates->parse('form', 'form');
$desc = $user_templates->finish($user_templates->get_var('form'));
$header_arr = array(array('text' => $LANG28[3], 'field' => 'username', 'sort' => true), array('text' => $LANG28[4], 'field' => 'fullname', 'sort' => true));
switch ($usr_type) {
case 'phantom':
$header_arr[] = array('text' => $LANG28[14], 'field' => 'regdate', 'sort' => true, 'align' => 'center');
$header_arr[] = array('text' => $LANG28[41], 'field' => 'lastlogin_short', 'sort' => true, 'align' => 'center');
$header_arr[] = array('text' => $LANG28[67], 'field' => 'phantom_date', 'sort' => true, 'align' => 'center');
$list_sql = ", UNIX_TIMESTAMP()- UNIX_TIMESTAMP(regdate) as phantom_date";
$filter_sql = "lastlogin = 0 AND UNIX_TIMESTAMP()- UNIX_TIMESTAMP(regdate) > " . $usr_time * 2592000 . " AND";
$sort = 'regdate';
break;
case 'short':
$header_arr[] = array('text' => $LANG28[14], 'field' => 'regdate', 'sort' => true, 'align' => 'center');
$header_arr[] = array('text' => $LANG28[41], 'field' => 'lastlogin_short', 'sort' => true, 'align' => 'center');
$header_arr[] = array('text' => $LANG28[68], 'field' => 'online_hours', 'sort' => true, 'align' => 'center');
$header_arr[] = array('text' => $LANG28[69], 'field' => 'offline_months', 'sort' => true, 'align' => 'center');
$list_sql = ", (lastlogin - UNIX_TIMESTAMP(regdate)) AS online_hours, (UNIX_TIMESTAMP() - lastlogin) AS offline_months";
$filter_sql = "lastlogin > 0 AND lastlogin - UNIX_TIMESTAMP(regdate) < 86400 " . "AND UNIX_TIMESTAMP() - lastlogin > " . $usr_time * 2592000 . " AND";
$sort = 'lastlogin';
break;
case 'old':
$header_arr[] = array('text' => $LANG28[41], 'field' => 'lastlogin_short', 'sort' => true, 'align' => 'center');
$header_arr[] = array('text' => $LANG28[69], 'field' => 'offline_months', 'sort' => true, 'align' => 'center');
$list_sql = ", (UNIX_TIMESTAMP() - lastlogin) AS offline_months";
$filter_sql = "lastlogin > 0 AND (UNIX_TIMESTAMP() - lastlogin) > " . $usr_time * 2592000 . " AND";
$sort = 'lastlogin';
break;
case 'recent':
$header_arr[] = array('text' => $LANG28[14], 'field' => 'regdate', 'sort' => true, 'align' => 'center');
$header_arr[] = array('text' => $LANG28[41], 'field' => 'lastlogin_short', 'sort' => true, 'align' => 'center');
$list_sql = "";
$filter_sql = "(UNIX_TIMESTAMP() - UNIX_TIMESTAMP(regdate)) < " . $usr_time * 2592000 . " AND";
$sort = 'regdate';
break;
//.........这里部分代码省略.........
示例13: PAGE_list
function PAGE_list()
{
global $_CONF, $_TABLES, $_IMAGE_TYPE, $LANG_ADMIN, $LANG_ACCESS, $LANG_STATIC;
USES_lib_admin();
$retval = '';
$menu_arr = array(array('url' => $_CONF['site_admin_url'] . '/plugins/staticpages/index.php?edit=x', 'text' => $LANG_ADMIN['create_new']), array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
$retval .= COM_startBlock($LANG_STATIC['staticpagelist'], '', COM_getBlockTemplate('_admin_block', 'header'));
$retval .= ADMIN_createMenu($menu_arr, $LANG_STATIC['instructions'], plugin_geticon_staticpages());
$header_arr = array(array('text' => $LANG_ADMIN['edit'], 'field' => 'edit', 'sort' => false, 'align' => 'center'), array('text' => $LANG_ADMIN['copy'], 'field' => 'copy', 'sort' => false, 'align' => 'center'), array('text' => $LANG_STATIC['id'], 'field' => 'sp_id', 'sort' => true), array('text' => $LANG_ADMIN['title'], 'field' => 'sp_title', 'sort' => true), array('text' => $LANG_STATIC['head_centerblock'], 'field' => 'sp_centerblock', 'sort' => true, 'align' => 'center'), array('text' => $LANG_STATIC['writtenby'], 'field' => 'sp_uid', 'sort' => true), array('text' => $LANG_ACCESS['access'], 'field' => 'access', 'sort' => false, 'align' => 'center'), array('text' => $LANG_STATIC['date'], 'field' => 'unixdate', 'sort' => true, 'align' => 'center'), array('text' => $LANG_ADMIN['delete'], 'field' => 'delete', 'sort' => false, 'align' => 'center'), array('text' => $LANG_ADMIN['enabled'], 'field' => 'sp_status', 'sort' => true, 'align' => 'center'));
$defsort_arr = array('field' => 'sp_title', 'direction' => 'asc');
$text_arr = array('has_extras' => true, 'form_url' => $_CONF['site_admin_url'] . '/plugins/staticpages/index.php');
// sql query which drives the list
$sql = "SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate " . "FROM {$_TABLES['staticpage']} WHERE 1=1 ";
$query_arr = array('table' => 'staticpage', 'sql' => $sql, 'query_fields' => array('sp_title', 'sp_id'), 'default_filter' => COM_getPermSQL('AND'));
// create the security token, and embed it in the list form
// also set the hidden var which signifies that this list allows for pages
// to be enabled/disabled via checkbox
$token = SEC_createToken();
$form_arr = array('top' => '<input type="hidden" name="' . CSRF_TOKEN . '" value="' . $token . '"/>', 'bottom' => '<input type="hidden" name="staticpageenabler" value="true"/>');
$retval .= ADMIN_list('static_pages', 'PAGE_getListField', $header_arr, $text_arr, $query_arr, $defsort_arr, '', $token, '', $form_arr);
$retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
$outputHandle = outputHandler::getInstance();
$outputHandle->addLinkScript($_CONF['site_url'] . '/javascript/admin.js', HEADER_PRIO_NORMAL, 'text/javascript');
return $retval;
}
示例14: TOPIC_list
/**
* Displays a list of topics
*
* Lists all the topics and their icons.
*
* @return string HTML for the topic list
*
*/
function TOPIC_list()
{
global $_CONF, $_TABLES, $LANG27, $LANG_ACCESS, $LANG_ADMIN, $_IMAGE_TYPE;
USES_lib_admin();
$retval = '';
$menu_arr = array(array('url' => $_CONF['site_admin_url'] . '/topic.php?edit=x', 'text' => $LANG_ADMIN['create_new']), array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
$retval .= COM_startBlock($LANG27[8], '', COM_getBlockTemplate('_admin_block', 'header'));
$retval .= ADMIN_createMenu($menu_arr, $LANG27[9], $_CONF['layout_url'] . '/images/icons/topic.' . $_IMAGE_TYPE);
$header_arr = array(array('text' => $LANG_ADMIN['edit'], 'field' => 'edit', 'sort' => false, 'align' => 'center', 'width' => '35px'), array('text' => $LANG27[10], 'field' => 'sortnum', 'sort' => true, 'align' => 'center'), array('text' => $LANG27[2], 'field' => 'tid', 'sort' => true), array('text' => $LANG27[3], 'field' => 'topic', 'sort' => true), array('text' => $LANG27[38], 'field' => 'is_default', 'sort' => false, 'align' => 'center'), array('text' => $LANG27[39], 'field' => 'archive_flag', 'sort' => false, 'align' => 'center'), array('text' => $LANG27[11], 'field' => 'limitnews', 'sort' => false, 'align' => 'center'), array('text' => $LANG27[35], 'field' => 'sort_by', 'sort' => false, 'align' => 'center', 'nowrap' => 'true'), array('text' => $LANG27[37], 'field' => 'sort_dir', 'sort' => false, 'align' => 'center'), array('text' => $LANG_ADMIN['delete'], 'field' => 'delete', 'sort' => false, 'align' => 'center', 'width' => '35px'));
$defsort_arr = array('field' => 'sortnum', 'direction' => 'asc');
$text_arr = array('has_extras' => true, 'form_url' => $_CONF['site_admin_url'] . '/topic.php');
$query_arr = array('table' => 'topics', 'sql' => "SELECT * FROM {$_TABLES['topics']} WHERE 1=1", 'query_fields' => array('tid', 'topic'), 'default_filter' => COM_getPermSql('AND'));
$token = SEC_createToken();
$form_arr = array('bottom' => '<input type="hidden" name="' . CSRF_TOKEN . '" value="' . $token . '"/>');
$retval .= ADMIN_list('topics', 'TOPIC_getListField', $header_arr, $text_arr, $query_arr, $defsort_arr, '', $token, '', $form_arr);
$retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
return $retval;
}
示例15: SI_get_site
/**
* Display admin list of site memberships for social follow for the site
*
* Displays all available social services for the site
*
* @return string HTML to display
*
*/
function SI_get_site()
{
global $_CONF, $_TABLES, $LANG_ADMIN, $LANG_SOCIAL;
USES_lib_admin();
$retval = '';
// if an social admin is using this page, offer navigation to the admin page(s)
if (SEC_hasRights('social.admin')) {
$menu_arr = array(array('url' => $_CONF['site_admin_url'] . '/social.php', 'text' => $LANG_SOCIAL['social_share']), array('url' => $_CONF['site_admin_url'] . '/social.php?list=f', 'text' => $LANG_SOCIAL['social_follow']), array('url' => $_CONF['site_admin_url'] . '/index.php', 'text' => $LANG_ADMIN['admin_home']));
} else {
$menu_arr = array();
}
$cfg =& config::get_instance();
$_SOCIAL = $cfg->get_config('social_internal');
$extra = '';
if (isset($_SOCIAL['social_site_extra'])) {
$extra = $_SOCIAL['social_site_extra'];
}
$T = new Template($_CONF['path_layout'] . 'admin/social');
$T->set_file('page', 'site_social.thtml');
$T->set_var('start_block', COM_startBlock($LANG_SOCIAL['site_memberships'], '', COM_getBlockTemplate('_admin_block', 'header')));
$T->set_var('admin_menu', ADMIN_createMenu($menu_arr, $LANG_SOCIAL['membership_instructions'], $_CONF['layout_url'] . '/images/icons/share.png'));
$T->set_var('end_block', COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer')));
$T->set_block('page', 'social_links', 'sl');
$follow_me = SOC_followMeProfile(-1);
if (is_array($follow_me) && count($follow_me) > 0) {
foreach ($follow_me as $service) {
$T->set_var(array('service_display_name' => $service['service_display_name'], 'service' => $service['service'], 'service_username' => $service['service_username'], 'service_url' => $service['service_url']));
$T->parse('sl', 'social_links', true);
}
}
$T->set_var(array('security_token_name' => CSRF_TOKEN, 'security_token' => SEC_createToken(), 'extra' => $extra, 'lang_service_name' => $LANG_SOCIAL['service_name'], 'lang_service_url' => $LANG_SOCIAL['service_url'], 'lang_site_username' => $LANG_SOCIAL['site_username'], 'lang_additional_html' => $LANG_SOCIAL['additional_html'], 'lang_save' => $LANG_ADMIN['save'], 'lang_cancel' => $LANG_ADMIN['cancel'], 'form_action' => $_CONF['site_admin_url'] . '/social.php'));
$retval = $T->finish($T->parse('output', 'page'));
return $retval;
}