$ets_outter->main_title = $config->get('site_name') . ': ' . $l['title-news']; $ets_outter->page_title = $l['title-news']; $page = 0; if (isset($_PATH['page'])) { $page = $_PATH['page']; } $q = '# GET NEWS POSTS SELECT t1.blog_id, t1.author_id, t1.date, t1.subject, t1.body, t1.access, t1.custom AS custom_text, t1.comments, t1.html, t1.smiles, t1.bb, t2.username AS author, t2.custom AS custom_title FROM ' . db_blogs . ' AS t1, ' . db_users . ' AS t2 WHERE t1.author_id = t2.user_id AND t1.access = ' . access_news . ' ORDER BY t1.date DESC LIMIT ' . $page . ' , ' . $config->get('news_per_page') . ' ;'; $newsitems = $db->getAllArray($q); $b->setDate($config->get('news_date_format')); foreach ($newsitems as $news) { $b->setData($news); $ets->news[] = $b->format(false, $user, $l['edit']); } $USESKIN = skin_news; break; case 'comment': /** * ======================================= * N E W S C O M M E N T S * ======================================= */ $USESKIN = skin_news; $ets_outter->main_title = $config->get('site_name') . ': ' . $l['title-news']; $ets_outter->page_title = $l['title-news']; if (!isset($_PATH['id'])) { jsRedirect('index.php');
$isAFriend = false; // get list of blog owners' friends // This should probally be a method of nlb_users, but I only have to do this once... $f = $db->query('SELECT friend_id FROM ' . db_friends . ' WHERE owner_id=' . $thisblog['author_id'] . ';'); while ($row = mysql_fetch_assoc($f)) { if ($row['friend_id'] == $user->id) { $isAFriend = true; break; } } if (!$isAFriend) { // Can't see this blog :( jsRedirect(script_path . 'index.php'); } } $blog->setData($thisblog); $blog->setDate($thisblog['date_format']); if ($user->isLogedIn) { $blog->setDateOffset($config->get('server_timezone'), $user->get('timezone')); } $USERID = $blog->data['author_id']; // check for avatars $avatar = $db->getArray('SELECT file, isCustom FROM ' . db_avatars . ' WHERE owner_id=' . $USERID . ' AND type=1;'); if (!empty($avatar)) { if ($avatar['isCustom'] == 1) { $file = 'avatars/'; } else { $file = 'avatars/default/'; } $file .= $avatar['file']; $ets->avatar_url = script_path . $file;