Esempio n. 1
0
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));
}
Esempio n. 2
0
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();
    }
}
Esempio n. 3
0
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'));
}
Esempio n. 4
0
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='******'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']));
    }
}
Esempio n. 5
0
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']));
    }
}
Esempio n. 6
0
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']));
    }
}
Esempio n. 7
0
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']));
    }
}
Esempio n. 8
0
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']));
    }
}
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']));
    }
}
Esempio n. 10
0
function captcha_configure()
{
    global $main_smarty;
    if (isset($_REQUEST['pubkey'])) {
        $pubkey = $_REQUEST['pubkey'];
    } else {
        $pubkey = '';
    }
    if (isset($_REQUEST['prikey'])) {
        $prikey = $_REQUEST['prikey'];
    } else {
        $prikey = '';
    }
    if ($pubkey != '' && $pubkey != get_misc_data('reCaptcha_pubkey')) {
        misc_data_update('reCaptcha_pubkey', $pubkey);
        $main_smarty->assign('msg', 'Update Complete');
    }
    if ($prikey != '' && $prikey != get_misc_data('reCaptcha_prikey')) {
        misc_data_update('reCaptcha_prikey', $prikey);
        $main_smarty->assign('msg', 'Update Complete');
    }
    $main_smarty->assign('captcha_pubkey', get_misc_data('reCaptcha_pubkey'));
    $main_smarty->assign('captcha_prikey', get_misc_data('reCaptcha_prikey'));
}
Esempio n. 11
0
$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');
}
Esempio n. 12
0
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";
        $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', str_replace('"', '&#034;', 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 {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
Esempio n. 13
0
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']));
    }
}
Esempio n. 14
0
$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'] = '';
    }
}
Esempio n. 15
0
     $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;
Esempio n. 16
0
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";
    }
}
Esempio n. 17
0
<?php

$widget['widget_title'] = "New Products";
$widget['widget_has_settings'] = 1;
$widget['widget_shrink_icon'] = 0;
$widget['widget_uninstall_icon'] = 0;
$widget['name'] = 'New Products';
$widget['desc'] = 'This widget displays the latest products available in the Pligg Pro Shop';
$widget['version'] = 0.1;
$product_count = get_misc_data('product_count');
if ($product_count <= 0) {
    $product_count = '3';
}
if ($_REQUEST['widget'] == 'pligg_products') {
    if (isset($_REQUEST['products'])) {
        $product_count = sanitize($_REQUEST['products'], 3);
    }
    misc_data_update('product_count', $product_count);
}
if ($main_smarty) {
    $main_smarty->assign('product_count', $product_count);
}
Esempio n. 18
0
function dropbox_backup_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('dropbox_backup_email', sanitize($_REQUEST['dropbox_backup_email'], 3));
            /*
            misc_data_update('dropbox_backup_save', sanitize($_REQUEST['dropbox_backup_save'], 3));
            $dropbox_backup_save=escapeshellcmd(get_misc_data('dropbox_backup_save'));
            if ($dropbox_backup_save == "Yes"){
            	misc_data_update('dropbox_backup_pass', sanitize($_REQUEST['dropbox_backup_pass'], 3));
            } else {
            	misc_data_update('dropbox_backup_pass', '');
            }
            */
            misc_data_update('dropbox_backup_dir', sanitize($_REQUEST['dropbox_backup_dir'], 3));
            $dropbox_pass = sanitize($_REQUEST['dropbox_backup_pass'], 3);
            // Current Directory
            $path = "admin/backup/";
            $db_path = "modules/dropbox_backup/backup/";
            // Check if it is Writable
            $backup_permissions = substr(sprintf('%o', fileperms($db_path)), -4);
            if ($backup_permissions !== '0777') {
                $error = 'The directory /' . $db_path . ' is not writable! Set the CHMOD permissions to 777 and try again.';
            } else {
                $files = array();
                $dir = opendir('admin/backup');
                while (($file = readdir($dir)) !== false) {
                    if ($file !== '.' && $file !== '..' && !is_dir($file) && $file !== 'index.htm') {
                        $files[] = $file;
                    }
                }
                closedir($dir);
                sort($files);
                if (count($files) != '0') {
                    /*
                    Copyright (c) 2011 http://ramui.com. All right reserved.
                    This product is protected by copyright and distributed under licenses restricting copying, distribution. Permission is granted to the public to download and use this script provided that this Notice and any statement of authorship are reproduced in every page on all copies of the script.
                    */
                    class recurseZip
                    {
                        private function recurse_zip($src, &$zip, $path)
                        {
                            $dir = opendir($src);
                            while (false !== ($file = readdir($dir))) {
                                if ($file != '.' && $file != '..') {
                                    if (is_dir($src . '/' . $file)) {
                                        $this->recurse_zip($src . '/' . $file, $zip, $path);
                                    } else {
                                        $zip->addFile($src . '/' . $file, substr($src . '/' . $file, $path));
                                    }
                                }
                            }
                            closedir($dir);
                        }
                        public function compress($src, $dst = '')
                        {
                            if (substr($src, -1) === '/') {
                                $src = substr($src, 0, -1);
                            }
                            if (substr($dst, -1) === '/') {
                                $dst = substr($dst, 0, -1);
                            }
                            $path = strlen(dirname($src) . '/');
                            $rand = substr(md5(microtime()), rand(0, 26), 5);
                            $zipname = 'Pligg' . "_" . date("Y-m-d_H-i-s") . '_' . $rand . '.zip';
                            $dst = empty($dst) ? $zipname : $dst . '/' . $zipname;
                            @unlink($dst);
                            $zip = new ZipArchive();
                            $res = $zip->open($dst, ZipArchive::CREATE);
                            if ($res !== TRUE) {
                                $status = 'error';
                                $message = 'Error: Unable to create zip file';
                            }
                            if (is_file($src)) {
                                $zip->addFile($src, substr($src, $path));
                            } else {
                                if (!is_dir($src)) {
                                    $zip->close();
                                    @unlink($dst);
                                    $status = 'error';
                                    $message = 'Error: File not found';
                                }
                                $this->recurse_zip($src, $zip, $path);
                            }
                            $zip->close();
                            return $dst;
                        }
                    }
                    //Source file or directory to be compressed.
                    $src = 'admin/backup';
                    //Destination folder where we create Zip file.
                    $dst = 'modules/dropbox_backup/backup';
                    $z = new recurseZip();
                    $fullpath = $z->compress($src, $dst);
                    $source = basename($fullpath);
                    if ($status != 'error') {
                        $status = 'success';
                        $message = 'The file has been sent to your Dropbox account.';
                    }
                    // Send to Dropbox
                    $dropbox_email = escapeshellcmd(get_misc_data('dropbox_backup_email'));
                    // Dropbox email address
                    //$dropbox_pass=escapeshellcmd(get_misc_data('dropbox_backup_pass'));   	// Dropbox password
                    //$dropbox_pass_save=escapeshellcmd(get_misc_data('dropbox_backup_save'));// Save password?
                    $dropbox_dir = escapeshellcmd(get_misc_data('dropbox_backup_dir'));
                    // DropBox directory (optional) - Folder on the Dropbox
                    include 'DropboxUploader.php';
                    $uploader = new DropboxUploader($dropbox_email, $dropbox_pass);
                    // $uploader->setCaCertificateFile("modules/dropbox_backup/ca-bundle.crt");
                    $uploader->upload($dst . '/' . $source, $dropbox_dir);
                    // Delete the file
                    $delete_me = $dst . '/' . $source;
                    chmod($delete_me, 0666);
                    unlink($delete_me);
                } else {
                    $status = 'error';
                    $message = '<h3>No backup files were found!</h3><p>Please <a href="admin/admin_backup.php">make a backup from this page</a> before trying to upload to Dropbox.</p>';
                }
            }
        }
        $main_smarty->assign('status', $status);
        $main_smarty->assign('message', $message);
        $main_smarty->assign('error', $error);
        // Breadcrumbs
        $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
        $navwhere['link1'] = getmyurl('admin', '');
        $navwhere['text2'] = "Dropbox Backup";
        $navwhere['link2'] = my_pligg_base . "/module.php?module=dropbox_backup";
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        define('modulename', 'dropbox_backup');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'dropbox_backup_admin');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('settings', str_replace('"', '&#034;', get_dropbox_backup_settings()));
        $main_smarty->assign('tpl_center', dropbox_backup_tpl_path . 'dropbox_backup_main');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
