<?php
	if( !$this->user->is_logged ) {
		$this->redirect('home');
	}
	
	
	/*************************************************************************/
	// needed before proceeding
	require_once('_all-required-language.php');
	
	$this->load_langfile('global/global.php');	
	$this->load_langfile('inside/dashboard.php');

	/*************************************************************************/
	
	
	require_once('_all-required-dashboard.php');
	

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

	$listpages = $this->db2->fetch_all('
	SELECT pages.* FROM pages, pages_likes 
	WHERE 
	pages.idpage=pages_likes.idpage 
	AND status=1 
	AND idowner<>'.$this->user->id.' 
	AND pages_likes.iduser='.$this->user->id
	);

	$D->htmlPages = '';
	
	foreach($listpages as $onepage) {
		$D->idpage = $onepage->idpage;
		$D->codepage = $onepage->code;
		$D->pageverified = $onepage->verified;
		$D->numlikespage = $onepage->num_likes;
		$D->numpostspage = $onepage->num_posts;
		$D->titlepage = stripslashes($onepage->title);
		$D->urlpage = $onepage->url;
		$D->status = $onepage->status;
		$D->avatarpage = $onepage->avatar_page;
		$D->nameCategory = stripslashes($this->network->getNameCatPage($onepage->idsubcategory));
		$D->isMyPage = $onepage->idowner == $this->user->id ? TRUE : FALSE;
		$D->htmlPages .= $this->load_template('__dashboard-one-page.php', FALSE);
	}
	
	unset($listpages, $onepage);
	
	/*************************************************************************/

	$D->optionactive = 11;
	$D->tab_active = 2;
	$this->load_template('dashboard-pages-likes.php');
?>