<?php
/* ============================================================
* index.php
* -------------------
* Date : 23 june 2006
* E-mail : hide@address.com
*
* Version : 1.0 (23/06/2006 - 13:35)
*
* This a free software
* licensed under GPL (General public license)
*
============================================================ */
$root_path = './../';
include_once($root_path.'config.php');
require_once($root_path.'includes/dbconn.php');
require_once($root_path.'includes/functions.php');
require_once($root_path.'includes/template.php');
require_once($root_path.'includes/metadata.php');
require_once($root_path.'includes/user.php');
// GET tag and page by url
isset($_GET['tag']) ? $tagg=$_GET['tag'] : $tagg = null;
isset($_GET['pag']) ? $pag=$_GET['pag'] : $pag = 1;
$paging=($pag-1)*$paglimit;
isset($_GET['style']) ? $template=$_GET['style'] : $template=$template;
//start templatebuilding
$tpl = & new Template();
$tpl->set('tagg', $tagg);
$tpl->set('location', $location);
if (isset($_COOKIE["user"]) AND isset($_COOKIE["secret"])) {
$myUser = new User;
$myUser->userName = $_COOKIE["user"];
$myUser->userPassword = $_COOKIE["secret"];
$myUser->verifyPassword();
$tpl->set('user_id', $myUser->user_id);
$tpl->set('username', $myUser->userName);
}
$ids = urlIDs($tagg); //returns an array of id's for this tag
//print_r($ids);
foreach($ids as $id){
$link = new Link($id);
$bdy = & new Template();
$bdy->set('url', $link->url);
$bdy->set('link_title', $link->title);
$bdy->set('link_description', $link->description);
$bdy->set('link_snipset', $link->snipset);
$bdy->set('link_taxonomy', $link->taxonomy);
$bdy->set('link_id', $link->meta_id);
$bdy->set('location', $location);
$tagList = tagList($link->meta_id); //this is an array with all the tags for this url
//print_r($tagList);
$bdy->set('link_taglist', $tagList);
$body .= $bdy->fetch($root_path.'template/'.$template.'/admin_body.tpl');
}
$tpl->set('body', $body);
if ($_GET['style'] == 'rss') header('Content-type: text/xml');
echo $tpl->fetch($root_path.'template/'.$template.'/index.tpl');
?>