Esempio n. 19
0
$widget['widget_has_settings'] = 1;
$widget['widget_shrink_icon'] = 1;
$widget['widget_uninstall_icon'] = 1;
$widget['name'] = 'Last Logged in Users';
$widget['desc'] = 'Shows the latest signed users.';
$widget['version'] = 1.0;
$widget['homepage_url'] = '';
////////////////////////////////////////////////////////////////////
// Fetch Size
/* get_misc_data('limit_size') does not work because there is no such value in the misc table,
we have to set it here otherwise the it was breaking the query because the query was LIMIT and no limit values.
*/
//$limit_size = get_misc_data('limit_size');
$limit_size = 5;
if ($_REQUEST['widget'] == 'setting_limit') {
    if (isset($_REQUEST['limit_size'])) {
        $limit_size = sanitize($_REQUEST['limit_size'], 3);
        // Shorten size to 5 digits
        $limit_size = substr($limit_size, 0, 5);
        // Making sure that the user is inserting a numerical value
        if (!is_numeric($limit_size)) {
            die("Please enter a correct amount of users to show.");
        }
    }
    // Write the size to database
    misc_data_update('limit_size', $limit_size);
}
// Assign smarty tags for limit, so that they can be used in tpl files
if ($main_smarty) {
    $main_smarty->assign('limit_size', $limit_size);
}
Esempio n. 20
0
function disable_pligg_web_toolbar()
{
    misc_data_update('pligg_web_toolbar', "disabled");
    header('Location: ' . URL_pligg_web_toolbar);
}
Esempio n. 21
0
$module_info['db_sql'][] = "ALTER TABLE " . table_users . " ADD  `status_story` TINYINT(1) DEFAULT '1'";
$module_info['db_sql'][] = "ALTER TABLE " . table_users . " ADD  `status_comment` TINYINT(1) DEFAULT '1'";
$module_info['db_sql'][] = "ALTER TABLE " . table_users . " ADD  `status_email` TINYINT(1) DEFAULT '1'";
$module_info['db_sql'][] = "ALTER TABLE " . table_users . " ADD  `status_group` TINYINT(1) DEFAULT '1'";
$module_info['db_sql'][] = "ALTER TABLE " . table_users . " ADD  `status_all_friends` TINYINT(1) DEFAULT '1'";
$module_info['db_sql'][] = "ALTER TABLE " . table_users . " ADD  `status_friend_list` TEXT";
$module_info['db_sql'][] = "ALTER TABLE " . table_users . " ADD  `status_excludes` TEXT";
// Set default values
$module_info['db_sql'][] = "UPDATE " . table_users . " SET status_switch=1, status_friends=1, status_story=1, status_comment=1, status_email=1, status_all_friends=1";
// Add new table
$module_info['db_add_table'][] = array('name' => table_prefix . "updates", 'sql' => "CREATE TABLE `" . table_prefix . "updates` (\n\t  `update_id` int(11) NOT NULL auto_increment,\n\t  `update_time` int(11) default NULL,\n\t  `update_type` char(1) NOT NULL,\n\t  `update_link_id` int(11) NOT NULL,\n\t  `update_user_id` int(11) NOT NULL,\n\t  `update_group_id` int(11) NOT NULL,\n\t  `update_likes` int(11) NOT NULL,\n\t  `update_level` varchar(25),\n\t  `update_text` text NOT NULL,\n\t  PRIMARY KEY  (`update_id`),\n\t  FULLTEXT KEY `update_text` (`update_text`)\n\t) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci");
$module_info['db_add_table'][] = array('name' => table_prefix . "likes", 'sql' => "CREATE TABLE `" . table_prefix . "likes` (\n\t  `like_update_id` int(11) NOT NULL,\n\t  `like_user_id` int(11) NOT NULL,\n\t  PRIMARY KEY  (`like_update_id`, `like_user_id`)\n\t) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci");
// Set default module settings
if (get_misc_data('status_switch') == '') {
    misc_data_update('status_switch', '0');
    misc_data_update('status_show_permalin', '1');
    misc_data_update('status_permalinks', '1');
    misc_data_update('status_inputonother', '1');
    misc_data_update('status_place', 'tpl_pligg_profile_tab_insert');
    misc_data_update('status_clock', '12');
    misc_data_update('status_results', '10');
    misc_data_update('status_max_chars', '1200');
    misc_data_update('status_avatar', 'small');
    misc_data_update('status_profile_level', 'admin,moderator,normal');
    misc_data_update('status_level', 'admin,moderator,normal');
    misc_data_update('status_user_email', '1');
    misc_data_update('status_user_comment', '1');
    misc_data_update('status_user_story', '1');
    misc_data_update('status_user_friends', '1');
    misc_data_update('status_user_switch', '1');
}
Esempio n. 22
0
function phpbb_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']) {
            misc_data_update('phpbb_db', sanitize($_REQUEST['phpbb_db'], 3));
            misc_data_update('phpbb_user', sanitize($_REQUEST['phpbb_user'], 3));
            misc_data_update('phpbb_pass', sanitize($_REQUEST['phpbb_pass'], 3));
            misc_data_update('phpbb_host', sanitize($_REQUEST['phpbb_host'], 3));
            misc_data_update('phpbb_group', sanitize($_REQUEST['phpbb_group'], 3));
            misc_data_update('phpbb_cookie_name', sanitize($_REQUEST['cookie_name'], 3));
            misc_data_update('phpbb_cookie_path', sanitize($_REQUEST['cookie_path'], 3));
            misc_data_update('phpbb_cookie_domain', sanitize($_REQUEST['cookie_domain'], 3));
            misc_data_update('phpbb_cookie_secure', sanitize($_REQUEST['cookie_secure'], 3));
            header("Location: " . my_pligg_base . "/module.php?module=phpbb");
            die;
        }
        // breadcrumbs
        $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
        $navwhere['link1'] = getmyurl('admin', '');
        $navwhere['text2'] = "Modify Snippet";
        $navwhere['link2'] = my_pligg_base . "/module.php?module=phpbb";
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        // breadcrumbs
        define('modulename', 'phpbb');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'admin_modifyphpbb');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('settings', get_settings());
        $main_smarty->assign('tpl_center', phpbb_tpl_path . 'phpbb_main');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
