<?php
/*************************************************************************/

	if ($D->page->status==0 && $this->user->info->is_network_admin==0) $this->redirect('home');

	// If there is a user logged in, get ready a variable for use.
	$D->is_my_page = 0;
	$D->is_logged = 0;
	$D->ilikeme = 0;
	$D->posted_in = 1; // Post in a page
	$D->id_wall = $D->page->code;

	if ($this->user->is_logged) {
		$D->me = $this->user->info;
		$D->is_logged = 1;
		
		$D->is_my_page = ($D->page->idowner == $this->user->id);
		
		$D->i_administrator_page = $this->user->if_admin_page($D->page->idpage);
		
		$D->ilikeme = $this->user->if_like_page($D->page->idpage);
				
		$D->i_follow_him = $this->user->if_follow_page($D->page->idpage);

	} 
/*************************************************************************/
	
	$D->pageIsVerified = 0;
	$D->pageIsVerified = $D->page->verified == 1 ? 1 : 0;
	
	$D->titlePage = $D->page->title;

/*************************************************************************/

	$D->useraccesories = '';
	if ($this->user->is_logged) $userAleat = $this->network->getUserAleat(5);
	else $userAleat = $this->network->getUserAleat(5, 0, 0);
	
	foreach($userAleat as $oneUser) {
		$D->acc_name = (empty($oneUser->firstname) || empty($oneUser->lastname))?stripslashes($oneUser->username):(stripslashes($oneUser->firstname).' '.stripslashes($oneUser->lastname));
		$D->acc_codeuser = $oneUser->code;
		$D->acc_avatar = $oneUser->avatar;
		$D->acc_numfriends = $oneUser->num_friends;
		$D->acc_username = $oneUser->username;
		$D->useraccesories .= $this->load_template('__accessories-one-user.php', FALSE);
	}

	unset($userAleat, $oneUser);

/*************************************************************************/
	
	$D->i_am_network_admin = ( $this->user->is_logged && $this->user->info->is_network_admin );

/*************************************************************************/

	$D->adsProfile1 = trim($this->network->get_ads_basic('adsbasic1'));
	$D->adsProfile2 = trim($this->network->get_ads_basic('adsbasic2'));
	
	require_once('_load-ads.php');
	
/*************************************************************************/

	$D->site_keywords = $C->SITE_TITLE.', '.$C->SITE_KEYWORDS;
	$D->site_description = $C->SITE_TITLE.', '.$C->SITE_DESCRIPTION;

/*************************************************************************/

	$D->ApplyScrollInf = 1;

/*************************************************************************/

	$D->subcategory = stripslashes($this->db1->fetch_field('SELECT name FROM pages_cat WHERE idcategory='.$D->page->idsubcategory));

/*************************************************************************/
?>