当前位置: 首页>>代码示例>>PHP>>正文


PHP misc_data_update函数代码示例

本文整理汇总了PHP中misc_data_update函数的典型用法代码示例。如果您正苦于以下问题:PHP misc_data_update函数的具体用法?PHP misc_data_update怎么用?PHP misc_data_update使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了misc_data_update函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: captcha_configure

function captcha_configure()
{
    global $main_smarty, $the_template;
    $q_1_low = isset($_REQUEST['q_1_low']) ? $_REQUEST['q_1_low'] : '';
    $q_1_high = isset($_REQUEST['q_1_high']) ? $_REQUEST['q_1_high'] : '';
    $q_2_low = isset($_REQUEST['q_2_low']) ? $_REQUEST['q_2_low'] : '';
    $q_2_high = isset($_REQUEST['q_2_high']) ? $_REQUEST['q_2_high'] : '';
    if ($q_1_low != '') {
        misc_data_update('captcha_math_q1low', $q_1_low);
    } else {
        $q_1_low = get_misc_data('captcha_math_q1low') == '' ? 1 : get_misc_data('captcha_math_q1low');
    }
    if ($q_1_high != '') {
        misc_data_update('captcha_math_q1high', $q_1_high);
    } else {
        $q_1_high = get_misc_data('captcha_math_q1high') == '' ? 5 : get_misc_data('captcha_math_q1high');
    }
    if ($q_2_low != '') {
        misc_data_update('captcha_math_q2low', $q_2_low);
    } else {
        $q_2_low = get_misc_data('captcha_math_q2low') == '' ? 1 : get_misc_data('captcha_math_q2low');
    }
    if ($q_2_high != '') {
        misc_data_update('captcha_math_q2high', $q_2_high);
    } else {
        $q_2_high = get_misc_data('captcha_math_q2high') == '' ? 5 : get_misc_data('captcha_math_q2high');
    }
    $main_smarty->assign('q_1_low', sanitize($q_1_low, 2));
    $main_smarty->assign('q_1_high', sanitize($q_1_high, 2));
    $main_smarty->assign('q_2_low', sanitize($q_2_low, 2));
    $main_smarty->assign('q_2_high', sanitize($q_2_high, 2));
}
开发者ID:bklein01,项目名称:pligg-cms,代码行数:32,代码来源:main.php

示例2: enable_captcha

function enable_captcha($captcha)
{
    include_once captcha_captchas_path . '/' . $captcha . '/main.php';
    if (captcha_can_we_use()) {
        misc_data_update('captcha_method', $captcha);
        //captcha_admin();
    }
}
开发者ID:bklein01,项目名称:pligg-cms,代码行数:8,代码来源:captcha_main.php

示例3: captcha_configure

function captcha_configure()
{
    global $main_smarty;
    if (isset($_REQUEST['pubkey'])) {
        $pubkey = $_REQUEST['pubkey'];
    } else {
        $pubkey = '';
    }
    if (isset($_REQUEST['privkey'])) {
        $privkey = $_REQUEST['privkey'];
    } else {
        $privkey = '';
    }
    if (isset($_REQUEST['hashkey'])) {
        $hashkey = $_REQUEST['hashkey'];
    } else {
        $hashkey = '';
    }
    if (isset($_REQUEST['theme'])) {
        $theme = $_REQUEST['theme'];
    } else {
        $theme = '';
    }
    if (isset($_REQUEST['lang'])) {
        $lang = $_REQUEST['lang'];
    } else {
        $lang = '';
    }
    if ($pubkey != '' && $pubkey != get_misc_data('adcopy_pubkey')) {
        misc_data_update('adcopy_pubkey', $pubkey);
        $main_smarty->assign('msg', 'Settings Saved');
    }
    if ($privkey != '' && $privkey != get_misc_data('adcopy_privkey')) {
        misc_data_update('adcopy_privkey', $privkey);
        $main_smarty->assign('msg', 'Settings Saved');
    }
    if ($hashkey != '' && $hashkey != get_misc_data('adcopy_hashkey')) {
        misc_data_update('adcopy_hashkey', $hashkey);
        $main_smarty->assign('msg', 'Settings Saved');
    }
    if ($theme != '' && $theme != get_misc_data('adcopy_theme')) {
        misc_data_update('adcopy_theme', $theme);
        $main_smarty->assign('msg', 'Settings Saved');
    }
    if ($lang != '' && $lang != get_misc_data('adcopy_lang')) {
        misc_data_update('adcopy_lang', $lang);
        $main_smarty->assign('msg', 'Settings Saved');
    }
    $main_smarty->assign('captcha_pubkey', get_misc_data('adcopy_pubkey'));
    $main_smarty->assign('captcha_privkey', get_misc_data('adcopy_privkey'));
    $main_smarty->assign('captcha_hashkey', get_misc_data('adcopy_hashkey'));
    $main_smarty->assign('captcha_theme', get_misc_data('adcopy_theme'));
    $main_smarty->assign('captcha_lang', get_misc_data('adcopy_lang'));
}
开发者ID:bendroid,项目名称:pligg-cms,代码行数:54,代码来源:main.php