Esempio n. 23
0
    if (isset($_REQUEST['latestuser'])) {
        $sw_newuser = sanitize($_REQUEST['latestuser'], 3);
    }
    misc_data_update('sw_newuser', $sw_newuser);
    if (isset($_REQUEST['phpver'])) {
        $phpver = sanitize($_REQUEST['phpver'], 3);
    }
    misc_data_update('phpver', $phpver);
    if (isset($_REQUEST['mysqlver'])) {
        $mysqlver = sanitize($_REQUEST['mysqlver'], 3);
    }
    misc_data_update('mysqlver', $mysqlver);
    if (isset($_REQUEST['dbsize'])) {
        $sw_dbsize = sanitize($_REQUEST['dbsize'], 3);
    }
    misc_data_update('sw_dbsize', $sw_dbsize);
}
// Database Size
include_once '../libs/dbconnect.php';
function CalcFullDatabaseSize($database, $db)
{
    $result = mysql_query("SHOW TABLES FROM {$database}");
    if (!$result) {
        return -1;
    }
    $table_count = mysql_num_rows($result);
    $size = 0;
    while ($row = mysql_fetch_row($result)) {
        $tname = $row[0];
        $r = mysql_query("SHOW TABLE STATUS FROM " . $database . " LIKE '" . $tname . "'");
        $data = mysql_fetch_array($r);
         $main_smarty->assign('navbar_where', $navwhere);
         $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
         // pagename
         define('pagename', 'admin_users');
         $main_smarty->assign('pagename', pagename);
         // show the template
         $main_smarty->assign('tpl_center', '/admin/user_listall_center');
         $main_smarty->display($template_dir . '/admin/admin.tpl');
     }
 } else {
     // No options are selected, so show the list of users.
     $CSRF->create('admin_users_list', true, true);
     global $offset, $top_users_size;
     // Items per page drop-down
     if (isset($_GET["pagesize"]) && is_numeric($_GET["pagesize"])) {
         misc_data_update('pagesize', $_GET["pagesize"]);
     }
     $pagesize = get_misc_data('pagesize');
     if ($pagesize <= 0) {
         $pagesize = 30;
     }
     $main_smarty->assign('pagesize', $pagesize);
     if ($_GET["filter"]) {
         $filter_sql = "WHERE user_level='" . sanitize($_GET["filter"], 3) . "'";
     } else {
         $filter_sql = "WHERE user_level!='Spammer'";
     }
     // figure out what "page" of the results we're on
     $offset = (get_current_page() - 1) * $pagesize;
     $users = mysql_query("SELECT SQL_CALC_FOUND_ROWS * FROM " . table_users . " {$filter_sql} ORDER BY `user_date` LIMIT {$offset},{$pagesize}");
     $rows = $db->get_var("SELECT FOUND_ROWS()");
Esempio n. 25
0
function akismet_showpage()
{
    global $main_smarty, $the_template, $current_user, $db;
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        $navwhere['text1'] = 'Akismet';
        $navwhere['link1'] = URL_akismet;
        define('pagename', 'akismet');
        $main_smarty->assign('pagename', pagename);
        define('modulename', 'akismet');
        $main_smarty->assign('modulename', modulename);
        if (isset($_REQUEST['view'])) {
            $view = sanitize($_REQUEST['view'], 3);
        } else {
            $view = '';
        }
        if ($view == '') {
            $wordpress_key = get_misc_data('wordpress_key');
            if ($wordpress_key == '') {
                header('Location: ' . URL_akismet . '&view=manageKey');
                die;
            }
            $main_smarty->assign('spam_links_count', akismet_get_link_count());
            $main_smarty->assign('spam_comments_count', akismet_get_comment_count());
            $main_smarty = do_sidebar($main_smarty, $navwhere);
            $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
            $main_smarty->assign('tpl_center', akismet_tpl_path . 'main');
            $main_smarty->display($template_dir . '/admin/admin.tpl');
        }
        if ($view == 'updateKey') {
            if ($_REQUEST['key']) {
                $wordpress_key = sanitize($_REQUEST['key'], 3);
                // Verify key before save
                if (phpnum() >= 5) {
                    include akismet_lib_path . 'Akismet.class_5.php';
                    $akismet = new Akismet(my_base_url . my_pligg_base, $wordpress_key);
                    if (!$akismet->isKeyValid()) {
                        $main_smarty->assign('error', 1);
                    } else {
                        misc_data_update('wordpress_key', $wordpress_key);
                    }
                } else {
                    include akismet_lib_path . 'Akismet.class_4.php';
                    $akismet = new Akismet(my_base_url . my_pligg_base, $wordpress_key);
                    if (!$akismet->_isValidApiKey($wordpress_key)) {
                        $main_smarty->assign('error', 1);
                    } else {
                        misc_data_update('wordpress_key', $wordpress_key);
                    }
                }
            } else {
                $wordpress_key = '';
                misc_data_update('wordpress_key', $wordpress_key);
            }
            $view = 'manageKey';
        }
        if ($view == 'manageKey') {
            $wordpress_key = get_misc_data('wordpress_key');
            $main_smarty->assign('wordpress_key', $wordpress_key);
            $main_smarty = do_sidebar($main_smarty, $navwhere);
            $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
            $main_smarty->assign('tpl_center', akismet_tpl_path . 'manageKey');
            $main_smarty->display($template_dir . '/admin/admin.tpl');
        }
        if ($view == 'manageSpam') {
            $sql = "SELECT " . table_links . ".*, " . table_users . ".user_login FROM " . table_links . " \r\n\t\t\t\t\tLEFT JOIN " . table_users . " ON link_author=user_id \r\n\t\t\t\t\tLEFT JOIN " . table_prefix . "spam_links ON linkid=link_id\r\n\t\t\t\t\tWHERE !ISNULL(linkid)";
            $link_data = $db->get_results($sql);
            if (sizeof($link_data)) {
                $main_smarty->assign('link_data', object_2_array($link_data));
            } else {
                header("Location: " . my_pligg_base . "/admin/admin_index.php");
                //				header('Location: ' . URL_akismet);
                die;
            }
            $main_smarty = do_sidebar($main_smarty, $navwhere);
            $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
            $main_smarty->assign('tpl_center', akismet_tpl_path . 'manageSpam');
            $main_smarty->display($template_dir . '/admin/admin.tpl');
        }
        if ($view == 'manageSettings') {
            $main_smarty = do_sidebar($main_smarty, $navwhere);
            $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
            $main_smarty->assign('tpl_center', akismet_tpl_path . 'manageSettings');
            $main_smarty->display($template_dir . '/admin/admin.tpl');
        }
        if ($view == 'manageSpamcomments') {
            $sql = "SELECT * FROM " . table_prefix . "spam_comments ";
            $link_data = $db->get_results($sql);
            if (sizeof($link_data)) {
                $user_cmt = new User();
                $user_cmt_link = new Link();
                $spam_output .= ' <form name="bulk_moderate" action="' . URL_akismet_isSpamcomment . '&action=bulkmod" method="post">';
                $spam_output .= '<table class="table table-bordered table-striped">';
                $spam_output .= "<thead>\r\n\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t<th>Author</th>\r\n\t\t\t\t\t\t\t\t\t\t<th>Content</th>\r\n\t\t\t\t\t\t\t\t\t\t<th style='width:65px;text-align:center;'><input type='checkbox' name='all1' onclick='mark_all_spam();' style='display:none;'><a onclick='mark_all_spam();' style='cursor:pointer;text-decoration:none;'>Spam</a></th>\r\n\t\t\t\t\t\t\t\t\t\t<th style='width:80px;text-align:center;'><input type='checkbox' name='all2' onclick='mark_all_notspam();' style='display:none;'><a onclick='mark_all_notspam();' style='cursor:pointer;text-decoration:none;'>Not Spam</a></th>\r\n\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t<tbody>";
                foreach ($link_data as $spam_cmts) {
                    $user_cmt->id = $spam_cmts->userid;
                    $user_cmt->read();
                    $user_name = $user_cmt->username;
                    $user_cmt_link->id = $spam_cmts->linkid;
                    $user_cmt_link->read();
                    $spam_output .= "<tr>";
                    $spam_output .= "\t<td>" . $user_name . "</td>";
                    $spam_output .= "\t<td><a href='story.php?id=" . ($user_cmt_link->id = $spam_cmts->linkid . "'>" . save_text_to_html($spam_cmts->cmt_content) . "</a></td>");
                    $spam_output .= '	<td style="text-align:center;"><input type="radio" name="spamcomment[' . $spam_cmts->auto_id . ']" id="spamcomment-' . $spam_cmts->auto_id . '" value="spamcomment"></td>';
                    $spam_output .= '	<td style="text-align:center;"><input type="radio" name="spamcomment[' . $spam_cmts->auto_id . ']" id="spamcomment-' . $spam_cmts->auto_id . '" value="notspamcomment"></td>';
                    $spam_output .= "</tr>";
                }
                $spam_output .= "</tbody></table>";
                $spam_output .= '<p align="right" style="margin-top:10px;"><input type="submit" name="submit" value="Apply Changes" class="btn btn-default" /></p>';
                $spam_output .= "</form>";
                $main_smarty->assign('spam_output', $spam_output);
                $main_smarty->assign('link_data', object_2_array($link_data));
            } else {
                header("Location: " . my_pligg_base . "/admin/admin_index.php");
                //				header('Location: ' . URL_akismet);
                die;
            }
            $main_smarty = do_sidebar($main_smarty, $navwhere);
            $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
            $main_smarty->assign('tpl_center', akismet_tpl_path . 'manageSpamcomments');
            $main_smarty->display($template_dir . '/admin/admin.tpl');
        }
        if (phpnum() >= 5) {
            include_once akismet_lib_path . 'Akismet.class_5.php';
        } else {
            include_once akismet_lib_path . 'Akismet.class_4.php';
        }
        if ($view == 'isSpam') {
            if ($_GET['action'] == "bulkmod") {
                if (isset($_POST['submit'])) {
                    $spam = array();
                    foreach ($_POST["spam"] as $k => $v) {
                        $spam[intval($k)] = $v;
                    }
                    foreach ($spam as $key => $value) {
                        if (isset($key)) {
                            $link_id = sanitize($key, 3);
                        } else {
                            continue;
                        }
                        $link = new Link();
                        $link->id = $link_id;
                        $link->read();
                        $user = new User();
                        $user->id = $link->author;
                        $user->read();
                        if (phpnum() < 5) {
                            $comment = array('author' => $user->username, 'email' => $user->email, 'website' => $link->url, 'body' => $link->content, 'permalink' => my_base_url . getmyurl('story', $link->id));
                            $akismet = new Akismet(my_base_url . my_pligg_base, get_misc_data('wordpress_key'), $comment);
                        } else {
                            $akismet = new Akismet(my_base_url . my_pligg_base, get_misc_data('wordpress_key'));
                            $akismet->setCommentAuthor($user->username);
                            $akismet->setCommentAuthorEmail($user->email);
                            $akismet->setCommentAuthorURL($link->url);
                            $akismet->setCommentContent($link->content);
                            $akismet->setPermalink(my_base_url . getmyurl('story', $link->id));
                        }
                        if ($value == "spam") {
                            $link->status = 'spam';
                            $link->store();
                            killspam($user->id);
                            $akismet->submitSpam();
                        } elseif ($value == "notspam") {
                            $link->status = 'new';
                            $link->store();
                            $akismet->submitHam();
                        }
                        $db->query("DELETE FROM " . table_prefix . "spam_links WHERE linkid={$link_id}");
                    }
                }
            }
            header('Location: ' . URL_akismet . '&view=manageSpam');
            die;
        }
        if ($view == 'isSpamcomment') {
            if ($_GET['action'] == "bulkmod") {
                if (isset($_POST['submit'])) {
                    $spamcomment = array();
                    foreach ($_POST["spamcomment"] as $k => $v) {
                        $spamcomment[intval($k)] = $v;
                    }
                    foreach ($spamcomment as $key => $value) {
                        if (isset($key)) {
                            $link_id = sanitize($key, 3);
                        } else {
                            continue;
                        }
                        $sql_result = "Select * from " . table_prefix . "spam_comments where auto_id=" . $link_id;
                        $result = $db->get_row($sql_result);
                        #print_r($result);
                        $link = new Link();
                        $link->id = $result->linkid;
                        $link->read();
                        $user = new User();
                        $user->id = $result->userid;
                        $user->read();
                        #print_r($user);
                        if (phpnum() < 5) {
                            $comment = array('author' => $user->username, 'email' => $user->email, 'website' => $link->url, 'body' => $result->cmt_content, 'permalink' => my_base_url . getmyurl('story', $link->id));
                            $akismet = new Akismet(my_base_url . my_pligg_base, get_misc_data('wordpress_key'), $comment);
                        } else {
                            $akismet = new Akismet(my_base_url . my_pligg_base, get_misc_data('wordpress_key'));
                            $akismet->setCommentAuthor($user->username);
                            $akismet->setCommentAuthorEmail($user->email);
                            $akismet->setCommentAuthorURL($link->url);
                            $akismet->setCommentContent($result->cmt_content);
                            $akismet->setPermalink(my_base_url . getmyurl('story', $link->id));
                        }
                        if ($value == "spamcomment") {
                            $akismet->submitSpam();
                        } elseif ($value == "notspamcomment") {
                            $akismet->submitHam();
                            $sql = "INSERT INTO " . table_comments . " (comment_parent, comment_user_id, comment_link_id , comment_date, comment_randkey, comment_content) VALUES ('{$result->cmt_parent}', '{$result->userid}', '{$result->linkid}', now(), '{$result->cmt_rand}', '{$result->cmt_content}')";
                            $db->query($sql);
                            #print $sql;
                        }
                        $link->adjust_comment(1);
                        $link->store();
                        $db->query(' Delete from ' . table_prefix . 'spam_comments where auto_id=' . $link_id);
                    }
                }
                header('Location: ' . URL_akismet . '&view=manageSpamcomments');
                die;
            }
        }
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
        die;
    }
}
Esempio n. 26
0
<?php

