本文整理匯總了PHP中ADMIN_simpleList函數的典型用法代碼示例。如果您正苦於以下問題:PHP ADMIN_simpleList函數的具體用法?PHP ADMIN_simpleList怎麽用?PHP ADMIN_simpleList使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ADMIN_simpleList函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: LINK_CAT_list
function LINK_CAT_list($root)
{
global $_CONF, $_TABLES, $_USER, $_IMAGE_TYPE, $LANG_ADMIN, $LANG_ACCESS, $LANG_LINKS_ADMIN, $LANG_LINKS, $_LI_CONF;
require_once $_CONF['path_system'] . 'lib-admin.php';
$retval = '';
$header_arr = array(array('text' => $LANG_ADMIN['edit'], 'field' => 'edit', 'sort' => false, 'align' => 'center', 'width' => '25px'), array('text' => $LANG_LINKS_ADMIN[41], 'field' => 'addchild', 'sort' => false, 'align' => 'center', 'width' => '25px'), array('text' => $LANG_LINKS_ADMIN[30], 'field' => 'category', 'sort' => true), array('text' => $LANG_LINKS_ADMIN[33], 'field' => 'tid', 'sort' => true, 'align' => 'center'), array('text' => $LANG_LINKS_ADMIN[61], 'field' => 'owner', 'sort' => true, 'align' => 'center'), array('text' => $LANG_ACCESS['access'], 'field' => 'access', 'sort' => false, 'align' => 'center'), array('text' => $LANG_LINKS_ADMIN[62], 'field' => 'unixdate', 'sort' => true, 'align' => 'center'), array('text' => $LANG_ADMIN['delete'], 'field' => 'delete', 'sort' => false, 'align' => 'center', 'width' => '25px'));
$defsort_arr = array('field' => 'category', 'direction' => 'asc');
$menu_arr = array(array('url' => $_CONF['site_admin_url'] . '/plugins/links/category.php?edit=x', 'text' => $LANG_LINKS_ADMIN[52]), array('url' => $_CONF['site_admin_url'] . '/plugins/links/index.php', 'text' => $LANG_LINKS_ADMIN[53]), array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
$retval .= COM_startBlock($LANG_LINKS_ADMIN[54], '', COM_getBlockTemplate('_admin_block', 'header'));
$retval .= ADMIN_createMenu($menu_arr, $LANG_LINKS_ADMIN[12], plugin_geticon_links());
$text_arr = array('has_extras' => true, 'form_url' => $_CONF['site_admin_url'] . '/plugins/links/category.php');
$dummy = array();
$data_arr = LINK_CAT_list_recursive($dummy, $_LI_CONF['root'], 0);
$retval .= ADMIN_simpleList('plugin_getListField_categories', $header_arr, $text_arr, $data_arr);
$retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
return $retval;
}
示例2: banner_list_categories
function banner_list_categories($root)
{
global $_CONF, $_TABLES, $_USER, $_IMAGE_TYPE, $LANG_ADMIN, $LANG_ACCESS, $LANG_BANNER_ADMIN, $LANG_BANNER, $_BAN_CONF;
require_once $_CONF['path_system'] . 'lib-admin.php';
$retval = '';
$header_arr = array(array('text' => $LANG_ADMIN['edit'], 'field' => 'edit', 'sort' => false), array('text' => $LANG_BANNER_ADMIN[44], 'field' => 'addchild', 'sort' => false), array('text' => $LANG_BANNER_ADMIN[30], 'field' => 'bannercategory', 'sort' => true), array('text' => $LANG_ACCESS['access'], 'field' => 'access', 'sort' => false), array('text' => $LANG_BANNER_ADMIN[33], 'field' => 'tid', 'sort' => true));
$defsort_arr = array('field' => 'category', 'direction' => 'asc');
$menu_arr = array(array('url' => $_CONF['site_admin_url'] . '/plugins/banner/index.php', 'text' => $LANG_BANNER_ADMIN[53]), array('url' => $_CONF['site_admin_url'] . '/plugins/banner/index.php?mode=edit', 'text' => $LANG_BANNER_ADMIN[51]), array('url' => $_CONF['site_admin_url'] . '/plugins/banner/index.php?validate=enabled', 'text' => $LANG_BANNER_ADMIN[26]), array('url' => $_CONF['site_admin_url'] . '/plugins/banner/bannercategory.php', 'text' => $LANG_BANNER_ADMIN[50]), array('url' => $_CONF['site_admin_url'] . '/plugins/banner/bannercategory.php?mode=edit', 'text' => $LANG_BANNER_ADMIN[52]), array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
$retval .= COM_startBlock($LANG_BANNER_ADMIN[54], '', COM_getBlockTemplate('_admin_block', 'header'));
$retval .= ADMIN_createMenu($menu_arr, $LANG_BANNER_ADMIN[12], plugin_geticon_banner());
$text_arr = array('has_extras' => true, 'form_url' => $_CONF['site_admin_url'] . '/plugins/banner/bannercategory.php');
$dummy = array();
$data_arr = banner_list_categories_recursive($dummy, $_BAN_CONF['root'], 0);
$retval .= ADMIN_simpleList('plugin_getListField_bannercategories', $header_arr, $text_arr, $data_arr);
$retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
return $retval;
}
示例3: draftlist
/**
* Displays a list of all the stories that have the 'draft' flag set.
*
* When enabled, this will list all the stories that have been marked as
* 'draft'. Approving a story from this list will clear the draft flag and
* thus publish the story.
*
* @param string $token CSRF token
* @return string HTML for the list of draft stories
*
*/
function draftlist($token)
{
global $_CONF, $_TABLES, $LANG24, $LANG29, $LANG_ADMIN;
require_once $_CONF['path_system'] . 'lib-admin.php';
$retval = '';
$result = DB_query("SELECT sid AS id,title,UNIX_TIMESTAMP(date) AS day,tid FROM {$_TABLES['stories']} WHERE (draft_flag = 1)" . COM_getTopicSQL('AND') . COM_getPermSQL('AND', 0, 3) . " ORDER BY date ASC");
$nrows = DB_numRows($result);
$data_arr = array();
for ($i = 0; $i < $nrows; $i++) {
$A = DB_fetchArray($result);
$A['edit'] = $_CONF['site_admin_url'] . '/story.php?mode=edit&sid=' . $A['id'];
$A['row'] = $i;
$A['title'] = stripslashes($A['title']);
$A['tid'] = stripslashes($A['tid']);
$data_arr[$i] = $A;
}
$header_arr = array(array('text' => $LANG_ADMIN['edit'], 'field' => 0), array('text' => $LANG29[10], 'field' => 'title'), array('text' => $LANG29[14], 'field' => 'day'), array('text' => $LANG29[15], 'field' => 'tid'), array('text' => $LANG29[2], 'field' => 'delete'), array('text' => $LANG29[1], 'field' => 'approve'));
$text_arr = array('has_menu' => false, 'title' => $LANG29[35] . ' (' . $LANG24[34] . ')', 'help_url' => '', 'no_data' => $LANG29[39], 'form_url' => "{$_CONF['site_admin_url']}/moderation.php");
$form_arr = array("bottom" => '', "top" => '');
if ($nrows > 0) {
$form_arr['bottom'] = '<input type="hidden" name="type" value="draft"' . XHTML . '>' . LB . '<input type="hidden" name="' . CSRF_TOKEN . '" value="' . $token . '"' . XHTML . '>' . LB . '<input type="hidden" name="mode" value="moderation"' . XHTML . '>' . LB . '<input type="hidden" name="count" value="' . $nrows . '"' . XHTML . '>' . '<p align="center"><input type="submit" value="' . $LANG_ADMIN['submit'] . '"' . XHTML . '></p>' . LB;
}
$listoptions = array('chkdelete' => true, 'chkfield' => 'id');
$table = ADMIN_simpleList('ADMIN_getListField_moderation', $header_arr, $text_arr, $data_arr, $listoptions, $form_arr);
$retval .= $table;
return $retval;
}
示例4: TMCE_getAdminConfigList
function TMCE_getAdminConfigList()
{
global $_CONF, $_TABLES;
$fieldfunction = 'TMCE_adminConfigFieldFunction';
$header_arr = array(array('text' => TMCE_str('admin_edit'), 'field' => 'cid', 'sort' => FALSE), array('text' => TMCE_str('admin_title'), 'field' => 'title', 'sort' => FALSE), array('text' => TMCE_str('admin_theme'), 'field' => 'theme', 'sort' => FALSE), array('text' => TMCE_str('admin_grp_name'), 'field' => 'grp_name', 'sort' => FALSE));
$text_arr = array('form_url' => $_CONF['site_admin_url'] . '/plugins/tinymce/index.php');
$data_arr = array();
$sql = "SELECT cid, title, theme, grp_name " . "FROM {$_TABLES['tinymce_configs']} " . "LEFT JOIN {$_TABLES['groups']} " . "ON group_id = grp_id ";
$result = DB_query($sql);
if (!DB_error()) {
while (($A = DB_fetchArray($result, FALSE)) !== FALSE) {
$data_arr[] = $A;
}
}
$options = array('chkdelete' => FALSE);
$form_arr = array();
return ADMIN_simpleList($fieldfunction, $header_arr, $text_arr, $data_arr, $options, $form_arr);
}
示例5: show_newplugins
/**
* Creates list of uninstalled plugins (if any) and offers install link to them.
*
* @param string $token Security token to use in list
* @return string HTML containing list of uninstalled plugins
*
*/
function show_newplugins($token)
{
global $_CONF, $_TABLES, $LANG32;
require_once $_CONF['path_system'] . 'lib-admin.php';
$plugins = array();
$plugins_dir = $_CONF['path'] . 'plugins/';
$fd = opendir($plugins_dir);
$index = 1;
$retval = '';
$data_arr = array();
while (($dir = @readdir($fd)) == TRUE) {
if ($dir != '.' && $dir != '..' && $dir != 'CVS' && substr($dir, 0, 1) != '.' && is_dir($plugins_dir . $dir)) {
clearstatcache();
// Check and see if this plugin is installed - if there is a record.
// If not then it's a new plugin
if (DB_count($_TABLES['plugins'], 'pi_name', $dir) == 0) {
$plugin_ok = false;
$plugin_new_style = false;
// additionally, check if a 'functions.inc' exists
if (file_exists($plugins_dir . $dir . '/functions.inc')) {
// new plugins will have a autoinstall.php
if (file_exists($plugins_dir . $dir . '/autoinstall.php')) {
$plugin_ok = true;
$plugin_new_style = true;
} else {
// and finally, since we're going to link to it, check
// if an install script exists
$adminurl = $_CONF['site_admin_url'];
if (strrpos($adminurl, '/') == strlen($adminurl)) {
$adminurl = substr($adminurl, 0, -1);
}
$pos = strrpos($adminurl, '/');
if ($pos === false) {
// didn't work out - use the URL
$admindir = $_CONF['site_admin_url'];
} else {
$admindir = $_CONF['path_html'] . substr($adminurl, $pos + 1);
}
$fh = @fopen($admindir . '/plugins/' . $dir . '/install.php', 'r');
if ($fh) {
fclose($fh);
$plugin_ok = true;
$plugin_new_style = false;
}
}
if ($plugin_ok) {
if ($plugin_new_style) {
$url = $_CONF['site_admin_url'] . '/plugins.php' . '?mode=autoinstall&plugin=' . $dir;
} else {
$url = $_CONF['site_admin_url'] . '/plugins/' . $dir . '/install.php?action=install';
}
$url .= '&' . CSRF_TOKEN . '=' . $token;
$data_arr[] = array('pi_name' => $dir, 'pi_display_name' => plugin_get_pluginname($dir), 'pi_gl_version' => '', 'number' => $index, 'install_link' => $url);
$index++;
}
}
}
}
}
$header_arr = array(array('text' => $LANG32[59], 'field' => 'info_uninstalled'), array('text' => $LANG32[16], 'field' => 'pi_display_name'), array('text' => $LANG32[17], 'field' => 'pi_version'), array('text' => $LANG32[50], 'field' => 'pi_dependencies'), array('text' => $LANG32[22], 'field' => 'install_link'));
$text_arr = array('title' => $LANG32[14]);
$retval .= ADMIN_simpleList('ADMIN_getListField_newplugins', $header_arr, $text_arr, $data_arr);
return $retval;
}
示例6: closedir
}
closedir($dir);
}
$header_arr = array(array('text' => $LANG_SX00['plugin'], 'field' => 'title'), array('text' => $LANG33[30], 'field' => 'regdate'), array('text' => $LANG_SX00['action'], 'field' => 'edit'));
$data_arr = array();
foreach ($files as $file) {
require_once $_CONF['path'] . 'plugins/spamx/' . $file . '.Admin.class.php';
$CM = new $file();
$action = 'Edit';
$link = $CM->linkText;
$regdate = '-';
if (strpos($link, 'Edit ') !== false) {
$link = substr($link, 5);
$regdate = DB_getItem($_TABLES['spamx'], 'regdate', "name = '{$CM->moduleName}' ORDER BY regdate DESC ");
} else {
$action = 'View';
}
$data_arr[] = array('title' => $link, 'regdate' => $regdate, 'edit' => COM_createLink($LANG_SX00[strtolower($action)], $_CONF['site_admin_url'] . '/plugins/spamx/index.php?command=' . $file));
}
$data_arr[] = array('title' => $LANG_SX00['documentation'], 'regdate' => '-', 'edit' => COM_createLink($LANG_SX00['view'], plugin_getdocumentationurl_spamx('index')));
$display .= ADMIN_simpleList(null, $header_arr, null, $data_arr);
if (isset($_REQUEST['command'])) {
$cmd = COM_applyFilter($_REQUEST['command']);
if (!empty($cmd) && in_array($cmd, $files)) {
$CM = new $cmd();
$display .= $CM->display();
}
}
$display .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
$display = COM_createHTMLDocument($display, array('pagetitle' => $LANG_SX00['plugin_name']));
COM_output($display);
示例7: listblocks
/**
* Display two lists of blocks, separated by left and right
*
* @return string HTML for the two lists
*
*/
function listblocks()
{
global $_CONF, $_TABLES, $LANG_ADMIN, $LANG21, $_IMAGE_TYPE;
require_once $_CONF['path_system'] . 'lib-admin.php';
$retval = '';
$token = SEC_createToken();
// writing the menu on top
$menu_arr = array(array('url' => $_CONF['site_admin_url'] . '/block.php?mode=edit', 'text' => $LANG_ADMIN['create_new']), array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
$retval .= COM_startBlock($LANG21[19], '', COM_getBlockTemplate('_admin_block', 'header'));
$retval .= ADMIN_createMenu($menu_arr, $LANG21[25], $_CONF['layout_url'] . '/images/icons/block.' . $_IMAGE_TYPE);
reorderblocks();
// Left
// Regular Blocks
$header_arr = array(array('text' => $LANG_ADMIN['edit'], 'field' => 'edit', 'sort' => false), array('text' => $LANG21[65], 'field' => 'blockorder', 'sort' => true), array('text' => $LANG21[46], 'field' => 'move', 'sort' => false), array('text' => $LANG_ADMIN['title'], 'field' => 'title', 'sort' => true), array('text' => $LANG21[48], 'field' => 'name', 'sort' => true), array('text' => $LANG_ADMIN['type'], 'field' => 'type', 'sort' => true), array('text' => $LANG_ADMIN['topic'], 'field' => 'topic', 'sort' => true), array('text' => $LANG_ADMIN['enabled'], 'field' => 'is_enabled', 'sort' => true));
$defsort_arr = array('field' => 'blockorder', 'direction' => 'asc');
$text_arr = array('has_extras' => true, 'title' => "{$LANG21['20']} ({$LANG21['40']})", 'form_url' => $_CONF['site_admin_url'] . '/block.php');
$query_arr = array('table' => 'blocks', 'sql' => "SELECT * FROM {$_TABLES['blocks']} WHERE onleft = 1", 'query_fields' => array('title', 'content'), 'default_filter' => COM_getPermSql('AND'));
// this is a dummy variable so we know the form has been used if all blocks
// should be disabled on one side in order to disable the last one.
// The value is the onleft var
$form_arr = array('top' => '<input type="hidden" name="' . CSRF_TOKEN . '" value="' . $token . '"' . XHTML . '>', 'bottom' => '<input type="hidden" name="blockenabler" value="1"' . XHTML . '>');
$retval .= ADMIN_list('blocks', 'ADMIN_getListField_blocks', $header_arr, $text_arr, $query_arr, $defsort_arr, '', $token, '', $form_arr);
// Dynamic blocks
$dyn_header_arr = array(array('text' => $LANG21[65], 'field' => 'blockorder', 'sort' => true), array('text' => $LANG21[69], 'field' => 'plugin', 'sort' => true), array('text' => $LANG_ADMIN['title'], 'field' => 'title', 'sort' => true), array('text' => $LANG21[48], 'field' => 'name', 'sort' => true), array('text' => $LANG_ADMIN['type'], 'field' => 'type', 'sort' => true), array('text' => $LANG_ADMIN['topic'], 'field' => 'topic', 'sort' => true), array('text' => $LANG_ADMIN['enabled'], 'field' => 'is_enabled', 'sort' => true));
$dyn_text_arr = array('title' => "{$LANG21['22']} ({$LANG21['40']})", 'form_url' => $_CONF['site_admin_url'] . '/block.php');
$leftblocks = PLG_getBlocksConfig('left', '');
// Sort Dynamic Blocks on Block Order
usort($leftblocks, "cmpDynamicBlocks");
$retval .= ADMIN_simpleList('ADMIN_getListField_dynamicblocks', $dyn_header_arr, $dyn_text_arr, $leftblocks, '', $form_arr);
// Right
// Regular Blocks
$query_arr = array('table' => 'blocks', 'sql' => "SELECT * FROM {$_TABLES['blocks']} WHERE onleft = 0", 'query_fields' => array('title', 'content'), 'default_filter' => COM_getPermSql('AND'));
$text_arr = array('has_extras' => true, 'title' => "{$LANG21['20']} ({$LANG21['41']})", 'form_url' => $_CONF['site_admin_url'] . '/block.php');
// this is a dummy-variable so we know the form has been used if all blocks should be disabled
// on one side in order to disable the last one. The value is the onleft var
$form_arr = array('top' => '<input type="hidden" name="' . CSRF_TOKEN . '" value="' . $token . '"' . XHTML . '>', 'bottom' => '<input type="hidden" name="blockenabler" value="0"' . XHTML . '>');
$retval .= ADMIN_list('blocks', 'ADMIN_getListField_blocks', $header_arr, $text_arr, $query_arr, $defsort_arr, '', $token, '', $form_arr);
// Dynamic blocks
$dyn_text_arr = array('title' => "{$LANG21['22']} ({$LANG21['41']})", 'form_url' => $_CONF['site_admin_url'] . '/block.php');
$rightblocks = PLG_getBlocksConfig('right', '');
// Sort Dynamic Blocks on Block Order
usort($rightblocks, "cmpDynamicBlocks");
$retval .= ADMIN_simpleList('ADMIN_getListField_dynamicblocks', $dyn_header_arr, $dyn_text_arr, $rightblocks, '', $form_arr);
$retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
return $retval;
}
示例8: listbackups
/**
* 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 listbackups()
{
global $_CONF, $_TABLES, $_IMAGE_TYPE, $LANG08, $LANG_ADMIN, $LANG_DB_BACKUP, $_DB_dbms;
require_once $_CONF['path_system'] . 'lib-admin.php';
$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, 'compareBackupFiles');
$data_arr = array();
$thisUrl = $_CONF['site_admin_url'] . '/database.php';
$num_backups = count($backups);
for ($i = 0; $i < $num_backups; $i++) {
$downloadUrl = $thisUrl . '?mode=download&file=' . urlencode($backups[$i]);
$downloadLink = COM_createLink($backups[$i], $downloadUrl, array('title' => $LANG_DB_BACKUP['download']));
$backupfile = $_CONF['backup_path'] . $backups[$i];
$backupfilesize = COM_numberFormat(filesizeHelper($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?mode=backup&' . CSRF_TOKEN . '=' . $token, 'text' => $LANG_ADMIN['create_new']));
if ($_DB_dbms == 'mysql') {
$menu_arr[] = array('url' => $thisUrl . '?mode=optimize', 'text' => $LANG_DB_BACKUP['optimize_menu']);
if (innodb_supported()) {
$menu_arr[] = array('url' => $thisUrl . '?mode=innodb', 'text' => $LANG_DB_BACKUP['convert_menu']);
}
}
$menu_arr[] = 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="mode" value="delete"' . XHTML . '>' . '<input type="hidden" name="' . CSRF_TOKEN . '" value="' . $token . '"' . XHTML . '>' . LB;
}
$listoptions = array('chkdelete' => true, 'chkminimum' => 0, 'chkfield' => 'filename');
$retval .= ADMIN_simpleList('', $header_arr, $text_arr, $data_arr, $listoptions, $form_arr);
$retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
} else {
$retval .= COM_showMessageText($LANG_DB_BACKUP['no_access'], $LANG08[06]);
COM_errorLog($_CONF['backup_path'] . ' is not writable.', 1);
}
return $retval;
}
示例9: strip_tags
$testText = strip_tags($testText);
$html2txt = new html2text($testText, false);
$testText = trim($html2txt->get_text());
$lastpostinfogll = htmlspecialchars(preg_replace('#\\r?\\n#', '<br>', strip_tags(substr($testText, 0, $_FF_CONF['contentinfo_numchars']) . '...')));
}
$link = '<a class="' . COM_getTooltipStyle() . '" style="text-decoration:none; white-space:nowrap;" href="' . $_CONF['site_url'] . '/forum/viewtopic.php?showtopic=' . $topic_id . '&lastpost=true#' . $lastid . '" title="' . htmlspecialchars($P['subject']) . '::' . $lastpostinfogll . '" rel="nofollow">';
$topiclink = '<a class="' . COM_getTooltipStyle() . '" style="text-decoration:none;" href="' . $_CONF['site_url'] . '/forum/viewtopic.php?showtopic=' . $topic_id . '" title="' . htmlspecialchars($P['subject']) . '::' . $topicinfo . '">' . $P['subject'] . '</a>';
$dt->setTimestamp($P['date']);
$tdate = $dt->format($_FF_CONF['default_Datetime_format'], true);
$data_arr[] = array('forum' => '<a href="' . $_CONF['site_url'] . '/forum/index.php?forum=' . $P['forum_id'] . '">' . $P['forum_name'] . '</a>', 'subject' => $topiclink, 'date' => $link . $tdate . '</a>');
if ($displayrecs >= 100) {
break;
}
}
}
$retval .= ADMIN_simpleList("", $header_arr, $text_arr, $data_arr);
$retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
$display .= $retval;
} else {
$retval = '';
$header_arr = array(array('text' => 'User', 'field' => 'username', 'sort' => true), array('text' => 'Registered', 'field' => 'regdate', 'sort' => false), array('text' => 'Posts', 'field' => 'posts', 'sort' => false), array('text' => 'Email', 'field' => 'email', 'sort' => false), array('text' => 'WWW', 'field' => 'homepage', 'sort' => false), array('text' => 'Last', 'field' => 'lastpost', 'sort' => false));
$form_url = $_CONF['site_url'] . '/forum/memberlist.php';
$form_url .= $chkactivity ? '?chkactivity=1' : '';
$text_arr = array('has_extras' => true, 'form_url' => $form_url, 'help_url' => '', 'nowrap' => 'date');
$defsort_arr = array('field' => 'username', 'direction' => 'ASC');
if ($chkactivity) {
$sql = "SELECT user.uid,user.uid,user.username,user.regdate,user.email,user.homepage, count(*) as posts, userprefs.emailfromuser ";
$sql .= " FROM {$_TABLES['users']} user, {$_TABLES['userprefs']} userprefs, {$_TABLES['ff_topic']} topic WHERE";
$sql .= " user.uid <> 1 AND user.status = 3 AND user.uid=topic.uid AND user.uid=userprefs.uid ";
$sql .= "GROUP by user.uid ";
} else {
示例10: _displayVersionData
function _displayVersionData()
{
global $_CONF, $_USER, $LANG_UPGRADE, $LANG01, $LANG_FILECHECK, $LANG_ADMIN, $_PLUGIN_INFO;
$retval = '';
$upToDate = 0;
$classCounter = 0;
$pluginInfo = '';
list($upToDate, $pluginsUpToDate, $pluginData) = _checkVersion();
$T = new Template($_CONF['path_layout'] . 'admin');
$T->set_file('page', 'vercheck.thtml');
$menu_arr = array(array('url' => $_CONF['site_admin_url'] . '/vercheck.php', 'text' => $LANG_UPGRADE['recheck']), array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
$retval .= COM_startBlock($LANG_UPGRADE['title'], '', COM_getBlockTemplate('_admin_block', 'header'));
$retval .= ADMIN_createMenu($menu_arr, $LANG_UPGRADE['desc'], $_CONF['layout_url'] . '/images/icons/versioncheck.png');
$retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
switch ($upToDate) {
case 0:
$alertIcon = $_CONF['layout_url'] . '/images/alert.png';
$statusMsg = $LANG_UPGRADE['upgrade_title'];
$statusText = sprintf($LANG_UPGRADE['upgrade'], $pluginData['glfusioncms']['installed_version'], $pluginData['glfusioncms']['latest_version']);
break;
case 1:
$alertIcon = $_CONF['layout_url'] . '/images/check.png';
$statusMsg = $LANG_UPGRADE['uptodate_title'];
$statusText = $LANG_UPGRADE['uptodate'];
break;
case 2:
$alertIcon = $_CONF['layout_url'] . '/images/alert.png';
$statusMsg = $LANG_UPGRADE['unknown_title'];
$statusText = sprintf($LANG_UPGRADE['unknown'], $pluginData['glfusioncms']['installed_version']);
break;
default:
$alertIcon = $_CONF['layout_url'] . '/images/alert.png';
$statusMsg = $LANG_UPGRADE['error_title'];
$statusText = $LANG_UPGRADE['error'];
break;
}
$T->set_var(array('alerticon' => $alertIcon, 'statusmsg' => $statusMsg, 'statustext' => $statusText));
if ($pluginsUpToDate != -1) {
$pluginInfo .= '<div style="margin-top:10px;"><h3>' . $LANG_UPGRADE['plugin_title'] . '</h3>';
$dt = new Date('now', $_USER['tzid']);
$data_arr = array();
$text_arr = array();
$header_arr = array(array('text' => $LANG_UPGRADE['plugin'], 'field' => 'display_name'), array('text' => $LANG_UPGRADE['installed_version'], 'field' => 'installed_version'), array('text' => $LANG_UPGRADE['latest_version'], 'field' => 'latest_version'), array('text' => $LANG_UPGRADE['notes'], 'field' => 'notes'));
asort($pluginData);
foreach ($pluginData as $plugin) {
if ($plugin['plugin'] == 'glfusioncms') {
continue;
}
$dt->setTimestamp($plugin['release_date']);
if ($plugin['latest_version'] == 0) {
$upToDate = -1;
} else {
$upToDate = _upToDate($plugin['latest_version'], $plugin['installed_version']);
}
switch ($upToDate) {
case 0:
$notes = sprintf($LANG_UPGRADE['was_released'], $plugin['latest_version'], $dt->format("M d, Y", true));
$class = "notok";
if (strlen($plugin['url']) > 0) {
$latest_version = '<a href="' . $plugin['url'] . '" target="_blank">' . $plugin['latest_version'] . '</a>';
} else {
$latest_version = $plugin['latest_version'];
}
break;
case 1:
$notes = $LANG_UPGRADE['plugin_uptodate'];
$class = "yes";
$latest_version = $plugin['latest_version'];
break;
case 2:
$notes = $LANG_UPGRADE['plugin_newer'];
$class = "yes";
$latest_version = $plugin['latest_version'];
break;
default:
$notes = $LANG_UPGRADE['no_data'];
$class = "ok";
$latest_version = '???';
break;
}
$data_arr[] = array('display_name' => $plugin['display_name'], 'installed_version' => $plugin['installed_version'], 'latest_version' => '<span class="' . $class . '">' . $latest_version . '</span>', 'url' => $plugin['url'], 'notes' => $notes, 'release_date' => $plugin['release_date'], 'update_available' => $upToDate);
}
$pluginInfo .= ADMIN_simpleList("", $header_arr, $text_arr, $data_arr);
$pluginInfo .= '</div>';
}
$T->parse('output', 'page');
$retval .= $T->finish($T->get_var('output'));
$retval .= $pluginInfo;
return $retval;
}
示例11: fncListReserv
function fncListReserv()
{
global $_CONF;
global $_TABLES;
global $LANG_ADMIN;
global $MESSAGE;
global $LANG_ASSIST_ADMIN;
global $LANG_ASSIST_TOENV;
$retval = '';
$files = glob("{$_CONF['path_data']}assist_reserv_*", GLOB_NOCHECK);
if (is_array($files)) {
if (count($files) > 0 && $files[0] != "{$_CONF['path_data']}assist_reserv_*") {
//ヘッダ:編集~
$header_arr[] = array('text' => $LANG_ASSIST_ADMIN['reservlist_no'], 'field' => 'no');
$header_arr[] = array('text' => $LANG_ASSIST_ADMIN['reservlist_datetime'], 'field' => 'datetime');
$header_arr[] = array('text' => $LANG_ASSIST_ADMIN['reservlist_range'], 'field' => 'range');
$header_arr[] = array('text' => $LANG_ASSIST_ADMIN['toenv'], 'field' => 'toenv');
$header_arr[] = array('text' => $LANG_ASSIST_ADMIN['selectgroup'], 'field' => 'selectgroup');
$header_arr[] = array('text' => $LANG_ASSIST_ADMIN['reservlist_sid'], 'field' => 'sid');
$header_arr[] = array('text' => $LANG_ASSIST_ADMIN['reservlist_cancel'], 'field' => 'reservcancel');
//
$text_arr = array('has_menu' => false, 'title' => $LANG_ASSIST_ADMIN['reservlist_title']);
//
$data_arr = array();
$token = SEC_createToken();
foreach ($files as $file) {
$filename = basename($file);
$aname = explode('_', $filename);
if (!empty($aname[2])) {
$A = array();
$A['no'] = $aname[2];
$A['datetime'] = date('Y-m-d H:i', $A['no']);
//
$uidfrom = DB_getItem($_TABLES['vars'], 'value', "name = 'assist_uf_{$A['no']}'");
$uidfrom = COM_stripslashes($uidfrom);
$uidto = DB_getItem($_TABLES['vars'], 'value', "name = 'assist_ut_{$A['no']}'");
$uidto = COM_stripslashes($uidto);
$lastid = DB_getItem($_TABLES['vars'], 'value', "name = 'assist_li_{$A['no']}'");
$lastid = COM_stripslashes($lastid);
$A['range'] = $uidfrom . ' -> ' . $uidto;
if ($lastid != 0) {
$A['range'] .= "(" . $lastid . ")";
}
//
$toenv = DB_getItem($_TABLES['vars'], 'value', "name = 'assist_te_{$A['no']}'");
$toenv = COM_stripslashes($toenv);
$A['toenv'] = $LANG_ASSIST_TOENV[$toenv];
//
$selectgroup = DB_getItem($_TABLES['vars'], 'value', "name = 'assist_sg_{$A['no']}'");
$selectgroup = COM_stripslashes($selectgroup);
if ($selectgroup === "99999") {
$A['selectgroup'] = $LANG_ASSIST_ADMIN['wkymlmguser_user'];
} else {
$A['selectgroup'] = DB_getItem($_TABLES['groups'], 'grp_name', "grp_id = '{$selectgroup}'");
}
//
$sid = DB_getItem($_TABLES['vars'], 'value', "name = 'assist_si_{$A['no']}'");
$sid = COM_stripslashes($sid);
$title = DB_getItem($_TABLES['stories'], 'title', "sid = '{$sid}'");
$title = stripslashes(str_replace('$', '$', $title));
$A['sid'] = COM_createLink($title, COM_buildUrl($_CONF['site_url'] . "/article.php?story={$sid}"));
//
$iconimg = "<img src=\"{$_CONF['layout_url']}/images/deleteitem.png\" border=\"0\"";
$iconimg .= "alt=\"{$LANG_ADMIN['delete']}\" title=\"{$LANG_ADMIN['delete']}\">";
$url = "{$_CONF['site_admin_url']}/plugins/assist/" . THIS_SCRIPT . "?";
$url .= "mode=reservcancel&id={$A['no']}&" . CSRF_TOKEN . "={$token}";
$attr = array('onClick' => "return confirm('{$MESSAGE[76]}');");
$A['reservcancel'] = COM_createLink($iconimg, $url, $attr);
//
$data_arr[] = $A;
}
}
$retval .= ADMIN_simpleList("", $header_arr, $text_arr, $data_arr);
}
}
return $retval;
}
示例12: _checkEnvironment
function _checkEnvironment()
{
global $_CONF, $_TABLES, $_PLUGINS, $_SYSTEM, $LANG_ADMIN, $LANG_ENVCHECK, $_SCRIPTS;
$retval = '';
$permError = 0;
$T = new Template($_CONF['path_layout'] . 'admin');
$T->set_file('page', 'envcheck.thtml');
$_SCRIPTS->setJavaScriptLibrary('jquery');
$javascript = '
$(document).ready(function(){
$("#toggle_phpinfo").click(function(){
$("#panel_phpinfo").slideToggle("slow");
});
});';
$_SCRIPTS->setJavascript($javascript, true);
$menu_arr = array(array('url' => $_CONF['site_admin_url'] . '/envcheck.php', 'text' => $LANG_ENVCHECK['recheck']), array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
$retval .= COM_startBlock($LANG_ENVCHECK['hosting_env'], '', COM_getBlockTemplate('_admin_block', 'header'));
$retval .= ADMIN_createMenu($menu_arr, $LANG_ENVCHECK['php_warning'], $_CONF['layout_url'] . '/images/icons/envcheck.png');
// ***********************************************
// PHP Settings Section - First we will validate the general environment.
$header_arr = array(array('text' => $LANG_ENVCHECK['setting'], 'field' => 'settings'), array('text' => $LANG_ENVCHECK['current'], 'field' => 'current'), array('text' => $LANG_ENVCHECK['recommended'], 'field' => 'recommended'), array('text' => $LANG_ENVCHECK['notes'], 'field' => 'notes'));
$text_arr = array('has_menu' => false, 'title' => $LANG_ENVCHECK['php_settings'], 'form_url' => "{$_CONF['site_admin_url']}/envcheck.php");
$data_arr = array();
if (_phpOutOfDate()) {
$current = '<span class="notok">' . phpversion() . '</span>';
} else {
$current = '<span class="yes">' . phpversion() . '</span>';
}
$data_arr[] = array('settings' => $LANG_ENVCHECK['php_version'], 'current' => $current, 'recommended' => '5.2.0+', 'notes' => $LANG_ENVCHECK['php_req_version']);
$rg = ini_get('register_globals');
$sm = ini_get('safe_mode');
$ob = ini_get('open_basedir');
$current = $rg == 1 ? '<span class="notok">' . $LANG_ENVCHECK['on'] . '</span>' : '<span class="yes">' . $LANG_ENVCHECK['off'] . '</span>';
$data_arr[] = array('settings' => 'register_globals', 'current' => $current, 'recommended' => $LANG_ENVCHECK['off'], 'notes' => $LANG_ENVCHECK['register_globals']);
$current = $sm == 1 ? '<span class="notok">' . $LANG_ENVCHECK['on'] . '</span>' : '<span class="yes">' . $LANG_ENVCHECK['off'] . '</span>';
$data_arr[] = array('settings' => 'safe_mode', 'current' => $current, 'recommended' => $LANG_ENVCHECK['off'], 'notes' => $LANG_ENVCHECK['safe_mode']);
$ob = ini_get('open_basedir');
if ($ob == '') {
$open_basedir_restriction = 0;
} else {
$open_basedir_restriction = 1;
$open_basedir_directories = $ob;
}
$current = $ob == '' ? '<span class="yes">' . $LANG_ENVCHECK['off'] . '</span>' : '<span class="notok">' . $LANG_ENVCHECK['enabled'] . '</span>';
$data_arr[] = array('settings' => 'open_basedir', 'current' => $current, 'recommended' => $LANG_ENVCHECK['off'], 'notes' => $LANG_ENVCHECK['open_basedir']);
$memory_limit = _return_bytes(ini_get('memory_limit'));
$memory_limit_print = $memory_limit / 1024 / 1024;
$current = $memory_limit < 50331648 ? '<span class="notok">' . $memory_limit_print . 'M</span>' : '<span class="yes">' . $memory_limit_print . 'M</span>';
$data_arr[] = array('settings' => 'memory_limit', 'current' => $current, 'recommended' => '48M', 'notes' => $LANG_ENVCHECK['memory_limit']);
$fu = ini_get('file_uploads');
$current = $fu == 1 ? '<span class="yes">' . $LANG_ENVCHECK['on'] . '</span>' : '<span class="notok">' . $LANG_ENVCHECK['off'] . '</span>';
$data_arr[] = array('settings' => 'file_uploads', 'current' => $current, 'recommended' => $LANG_ENVCHECK['on'], 'notes' => $LANG_ENVCHECK['file_uploads']);
$upload_limit = _return_bytes(ini_get('upload_max_filesize'));
$upload_limit_print = $upload_limit / 1024 / 1024;
$current = $upload_limit < 8388608 ? '<span class="notok">' . $upload_limit_print . 'M</span>' : '<span class="yes">' . $upload_limit_print . 'M</span>';
$data_arr[] = array('settings' => 'upload_max_filesize', 'current' => $current, 'recommended' => '8M', 'notes' => $LANG_ENVCHECK['upload_max_filesize']);
$post_limit = _return_bytes(ini_get('post_max_size'));
$post_limit_print = $post_limit / 1024 / 1024;
$current = $post_limit < 8388608 ? '<span class="notok">' . $post_limit_print . 'M</span>' : '<span class="yes">' . $post_limit_print . 'M</span>';
$data_arr[] = array('settings' => 'post_max_size', 'current' => $current, 'recommended' => '8M', 'notes' => $LANG_ENVCHECK['post_max_size']);
$max_execution_time = ini_get('max_execution_time');
$current = $max_execution_time < 30 ? '<span class="notok">' . $max_execution_time . ' secs</span>' : '<span class="yes">' . $max_execution_time . ' secs</span>';
$data_arr[] = array('settings' => 'max_execution_time', 'current' => $current, 'recommended' => '30 secs', 'notes' => $LANG_ENVCHECK['max_execution_time']);
$admin_list = ADMIN_simpleList('', $header_arr, $text_arr, $data_arr);
$T->set_var('php_settings_list', $admin_list);
// ***********************************************
// Libraries
$header_arr = array(array('text' => $LANG_ENVCHECK['item'], 'field' => 'item'), array('text' => $LANG_ENVCHECK['status'], 'field' => 'status'), array('text' => $LANG_ENVCHECK['notes'], 'field' => 'notes'));
$text_arr = array('has_menu' => false, 'title' => $LANG_ENVCHECK['libraries'], 'form_url' => "{$_CONF['site_admin_url']}/envcheck.php");
$data_arr = array();
if (extension_loaded('openssl')) {
$data_arr[] = array('item' => $LANG_ENVCHECK['openssl_library'], 'status' => '<span class="yes">' . $LANG_ENVCHECK['ok'] . '</span>', 'notes' => $LANG_ENVCHECK['openssl_ok']);
} else {
$data_arr[] = array('item' => $LANG_ENVCHECK['openssl_library'], 'status' => '<span class="notok">' . $LANG_ENVCHECK['not_found'] . '</span>', 'notes' => $LANG_ENVCHECK['openssl_not_found']);
}
if ($sm != 1 && $open_basedir_restriction != 1) {
switch ($_CONF['image_lib']) {
case 'imagemagick':
// ImageMagick
if (PHP_OS == "WINNT") {
$binary = "/convert.exe";
} else {
$binary = "/convert";
}
clearstatcache();
if (!@file_exists($_CONF['path_to_mogrify'] . $binary)) {
$data_arr[] = array('item' => $LANG_ENVCHECK['imagemagick'], 'status' => '<span class="notok">' . $LANG_ENVCHECK['not_found'] . '</span>', 'notes' => $LANG_ENVCHECK['im_not_found']);
} else {
$data_arr[] = array('item' => $LANG_ENVCHECK['imagemagick'], 'status' => '<span class="yes">' . $LANG_ENVCHECK['ok'] . '</span>', 'notes' => $LANG_ENVCHECK['im_ok']);
}
break;
case 'gdlib':
// GD Libs
if ($gdv = gdVersion()) {
if ($gdv >= 2) {
$data_arr[] = array('item' => $LANG_ENVCHECK['gd_lib'], 'status' => '<span class="yes">' . $LANG_ENVCHECK['ok'] . '</span>', 'notes' => $LANG_ENVCHECK['gd_ok']);
} else {
$data_arr[] = array('item' => $LANG_ENVCHECK['gd_lib'], 'status' => '<span class="yes">' . $LANG_ENVCHECK['ok'] . '</span>', 'notes' => $LANG_ENVCHECK['gd_v1']);
}
} else {
//.........這裏部分代碼省略.........
示例13: _mg_showstats
/**
* Shows the statistics for the plugin on stats.php. If
* $showsitestats is 1 then we are to only print the overall stats in the 'site
* statistics' box otherwise we show the detailed stats for the plugin
*
* Universal Plugin: Modify/uncomment use it
*
* @param int showsitestate Flag to let us know which stats to get
* @return string returns formatted HTML to insert in stats page
*
*/
function _mg_showstats($showsitestats)
{
global $_CONF, $_MG_CONF, $_TABLES, $LANG_MG00, $MG_albums, $_USER;
if (COM_isAnonUser() && $_MG_CONF['loginrequired'] == 1) {
return;
}
$previd = -1;
$loopcounter = 0;
$retval = '';
if ($showsitestats == 1) {
// This shows in the summary box
$total_pages = DB_count($_TABLES['mg_media']);
$summary_label = $LANG_MG00['items_in'] . ' ' . $LANG_MG00['plugin'];
$retval = "<table border = '0' width='100%' cellspacing='0' cellpadding='0'>";
$retval .= "<tr><td>{$summary_label}</td>";
$retval .= "<td align='right'>" . $total_pages . "   </td></tr></table>";
} else {
$header_arr = array(array('text' => $LANG_MG00['media_col_header'], 'field' => 'title', 'header_class' => 'stats-header-title'), array('text' => $LANG_MG00['rating'], 'field' => 'rating', 'field_class' => 'stats-list-count'));
$data_arr = array();
$text_arr = array('has_menu' => false, 'title' => $LANG_MG00['stats_rate_title']);
$sql = "SELECT a.album_id,m.media_original_filename,m.media_title,m.media_id,m.media_rating FROM {$_TABLES['mg_albums']} as a LEFT JOIN {$_TABLES['mg_media_albums']} as ma\n on a.album_id=ma.album_id LEFT JOIN {$_TABLES['mg_media']} as m on ma.media_id=m.media_id WHERE\n m.media_rating <> 0 AND a.hidden=0 " . COM_getPermSQL('and') . " ORDER BY m.media_rating DESC LIMIT 10";
$result = DB_query($sql);
$numrows = DB_numRows($result);
if ($numrows > 0) {
for ($i = 0; $i < $numrows && $i < 10; $i++) {
$A = DB_fetchArray($result);
$aid = $A['album_id'];
if ($A['media_title'] == '' || $A['media_title'] == " ") {
if ($A['media_original_filename'] == '') {
$title = '<b>' . $LANG_MG00['album'] . '</b>' . '<em>' . strip_tags($MG_albums[$aid]->title) . ' - ' . $LANG_MG00['no_title'] . '</em>';
} else {
$title = $A['media_original_filename'];
}
} else {
$title = strip_tags($A['media_title']);
}
$S['title'] = '<a href="' . $_MG_CONF['site_url'] . '/media.php?s=' . $A['media_id'] . '">' . $title . '</a>';
$S['rating'] = @number_format($A['media_rating'], 2);
$data_arr[$i] = $S;
}
$retval .= ADMIN_simpleList("", $header_arr, $text_arr, $data_arr);
}
$loopcounter = 0;
$previd = '';
$header_arr = array(array('text' => $LANG_MG00['media_col_header'], 'field' => 'title', 'header_class' => 'stats-header-title'), array('text' => $LANG_MG00['hitsmsg'], 'field' => 'views', 'field_class' => 'stats-list-count'));
$data_arr = array();
$text_arr = array('has_menu' => false, 'title' => $LANG_MG00['stats_title']);
$sql = "SELECT DISTINCT m.media_id,m.media_title,ma.album_id,m.media_original_filename,m.media_views\n FROM " . $_TABLES['mg_media'] . " as m" . " LEFT JOIN " . $_TABLES['mg_media_albums'] . " as ma" . " ON m.media_id=ma.media_id " . " WHERE m.media_views > 0 " . " ORDER BY m.media_views DESC LIMIT 10";
$result = DB_query($sql);
$numrows = DB_numRows($result);
if ($numrows > 0) {
for ($i = 0; $i < $numrows; $i++) {
$A = DB_fetchArray($result);
if ($A['media_id'] == $previd) {
continue;
}
$aid = $A['album_id'];
$previd = $A['media_id'];
if ($A['media_id'] != '' && isset($MG_albums[$aid]) && $MG_albums[$aid]->access > 0) {
if ($A['media_title'] == '' || $A['media_title'] == " ") {
if ($A['media_original_filename'] == '') {
$title = '<b>' . $LANG_MG00['album'] . '</b>' . '<em>' . strip_tags($MG_albums[$aid]->title) . ' - ' . $LANG_MG00['no_title'] . '</em>';
} else {
$title = $A['media_original_filename'];
}
} else {
$title = strip_tags($A['media_title']);
}
$S['title'] = '<a href="' . $_MG_CONF['site_url'] . '/media.php?s=' . $A['media_id'] . '">' . $title . '</a>';
$S['views'] = $A['media_views'];
$data_arr[$loopcounter] = $S;
$loopcounter++;
}
if ($loopcounter > 10) {
break;
}
}
$retval .= ADMIN_simpleList("", $header_arr, $text_arr, $data_arr);
}
}
return $retval;
}
示例14: MODERATE_itemList
/**
* Displays items needing moderation
*
* Displays the moderation list of items from the submission tables
*
* @type string Type of object to build list for
*
*/
function MODERATE_itemList($type = '', $token)
{
global $_CONF, $_TABLES, $LANG01, $LANG24, $LANG29, $LANG_ADMIN, $_IMAGE_TYPE;
$retval = '';
if (empty($type)) {
COM_errorLog("Submissions Error: Attempted to generate a moderation list for a null item type.");
} else {
switch ($type) {
case 'user':
// user -----------------------------------------------
$result = DB_query("SELECT uid,username,fullname,email,UNIX_TIMESTAMP(regdate) AS day FROM {$_TABLES['users']} WHERE status = 2");
$nrows = DB_numRows($result);
if ($nrows > 0) {
$data_arr = array();
for ($i = 0; $i < $nrows; $i++) {
$A = DB_fetchArray($result);
$A['edit'] = $_CONF['site_admin_url'] . '/user.php?edit=x&uid=' . $A['uid'];
$A['fullname'] = $A['fullname'];
$A['email'] = $A['email'];
$A['_type_'] = 'user';
$A['_key_'] = 'uid';
$data_arr[$i] = $A;
}
$header_arr = array(array('text' => $LANG_ADMIN['edit'], 'field' => 0, 'align' => 'center', 'width' => '25px'), array('text' => $LANG29[16], 'field' => 1, 'nowrap' => true), array('text' => $LANG29[17], 'field' => 2), array('text' => $LANG29[18], 'field' => 3, 'nowrap' => true), array('text' => $LANG29[47], 'field' => 4, 'align' => 'center'), array('text' => $LANG29[1], 'field' => 'approve', 'align' => 'center', 'width' => '35px'), array('text' => $LANG_ADMIN['delete'], 'field' => 'delete', 'align' => 'center', 'width' => '35px'));
$text_arr = array('has_menu' => false, 'title' => $LANG29[40], 'help_url' => 'ccusersubmission.html', 'no_data' => '', 'form_url' => "{$_CONF['site_admin_url']}/moderation.php");
$actions = '<input name="approve" type="image" src="' . $_CONF['layout_url'] . '/images/admin/accept.' . $_IMAGE_TYPE . '" style="vertical-align:bottom;" title="' . $LANG29[44] . '" onclick="return confirm(\'' . $LANG29[45] . '\');"' . '/> ' . $LANG29[1];
$actions .= ' ';
$actions .= '<input name="delbutton" type="image" src="' . $_CONF['layout_url'] . '/images/admin/delete.' . $_IMAGE_TYPE . '" style="vertical-align:text-bottom;" title="' . $LANG01[124] . '" onclick="return confirm(\'' . $LANG01[125] . '\');"' . '/> ' . $LANG_ADMIN['delete'];
$options = array('chkselect' => true, 'chkfield' => 'uid', 'chkname' => 'selitem', 'chkminimum' => 0, 'chkall' => false, 'chkactions' => $actions);
$form_arr['bottom'] = '<input type="hidden" name="type" value="user"/>' . LB . '<input type="hidden" name="' . CSRF_TOKEN . '" value="' . $token . '"/>' . LB . '<input type="hidden" name="moderation" value="x"/>' . LB . '<input type="hidden" name="count" value="' . $nrows . '"/>';
$retval = ADMIN_simpleList('MODERATE_getListField', $header_arr, $text_arr, $data_arr, $options, $form_arr, $token);
}
break;
case 'draftstory':
// draft story ----------------------------------
$result = DB_query("SELECT sid AS id,title,UNIX_TIMESTAMP(date) AS day,tid,uid FROM {$_TABLES['stories']} WHERE (draft_flag = 1)" . COM_getTopicSQL('AND') . COM_getPermSQL('AND', 0, 3) . " ORDER BY date ASC");
$nrows = DB_numRows($result);
if ($nrows > 0) {
$data_arr = array();
for ($i = 0; $i < $nrows; $i++) {
$A = DB_fetchArray($result);
$A['edit'] = $_CONF['site_admin_url'] . '/story.php?draft=x&sid=' . $A['id'];
$A['title'] = $A['title'];
$A['tid'] = $A['tid'];
$A['_type_'] = 'draftstory';
$A['_key_'] = 'sid';
$data_arr[$i] = $A;
}
$header_arr = array(array('text' => $LANG_ADMIN['edit'], 'field' => 0, 'align' => 'center', 'width' => '25px'), array('text' => $LANG29[10], 'field' => 'title'), array('text' => $LANG29[14], 'field' => 'day', 'align' => 'center', 'width' => '15%'), array('text' => $LANG29[15], 'field' => 'tid', 'width' => '20%'), array('text' => $LANG29[46], 'field' => 'uid', 'width' => '15%', 'nowrap' => true), array('text' => $LANG29[1], 'field' => 'approve', 'align' => 'center', 'width' => '35px'), array('text' => $LANG_ADMIN['delete'], 'field' => 'delete', 'align' => 'center', 'width' => '35px'));
$text_arr = array('has_menu' => false, 'title' => $LANG29[35] . ' (' . $LANG24[34] . ')', 'help_url' => '', 'no_data' => $LANG29[39], 'form_url' => "{$_CONF['site_admin_url']}/moderation.php");
$actions = '<input name="approve" type="image" src="' . $_CONF['layout_url'] . '/images/admin/accept.' . $_IMAGE_TYPE . '" style="vertical-align:bottom;" title="' . $LANG29[44] . '" onclick="return confirm(\'' . $LANG29[45] . '\');"' . '/> ' . $LANG29[1];
$actions .= ' ';
$actions .= '<input name="delbutton" type="image" src="' . $_CONF['layout_url'] . '/images/admin/delete.' . $_IMAGE_TYPE . '" style="vertical-align:text-bottom;" title="' . $LANG01[124] . '" onclick="return confirm(\'' . $LANG01[125] . '\');"' . '/> ' . $LANG_ADMIN['delete'];
$options = array('chkselect' => true, 'chkfield' => 'id', 'chkname' => 'selitem', 'chkminimum' => 0, 'chkall' => false, 'chkactions' => $actions);
$form_arr['bottom'] = '<input type="hidden" name="type" value="draftstory"/>' . LB . '<input type="hidden" name="' . CSRF_TOKEN . '" value="' . $token . '"/>' . LB . '<input type="hidden" name="count" value="' . $nrows . '"/>';
$retval .= ADMIN_simpleList('MODERATE_getListField', $header_arr, $text_arr, $data_arr, $options, $form_arr, $token);
}
break;
// draftstory
// draftstory
default:
// plugin -------------------------------------------------
$function = 'plugin_itemlist_' . $type;
if (function_exists($function)) {
$plugin = new Plugin();
$plugin = $function($token);
// if the plugin returns a string, it wants to control it's own
// moderation. as far as I can tell - no plugin has used this yet
// it appears to be a feature that was added in glFusion 1.1.0rc1
// but never actually used
if (is_string($plugin) && !empty($plugin)) {
return '<div class="block-box">' . $plugin . '</div>';
// otherwise this is a plugin object (historical approach)
} elseif (is_object($plugin)) {
$helpfile = $plugin->submissionhelpfile;
$sql = $plugin->getsubmissionssql;
$H = $plugin->submissionheading;
$section_title = $plugin->submissionlabel;
$section_help = $helpfile;
$isplugin = true;
}
}
// this needs to be removed when story moves into a plugin
if ($type == 'story') {
$isplugin = false;
}
// we really only need the id from this list, so that we know key/id field name
list($key, $table, $fields, $submissiontable) = PLG_getModerationValues($type);
// the first 4 columns default to Title, Date, Topic and Submitted By unless otherwise
// specified. not sure I like this approach - but whatever - it's not
// breaking anything at the momemnt
if (!isset($H[0]) || empty($H[0])) {
//.........這裏部分代碼省略.........
示例15: COM_startBlock
} else {
$display .= COM_startBlock($LANG10[25]);
$display .= $LANG10[26];
$display .= COM_endBlock();
}
}
// Top Ten Emailed Stories
$sql = "SELECT sid,title,numemails\n FROM {$_TABLES['stories']}, {$_TABLES['topic_assignments']} ta\n WHERE ta.type = 'article' AND ta.id = sid\n AND (numemails > 0) AND (draft_flag = 0) AND (date <= NOW())" . COM_getPermSQL('AND') . $topicsql . " ORDER BY numemails DESC LIMIT 10";
$result = DB_query($sql);
$nrows = DB_numRows($result);
if ($nrows > 0) {
$header_arr = array(array('text' => $LANG10[8], 'field' => 'sid', 'header_class' => 'stats-header-title'), array('text' => $LANG10[23], 'field' => 'numemails', 'header_class' => 'stats-header-count', 'field_class' => 'stats-list-count'));
$data_arr = array();
$text_arr = array('has_menu' => false, 'title' => $LANG10[22], 'form_url' => $_CONF['site_url'] . '/stats.php');
for ($i = 0; $i < $nrows; $i++) {
$A = DB_fetchArray($result);
$A['title'] = stripslashes(str_replace('$', '$', $A['title']));
$A['sid'] = COM_createLink($A['title'], COM_buildUrl($_CONF['site_url'] . "/article.php?story={$A['sid']}"));
$A['numemails'] = COM_NumberFormat($A['numemails']);
$data_arr[$i] = $A;
}
$display .= ADMIN_simpleList('', $header_arr, $text_arr, $data_arr);
} else {
$display .= COM_startBlock($LANG10[22]);
$display .= $LANG10[24];
$display .= COM_endBlock();
}
// Now show stats for any plugins that want to be included
$display .= PLG_getPluginStats(2);
$display = COM_createHTMLDocument($display, array('pagetitle' => $LANG10[1]));
COM_output($display);