示例4: karma_showpage

function karma_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        // Save settings
        if ($_POST['submit']) {
            misc_data_update('karma_submit_story', sanitize($_REQUEST['karma_submit_story'], 3));
            misc_data_update('karma_submit_comment', sanitize($_REQUEST['karma_submit_comment'], 3));
            misc_data_update('karma_story_publish', sanitize($_REQUEST['karma_story_publish'], 3));
            misc_data_update('karma_story_vote', sanitize($_REQUEST['karma_story_vote'], 3));
            misc_data_update('karma_story_unvote', sanitize($_REQUEST['karma_story_vote_remove'], 3));
            misc_data_update('karma_comment_vote', sanitize($_REQUEST['karma_comment_vote'], 3));
            misc_data_update('karma_story_discard', sanitize($_REQUEST['karma_story_discard'], 3));
            misc_data_update('karma_story_spam', sanitize($_REQUEST['karma_story_spam'], 3));
            misc_data_update('karma_comment_delete', sanitize($_REQUEST['karma_comment_delete'], 3));
            if ($_REQUEST['karma_username'] && $_REQUEST['karma_value'] != 0) {
                $db->query($sql = "UPDATE " . table_users . " SET user_karma=user_karma+'" . $db->escape($_REQUEST['karma_value']) . "' WHERE user_login='" . $db->escape($_REQUEST['karma_username']) . "'");
                if (!$db->rows_affected) {
                    $error = "Wrong username " . sanitize($_REQUEST['karma_username'], 1);
                }
            }
            $main_smarty->assign('error', $error);
        }
        // breadcrumbs
        $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
        $navwhere['link1'] = getmyurl('admin', '');
        $navwhere['text2'] = "Modify Karma";
        $navwhere['link2'] = my_pligg_base . "/module.php?module=karma";
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        // breadcrumbs
        define('modulename', 'karma');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'admin_modify_karma');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('settings', str_replace('"', '"', get_karma_settings()));
        $main_smarty->assign('tpl_center', karma_tpl_path . 'karma_main');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:bendroid,项目名称:pligg-cms,代码行数:51,代码来源:karma_main.php

示例5: close_comments_showpage

function close_comments_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        if ($_POST['submit']) {
            $_REQUEST = str_replace('"', "'", $_REQUEST);
            $close_comment_method = trim($_REQUEST['close_comment_method']);
            $close_comment_time = trim($_REQUEST['close_comment_time']);
            if ($close_comment_method == 'time') {
                misc_data_update('close_comment_method', mysql_real_escape_string($close_comment_method));
            } elseif ($close_comment_method == 'manual') {
                misc_data_update('close_comment_method', mysql_real_escape_string($close_comment_method));
            } elseif ($close_comment_method == 'both') {
                misc_data_update('close_comment_method', mysql_real_escape_string($close_comment_method));
            } else {
                $main_smarty->assign('module_error', "Method POST data did not contain an expected value");
            }
            if (is_numeric($close_comment_time)) {
                misc_data_update('close_comment_time', mysql_real_escape_string($close_comment_time));
            } else {
                $main_smarty->assign('module_error', "Time POST data did not contain a numerical value. Please give the second field a value of 0 or higher.");
            }
        }
        // breadcrumbs
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        // breadcrumbs
        define('modulename', 'close_comments');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'close_comments_settings');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('settings', get_close_comments_settings());
        $main_smarty->assign('tpl_center', close_comments_tpl_path . 'close_comments_settings');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:hyrmedia,项目名称:modules,代码行数:47,代码来源:close_comments_main.php

