本文整理汇总了PHP中redirectMsg函数的典型用法代码示例。如果您正苦于以下问题:PHP redirectMsg函数的具体用法?PHP redirectMsg怎么用?PHP redirectMsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了redirectMsg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update_tag
function update_tag()
{
global $xoopsModule, $xoopsSecurity;
$page = rmc_server_var($_POST, 'page', 1);
$tags = rmc_server_var($_POST, 'tags', array());
if (!$xoopsSecurity->check()) {
redirectMsg('tags.php?page=' . $page, __('Sorry, operation not allowed!', 'mywords'), 1);
die;
}
if (!is_array($tags) || empty($tags)) {
redirectMsg('tags.php?page=' . $page, __('Please, specify a valid tag id!', 'mywords'), 1);
die;
}
foreach ($tags as $id) {
$tag = new MWTag($id);
if ($tag->isNew()) {
continue;
}
$tag->update_posts();
}
redirectMsg('tags.php?page=' . $page, __('Tags updated!', 'mywords'), 0);
}
示例2: deleteTopics
/**
* @desc Elimina los temas especificados
**/
function deleteTopics()
{
global $xoopsSecurity;
foreach ($_POST as $k => $v) {
${$k} = $v;
}
if (!$xoopsSecurity->check()) {
redirectMsg('prune.php', __('Session token expired!', 'bxpress'), 0);
die;
}
$db = XoopsDatabaseFactory::getDatabaseConnection();
$sql = "SELECT id_topic FROM " . $db->prefix('bxpress_topics') . " WHERE ";
$sql .= $forums == 0 ? '' : "id_forum='{$forums}' ";
//Determinamos de que foro se va a limpiar temas
$sql .= $forums ? " AND date<" . (time() - $days * 86400) : " date<" . (time() - $days * 86400);
//Determinamos los temas con los dias de antigüedad especificados
$sql .= $option == 2 ? " AND replies=0" : '';
//Determinamos los temas a eliminar
$sql .= $fixed ? " AND sticky=1 " : ' AND sticky=0';
//Temas fijos
$result = $db->queryF($sql);
$num = $db->getRowsNum($result);
while ($rows = $db->fetchArray($result)) {
$topic = new BBTopic();
$topic->assignVars($rows);
$topic->delete();
}
redirectMsg('prune.php', sprintf(__('Prune done! %u topics deleted', 'bxpress'), $num), 0);
}
示例3: rd_save_page
function rd_save_page()
{
$page = rmc_server_var($_POST, 'homepage', '');
if (file_put_contents(XOOPS_CACHE_PATH . '/rd_homepage.html', $page)) {
redirectMsg('hpage.php', __('Page saved successfully!', 'docs'), 0);
} else {
redirectMsg('hpage.php', __('Page could not be saved!', 'docs'), 1);
}
}
示例4: eventCoreIncludeFunctionsRedirectheader
public function eventCoreIncludeFunctionsRedirectheader($params)
{
// 0 = URL
// 1 = Time
// 2 = Message
// 3 = Add redirect
// 4 = Allow external link
RMEvents::get()->run_event('rmcommon.redirect.header', $params[0], $params[1], $params[2], $params[3], $params[4]);
if (!defined('XOOPS_CPFUNC_LOADED')) {
return;
}
redirectMsg($params[0], $params[2]);
die;
}
示例5: xt_show_menus
function xt_show_menus()
{
global $xtAssembler, $xtFunctions;
$tc = TextCleaner::getInstance();
$menus = $xtAssembler->rootMenus();
if (!$menus) {
redirectMsg('themes.php', __('This theme does not support xThemes menus!', 'xthemes'), RMMSG_WARN);
}
$theme_menu = $xtAssembler->menu();
$tpl = RMTemplate::get();
$tpl->add_local_script('jquery.nestedSortable.js', 'xthemes');
$tpl->add_local_script('json_encode.js', 'xthemes');
$tpl->add_head_script("var lang_delete = '" . __('Do you really want to delete selected menu?', 'xthemes') . "';");
$tpl->add_local_script('xthemes.js', 'xthemes');
$tpl->assign('xoops_pagetitle', __('Theme menus', 'xthemes'));
xoops_cp_header();
include $tpl->get_template('xt_navigation.php', 'module', 'xthemes');
xoops_cp_footer();
}
示例6: delete_mw_trackbacks
function delete_mw_trackbacks()
{
global $xoopsSecurity;
$tbs = rmc_server_var($_POST, 'tbs', array());
if (empty($tbs) || !is_array($tbs)) {
redirectMsg('trackbacks.php', __('Select one trackback at least!', 'mw_categories'), 1);
die;
}
if (!$xoopsSecurity->check()) {
redirectMsg('trackbacks.php', __('Session token expired!', 'mywords'), 1);
die;
}
// Event
RMEvents::get()->run_event('mywords.before.delete.trackback', $tbs);
foreach ($tbs as $id) {
$trac = new MWTrackbackObject($id);
if ($trac->isNew()) {
continue;
}
$trac->delete();
}
redirectMsg('trackbacks.php', __('Trackbacks deleted successfully', 'mywords'), 0);
}
示例7: m_delete_category
/**
* Deleting a category
*/
function m_delete_category()
{
global $xoopsModule, $xoopsSecurity;
$ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : 0;
$ok = isset($_POST['ok']) ? intval($_POST['ok']) : 0;
//Verificamos que nos hayan proporcionado una categoría para eliminar
if (!is_array($ids) && $ids <= 0) {
redirectMsg('./categories.php', __('No categories selected!', 'match'), 1);
die;
}
if (!is_array($ids)) {
$catego = new MCHCategory($ids);
$ids = array($ids);
}
if (!$xoopsSecurity->check()) {
redirectMsg('./categories.php', __('Session token expired!', 'match'), 1);
die;
}
$db = XoopsDatabaseFactory::getDatabaseConnection();
$errors = '';
foreach ($ids as $k) {
//Verificamos si la categoría es válida
if ($k <= 0) {
$errors .= sprintf(__('Category id "%s" is not valid!', 'match'), $k);
continue;
}
//Verificamos si la categoría existe
$cat = new MCHCategory($k);
if ($cat->isNew()) {
$errors .= sprintf(__('Category "%s" does not exists!', 'match'), $k);
continue;
}
RMEvents::get()->run_event('match.delete.category', $cat);
if (!$cat->delete()) {
$errors .= sprintf(__('Category "%s" could not be deleted!', 'match'), $k);
} else {
$sql = "UPDATE " . $db->prefix('mch_categories') . " SET parent='" . $cat->getVar('parent') . "' WHERE parent='" . $cat->id() . "'";
$result = $db->queryF($sql);
}
}
if ($errors != '') {
redirectMsg('./categories.php', __('Errors ocurred while trying to delete categories', 'match') . '<br />' . $errors, 1);
die;
} else {
redirectMsg('./categories.php', __('Database updated successfully!', 'match'), 0);
die;
}
}
示例8: activeCategory
/**
* @desc Activa/desactiva las categorías especificadas
**/
function activeCategory($act = 0)
{
global $xoopsSecurity;
$ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : null;
if (!$xoopsSecurity->check()) {
redirectMsg('./categos.php', __('Session token expired!', 'works'), 1);
die;
}
//Verificamos que nos hayan proporcionado una categoría
if (!is_array($ids)) {
redirectMsg('./categos.php', __('You must select a category to enable/disable', 'works'), 1);
die;
}
$errors = '';
foreach ($ids as $k) {
//Verificamos si la categoría es válida
if ($k <= 0) {
$errors .= sprintf(__('Category id "%s" is not valid!', 'works'), $k);
continue;
}
//Verificamos si la categoría existe
$cat = new PWCategory($k);
if ($cat->isNew()) {
$errors .= sprintf(__('Specified category "%s" does not exists!', 'works'), $k);
continue;
}
$cat->setActive($act);
RMEvents::get()->run_event('works.activate.category', $cat);
if (!$cat->save()) {
$errors .= sprintf(__('Category "%s" could not be saved!', 'works'), $k);
}
}
if ($errors != '') {
redirectMsg('./categos.php', __('Errors ocurred while trying to save category', 'works') . $errors, 1);
die;
} else {
redirectMsg('./categos.php', __('Database updated successfully!', 'works'), 0);
die;
}
}
示例9: xt_save_settings
function xt_save_settings()
{
global $xoopsConfig, $xtAssembler, $xtFunctions;
if (!$xtAssembler->isSupported()) {
redirectMsg('index.php', __('This is a not valid theme', 'xthemes'), 1);
}
$xt_to_save = array();
$theme = $xtAssembler->theme();
foreach ($_POST as $id => $v) {
if (substr($id, 0, 5) != 'conf_') {
continue;
}
$xt_to_save[substr($id, 5)] = $theme->checkSettingValue($v);
}
if (!$xtFunctions->insertOptions($theme, $xt_to_save)) {
redirectMsg('settings.php', __('Settings could not be saved! Please try again', 'xthemes'), RMMSG_ERROR);
}
RMEvents::get()->run_event('xtheme.save.settings', $xt_to_save);
redirectMsg('settings.php', __('Settings updated successfully!', 'xthemes'), RMMSG_SAVED);
}
示例10: module_disable_now
function module_disable_now($enable = 0)
{
global $xoopsSecurity, $xoopsConfig;
$mod = rmc_server_var($_POST, 'module', '');
if (!$xoopsSecurity->check()) {
redirectMsg('modules.php', __('Sorry, this operation could not be completed!', 'rmcommon'), 1);
die;
}
$module_handler = xoops_gethandler('module');
if (!($module = $module_handler->getByDirname($mod))) {
redirectMsg('modules.php', sprintf(__('Module %s is not installed yet!', 'rmcommon'), $mod), 1);
die;
}
RMEvents::get()->run_event('rmcommon.disabling.module', $module);
$db = XoopsDatabaseFactory::getDatabaseConnection();
$sql = "UPDATE " . $db->prefix("modules") . " SET isactive='{$enable}' WHERE dirname='{$mod}'";
if (!$db->queryF($sql)) {
redirectMsg('modules.php', sprintf(__('Module %s could not be disabled!', 'rmcommon'), $mod), 1);
die;
}
RMEvents::get()->run_event('rmcommon.module.disabled', $module);
redirectMsg("modules.php", sprintf(__('Module %s successfully disabled!', 'rmcommon'), $module->name()), 0);
}
示例11: deleteCoachs
function deleteCoachs()
{
global $db;
$coachs = TCFunctions::request('coachs');
if (empty($coachs)) {
redirectMsg('coachs.php', __('Selecciona al menos un entrenador', 'admin_template'), 1);
die;
}
foreach ($coachs as $k) {
$coach = new TCCoach($k);
$coach->delete();
}
redirectMsg('coachs.php', __('Base de datos actulizada correctamente', 'admin_template'), 0);
}
示例12: array
// $Id$
// --------------------------------------------------------------
// Designia v1.0
// Theme for Common Utilities 2
// Author: Eduardo Cortés <i.bitcero@gmail.com>
// Email: i.bitcero@gmail.com
// License: GPL 2.0
// --------------------------------------------------------------
global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $rmc_config;
include XOOPS_ROOT_PATH . '/include/cp_header.php';
require_once XOOPS_ROOT_PATH . '/modules/rmcommon/admin_loader.php';
if (rmc_server_var($_POST, 'action', '') != '') {
$settings = "<?php\n\nreturn array(\n'logo' => '" . rmc_server_var($_POST, 'logo_url', RMCURL . '/themes/designia/images/logo.png') . "',\n'scheme' => '" . rmc_server_var($_POST, 'scheme', 'colors') . "'\n);";
file_put_contents(XOOPS_CACHE_PATH . '/designia.php', $settings);
redirectMsg(RMCURL, __('Settings saved successfully!', 'designia'), RMMSG_SUCCESS);
die;
}
RMTemplate::get()->add_theme_style('settings.css', 'designia');
RMTemplate::get()->add_local_script('colorpicker.js', 'rmcommon', 'include');
RMTemplate::get()->add_style('colorpicker.css', 'rmcommon');
RMTemplate::get()->add_theme_script('settings.js', 'designia');
RMTemplate::get()->assign('xoops_pagetitle', __('Designia Options', 'designia'));
$dConfig = (include XOOPS_CACHE_PATH . '/designia.php');
xoops_cp_header();
?>
<h1 class=rmc_titles><?php
_e('Designia Theme Settings', 'designia');
?>
</h1>
示例13: cm_send_reply
/**
* Sends a reply made from reply form
*/
function cm_send_reply()
{
global $xoopsSecurity, $xoopsModuleConfig, $xoopsConfig;
$id = rmc_server_var($_POST, 'id', 0);
$page = rmc_server_var($_POST, 'page', 1);
if ($id <= 0) {
redirectMsg('index.php?page=' . $page, __('You must specify a message ID', 'contact'), 1);
die;
}
if (!$xoopsSecurity->check()) {
redirectMsg('index.php?page=' . $page, __('Session token expired!', 'contact'), 1);
die;
}
$msg = new CTMessage($id);
if ($msg->isNew()) {
redirectMsg('index.php?page=' . $page, __('Sorry, specified message does not exists!', 'contact'), 1);
die;
}
$subject = rmc_server_var($_POST, 'subject', '');
$message = rmc_server_var($_POST, 'message', 1);
if ($subject == '' || $message == '') {
redirectMsg('index.php?action=reply&id=' . $id . '&page=' . $page, __('Please fill al required fields!', 'contact'), 1);
die;
}
$xoopsMailer =& getMailer();
$xoopsMailer->useMail();
$xoopsMailer->setBody($message . '\\n--------------\\n' . __('Message sent with ContactMe!', 'contact') . '\\nFrom ' . $xoopsModuleConfig['url']);
$xoopsMailer->setToEmails($msg->getVar('email'));
$xoopsMailer->setFromEmail($xoopsConfig['from']);
$xoopsMailer->setFromName($xoopsConfig['fromname']);
$xoopsMailer->setSubject($subject);
if (!$xoopsMailer->send(true)) {
redirectMsg('index.php?action=reply&id=' . $id . '&page=' . $page, __('Message could not be delivered. Please try again.', 'contact') . '<br />' . $xoopsMailer->getErrors(), 1);
die;
}
redirectMsg('index.php?page=' . $page, __('Message sent successfully!', 'contact'), 0);
}
示例14: redirectMsg
<?php
require_once 'common/functions.php';
$id = (int) $_GET['id'];
$tag = $_GET['tag'];
$p = (int) $_GET['p'];
$fav = (int) $_GET['fav'];
if (!empty($fav) && !loggedIn()) {
//only allow favorite search if user is logged in
redirectMsg("./", 'Operação não permitida');
}
$offset = $p * 12;
if (!empty($id) && !empty($tag) || !empty($id) && !empty($fav) || !empty($tag) && !empty($fav)) {
//tag AND id AND favorite? no sir
redirect('./');
}
if (isset($_SESSION['json_news'])) {
unset($_SESSION['json_news']);
}
//unset array of news from obter_noticias.php (if no news have been added)
require_once 'db/news_query.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Social News</title>
<link rel="stylesheet" href="common/style.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="common/favorites.js"></script>
<script src="common/search.js"></script>
示例15: clonePage
function clonePage()
{
$id = rmc_server_var($_GET, 'id', 0);
$page = new QPPage($id);
if ($page->isNew()) {
redirectMsg('pages.php', __('Specified page does not exists!', 'qpages'), 1);
die;
}
$page->setNew();
$page->setTitle($page->getTitle() . ' [cloned]');
$page->setFriendTitle(TextCleaner::sweetstring($page->getTitle()));
if (!$page->save()) {
redirectMsg('pages.php', __('Page could not be cloned!', 'qpages'), 1);
die;
}
redirectMsg('pages.php?op=edit&id=' . $page->getID(), __('Page cloned successfully!', 'qpages'), 0);
}