Esempio n. 1
0
    $blogentry_id = $_POST['blogentry_id'];
} elseif (isset($_GET['blogentry_id'])) {
    $blogentry_id = $_GET['blogentry_id'];
} else {
    $blogentry_id = 0;
}
if (isset($_POST['delete_blogentries'])) {
    $delete_blogentries = $_POST['delete_blogentries'];
} elseif (isset($_GET['delete_blogentries'])) {
    $delete_blogentries = $_GET['delete_blogentries'];
} else {
    $delete_blogentries = NULL;
}
// CREATE BLOG OBJECT
$entries_per_page = 100;
$blog = new se_blog();
// DELETE ENTRIES
if ($task == "deleteentries" && !empty($delete_blogentries)) {
    $blog->blog_entry_delete($delete_blogentries);
    header('Location: admin_viewblogs.php');
    exit;
}
// SET BLOG ENTRY SORT-BY VARIABLES FOR HEADING LINKS
$i = "id";
// BLOGENTRY_ID
$t = "t";
// BLOGENTRY_TITLE
$o = "o";
// OWNER OF ENTRY
$v = "v";
// VIEWS OF ENTRY
Esempio n. 2
0
<?php

$page = "user_blog_entry";
include "header.php";
$task = !empty($_POST['task']) ? $_POST['task'] : (!empty($_GET['task']) ? $_GET['task'] : NULL);
$blogentry_id = !empty($_POST['blogentry_id']) ? $_POST['blogentry_id'] : (!empty($_GET['blogentry_id']) ? $_GET['blogentry_id'] : NULL);
// ENSURE BLOGS ARE ENABLED FOR THIS USER
if (!$user->level_info['level_blog_create']) {
    header("Location: user_home.php");
    exit;
}
// START BLOG METHOD
$blog = new se_blog($user->user_info['user_id']);
// MAKE SURE THIS BLOG ENTRY BELONGS TO THIS USER AND IS NUMERIC
if ($blogentry_id) {
    $blogentry_info = $blog->blog_entry_info($blogentry_id);
    if (!$blogentry_info) {
        header("Location: user_blog.php");
        exit;
    }
    // GET TOTAL COMMENTS POSTED ON THIS ENTRY
    $comments_total = $database->database_num_rows($database->database_query("SELECT blogcomment_id FROM se_blogcomments WHERE blogcomment_blogentry_id='{$blogentry_info[blogentry_id]}'"));
}
// DO SAVE
if ($task == "dosave") {
    $blogentry_title = $_POST['blogentry_title'];
    $blogentry_body = $_POST['blogentry_body'];
    $blogentry_blogentrycat_id = $_POST['blogentry_blogentrycat_id'];
    $blogentry_search = $_POST['blogentry_search'];
    $blogentry_privacy = $_POST['blogentry_privacy'];
    $blogentry_comments = $_POST['blogentry_comments'];
Esempio n. 3
0
<?php

$page = "user_blog";
include "header.php";
$task = !empty($_POST['task']) ? $_POST['task'] : (!empty($_GET['task']) ? $_GET['task'] : NULL);
$search = !empty($_POST['search']) ? $_POST['search'] : (!empty($_GET['search']) ? $_GET['search'] : NULL);
$p = !empty($_POST['p']) ? $_POST['p'] : (!empty($_GET['p']) ? $_GET['p'] : 1);
$s = !empty($_POST['s']) ? $_POST['s'] : (!empty($_GET['s']) ? $_GET['s'] : NULL);
// CREATE BLOG OBJECT
$entries_per_page = 10;
$blog = new se_blog($user->user_info['user_id']);
// DELETE NECESSARY ENTRIES
if ($task == "delete" && !empty($_POST['delete_blogentries']) && is_array($_POST['delete_blogentries'])) {
    $blog->blog_entry_delete($_POST['delete_blogentries']);
}
// SET ENTRY SORT-BY VARIABLES FOR HEADING LINKS
$s = "blogentry_date DESC";
$where = NULL;
if (trim($search)) {
    $where = "(blogentry_title LIKE '%{$search}%' OR blogentry_body LIKE '%{$search}%')";
}
// GET ENTRIES
$total_blogentries = $blog->blog_entries_total($where);
$page_vars = make_page($total_blogentries, $entries_per_page, $p);
$blogentries = $blog->blog_entries_list($page_vars[0], $entries_per_page, $s, $where);
// ASSIGN VARIABLES AND SHOW VIEW ENTRIES PAGE
$smarty->assign('total_blogentries', $total_blogentries);
$smarty->assign_by_ref('blogentries', $blogentries);
$smarty->assign('s', $s);
$smarty->assign('search', $search);
$smarty->assign('p', $page_vars[1]);
Esempio n. 4
0
            $resource = $database->database_query($sql) or die($database->database_error() . " <b>SQL was: </b>{$sql}");
            if (!$database->database_num_rows($resource)) {
                echo '{"result" : "failure"}';
                exit;
            }
            $result = $database->database_fetch_assoc($resource);
            $lvar_id = $result['blogentrycat_languagevar_id'];
            SE_Language::edit($lvar_id, $blogentrycat_title);
            $sql = "UPDATE se_blogentrycats SET blogentrycat_title='{$blogentrycat_title}' WHERE blogentrycat_id='{$blogentrycat_id}' LIMIT 1";
            $resource = $database->database_query($sql) or die($database->database_error() . " <b>SQL was: </b>{$sql}");
            if ($database->database_affected_rows($resource) || $resource) {
                echo '{"result" : "success"}';
            } else {
                echo '{"result" : "failure"}';
            }
            exit;
        } elseif ($task == "dosave") {
            $setting_permission_blog = $_POST['setting_permission_blog'];
            $sql = "UPDATE se_settings SET setting_permission_blog='{$setting_permission_blog}'";
            $database->database_query($sql) or die($database->database_error() . " <b>SQL was: </b>{$sql}");
            $setting = $database->database_fetch_assoc($database->database_query("SELECT * FROM se_settings LIMIT 1"));
            $result = 1;
        }
    }
}
// GET BLOG ENTRY CATEGORIES
$categories_array = se_blog::blog_category_list($blogentrycat_showusercreated);
// ASSIGN VARIABLES AND SHOW GENERAL SETTINGS PAGE
$smarty->assign('result', $result);
$smarty->assign('blogentrycats', $categories_array);
include "admin_footer.php";
Esempio n. 5
0
    // SET WHERE CLAUSE
    $where .= " AND (SELECT TRUE FROM se_friends WHERE friend_user_id1='{$user->user_info['user_id']}' AND friend_user_id2=se_blogentries.blogentry_user_id AND friend_status=1)";
}
// CATEGORIES
if (isset($c) && $c != -1) {
    if ($c == 0 || !is_numeric($c)) {
        $c = '0';
    }
    $where .= " AND blogentry_blogentrycat_id='{$c}'";
}
// SEARCH
if (!empty($blog_search)) {
    $where .= " && MATCH (`blogentry_title`, `blogentry_body`) AGAINST ('{$blog_search}' IN BOOLEAN MODE)";
}
// CREATE blog OBJECT
$blog = new se_blog();
// GET TOTAL blogs
$total_blogentries = $blog->blog_entries_total($where);
// MAKE ENTRY PAGES
$blogentries_per_page = 10;
$page_vars = make_page($total_blogentries, $blogentries_per_page, $p);
// GET blog ARRAY
$blogentry_array = $blog->blog_entries_list($page_vars[0], $blogentries_per_page, $s, $where);
// GET BLOG ENTRY CATEGORIES
$blogentrycats_query = $database->database_query("SELECT * FROM se_blogentrycats WHERE blogentrycat_user_id=0 ORDER BY blogentrycat_id ASC");
$blogentrycats_array = array();
while ($blogentrycat = $database->database_fetch_assoc($blogentrycats_query)) {
    $blogentrycats_array[] = array('blogentrycat_id' => $blogentrycat['blogentrycat_id'], 'blogentrycat_title' => $blogentrycat['blogentrycat_title']);
}
// ASSIGN SMARTY VARIABLES AND DISPLAY blogs PAGE
$smarty->assign('total_blogentries', $total_blogentries);
Esempio n. 6
0
include "./include/class_blog.php";
include "./include/class_blog_trackback.php";
include "./include/functions_blog.php";
// PRELOAD LANGUAGE
SE_Language::_preload(1500007);
// SET MENU VARS
if (!$user->user_exists && $setting['setting_permission_blog'] || $user->user_exists && $user->level_info['level_blog_view']) {
    $plugin_vars['menu_main'] = array('file' => 'browse_blogs.php', 'title' => 1500007);
}
if ($user->user_exists && $user->level_info['level_blog_view']) {
    $plugin_vars['menu_user'] = array('file' => 'user_blog.php', 'icon' => 'blog_blog16.gif', 'title' => 1500007);
}
// SET PROFILE MENU VARS
if ($owner->level_info['level_blog_create'] && $page == "profile") {
    // START BLOG
    $blog = new se_blog($owner->user_info['user_id']);
    $entries_per_page = 5;
    $sort = "blogentry_date DESC";
    // GET PRIVACY LEVEL AND SET WHERE
    $blog_privacy_max = $owner->user_privacy_max($user);
    $where = "(blogentry_privacy & {$blog_privacy_max})";
    // GET TOTAL ENTRIES
    $total_blogentries = $blog->blog_entries_total($where);
    // GET ENTRY ARRAY
    $blogentries = $blog->blog_entries_list(0, $entries_per_page, $sort, $where);
    // ASSIGN ENTRIES SMARY VARIABLE
    $smarty->assign_by_ref('blogentries', $blogentries);
    $smarty->assign('total_blogentries', $total_blogentries);
    // SET PROFILE MENU VARS
    if ($total_blogentries) {
        $plugin_vars['menu_profile_tab'] = array('file' => 'profile_blog.tpl', 'title' => 1500007, 'name' => 'blog');
} elseif (isset($_GET['s'])) {
    $s = $_GET['s'];
} else {
    $s = "dd";
}
$sort = NULL;
//"se_blogentries.blogentry_date DESC";
$where = NULL;
// ENSURE BLOGS ARE ENABLED FOR THIS USER
if (!$user->level_info['level_blog_view']) {
    header("Location: user_home.php");
    exit;
}
// CREATE BLOG OBJECT
$subscriptions_per_page = 10;
$blog_object = new se_blog($user->user_info['user_id']);
// GET TOTAL ENTRIES
$blog_subscriptions_total = $blog_object->blog_subscription_total($where);
// MAKE ENTRY PAGES
$page_vars = make_page($blog_subscriptions_total, $subscriptions_per_page, $p);
// GET ENTRY ARRAY
$blog_subscriptions_list = $blog_object->blog_subscription_list($page_vars[0], $subscriptions_per_page, $sort, $where, TRUE);
//echo mysql_get_server_info();
//print_r($blog_subscriptions_list);
// ASSIGN VARIABLES AND SHOW PAGE
$smarty->assign('blog_subscriptions_total', $blog_subscriptions_total);
$smarty->assign_by_ref('blog_subscriptions_list', $blog_subscriptions_list);
$smarty->assign('s', $s);
$smarty->assign('p', $page_vars[1]);
$smarty->assign('maxpage', $page_vars[2]);
$smarty->assign('p_start', $page_vars[0] + 1);
Esempio n. 8
0
<?php

$page = "blog_ajax";
include "header.php";
// PROCESS INPUT
$task = !empty($_POST['task']) ? $_POST['task'] : (!empty($_GET['task']) ? $_GET['task'] : NULL);
$blogentry_id = !empty($_POST['blogentry_id']) ? $_POST['blogentry_id'] : (!empty($_GET['blogentry_id']) ? $_GET['blogentry_id'] : NULL);
// TRACKBACK COMPATIBILITY
if (empty($_POST['e_id']) && !empty($blogentry_id)) {
    $_POST['e_id'] = $blogentry_id;
}
// CREATE BLOG OBJECT
$blog = new se_blog($user->user_exists ? $user->user_info['user_id'] : NULL);
// TRACKBACKS
if ($task == "trackback") {
    // Redirect if no data
    if (!empty($blogentry_id) && empty($_POST['url']) && empty($_GET['url'])) {
        $blogentry_info = $blog->blog_entry_info($blogentry_id);
        header('Location: ' . $url->url_create('blog_entry', $blogentry_info['user_username'], $blogentry_id));
        exit;
    }
    echo $blog->blog_trackback_receive();
    exit;
}
/* ***** ACTIONS BELOW THIS LINE REQUIRE THE USER TO BE LOGGED IN ***** */
if (!$user->user_exists) {
    echo json_encode(array('result' => FALSE));
    exit;
}
// DELETE
if ($task == "deleteblog") {
Esempio n. 9
0
    include "footer.php";
}
// ENSURE BLOGS ARE ENABLED FOR THIS USER
if (!$owner->level_info['level_blog_create']) {
    header("Location: " . $url->url_create('profile', $owner->user_info['user_username']));
    exit;
}
// PROCESS INPUT
$p = !empty($_POST['p']) ? $_POST['p'] : (!empty($_GET['p']) ? $_GET['p'] : NULL);
$blogentry_id = !empty($_POST['blogentry_id']) ? $_POST['blogentry_id'] : (!empty($_GET['blogentry_id']) ? $_GET['blogentry_id'] : NULL);
$category_id = !empty($_POST['category_id']) ? $_POST['category_id'] : (!empty($_GET['category_id']) ? $_GET['category_id'] : NULL);
$date_start = !empty($_POST['date_start']) ? $_POST['date_start'] : (!empty($_GET['date_start']) ? $_GET['date_start'] : NULL);
$date_end = !empty($_POST['date_end']) ? $_POST['date_end'] : (!empty($_GET['date_end']) ? $_GET['date_end'] : NULL);
$blog_search = !empty($_POST['blog_search']) ? $_POST['blog_search'] : (!empty($_GET['blog_search']) ? $_GET['blog_search'] : NULL);
// CREATE BLOG OBJECT
$blog = new se_blog($owner->user_info['user_id']);
// GENERATE WHERE CLAUSE
$privacy_max = $owner->user_privacy_max($user);
$where = "(blogentry_privacy & '{$privacy_max}')";
if (!empty($blogentry_id) && is_numeric($blogentry_id)) {
    // SPECIFIC ENTRY SPECIFIED
    $where .= " && blogentry_id='{$blogentry_id}'";
} else {
    // SEARCH PARAMETERS
    if (!empty($date_start) && !empty($date_end) && is_numeric($date_start) && is_numeric($date_end)) {
        $where .= " && blogentry_date>'{$date_start}' && blogentry_date<'{$date_end}'";
    }
    if (!empty($category_id) && is_numeric($category_id)) {
        $where .= " && blogentry_blogentrycat_id='{$category_id}'";
    }
    if (!empty($blog_search)) {