示例6: contactable_showpage

function contactable_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        if ($_POST['submit']) {
            $_REQUEST = str_replace('"', "'", $_REQUEST);
            $contactable_input = $_REQUEST['contactable_mail'];
            $result = filter_var($contactable_input, FILTER_VALIDATE_EMAIL);
            // Checking if the email is valid. Returns 'false' if not valid.
            if (!$result) {
                // Email is not valid
                $msg = "Error! Your email address does not appear to be valid.";
            } else {
                // Add email address to database field
                misc_data_update('contactable_mail', mysql_real_escape_string($contactable_input));
            }
        }
        // breadcrumbs
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        define('modulename', 'contactable');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'admin_contactable');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('msg', $msg);
        // Error messages
        $main_smarty->assign('contactable', get_contactable_settings());
        $main_smarty->assign('tpl_center', contactable_tpl_path . 'settings');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:hyrmedia,项目名称:modules,代码行数:42,代码来源:contactable_main.php

示例7: spam_trigger_showpage

function spam_trigger_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        // Save settings
        if ($_POST['submit']) {
            misc_data_update('spam_trigger_light', sanitize($_REQUEST['spam_light'], 3));
            misc_data_update('spam_trigger_medium', sanitize($_REQUEST['spam_medium'], 3));
            misc_data_update('spam_trigger_hard', sanitize($_REQUEST['spam_hard'], 3));
            header("Location: " . my_pligg_base . "/module.php?module=spam_trigger");
            die;
        }
        // breadcrumbs
        $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
        $navwhere['link1'] = getmyurl('admin', '');
        $navwhere['text2'] = "Modify spam_trigger";
        $navwhere['link2'] = my_pligg_base . "/module.php?module=spam_trigger";
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        define('modulename', 'spam_trigger');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'admin_modifyspam_trigger');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('settings', str_replace('"', '"', get_spam_trigger_settings()));
        $main_smarty->assign('places', $spam_trigger_places);
        $main_smarty->assign('tpl_center', spam_trigger_tpl_path . 'spam_trigger_main');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:bendroid,项目名称:pligg-cms,代码行数:40,代码来源:spam_trigger_main.php

示例8: analytics_showpage

function analytics_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        if ($_POST['submit']) {
            $_REQUEST = str_replace('"', "'", $_REQUEST);
            $analytics_input = substr($_REQUEST['analytics_id'], 0, 14);
            // Shorten input to 14 characters (max length of Analytics IDs)
            if (strlen($analytics_input) > '14') {
                $msg = "Error! The value entered was more than 14 characters in length. Please try again.";
            }
            misc_data_update('analytics_id', mysql_real_escape_string($analytics_input));
        }
        // breadcrumbs
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        define('modulename', 'analytics');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'admin_analytics');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('msg', $msg);
        // Error messages
        $main_smarty->assign('settings', get_analytics_settings());
        $main_smarty->assign('tpl_center', analytics_tpl_path . 'settings');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:hyrmedia,项目名称:modules,代码行数:38,代码来源:analytics_main.php

示例9: links_showpage

function links_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('god');
    if ($canIhaveAccess == 1) {
        if ($_POST['submit']) {
            misc_data_update('links_comments', sanitize($_REQUEST['links_comments'], 3));
            misc_data_update('links_stories', sanitize($_REQUEST['links_stories'], 3));
            misc_data_update('links_nofollow', sanitize($_REQUEST['links_nofollow'], 3));
            misc_data_update('links_host', sanitize($_REQUEST['links_host'], 3));
            header("Location: " . my_pligg_base . "/module.php?module=links");
            die;
        }
        // breadcrumbs
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        // breadcrumbs
        define('modulename', 'links');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'admin_modifylinks');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('settings', links_settings());
        $main_smarty->assign('tpl_center', links_tpl_path . 'links_main');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:36,代码来源:links_main.php

