ob_start("ob_gzhandler");
include("./includes/config.php");
include("./lang/arabic.php");
include("./includes/function.php");
include("./includes/online.php");
include("./includes/easytemplate.php");
include("./includes/inquiry.php");
include("./includes/bbcode.php");
$PhpGroup_style['def_style'] = "designs/$style";
$stylepath= $PhpGroup_style['def_style'];
$tpl = new EasyTemplate;
$tpl->Temp = $PhpGroup_style['def_style'];
$tpl->Cache = "easycache";
//get the can name in the right page
$selectc = @mysql_db_query("$dbName", "SELECT * FROM `cat` WHERE `cat_group` = '1' ORDER BY `cat`.`cat_display` ASC ") ;
while ($s = @mysql_fetch_assoc($selectc)){
$cat[] = $s ;
}
@mysql_free_result($selectc);
//loginbox
loginbox( $login );
//statistics
$selectcount= mysql_db_query("$dbName", "SELECT * FROM cat;") ;
$totalcat = mysql_affected_rows();
@mysql_free_result($selectcount);
$selectcount= mysql_db_query("$dbName", "SELECT * FROM divan;") ;
$totaldivan = mysql_affected_rows();
@mysql_free_result($selectcount);
$selectcount= mysql_db_query("$dbName", "SELECT * FROM users;") ;
$totalusers = mysql_affected_rows();
@mysql_free_result($selectcount);
//getcat info
//poeminfo info
$id= trim($_GET['poemid']);
$cleanid = strip_tags($id);
if(! is_numeric($cleanid)) { die("ERROR : Not Found"); }
$selectpoem = mysql_db_query("$dbName", "SELECT * FROM `divan` WHERE `divan_id` = '$cleanid'") ;
while ($pinfo = @mysql_fetch_assoc($selectpoem)){
$poemname= $pinfo[divan_title];
$poemcontaining= $pinfo[divan_containing];
$poemdate= $pinfo[divan_date];
$poemcount = $pinfo[divan_count];
$poemgroup = $pinfo[divan_group];
$poembackg = $pinfo[divan_back];
$poemcatid = $pinfo[cat_id];
$sounds = $pinfo[divan_sound];
$formats = $pinfo[poem_format];
}
if(($sounds)!=('')){
$realplayer = "
";
}else{
$realplayer = "";
}
$javacode = "";
$exp = $_SERVER['HTTP_USER_AGENT'];
$exp = explode("Firefox",$exp);
$exp = $exp[1];
if(($exp) == ('')){
$poemcode = "";
$thispoem = bbcode($poemcontaining);
$thispoem = nl2br($thispoem);
$thispoem = "
";
}else{
$poemcode = "";
$thispoem= $poemcontaining;
$thispoem = nltobr($thispoem);
$thispoem = str_replace("="," ",$thispoem);
$thispoem = "
$thispoem
التنسيق غير مفعل علي متصفح الفايرفوكس
";
}
$selectcats = mysql_db_query("$dbName", "SELECT * FROM `cat` WHERE `cat_id` = '$poemcatid'") ;
while ($pcatinfo = @mysql_fetch_assoc($selectcats)){
$catname = $pcatinfo[cat_name];
}
@mysql_free_result($selectpoem);
//gatcat info
$subtitle = " - $poemname ";
echo $tpl->display("headerinclude.html");
//header
//get the last new poem
$selectnewdivan = mysql_db_query("$dbName", "SELECT * FROM `divan` WHERE `divan_group` = '1' ORDER BY `divan_id` DESC LIMIT 10 ") ;
while ($ndivan = @mysql_fetch_assoc($selectnewdivan)){
$nd[] = $ndivan ;
}
@mysql_free_result($selectnewdivan);
echo $tpl->display("header.html");
echo $tpl->display("bodyinclude.html");
if (($close) == ('yes')){
echo $tpl->display("message.html");
traidntright();
echo $tpl->display("footer.html");
exit();
}
if(($catname)==('')){
$message = "عفوا ليس لديك صلاحيات مشاهده القصيدة";
echo $tpl->display("message.html");
traidntright();
echo $tpl->display("footer.html");
exit();
}
if (($poemgroup) != ('1')){
$message = $lang[gpoem];
echo $tpl->display("message.html");
}else{
$selectidpoem = mysql_db_query("$dbName", "SELECT * FROM `divan` WHERE `divan_id` = '$cleanid'") ;
$totalpoumincat = mysql_affected_rows();
if(($totalpoumincat)==('0')){
$message = $lang[poemnotfound];
echo $tpl->display("message.html");
}else{
//get poem
while ($vdivan = @mysql_fetch_assoc($selectidpoem)){
$pi[] = $vdivan ;
}
if (($commentallow)==('yes')){
addcom($addcom,$stylepath);
}else{
$addcom = $lang[disalowcomment];
}
$updatcatcount = @mysql_db_query("$dbName", "update `divan` SET `divan_count` =divan_count+1 WHERE `divan_id` = '$cleanid'; ") ;
//get poum
$rating = pullRating($cleanid,true,false,true);
echo "
".$tpl->display("viewpoem.html");
//get comment
$getc = @mysql_db_query("$dbName", "SELECT * FROM `comments` WHERE `comments`.`divan_id` = '$cleanid' and `comment_group` ='1' ORDER BY `comments`.`comment_id` ASC ") ;
$totalcoments = mysql_affected_rows();
if(($totalcoments)!=('0')){
while ($dpc = @mysql_fetch_assoc($getc)){
$cpd[] = $dpc ;
}
echo $tpl->display("comments.html");
}
}
}
//page footer
echo"
";
traidntright();
echo $tpl->display("footer.html");
ob_end_flush();
?>