本文整理汇总了PHP中varsettrue函数的典型用法代码示例。如果您正苦于以下问题:PHP varsettrue函数的具体用法?PHP varsettrue怎么用?PHP varsettrue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了varsettrue函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getListData
function getListData()
{
$list_caption = $this->parent->settings['caption'];
$list_display = $this->parent->settings['open'] ? "" : "none";
$qry = '';
if ($this->parent->mode == "new_page" || $this->parent->mode == "new_menu") {
$qry = "user_join>" . $this->parent->getlvisit() . " AND ";
}
$qry .= " user_ban=0 ORDER BY user_join DESC LIMIT 0," . intval($this->parent->settings['amount']);
$bullet = $this->parent->getBullet($this->parent->settings['icon']);
if (!$this->parent->e107->sql->db_Select_gen("SELECT user_id,user_name,user_join FROM #user WHERE " . $qry)) {
$list_data = LIST_MEMBER_2;
} else {
while ($row = $this->parent->e107->sql->db_Fetch()) {
$record = array();
$rowheading = $this->parent->parse_heading($row['user_name']);
$record['icon'] = $bullet;
$record['heading'] = USER ? "<a href='" . e_BASE . "user.php?id." . $row['user_id'] . "'>" . $rowheading . "</a>" : $rowheading;
$record['category'] = '';
$record['author'] = '';
$record['date'] = varsettrue($this->parent->settings['date']) ? $this->parent->getListDate($row['user_join']) : "";
$record['info'] = '';
$list_data[] = $record;
}
}
//return array with 'records', (global)'caption', 'display'
return array('records' => $list_data, 'caption' => $list_caption, 'display' => $list_display);
}
示例2: getListData
function getListData()
{
$list_caption = $this->parent->settings['caption'];
$list_display = $this->parent->settings['open'] ? "" : "none";
if ($this->parent->mode == "new_page" || $this->parent->mode == "new_menu") {
$qry = " AND download_datestamp>" . $this->parent->getlvisit();
} else {
$qry = '';
}
$bullet = $this->parent->getBullet($this->parent->settings['icon']);
$qry = "SELECT d.download_id, d.download_name, d.download_author, d.download_datestamp,\n\t\t dc.download_category_id, dc.download_category_name, dc.download_category_class\n\t\t FROM #download AS d\n\t\t LEFT JOIN #download_category AS dc ON d.download_category=dc.download_category_id\n\t\t WHERE dc.download_category_class REGEXP '" . e_CLASS_REGEXP . "' AND d.download_class REGEXP '" . e_CLASS_REGEXP . "' AND d.download_active != '0' " . $qry . "\n\t\t ORDER BY download_datestamp DESC LIMIT 0," . intval($this->parent->settings['amount']) . " ";
$downloads = $this->parent->e107->sql->db_Select_gen($qry);
if ($downloads == 0) {
$list_data = LIST_DOWNLOAD_2;
} else {
$list_data = array();
while ($row = $this->parent->e107->sql->db_Fetch()) {
$record = array();
$rowheading = $this->parent->parse_heading($row['download_name']);
$record['icon'] = $bullet;
$record['heading'] = "<a href='" . e_BASE . "download.php?view." . $row['download_id'] . "'>" . $rowheading . "</a>";
$record['author'] = varsettrue($this->parent->settings['author']) ? $row['download_author'] : "";
$record['category'] = varsettrue($this->parent->settings['category']) ? "<a href='" . e_BASE . "download.php?list." . $row['download_category_id'] . "'>" . $row['download_category_name'] . "</a>" : "";
$record['date'] = varsettrue($this->parent->settings['date']) ? $this->parent->getListDate($row['download_datestamp']) : "";
$record['info'] = "";
$list_data[] = $record;
}
}
//return array with 'records', (global)'caption', 'display'
return array('records' => $list_data, 'caption' => $list_caption, 'display' => $list_display);
}
示例3: returnSelectors
/**
* Return data representing the user's selection criteria as entered in the $_POST array.
*
* The value returned can be as simple as an array of chosen fields from the $_POST array, or it may be processed to make it more
* convenient to use later. (In general, at least basic sanitising should be performed)
* Conflicting selection criteria can also be resolved here.
* The returned data is stored in the DB with a saved email. (Just return an empty string or array if this is undesirable)
* The returned value is passed back to selectInit() and showSelect when needed.
*
* @return mixed Selection data - may be string, array or whatever suits
*/
public function returnSelectors()
{
$tp = e107::getParser();
$res = array();
foreach ($this->selectFields as $k) {
if (varsettrue($_POST[$k])) {
$res[$k] = $tp->toDB($_POST[$k]);
}
}
return $res;
}
示例4: toHTML
/**
* Translate to <p> tag
*/
function toHTML($code_text, $parm)
{
if ($parm && !strpos($parm, '=')) {
$parm = 'class=' . $parm;
}
$code_text = trim($code_text);
$parms = eHelper::scParams($parm);
$class = " " . e107::getBB()->getClass('p');
// consistent classes across all themes.
$id = varsettrue($parms['id']) ? ' id="' . eHelper::secureIdAttr($parms['id']) . '"' : '';
$style = varsettrue($parms['style']) ? ' style="' . eHelper::secureStyleAttr($parms['style']) . '"' : '';
return "<p{$id}{$class}{$style}>" . $code_text . '</p>';
}
示例5: toHTML
/**
* Translate youtube bbcode into the appropriate HTML
*/
function toHTML($code_text, $parm)
{
// transform to class, equal sign at 0 position is not well formed parm string
if ($parm && !strpos($parm, '=')) {
$parm = 'class=' . $parm;
}
$parms = eHelper::scParams($parm);
$class = " " . e107::getBB()->getClass('block');
$id = varsettrue($parms['id']) ? ' id=' . eHelper::secureIdAttr($parms['id']) : '';
$style = varsettrue($parms['style']) ? ' style="' . eHelper::secureStyleAttr($parms['style']) . '"' : '';
if (empty($code_text)) {
$code_text = '<!-- -->';
}
return '<div' . $id . $class . $style . '>' . $code_text . '</div>';
}
示例6: toHTML
/**
* Translate to <h*> tag
*/
function toHTML($code_text, $parm)
{
$code_text = trim($code_text);
if (empty($code_text)) {
return '';
}
$bparms = eHelper::scDualParams($parm);
$h = 'h' . ($bparms[1] ? intval($bparms[1]) : 2);
$parms = $bparms[2];
unset($bparms);
$class = " " . e107::getBB()->getClass('h2');
// consistent classes across all themes.
$id = varsettrue($parms['id']) ? ' id=' . eHelper::secureIdAttr($parms['id']) : '';
$style = varsettrue($parms['style']) ? ' style="' . eHelper::secureStyleAttr($parms['style']) . '"' : '';
return "<{$h}{$id}{$class}{$style}>" . $code_text . "</{$h}>";
}
示例7: getListData
function getListData()
{
if ($this->parent->mode == "new_page" || $this->parent->mode == "new_menu") {
$qry = " n.news_datestamp>" . $this->parent->getlvisit();
} else {
$qry = " (n.news_start=0 || n.news_start < " . time() . ") AND (n.news_end=0 || n.news_end>" . time() . ") ";
}
$bullet = $this->parent->getBullet($this->parent->settings['icon']);
$list_caption = $this->parent->settings['caption'];
$list_display = varsettrue($this->parent->settings['open']) ? '' : 'none';
$qry = "\n\t\tSELECT n.*, c.category_id AS news_category_id, c.category_name AS news_category_name, u.user_id AS news_author_id, u.user_name AS news_author_name\n\t\tFROM #news AS n\n\t\tLEFT JOIN #news_category AS c ON c.category_id = n.news_category\n\t\tLEFT JOIN #user AS u ON n.news_author = u.user_id\n\t\tWHERE " . $qry . " AND n.news_class REGEXP '" . e_CLASS_REGEXP . "'\n\t\tORDER BY n.news_datestamp DESC LIMIT 0," . intval($this->parent->settings['amount']);
if (!$this->parent->e107->sql->db_Select_gen($qry)) {
$list_data = LIST_NEWS_2;
} else {
$list_data = array();
while ($row = $this->parent->e107->sql->db_Fetch()) {
$row['news_title'] = $this->parse_news_title($row['news_title']);
$rowheading = $this->parent->parse_heading($row['news_title']);
$record = array();
$record['icon'] = $bullet;
$record['heading'] = "<a href='" . e_BASE . "news.php?item." . $row['news_id'] . "'>" . $rowheading . "</a>";
$record['author'] = '';
if (varsettrue($this->parent->settings['author'])) {
if ($row['news_author'] == 0) {
$record['author'] = $row['news_author'];
} else {
if (varsettrue($row['news_author_name'])) {
$record['author'] = "<a href='" . e_BASE . "user.php?id." . $row['news_author_id'] . "'>" . $row['news_author_name'] . "</a>";
}
}
}
$record['category'] = '';
if (varsettrue($this->parent->settings['category'])) {
$record['category'] = "<a href='" . e_BASE . "news.php?cat." . $row['news_category_id'] . "'>" . $row['news_category_name'] . "</a>";
}
$record['date'] = '';
if (varsettrue($this->parent->settings['date'])) {
$record['date'] = $this->parent->getListDate($row['news_datestamp']);
}
$record['info'] = '';
//collect each result
$list_data[] = $record;
}
}
//return array with 'records', (global)'caption', 'display'
return array('records' => $list_data, 'caption' => $list_caption, 'display' => $list_display);
}
示例8: getListData
function getListData()
{
global $tp, $cobj;
$list_caption = $this->parent->settings['caption'];
$list_display = $this->parent->settings['open'] ? "" : "none";
$bullet = $this->parent->getBullet($this->parent->settings['icon']);
$qry = '';
if ($this->parent->mode == "new_page" || $this->parent->mode == "new_menu") {
$qry = "comment_datestamp>" . $this->parent->getlvisit();
}
$data = $cobj->getCommentData(intval($this->parent->settings['amount']), '0', $qry);
if (empty($data)) {
$list_data = LIST_COMMENT_2;
} else {
$list_data = array();
foreach ($data as $row) {
$record = array();
$rowheading = $this->parent->parse_heading($row['comment_title']);
$record['icon'] = $bullet;
if ($row['comment_url']) {
$record['heading'] = "<a href='" . $row['comment_url'] . "'>" . $this->parent->e107->tp->toHTML($rowheading, true) . "</a>";
} else {
$record['heading'] = $this->parent->e107->tp->toHTML($rowheading, true);
}
$category = '';
if (varsettrue($this->parent->settings['category'])) {
if ($row['comment_category_url']) {
$record['category'] = "<a href='" . $row['comment_category_url'] . "'>" . $row['comment_category_heading'] . "</a>";
} else {
$record['category'] = $row['comment_category_heading'];
}
}
$record['author'] = varsettrue($this->parent->settings['author']) ? $row['comment_author'] : '';
$record['date'] = varsettrue($this->parent->settings['date']) ? $this->parent->getListDate($row['comment_datestamp']) : "";
$record['icon'] = $bullet;
$record['info'] = '';
$list_data[] = $record;
}
}
//return array with 'records', (global)'caption', 'display'
return array('records' => $list_data, 'caption' => $list_caption, 'display' => $list_display);
}
示例9: run_updates
function run_updates($dbupdate)
{
global $mes;
foreach ($dbupdate as $func => $rmks) {
if (function_exists('update_' . $func)) {
$installed = call_user_func("update_" . $func);
//?! (LAN_UPDATE == $_POST[$func])
if (varsettrue($_POST['update_core'][$func]) && !$installed) {
if (function_exists("update_" . $func)) {
$message = LAN_UPDATE_7 . " {$rmks}";
$error = call_user_func("update_" . $func, "do");
if ($error != '') {
$mes->add($message, E_MESSAGE_ERROR);
$mes->add($error, E_MESSAGE_ERROR);
} else {
$mes->add($message, E_MESSAGE_SUCCESS);
}
}
}
}
}
}
示例10: sc_tag_options
function sc_tag_options()
{
global $tag;
if (varsettrue($tag->pref['tagwords_view_search']) == 1 || varsettrue($tag->pref['tagwords_view_sort']) == 1 || varsettrue($tag->pref['tagwords_view_style']) == 1 || varsettrue($tag->pref['tagwords_view_area']) == 1) {
return $this->e107->tp->parseTemplate($tag->template['options'], true, $tag->shortcodes);
}
}
示例11: make_def
function make_def($list)
{
switch ($list['type']) {
case 'key':
return 'KEY ' . $list['name'] . ' (' . str_replace(array('(', ')'), '', $list['keyfield']) . ')';
case 'ukey':
return 'UNIQUE KEY ' . $list['name'] . ' (' . str_replace(array('(', ')'), '', $list['keyfield']) . ')';
case 'ftkey':
return 'FULLTEXT KEY ' . $list['name'] . ' (' . str_replace(array('(', ')'), '', $list['keyfield']) . ')';
case 'pkey':
return 'PRIMARY KEY (' . $list['name'] . ')';
case 'field':
// Require a field - got a key. so add a field at the end
$def = $list['name'];
if (isset($list['fieldtype'])) {
$def .= ' ' . $list['fieldtype'];
}
if (isset($list['vartype'])) {
$def .= ' ' . $list['vartype'];
}
if (isset($list['nulltype'])) {
$def .= ' ' . $list['nulltype'];
}
if (isset($list['default'])) {
$def .= ' default ' . $list['default'];
}
if (varsettrue($list['autoinc'])) {
$def .= ' auto_increment';
}
return $def;
}
return "Cannot generate definition for: " . $list['type'] . ' ' . $list['name'];
}
示例12: pluginRenderPlugin
function pluginRenderPlugin($pluginList)
{
global $plugin;
if (empty($pluginList)) {
return '';
}
$tp = e107::getParser();
$frm = e107::getForm();
$text = "";
foreach ($pluginList as $plug) {
e107::loadLanFiles($plug['plugin_path'], 'admin');
$_path = e_PLUGIN . $plug['plugin_path'] . '/';
$plug_vars = false;
$plugin_config_icon = "";
if ($plugin->parse_plugin($plug['plugin_path'])) {
$plug_vars = $plugin->plug_vars;
}
if (varset($plug['plugin_category']) == "menu") {
continue;
}
if ($plug_vars) {
$icon_src = (isset($plug_vars['plugin_php']) ? e_PLUGIN : $_path) . $plug_vars['administration']['icon'];
$plugin_icon = $plug_vars['administration']['icon'] ? "<img src='{$icon_src}' alt='' class='icon S32' />" : E_32_CAT_PLUG;
$conf_file = "#";
$conf_title = "";
if ($plug_vars['administration']['configFile'] && $plug['plugin_installflag'] == true) {
$conf_file = e_PLUGIN . $plug['plugin_path'] . '/' . $plug_vars['administration']['configFile'];
$conf_title = LAN_CONFIGURE . ' ' . $tp->toHtml($plug_vars['@attributes']['name'], "", "defs,emotes_off, no_make_clickable");
$plugin_icon = "<a title='{$conf_title}' href='{$conf_file}' >" . $plugin_icon . "</a>";
$plugin_config_icon = "<a title='{$conf_title}' href='{$conf_file}' >" . ADMIN_CONFIGURE_ICON . "</a>";
}
$plugEmail = varset($plug_vars['author']['@attributes']['email'], '');
$plugAuthor = varset($plug_vars['author']['@attributes']['name'], '');
$plugURL = varset($plug_vars['author']['@attributes']['url'], '');
$plugDate = varset($plug_vars['@attributes']['date'], '');
$description = varset($plug_vars['description']['@attributes']['lang']) ? $tp->toHTML($plug_vars['description']['@attributes']['lang'], false, "defs,emotes_off, no_make_clickable") : $tp->toHTML($plug_vars['description']['@value'], false, "emotes_off, no_make_clickable");
$plugReadme = "";
if (varset($plug['plugin_installflag'])) {
$plugName = "<a title='{$conf_title}' href='{$conf_file}' >" . $tp->toHTML($plug['plugin_name'], false, "defs,emotes_off, no_make_clickable") . "</a>";
} else {
$plugName = $tp->toHTML($plug['plugin_name'], false, "defs,emotes_off, no_make_clickable");
}
if (varset($plug_vars['readme'])) {
$plugReadme = $plug_vars['readme'];
}
if (varset($plug_vars['readMe'])) {
$plugReadme = $plug_vars['readMe'];
}
$text .= "<tr>";
if (varset($this->fields['plugin_checkboxes'])) {
$rowid = "plugin_checkbox[" . $plug['plugin_id'] . "]";
$text .= "<td class='center middle'>" . $frm->checkbox($rowid, $plug['plugin_id']) . "</td>\n";
}
// $text .= (in_array("plugin_status",$this->fieldpref)) ? "<td class='center'>".$img."</td>" : "";
$text .= in_array("plugin_icon", $this->fieldpref) ? "<td class='center middle'>" . $plugin_icon . "</td>" : "";
$text .= in_array("plugin_name", $this->fieldpref) ? "<td class='middle'>" . $plugName . "</td>" : "";
$text .= in_array("plugin_version", $this->fieldpref) ? "<td class='middle'>" . $plug['plugin_version'] . "</td>" : "";
$text .= in_array("plugin_date", $this->fieldpref) ? "<td class='middle'>" . $plugDate . "</td>" : "";
$text .= in_array("plugin_folder", $this->fieldpref) ? "<td class='middle'>" . $plug['plugin_path'] . "</td>" : "";
$text .= in_array("plugin_category", $this->fieldpref) ? "<td class='middle'>" . $plug['plugin_category'] . "</td>" : "";
$text .= in_array("plugin_author", $this->fieldpref) ? "<td class='middle'><a href='mailto:" . $plugEmail . "' title='" . $plugEmail . "'>" . $plugAuthor . "</a> </td>" : "";
$text .= in_array("plugin_website", $this->fieldpref) ? "<td class='center middle'>" . ($plugURL ? "<a href='{$plugURL}' title='{$plugURL}' >" . ADMIN_URL_ICON . "</a>" : "") . "</td>" : "";
$text .= in_array("plugin_notes", $this->fieldpref) ? "<td class='center middle'>" . ($plugReadme ? "<a href='" . e_PLUGIN . $plug['plugin_path'] . "/" . $plugReadme . "' title='" . $plugReadme . "'>" . ADMIN_INFO_ICON . "</a>" : " ") . "</td>" : "";
$text .= in_array("plugin_description", $this->fieldpref) ? "<td class='middle'>" . $description . "</td>" : "";
$text .= in_array("plugin_compatible", $this->fieldpref) ? "<td class='center middle'>" . varset($plug_vars['@attributes']['compatibility'], '') . "</td>" : "";
$text .= in_array("plugin_compliant", $this->fieldpref) ? "<td class='center middle'>" . (varset($plug_vars['compliant']) || varsettrue($plug_vars['@attributes']['xhtmlcompliant']) ? ADMIN_TRUE_ICON : " ") . "</td>" : "";
// Plugin options Column --------------
$text .= "<td class='center middle'>" . $plugin_config_icon;
if ($plug_vars['@attributes']['installRequired']) {
if ($plug['plugin_installflag']) {
$text .= $plug['plugin_installflag'] ? "<a href=\"" . e_SELF . "?uninstall.{$plug['plugin_id']}\" title='" . EPL_ADLAN_1 . "' >" . ADMIN_UNINSTALLPLUGIN_ICON . "</a>" : "<a href=\"" . e_SELF . "?install.{$plug['plugin_id']}\" title='" . EPL_ADLAN_0 . "' >" . ADMIN_INSTALLPLUGIN_ICON . "</a>";
// $text .= ($plug['plugin_installflag'] ? "<button type='button' class='delete' value='no-value' onclick=\"location.href='".e_SELF."?uninstall.{$plug['plugin_id']}'\"><span>".EPL_ADLAN_1."</span></button>" : "<button type='button' class='update' value='no-value' onclick=\"location.href='".e_SELF."?install.{$plug['plugin_id']}'\"><span>".EPL_ADLAN_0."</span></button>");
if (PLUGIN_SHOW_REFRESH && !varsettrue($plug_vars['plugin_php'])) {
$text .= "<br /><br /><input type='button' class='button' onclick=\"location.href='" . e_SELF . "?refresh.{$plug['plugin_id']}'\" title='" . 'Refresh plugin settings' . "' value='" . 'Refresh plugin settings' . "' /> ";
}
} else {
// $text .= "<input type='button' class='button' onclick=\"location.href='".e_SELF."?install.{$plug['plugin_id']}'\" title='".EPL_ADLAN_0."' value='".EPL_ADLAN_0."' />";
// $text .= "<button type='button' class='update' value='no-value' onclick=\"location.href='".e_SELF."?install.{$plug['plugin_id']}'\"><span>".EPL_ADLAN_0."</span></button>";
$text .= "<a href=\"" . e_SELF . "?install.{$plug['plugin_id']}\" title='" . EPL_ADLAN_0 . "' >" . ADMIN_INSTALLPLUGIN_ICON . "</a>";
}
} else {
if ($plug_vars['menuName']) {
$text .= EPL_NOINSTALL . str_replace("..", "", e_PLUGIN . $plug['plugin_path']) . "/ " . EPL_DIRECTORY;
} else {
$text .= EPL_NOINSTALL_1 . str_replace("..", "", e_PLUGIN . $plug['plugin_path']) . "/ " . EPL_DIRECTORY;
if ($plug['plugin_installflag'] == false) {
e107::getDb()->db_Delete('plugin', "plugin_installflag=0 AND (plugin_path='{$plug['plugin_path']}' OR plugin_path='{$plug['plugin_path']}/' ) ");
}
}
}
if ($plug['plugin_version'] != $plug_vars['@attributes']['version'] && $plug['plugin_installflag']) {
// $text .= "<br /><input type='button' class='button' onclick=\"location.href='".e_SELF."?upgrade.{$plug['plugin_id']}'\" title='".EPL_UPGRADE." to v".$plug_vars['@attributes']['version']."' value='".EPL_UPGRADE."' />";
$text .= "<a href='" . e_SELF . "?upgrade.{$plug['plugin_id']}' title=\"" . EPL_UPGRADE . " to v" . $plug_vars['@attributes']['version'] . "\" >" . ADMIN_UPGRADEPLUGIN_ICON . "</a>";
}
$text .= "</td>";
$text .= "</tr>";
}
}
return $text;
}
示例13: sc_list_displaystyle
function sc_list_displaystyle()
{
//open sections if content exists ? yes if true, else use individual setting of section
return varsettrue($this->list_pref[$this->rc->mode . "_openifrecords"]) && is_array($this->rc->data['records']) ? "" : $this->rc->data['display'];
}
示例14: nextprev_shortcode
//.........这里部分代码省略.........
$parm_count = substr_count($parm, ',');
while ($parm_count < 5) {
$parm .= ',';
$parm_count++;
}
$p = explode(',', $parm, 6);
$total_items = intval($p[0]);
$perpage = intval($p[1]);
// page number instead record start now supported
if (is_numeric($p[2])) {
$current_start = intval($p[2]);
$current_page = $current_start / $perpage + 1;
$total_pages = ceil($total_items / $perpage);
$index_add = 0;
} else {
$perpage = 1;
$current_start = intval(array_pop(explode(':', $p[2], 2)));
$current_page = $current_start;
$total_pages = $total_items;
$index_add = 1;
}
if ($total_items < $perpage) {
return '';
}
$url = trim($p[3]);
$caption = trim($p[4]);
$pagetitle = explode('|', trim($p[5]));
$caption = !$caption || $caption == 'off' ? NP_3 . ' ' : $caption;
while (substr($url, -1) == '.') {
$url = substr($url, 0, -1);
}
}
if ($total_pages > 1) {
if (varsettrue($pref['old_np'])) {
$NP_PRE_ACTIVE = '';
$NP_POST_ACTIVE = '';
$NP_STYLE = '';
if (!defined('NEXTPREV_NOSTYLE') || NEXTPREV_NOSTYLE == FALSE) {
$NP_PRE_ACTIVE = '[';
$NP_POST_ACTIVE = '] ';
$NP_STYLE = "style='text-decoration:underline'";
}
// Use OLD nextprev method
$nppage = '';
$nppage .= "\n\n<!-- Start of Next/Prev -->\n\n";
if ($total_pages > 10) {
//$current_page = ($current_start/$perpage)+1;
for ($c = 0; $c <= 2; $c++) {
if ($perpage * ($c + $index_add) == $current_start) {
$nppage .= $NP_PRE_ACTIVE . "<span class='nextprev_current' {$NP_STYLE} >" . ($c + 1) . "</span>" . $NP_POST_ACTIVE . "\n";
} else {
$link = str_replace("[FROM]", $perpage * ($c + $index_add), $url);
$nppage .= "<a class='nextprev_link' href='{$link}'>" . ($c + 1) . "</a> \n";
}
}
if ($current_page >= 3 && $current_page <= 5) {
for ($c = 3; $c <= $current_page; $c++) {
if ($perpage * ($c + $index_add) == $current_start) {
$nppage .= $NP_PRE_ACTIVE . "<span class='nextprev_current' {$NP_STYLE} >" . ($c + 1) . "</span>" . $NP_POST_ACTIVE . "\n";
} else {
$link = str_replace("[FROM]", $perpage * ($c + $index_add), $url);
$nppage .= "<a class='nextprev_link' href='{$link}'>" . ($c + 1) . "</a> \n";
}
}
} else {
if ($current_page >= 6 && $current_page <= $total_pages - 5) {
示例15: show_prefs
function show_prefs($mailAdmin)
{
global $pref;
$e107 = e107::getInstance();
$frm = e107::getForm();
$mes = e107::getMessage();
e107::getCache()->CachePageMD5 = '_';
$lastload = e107::getCache()->retrieve('emailLastBounce', FALSE, TRUE, TRUE);
$lastBounce = round((time() - $lastload) / 60);
$lastBounceText = $lastBounce > 1256474 ? "<b>Never</b>" : "<b>" . $lastBounce . " minutes </b>ago.";
$text = "\n\t\t<form method='post' action='" . e_SELF . "?" . e_QUERY . "' id='mailsettingsform'>\n\t\t<fieldset id='mail'>\n\t\t<legend>" . LAN_MAILOUT_110 . "</legend>\n\t\t<table class='table adminform'>\n\t\t<colgroup>\n\t\t\t<col class='col-label' />\n\t\t\t<col class='col-control' />\n\t\t</colgroup>\n\t\t<tbody>\n\t\t<tr>\n\t\t\t<td>" . LAN_MAILOUT_110 . "<br /></td>\n\t\t\t<td>" . $frm->admin_button('testemail', LAN_MAILOUT_112, 'other') . " \n\t\t\t<input name='testaddress' class='tbox' type='text' size='40' maxlength='80' value=\"" . (varset($_POST['testaddress']) ? $_POST['testaddress'] : USEREMAIL) . "\" />\n\t\t\t</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<td style='vertical-align:top'>" . LAN_MAILOUT_115 . "<br /></td>\n\t\t<td>\n\t\t<select class='tbox' name='mailer' onchange='disp(this.value)'>\n";
$mailers = array('php', 'smtp', 'sendmail');
foreach ($mailers as $opt) {
$sel = $pref['mailer'] == $opt ? "selected='selected'" : '';
$text .= "<option value='{$opt}' {$sel}>{$opt}</option>\n";
}
$text .= "</select> <span class='field-help'>" . LAN_MAILOUT_116 . "</span><br />";
// SMTP. -------------->
$smtp_opts = explode(',', varset($pref['smtp_options'], ''));
$smtpdisp = $pref['mailer'] != 'smtp' ? "style='display:none;'" : '';
$text .= "<div id='smtp' {$smtpdisp}>\n\t\t<table class='table adminlist' style='margin-right:auto;margin-left:0px;border:0px'>\n\t\t<colgroup>\n\t\t\t<col class='col-label' />\n\t\t\t<col class='col-control' />\n\t\t</colgroup>\n\t\t";
$text .= "\n\t\t<tr>\n\t\t<td>" . LAN_MAILOUT_87 . ": </td>\n\t\t<td>\n\t\t<input class='tbox' type='text' name='smtp_server' size='40' value='" . $pref['smtp_server'] . "' maxlength='50' />\n\t\t</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<td>" . LAN_MAILOUT_88 . ": (" . LAN_OPTIONAL . ") </td>\n\t\t<td style='width:50%;' >\n\t\t<input class='tbox' type='text' name='smtp_username' size='40' value=\"" . $pref['smtp_username'] . "\" maxlength='50' />\n\t\t</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<td>" . LAN_MAILOUT_89 . ": (" . LAN_OPTIONAL . ") </td>\n\t\t<td>\n\t\t<input class='tbox' type='password' name='smtp_password' size='40' value='" . $pref['smtp_password'] . "' maxlength='50' />\n\t\t</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<td>" . LAN_MAILOUT_90 . "</td><td>\n\t\t<select class='tbox' name='smtp_options'>\n\n\t\t<option value=''>" . LAN_MAILOUT_96 . "</option>\n";
$selected = in_array('secure=SSL', $smtp_opts) ? " selected='selected'" : '';
$text .= "<option value='smtp_ssl'{$selected}>" . LAN_MAILOUT_92 . "</option>\n";
$selected = in_array('secure=TLS', $smtp_opts) ? " selected='selected'" : '';
$text .= "<option value='smtp_tls'{$selected}>" . LAN_MAILOUT_93 . "</option>\n";
$selected = in_array('pop3auth', $smtp_opts) ? " selected='selected'" : '';
$text .= "<option value='smtp_pop3auth'{$selected}>" . LAN_MAILOUT_91 . "</option>\n";
$text .= "</select>\n<br />" . LAN_MAILOUT_94 . "</td></tr>";
$text .= "<tr>\n\t\t<td>" . LAN_MAILOUT_57 . "</td><td>\n\t\t";
$checked = varsettrue($pref['smtp_keepalive']) ? "checked='checked'" : '';
$text .= "<input type='checkbox' name='smtp_keepalive' value='1' {$checked} />\n\t\t</td>\n\t\t</tr>";
$checked = in_array('useVERP', $smtp_opts) ? "checked='checked'" : "";
$text .= "<tr>\n\t\t<td>" . LAN_MAILOUT_95 . "</td><td>\n\t\t<input type='checkbox' name='smtp_useVERP' value='1' {$checked} />\n\t\t</td>\n\t\t</tr>\n\t\t</table></div>";
/* FIXME - posting SENDMAIL path triggers Mod-Security rules.
// Sendmail. -------------->
$senddisp = ($pref['mailer'] != 'sendmail') ? "style='display:none;'" : '';
$text .= "<div id='sendmail' {$senddisp}><table style='margin-right:0px;margin-left:auto;border:0px'>";
$text .= "
<tr>
<td>".LAN_MAILOUT_20.": </td>
<td>
<input class='tbox' type='text' name='sendmail' size='60' value=\"".(!$pref['sendmail'] ? "/usr/sbin/sendmail -t -i -r ".$pref['siteadminemail'] : $pref['sendmail'])."\" maxlength='80' />
</td>
</tr>
</table></div>";
*/
$text .= "</td>\n\t</tr>\n\n\n\t<tr>\n\t\t<td>" . LAN_MAILOUT_222 . "</td>\n\t\t<td>";
$text .= $mailAdmin->sendStyleSelect(varset($pref['mail_sendstyle'], 'textonly'), 'mail_sendstyle');
$text .= "<span class='field-help'>" . LAN_MAILOUT_223 . "</span>\n\t\t</td>\n\t</tr>\n\n\n\t\n\t<tr>\n\t\t<td>" . LAN_MAILOUT_25 . "</td>\n\t\t<td> " . LAN_MAILOUT_26 . "\n\t\t<input class='tbox e-spinner' size='3' type='text' name='mail_pause' value='" . $pref['mail_pause'] . "' /> " . LAN_MAILOUT_27 . "<input class='tbox e-spinner' size='3' type='text' name='mail_pausetime' value='" . $pref['mail_pausetime'] . "' /> " . LAN_MAILOUT_29 . ".<br />\n\t\t<span class='field-help'>" . LAN_MAILOUT_30 . "</span>\n\t\t</td>\n\t</tr>\n\n\t\n\t<tr>\n\t\t<td>" . LAN_MAILOUT_156 . "</td>\n\t\t<td><input class='tbox e-spinner' size='3' type='text' name='mail_workpertick' value='" . varset($pref['mail_workpertick'], 5) . "' />\n\t\t<span class='field-help'>" . LAN_MAILOUT_157 . "</span>\n\t\t</td>\n\t</tr>\n";
if (isset($pref['e_mailout_list'])) {
// Allow selection of email address sources
$text .= "<tr>\n\t\t<td>" . LAN_MAILOUT_77 . "</td>\n\t\t<td> \n\t ";
$mail_enable = explode(',', $pref['mailout_enabled']);
foreach ($pref['e_mailout_list'] as $mailer => $v) {
$check = in_array($mailer, $mail_enable) ? "checked='checked'" : "";
$text .= " <input type='checkbox' name='mail_mailer_enabled[]' value='{$mailer}' {$check} /> {$mailer}<br />";
}
$text .= "</td></tr>\n";
}
list($mail_log_option, $mail_log_email) = explode(',', varset($pref['mail_log_options'], '0,0'));
$check = $mail_log_email == 1 ? " checked='checked'" : "";
$text .= "<tr>\n\t\t<td>" . LAN_MAILOUT_72 . "</td>\n\t\t<td> \n\t\t<select class='tbox' name='mail_log_option'>\n\n\t\t<option value='0'" . ($mail_log_option == 0 ? " selected='selected'" : '') . ">" . LAN_MAILOUT_73 . "</option>\n\n\t\t<option value='1'" . ($mail_log_option == 1 ? " selected='selected'" : '') . ">" . LAN_MAILOUT_74 . "</option>\n\n\t\t<option value='2'" . ($mail_log_option == 2 ? " selected='selected'" : '') . ">" . LAN_MAILOUT_75 . "</option>\n\n\t\t<option value='3'" . ($mail_log_option == 3 ? " selected='selected'" : '') . ">" . LAN_MAILOUT_119 . "</option>\n\n\t\t</select>\n\n\t\t<input type='checkbox' name='mail_log_email' value='1' {$check} />" . LAN_MAILOUT_76 . "</td>\n\t</tr>\n";
$text .= "</table></fieldset>\n\t<fieldset id='core-mail-prefs-bounce'>\n\t\t<legend>" . LAN_MAILOUT_31 . "</legend>\n\t\t<table class='table adminform'>\n\t\t<colgroup>\n\t\t\t<col class='col-label' />\n\t\t\t<col class='col-control' />\n\t\t</colgroup>\n\t\t<tbody>\n\t<tr>\n\t\t<td>" . LAN_MAILOUT_231 . "</td><td>";
// bounce divs = mail_bounce_none, mail_bounce_auto, mail_bounce_mail
$autoDisp = $pref['mail_bounce'] != 'auto' ? "style='display:none;'" : '';
$autoMail = $pref['mail_bounce'] != 'mail' ? "style='display:none;'" : '';
$bounceOpts = array('none' => LAN_MAILOUT_232, 'auto' => LAN_MAILOUT_233, 'mail' => LAN_MAILOUT_234);
$text .= "<select name='mail_bounce' class='tbox' onchange='bouncedisp(this.value)'>\n<option value=''> </option>\n";
foreach ($bounceOpts as $k => $v) {
$selected = $pref['mail_bounce'] == $k ? " selected='selected'" : '';
$text .= "<option value='{$k}'{$selected}>{$v}</option>\n";
}
$text .= "</select>\n</td>\n\t</tr></tbody></table>\n\n\n\t\t<table class='adminform' id='mail_bounce_auto' {$autoDisp}>\n\t\t<colgroup>\n\t\t\t<col class='col-label' />\n\t\t\t<col class='col-control' />\n\t\t</colgroup>\n\t\t<tbody>\n\t\t<tr><td>" . LAN_MAILOUT_32 . "</td><td><input class='tbox' size='40' type='text' name='mail_bounce_email2' value=\"" . $pref['mail_bounce_email'] . "\" /></td></tr>\n\t\n\t<tr>\n\t\t<td>" . LAN_MAILOUT_233 . "</td><td><b>" . e_DOCROOT . e107::getFolder('handlers') . "bounce_handler.php</b>";
if (!is_readable(e_HANDLER . 'bounce_handler.php')) {
$text .= "<br /><span class='required'>" . LAN_MAILOUT_161 . '</span>';
} elseif (!is_executable(e_HANDLER . 'bounce_handler.php')) {
$text .= "<br /><span class='required'>" . LAN_MAILOUT_162 . '</span>';
}
$text .= "<br /><span class='field-help'>" . LAN_MAILOUT_235 . "</span></td></tr>\n\t<tr><td>" . LAN_MAILOUT_236 . "</td><td>" . $lastBounceText . "</td></tr>\n\t</tbody></table>";
// Parameters for mail-account based bounce processing
$text .= "\n\t\t<table class='table adminform' id='mail_bounce_mail' {$autoMail}>\n\t\t<colgroup>\n\t\t\t<col class='col-label' />\n\t\t\t<col class='col-control' />\n\t\t</colgroup>\n\t\t<tbody>\n\t\t<tr><td>" . LAN_MAILOUT_32 . "</td><td><input class='tbox' size='40' type='text' name='mail_bounce_email' value=\"" . $pref['mail_bounce_email'] . "\" /></td></tr>\n\t\t<tr><td>" . LAN_MAILOUT_33 . "</td><td><input class='tbox' size='40' type='text' name='mail_bounce_pop3' value=\"" . $pref['mail_bounce_pop3'] . "\" /></td></tr>\n\t\t<tr><td>" . LAN_MAILOUT_34 . "</td><td><input class='tbox' size='40' type='text' name='mail_bounce_user' value=\"" . $pref['mail_bounce_user'] . "\" /></td></tr>\n\t\t<tr><td>" . LAN_MAILOUT_35 . "</td><td><input class='tbox' size='40' type='text' name='mail_bounce_pass' value=\"" . $pref['mail_bounce_pass'] . "\" /></td></tr>\n\t\t<tr><td>" . LAN_MAILOUT_120 . "</td><td><select class='tbox' name='mail_bounce_type'>\n\n\t\t\t<option value=''> </option>\n\n\t\t\t<option value='pop3'" . ($pref['mail_bounce_type'] == 'pop3' ? " selected='selected'" : "") . ">" . LAN_MAILOUT_121 . "</option>\n\n\t\t\t<option value='pop3/notls'" . ($pref['mail_bounce_type'] == 'pop3/notls' ? " selected='selected'" : "") . ">" . LAN_MAILOUT_122 . "</option>\n\n\t\t\t<option value='pop3/tls'" . ($pref['mail_bounce_type'] == 'pop3/tls' ? " selected='selected'" : "") . ">" . LAN_MAILOUT_123 . "</option>\n\n\t\t\t<option value='imap'" . ($pref['mail_bounce_type'] == 'imap' ? " selected='selected'" : "") . ">" . LAN_MAILOUT_124 . "</option>\n\n\t\t</select></td></tr>\n\n\t\t";
$check = $pref['mail_bounce_delete'] == 1 ? " checked='checked'" : "";
$text .= "<tr><td>" . LAN_MAILOUT_36 . "</td><td><input type='checkbox' name='mail_bounce_delete' value='1' {$check} /></td></tr>";
$check = $pref['mail_bounce_auto'] == 1 ? " checked='checked'" : "";
$text .= "<tr><td>" . LAN_MAILOUT_245 . "</td><td><input type='checkbox' name='mail_bounce_auto' value='1' {$check} /><span class='field-help'> " . LAN_MAILOUT_246 . "</span></td></tr>\n\n\t</tbody>\n\t</table></fieldset>\n\n\t<div class='buttons-bar center'>" . $frm->admin_button('updateprefs', LAN_MAILOUT_28, 'update') . "</div>\n\n\t</form>";
$caption = ADLAN_136 . ' :: ' . LAN_PREFS;
$e107->ns->tablerender($caption, $mes->render() . $text);
}