示例10: array

$module_info['update_url'] = 'http://pligg.com/downloads/module/upload-module/version/';
$module_info['homepage_url'] = 'http://pligg.com/downloads/module/upload-module/';
$module_info['settings_url'] = '../module.php?module=upload';
// this is where you set the modules "name" and "version" that is required
// if more that one module is required then just make a copy of that line
$module_info['db_add_table'][] = array('name' => table_prefix . "files", 'sql' => "CREATE TABLE `" . table_prefix . "files` (\n\t  `file_id` int(11) NOT NULL auto_increment,\n\t  `file_name` varchar(255) default NULL,\n\t  `file_size` varchar(20) default NULL,\n\t  `file_user_id` int(11) NOT NULL,\n\t  `file_link_id` int(11) NOT NULL,\n\t  `file_orig_id` int(11) NOT NULL,\n\t  `file_real_size` int(11) NOT NULL,\n\t  `file_number` tinyint(4) NOT NULL,\n\t  `file_ispicture` tinyint(4) NOT NULL,\n\t  PRIMARY KEY  (`file_id`)\n\t) ENGINE=MyISAM ");
// these are seperate because most people will have the tables already
// created from a previous install
$module_info['db_add_field'][] = array(table_prefix . 'files', 'file_fields', 'TEXT', '', '', 0, '');
$module_info['db_add_field'][] = array(table_prefix . 'files', 'file_hide_thumb', 'TINYINT', 1, "UNSIGNED", 0, '0');
$module_info['db_add_field'][] = array(table_prefix . 'files', 'file_hide_file', 'TINYINT', 1, "UNSIGNED", 0, '0');
$module_info['db_add_field'][] = array(table_prefix . 'files', 'file_comment_id', 'INT', 11, '', 0, '0');
if (get_misc_data('upload_thumb') == '') {
    misc_data_update('upload_thumb', '1');
    misc_data_update('upload_sizes', 'a:1:{i:0;s:7:"200x200";}');
    misc_data_update('upload_display', 'a:1:{s:7:"150x150";s:1:"1";}');
    misc_data_update('upload_fields', 'YTowOnt9');
    misc_data_update('upload_alternates', 'YToxOntpOjE7czowOiIiO30=');
    misc_data_update('upload_mandatory', 'a:0:{}');
    misc_data_update('upload_place', 'tpl_link_summary_pre_story_content');
    misc_data_update('upload_external', 'file,url');
    misc_data_update('upload_link', 'orig');
    misc_data_update('upload_quality', '80');
    misc_data_update('upload_directory', '/modules/upload/attachments');
    misc_data_update('upload_thdirectory', '/modules/upload/attachments/thumbs');
    misc_data_update('upload_filesize', '200');
    misc_data_update('upload_maxnumber', '1');
    misc_data_update('upload_extensions', 'jpg jpeg png gif');
    misc_data_update('upload_defsize', '200x200');
    misc_data_update('upload_fileplace', 'tpl_pligg_story_who_voted_start');
}
开发者ID:bendroid,项目名称:pligg-cms,代码行数:31,代码来源:upload_install.php

示例11: upload_showpage

