コード例 #1
0
ファイル: edit_blog.php プロジェクト: nickfun/newlifeblogger
 /**
  *		Check submited data
  */
 $text->validate();
 $text->makeClean('trim', 'slash_if_needed');
 $c = $text->clean;
 if ($text->is_missing_required) {
     $baddata = true;
 } else {
     // deal with options.
     $c['bb'] = empty($c['bb']) ? 1 : 0;
     $c['html'] = empty($c['html']) ? 1 : 0;
     $c['smiles'] = empty($c['smiles']) ? 1 : 0;
     badHtmlSecond($c['body']);
     // make the updates
     $update = new nlb_blog($db);
     $update->fetchFromDB($_GET['id']);
     foreach (array('subject', 'custom', 'body', 'bb', 'html', 'smiles', 'access') as $item) {
         $update->setItem($item, $c[$item]);
     }
     // deal with comments.
     if (empty($c['comments'])) {
         // comments are allowed
         $update->recountComments();
     } else {
         // no comments
         $update->setItem('comments', -1);
     }
     // deal with blog count
     $user->recountBlogs();
     // set it in stone
コード例 #2
0
ファイル: register.php プロジェクト: nickfun/newlifeblogger
	-----------------------------------------
*/
require_once 'config.php';
require_once 'system/functions.php';
require_once 'system/ets_file.php';
require_once 'system/sqldb2.class.php';
require_once 'system/nlb_user.class.php';
require_once 'system/nlb_config.class.php';
require_once 'system/nlb_blog.class.php';
require_once 'system/nlb_mail.class.php';
require_once 'system/text.class.php';
require_once 'ets.php';
$db = new sqldb2($DB_CONFIG);
$user = new nlb_user($db);
$config = new nlb_config($db);
$blog = new nlb_blog($db);
$user->checkLogin();
// check for loged in user.
if ($user->isLogedIn) {
    jsRedirect("index.php");
}
include $config->langfile();
$start = mymicrotime();
$text = new Text($_POST, array('username', 'password', 'confirm-password', 'email', 'template', 'timezone'), array('custom'));
$text->validate();
$clean = $text->clean;
$baddata = false;
$problems = array();
if (!empty($_POST)) {
    if ($text->is_missing_required) {
        $baddata = true;
コード例 #3
0
ファイル: index.php プロジェクト: nickfun/newlifeblogger
// Sweet template library
$start = mymicrotime();
$db = new sqldb2($DB_CONFIG);
$config = new nlb_config($db);
$user = new nlb_user($db);
// is someone trying to access a persons blog
$_SERVER['QUERY_STRING'] = urldecode($_SERVER['QUERY_STRING']);
if (!empty($_SERVER['QUERY_STRING']) && ($id = $user->getIdByName($_SERVER['QUERY_STRING'])) > -1) {
    // 	die($id);
    //jsRedirect( script_path . 'blog.php/user/' . $id );
    jsRedirect(build_link('blog.php', array('user' => $id)));
}
$user->checklogin();
require_once $config->langfile();
// include lang file
$b = new nlb_blog($db);
if ($user->isLogedIn) {
    // timezone settings
    $b->setDateOffset($config->get('server_timezone'), $user->get('timezone'));
}
$script_path = script_path;
$_PATH = fetch_url_data();
$action = 'news';
if (isset($_PATH['action'])) {
    $action = $_PATH['action'];
}
$ets = new stdClass();
switch ($action) {
    // Display Recent News news
    default:
    case 'news':
コード例 #4
0
ファイル: login.php プロジェクト: nickfun/newlifeblogger
*/
require_once 'config.php';
require_once 'system/functions.php';
require_once 'system/ets_file.php';
require_once 'ets.php';
require_once 'system/text.class.php';
require_once 'system/sqldb2.class.php';
require_once 'system/nlb_user.class.php';
require_once 'system/nlb_blog.class.php';
require_once 'system/nlb_mail.class.php';
require_once 'system/nlb_config.class.php';
$start = mymicrotime();
$db = new sqldb2($DB_CONFIG);
$config = new nlb_config($db);
$user = new nlb_user($db);
$b = new nlb_blog($db);
include $config->langfile();
if ($user->isLogedIn) {
    $b->setDateOffset($config->get('server_timezone'), $user->get('timezone'));
}
$action = 'login';
if (isset($_GET['action'])) {
    $action = $_GET['action'];
}
switch ($action) {
    // build login form.
    default:
    case 'login':
        $ets_outter->main_title = $config->get('site_name') . ": " . $l['title-login'];
        $ets_outter->page_title = $l['title-login'];
        $logedin = $user->checklogin();
コード例 #5
0
ファイル: edit_blog.php プロジェクト: nickfun/newlifeblogger
 } else {
     // delete the blog?
     if ($c['delete'] == 'x') {
         $db->query('DELETE FROM ' . db_blogs . ' WHERE blog_id=' . $blog_id . ' LIMIT 1;');
         $author->recountBlogs();
         $author->updatedb();
         $ets->page_body = $l['item-deleted'];
     } else {
         // deal with options.
         $c['bb'] = empty($c['bb']) ? 1 : 0;
         $c['html'] = empty($c['html']) ? 1 : 0;
         $c['smiles'] = empty($c['smiles']) ? 1 : 0;
         // anti bad html
         badHtmlSecond($c['body']);
         // make the updates
         $update = new nlb_blog($db);
         $update->fetchFromDB($blog_id);
         foreach (array('subject', 'custom', 'body', 'mood', 'bb', 'html', 'smiles') as $item) {
             $update->setItem($item, $c[$item]);
         }
         // deal with comments.
         if (empty($c['comments'])) {
             // comments are allowed
             $update->recountComments();
         } else {
             // no comments
             $update->setItem('comments', -1);
         }
         // deal with blog count
         $author->recountBlogs();
         // set it in stone
コード例 #6
0
ファイル: friends.php プロジェクト: nickfun/newlifeblogger
	should be packaged with this product.
	-----------------------------------------
*/
require_once 'config.php';
// require_once this before others!
require_once 'system/functions.php';
require_once 'system/ets_sql.php';
require_once 'system/sqldb2.class.php';
require_once 'system/nlb_blog.class.php';
require_once 'system/nlb_user.class.php';
require_once 'system/nlb_config.class.php';
require_once 'system/text.class.php';
require_once 'ets.php';
$path = fetch_url_data();
$db = new sqldb2($DB_CONFIG);
$blog = new nlb_blog($db);
$config = new nlb_config($db);
require_once $config->langfile();
$user = new nlb_user($db);
$user->checkLogin();
if (isset($path['user'])) {
    /**
     *		Show page of blogs for user
     */
    $USERID = $path['user'];
    if (!is_numeric($USERID)) {
        jsRedirect(script_path . 'index.php');
    }
    $u = new nlb_user($db, $USERID);
    // $u is the user who's friends page we are viewing
    $page = 0;
コード例 #7
0
ファイル: edit_news.php プロジェクト: nickfun/newlifeblogger
     */
    $text->validate();
    $text->makeClean('trim', 'slash_if_needed');
    $c = $text->clean;
    if ($text->is_missing_required) {
        $baddata = true;
    } else {
        /**
         * 		U P D A T E   I T E M
         */
        // deal with options.
        $bb = empty($c['bb']) ? 1 : 0;
        $html = empty($c['html']) ? 1 : 0;
        $smiles = empty($c['smiles']) ? 1 : 0;
        badHtmlSecond($c['subject']);
        $update = new nlb_blog($db);
        $update->fetchFromDB($_GET['id']);
        $update->setItem("subject", $c['subject']);
        $update->setItem("body", $c['body']);
        $update->setItem("bb", $bb);
        $update->setItem("html", $html);
        $update->setItem("smiles", $smiles);
        if (empty($c['comments'])) {
            $update->recountComments();
        } else {
            $update->setItem("comments", -1);
        }
        $update->updateToDB();
        $ets->page_body = $l['goodedit'];
    }
}
コード例 #8
0
$USESKIN = skin_basic;
$ets_outter->main_title = $config->get('site_name') . ": " . $l['title-editcomment'];
$ets_outter->page_title = $l['title-editcomment'];
$text = new text($_POST, array('body'), array('delete'));
$missing = false;
if (!empty($_POST)) {
    $text->validate();
    if ($text->is_missing_required) {
        $missing = true;
    } else {
        $text->makeClean('trim', 'slash_if_needed');
        $clean = $text->clean;
        if ($clean['delete'] == 'x') {
            // remove comment
            $db->query('DELETE FROM ' . db_comments . ' WHERE comment_id="' . $comment_id . '" LIMIT 1;');
            $updatecount = new nlb_blog($db);
            $updatecount->fetchFromDB($comment['parent_id']);
            $updatecount->recountComments();
            $updatecount->updateToDB();
            $ets->page_body .= $l['acp-com-deleted'];
        } else {
            // just update the comment
            badHtmlSecond($clean['body']);
            $db->query('UPDATE ' . db_comments . ' SET body="' . $clean['body'] . '" WHERE comment_id="' . $comment_id . '" LIMIT 1;');
            $ets->page_body .= $l['goodedit'];
        }
    }
}
if (empty($_POST) || $missing) {
    if ($missing) {
        $ets->page_body = '<div class="error">' . $l['data-problems'] . "\n";
コード例 #9
0
ファイル: blog.php プロジェクト: nickfun/newlifeblogger
	GPL liscense. A copy of that liscense 
	should be packaged with this product.
	-----------------------------------------
*/
require_once 'config.php';
require_once 'system/functions.php';
require_once 'system/ets_sql.php';
require_once 'system/sqldb2.class.php';
require_once 'system/nlb_blog.class.php';
require_once 'system/nlb_user.class.php';
require_once 'system/nlb_config.class.php';
require_once 'system/text.class.php';
require_once 'ets.php';
$path = fetch_url_data();
$db = new sqldb2($DB_CONFIG);
$blog = new nlb_blog($db);
$config = new nlb_config($db);
require_once $config->langfile();
$user = new nlb_user($db);
$user->checkLogin();
if (isset($path['id'])) {
    /**
     * =======================================
     *		Show single blog & Comments
     * =======================================
     */
    $blog_id = $path['id'];
    if (!is_numeric($blog_id)) {
        jsRedirect(script_path . 'index.php');
    }
    // blog exists?