$widget['widget_title'] = "Pligg News";
$widget['widget_has_settings'] = 1;
$widget['widget_shrink_icon'] = 1;
$widget['widget_uninstall_icon'] = 0;
$widget['name'] = 'Pligg News';
$widget['desc'] = 'The Pligg News widget displays the latest news items from the <a href="http://www.pligg.com/blog/" target="_blank">Pligg CMS Blog</a>.';
$widget['version'] = 0.1;
$news_count = get_misc_data('news_count');
if ($news_count <= 0) {
    $news_count = '3';
}
if ($_REQUEST['widget'] == 'pligg_news') {
    if (isset($_REQUEST['stories'])) {
        $news_count = sanitize($_REQUEST['stories'], 3);
    }
    misc_data_update('news_count', $news_count);
}
if ($main_smarty) {
    $main_smarty->assign('news_count', $news_count);
}
Esempio n. 27
0
function akismet_showpage()
{
    global $main_smarty, $the_template, $current_user, $db;
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('god');
    if ($canIhaveAccess == 1) {
        if (phpnum() >= 5) {
            include_once akismet_lib_path . 'Akismet.class_5.php';
        } else {
            include_once akismet_lib_path . 'Akismet.class_4.php';
        }
        $navwhere['text1'] = 'Akismet';
        $navwhere['link1'] = URL_akismet;
        define('pagename', 'akismet');
        $main_smarty->assign('pagename', pagename);
        define('modulename', 'akismet');
        $main_smarty->assign('modulename', modulename);
        if (isset($_REQUEST['view'])) {
            $view = sanitize($_REQUEST['view'], 3);
        } else {
            $view = '';
        }
        if ($view == '') {
            $wordpress_key = get_misc_data('wordpress_key');
            if ($wordpress_key == '') {
                header('Location: ' . URL_akismet . '&view=manageKey');
            }
            $spam_links = get_misc_data('spam_links');
            if ($spam_links != '') {
                $spam_links = unserialize(get_misc_data('spam_links'));
            } else {
                $spam_links = array();
            }
            $main_smarty->assign('spam_links', $spam_links);
            $main_smarty->assign('spam_links_count', count($spam_links));
            $spam_comments = get_misc_data('spam_comments');
            if ($spam_comments != '') {
                $spam_comments = unserialize(get_misc_data('spam_comments'));
            } else {
                $spam_comments = array();
            }
            $main_smarty->assign('spam_comments', $spam_comments);
            $main_smarty->assign('spam_comments_count', count($spam_comments));
            $main_smarty = do_sidebar($main_smarty, $navwhere);
            $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
            $main_smarty->assign('tpl_center', akismet_tpl_path . 'main');
            $main_smarty->display($template_dir . '/admin/admin.tpl');
        }
        if ($view == 'manageKey') {
            $wordpress_key = get_misc_data('wordpress_key');
            $main_smarty->assign('wordpress_key', $wordpress_key);
            $main_smarty = do_sidebar($main_smarty, $navwhere);
            $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
            $main_smarty->assign('tpl_center', akismet_tpl_path . 'manageKey');
            $main_smarty->display($template_dir . '/admin/admin.tpl');
        }
        if ($view == 'updateKey') {
            if (isset($_REQUEST['key'])) {
                $wordpress_key = sanitize($_REQUEST['key'], 3);
            } else {
                $wordpress_key = '';
            }
            misc_data_update('wordpress_key', $wordpress_key);
            header('Location: ' . URL_akismet);
        }
        if ($view == 'manageSpam') {
            $spam_links = get_misc_data('spam_links');
            if ($spam_links != '') {
                $spam_links = unserialize(get_misc_data('spam_links'));
            } else {
                $spam_links = array();
            }
            if (count($spam_links) > 0) {
                $sql = "SELECT " . table_links . ".* FROM " . table_links . " WHERE ";
                $sql .= 'link_id IN (' . implode(',', $spam_links) . ')';
                $link_data = $db->get_results($sql);
                $main_smarty->assign('link_data', object_2_array($link_data));
            } else {
                header('Location: ' . URL_akismet);
            }
            $main_smarty = do_sidebar($main_smarty, $navwhere);
            $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
            $main_smarty->assign('tpl_center', akismet_tpl_path . 'manageSpam');
            $main_smarty->display($template_dir . '/admin/admin.tpl');
        }
        if ($view == 'manageSettings') {
            $main_smarty = do_sidebar($main_smarty, $navwhere);
            $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
            $main_smarty->assign('tpl_center', akismet_tpl_path . 'manageSettings');
            $main_smarty->display($template_dir . '/admin/admin.tpl');
        }
        /*
        if($view == 'isSpam'){
        	if(isset($_REQUEST['link_id'])){$link_id = sanitize($_REQUEST['link_id'], 3);}else{$link_id='';}
        
        	$spam_links = get_misc_data('spam_links');
        	$spam_links = unserialize(get_misc_data('spam_links'));
        
        	unset($spam_links[$link_id]);
        	misc_data_update('spam_links', serialize($spam_links));
        
        	$link = new Link;
        	$link->id = $link_id;
        	$link->read(FALSE);
        	$link->status = 'discard';
        	$link->store();
        
        	header('Location: ' . URL_akismet . '&view=manageSpam');
        }
        
        if($view == 'isNotSpam'){
        	if(isset($_REQUEST['link_id'])){$link_id = sanitize($_REQUEST['link_id'], 3);}else{$link_id='';}
        
        	$spam_links = get_misc_data('spam_links');
        	$spam_links = unserialize(get_misc_data('spam_links'));
        
        	unset($spam_links[$link_id]);
        	misc_data_update('spam_links', serialize($spam_links));
        
        	$link = new Link;
        	$link->id = $link_id;
        	$link->read(FALSE);
        	$link->status = 'queued';
        	$link->store();
        
        	header('Location: ' . URL_akismet . '&view=manageSpam');
        }
        
        if($view == 'addSpam'){
        
        	$spam_links[1] = 1;
        	misc_data_update('spam_links', serialize($spam_links));
        	header('Location: ' . URL_akismet . '&view=manageSpam');
        
        }
        */
        if ($view == 'manageSpamcomments') {
            $spam_comments = get_misc_data('spam_comments');
            if ($spam_comments != '') {
                $spam_comments = unserialize(get_misc_data('spam_comments'));
            } else {
                $spam_comments = array();
            }
            if (count($spam_comments) > 0) {
                $sql = "SELECT * FROM " . table_prefix . "spam_comments WHERE ";
                $sql .= 'linkid IN (' . implode(',', $spam_comments) . ')';
                $link_data = $db->get_results($sql);
                $user_cmt = new User();
                $user_cmt_link = new Link();
                $spam_output .= ' <form name="bulk_moderate" action="' . URL_akismet_isSpamcomment . '&action=bulkmod" method="post">';
                $spam_output .= "<table>";
                $spam_output .= "<tr><th>Author</th><th>Body</th><th>this is spam</th><th>this is NOT spam</th></tr>";
                if ($link_data) {
                    foreach ($link_data as $spam_cmts) {
                        $user_cmt->id = $spam_cmts->userid;
                        $user_cmt->read();
                        $user_name = $user_cmt->username;
                        $user_cmt_link->id = $spam_cmts->linkid;
                        $user_cmt_link->read();
                        $spam_output .= "<tr>";
                        $spam_output .= "<td>" . $user_name . "</td>";
                        $spam_output .= "<td>" . save_text_to_html($spam_cmts->cmt_content) . "</td>";
                        $spam_output .= '<td><center><input type="radio" name="spamcomment[' . $spam_cmts->auto_id . ']" id="spamcomment-' . $spam_cmts->auto_id . '" value="spamcomment"></center></td>';
                        $spam_output .= '<td><center><input type="radio" name="spamcomment[' . $spam_cmts->auto_id . ']" id="spamcomment-' . $spam_cmts->auto_id . '" value="notspamcomment"></center></td>';
                        $spam_output .= "</tr>";
                    }
                }
                $spam_output .= "</table>";
                $spam_output .= '<p align="right"><input type="submit" name="submit" value="Change Status" class="log2" /></p>';
                $spam_output .= "</form>";
                $main_smarty->assign('spam_output', $spam_output);
                $main_smarty->assign('link_data', object_2_array($link_data));
            } else {
                header('Location: ' . URL_akismet);
            }
            $main_smarty = do_sidebar($main_smarty, $navwhere);
            $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
            $main_smarty->assign('tpl_center', akismet_tpl_path . 'manageSpamcomments');
            $main_smarty->display($the_template . '/pligg.tpl');
        }
        if ($view == 'isSpam') {
            if ($_GET['action'] == "bulkmod") {
                if (isset($_POST['submit'])) {
                    $spam = array();
                    foreach ($_POST["spam"] as $k => $v) {
                        $spam[intval($k)] = $v;
                    }
                    foreach ($spam as $key => $value) {
                        if ($value == "spam") {
                            if (isset($key)) {
                                $link_id = sanitize($key, 3);
                            } else {
                                $link_id = '';
                            }
                            $spam_links = get_misc_data('spam_links');
                            $spam_links = unserialize(get_misc_data('spam_links'));
                            $key = array_search($link_id, $spam_links);
                            unset($spam_links[$key]);
                            misc_data_update('spam_links', serialize($spam_links));
                            $link = new Link();
                            $link->id = $link_id;
                            $link->read();
                            $link->status = 'discard';
                            $link->store();
                            $user = new User();
                            $user->id = $link->author;
                            $user->read();
                            $akismet = new Akismet(my_base_url . my_pligg_base, get_misc_data('wordpress_key'));
                            $akismet->setCommentAuthor($user->username);
                            $akismet->setCommentAuthorEmail($user->email);
                            $akismet->setCommentAuthorURL($link->url);
                            $akismet->setCommentContent($link->content);
                            $akismet->setPermalink(getmyurl('story', $link->id));
                            $akismet->submitSpam();
                        } elseif ($value == "notspam") {
                            if (isset($key)) {
                                $link_id = sanitize($key, 3);
                            } else {
                                $link_id = '';
                            }
                            $spam_links = get_misc_data('spam_links');
                            $spam_links = unserialize(get_misc_data('spam_links'));
                            $key = array_search($link_id, $spam_links);
                            unset($spam_links[$key]);
                            misc_data_update('spam_links', serialize($spam_links));
                            $link = new Link();
                            $link->id = $link_id;
                            $link->read(FALSE);
                            $link->status = 'queued';
                            $link->store();
                            $user = new User();
                            $user->id = $link->author;
                            $user->read();
                            $akismet = new Akismet(my_base_url . my_pligg_base, get_misc_data('wordpress_key'));
                            $akismet->setCommentAuthor($user->username);
                            $akismet->setCommentAuthorEmail($user->email);
                            $akismet->setCommentAuthorURL($link->url);
                            $akismet->setCommentContent($link->content);
                            $akismet->setPermalink(getmyurl('story', $link->id));
                            $akismet->submitHam();
                        }
                    }
                }
            }
            header('Location: ' . URL_akismet . '&view=manageSpam');
        }
        if ($view == 'isSpamcomment') {
            if ($_GET['action'] == "bulkmod") {
                if (isset($_POST['submit'])) {
                    $spamcomment = array();
                    foreach ($_POST["spamcomment"] as $k => $v) {
                        $spamcomment[intval($k)] = $v;
                    }
                    foreach ($spamcomment as $key => $value) {
                        if ($value == "spamcomment") {
                            if (isset($key)) {
                                $link_id = sanitize($key, 3);
                            } else {
                                $link_id = '';
                            }
                            global $db;
                            $spam_comments = get_misc_data('spam_comments');
                            $spam_comments = unserialize(get_misc_data('spam_comments'));
                            $key = array_search($link_id, $spam_comments);
                            unset($spam_comments[$key]);
                            $sql_result = "Select * from " . table_prefix . "spam_comments where auto_id=" . $link_id;
                            $result_arr = $db->get_results($sql_result);
                            if ($result_arr) {
                                foreach ($result_arr as $result_arr_comments) {
                                    $link = new Link();
                                    $link->id = $result_arr_comments->linkid;
                                    $link->read();
                                    $user = new User();
                                    $user->id = $result_arr_comments->userid;
                                    $user->read();
                                    $akismet = new Akismet(my_base_url . my_pligg_base, get_misc_data('wordpress_key'));
                                    $akismet->setCommentAuthor($user->username);
                                    $akismet->setCommentAuthorEmail($user->email);
                                    $akismet->setCommentAuthorURL($link->url);
                                    $akismet->setCommentContent($result_arr_comments->cmt_content);
                                    $akismet->setPermalink(getmyurl('story', $link->id));
                                    $akismet->submitSpam();
                                }
                            }
                            misc_data_update('spam_comments', serialize($spam_comments));
                            $db->query(' Delete from ' . table_prefix . 'spam_comments where auto_id=' . $link_id);
                        } elseif ($value == "notspamcomment") {
                            if (isset($key)) {
                                $link_id = sanitize($key, 3);
                            } else {
                                $link_id = '';
                            }
                            global $db;
                            $spam_comments = get_misc_data('spam_comments');
                            $spam_comments = unserialize(get_misc_data('spam_comments'));
                            $key = array_search($link_id, $spam_comments);
                            unset($spam_comments[$key]);
                            $sql_result = " Select * from " . table_prefix . "spam_comments where auto_id={$link_id}";
                            $result_arr = $db->get_results($sql_result);
                            if ($result_arr) {
                                foreach ($result_arr as $result_arr_comments) {
                                    $link = new Link();
                                    $link->id = $result_arr_comments->linkid;
                                    $link->read();
                                    $user = new User();
                                    $user->id = $result_arr_comments->userid;
                                    $user->read();
                                    $akismet = new Akismet(my_base_url . my_pligg_base, get_misc_data('wordpress_key'));
                                    $akismet->setCommentAuthor($user->username);
                                    $akismet->setCommentAuthorEmail($user->email);
                                    $akismet->setCommentAuthorURL($link->url);
                                    $akismet->setCommentContent($result_arr_comments->cmt_content);
                                    $akismet->setPermalink(getmyurl('story', $link->id));
                                    $akismet->submitHam();
                                    $sql = "INSERT INTO " . table_comments . " (comment_parent, comment_user_id, comment_link_id , comment_date, comment_randkey, comment_content) VALUES ({$result_arr_comments->cmt_parent}, {$result_arr_comments->userid}, {$result_arr_comments->linkid}, now(), '{$result_arr_comments->cmt_rand}', '{$result_arr_comments->cmt_content}')";
                                    $db->query($sql);
                                }
                            }
                            misc_data_update('spam_comments', serialize($spam_comments));
                            $sql_delete = ' Delete from ' . table_prefix . 'spam_comments where auto_id=' . $link_id;
                            $db->query($sql_delete);
                            $link->adjust_comment(1);
                            $link->store();
                        }
                    }
                }
                header('Location: ' . URL_akismet . '&view=manageSpamcomments');
            }
        }
    }
}
Esempio n. 28
0
    misc_data_update('spam_trigger_light', 'arsehole
ass-pirate
ass pirate
assbandit
assbanger
assfucker
asshat
asshole
asspirate
assshole
asswipe
bastard
beaner
beastiality
bitch
blow job
b*****b
butt plug
butt-pirate
butt pirate
buttpirate
carpet muncher
carpetmuncher
c**t
c**k smoker
cocksmoker
c**k sucker
c********r
cum dumpster
cumdumpster
cum s**t
cumslut
cunnilingus
c**t
dick head
dickhead
dickwad
dickweed
dickwod
dike
d***o
douche bag
douche-bag
douchebag
dyke
ejaculat
erection
faggit
f****t
fagtard
farm sex
f**k
fudge packer
fudge-packer
f*********r
gayass
gay wad
gaywad
god damn
god-damn
goddamn
handjob
jerk off
j**z
jungle bunny
jungle-bunny
junglebunny
kike
kunt
n***a
nigger
o****m
penis
porch monkey
porch-monkey
porchmonkey
prostitute
queef
rimjob
sexual
shit
spick
splooge
testicle
titty
twat
v****a
wank
xxx
abilify
adderall
adipex
advair diskus
ambien
aranesp
botox
celebrex
cialis
crestor
cyclen
cyclobenzaprine
cymbalta
dieting
effexor
epogen
fioricet
hydrocodone
ionamin
lamictal
levaquin
levitra
lexapro
lipitor
meridia
nexium
oxycontin
paxil
phendimetrazine
phentamine
phentermine
pheramones
pherimones
plavix
prevacid
procrit
protonix
risperdal
seroquel
singulair
topamax
tramadol
trim-spa
ultram
valium
valtrex
viagra
vicodin
vioxx
vytorin
xanax
zetia
zocor
zoloft
zyprexa
zyrtec
18+
acai berry
acai pill
adults only
adult web
apply online
auto loan
best rates
bulk email
buy direct
buy drugs
buy now
buy online
casino
cell phone
child p**n
credit card
dating site
day-trading
debt free
degree program
descramble
diet pill
digital cble
direct tv
doctor approved
doctor prescribed
download full
dvd and bluray
dvd bluray
dvd storage
earn a college degree
earn a degree
earn extra money
easy money
ebay secret
ebay shop
erotic
escorts
explicit
find online
fire your boss
free cable
free cell phone
free dating
free degree
free diploma
free dvd
free games
free gift
free money
free offer
free phone
free reading
gambling
get rich quick
gingivitis
health products
heartburn
hormone
horny
incest
insurance
investment
investor
loan quote
loose weight
low interest
make money
medical exam
medications
money at home
mortgage
m0rtgage
movies online
must be 18
no purchase
nudist
online free
online marketing
online movies
online order
online poker
order now
order online
over 18
over 21
pain relief
pharmacy
prescription
production management
refinance
removes wrinkles
rolex
satellite tv
savings on
search engine
sexcapades
stop snoring
stop spam
vacation offers
video recorder
virgin
weight reduction
work at home');