<?php session_start();
/* * ********************************************************************
* Copyright notice PHP Blogger 1.1.
*
* (c) 2011 Predrag Rukavina - admin[at]phpblogger[dot]org
* All rights reserved
*
* This script is part of the PHP Blogger project.
* The PHP Blogger project is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
* This copyright notice MUST appear in all copies of the script!
* ********************************************************************** */
##############################
# profile.php version 1.1.#
##############################
include ('settings.php');
include 'libs/pagination.class.php';
$pagination = new pagination;
$cid = $_GET['cid'];
$arecordSet = &$conn->Execute("SELECT * FROM comment WHERE texty = '".mysql_real_escape_string($cid)."' ORDER by commid desc");
if($arecordSet) {
if($arecordSet->fields == 0) {
echo "Sorry, user you are looking for does not exist.";
$arecordSet->Close();
$conn->Close();
die();
}
}
if(!$arecordSet)
print $conn->ErrorMsg();
else
while(!$arecordSet->EOF) {
$acval[] = $arecordSet->fields;
$arecordSet->MoveNext();
}
$brecordSet = &$conn->Execute("SELECT * FROM reviews");
if(!$brecordSet)
print $conn->ErrorMsg();
else
while(!$brecordSet->EOF) {
$bcval[] = $brecordSet->fields;
$brecordSet->MoveNext();
}
$crecordSet = &$conn->Execute("SELECT * FROM users WHERE username = '".mysql_real_escape_string($cid)."' LIMIT 1");
if(!$crecordSet)
print $conn->ErrorMsg();
else
while(!$crecordSet->EOF) {
$bval[] = $crecordSet->fields;
$crecordSet->MoveNext();
}
/**
* intergrate()
*
* @param mixed $comment
* @return
*/
if($rewritemod == 2){
function intergrate($comment) {
$comment = preg_replace("#(([a-zA-Z]+://)([a-zA-Z0-9?&%.;:/=\-_+\#]*))#e","'<a href=\"$1\" target=\"_blank\">$0</a>'",$comment);
$comment = preg_replace("/@([A-Za-z0-9_]+)/","<a href='$1'>$0</a> ",$comment).'';
return $comment;
}
}
if($rewritemod == 1){
function intergrate($comment) {
$comment = preg_replace("#(([a-zA-Z]+://)([a-zA-Z0-9?&%.;:/=\-_+\#]*))#e","'<a href=\"$1\" target=\"_blank\">$0</a>'",$comment);
$comment = preg_replace("/@([A-Za-z0-9_]+)/","<a href='profile.php?cid=$1'>$0</a> ",$comment).'';
return $comment;
}
}
$smarty->caching = 0;
$iconfig['date'] = '%I:%M %p';
$iconfig['time'] = '%H:%M:%S';
$smarty->assign('iconfig',$iconfig);
$smarty->assign('today',strtotime('+ 1 hours'));
@$dataPages = $pagination->generate(@$acval,12);
$smarty->assign('comment',$dataPages);
$smarty->assign('pagination',$pagination->links());
$smarty->assign('reviews',@$bcval);
$smarty->assign('users',@$bval);
$smarty->display('profile.php');
$smarty->display('footer.php');
$recordSet->Close();
$arecordSet->Close();
$brecordSet->Close();
$conn->Close();
?>