<?php ini_set("include_path", "."); require_once "../classes/Links.php"; require_once "../../../php/include.php"; require_once "functions.php"; $site = parse_ini_file(dirname(__FILE__) . "/../../../ini/" . $lang . "/bvs.ini", true); $ini = parse_ini_file("../scielo.def", true); $home = $ini['this']['url']; if (!isset($_COOKIE['userID'])) { header("Location: " . $home); } ob_start("ob_gzhandler"); session_start(); $link = new Links(); $link->setUser_Id($_COOKIE['userID']); $link->setLink_id($_GET['link']); $link->setRate($_GET['rate']); $result = $link->updateLinkRate(); echo "Content-type: text/plain \n"; echo "true"; ob_end_flush();
/** *Retorna um registro da tabela directories definido pelo campo directory_id * *@param Links */ function getInHomeLinks($link) { $strsql = "SELECT * FROM user_links WHERE user_id = " . $link->getUser_id() . " and in_home=1 order by rate desc"; $result = $this->_db->databaseQuery($strsql); $linkList = array(); for ($i = 0; $i < count($result); $i++) { $link = new Links(); $link->setLink_id($result[$i]['link_id']); $link->setUser_id($result[$i]['user_id']); $link->setName($result[$i]['name']); $link->setUrl($result[$i]['url']); $link->setDescription($result[$i]['description']); $link->setInHome($result[$i]['in_home']); $link->setRate($result[$i]['rate']); array_push($linkList, $link); } return $linkList; }