本文整理汇总了PHP中COM_createLink函数的典型用法代码示例。如果您正苦于以下问题:PHP COM_createLink函数的具体用法?PHP COM_createLink怎么用?PHP COM_createLink使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了COM_createLink函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: adduserevent
/**
* Adds an event to the user's calendar
*
* The user has asked that an event be added to their personal
* calendar. Show a confirmation screen.
*
* @param string $eid event ID to add to user's calendar
* @return string HTML for confirmation form
*
*/
function adduserevent($eid)
{
global $_CONF, $_TABLES, $LANG_CALJP_1;
$retval = '';
$eventsql = "SELECT * FROM {$_TABLES['eventsjp']} WHERE eid='{$eid}'" . COM_getPermSql('AND');
$result = DB_query($eventsql);
$nrows = DB_numRows($result);
if ($nrows == 1) {
$retval .= COM_startBlock(sprintf($LANG_CALJP_1[11], COM_getDisplayName()));
$A = DB_fetchArray($result);
$cal_template = COM_newTemplate($_CONF['path'] . 'plugins/calendarjp/templates/');
$cal_template->set_file(array('addevent' => 'addevent.thtml'));
$cal_template->set_var('intro_msg', $LANG_CALJP_1[8]);
$cal_template->set_var('lang_event', $LANG_CALJP_1[12]);
$event_title = stripslashes($A['title']);
if (!empty($A['url']) && $A['url'] != 'http://') {
$event_title_and_url = COM_createLink($event_title, $A['url'], array('class' => 'url'));
$cal_template->set_var('event_url', $A['url']);
$cal_template->set_var('event_begin_anchortag', '<a href="' . $A['url'] . '" class="url">');
$cal_template->set_var('event_end_anchortag', '</a>');
} else {
$event_title_and_url = $event_title;
$cal_template->set_var('event_url', '');
$cal_template->set_var('event_begin_anchortag', '');
$cal_template->set_var('event_end_anchortag', '');
}
$cal_template->set_var('event_title', $event_title_and_url);
$cal_template->set_var('event_title_only', $event_title);
$cal_template->set_var('lang_starts', $LANG_CALJP_1[13]);
$cal_template->set_var('lang_ends', $LANG_CALJP_1[14]);
$thestart = COM_getUserDateTimeFormat($A['datestart'] . ' ' . $A['timestart']);
$theend = COM_getUserDateTimeFormat($A['dateend'] . ' ' . $A['timeend']);
if ($A['allday'] == 0) {
$cal_template->set_var('event_start', $thestart[0]);
$cal_template->set_var('event_end', $theend[0]);
} else {
$cal_template->set_var('event_start', strftime($_CONF['shortdate'], $thestart[1]));
$cal_template->set_var('event_end', strftime($_CONF['shortdate'], $theend[1]));
}
$cal_template->set_var('lang_where', $LANG_CALJP_1[4]);
$location = stripslashes($A['location']) . '<br' . XHTML . '>' . stripslashes($A['address1']) . '<br' . XHTML . '>' . stripslashes($A['address2']) . '<br' . XHTML . '>' . stripslashes($A['city']) . ', ' . stripslashes($A['state']) . ' ' . $A['zipcode'];
$cal_template->set_var('event_location', $location);
$cal_template->set_var('lang_description', $LANG_CALJP_1[5]);
$description = stripslashes($A['description']);
if (empty($A['postmode']) || $A['postmode'] == 'plaintext') {
$description = COM_nl2br($description);
}
$cal_template->set_var('event_description', PLG_replaceTags($description));
$cal_template->set_var('event_id', $eid);
$cal_template->set_var('lang_addtomycalendar', $LANG_CALJP_1[9]);
$cal_template->set_var('gltoken_name', CSRF_TOKEN);
$cal_template->set_var('gltoken', SEC_createToken());
$cal_template->parse('output', 'addevent');
$retval .= $cal_template->finish($cal_template->get_var('output'));
$retval .= COM_endBlock();
} else {
$retval .= COM_showMessage(23);
}
return $retval;
}
示例2: _ff_getListField_memberlist
function _ff_getListField_memberlist($fieldname, $fieldvalue, $A, $icon_arr)
{
global $_CONF, $_USER, $_TABLES, $LANG_ADMIN, $LANG04, $LANG28, $_IMAGE_TYPE;
global $_FF_CONF, $_SYSTEM, $LANG_GF02;
if (!isset($A['status'])) {
$A['status'] = 0;
}
$retval = '';
switch ($fieldname) {
case 'username':
$url = $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid'];
$retval = COM_createLink($fieldvalue, $url);
break;
case 'posts':
$posts = DB_count($_TABLES['ff_topic'], 'uid', $A['uid']);
$retval = $posts;
break;
case 'homepage':
$retval = '';
if ($A['homepage'] != '') {
$homepage = $A['homepage'];
if (!preg_match("/http/i", $homepage)) {
$homepage = 'http://' . $homepage;
}
$retval = '<a href="' . $homepage . '"><img src="' . _ff_getImage('home') . '" alt="Website"/></a>';
}
break;
case 'email':
if ($A['emailfromuser'] == '1') {
$retval = '<a href="' . $_CONF['site_url'] . '/profiles.php?uid=' . $A['uid'] . '"><img src="' . _ff_getImage('email') . '" alt="email"/></a>';
}
break;
case 'pm':
if ($_FF_CONF['use_pm_plugin']) {
$pmplugin_link = forumPLG_getPMlink($siteMembers['username']);
$retval = '<a href="' . $pmplugin_link . '"><img src="' . _ff_getImage('pm') . '" alt="PM"/></a>';
}
break;
case 'lastpost':
$A['posts'] = DB_count($_TABLES['ff_topic'], 'uid', $A['uid']);
if ($A['posts'] > 0) {
$reportlinkURL = $_CONF['site_url'] . '/forum/memberlist.php?op=last10posts&showuser=' . $A['uid'];
$retval = '<a href="' . $reportlinkURL . '"><img src="' . _ff_getImage('latestposts') . '" alt="LatestPosts"/></a>';
}
break;
case 'regdate':
$phpdate = strtotime($fieldvalue);
$dt = new Date($phpdate, $_USER['tzid']);
$retval = $dt->format($_FF_CONF['default_Datetime_format'], true);
break;
default:
$retval = $fieldvalue;
break;
}
return $retval;
}
示例3: display
/**
* Constructor
*/
function display()
{
global $_CONF, $_TABLES, $LANG_SX00;
$action = '';
if (isset($_GET['action'])) {
$action = $_GET['action'];
} elseif (isset($_POST['paction'])) {
$action = $_POST['paction'];
}
if ($action == 'delete' && SEC_checkToken()) {
$entry = $_GET['entry'];
if (!empty($entry)) {
$dbentry = addslashes($entry);
DB_delete($_TABLES['spamx'], array('name', 'value'), array('HTTPHeader', $dbentry));
}
} elseif ($action == $LANG_SX00['addentry'] && SEC_checkToken()) {
$entry = '';
$name = COM_applyFilter($_REQUEST['header-name']);
$n = explode(':', $name);
$name = $n[0];
$value = $_REQUEST['header-value'];
if (!empty($name) && !empty($value)) {
$entry = $name . ': ' . $value;
}
$dbentry = addslashes($entry);
if (!empty($entry)) {
$result = DB_query("INSERT INTO {$_TABLES['spamx']} VALUES ('HTTPHeader','{$dbentry}')");
}
}
$token = SEC_createToken();
$display = '<hr' . XHTML . '>' . LB . '<p><b>';
$display .= $LANG_SX00['headerblack'];
$display .= '</b></p>' . LB . '<ul>' . LB;
$result = DB_query("SELECT value FROM {$_TABLES['spamx']} WHERE name='HTTPHeader' ORDER BY value");
$nrows = DB_numRows($result);
for ($i = 0; $i < $nrows; $i++) {
list($e) = DB_fetchArray($result);
$display .= '<li>' . COM_createLink(htmlspecialchars($e), $_CONF['site_admin_url'] . '/plugins/spamx/index.php?command=EditHeader&action=delete&entry=' . urlencode($e) . '&' . CSRF_TOKEN . '=' . $token) . '</li>' . LB;
}
$display .= '</ul>' . LB . '<p>' . $LANG_SX00['e1'] . '</p>' . LB;
$display .= '<p>' . $LANG_SX00['e2'] . '</p>' . LB;
$display .= '<form method="post" action="' . $_CONF['site_admin_url'] . '/plugins/spamx/index.php?command=EditHeader">' . LB;
$display .= '<table border="0" width="100%">' . LB;
$display .= '<tr><td align="right"><b>Header:</b></td>' . LB;
$display .= '<td><input type="text" size="40" name="header-name"' . XHTML . '> e.g. <tt>User-Agent</tt></td></tr>' . LB;
$display .= '<tr><td align="right"><b>Content:</b></td>' . LB;
$display .= '<td><input type="text" size="40" name="header-value"' . XHTML . '> e.g. <tt>Mozilla</tt></td></tr>' . LB;
$display .= '</table>' . LB;
$display .= '<p><input type="submit" name="paction" value="' . $LANG_SX00['addentry'] . '"' . XHTML . '>';
$display .= '<input type="hidden" name="' . CSRF_TOKEN . "\" value=\"{$token}\"" . XHTML . '></p>' . LB;
$display .= '</form>' . LB;
return $display;
}
示例4: display
/**
* Constructor
*/
function display()
{
global $_CONF, $_TABLES, $LANG_SX00;
$action = '';
if (isset($_GET['action'])) {
$action = $_GET['action'];
} elseif (isset($_POST['paction'])) {
$action = $_POST['paction'];
}
$entry = '';
if (isset($_GET['entry'])) {
$entry = COM_stripslashes($_GET['entry']);
} elseif (isset($_POST['pentry'])) {
$entry = COM_stripslashes($_POST['pentry']);
}
if ($action == 'delete' && SEC_checkToken()) {
$entry = DB_escapeString($entry);
DB_delete($_TABLES['spamx'], array('name', 'value'), array('Personal', $entry));
} elseif ($action == $LANG_SX00['addentry'] && SEC_checkToken()) {
if (!empty($entry)) {
$entry = DB_escapeString($entry);
$result = DB_query("INSERT INTO {$_TABLES['spamx']} VALUES ('Personal', '{$entry}')");
}
} elseif ($action == $LANG_SX00['addcen'] && SEC_checkToken()) {
foreach ($_CONF['censorlist'] as $entry) {
$entry = DB_escapeString($entry);
$result = DB_query("INSERT INTO {$_TABLES['spamx']} VALUES ('Personal', '{$entry}')");
}
}
$token = SEC_createToken();
$display = '<hr' . XHTML . '>' . LB . '<p><b>';
$display .= $LANG_SX00['pblack'];
$display .= '</b></p>' . LB . '<ul>' . LB;
$result = DB_query("SELECT value FROM {$_TABLES['spamx']} WHERE name = 'Personal'");
$nrows = DB_numRows($result);
for ($i = 0; $i < $nrows; $i++) {
$A = DB_fetchArray($result);
$e = $A['value'];
$display .= '<li>' . COM_createLink(htmlspecialchars($e), $_CONF['site_admin_url'] . '/plugins/spamx/index.php?command=EditBlackList&action=delete&entry=' . urlencode($e) . '&' . CSRF_TOKEN . '=' . $token) . '</li>' . LB;
}
$display .= '</ul>' . LB . '<p>' . $LANG_SX00['e1'] . '</p>' . LB;
$display .= '<p>' . $LANG_SX00['e2'] . '</p>' . LB;
$display .= '<form method="post" action="' . $_CONF['site_admin_url'] . '/plugins/spamx/index.php?command=EditBlackList">' . LB;
$display .= '<div><input type="text" size="30" name="pentry"' . XHTML . '> ';
$display .= '<input type="submit" name="paction" value="' . $LANG_SX00['addentry'] . '"' . XHTML . '>' . LB;
$display .= '<p>' . $LANG_SX00['e3'] . '</p> ';
$display .= '<input type="submit" name="paction" value="' . $LANG_SX00['addcen'] . '"' . XHTML . '>' . LB;
$display .= '<input type="hidden" name="' . CSRF_TOKEN . "\" value=\"{$token}\"" . XHTML . '>' . LB;
$display .= '</div></form>' . LB;
return $display;
}
示例5: parse
function parse($p1, $p2, $fulltag)
{
global $_CONF;
$retval = '';
$p1 .= empty($p2) ? '' : ' ' . $p2;
if (!empty($p1)) {
$lang = COM_getLanguageId();
$lang = empty($lang) ? 'en' : $lang;
// default to en
$attr['target'] = '_blank';
$attr['style'] = "cursor:help;text-decoration:none;')";
$url = "http://www.glfusion.org/wiki/doku.php/?do=search&id=" . trim(str_replace(' ', '_', $p1));
$retval = COM_createLink($p1, $url, $attr);
}
return $retval;
}
示例6: HELLO_getListField_hello
function HELLO_getListField_hello($fieldname, $fieldvalue, $A, $icon_arr)
{
global $_CONF;
switch ($fieldname) {
case 'see_hello':
$retval = '';
$retval .= COM_createLink($icon_arr['list'], "{$_CONF['site_admin_url']}/plugins/hello/read_email.php?mode=edit&hello_id={$A['hello_id']}");
break;
case 'creation':
$creation = COM_getUserDateTimeFormat(strtotime($A['creation']));
$retval .= $creation[0];
break;
default:
$retval = stripslashes($fieldvalue);
break;
}
return $retval;
}
示例7: MAPS_getListField_maps_displayOverlaysToAdd
function MAPS_getListField_maps_displayOverlaysToAdd($fieldname, $fieldvalue, $A, $icon_arr)
{
global $LANG_MAPS_1, $_MAPS_CONF;
switch ($fieldname) {
case "edit":
$edit_url = '#';
$retval = COM_createLink($icon_arr['disabled'], $edit_url, array('class' => 'add', 'id' => $A['oid'], 'mid' => $A['mid'], 'title' => $LANG_MAPS_1['add_overlay']));
break;
case "o_name":
$overlay_image = $_MAPS_CONF['path_overlay_images'] . $A['o_image'];
if (is_file($overlay_image)) {
$retval = COM_getTooltip($A['o_name'], '<img src="' . $_MAPS_CONF['site_url'] . '/timthumb.php?src=' . $_MAPS_CONF['images_overlay_url'] . $A['o_image'] . '&w=200&q=70&zc=1" alt="" />', '', $A['o_name'], $template = 'help');
} else {
$retval = $A['o_name'];
}
break;
default:
$retval = stripslashes($fieldvalue);
break;
}
return $retval;
}
示例8: ADMIN_getListField_ratings
/**
* used for the list of users in admin/user.php
*
*/
function ADMIN_getListField_ratings($fieldname, $fieldvalue, $A, $icon_arr)
{
global $_CONF, $_TABLES, $LANG_ADMIN, $LANG04, $LANG28, $_IMAGE_TYPE;
$retval = '';
switch ($fieldname) {
case 'uid':
$retval = COM_createLink($fieldvalue, $_CONF['site_admin_url'] . '/plugins/forum/userrating_detail.php?vid=' . $A['uid']);
break;
case 'rating':
$retval = '<input type="text" name="new_rating-' . $A['uid'] . '" value="' . intval($A['rating']) . '" size="5" />';
break;
case 'username':
$retval = COM_createLink($fieldvalue, $_CONF['site_admin_url'] . '/plugins/forum/userrating_detail.php?uid=' . $A['uid']);
break;
case $_TABLES['users'] . '.uid':
$retval = $A['uid'];
break;
default:
$retval = $fieldvalue;
break;
}
return $retval;
}
示例9: MAPS_getListField_icons
/**
* Get an individual field for the icons screen.
*
* @param string $fieldname Name of field (from the array, not the db)
* @param mixed $fieldvalue Value of the field
* @param array $A Array of all fields from the database
* @param array $icon_arr System icon array
* @param object $EntryList This entry list object
* @return string HTML for field display in the table
*/
function MAPS_getListField_icons($fieldname, $fieldvalue, $A, $icon_arr)
{
global $_CONF, $_MAPS_CONF, $LANG_ADMIN, $LANG_STATIC, $_TABLES;
switch ($fieldname) {
case "icon_id":
$retval = COM_createLink($icon_arr['edit'], "{$_CONF['site_admin_url']}/plugins/maps/icons.php?mode=edit&id={$A['icon_id']}");
break;
case "icon_name":
$retval = $A['icon_name'];
break;
case "icon_image":
$icon_image = $_MAPS_CONF['path_icons_images'] . $A['icon_image'];
if (is_file($icon_image)) {
$retval = '<img src="' . $_MAPS_CONF['images_icons_url'] . $A['icon_image'] . '" alt="' . $A['icon_image'] . '">';
} else {
$retval = '';
}
break;
default:
$retval = $fieldvalue;
break;
}
return $retval;
}
示例10: EVLIST_adminRSVP
/**
* Administer user registrations.
* This will appear in the admin area for administrators, and as part of
* the event detail for event owners. Owners can delete registrations.
*
* @param integer $rp_id Repeat ID being viewed or checked
* @return string HTML for admin list
*/
function EVLIST_adminRSVP($rp_id)
{
global $LANG_EVLIST, $LANG_ADMIN, $_TABLES, $_CONF, $_IMAGE_TYPE;
/*
+-------------------+----------+-------------------+-------+-------+-------+-----+------+------+
| tic_id | tic_type | ev_id | rp_id | fee | paid | uid | used | dt |
+-------------------+----------+-------------------+-------+-------+-------+-----+------+------+
| 20150209083155975 | 1 | 20150209081055236 | 7552 | 15.00 | 15.00 | 3 | 0 | 0 |
+-------------------+----------+-------------------+-------+-------+-------+-----+------+------+
1 row in set (0.00 sec)
*/
USES_lib_admin();
USES_evlist_class_repeat();
$Ev = new evRepeat($rp_id);
if ($Ev->rp_id == 0) {
return '';
}
DB_query("SET @tk_count = 0;");
$sql = "SELECT @tk_count := @tk_count +1 as tic_count,\n tk.dt, tk.tic_id, tk.tic_type, tk.rp_id, tk.fee, tk.paid,\n tk.uid, tk.used, tt.description, u.fullname,\n {$Ev->Event->options['max_rsvp']} as max_rsvp\n FROM {$_TABLES['evlist_tickets']} tk\n LEFT JOIN {$_TABLES['evlist_tickettypes']} tt\n ON tt.id = tk.tic_type\n LEFT JOIN {$_TABLES['users']} u\n ON u.uid = tk.uid\n WHERE tk.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);
$title .= ' <a href="' . $_CONF['site_admin_url'] . '/plugins/evlist/index.php?printtickets&eid=' . $Ev->ev_id . '" class="lgButton blue" target="_new">' . $LANG_EVLIST['print_tickets'] . '</a>';
$title .= ' <a href="' . $_CONF['site_admin_url'] . '/plugins/evlist/index.php?exporttickets&eid=' . $Ev->rp_id . '" class="lgButton blue">' . $LANG_EVLIST['export_list'] . '</a>';
if ($Ev->Event->options['use_reg'] == EV_RSVP_REPEAT) {
$sql .= " AND rp_id = '{$Ev->rp_id}' ";
}
$defsort_arr = array('field' => 'dt', 'direction' => 'ASC');
$text_arr = array('has_menu' => false, 'has_extras' => false, 'title' => $title, 'form_url' => EVLIST_URL . '/event.php?rp_id=' . $rp_id, 'help_url' => '');
$header_arr = array(array('text' => $LANG_EVLIST['rsvp_date'], 'field' => 'dt', 'sort' => true), array('text' => $LANG_EVLIST['name'], 'field' => 'fullname', 'sort' => false), array('text' => $LANG_EVLIST['fee'], 'field' => 'fee', 'sort' => false), array('text' => $LANG_EVLIST['paid'], 'field' => 'paid', 'sort' => false), array('text' => $LANG_EVLIST['ticket_num'], 'field' => 'tic_id', 'sort' => false), array('text' => $LANG_EVLIST['date_used'], 'field' => 'used', 'sort' => false), array('text' => $LANG_EVLIST['waitlisted'], 'field' => 'tic_count', 'sort' => false));
$options_arr = array('chkdelete' => true, 'chkfield' => 'tic_id', 'chkname' => 'delrsvp', 'chkactions' => '<input data-uk-tooltip name="tickdelete" type="image" src="' . $_CONF['layout_url'] . '/images/admin/delete.' . $_IMAGE_TYPE . '" style="vertical-align:text-bottom;" title="' . $LANG_ADMIN['delete'] . '" class="gl_mootip"' . ' onclick="return confirm(\'' . $LANG_EVLIST['conf_del_item'] . '\');" /> ' . $LANG_ADMIN['delete'] . ' ' . '<input data-uk-tooltip name="tickreset" type="image" src="' . $_CONF['site_url'] . '/evlist/images/reset.png' . '" style="vertical-align:text-bottom;" title="' . $LANG_EVLIST['reset_usage'] . '" class="gl_mootip"' . ' onclick="return confirm(\'' . $LANG_EVLIST['conf_reset'] . '\');" /> ' . $LANG_EVLIST['reset_usage'] . '<input type="hidden" name="ev_id" value="' . $rp_id . '"/>');
$query_arr = array('sql' => $sql);
$retval .= ADMIN_list('evlist', 'EVLIST_getField_rsvp', $header_arr, $text_arr, $query_arr, $defsort_arr, '', '', $options_arr);
return $retval;
}
示例11: DBADMIN_list
/**
* List all backups, i.e. all files ending in .sql or .sql.gz
*
* @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;
global $token;
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(\\.gz)?$/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();
$diskIconUrl = $_CONF['layout_url'] . '/images/admin/disk.' . $_IMAGE_TYPE;
$attr['title'] = $LANG_DB_BACKUP['download'];
$alt = $LANG_DB_BACKUP['download'];
$num_backups = count($backups);
$icon_img = COM_createImage($diskIconUrl, $alt, $attr);
for ($i = 0; $i < $num_backups; $i++) {
$downloadUrl = LGLIB_ADMIN_URL . '/index.php?download=x&file=' . urlencode($backups[$i]);
$downloadLink = COM_createLink($icon_img, $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]);
}
$retval .= DBADMIN_menu("<p>{$LANG_DB_BACKUP['db_explanation']}</p><p>" . sprintf($LANG_DB_BACKUP['total_number'], $index) . '</p>');
$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' => LGLIB_ADMIN_URL . '/index.php');
$form_arr = array('bottom' => '', 'top' => '');
if ($num_backups > 0) {
$form_arr['bottom'] = '<input type="hidden" name="delete" value="x" />' . '<input type="hidden" name="' . CSRF_TOKEN . '" value="' . $token . '" />' . 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;
}
示例12: TRB_renderTrackbackComments
/**
* Render all the trackback comments for a specific entry
*
* @param string $sid entry id
* @param string $type type of entry ('article' = story, etc.)
* @param string $title the entry's title
* @param string $permalink link to the entry
* @param string trackback_url trackback URL for this entry
* @return string HTML (formatted list of trackback comments)
*
*/
function TRB_renderTrackbackComments($sid, $type, $title, $permalink, $trackback_url = '')
{
global $_CONF, $_TABLES, $LANG_TRB;
$link_and_title = COM_createLink($title, $permalink);
if (empty($trackback_url)) {
$trackback_url = TRB_makeTrackbackUrl($sid, $type);
}
$template = COM_newTemplate($_CONF['path_layout'] . 'trackback');
$template->set_file(array('trackback' => 'trackback.thtml', 'comment' => 'trackbackcomment.thtml'));
$template->set_var('lang_trackback', $LANG_TRB['trackback']);
$template->set_var('lang_trackback_url', $LANG_TRB['this_trackback_url']);
$template->set_var('permalink', $permalink);
$template->set_var('permalink_and_title', $link_and_title);
$template->set_var('trackback_url', $trackback_url);
$result = DB_query("SELECT cid,url,title,blog,excerpt,ipaddress,UNIX_TIMESTAMP(date) AS day " . "FROM {$_TABLES['trackback']} WHERE sid = '{$sid}' AND type = '{$type}' ORDER BY date");
$numrows = DB_numRows($result);
$template->set_var('trackback_comment_count', $numrows);
$num_comments = sprintf($LANG_TRB['num_comments'], $numrows);
$template->set_var('trackback_comment_text', $num_comments);
if ($numrows == 0) {
$template->set_var('lang_trackback_comments', $LANG_TRB['no_comments']);
$template->set_var('lang_trackback_comments_no_link', $LANG_TRB['no_comments']);
} else {
$template->set_var('lang_trackback_comments', sprintf($LANG_TRB['intro_text'], $link_and_title));
$template->set_var('lang_trackback_comments_no_link', sprintf($LANG_TRB['intro_text'], $title));
}
$delete_option = TRB_allowDelete($sid, $type);
$token = '';
if ($delete_option && $numrows > 0) {
$token = SEC_createToken();
}
for ($i = 0; $i < $numrows; $i++) {
$A = DB_fetchArray($result);
$comment = TRB_formatComment($A['url'], $A['title'], $A['blog'], $A['excerpt'], $A['day'], $delete_option, $A['cid'], $A['ipaddress'], $token);
$template->set_var('formatted_comment', $comment);
$template->parse('trackback_comments', 'comment', true);
}
$template->parse('output', 'trackback');
return $template->finish($template->get_var('output'));
}
示例13: plugin_getListField_maps
/**
* Get an individual field for the maps screen.
*
* @param string $fieldname Name of field (from the array, not the db)
* @param mixed $fieldvalue Value of the field
* @param array $A Array of all fields from the database
* @param array $icon_arr System icon array
* @param object $EntryList This entry list object
* @return string HTML for field display in the table
*/
function plugin_getListField_maps($fieldname, $fieldvalue, $A, $icon_arr)
{
global $_CONF, $LANG_ADMIN, $LANG_STATIC, $_TABLES, $_MAPS_CONF;
switch ($fieldname) {
case "edit":
$retval = COM_createLink($icon_arr['edit'], "{$_CONF['site_admin_url']}/plugins/maps/map_edit.php?mode=edit&mid={$A['mid']}");
break;
case "name":
$map_title = stripslashes($A['name']);
$url = $_MAPS_CONF['site_url'] . '/index.php?mode=map&mid=' . $A['mid'];
$link = COM_createLink($map_title, $url, array('title' => $LANG_MAPS_1['title_display']));
if ($A['description'] != '') {
$retval = COM_getTooltip($A['name'], $A['description'], $url, $A['name'], 'help');
} else {
$retval = $link;
}
break;
case "id":
$retval = $A['mid'];
break;
case "active":
if ($fieldvalue == 1) {
$retval = '<img src="' . $_CONF['site_admin_url'] . '/plugins/maps/images/green_dot.gif" alt="" valign="center">';
} else {
$retval = '<img src="' . $_CONF['site_admin_url'] . '/plugins/maps/images/red_dot.gif" alt="">';
}
break;
case "hidden":
if ($fieldvalue == 0) {
$retval = '<img src="' . $_CONF['site_admin_url'] . '/plugins/maps/images/green_dot.gif" alt="">';
} else {
$retval = '<img src="' . $_CONF['site_admin_url'] . '/plugins/maps/images/red_dot.gif" alt="">';
}
break;
default:
$retval = stripslashes($fieldvalue);
break;
}
return $retval;
}
示例14: SEC_loginForm
/**
* Displays a login form
* This is the version of the login form displayed in the content area of the
* page (not the side bar). It will present all options (remote authentication
* - including OpenID, new registration link, etc.) according to the current
* configuration settings.
*
* @param array $use_config options to override some of the defaults
* @return string HTML of the login form
*/
function SEC_loginForm($use_config = array())
{
global $_CONF, $LANG01, $LANG04, $_SCRIPTS;
$retval = '';
$have_remote_login = false;
$default_config = array('hide_forgotpw_link' => false, 'hidden_fields' => '', 'no_oauth_login' => false, 'no_3rdparty_login' => false, 'no_openid_login' => false, 'no_newreg_link' => false, 'no_plugin_vars' => false, 'title' => $LANG04[65], 'message' => $LANG04[66], 'button_text' => $LANG04[80]);
$config = array_merge($default_config, $use_config);
$loginform = COM_newTemplate($_CONF['path_layout'] . 'users');
$loginform->set_file('login', 'loginform.thtml');
$loginform->set_var('start_block_loginagain', COM_startBlock($config['title']));
$loginform->set_var('lang_message', $config['message']);
if ($config['no_newreg_link'] || $_CONF['disable_new_user_registration']) {
$loginform->set_var('lang_newreglink', '');
} else {
$loginform->set_var('lang_newreglink', $LANG04[123]);
}
$loginform->set_var('lang_username', $LANG04[2]);
$loginform->set_var('lang_password', $LANG01[57]);
if ($config['hide_forgotpw_link']) {
$loginform->set_var('lang_forgetpassword', '');
$loginform->set_var('forgetpassword_link', '');
} else {
$loginform->set_var('lang_forgetpassword', $LANG04[25]);
$forget = COM_createLink($LANG04[25], $_CONF['site_url'] . '/users.php?mode=getpassword', array('rel' => 'nofollow'));
$loginform->set_var('forgetpassword_link', $forget);
}
$loginform->set_var('lang_login', $config['button_text']);
$loginform->set_var('lang_remote_login', $LANG04[167]);
$loginform->set_var('lang_remote_login_desc', $LANG04[168]);
$loginform->set_var('end_block', COM_endBlock());
// 3rd party remote authentification.
$services = '';
if (!$config['no_3rdparty_login'] && $_CONF['user_login_method']['3rdparty'] && $_CONF['usersubmission'] == 0) {
$modules = SEC_collectRemoteAuthenticationModules();
if (count($modules) > 0) {
if (!$_CONF['user_login_method']['standard'] && count($modules) == 1) {
$select = '<input type="hidden" name="service" value="' . $modules[0] . '"' . XHTML . '>' . $modules[0];
} else {
// Build select
$select = '<select name="service">';
if ($_CONF['user_login_method']['standard']) {
$select .= '<option value="">' . $_CONF['site_name'] . '</option>';
}
foreach ($modules as $service) {
$select .= '<option value="' . $service . '">' . $service . '</option>';
}
$select .= '</select>';
}
$loginform->set_file('services', 'services.thtml');
$loginform->set_var('lang_service', $LANG04[121]);
$loginform->set_var('select_service', $select);
$loginform->parse('output', 'services');
$services .= $loginform->finish($loginform->get_var('output'));
}
}
if (!empty($config['hidden_fields'])) {
// allow caller to (ab)use {services} for hidden fields
$services .= $config['hidden_fields'];
}
$loginform->set_var('services', $services);
// OpenID remote authentification.
if (!$config['no_openid_login'] && $_CONF['user_login_method']['openid'] && $_CONF['usersubmission'] == 0 && !$_CONF['disable_new_user_registration']) {
$have_remote_login = true;
$_SCRIPTS->setJavascriptFile('login', '/javascript/login.js');
$loginform->set_file('openid_login', '../loginform_openid.thtml');
$loginform->set_var('lang_openid_login', $LANG01[128]);
$loginform->set_var('input_field_size', 40);
// for backward compatibility - not used any more
$app_url = isset($_SERVER['SCRIPT_URI']) ? $_SERVER['SCRIPT_URI'] : 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
$loginform->set_var('app_url', $app_url);
$loginform->parse('output', 'openid_login');
$loginform->set_var('openid_login', $loginform->finish($loginform->get_var('output')));
} else {
$loginform->set_var('openid_login', '');
}
// OAuth remote authentification.
if (!$config['no_oauth_login'] && $_CONF['user_login_method']['oauth'] && $_CONF['usersubmission'] == 0 && !$_CONF['disable_new_user_registration']) {
$have_remote_login = true;
$_SCRIPTS->setJavascriptFile('login', '/javascript/login.js');
$modules = SEC_collectRemoteOAuthModules();
if (count($modules) == 0) {
$loginform->set_var('oauth_login', '');
} else {
$html_oauth = '';
// Grab oauth icons from theme
if ($_CONF['theme_oauth_icons']) {
$icon_path = $_CONF['layout_url'] . '/images/';
} else {
$icon_path = $_CONF['site_url'] . '/images/';
}
//.........这里部分代码省略.........
示例15: userprofile
//.........这里部分代码省略.........
$user_templates->set_var('end_block', COM_endBlock());
$user_templates->set_var('lang_username', $LANG04[2]);
$user_templates->set_var('tooltip', COM_getTooltipStyle());
if ($_CONF['show_fullname'] == 1) {
if (empty($A['fullname'])) {
$username = $A['username'];
$fullname = '';
} else {
$username = $A['fullname'];
$fullname = $A['username'];
}
} else {
$username = $A['username'];
$fullname = '';
}
$username = @htmlspecialchars($username, ENT_COMPAT, COM_getEncodingt());
$fullname = @htmlspecialchars($fullname, ENT_COMPAT, COM_getEncodingt());
if ($A['status'] == USER_ACCOUNT_DISABLED) {
$username = sprintf('%s - %s', $username, $LANG28[42]);
if (!empty($fullname)) {
$fullname = sprintf('% - %s', $fullname, $LANG28[42]);
}
}
$user_templates->set_var('username', $username);
$user_templates->set_var('user_fullname', $fullname);
if (SEC_hasRights('user.edit') || isset($_USER['uid']) && $_USER['uid'] == $A['uid']) {
global $_IMAGE_TYPE, $LANG_ADMIN;
$edit_icon = '<img src="' . $_CONF['layout_url'] . '/images/edit.' . $_IMAGE_TYPE . '" alt="' . $LANG_ADMIN['edit'] . '" title="' . $LANG_ADMIN['edit'] . '" />';
if ($_USER['uid'] == $A['uid']) {
$edit_url = "{$_CONF['site_url']}/usersettings.php";
} else {
$edit_url = "{$_CONF['site_admin_url']}/user.php?edit=x&uid={$A['uid']}";
}
$edit_link_url = COM_createLink($edit_icon, $edit_url);
$user_templates->set_var('edit_icon', $edit_icon);
$user_templates->set_var('edit_link', $edit_link_url);
$user_templates->set_var('user_edit', $edit_url);
} else {
$user_templates->set_var('user_edit', '');
}
if (isset($A['photo']) && empty($A['photo'])) {
$A['photo'] = '(none)';
// user does not have a photo
}
$lastlogin = $A['lastlogin'];
$lasttime = COM_getUserDateTimeFormat($lastlogin);
$photo = USER_getPhoto($user, $A['photo'], $A['email'], -1, 0);
$user_templates->set_var('user_photo', $photo);
$user_templates->set_var('lang_membersince', $LANG04[67]);
$user_templates->set_var('user_regdate', $A['regdate']);
if ($_CONF['lastlogin'] && $A['showonline']) {
$user_templates->set_var('lang_lastlogin', $LANG28[35]);
if (!empty($lastlogin)) {
$user_templates->set_var('user_lastlogin', $lasttime[0]);
} else {
$user_templates->set_var('user_lastlogin', $LANG28[36]);
}
}
if ($A['showonline']) {
if (DB_count($_TABLES['sessions'], 'uid', (int) $user)) {
$user_templates->set_var('online', 'online');
}
}
$user_templates->set_var('lang_email', $LANG04[5]);
$user_templates->set_var('user_id', $user);
if ($A['email'] == '' || $A['emailfromuser'] == 0) {