function upload_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        // Save settings
        if ($_POST['submit']) {
            misc_data_update('upload_thumb', sanitize($_REQUEST['upload_thumb'], 3));
            $sizes = unserialize(get_misc_data('upload_sizes'));
            for ($i = 0; $i < sizeof($sizes); $i++) {
                if (@in_array($sizes[$i], $_POST['delsize'])) {
                    if ($_REQUEST['upload_defsize'] == $sizes[$i]) {
                        $_REQUEST['upload_defsize'] = 'orig';
                    }
                    array_splice($sizes, $i--, 1);
                }
            }
            if (is_numeric($_POST['upload_width']) && $_POST['upload_width'] > 0 && is_numeric($_POST['upload_height']) && $_POST['upload_height'] > 0) {
                $size = sanitize($_POST['upload_width'] . 'x' . $_POST['upload_height'], 3);
                if (!@in_array($size, $sizes)) {
                    $sizes[] = $size;
                    $files = $db->get_results($sql = "SELECT a.* FROM " . table_prefix . "files a\n\t\t\t\t\t\t\t\t    LEFT JOIN " . table_prefix . "files b ON a.file_id=b.file_orig_id AND b.file_size='{$size}'\n\t\t\t\t\t\t\t\t    WHERE a.file_size='orig' AND ISNULL(b.file_id)");
                    if ($files) {
                        misc_data_update('upload_sizes', serialize($sizes));
                        misc_data_update('upload_thumb_format', $_REQUEST['upload_thumb_format']);
                        misc_data_update('upload_quality', $_REQUEST['upload_quality'] <= 100 && $_REQUEST['upload_quality'] >= 1 ? $_REQUEST['upload_quality'] : 80);
                        $settings = get_upload_settings();
                        foreach ($files as $file) {
                            generate_thumbs(strpos($file->file_name, 'http') === 0 ? $file->file_name : mnmpath . sanitize($_REQUEST['upload_directory'], 3) . '/' . $file->file_name, $file->file_link_id, $settings, $file->file_id, $size);
                        }
                    }
                }
            }
            $fields = unserialize(base64_decode(get_misc_data('upload_fields')));
            for ($i = 0; $i < sizeof($fields); $i++) {
                if (in_array($fields[$i], $_POST['delfield'])) {
                    array_splice($fields, $i--, 1);
                }
            }
            if ($_POST['upload_new_field']) {
                $fields[] = sanitize($_POST['upload_new_field'], 3);
            }
            if ($_POST['alternate']) {
                foreach ($_POST['alternate'] as $k => $v) {
                    $alternates[$k] = sanitize($v, 3);
                }
            }
            $mandatory = array();
            if ($_POST['mandatory']) {
                foreach ($_POST['mandatory'] as $k => $v) {
                    $mandatory[$k] = sanitize($v, 3);
                }
            }
            $display = array();
            if ($_POST['display']) {
                foreach ($_POST['display'] as $k => $v) {
                    $display[$k] = sanitize($v, 3);
                }
            }
            misc_data_update('upload_sizes', serialize($sizes));
            misc_data_update('upload_fields', base64_encode(serialize($fields)));
            misc_data_update('upload_alternates', base64_encode(serialize($alternates)));
            misc_data_update('upload_mandatory', serialize($mandatory));
            misc_data_update('upload_display', serialize($display));
            misc_data_update('upload_place', sanitize($_REQUEST['upload_place'], 3));
            misc_data_update('upload_defsize', sanitize($_REQUEST['upload_defsize'], 3));
            misc_data_update('upload_external', sanitize($_REQUEST['upload_external'], 3));
            misc_data_update('upload_format', $_REQUEST['upload_format']);
            misc_data_update('upload_pre_format', $_REQUEST['upload_pre_format']);
            misc_data_update('upload_post_format', $_REQUEST['upload_post_format']);
            misc_data_update('upload_thumb_format', $_REQUEST['upload_thumb_format']);
            misc_data_update('upload_t_pre_format', $_REQUEST['upload_thumb_pre_format']);
            misc_data_update('upload_t_post_format', $_REQUEST['upload_thumb_post_format']);
            misc_data_update('upload_allow_hide', sanitize($_REQUEST['upload_allow_hide'], 3));
            misc_data_update('upload_quality', $_REQUEST['upload_quality'] <= 100 && $_REQUEST['upload_quality'] >= 1 ? $_REQUEST['upload_quality'] : 80);
            misc_data_update('upload_link', sanitize($_REQUEST['upload_link'], 3));
            misc_data_update('upload_directory', sanitize($_REQUEST['upload_directory'], 3));
            misc_data_update('upload_thdirectory', sanitize($_REQUEST['upload_thdirectory'], 3));
            misc_data_update('upload_filesize', sanitize($_REQUEST['upload_filesize'], 3));
            misc_data_update('upload_maxnumber', sanitize($_REQUEST['upload_maxnumber'], 3));
            misc_data_update('upload_extensions', sanitize($_REQUEST['upload_extensions'], 3));
            misc_data_update('upload_fileplace', sanitize($_REQUEST['upload_fileplace'], 3));
            misc_data_update('upload_allow_comment', sanitize($_REQUEST['upload_allow_comment'], 3));
            misc_data_update('upload_commentplace', sanitize($_REQUEST['upload_commentplace'], 3));
            misc_data_update('upload_cfilelist', sanitize($_REQUEST['upload_commentfilelist'], 3));
            header("Location: " . my_pligg_base . "/module.php?module=upload");
            die;
        }
        // breadcrumbs
        $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
        $navwhere['link1'] = getmyurl('admin', '');
        $navwhere['text2'] = "Modify Upload";
