Exemple #1
0
$_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':
        /**
         * =======================================
         *	S H O W   N E W S
         * =======================================
         */
        $ets_outter->main_title = $config->get('site_name') . ': ' . $l['title-news'];
Exemple #2
0
/*
	------------------------------------------------		
			NewLife Blogging System Version 3		
	------------------------------------------------
		Developed by sevengraff
		Nick Fun <*****@*****.**>
		Jan-March 2004
		Liscensed under the GNU GPL
	------------------------------------------------
*/
header("Content-type: text/xml");
require_once 'config.php';
require_once 'system/functions.php';
require_once 'system/sqldb2.class.php';
$path = fetch_url_data();
if (!isset($path['id'])) {
    jsRedirect(script_path . 'index.php');
    // I'm not sure if re-directing is the best option since RSS should be used by
    // client apps, but if there is something wrong with the path info, then chances
    // are that someone is just trying to make an error appear.
}
$userid = addslashes($path['id']);
$home_url = full_url . build_link('blog.php', array('user' => $userid));
$db = new sqldb2($DB_CONFIG);
// user exists?
$user_check = $db->getArray('SELECT count(user_id) AS c FROM ' . db_users . ' WHERE user_id="' . $userid . '";');
if ($user_check['c'] != 1) {
    // 	die('Invalid User');
    jsRedirect(script_path . 'index.php');
}