require_once(dirname(__FILE__)."/wpBlog.php");
require_once(dirname(__FILE__)."/../users/DBClassBlog.php");
class wpBlogDAO{
function wpBlogDAO(){
// $fileDef = parse_ini_file(dirname(__FILE__)."/../../../scielo.def.php");
// $DBparams["password"] = $fileDef["DB_USER_BLOG_PASSWORD"];
// $DBparams["db"] = $fileDef["DB_BLOG"];
// $DBparams["user"] = $fileDef["DB_USER_BLOG"];
// $DBparams["host"] = $fileDef["DB_HOST_BLOG"];
// $this->_db = new DBClass($DBparams);
$this->_db = new DBClassBlog();
}
function getBlogIdByName($acron){
$acron = "/".$acron."/";
$strsql = "SELECT blog_id from wp_blogs where path='".$acron."'";
$arr = $this->_db->databaseQuery($strsql);
$blogId = $arr[0]["blog_id"];
return $blogId;
}
function getBlogByName($acron){
$acron = "/".$acron."/";
$strsql = "SELECT blog_id from wp_blogs where path='".$acron."'";
$arr = $this->_db->databaseQuery($strsql);
if($arr){
return true;
}else{
return false;
}
}
function getCountCommentByPid($PID,$acron){
$reacron = $this->getBlogIdByName($acron);
if($reacron!=0){
$strsql = "SELECT comment_count FROM wp_".$reacron."_posts WHERE post_name='".$PID."'";
$arr = $this->_db->databaseQuery($strsql);
if(!isset($arr[0]["comment_count"])){
return '0';
}else{
return $arr[0]["comment_count"];
}
}else{
return '0';
}
}
function fechaConexao(){
$this->_db->fechaConexao();
}
}
?>
//consulta a instancia para pegar o COOKIE se jah logado
//ini_set("display_errors","1");
//error_reporting(E_ALL);
session_start();
$dir = dirname(__FILE__);
$defi = parse_ini_file($dir."/../../../scielo.def.php",true);
$robotsUserAgents = parse_ini_file($dir."/../../../robotsUserAgents.def",true);
$isaRobot = false;
foreach($robotsUserAgents["ROBOTS_AGENT"] as $key => $value){
$userAgent = strtolower($HTTP_USER_AGENT);
$agent = strtolower($value);
if (strstr($userAgent,$agent)){
$isaRobot = true;
break;
}
}
if (!$isaRobot){
if($defi['services']['show_login'] != "0"){
$loginURL = "http://".$defi['SCIELO_REGIONAL']['SCIELO_REGIONAL_DOMAIN']. $defi['SCIELO_REGIONAL']['check_login_url'];
if(isset($_GET['userID']))
{
if (strpos($_SERVER["REQUEST_URI"],"lng"))
{
$self_url = str_replace("lng=en","lng=".$_GET['lng'],"http://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]);
}else{
$self_url = "http://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]."&lng=".$_GET['lng'];
}
$inicio = strpos($self_url,"userID") -1 ;
$self_url = substr($self_url, 0, $inicio);
header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"');
setcookie("userID",$_GET['userID'],time()+3600,"/");
setcookie("userToken",$_GET['userToken'],time()+3600,"/");
setcookie("tokenVisit",$_GET['tokenVisit'],time()+3600,"/");
setcookie("firstName",$_GET['firstName'],time()+3600,"/");
setcookie("lastName",$_GET['lastName'],time()+3600,"/");
setcookie("userToken",$_GET['userToken'],time()+3600,"/");
setcookie("email",$_GET['email'],time()+3600,"/");
session_write_close();
Header("Location: ".$self_url);
exit;
}
/*
se nao verificou no Regional o Login do usuario vai verificar
*/
/*
if(!isset($_SESSION['checkedLogin']))
{
if(!isset($_REQUEST['skpa'])=="on"){
$self_url = "http://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
$inicio = strpos($self_url,"userID") -1 ;
if($inicio > 0){
$self_url = substr($self_url, 0, $inicio);
}
$_SESSION['checkedLogin'] = "true";
session_write_close();
$self_url = '?origem='.str_replace('?','&',$self_url);
header("Location: ".$loginURL.$self_url);
}
}
*/
}
}
?>
Interface (Botucatu) - vol.2 special edition
Interface - Comunicação, Saúde, Educação
Print version ISSN
1414-3283
| | Table of contents Interface (Botucatu) vol.2 no.se Botucatu 2006 On a new concept of community: social networks, personal communities and collective intelligence Costa, Rogério da
| | | Evaluation of the knowledge in hygiene practices: a qualitative approach Tavolaro, Paula; Oliveira, Carlos Augusto Fernandes; Lefèvre, Fernando
| | | Capital dynamics and local health systems: searching for a comprehensive analysis of the health sector Andreazzi, Maria de Fátima Siliansky de; Andreazzi, Marco Antonio Ratzsch de; Carvalho, Diana Maul de
| | | Social medicalization (II): biomedical limits and proposals for primary care clinic Tesser, Charles Dalcanale
| | | The understanding of solid wastes from healthcare services in academic education: a contribution to environmental education Corrêa, L.B.; Lunardi, V.L.; De Conto, S.M.; Galiazzi, M.C.
| | | Social support, health and oral health promotion in the elderly population in Brazil Araújo, Silvânia Suely Caribé de; Freire, Danielle Bianca de Lima; Padilha, Dalva Maria Pereira; Baldisserotto, Julio
| | | Self-perception of teeth loss of the aged Unfer, Beatriz; Braun, Kátia; Silva, Caroline Pafiadache da; Pereira Filho, Léo Dias
| | | Promoting and recovering health: meanings produced in community groups within the family health program context Camargo-Borges, Celiane; Japur, Marisa
| | | Public regulation of the health care system in Brazil: a review Santos, Fausto Pereira dos; Merhy, Emerson Elias
| | | The path of accident analysis: the traditional paradigm and extending the origins of the expansion of analysis Almeida, Ildeberto Muniz de
| | | Images and meanings in the discourse of the press media on a benzene occupational intoxication epidemic Rangel-S, Maria Ligia
| | | Competence of health professionals for interdisciplinary work Saupe, Rosita; Cutolo, Luiz Roberto Agea; Wendhausen, Águeda Lenita Pereira; Benito, Gladys Amélia Vélez
| | | The professional master's degree as a preferable model for training in family health Saupe, Rosita; Wendhausen, Águeda Lenita Pereira
| | |
|