本文整理汇总了PHP中add_url_params函数的典型用法代码示例。如果您正苦于以下问题:PHP add_url_params函数的具体用法?PHP add_url_params怎么用?PHP add_url_params使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_url_params函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: on_index_thumbnails
static function on_index_thumbnails($thumbs)
{
global $page, $template;
$total = count($page['items']);
if (count($thumbs) >= $total) {
add_event_handler('loc_end_index', array('RVTS', 'on_end_index'));
return $thumbs;
}
$url_model = str_replace('123456789', '%start%', duplicate_index_url(array('start' => 123456789)));
$ajax_url_model = add_url_params($url_model, array('rvts' => '%per%'));
$url_model = str_replace('&', '&', $url_model);
$ajax_url_model = str_replace('&', '&', $ajax_url_model);
$my_base_name = basename(dirname(__FILE__));
$ajax_loader_image = get_root_url() . "plugins/{$my_base_name}/ajax-loader.gif";
$template->func_combine_script(array('id' => 'jquery', 'load' => 'footer', 'path' => 'themes/default/js/jquery.min.js'));
$template->func_combine_script(array('id' => $my_base_name, 'load' => 'async', 'path' => 'plugins/' . $my_base_name . '/rv_tscroller.min.js', 'require' => 'jquery', 'version' => RVTS_VERSION));
$start = (int) $page['start'];
$per_page = $page['nb_image_page'];
$moreMsg = 'See the remaining %d photos';
if ('en' != $GLOBALS['lang_info']['code']) {
load_language('lang', dirname(__FILE__) . '/');
$moreMsg = l10n($moreMsg);
}
// the String.fromCharCode comes from google bot which somehow manage to get these urls
$template->block_footer_script(null, "var RVTS = {\najaxUrlModel: String.fromCharCode(" . ord($ajax_url_model[0]) . ")+'" . substr($ajax_url_model, 1) . "',\nstart: {$start},\nperPage: {$per_page},\nnext: " . ($start + $per_page) . ",\ntotal: {$total},\nurlModel: String.fromCharCode(" . ord($url_model[0]) . ")+'" . substr($url_model, 1) . "',\nmoreMsg: '{$moreMsg}',\nprevMsg: '" . l10n("Previous") . "',\najaxLoaderImage: '{$ajax_loader_image}'\n};\njQuery('.navigationBar').hide();");
return $thumbs;
}
示例2: language_controler_flags
function language_controler_flags()
{
global $user, $template, $conf, $page;
$available_lang = get_languages();
if (isset($conf['no_flag_languages'])) {
$available_lang = array_diff_key($available_lang, array_flip($conf['no_flag_languages']));
}
$url_starting = get_query_string_diff(array('lang'));
if (isset($page['section']) and $page['section'] == 'additional_page' and isset($page['additional_page'])) {
$base_url = make_index_url(array('section' => 'page')) . '/' . (isset($page['additional_page']['permalink']) ? $page['additional_page']['permalink'] : $page['additional_page']['id']);
} else {
$base_url = duplicate_index_url();
}
foreach ($available_lang as $code => $displayname) {
$qlc = array('url' => add_url_params($base_url, array('lang' => $code)), 'alt' => ucwords($displayname), 'title' => substr($displayname, 0, -4), 'code' => $code);
$lsw['flags'][$code] = $qlc;
if ($code == $user['language']) {
$lsw['Active'] = $qlc;
}
}
$safe_themes = array('clear', 'dark', 'elegant', 'Sylvia', 'simple-grey', 'simple-black', 'simple-white', 'kardon', 'luciano', 'montblancxl');
// stripped (2.6)
$template->assign(array('lang_switch' => $lsw, 'LANGUAGE_SWITCH_PATH' => LANGUAGE_SWITCH_PATH, 'LANGUAGE_SWITCH_LOAD_STYLE' => !in_array($user['theme'], $safe_themes)));
$template->set_filename('language_flags', dirname(__FILE__) . '/flags.tpl');
$template->concat('PLUGIN_INDEX_ACTIONS', $template->parse('language_flags', true));
$template->clear_assign('lang_switch');
}
示例3: parse_sort_variables
function parse_sort_variables($sortable_by, $default_field, $get_param, $get_rejects, $template_var, $anchor = '')
{
global $template;
$url_components = parse_url($_SERVER['REQUEST_URI']);
$base_url = $url_components['path'];
parse_str($url_components['query'], $vars);
$is_first = true;
foreach ($vars as $key => $value) {
if (!in_array($key, $get_rejects) and $key != $get_param) {
$base_url .= $is_first ? '?' : '&';
$is_first = false;
$base_url .= $key . '=' . urlencode($value);
}
}
$ret = array();
foreach ($sortable_by as $field) {
$url = $base_url;
$disp = '↓';
// TODO: an small image is better
if ($field !== @$_GET[$get_param]) {
if (!isset($default_field) or $default_field != $field) {
// the first should be the default
$url = add_url_params($url, array($get_param => $field));
} elseif (isset($default_field) and !isset($_GET[$get_param])) {
$ret[] = $field;
$disp = '<em>' . $disp . '</em>';
}
} else {
$ret[] = $field;
$disp = '<em>' . $disp . '</em>';
}
if (isset($template_var)) {
$template->assign($template_var . strtoupper($field), '<a href="' . $url . $anchor . '" title="' . l10n('Sort order') . '">' . $disp . '</a>');
}
}
return $ret;
}
示例4: ROUND
, ROUND(AVG(rate),2) AS average
FROM ' . RATE_TABLE . '
WHERE element_id = ' . $picture['current']['id'] . '
;';
list($rate_summary['count'], $rate_summary['average']) = pwg_db_fetch_row(pwg_query($query));
}
$template->assign('rate_summary', $rate_summary);
$user_rate = null;
if ($conf['rate_anonymous'] or is_autorize_status(ACCESS_CLASSIC)) {
if ($rate_summary['count'] > 0) {
$query = 'SELECT rate
FROM ' . RATE_TABLE . '
WHERE element_id = ' . $page['image_id'] . '
AND user_id = ' . $user['id'];
if (!is_autorize_status(ACCESS_CLASSIC)) {
$ip_components = explode('.', $_SERVER['REMOTE_ADDR']);
if (count($ip_components) > 3) {
array_pop($ip_components);
}
$anonymous_id = implode('.', $ip_components);
$query .= ' AND anonymous_id = \'' . $anonymous_id . '\'';
}
$result = pwg_query($query);
if (pwg_db_num_rows($result) > 0) {
$row = pwg_db_fetch_assoc($result);
$user_rate = $row['rate'];
}
}
$template->assign('rating', array('F_ACTION' => add_url_params($url_self, array('action' => 'rate')), 'USER_RATE' => $user_rate, 'marks' => $conf['rate_items']));
}
}
示例5: add_url_params
if (can_manage_comment('delete', $row['author_id'])) {
$tpl_comment['U_DELETE'] = add_url_params($url_self, array('action' => 'delete_comment', 'comment_to_delete' => $row['id'], 'pwg_token' => get_pwg_token()));
}
if (can_manage_comment('edit', $row['author_id'])) {
$tpl_comment['U_EDIT'] = add_url_params($url_self, array('action' => 'edit_comment', 'comment_to_edit' => $row['id']));
if (isset($edit_comment) and $row['id'] == $edit_comment) {
$tpl_comment['IN_EDIT'] = true;
$tpl_comment['KEY'] = get_ephemeral_key(2);
$tpl_comment['CONTENT'] = $row['content'];
$tpl_comment['PWG_TOKEN'] = get_pwg_token();
$tpl_comment['U_CANCEL'] = $url_self;
}
}
if (is_admin()) {
if ($row['validated'] != 'true') {
$tpl_comment['U_VALIDATE'] = add_url_params($url_self, array('action' => 'validate_comment', 'comment_to_validate' => $row['id'], 'pwg_token' => get_pwg_token()));
}
}
$template->append('comments', $tpl_comment);
}
}
$show_add_comment_form = !is_a_guest() || $conf['guestbook']['guest_can_add'];
if (isset($edit_comment)) {
$show_add_comment_form = false;
}
if ($show_add_comment_form) {
foreach (array('content', 'author', 'website', 'email') as $el) {
${$el} = '';
if ('reject' === @$comment_action and !empty($comm[$el])) {
${$el} = htmlspecialchars(stripslashes($comm[$el]));
}
示例6: admintools_add_public_controller
/**
* Add main toolbar to current page
* @trigger loc_after_page_header
*/
function admintools_add_public_controller()
{
global $MultiView, $conf, $template, $page, $user, $picture;
if (script_basename() == 'picture' and empty($picture['current'])) {
return;
}
$url_root = get_root_url();
$tpl_vars = array();
if ($MultiView->is_admin()) {
// full options for admin
$tpl_vars['U_SITE_ADMIN'] = $url_root . 'admin.php?page=';
$tpl_vars['MULTIVIEW'] = $MultiView->get_data();
$tpl_vars['USER'] = $MultiView->get_user();
$tpl_vars['CURRENT_USERNAME'] = $user['id'] == $conf['guest_id'] ? l10n('guest') : $user['username'];
$tpl_vars['DELETE_CACHE'] = isset($conf['multiview_invalidate_cache']);
if (($admin_lang = $MultiView->get_user_language()) !== false) {
include_once PHPWG_ROOT_PATH . 'include/functions_mail.inc.php';
switch_lang_to($admin_lang);
}
} else {
if ($conf['AdminTools']['public_quick_edit'] and script_basename() == 'picture' and $picture['current']['added_by'] == $user['id']) {
// only "edit" button for photo owner
} else {
return;
}
}
$tpl_vars['POSITION'] = $conf['AdminTools']['closed_position'];
$tpl_vars['DEFAULT_OPEN'] = $conf['AdminTools']['default_open'];
$tpl_vars['U_SELF'] = $MultiView->get_clean_url(true);
// photo page
if (script_basename() == 'picture') {
$url_self = duplicate_picture_url();
$tpl_vars['IS_PICTURE'] = true;
// admin can add to caddie and set representattive
if ($MultiView->is_admin()) {
$template->clear_assign(array('U_SET_AS_REPRESENTATIVE', 'U_PHOTO_ADMIN', 'U_CADDIE'));
$template->set_prefilter('picture', 'admintools_remove_privacy');
$tpl_vars['U_CADDIE'] = add_url_params($url_self, array('action' => 'add_to_caddie'));
$query = '
SELECT element_id FROM ' . CADDIE_TABLE . '
WHERE element_id = ' . $page['image_id'] . '
;';
$tpl_vars['IS_IN_CADDIE'] = pwg_db_num_rows(pwg_query($query)) > 0;
if (isset($page['category'])) {
$tpl_vars['CATEGORY_ID'] = $page['category']['id'];
$tpl_vars['U_SET_REPRESENTATIVE'] = add_url_params($url_self, array('action' => 'set_as_representative'));
$tpl_vars['IS_REPRESENTATIVE'] = $page['category']['representative_picture_id'] == $page['image_id'];
}
$tpl_vars['U_ADMIN_EDIT'] = $url_root . 'admin.php?page=photo-' . $page['image_id'] . (isset($page['category']) ? '&cat_id=' . $page['category']['id'] : '');
}
$tpl_vars['U_DELETE'] = add_url_params($url_self, array('delete' => '', 'pwg_token' => get_pwg_token()));
// gets tags (full available list is loaded in ajax)
include_once PHPWG_ROOT_PATH . 'admin/include/functions.php';
$query = '
SELECT id, name
FROM ' . IMAGE_TAG_TABLE . ' AS it
JOIN ' . TAGS_TABLE . ' AS t ON t.id = it.tag_id
WHERE image_id = ' . $page['image_id'] . '
;';
$tag_selection = get_taglist($query);
$tpl_vars['QUICK_EDIT'] = array('img' => $picture['current']['derivatives']['square']->get_url(), 'name' => $picture['current']['name'], 'comment' => $picture['current']['comment'], 'author' => $picture['current']['author'], 'level' => $picture['current']['level'], 'date_creation' => substr($picture['current']['date_creation'], 0, 10), 'date_creation_time' => substr($picture['current']['date_creation'], 11, 5), 'tag_selection' => $tag_selection);
} else {
if ($MultiView->is_admin() and @$page['section'] == 'categories' and isset($page['category'])) {
$url_self = duplicate_index_url();
$tpl_vars['IS_CATEGORY'] = true;
$tpl_vars['CATEGORY_ID'] = $page['category']['id'];
$template->clear_assign(array('U_EDIT', 'U_CADDIE'));
$tpl_vars['U_ADMIN_EDIT'] = $url_root . 'admin.php?page=album-' . $page['category']['id'];
if (!empty($page['items'])) {
$tpl_vars['U_CADDIE'] = add_url_params($url_self, array('caddie' => 1));
}
$tpl_vars['QUICK_EDIT'] = array('img' => null, 'name' => $page['category']['name'], 'comment' => $page['category']['comment']);
if (!empty($page['category']['representative_picture_id'])) {
$query = '
SELECT * FROM ' . IMAGES_TABLE . '
WHERE id = ' . $page['category']['representative_picture_id'] . '
;';
$image_infos = pwg_db_fetch_assoc(pwg_query($query));
$tpl_vars['QUICK_EDIT']['img'] = DerivativeImage::get_one(IMG_SQUARE, $image_infos)->get_url();
}
}
}
$template->assign(array('ADMINTOOLS_PATH' => './plugins/' . ADMINTOOLS_ID . '/', 'ato' => $tpl_vars));
$template->set_filename('ato_public_controller', realpath(ADMINTOOLS_PATH . 'template/public_controller.tpl'));
$template->parse('ato_public_controller');
if ($MultiView->is_admin() && @$admin_lang !== false) {
switch_lang_back();
}
}
示例7: assign_vars_nbm_mail_content
function assign_vars_nbm_mail_content($nbm_user)
{
global $env_nbm;
set_make_full_url();
$env_nbm['mail_template']->assign(array('USERNAME' => stripslashes($nbm_user['username']), 'SEND_AS_NAME' => $env_nbm['send_as_name'], 'UNSUBSCRIBE_LINK' => add_url_params(get_gallery_home_url() . '/nbm.php', array('unsubscribe' => $nbm_user['check_key'])), 'SUBSCRIBE_LINK' => add_url_params(get_gallery_home_url() . '/nbm.php', array('subscribe' => $nbm_user['check_key'])), 'CONTACT_EMAIL' => $env_nbm['send_as_mail_address']));
unset_make_full_url();
}
示例8: add_url_params
// Database Transactions
$tmp_link = add_url_params($this->page_url, array("action" => "db_trans"), true);
$top_mod_links["links"][] = array("link" => $tmp_link, "desc" => "Transactions Tests", "image" => xml_escape($db_trans_image));
//=================================================================
// Pull a list records
//=================================================================
$strsql = "select * from contacts order by first_name, last_name";
$contacts = qdb_list($data_source, $strsql);
//=================================================================
// Alter dataset if Oracle or DB2
//=================================================================
lower_rec_keys($driver_type, $contacts);
foreach ($contacts as $key => $contact) {
extract($contact);
$edit_link = add_url_params($this->page_url, array("action" => "edit", "id" => $id));
$delete_link = add_url_params($this->page_url, array("action" => "confirm_delete", "id" => $id));
$contacts[$key]["edit"] = anchor($edit_link, $edit_image);
$contacts[$key]["delete"] = anchor($delete_link, $delete_image);
if (isset($change_id) && $id == $change_id) {
$change_row = $key;
}
}
//=================================================================
// Record Set List
//=================================================================
$data_order = array();
$data_order["id"] = "ID";
$data_order["first_name"] = "First Name";
$data_order["last_name"] = "Last Name";
$data_order["city"] = "City";
$data_order["state"] = "State";
示例9: pwg_mail
//.........这里部分代码省略.........
}
}
if (!isset($args['mail_title'])) {
$args['mail_title'] = $conf['gallery_title'];
}
if (!isset($args['mail_subtitle'])) {
$args['mail_subtitle'] = $args['subject'];
}
// content type
if (empty($args['content_format'])) {
$args['content_format'] = 'text/plain';
}
$content_type_list = array();
if ($conf_mail['mail_allow_html'] and @$args['email_format'] != 'text/plain') {
$content_type_list[] = 'text/html';
}
$content_type_list[] = 'text/plain';
$contents = array();
foreach ($content_type_list as $content_type) {
// key compose of indexes witch allow to cache mail data
$cache_key = $content_type . '-' . $lang_info['code'];
if (!empty($args['auth_key'])) {
$cache_key .= '-' . $args['auth_key'];
}
if (!isset($conf_mail[$cache_key])) {
// instanciate a new Template
if (!isset($conf_mail[$cache_key]['theme'])) {
$conf_mail[$cache_key]['theme'] = get_mail_template($content_type);
trigger_notify('before_parse_mail_template', $cache_key, $content_type);
}
$template =& $conf_mail[$cache_key]['theme'];
$template->set_filename('mail_header', 'header.tpl');
$template->set_filename('mail_footer', 'footer.tpl');
$add_url_params = array();
if (!empty($args['auth_key'])) {
$add_url_params['auth'] = $args['auth_key'];
}
$template->assign(array('GALLERY_URL' => add_url_params(get_gallery_home_url(), $add_url_params), 'GALLERY_TITLE' => isset($page['gallery_title']) ? $page['gallery_title'] : $conf['gallery_title'], 'VERSION' => $conf['show_version'] ? PHPWG_VERSION : '', 'PHPWG_URL' => defined('PHPWG_URL') ? PHPWG_URL : '', 'CONTENT_ENCODING' => get_pwg_charset(), 'CONTACT_MAIL' => $conf_mail['email_webmaster']));
if ($content_type == 'text/html') {
if ($template->smarty->templateExists('global-mail-css.tpl')) {
$template->set_filename('global-css', 'global-mail-css.tpl');
$template->assign_var_from_handle('GLOBAL_MAIL_CSS', 'global-css');
}
if ($template->smarty->templateExists('mail-css-' . $args['theme'] . '.tpl')) {
$template->set_filename('css', 'mail-css-' . $args['theme'] . '.tpl');
$template->assign_var_from_handle('MAIL_CSS', 'css');
}
}
}
$template =& $conf_mail[$cache_key]['theme'];
$template->assign(array('MAIL_TITLE' => $args['mail_title'], 'MAIL_SUBTITLE' => $args['mail_subtitle']));
// Header
$contents[$content_type] = $template->parse('mail_header', true);
// Content
// Stored in a temp variable, if a content template is used it will be assigned
// to the $CONTENT template variable, otherwise it will be appened to the mail
if ($args['content_format'] == 'text/plain' and $content_type == 'text/html') {
// convert plain text to html
$mail_content = '<p>' . nl2br(preg_replace('/(https?:\\/\\/([-\\w\\.]+[-\\w])+(:\\d+)?(\\/([\\w\\/_\\.\\#-]*(\\?\\S+)?[^\\.\\s])?)?)/i', '<a href="$1">$1</a>', htmlspecialchars($args['content']))) . '</p>';
} else {
if ($args['content_format'] == 'text/html' and $content_type == 'text/plain') {
// convert html text to plain text
$mail_content = strip_tags($args['content']);
} else {
$mail_content = $args['content'];
}
示例10: get_action_url
/**
* @param id image id
* @param what_part string one of 'e' (element), 'r' (representative)
*/
function get_action_url($id, $what_part, $download)
{
$params = array('id' => $id, 'part' => $what_part);
if ($download) {
$params['download'] = null;
}
return add_url_params(get_root_url() . 'action.php', $params);
}
示例11: add_url_params
}
// category comment
if ($page['start'] == 0 and !isset($page['chronology_field']) and !empty($page['comment'])) {
$template->assign('CONTENT_DESCRIPTION', $page['comment']);
}
if (isset($page['category']['count_categories']) and $page['category']['count_categories'] == 0) {
// count_categories might be computed by menubar - if the case unassign flat link if no sub albums
$template->clear_assign('U_MODE_FLAT');
}
//------------------------------------------------------ main part : thumbnails
if (0 == $page['start'] and !isset($page['flat']) and !isset($page['chronology_field']) and ('recent_cats' == $page['section'] or 'categories' == $page['section']) and (!isset($page['category']['count_categories']) or $page['category']['count_categories'] > 0)) {
include PHPWG_ROOT_PATH . 'include/category_cats.inc.php';
}
if (!empty($page['items'])) {
include PHPWG_ROOT_PATH . 'include/category_default.inc.php';
$url = add_url_params(duplicate_index_url(), array('display' => ''));
$selected_type = $template->get_template_vars('derivative_params')->type;
$template->clear_assign('derivative_params');
$type_map = ImageStdParams::get_defined_type_map();
unset($type_map[IMG_XXLARGE], $type_map[IMG_XLARGE]);
foreach ($type_map as $params) {
$template->append('image_derivatives', array('DISPLAY' => l10n($params->type), 'URL' => $url . $params->type, 'SELECTED' => $params->type == $selected_type ? true : false));
}
}
// slideshow
// execute after init thumbs in order to have all picture informations
if (!empty($page['cat_slideshow_url'])) {
if (isset($_GET['slideshow'])) {
redirect($page['cat_slideshow_url']);
} elseif ($conf['index_slideshow_icon']) {
$template->assign('U_SLIDESHOW', $page['cat_slideshow_url']);
示例12: osm_make_kml_index_url
function osm_make_kml_index_url($params)
{
global $conf, $osm_dir;
$url = get_root_url() . 'plugins/' . $osm_dir . '/kml.php';
if ($conf['question_mark_in_urls']) {
$url .= '?';
}
$url .= make_section_in_url($params);
unset($params['start']);
if ('categories' != $params['section']) {
unset($params['flat']);
}
$url = add_well_known_params_in_url($url, $params);
$get_params = array();
if (isset($params['box']) and !empty($params['box'])) {
include_once dirname(__FILE__) . '/functions_map.php';
if (!bounds_is_world($params['box'])) {
$get_params['box'] = bounds_to_url($params['box']);
}
}
if (isset($params['ll']) and !empty($params['ll'])) {
$get_params['ll'] = $params['ll']['lat'] . ',' . $params['ll']['lon'];
}
$url = add_url_params($url, $get_params);
return $url;
}
示例13: add_url_params
}
if (can_manage_comment('edit', $comment['author_id'])) {
$tpl_comment['U_EDIT'] = add_url_params($url_self, array('edit' => $comment['comment_id']));
if (isset($edit_comment) and $comment['comment_id'] == $edit_comment) {
$tpl_comment['IN_EDIT'] = true;
$key = get_ephemeral_key(2, $comment['image_id']);
$tpl_comment['KEY'] = $key;
$tpl_comment['IMAGE_ID'] = $comment['image_id'];
$tpl_comment['CONTENT'] = $comment['content'];
$tpl_comment['PWG_TOKEN'] = get_pwg_token();
$tpl_comment['U_CANCEL'] = $url_self;
}
}
if (can_manage_comment('validate', $comment['author_id'])) {
if ('true' != $comment['validated']) {
$tpl_comment['U_VALIDATE'] = add_url_params($url_self, array('validate' => $comment['comment_id'], 'pwg_token' => get_pwg_token()));
}
}
$template->append('comments', $tpl_comment);
}
}
$derivative_params = trigger_change('get_comments_derivative_params', ImageStdParams::get_by_type(IMG_THUMB));
$template->assign('derivative_params', $derivative_params);
// include menubar
$themeconf = $template->get_template_vars('themeconf');
if (!isset($themeconf['hide_menu_on']) or !in_array('theCommentsPage', $themeconf['hide_menu_on'])) {
include PHPWG_ROOT_PATH . 'include/menubar.inc.php';
}
// +-----------------------------------------------------------------------+
// | html code display |
// +-----------------------------------------------------------------------+
示例14: pqv_end_section_init
function pqv_end_section_init()
{
global $template, $page;
if (!pqv_is_active()) {
return;
}
if (empty($page['items'])) {
return;
}
$query = '
SELECT
id
FROM ' . IMAGES_TABLE . '
WHERE id IN (' . implode(',', $page['items']) . ')
AND pqv_validated = \'false\'
;';
$pqv_rejected = query2array($query, null, 'id');
if (isset($_GET['pqv_delete']) and count($pqv_rejected) > 0) {
include_once PHPWG_ROOT_PATH . 'admin/include/functions.php';
$deleted_count = delete_elements($pqv_rejected, true);
if ($deleted_count > 0) {
invalidate_user_cache();
$_SESSION['page_infos'][] = l10n_dec('%d photo was deleted', '%d photos were deleted', $deleted_count);
$redirect_url = duplicate_index_url(array(), array('pqv_delete'));
redirect($redirect_url);
}
}
if (count($pqv_rejected) > 0) {
$delete_url = add_url_params(duplicate_index_url(), array('pqv_delete' => 1));
$template->assign('CONTENT_DESCRIPTION', '<a href="' . $delete_url . '" onclick="return confirm(\'' . l10n('Are you sure?') . '\');">delete the ' . count($pqv_rejected) . ' rejected photo(s)</a>');
}
}
示例15: Audit_PWG_FluxBB
function Audit_PWG_FluxBB()
{
global $page, $conf, $errors;
$conf_Register_FluxBB = unserialize($conf['Register_FluxBB']);
$msg_error_PWG_Dup = '';
$msg_error_FluxBB_Dup = '';
$msg_error_Link_Break = '';
$msg_error_Link_Bad = '';
$msg_error_Synchro = '';
$msg_ok_Synchro = '';
$msg_error_PWG2FluxBB = '';
$msg_error_FluxBB2PWG = '';
// Check duplicate accounts in Piwigo users table
// ----------------------------------------------
$query = '
SELECT COUNT(*) AS nbr_dup, id, username
FROM ' . USERS_TABLE . '
WHERE username NOT IN ("18","16")
GROUP BY BINARY username
HAVING COUNT(*) > 1
;';
$result = pwg_query($query);
while ($row = pwg_db_fetch_assoc($result)) {
$msg_error_PWG_Dup .= '<br>' . l10n('Error_PWG_Dup') . $row['nbr_dup'] . ' x ' . stripslashes($row['username']);
}
// Display OK message or build errors
if ($msg_error_PWG_Dup == '') {
array_push($page['infos'], l10n('Audit_PWG_Dup') . '<br>' . l10n('Audit_OK'));
} else {
$msg_error_PWG_Dup = l10n('Audit_PWG_Dup') . $msg_error_PWG_Dup . '<br>' . l10n('Advise_PWG_Dup');
}
// Check duplicate accounts in FluxBB users table
// ----------------------------------------------
$query = '
SELECT COUNT(*) AS nbr_dup, username
FROM ' . FluxBB_USERS_TABLE . '
GROUP BY BINARY username
HAVING COUNT(*) > 1
;';
$result = pwg_query($query);
while ($row = pwg_db_fetch_assoc($result)) {
$msg_error_FluxBB_Dup .= '<br>' . l10n('Error_FluxBB_Dup') . $row['nbr_dup'] . ' x ' . stripslashes($row['username']);
$subquery = '
SELECT id, username, email
FROM ' . FluxBB_USERS_TABLE . '
WHERE BINARY username = BINARY "' . $row['username'] . '"
;';
$subresult = pwg_query($subquery);
while ($subrow = pwg_db_fetch_assoc($subresult)) {
$msg_error_FluxBB_Dup .= '<br>id:' . $subrow['id'] . '=' . stripslashes($subrow['username']) . ' (' . $subrow['email'] . ')';
// Action : Delete duplicate user from FluxBB
$msg_error_FluxBB_Dup .= ' <a href="';
$msg_error_FluxBB_Dup .= add_url_params(REGFLUXBB_ADMIN, array('action' => 'del_user', 'id' => $subrow['id']));
$msg_error_FluxBB_Dup .= '" title="' . l10n('Del_User') . stripslashes($subrow['username']) . '"';
$msg_error_FluxBB_Dup .= $conf_Register_FluxBB['FLUXBB_CONFIRM'] == 'false' ? ' onclick="return confirm(\'' . l10n('Are you sure?') . '\');" ' : ' ';
$msg_error_FluxBB_Dup .= '><img src="' . REGFLUXBB_PATH . '/admin/template/icon/user_delete.png" alt="' . l10n('Del_User') . $subrow['username'] . '" /></a>';
}
}
// Display OK message or build errors
if ($msg_error_FluxBB_Dup == '') {
array_push($page['infos'], l10n('Audit_FluxBB_Dup') . '<br>' . l10n('Audit_OK'));
} else {
$msg_error_FluxBB_Dup = l10n('Audit_FluxBB_Dup') . $msg_error_FluxBB_Dup . '<br>' . l10n('Advise_FluxBB_Dup');
}
// Check links between Piwigo and FluxBB users
// -------------------------------------------
// Check fixable broken links between Piwigo and FluxBB users
// ----------------------------------------------------------
$query = '
SELECT pwg.id as pwg_id, bb.id as bb_id, pwg.username as pwg_user, pwg.mail_address as pwg_mail
FROM ' . FluxBB_USERS_TABLE . ' AS bb, ' . USERS_TABLE . ' as pwg
WHERE bb.id NOT in (
SELECT id_user_FluxBB
FROM ' . Register_FluxBB_ID_TABLE . '
)
AND pwg.id NOT in (
SELECT id_user_pwg
FROM ' . Register_FluxBB_ID_TABLE . '
)
AND pwg.username = bb.username
AND pwg.username NOT IN ("18","16")
AND pwg.mail_address = bb.email
;';
$result = pwg_query($query);
while ($row = pwg_db_fetch_assoc($result)) {
$msg_error_Link_Break .= '<br>' . l10n('Error_Link_Break') . stripslashes($row['pwg_user']) . ' (' . $row['pwg_mail'] . ')';
// Action : Create new link
$msg_error_Link_Break .= ' <a href="';
$msg_error_Link_Break .= add_url_params(REGFLUXBB_ADMIN, array('action' => 'new_link', 'pwg_id' => $row['pwg_id'], 'bb_id' => $row['bb_id']));
$msg_error_Link_Break .= '" title="' . l10n('New_Link') . stripslashes($row['pwg_user']) . '"';
$msg_error_Link_Break .= $conf_Register_FluxBB['FLUXBB_CONFIRM'] == 'false' ? ' onclick="return confirm(\'' . l10n('Are you sure?') . '\');" ' : ' ';
$msg_error_Link_Break .= '><img src="' . REGFLUXBB_PATH . '/admin/template/icon/link_break.png" alt="' . l10n('New_Link') . stripslashes($row['pwg_user']) . '" /></a>';
}
// Display OK message or build errors
if ($msg_error_Link_Break == '') {
array_push($page['infos'], l10n('Audit_Link_Break') . '<br>' . l10n('Audit_OK'));
} else {
$msg_error_Link_Break = l10n('Audit_Link_Break') . $msg_error_Link_Break;
}
// Check not fixable broken links between Piwigo and FluxBB users
//.........这里部分代码省略.........