//.........这里部分代码省略.........
开发者ID:hyrmedia,项目名称:pligg-cms,代码行数:101,代码来源:upload_main.php

示例12: status_showpage

function status_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        if ($_POST['submit']) {
            if ($_REQUEST['status_level']) {
                $level = join(',', $_REQUEST['status_level']);
            }
            if ($_REQUEST['status_profile_level']) {
                $level1 = join(',', $_REQUEST['status_profile_level']);
            }
            $_REQUEST = str_replace('"', "'", $_REQUEST);
            misc_data_update('status_level', mysql_real_escape_string($level));
            misc_data_update('status_profile_level', mysql_real_escape_string($level1));
            misc_data_update('status_switch', mysql_real_escape_string($_REQUEST['status_switch']));
            misc_data_update('status_allowsearch', mysql_real_escape_string($_REQUEST['status_allowsearch']));
            misc_data_update('status_place', mysql_real_escape_string($_REQUEST['status_place']));
            misc_data_update('status_pre_format', mysql_real_escape_string($_REQUEST['status_pre_format']));
            misc_data_update('status_post_format', mysql_real_escape_string($_REQUEST['status_post_format']));
            misc_data_update('status_pre_comment', mysql_real_escape_string($_REQUEST['status_pre_comment']));
            misc_data_update('status_post_comment', mysql_real_escape_string($_REQUEST['status_post_comment']));
            misc_data_update('status_pre_story', mysql_real_escape_string($_REQUEST['status_pre_story']));
            misc_data_update('status_post_story', mysql_real_escape_string($_REQUEST['status_post_story']));
            misc_data_update('status_pre_username', mysql_real_escape_string($_REQUEST['status_pre_username']));
            misc_data_update('status_post_username', mysql_real_escape_string($_REQUEST['status_post_username']));
            misc_data_update('status_pre_search', mysql_real_escape_string($_REQUEST['status_pre_search']));
            misc_data_update('status_post_search', mysql_real_escape_string($_REQUEST['status_post_search']));
            misc_data_update('status_pre_submit', mysql_real_escape_string($_REQUEST['status_pre_submit']));
            misc_data_update('status_post_submit', mysql_real_escape_string($_REQUEST['status_post_submit']));
            misc_data_update('status_email', mysql_real_escape_string($_REQUEST['status_email']));
            misc_data_update('status_clock', mysql_real_escape_string($_REQUEST['status_clock']));
            misc_data_update('status_permalinks', mysql_real_escape_string($_REQUEST['status_permalinks']));
            misc_data_update('status_inputonother', mysql_real_escape_string($_REQUEST['status_inputonother']));
            misc_data_update('status_show_permalin', mysql_real_escape_string($_REQUEST['status_show_permalinks']));
            misc_data_update('status_results', mysql_real_escape_string($_REQUEST['status_results']));
            misc_data_update('status_max_chars', mysql_real_escape_string($_REQUEST['status_max_chars']));
            misc_data_update('status_avatar', mysql_real_escape_string($_REQUEST['status_avatar']));
            misc_data_update('status_groups', mysql_real_escape_string($_REQUEST['status_groups']));
            misc_data_update('status_users', mysql_real_escape_string($_REQUEST['status_users']));
            misc_data_update('status_user_switch', mysql_real_escape_string($_REQUEST['status_user_switch']));
            misc_data_update('status_user_friends', mysql_real_escape_string($_REQUEST['status_user_friends']));
            misc_data_update('status_user_story', mysql_real_escape_string($_REQUEST['status_user_story']));
            misc_data_update('status_user_comment', mysql_real_escape_string($_REQUEST['status_user_comment']));
            misc_data_update('status_user_group', mysql_real_escape_string($_REQUEST['status_user_group']));
            misc_data_update('status_user_email', mysql_real_escape_string($_REQUEST['status_user_email']));
            $db->query("ALTER TABLE " . table_users . " \r\n\t\t\t\t\tCHANGE  `status_switch`  `status_switch` TINYINT(1) DEFAULT '" . ($_REQUEST['status_user_switch'] + 0) . "',\r\n\t\t\t\t\tCHANGE  `status_friends` `status_friends` TINYINT(1) DEFAULT '" . ($_REQUEST['status_user_friends'] + 0) . "',\r\n\t\t\t\t\tCHANGE  `status_story`  `status_story` TINYINT(1) DEFAULT  '" . ($_REQUEST['status_user_story'] + 0) . "',\r\n\t\t\t\t\tCHANGE  `status_comment`  `status_comment` TINYINT(1) DEFAULT  '" . ($_REQUEST['status_user_comment'] + 0) . "',\r\n\t\t\t\t\tCHANGE  `status_group`  `status_group` TINYINT(1) DEFAULT  '" . ($_REQUEST['status_user_group'] + 0) . "',\r\n\t\t\t\t\tCHANGE  `status_email`  `status_email` TINYINT(1) DEFAULT  '" . ($_REQUEST['status_user_email'] + 0) . "'");
            header("Location: " . my_pligg_base . "/module.php?module=status");
            die;
        }
        // breadcrumbs
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        // breadcrumbs
        define('modulename', 'status');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'admin_modifystatus');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('settings', get_status_settings());
        $main_smarty->assign('tpl_center', status_tpl_path . 'status_main');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:bendroid,项目名称:pligg-cms,代码行数:73,代码来源:status_main.php

