本文整理汇总了PHP中display_editor函数的典型用法代码示例。如果您正苦于以下问题:PHP display_editor函数的具体用法?PHP display_editor怎么用?PHP display_editor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了display_editor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display()
{
$Template = new Template('framework/builder/forms/field_extended.tpl');
$field = '<textarea type="text" ';
$field .= !empty($this->field_rows) ? 'rows="' . $this->field_rows . '" ' : '';
$field .= !empty($this->field_cols) ? 'cols="' . $this->field_cols . '" ' : '';
$field .= !empty($this->field_name) ? 'name="' . $this->field_name . '" ' : '';
$field .= !empty($this->field_id) ? 'id="' . $this->field_id . '" ' : '';
$field .= !empty($this->field_css_class) ? 'class="' . $this->field_css_class . '"> ' : '>';
$field .= !empty($this->field_value) ? $this->field_value : '';
$field .= '</textarea>';
$Template->assign_vars(array('ID' => $this->field_id, 'FIELD' => $field, 'KERNEL_EDITOR' => $this->field_editor ? display_editor($this->field_id, $this->field_forbidden_tags) : '', 'L_FIELD_TITLE' => $this->field_title, 'L_EXPLAIN' => $this->field_sub_title, 'L_REQUIRE' => $this->field_required ? '* ' : ''));
return $Template->parse(TEMPLATE_STRING_MODE);
}
示例2: sprintf
case 'l_flood':
$errstr = sprintf($LANG['e_l_flood'], $CONFIG_SHOUTBOX['shoutbox_max_link']);
break;
case 'l_pseudo':
$errstr = $LANG['e_link_pseudo'];
break;
case 'incomplete':
$errstr = $LANG['e_incomplete'];
break;
default:
$errstr = '';
}
if (!empty($errstr)) {
$Errorh->handler($errstr, E_USER_NOTICE);
}
$Template->assign_vars(array('UPDATE' => '?token=' . $Session->get_token(), 'KERNEL_EDITOR' => display_editor('shout_contents', $CONFIG_SHOUTBOX['shoutbox_forbidden_tags']), 'L_ON' => $LANG['on'], 'L_ALERT_TEXT' => $LANG['require_text'], 'L_DELETE_MSG' => $LANG['alert_delete_msg'], 'L_ADD_MSG' => $LANG['add_msg'], 'L_REQUIRE' => $LANG['require'], 'L_MESSAGE' => $LANG['message'], 'L_PSEUDO' => $LANG['pseudo'], 'L_SUBMIT' => $LANG['submit'], 'L_PREVIEW' => $LANG['preview'], 'L_RESET' => $LANG['reset']));
$nbr_shout = $Sql->count_table('shoutbox', __LINE__, __FILE__);
import('util/pagination');
$Pagination = new Pagination();
$Template->assign_vars(array('PAGINATION' => $Pagination->display('shoutbox' . url('.php?p=%d'), $nbr_shout, 'p', 10, 3)));
$array_ranks = array(-1 => $LANG['guest'], 0 => $LANG['member'], 1 => $LANG['modo'], 2 => $LANG['admin']);
$Cache->load('ranks');
$j = 0;
$result = $Sql->query_while("SELECT s.id, s.login, s.user_id, s.timestamp, m.login as mlogin, m.level, m.user_mail, m.user_show_mail, m.timestamp AS registered, m.user_avatar, m.user_msg, m.user_local, m.user_web, m.user_sex, m.user_msn, m.user_yahoo, m.user_sign, m.user_warning, m.user_ban, m.user_groups, se.user_id AS connect, s.contents\n\tFROM " . PREFIX . "shoutbox s\n\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = s.user_id\n\tLEFT JOIN " . DB_TABLE_SESSIONS . " se ON se.user_id = s.user_id AND se.session_time > '" . (time() - $CONFIG['site_session_invit']) . "'\n\tGROUP BY s.id\n\tORDER BY s.timestamp DESC \n\t" . $Sql->limit($Pagination->get_first_msg(10, 'p'), 10), __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$row['user_id'] = (int) $row['user_id'];
$edit_message = '';
$del_message = '';
$is_guest = $row['user_id'] === -1;
$is_modo = $User->check_level(MODO_LEVEL);
$warning = '';
示例3: Template
}
require_once '../kernel/header.php';
$template = new Template('member/contribution_panel.tpl');
if ($contribution_id > 0) {
$template->assign_vars(array('C_CONSULT_CONTRIBUTION' => true));
import('content/comments');
$comments = new Comments('events', $contribution_id, url('contribution_panel.php?id=' . $contribution_id . '&com=%s'), 'member', KERNEL_SCRIPT);
$contribution_creation_date = $contribution->get_creation_date();
$contribution_fixing_date = $contribution->get_fixing_date();
$template->assign_vars(array('C_WRITE_AUTH' => $User->check_auth($contribution->get_auth(), CONTRIBUTION_AUTH_BIT), 'C_UNPROCESSED_CONTRIBUTION' => $contribution->get_status() != EVENT_STATUS_PROCESSED, 'ENTITLED' => $contribution->get_entitled(), 'DESCRIPTION' => second_parse($contribution->get_description()), 'STATUS' => $contribution->get_status_name(), 'CONTRIBUTER' => $Sql->query("SELECT login FROM " . DB_TABLE_MEMBER . " WHERE user_id = '" . $contribution->get_poster_id() . "'", __LINE__, __FILE__), 'COMMENTS' => $comments->display(), 'CREATION_DATE' => $contribution_creation_date->format(DATE_FORMAT_SHORT), 'MODULE' => $contribution->get_module_name(), 'U_CONTRIBUTOR_PROFILE' => url('member.php?id=' . $contribution->get_poster_id(), 'member-' . $contribution->get_poster_id() . '.php'), 'FIXING_URL' => url(PATH_TO_ROOT . $contribution->get_fixing_url())));
if ($contribution->get_status() == EVENT_STATUS_PROCESSED) {
$template->assign_vars(array('C_CONTRIBUTION_FIXED' => true, 'FIXER' => $Sql->query("SELECT login FROM " . DB_TABLE_MEMBER . " WHERE user_id = '" . $contribution->get_fixer_id() . "'", __LINE__, __FILE__), 'FIXING_DATE' => $contribution_fixing_date->format(DATE_FORMAT_SHORT), 'U_FIXER_PROFILE' => url('member.php?id=' . $contribution->get_poster_id(), 'member-' . $contribution->get_poster_id() . '.php')));
}
$template->assign_vars(array('L_CONTRIBUTION' => $LANG['contribution'], 'L_ENTITLED' => $LANG['contribution_entitled'], 'L_DESCRIPTION' => $LANG['contribution_description'], 'L_STATUS' => $LANG['contribution_status'], 'L_CONTRIBUTOR' => $LANG['contributor'], 'L_CREATION_DATE' => $LANG['contribution_creation_date'], 'L_FIXER' => $LANG['contribution_fixer'], 'L_FIXING_DATE' => $LANG['contribution_fixing_date'], 'L_MODULE' => $LANG['contribution_module'], 'L_PROCESS_CONTRIBUTION' => $LANG['process_contribution'], 'L_CONFIRM_DELETE_CONTRIBUTION' => $LANG['confirm_delete_contribution'], 'L_DELETE' => $LANG['delete'], 'L_UPDATE' => $LANG['update'], 'U_UPDATE' => url('contribution_panel.php?edit=' . $contribution_id), 'U_DELETE' => url('contribution_panel.php?del=' . $contribution_id . '&token=' . $Session->get_token())));
} elseif ($id_update > 0) {
$template->assign_vars(array('C_EDIT_CONTRIBUTION' => true, 'EDITOR' => display_editor(), 'ENTITLED' => $contribution->get_entitled(), 'DESCRIPTION' => unparse($contribution->get_description()), 'CONTRIBUTION_ID' => $contribution->get_id(), 'EVENT_STATUS_UNREAD_SELECTED' => $contribution->get_status() == EVENT_STATUS_UNREAD ? ' selected="selected"' : '', 'EVENT_STATUS_BEING_PROCESSED_SELECTED' => $contribution->get_status() == EVENT_STATUS_BEING_PROCESSED ? ' selected="selected"' : '', 'EVENT_STATUS_PROCESSED_SELECTED' => $contribution->get_status() == EVENT_STATUS_PROCESSED ? ' selected="selected"' : '', 'L_CONTRIBUTION_STATUS_UNREAD' => $LANG['contribution_status_unread'], 'L_CONTRIBUTION_STATUS_BEING_PROCESSED' => $LANG['contribution_status_being_processed'], 'L_CONTRIBUTION_STATUS_PROCESSED' => $LANG['contribution_status_processed'], 'L_CONTRIBUTION' => $LANG['contribution'], 'L_DESCRIPTION' => $LANG['contribution_description'], 'L_STATUS' => $LANG['contribution_status'], 'L_ENTITLED' => $LANG['contribution_entitled'], 'L_SUBMIT' => $LANG['submit'], 'L_PREVIEW' => $LANG['preview'], 'L_RESET' => $LANG['reset'], 'U_TARGET' => url('contribution_panel.php?token=' . $Session->get_token())));
} else {
import('util/pagination');
$pagination = new Pagination();
$template->assign_vars(array('C_CONTRIBUTION_LIST' => true));
$num_contributions = 1;
define('CONTRIBUTIONS_PER_PAGE', 20);
$criteria = retrieve(GET, 'criteria', 'current_status');
$order = retrieve(GET, 'order', 'asc');
if (!in_array($criteria, array('entitled', 'module', 'status', 'creation_date', 'fixing_date', 'poster_id', 'fixer_id'))) {
$criteria = 'current_status';
}
$order = $order == 'desc' ? 'desc' : 'asc';
foreach (ContributionService::get_all_contributions($criteria, $order) as $this_contribution) {
$creation_date = $this_contribution->get_creation_date();
$fixing_date = $this_contribution->get_fixing_date();
示例4: MiniCalendar
$creation_calendar = new MiniCalendar('creation');
$creation_calendar->set_date($news_creation_date);
$release_calendar = new MiniCalendar('release_date');
$release_calendar->set_date($news_release_date);
if ($news_visibility < 0 || $news_visibility > 2) {
$news_visibility = 0;
}
$Template->assign_vars(array('C_DISPLAY_NEWS' => true, 'C_IMG' => !empty($news_image), 'C_EDIT_AUTH' => false, 'MODULE_DATA_PATH' => $Template->get_module_data_path('news'), 'NAME' => stripslashes($news_title), 'CONTENTS' => second_parse(stripslashes(strparse($news_contents))), 'CREATION_DATE' => $news_creation_date->format(DATE_FORMAT_SHORT), 'RELEASE_DATE' => $news_release_date->get_timestamp() > 0 ? $news_release_date->format(DATE_FORMAT_SHORT) : $NEWS_LANG['unknown_date'], 'SIZE' => $size_tpl, 'COUNT' => $news_hits, 'THEME' => get_utheme(), 'HITS' => sprintf($NEWS_LANG['n_times'], (int) $news_hits), 'NUM_NOTES' => sprintf($NEWS_LANG['num_notes'], 0), 'U_IMG' => $news_image, 'IMAGE_ALT' => str_replace('"', '\\"', $news_title), 'LANG' => get_ulang(), 'L_DATE' => $LANG['date'], 'L_SIZE' => $LANG['size'], 'L_NEWS' => $NEWS_LANG['news'], 'L_NEWS_FILE' => $NEWS_LANG['news_news'], 'L_FILE_INFOS' => $NEWS_LANG['news_infos'], 'L_INSERTION_DATE' => $NEWS_LANG['insertion_date'], 'L_RELEASE_DATE' => $NEWS_LANG['release_date'], 'L_NEWSED' => $NEWS_LANG['newsed'], 'L_NOTE' => $LANG['note'], 'U_NEWS_FILE' => url('count.php?id=' . $edit_news_id, 'news-' . $edit_news_id . '+' . url_encode_rewrite($news_title) . '.php')));
$Template->assign_vars(array('TITLE' => stripslashes($news_title), 'COUNT' => $news_hits, 'DESCRIPTION' => $news_contents, 'SHORT_DESCRIPTION' => $news_short_contents, 'FILE_IMAGE' => $news_image, 'URL' => $news_url, 'SIZE_FORM' => $news_size, 'DATE' => $news_creation_date->format(DATE_FORMAT_SHORT, TIMEZONE_AUTO), 'CATEGORIES_TREE' => $news_categories->build_select_form($news_cat_id, 'idcat', 'idcat', 0, WRITE_CAT_NEWS, $CONFIG_NEWS['global_auth'], IGNORE_AND_CONTINUE_BROWSING_IF_A_CATEGORY_DOES_NOT_MATCH), 'SHORT_DESCRIPTION_PREVIEW' => second_parse(stripslashes(strparse($news_short_contents))), 'VISIBLE_WAITING' => $news_visibility == 2 ? ' checked="checked"' : '', 'VISIBLE_ENABLED' => $news_visibility == 1 ? ' checked="checked"' : '', 'VISIBLE_UNAPROVED' => $news_visibility == 0 ? ' checked="checked"' : '', 'DATE_CALENDAR_CREATION' => $creation_calendar->display(), 'DATE_CALENDAR_RELEASE' => $release_calendar->display(), 'BOOL_IGNORE_RELEASE_DATE' => $ignore_release_date ? 'true' : 'false', 'STYLE_FIELD_RELEASE_DATE' => $ignore_release_date ? 'none' : 'block', 'IGNORE_RELEASE_DATE_CHECKED' => $ignore_release_date ? ' checked="checked"' : '', 'BEGINING_CALENDAR' => $begining_calendar->display(), 'END_CALENDAR' => $end_calendar->display()));
} else {
$news_creation_date = new Date(DATE_NOW, TIMEZONE_AUTO);
$news_release_date = new Date(DATE_NOW, TIMEZONE_AUTO);
$creation_calendar = new MiniCalendar('creation');
$creation_calendar->set_date($news_creation_date);
$release_calendar = new MiniCalendar('release_date');
$ignore_release_date = false;
if (!$ignore_release_date) {
$release_calendar->set_date($news_release_date);
}
$begining_calendar = new MiniCalendar('begining_date');
$end_calendar = new MiniCalendar('end_date');
$end_calendar->set_style('margin-left:150px;');
$begining_calendar->set_date(new Date(DATE_NOW, TIMEZONE_AUTO));
$end_calendar->set_date(new Date(DATE_NOW, TIMEZONE_AUTO));
$news_visibility = 0;
$Template->assign_vars(array('TITLE' => '', 'COUNT' => 0, 'DESCRIPTION' => '', 'SHORT_DESCRIPTION' => '', 'FILE_IMAGE' => '', 'URL' => '', 'SIZE_FORM' => '', 'DATE' => $news_creation_date->format(DATE_FORMAT_SHORT, TIMEZONE_AUTO), 'CATEGORIES_TREE' => $news_categories->build_select_form($selected_cat, 'idcat', 'idcat', 0, WRITE_CAT_NEWS, $CONFIG_NEWS['global_auth'], IGNORE_AND_CONTINUE_BROWSING_IF_A_CATEGORY_DOES_NOT_MATCH), 'DATE_CALENDAR_CREATION' => $creation_calendar->display(), 'DATE_CALENDAR_RELEASE' => $release_calendar->display(), 'BOOL_IGNORE_RELEASE_DATE' => $ignore_release_date ? 'true' : 'false', 'STYLE_FIELD_RELEASE_DATE' => $ignore_release_date ? 'none' : 'block', 'IGNORE_RELEASE_DATE_CHECKED' => $ignore_release_date ? ' checked="checked"' : '', 'BEGINING_CALENDAR' => $begining_calendar->display(), 'END_CALENDAR' => $end_calendar->display(), 'VISIBLE_WAITING' => '', 'VISIBLE_ENABLED' => ' checked="checked"', 'VISIBLE_UNAPROVED' => '', 'U_TARGET' => url('management.php?new=1&token=' . $Session->get_token())));
}
}
$Template->assign_vars(array('KERNEL_EDITOR' => display_editor(), 'KERNEL_EDITOR_SHORT' => display_editor('short_contents'), 'C_PREVIEW' => $preview, 'L_PAGE_TITLE' => TITLE, 'L_EDIT_FILE' => $NEWS_LANG['edit_news'], 'L_YES' => $LANG['yes'], 'L_NO' => $LANG['no'], 'L_NEWS_DATE' => $NEWS_LANG['news_date'], 'L_IGNORE_RELEASE_DATE' => $NEWS_LANG['ignore_release_date'], 'L_RELEASE_DATE' => $NEWS_LANG['release_date'], 'L_FILE_VISIBILITY' => $NEWS_LANG['news_visibility'], 'L_NOW' => $LANG['now'], 'L_UNAPPROVED' => $LANG['unapproved'], 'L_TO_DATE' => $LANG['to_date'], 'L_FROM_DATE' => $LANG['from_date'], 'L_DESC' => $LANG['description'], 'L_NEWS' => $NEWS_LANG['news'], 'L_SIZE' => $LANG['size'], 'L_URL' => $LANG['url'], 'L_FILE_IMAGE' => $NEWS_LANG['news_image'], 'L_TITLE' => $LANG['title'], 'L_CATEGORY' => $LANG['category'], 'L_REQUIRE' => $LANG['require'], 'L_NEWS_ADD' => $NEWS_LANG['news_add'], 'L_NEWS_MANAGEMENT' => $NEWS_LANG['news_management'], 'L_NEWS_CONFIG' => $NEWS_LANG['news_config'], 'L_UPDATE' => $LANG['update'], 'L_RESET' => $LANG['reset'], 'L_PREVIEW' => $LANG['preview'], 'L_UNIT_SIZE' => $LANG['unit_megabytes'], 'L_CONTENTS' => $NEWS_LANG['complete_contents'], 'L_SHORT_CONTENTS' => $NEWS_LANG['short_contents'], 'L_SUBMIT' => $edit_news_id > 0 ? $NEWS_LANG['update_news'] : $NEWS_LANG['add_news'], 'L_WARNING_PREVIEWING' => $NEWS_LANG['warning_previewing'], 'L_REQUIRE_DESCRIPTION' => $NEWS_LANG['require_description'], 'L_REQUIRE_URL' => $NEWS_LANG['require_url'], 'L_REQUIRE_CREATION_DATE' => $NEWS_LANG['require_creation_date'], 'L_REQUIRE_RELEASE_DATE' => $NEWS_LANG['require_release_date'], 'L_REQUIRE_TITLE' => $LANG['require_title']));
$Template->pparse('news_management');
require_once '../kernel/footer.php';
示例5: call_user_func
$ret = call_user_func($_POST['fn']);
}
}
if ($ret) {
echo $ret;
}
// Display the response
} else {
if ($_POST['submit'] != "") {
switch ($_POST['submit']) {
case "Upload":
$GLOBALS['error'] = upload();
display($content);
break;
case "Edit":
display_editor($_POST['edit_file']);
break;
case "Save":
save_file();
display($content);
break;
default:
display($content);
break;
}
} else {
display($content);
}
}
/*=====================FUNCTIONS====================*/
/**
示例6: retrieve
$config_member['activ_mbr'] = retrieve(POST, 'activ_mbr', 0);
$config_member['verif_code'] = isset($_POST['verif_code']) && @extension_loaded('gd') ? numeric($_POST['verif_code']) : 0;
$config_member['verif_code_difficulty'] = retrieve(POST, 'verif_code_difficulty', 2);
$config_member['delay_unactiv_max'] = retrieve(POST, 'delay_unactiv_max', 0);
$config_member['force_theme'] = retrieve(POST, 'force_theme', 0);
$config_member['activ_up_avatar'] = retrieve(POST, 'activ_up_avatar', 0);
$config_member['width_max'] = retrieve(POST, 'width_max', 120);
$config_member['height_max'] = retrieve(POST, 'height_max', 120);
$config_member['weight_max'] = retrieve(POST, 'weight_max', 20);
$config_member['activ_avatar'] = retrieve(POST, 'activ_avatar', 0);
$config_member['avatar_url'] = retrieve(POST, 'avatar_url', '');
$Sql->query_inject("UPDATE " . DB_TABLE_CONFIGS . " SET value = '" . addslashes(serialize($config_member)) . "' WHERE name = 'member'", __LINE__, __FILE__);
###### Régénération du cache $CONFIG_USER #######
$Cache->Generate_file('member');
redirect(HOST . SCRIPT);
} else {
$Template->set_filenames(array('admin_members_config' => 'admin/admin_members_config.tpl'));
#####################Activation du mail par le membre pour s'inscrire##################
$array = array(0 => $LANG['no_activ_mbr'], 1 => $LANG['mail'], 2 => $LANG['admin']);
$activ_mode_option = '';
foreach ($array as $key => $value) {
$selected = $CONFIG_USER['activ_mbr'] == $key ? 'selected="selected"' : '';
$activ_mode_option .= '<option value="' . $key . '" ' . $selected . '>' . $value . '</option>';
}
for ($i = 0; $i < 5; $i++) {
$Template->assign_block_vars('difficulty', array('VALUE' => $i, 'SELECTED' => $CONFIG_USER['verif_code_difficulty'] == $i ? 'selected="selected"' : ''));
}
$Template->assign_vars(array('ACTIV_MODE_OPTION' => $activ_mode_option, 'ACTIV_REGISTER_ENABLED' => $CONFIG_USER['activ_register'] == 1 ? 'selected="selected"' : '', 'ACTIV_REGISTER_DISABLED' => $CONFIG_USER['activ_register'] == 0 ? 'selected="selected"' : '', 'VERIF_CODE_ENABLED' => $CONFIG_USER['verif_code'] == 1 && @extension_loaded('gd') ? 'checked="checked"' : '', 'VERIF_CODE_DISABLED' => $CONFIG_USER['verif_code'] == 0 ? 'checked="checked"' : '', 'DELAY_UNACTIV_MAX' => !empty($CONFIG_USER['delay_unactiv_max']) ? $CONFIG_USER['delay_unactiv_max'] : '', 'ALLOW_THEME_ENABLED' => $CONFIG_USER['force_theme'] == 0 ? 'checked="checked"' : '', 'ALLOW_THEME_DISABLED' => $CONFIG_USER['force_theme'] == 1 ? 'checked="checked"' : '', 'AVATAR_UP_ENABLED' => $CONFIG_USER['activ_up_avatar'] == 1 ? 'checked="checked"' : '', 'AVATAR_UP_DISABLED' => $CONFIG_USER['activ_up_avatar'] == 0 ? 'checked="checked"' : '', 'AVATAR_ENABLED' => $CONFIG_USER['activ_avatar'] == 1 ? 'checked="checked"' : '', 'AVATAR_DISABLED' => $CONFIG_USER['activ_avatar'] == 0 ? 'checked="checked"' : '', 'WIDTH_MAX' => !empty($CONFIG_USER['width_max']) ? $CONFIG_USER['width_max'] : '120', 'HEIGHT_MAX' => !empty($CONFIG_USER['height_max']) ? $CONFIG_USER['height_max'] : '120', 'WEIGHT_MAX' => !empty($CONFIG_USER['weight_max']) ? $CONFIG_USER['weight_max'] : '20', 'AVATAR_URL' => !empty($CONFIG_USER['avatar_url']) ? $CONFIG_USER['avatar_url'] : '', 'CONTENTS' => unparse($CONFIG_USER['msg_mbr']), 'KERNEL_EDITOR' => display_editor(), 'GD_DISABLED' => !@extension_loaded('gd') ? 'disabled="disabled"' : '', 'L_KB' => $LANG['unit_kilobytes'], 'L_PX' => $LANG['unit_pixels'], 'L_ACTIV_REGISTER' => $LANG['activ_register'], 'L_REQUIRE_MAX_WIDTH' => $LANG['require_max_width'], 'L_REQUIRE_HEIGHT' => $LANG['require_height'], 'L_REQUIRE_WEIGHT' => $LANG['require_weight'], 'L_USERS_MANAGEMENT' => $LANG['members_management'], 'L_USERS_ADD' => $LANG['members_add'], 'L_USERS_CONFIG' => $LANG['members_config'], 'L_USERS_PUNISHMENT' => $LANG['punishment_management'], 'L_USERS_MSG' => $LANG['members_msg'], 'L_ACTIV_MBR' => $LANG['activ_mbr'], 'L_DELAY_UNACTIV_MAX' => $LANG['delay_activ_max'], 'L_DELAY_UNACTIV_MAX_EXPLAIN' => $LANG['delay_activ_max_explain'], 'L_DAYS' => $LANG['days'], 'L_VERIF_CODE' => $LANG['verif_code'], 'L_VERIF_CODE_EXPLAIN' => $LANG['verif_code_explain'], 'L_CAPTCHA_DIFFICULTY' => $LANG['captcha_difficulty'], 'L_ALLOW_THEME_MBR' => $LANG['allow_theme_mbr'], 'L_AVATAR_MANAGEMENT' => $LANG['avatar_management'], 'L_ACTIV_UP_AVATAR' => $LANG['activ_up_avatar'], 'L_WIDTH_MAX_AVATAR' => $LANG['width_max_avatar'], 'L_WIDTH_MAX_AVATAR_EXPLAIN' => $LANG['width_max_avatar_explain'], 'L_HEIGHT_MAX_AVATAR' => $LANG['height_max_avatar'], 'L_HEIGHT_MAX_AVATAR_EXPLAIN' => $LANG['height_max_avatar_explain'], 'L_WEIGHT_MAX_AVATAR' => $LANG['weight_max_avatar'], 'L_WEIGHT_MAX_AVATAR_EXPLAIN' => $LANG['weight_max_avatar_explain'], 'L_ACTIV_DEFAUT_AVATAR' => $LANG['activ_defaut_avatar'], 'L_ACTIV_DEFAUT_AVATAR_EXPLAIN' => $LANG['activ_defaut_avatar_explain'], 'L_URL_DEFAUT_AVATAR' => $LANG['url_defaut_avatar'], 'L_URL_DEFAUT_AVATAR_EXPLAIN' => $LANG['url_defaut_avatar_explain'], 'L_YES' => $LANG['yes'], 'L_NO' => $LANG['no'], 'L_CONTENTS' => $LANG['content'], 'L_UPDATE' => $LANG['update'], 'L_RESET' => $LANG['reset']));
$Template->pparse('admin_members_config');
}
require_once '../admin/admin_footer.php';
示例7: retrieve
$idcat = retrieve(POST, 'idcat', 0);
$compt = retrieve(POST, 'compt', 0);
$aprob = retrieve(POST, 'aprob', 0);
if (!empty($title) && !empty($url) && !empty($idcat)) {
$Sql->query_inject("UPDATE " . PREFIX . "web SET title = '" . $title . "', contents = '" . $contents . "', url = '" . $url . "', idcat = '" . $idcat . "', compt = '" . $compt . "', aprob = '" . $aprob . "' WHERE id = '" . $id_post . "'", __LINE__, __FILE__);
redirect(HOST . SCRIPT);
} else {
redirect(HOST . DIR . '/web/admin_web.php?id= ' . $id_post . '&error=incomplete#errorh');
}
} elseif ($del && !empty($id)) {
$Session->csrf_get_protect();
$Sql->query_inject("DELETE FROM " . PREFIX . "web WHERE id = '" . $id . "'", __LINE__, __FILE__);
$Sql->query_inject("DELETE FROM " . DB_TABLE_COM . " WHERE idprov = '" . $id . "' AND script = 'web'", __LINE__, __FILE__);
redirect(HOST . SCRIPT);
} else {
$Template->set_filenames(array('admin_web_management' => 'web/admin_web_management.tpl'));
$nbr_web = $Sql->count_table('web', __LINE__, __FILE__);
import('util/pagination');
$Pagination = new Pagination();
$Template->assign_vars(array('PAGINATION' => $Pagination->display('admin_web.php?p=%d', $nbr_web, 'p', 25, 3), 'THEME' => get_utheme(), 'LANG' => get_ulang(), 'KERNEL_EDITOR' => display_editor(), 'L_WEB_ADD' => $LANG['web_add'], 'L_WEB_MANAGEMENT' => $LANG['web_management'], 'L_WEB_CAT' => $LANG['cat_management'], 'L_WEB_CONFIG' => $LANG['web_config'], 'L_DEL_ENTRY' => $LANG['delete_link'], 'L_LISTE' => $LANG['list'], 'L_NAME' => $LANG['name'], 'L_CATEGORY' => $LANG['category'], 'L_URL' => $LANG['url'], 'L_VIEW' => $LANG['view'], 'L_DATE' => $LANG['date'], 'L_APROB' => $LANG['aprob'], 'L_UPDATE' => $LANG['update'], 'L_DELETE' => $LANG['delete']));
$result = $Sql->query_while("SELECT d.*, ad.name \n\tFROM " . PREFIX . "web d \n\tLEFT JOIN " . PREFIX . "web_cat ad ON ad.id = d.idcat\n\tORDER BY timestamp DESC \n\t" . $Sql->limit($Pagination->get_first_msg(25, 'p'), 25), __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$aprob = $row['aprob'] == 1 ? $LANG['yes'] : $LANG['no'];
$title = $row['title'];
$title = strlen($title) > 45 ? substr_html($title, 0, 45) . '...' : $title;
$Template->assign_block_vars('web', array('IDWEB' => $row['id'], 'NAME' => $title, 'IDCAT' => $row['idcat'], 'CAT' => $row['name'], 'DATE' => gmdate_format('date_format_short', $row['timestamp']), 'APROBATION' => $aprob, 'COMPT' => $row['compt']));
}
$Sql->query_close($result);
$Template->pparse('admin_web_management');
}
require_once '../admin/admin_footer.php';
示例8: array
$error_mailing_list = NewsletterService::send_bbcode($mail_object, $mail_contents);
break;
default:
$type = 'text';
$error_mailing_list = NewsletterService::send_text($mail_object, $mail_contents);
}
$Template->assign_block_vars('end', array());
$Template->assign_vars(array('L_ARCHIVES' => $LANG['newsletter_go_to_archives'], 'L_BACK' => $LANG['newsletter_back'], 'L_NEWSLETTER' => $LANG['newsletter']));
if (count($error_mailing_list) == 0) {
$Errorh->handler($LANG['newsletter_sent_successful'], E_USER_NOTICE);
} else {
$Errorh->handler(sprintf($LANG['newsletter_error_list'], implode(', ', $error_mailing_list)), E_USER_NOTICE);
}
} elseif (!empty($type)) {
if ($type == 'bbcode') {
$Template->assign_vars(array('KERNEL_EDITOR' => display_editor()));
} else {
$type = $type == 'html' ? 'html' : 'text';
}
$nbr = $Sql->count_table("newsletter", __LINE__, __FILE__);
$Template->assign_block_vars('write', array('TYPE' => $type, 'SUBSCRIBE_LINK' => $type == 'html' ? $LANG['newsletter_subscribe_link'] : '', 'NBR_SUBSCRIBERS' => $nbr, 'MESSAGE' => stripslashes($mail_contents), 'TITLE' => $mail_object, 'PREVIEW_BUTTON' => $type == 'bbcode' ? '<input value="' . $LANG['preview'] . '" onclick="XMLHttpRequest_preview();" class="submit" type="button">' : ''));
$Template->assign_vars(array('L_WRITE_TYPE' => $LANG['newsletter_write_type'], 'L_TITLE' => $LANG['title'], 'L_MESSAGE' => $LANG['message'], 'L_SEND' => $LANG['newsletter_send'], 'L_NEWSLETTER_TEST' => $LANG['newsletter_test'], 'L_NBR_SUBSCRIBERS' => $LANG['newsletter_nbr_subscribers']));
if ($type == 'bbcode') {
$Template->assign_block_vars('write.bbcode_explain', array('L_WARNING' => $LANG['newsletter_bbcode_warning']));
}
if (empty($mail_object) && $send_test) {
$Errorh->handler($LANG['require_title'], E_USER_WARNING);
} elseif (empty($mail_contents) && $send_test) {
$Errorh->handler($LANG['require_text'], E_USER_WARNING);
} elseif ($send_test) {
switch ($type) {
示例9: import
case 'incomplete':
$errstr = $LANG['e_incomplete'];
break;
default:
$errstr = '';
}
if (!empty($errstr)) {
$Errorh->handler($errstr, E_USER_NOTICE);
}
if ($captcha->is_available() && $CONFIG_GUESTBOOK['guestbook_verifcode']) {
$Template->assign_vars(array('C_VERIF_CODE' => true, 'VERIF_CODE' => $captcha->display_form(), 'L_REQUIRE_VERIF_CODE' => $captcha->js_require()));
}
$nbr_guestbook = $Sql->count_table('guestbook', __LINE__, __FILE__);
import('util/pagination');
$Pagination = new Pagination();
$Template->assign_vars(array('UPDATE' => url('?token=' . $Session->get_token()), 'PAGINATION' => $Pagination->display('guestbook' . url('.php?p=%d'), $nbr_guestbook, 'p', 10, 3), 'KERNEL_EDITOR' => display_editor('guestbook_contents', $CONFIG_GUESTBOOK['guestbook_forbidden_tags']), 'L_ALERT_TEXT' => $LANG['require_text'], 'L_DELETE_MSG' => $LANG['alert_delete_msg'], 'L_ADD_MSG' => $LANG['add_msg'], 'L_REQUIRE' => $LANG['require'], 'L_MESSAGE' => $LANG['message'], 'L_VERIF_CODE' => $LANG['verif_code'], 'L_PSEUDO' => $LANG['pseudo'], 'L_SUBMIT' => $LANG['submit'], 'L_PREVIEW' => $LANG['preview'], 'L_RESET' => $LANG['reset'], 'L_ON' => $LANG['on']));
$array_ranks = array(-1 => $LANG['guest'], 0 => $LANG['member'], 1 => $LANG['modo'], 2 => $LANG['admin']);
$Cache->load('ranks');
$j = 0;
$result = $Sql->query_while("SELECT g.id, g.login, g.timestamp, m.user_id, m.login as mlogin, m.level, m.user_mail, m.user_show_mail, m.timestamp AS registered, m.user_avatar, m.user_msg, m.user_local, m.user_web, m.user_sex, m.user_msn, m.user_yahoo, m.user_sign, m.user_warning, m.user_ban, m.user_groups, s.user_id AS connect, g.contents\n\tFROM " . PREFIX . "guestbook g\n\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = g.user_id\n\tLEFT JOIN " . DB_TABLE_SESSIONS . " s ON s.user_id = g.user_id AND s.session_time > '" . (time() - $CONFIG['site_session_invit']) . "'\n\tGROUP BY g.id\n\tORDER BY g.timestamp DESC\n\t" . $Sql->limit($Pagination->get_first_msg(10, 'p'), 10), __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$edit = '';
$del = '';
$is_guest = empty($row['user_id']);
$is_modo = $User->check_level(MODO_LEVEL);
$warning = '';
$readonly = '';
if ($is_modo && !$is_guest) {
$warning = ' <a href="../member/moderation_panel' . url('.php?action=warning&id=' . $row['user_id']) . '" title="' . $LANG['warning_management'] . '"><img src="../templates/' . get_utheme() . '/images/admin/important.png" alt="' . $LANG['warning_management'] . '" class="valign_middle" /></a>';
$readonly = '<a href="../member/moderation_panel' . url('.php?action=punish&id=' . $row['user_id']) . '" title="' . $LANG['punishment_management'] . '"><img src="../templates/' . get_utheme() . '/images/readonly.png" alt="' . $LANG['punishment_management'] . '" class="valign_middle" /></a>';
}
示例10: redirect
if (empty($name)) {
redirect(url(HOST . SCRIPT . '?error=e_required_fields_empty#errorh'), '', '&');
}
if ($id_cat > 0) {
$error_string = $faq_categories->Update_category($id_cat, $id_parent, $name, $description, $image);
} else {
$error_string = $faq_categories->add($id_parent, $name, $description, $image);
}
}
$Cache->Generate_module_file('faq');
redirect(url(HOST . SCRIPT . '?error=' . $error_string . '#errorh'), '', '&');
} elseif (!empty($_GET['recount'])) {
$faq_categories->Recount_subquestions();
redirect(url(HOST . SCRIPT . '?error=e_recount_success', '', '&'));
} elseif ($new_cat xor $id_edit > 0) {
$Template->assign_vars(array('KERNEL_EDITOR' => display_editor(), 'L_CATEGORY' => $FAQ_LANG['category'], 'L_REQUIRED_FIELDS' => $FAQ_LANG['required_fields'], 'L_NAME' => $FAQ_LANG['category_name'], 'L_LOCATION' => $FAQ_LANG['category_location'], 'L_DESCRIPTION' => $FAQ_LANG['cat_description'], 'L_IMAGE' => $FAQ_LANG['category_image'], 'L_PREVIEW' => $LANG['preview'], 'L_RESET' => $LANG['reset'], 'L_SUBMIT' => $id_edit > 0 ? $LANG['edit'] : $LANG['add'], 'L_REQUIRE_TITLE' => $LANG['require_title']));
if ($id_edit > 0 && array_key_exists($id_edit, $FAQ_CATS)) {
$Template->assign_block_vars('edition_interface', array('NAME' => $FAQ_CATS[$id_edit]['name'], 'DESCRIPTION' => unparse($FAQ_CATS[$id_edit]['description']), 'IMAGE' => $FAQ_CATS[$id_edit]['image'], 'CATEGORIES_TREE' => $faq_categories->build_select_form($FAQ_CATS[$id_edit]['id_parent'], 'id_parent', 'id_parent', $id_edit), 'IDCAT' => $id_edit));
} else {
$id_edit = 0;
$Template->assign_block_vars('edition_interface', array('NAME' => '', 'DESCRIPTION' => '', 'IMAGE' => '', 'CATEGORIES_TREE' => $faq_categories->build_select_form($id_edit, 'id_parent', 'id_parent'), 'IDCAT' => $id_edit));
}
} else {
if (!empty($error)) {
switch ($error) {
case 'e_required_fields_empty':
$Errorh->handler($FAQ_LANG['required_fields_empty'], E_USER_WARNING);
break;
case 'e_unexisting_category':
$Errorh->handler($FAQ_LANG['unexisting_category'], E_USER_WARNING);
break;
示例11: elseif
$user_born .= $array_user_born[2 - $i];
$born_day = $array_user_born[2 - $i];
} elseif ($date_birth[$i] == 'MM') {
$user_born .= $array_user_born[2 - $i];
$born_month = $array_user_born[2 - $i];
} elseif ($date_birth[$i] == 'YYYY') {
$user_born .= $array_user_born[2 - $i];
$born_year = $array_user_born[2 - $i];
}
$user_born .= $i != 2 ? '/' : '';
}
$user_sex = '';
if (!empty($row['user_sex'])) {
$user_sex = $row['user_sex'] == 1 ? 'man.png' : 'woman.png';
}
$Template->assign_vars(array('C_USER_UPDATE_PROFIL' => true, 'USER_THEME' => $row['user_theme'], 'USER_LOGIN' => $User->get_attribute('login'), 'MAIL' => $row['user_mail'], 'LOCAL' => $row['user_local'], 'WEB' => $row['user_web'], 'OCCUPATION' => $row['user_occupation'], 'HOBBIES' => $row['user_hobbies'], 'USER_AVATAR' => !empty($row['user_avatar']) ? '<img src="' . $row['user_avatar'] . '" alt="" />' : '<em>' . $LANG['no_avatar'] . '</em>', 'SHOW_MAIL_CHECKED' => $row['user_show_mail'] == 0 ? 'checked="checked"' : '', 'USER_BORN' => $user_born, 'BORN_DAY' => $born_day, 'BORN_MONTH' => $born_month, 'BORN_YEAR' => $born_year, 'USER_SEX' => !empty($user_sex) ? '<img src="../templates/' . get_utheme() . '/images/' . $user_sex . '" alt="" />' : '', 'USER_SIGN' => unparse($row['user_sign']), 'USER_SIGN_EDITOR' => display_editor('user_sign'), 'USER_DESC' => unparse($row['user_desc']), 'USER_DESC_EDITOR' => display_editor('user_desc'), 'USER_MSN' => $row['user_msn'], 'USER_YAHOO' => $row['user_yahoo'], 'U_USER_ACTION_UPDATE' => url('.php?id=' . $User->get_attribute('user_id') . '&token=' . $Session->get_token(), '-' . $User->get_attribute('user_id') . '.php?token=' . $Session->get_token()), 'L_REQUIRE_MAIL' => $LANG['require_mail'], 'L_MAIL_INVALID' => $LANG['e_mail_invalid'], 'L_MAIL_AUTH' => $LANG['e_mail_auth'], 'L_PASSWORD_SAME' => $LANG['e_pass_same'], 'L_PASSWORD_HOW' => $LANG['password_how'], 'L_USER_AREA' => $LANG['member_area'], 'L_PROFIL_EDIT' => $LANG['profile_edition'], 'L_REQUIRE' => $LANG['require'], 'L_MAIL' => $LANG['mail'], 'L_VALID' => $LANG['valid'], 'L_PREVIOUS_PASS' => $LANG['previous_password'], 'L_EDIT_JUST_IF_MODIF' => $LANG['fill_only_if_modified'], 'L_NEW_PASS' => $LANG['new_password'], 'L_CONFIRM_PASS' => $LANG['confirm_password'], 'L_DEL_USER' => $LANG['del_member'], 'L_LANG_CHOOSE' => $LANG['choose_lang'], 'L_OPTIONS' => $LANG['options'], 'L_THEME_CHOOSE' => $LANG['choose_theme'], 'L_EDITOR_CHOOSE' => $LANG['choose_editor'], 'L_TIMEZONE_CHOOSE' => $LANG['timezone_choose'], 'L_TIMEZONE_CHOOSE_EXPLAIN' => $LANG['timezone_choose_explain'], 'L_HIDE_MAIL' => $LANG['hide_mail'], 'L_HIDE_MAIL_WHO' => $LANG['hide_mail_who'], 'L_INFO' => $LANG['info'], 'L_SITE_WEB' => $LANG['web_site'], 'L_LOCALISATION' => $LANG['localisation'], 'L_JOB' => $LANG['job'], 'L_HOBBIES' => $LANG['hobbies'], 'L_SEX' => $LANG['sex'], 'L_DATE_OF_BIRTH' => $LANG['date_of_birth'], 'L_DATE_FORMAT' => $LANG['date_birth_format'], 'L_BIOGRAPHY' => $LANG['biography'], 'L_YEARS_OLD' => $LANG['years_old'], 'L_SIGN' => $LANG['sign'], 'L_SIGN_WHERE' => $LANG['sign_where'], 'L_CONTACT' => $LANG['contact'], 'L_AVATAR_MANAGEMENT' => $LANG['avatar_gestion'], 'L_CURRENT_AVATAR' => $LANG['current_avatar'], 'L_WEIGHT_MAX' => $LANG['weight_max'], 'L_HEIGHT_MAX' => $LANG['height_max'], 'L_WIDTH_MAX' => $LANG['width_max'], 'L_UPLOAD_AVATAR' => $LANG['upload_avatar'], 'L_UPLOAD_AVATAR_WHERE' => $LANG['upload_avatar_where'], 'L_AVATAR_LINK' => $LANG['avatar_link'], 'L_AVATAR_LINK_WHERE' => $LANG['avatar_link_where'], 'L_AVATAR_DEL' => $LANG['avatar_del'], 'L_UNIT_PX' => $LANG['unit_pixels'], 'L_UNIT_KO' => $LANG['unit_kilobytes'], 'L_UPDATE' => $LANG['update'], 'L_RESET' => $LANG['reset']));
$array_identifier = '';
$lang_identifier = '../images/stats/other.png';
$ulang = get_ulang();
foreach ($LANGS_CONFIG as $lang => $array_info) {
if ($User->check_level($array_info['secure'])) {
$info_lang = load_ini_file('../lang/', $lang);
$selected = '';
if ($ulang == $lang) {
$selected = ' selected="selected"';
$lang_identifier = '../images/stats/countries/' . $info_lang['identifier'] . '.png';
}
$array_identifier .= 'array_identifier[\'' . $lang . '\'] = \'' . $info_lang['identifier'] . '\';' . "\n";
$Template->assign_block_vars('select_lang', array('NAME' => !empty($info_lang['name']) ? $info_lang['name'] : $lang, 'IDNAME' => $lang, 'SELECTED' => $selected));
}
}
示例12: array
}
include_once '../kernel/header.php';
$Template->set_filenames(array('faq' => 'faq/management.tpl'));
if ($edit_question > 0) {
$Template->assign_block_vars('edit_question', array('ENTITLED' => $question_infos['question'], 'ANSWER' => unparse($question_infos['answer']), 'TARGET' => url('action.php?token=' . $Session->get_token()), 'ID_QUESTION' => $edit_question));
$Template->assign_vars(array('KERNEL_EDITOR' => display_editor(), 'L_QUESTION' => $FAQ_LANG['question'], 'L_ENTITLED' => $FAQ_LANG['entitled'], 'L_ANSWER' => $FAQ_LANG['answer'], 'L_REQUIRE_ENTITLED' => $FAQ_LANG['require_entitled'], 'L_REQUIRE_ANSWER' => $FAQ_LANG['require_answer']));
} elseif ($cat_of_new_question >= 0 && $new) {
$Template->assign_block_vars('edit_question', array('ENTITLED' => '', 'ANSWER' => '', 'TARGET' => url('action.php?token=' . $Session->get_token()), 'ID_AFTER' => $new_after_id, 'ID_CAT' => $cat_of_new_question));
$Template->assign_vars(array('KERNEL_EDITOR' => display_editor(), 'L_QUESTION' => $FAQ_LANG['question'], 'L_ENTITLED' => $FAQ_LANG['entitled'], 'L_ANSWER' => $FAQ_LANG['answer'], 'L_REQUIRE_ENTITLED' => $FAQ_LANG['require_entitled'], 'L_REQUIRE_ANSWER' => $FAQ_LANG['require_answer']));
} elseif ($id_move > 0) {
include_once 'faq_cats.class.php';
$faq_cats = new Faqcats();
$Template->assign_block_vars('move_question', array('CATEGORIES_TREE' => $faq_cats->build_select_form(0, 'target', 'target', 0, AUTH_WRITE, $FAQ_CONFIG['global_auth'], IGNORE_AND_CONTINUE_BROWSING_IF_A_CATEGORY_DOES_NOT_MATCH), 'ID_QUESTION' => $id_move));
$Template->assign_vars(array('L_TARGET' => $FAQ_LANG['target_category'], 'L_MOVE' => $FAQ_LANG['move'], 'ID_QUESTION' => $id_move, 'U_FORM_TARGET' => url('action.php?token=' . $Session->get_token())));
} else {
$Template->assign_vars(array('KERNEL_EDITOR' => display_editor(), 'TARGET' => url('action.php?idcat=' . $id_faq . '&cat_properties=1&token=' . $Session->get_token()), 'AUTO_SELECTED' => $FAQ_CATS[$id_faq]['display_mode'] == 0 ? 'selected="selected"' : '', 'INLINE_SELECTED' => $FAQ_CATS[$id_faq]['display_mode'] == 1 ? 'selected="selected"' : '', 'BLOCK_SELECTED' => $FAQ_CATS[$id_faq]['display_mode'] == 2 ? 'selected="selected"' : '', 'DESCRIPTION' => unparse($FAQ_CATS[$id_faq]['description']), 'L_CAT_PROPERTIES' => $FAQ_LANG['cat_properties'], 'L_DESCRIPTION' => $FAQ_LANG['cat_description'], 'L_DISPLAY_MODE' => $FAQ_LANG['display_mode'], 'L_DISPLAY_BLOCK' => $FAQ_LANG['display_block'], 'L_DISPLAY_INLINE' => $FAQ_LANG['display_inline'], 'L_DISPLAY_AUTO' => $FAQ_LANG['display_auto'], 'L_DISPLAY_EXPLAIN' => $FAQ_LANG['display_explain'], 'L_GLOBAL_AUTH' => $FAQ_LANG['global_auth'], 'L_GLOBAL_AUTH_EXPLAIN' => $FAQ_LANG['global_auth_explain'], 'L_READ_AUTH' => $FAQ_LANG['read_auth'], 'L_WRITE_AUTH' => $FAQ_LANG['write_auth'], 'L_QUESTIONS_LIST' => $FAQ_LANG['questions_list'], 'L_INSERT_QUESTION' => $FAQ_LANG['insert_question'], 'L_INSERT_QUESTION_BEFORE' => $FAQ_LANG['insert_question_begening'], 'L_EDIT' => $FAQ_LANG['update'], 'L_DELETE' => $FAQ_LANG['delete'], 'L_UP' => $FAQ_LANG['up'], 'L_DOWN' => $FAQ_LANG['down'], 'L_MOVE' => $FAQ_LANG['move'], 'L_CONFIRM_DELETE' => addslashes($FAQ_LANG['confirm_delete']), 'L_GO_BACK_TO_CAT' => $FAQ_LANG['go_back_to_cat'], 'L_PREVIEW' => $LANG['preview'], 'L_CAT_NAME' => $FAQ_LANG['cat_name'], 'L_REQUIRE_CAT_NAME' => $FAQ_LANG['require_cat_name'], 'U_GO_BACK_TO_CAT' => url('faq.php' . ($id_faq > 0 ? '?id=' . $id_faq : ''), $id_faq > 0 ? 'faq-' . $id_faq . '+' . url_encode_rewrite($FAQ_CATS[$id_faq]['name']) . '.php' : 'faq.php')));
if (!empty($FAQ_CATS[$id_faq]['auth'])) {
$Template->assign_vars(array('GLOBAL_CHECKED' => 'checked="checked"', 'DISPLAY_GLOBAL' => 'block', 'JS_GLOBAL' => 'true'));
} else {
$Template->assign_vars(array('GLOBAL_CHECKED' => '', 'DISPLAY_GLOBAL' => 'none', 'JS_GLOBAL' => 'false'));
}
$Template->assign_block_vars('category', array('READ_AUTH' => Authorizations::generate_select(AUTH_READ, !empty($FAQ_CATS[$id_faq]['auth']) ? $FAQ_CATS[$id_faq]['auth'] : $FAQ_CONFIG['global_auth']), 'WRITE_AUTH' => Authorizations::generate_select(AUTH_WRITE, !empty($FAQ_CATS[$id_faq]['auth']) ? $FAQ_CATS[$id_faq]['auth'] : $FAQ_CONFIG['global_auth']), 'U_CREATE_BEFORE' => url('management.php?new=1&idcat=' . $id_faq . '&after=0'), 'ID_FAQ' => $id_faq));
if ($id_faq > 0) {
$Template->assign_block_vars('category.not_root_name', array('CAT_TITLE' => $FAQ_CATS[$id_faq]['name']));
$Template->assign_block_vars('category.not_root_auth', array('WRITE_AUTH' => Authorizations::generate_select(AUTH_WRITE, !empty($FAQ_CATS[$id_faq]['auth']) ? $FAQ_CATS[$id_faq]['auth'] : $FAQ_CONFIG['global_auth'])));
}
$result = $Sql->query_while("SELECT id, q_order, question, answer\n\tFROM " . PREFIX . "faq\n\tWHERE idcat = '" . $id_faq . "'\n\tORDER BY q_order", __LINE__, __FILE__);
$num_rows = $Sql->num_rows($result, "SELECT COUNT(*) FROM " . PREFIX . "faq WHERE idcat = '" . $id_faq . "'", __LINE__, __FILE__);
if ($num_rows > 0 || $id_faq == 0) {
$Template->assign_vars(array('C_DISPLAY_ANSWERS' => true, 'NUM_QUESTIONS' => $num_rows, 'L_HIDE_ANSWERS' => addslashes($FAQ_LANG['hide_all_answers']), 'L_DISPLAY_ANSWERS' => addslashes($FAQ_LANG['show_all_answers'])));
while ($row = $Sql->fetch_assoc($result)) {
示例13: get_utheme
$Template->assign_vars(array('MODULE_DATA_PATH' => $Template->get_module_data_path('web'), 'THEME' => get_utheme(), 'LANG' => get_ulang(), 'NAME' => $title, 'CONTENTS' => retrieve(POST, 'contents', '', TSTRING_UNCHANGE), 'URL' => $url, 'IDCAT' => $idcat, 'COMPT' => $compt, 'CHECK_ENABLED' => $aprob_enable, 'CHECK_DISABLED' => $aprob_disable, 'KERNEL_EDITOR' => display_editor(), 'L_NOTE' => $LANG['note'], 'L_REQUIRE_NAME' => $LANG['require_title'], 'L_REQUIRE_URL' => $LANG['require_url'], 'L_REQUIRE_CAT' => $LANG['require_cat'], 'L_WEB_ADD' => $LANG['web_add'], 'L_WEB_MANAGEMENT' => $LANG['web_management'], 'L_WEB_CAT' => $LANG['cat_management'], 'L_WEB_CONFIG' => $LANG['web_config'], 'L_REQUIRE' => $LANG['require'], 'L_CATEGORY' => $LANG['categorie'], 'L_NAME' => $LANG['name'], 'L_URL_LINK' => $LANG['url'], 'L_VIEWS' => $LANG['views'], 'L_DESC' => $LANG['description'], 'L_APROB' => $LANG['aprob'], 'L_YES' => $LANG['yes'], 'L_NO' => $LANG['no'], 'L_SUBMIT' => $LANG['submit'], 'L_PREVIEW' => $LANG['preview'], 'L_RESET' => $LANG['reset']));
$i = 0;
$result = $Sql->query_while("SELECT id, name \n\tFROM " . PREFIX . "web_cat\n\tORDER BY class", __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$selected = $row['id'] == $idcat ? ' selected="selected"' : '';
$Template->assign_block_vars('select', array('CAT' => '<option value="' . $row['id'] . '"' . $selected . '>' . $row['name'] . '</option>'));
$i++;
}
$Sql->query_close($result);
if ($i == 0) {
$Errorh->handler($LANG['require_cat_create'], E_USER_WARNING);
}
$Template->pparse('admin_web_add');
} else {
$Template->set_filenames(array('admin_web_add' => 'web/admin_web_add.tpl'));
$Template->assign_vars(array('COMPT' => '0', 'CHECK_ENABLED' => 'checked="ckecked"', 'CHECK_DISABLED' => '', 'KERNEL_EDITOR' => display_editor(), 'L_REQUIRE_NAME' => $LANG['require_title'], 'L_REQUIRE_URL' => $LANG['require_url'], 'L_REQUIRE_CAT' => $LANG['require_cat'], 'L_WEB_ADD' => $LANG['web_add'], 'L_WEB_MANAGEMENT' => $LANG['web_management'], 'L_WEB_CAT' => $LANG['cat_management'], 'L_WEB_CONFIG' => $LANG['web_config'], 'L_REQUIRE' => $LANG['require'], 'L_CATEGORY' => $LANG['categorie'], 'L_NAME' => $LANG['name'], 'L_URL_LINK' => $LANG['url'], 'L_VIEWS' => $LANG['views'], 'L_DESC' => $LANG['description'], 'L_APROB' => $LANG['aprob'], 'L_YES' => $LANG['yes'], 'L_NO' => $LANG['no'], 'L_SUBMIT' => $LANG['submit'], 'L_PREVIEW' => $LANG['preview'], 'L_RESET' => $LANG['reset']));
$i = 0;
$result = $Sql->query_while("SELECT id, name \n\tFROM " . PREFIX . "web_cat\n\tORDER BY class", __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$Template->assign_block_vars('select', array('CAT' => '<option value="' . $row['id'] . '">' . $row['name'] . '</option>'));
$i++;
}
$Sql->query_close($result);
$get_error = retrieve(GET, 'error', '');
if ($get_error == 'incomplete') {
$Errorh->handler($LANG['e_incomplete'], E_USER_NOTICE);
} elseif ($i == 0) {
$Errorh->handler($LANG['require_cat_create'], E_USER_WARNING);
}
$Template->pparse('admin_web_add');
}
示例14: redirect
redirect(HOST . SCRIPT);
} else {
$Template->set_filenames(array('admin_maintain' => 'admin/admin_maintain.tpl'));
$array_time = array(-1, 60, 300, 600, 900, 1800, 3600, 7200, 10800, 14400, 18000, 21600, 25200, 28800, 57600);
$array_delay = array($LANG['unspecified'], '1 ' . $LANG['minute'], '5 ' . $LANG['minutes'], '10 ' . $LANG['minutes'], '15 ' . $LANG['minutes'], '30 ' . $LANG['minutes'], '1 ' . $LANG['hour'], '2 ' . $LANG['hours'], '3 ' . $LANG['hours'], '4 ' . $LANG['hours'], '5 ' . $LANG['hours'], '6 ' . $LANG['hours'], '7 ' . $LANG['hours'], '8 ' . $LANG['hours'], '16 ' . $LANG['hours']);
$array_size = count($array_time) - 1;
$CONFIG['maintain'] = isset($CONFIG['maintain']) ? $CONFIG['maintain'] : -1;
if ($CONFIG['maintain'] != -1) {
$key_delay = 0;
$current_time = time();
for ($i = $array_size; $i >= 1; $i--) {
if ($CONFIG['maintain'] - $current_time - $array_time[$i] < 0 && $CONFIG['maintain'] - $current_time - $array_time[$i - 1] > 0) {
$key_delay = $i - 1;
break;
}
}
} else {
$key_delay = 0;
}
$delay_maintain_option = '';
foreach ($array_time as $key => $time) {
$selected = $key_delay == $key ? 'selected="selected"' : '';
$delay_maintain_option .= '<option value="' . $time . '" ' . $selected . '>' . $array_delay[$key] . '</option>' . "\n";
}
$CONFIG['maintain_delay'] = isset($CONFIG['maintain_delay']) ? $CONFIG['maintain_delay'] : 1;
$CONFIG['maintain_display_admin'] = isset($CONFIG['maintain_display_admin']) ? $CONFIG['maintain_display_admin'] : 1;
$check_until = $CONFIG['maintain'] != -1 && $CONFIG['maintain'] > time() + 86400;
$Template->assign_vars(array('KERNEL_EDITOR' => display_editor(), 'DELAY_MAINTAIN_OPTION' => $delay_maintain_option, 'MAINTAIN_CONTENTS' => !empty($CONFIG['maintain_text']) ? unparse($CONFIG['maintain_text']) : '', 'DISPLAY_DELAY_ENABLED' => $CONFIG['maintain_delay'] == 1 ? 'checked="checked"' : '', 'DISPLAY_DELAY_DISABLED' => $CONFIG['maintain_delay'] == 0 ? 'checked="checked"' : '', 'DISPLAY_ADMIN_ENABLED' => $CONFIG['maintain_display_admin'] == 1 ? 'checked="checked"' : '', 'DISPLAY_ADMIN_DISABLED' => $CONFIG['maintain_display_admin'] == 0 ? 'checked="checked"' : '', 'MAINTAIN_CHECK_NO' => $CONFIG['maintain'] != -1 && $CONFIG['maintain'] <= time() ? ' checked="checked"' : '', 'MAINTAIN_CHECK_DELAY' => $CONFIG['maintain'] == -1 || $CONFIG['maintain'] > time() && $CONFIG['maintain'] <= time() + 86400 ? ' checked="checked"' : '', 'MAINTAIN_CHECK_UNTIL' => $check_until ? ' checked="checked"' : '', 'DATE_UNTIL' => $check_until ? gmdate_format('date_format_short', $CONFIG['maintain']) : '', 'L_MAINTAIN' => $LANG['maintain'], 'L_UNTIL' => $LANG['until'], 'L_DURING' => $LANG['during'], 'L_SET_MAINTAIN' => $LANG['maintain_for'], 'L_MAINTAIN_DELAY' => $LANG['maintain_delay'], 'L_MAINTAIN_DISPLAY_ADMIN' => $LANG['maintain_display_admin'], 'L_MAINTAIN_TEXT' => $LANG['maintain_text'], 'L_YES' => $LANG['yes'], 'L_NO' => $LANG['no'], 'L_UPDATE' => $LANG['update'], 'L_PREVIEW' => $LANG['preview'], 'L_RESET' => $LANG['reset']));
$Template->pparse('admin_maintain');
}
require_once '../admin/admin_footer.php';
示例15: display
function display($integrated_in_environment = INTEGRATED_IN_ENVIRONMENT, $Template = false, $page_path_to_root = '')
{
global $Cache, $User, $Errorh, $Sql, $LANG, $CONFIG, $CONFIG_USER, $CONFIG_COM, $_array_rank, $_array_groups_auth, $Session;
if ($integrated_in_environment) {
$idcom_get = retrieve(GET, 'com', 0);
$idcom_post = retrieve(POST, 'idcom', 0);
$idcom = $idcom_post > 0 ? $idcom_post : $idcom_get;
$this->set_arg($idcom);
}
$vars_simple = sprintf($this->vars, 0);
$delcom = retrieve(GET, 'delcom', 0);
$editcom = retrieve(GET, 'editcom', 0);
$updatecom = retrieve(GET, 'updatecom', false);
$path_redirect = $this->path . sprintf(str_replace('&', '&', $this->vars), 0) . (!empty($page_path_to_root) && !$integrated_in_environment ? '&path_to_root=' . $page_path_to_root : '');
if (!is_object($Template) || strtolower(get_class($Template)) != 'template') {
$Template = new Template('framework/content/com.tpl');
}
if ($this->is_loaded()) {
$Cache->load('com');
import('util/captcha');
$captcha = new Captcha();
$captcha->set_difficulty($CONFIG_COM['com_verif_code_difficulty']);
###########################Insertion##############################
if (retrieve(POST, 'valid_com', false) && !$updatecom) {
if ($User->get_attribute('user_readonly') > time()) {
$Errorh->handler('e_auth', E_USER_REDIRECT);
}
$login = retrieve(POST, 'login', '');
$contents = retrieve(POST, 'contents', '', TSTRING_UNCHANGE);
if (!empty($login) && !empty($contents)) {
if ($this->lock_com >= 1 && !$User->check_level(MODO_LEVEL)) {
redirect($path_redirect);
}
if ($User->check_level($CONFIG_COM['com_auth'])) {
$check_time = $User->get_attribute('user_id') !== -1 && $CONFIG['anti_flood'] == 1 ? $Sql->query("SELECT MAX(timestamp) as timestamp FROM " . DB_TABLE_COM . " WHERE user_id = '" . $User->get_attribute('user_id') . "'", __LINE__, __FILE__) : '';
if (!empty($check_time) && !$User->check_max_value(AUTH_FLOOD)) {
if ($check_time >= time() - $CONFIG['delay_flood']) {
redirect($path_redirect . '&errorh=flood#errorh');
}
}
if ($CONFIG_COM['com_verif_code'] && !$captcha->is_valid()) {
redirect($path_redirect . '&errorh=verif#errorh');
}
$contents = strparse($contents, $CONFIG_COM['forbidden_tags']);
if (!check_nbr_links($login, 0)) {
redirect($path_redirect . '&errorh=l_pseudo#errorh');
}
if (!check_nbr_links($contents, $CONFIG_COM['max_link'])) {
redirect($path_redirect . '&errorh=l_flood#errorh');
}
$last_idcom = $this->add($contents, $login);
redirect($path_redirect . '#m' . $last_idcom);
} else {
redirect($path_redirect . '&errorh=auth#errorh');
}
} else {
redirect($path_redirect . '&errorh=incomplete#errorh');
}
} elseif ($updatecom || $delcom > 0 || $editcom > 0) {
if ($User->get_attribute('user_readonly') > time()) {
$Errorh->handler('e_auth', E_USER_REDIRECT);
}
$row = $Sql->query_array(DB_TABLE_COM, '*', "WHERE idcom = '" . $this->idcom . "' AND idprov = '" . $this->idprov . "' AND script = '" . $this->script . "'", __LINE__, __FILE__);
$row['user_id'] = (int) $row['user_id'];
if ($this->idcom != 0 && ($User->check_level(MODO_LEVEL) || $row['user_id'] === $User->get_attribute('user_id') && $User->get_attribute('user_id') !== -1)) {
if ($delcom > 0) {
$Session->csrf_get_protect();
$lastid_com = $this->del();
$lastid_com = !empty($lastid_com) ? '#m' . $lastid_com : '';
redirect($path_redirect . $lastid_com);
} elseif ($editcom > 0) {
$Template->assign_vars(array('CURRENT_PAGE_COM' => $integrated_in_environment, 'POPUP_PAGE_COM' => !$integrated_in_environment, 'AUTH_POST_COM' => true));
if ($row['user_id'] !== -1) {
$Template->assign_vars(array('C_HIDDEN_COM' => true, 'LOGIN' => $User->get_attribute('login')));
} else {
$Template->assign_vars(array('C_VISIBLE_COM' => true, 'LOGIN' => $row['login']));
}
$Template->assign_vars(array('IDPROV' => $row['idprov'], 'IDCOM' => $row['idcom'], 'SCRIPT' => $this->script, 'CONTENTS' => unparse($row['contents']), 'DATE' => gmdate_format('date_format', $row['timestamp']), 'THEME' => get_utheme(), 'KERNEL_EDITOR' => display_editor($this->script . 'contents', $CONFIG_COM['forbidden_tags']), 'L_LANGUAGE' => substr(get_ulang(), 0, 2), 'L_EDIT_COMMENT' => $LANG['edit_comment'], 'L_REQUIRE_LOGIN' => $LANG['require_pseudo'], 'L_REQUIRE_TEXT' => $LANG['require_text'], 'L_DELETE_MESSAGE' => $LANG['alert_delete_msg'], 'L_LOGIN' => $LANG['pseudo'], 'L_MESSAGE' => $LANG['message'], 'L_RESET' => $LANG['reset'], 'L_PREVIEW' => $LANG['preview'], 'L_PREVIEW' => $LANG['preview'], 'L_SUBMIT' => $LANG['update'], 'U_ACTION' => $this->path . sprintf($this->vars, $this->idcom) . '&token=' . $Session->get_token() . '&updatecom=1' . (!empty($page_path_to_root) && !$integrated_in_environment ? '&path_to_root=' . $page_path_to_root : '')));
} elseif ($updatecom) {
$contents = retrieve(POST, 'contents', '', TSTRING_UNCHANGE);
$login = retrieve(POST, 'login', '');
if (!empty($contents) && !empty($login)) {
$contents = strparse($contents, $CONFIG_COM['forbidden_tags']);
if (!check_nbr_links($contents, $CONFIG_COM['max_link'])) {
redirect($path_redirect . '&errorh=l_flood#errorh');
}
$this->update($contents, $login);
redirect($path_redirect . '#m' . $this->idcom);
} else {
redirect($path_redirect . '&errorh=incomplete#errorh');
}
} else {
redirect($path_redirect . '&errorh=incomplete#errorh');
}
} else {
$Errorh->handler('e_auth', E_USER_REDIRECT);
}
} elseif (isset($_GET['lock']) && $User->check_level(MODO_LEVEL)) {
$Session->csrf_get_protect();
if ($User->check_level(MODO_LEVEL)) {
//.........这里部分代码省略.........