示例13: get_misc_data

$widget['widget_title'] = "Akismet Anti-Spam";
$widget['widget_has_settings'] = 1;
$widget['widget_shrink_icon'] = 1;
$widget['widget_uninstall_icon'] = 0;
$widget['name'] = 'Akismet';
$widget['desc'] = 'Akismet Anti-Spam Module';
$widget['version'] = 0.1;
$wordpress_key = get_misc_data('wordpress_key');
if ($_REQUEST['widget'] == 'akismet') {
    if (isset($_REQUEST['key'])) {
        $wordpress_key = sanitize($_REQUEST['key'], 3);
    } else {
        $wordpress_key = '';
    }
    misc_data_update('wordpress_key', $wordpress_key);
}
if ($main_smarty) {
    $main_smarty->assign('wordpress_key', $wordpress_key);
    if (function_exists('akismet_get_link_count')) {
        $count1 = akismet_get_link_count();
        $count2 = akismet_get_comment_count();
        $main_smarty->assign('spam_links_count', $count1);
        $main_smarty->assign('spam_comments_count', $count2);
        if ($count1 == 0 && $count2 == 0) {
            $widget['column'] = '';
        }
    } else {
        $widget['column'] = '';
    }
}
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:30,代码来源:init.php

示例14: VARCHAR

     $sql = "CHANGE  `user_categories`  `user_categories` VARCHAR( 255 ) DEFAULT  ''";
     $db->query($sql);
     if (get_misc_data('user_cat') == '' && $db->get_var("SELECT user_categories FROM " . table_users . " WHERE user_level='admin' LIMIT 1")) {
         $sqlGetiCategory = "SELECT category__auto_id from " . table_categories . " where category__auto_id!= 0;";
         $sqlGetiCategoryQ = mysql_query($sqlGetiCategory);
         $arr = array();
         while ($row = mysql_fetch_array($sqlGetiCategoryQ, MYSQL_NUM)) {
             $arr[] = $row[0];
         }
         $result = mysql_query("SELECT * FROM " . table_users);
         while ($row = mysql_fetch_array($result)) {
             $cats = split(',', $row['user_categories']);
             $diff = array_diff($arr, $cats);
             mysql_query($sql = "UPDATE " . table_users . " SET user_categories='" . join(',', $diff) . "' WHERE user_id='{$row['user_id']}'");
         }
         misc_data_update('user_cat', 'changed');
     }
 }
 $fieldexists = checkforfield('category_desc', table_categories);
 if (!$fieldexists) {
     $sql = "ALTER TABLE `" . table_categories . "` ADD `category_desc` varchar(255) NOT NULL;";
     $db->query($sql);
 }
 $fieldexists = checkforfield('category_keywords', table_categories);
 if (!$fieldexists) {
     $sql = "ALTER TABLE `" . table_categories . "` ADD `category_keywords` varchar(255) NOT NULL;";
     $db->query($sql);
 }
 $sql = "ALTER TABLE `" . table_links . "` ADD FULLTEXT `link_search` (\r\n\t`link_title` ,\r\n\t`link_content` ,\r\n\t`link_tags`\r\n\t);";
 $show_errors = $db->show_errors;
 $db->show_errors = false;
开发者ID:hyrmedia,项目名称:pligg-cms,代码行数:31,代码来源:1.x.php

示例15: upload_showpage

function upload_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('god');
    if ($canIhaveAccess == 1) {
        // Save settings
        if ($_POST['submit']) {
            misc_data_update('upload_thumb', sanitize($_REQUEST['upload_thumb'], 3));
            $sizes = unserialize(get_misc_data('upload_sizes'));
            for ($i = 0; $i < sizeof($sizes); $i++) {
                if (in_array($sizes[$i], $_POST['delsize'])) {
                    if ($_REQUEST['upload_defsize'] == $sizes[$i]) {
                        $_REQUEST['upload_defsize'] = 'orig';
                    }
                    array_splice($sizes, $i--, 1);
                }
            }
            if (is_numeric($_POST['upload_width']) && $_POST['upload_width'] > 0 && is_numeric($_POST['upload_height']) && $_POST['upload_height'] > 0) {
                $sizes[] = sanitize($_POST['upload_width'] . 'x' . $_POST['upload_height'], 3);
            }
            misc_data_update('upload_sizes', serialize($sizes));
            misc_data_update('upload_place', sanitize($_REQUEST['upload_place'], 3));
            misc_data_update('upload_defsize', sanitize($_REQUEST['upload_defsize'], 3));
            misc_data_update('upload_external', sanitize($_REQUEST['upload_external'], 3));
            misc_data_update('upload_link', sanitize($_REQUEST['upload_link'], 3));
            misc_data_update('upload_directory', sanitize($_REQUEST['upload_directory'], 3));
            misc_data_update('upload_thdirectory', sanitize($_REQUEST['upload_thdirectory'], 3));
            misc_data_update('upload_filesize', sanitize($_REQUEST['upload_filesize'], 3));
            misc_data_update('upload_maxnumber', sanitize($_REQUEST['upload_maxnumber'], 3));
            misc_data_update('upload_extensions', sanitize($_REQUEST['upload_extensions'], 3));
            misc_data_update('upload_fileplace', sanitize($_REQUEST['upload_fileplace'], 3));
            header("Location: " . my_pligg_base . "/module.php?module=upload");
            die;
        }
        // breadcrumbs
        $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
        $navwhere['link1'] = getmyurl('admin', '');
        $navwhere['text2'] = "Modify Upload";
        $navwhere['link2'] = my_pligg_base . "/module.php?module=upload";
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        // breadcrumbs
        define('modulename', 'upload');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'admin_modifyupload');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('settings', get_upload_settings());
        $main_smarty->assign('places', $upload_places);
        $main_smarty->assign('tpl_center', upload_tpl_path . 'upload_main');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        echo "Access denied";
    }
}
开发者ID:pantofla,项目名称:geez,代码行数:62,代码来源:upload_main.php


注:本文中的misc_data_update函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。