<?PHP
require 'app/boot.php';
class Gpage extends article
{
function Gpage( )
{
$this->show_page = 'article.php';
}
function runner()
{
$this->chek_Get();
$article = mysql_query("SELECT * FROM article WHERE id=".$_GET['a']." ",$this->connect()) or die(mysql_error());
$this->likes_ip();
if(isset($_GET['like']) AND $this->like == TRUE)
{
$this->Update_like($article);
}
$articles = mysql_fetch_assoc($article);
include FILE_PATH.DIRECTORY_SEPARATOR.$this->show_page;
$com = mysql_query("SELECT * FROM comment WHERE aid=".$_GET['a']."",$this->connect()) or die(mysql_error());
include FILE_PATH.DIRECTORY_SEPARATOR."comment_show.php";
if(isset($_POST['c_b'])){$vals = array('c_n','c_e','c_t','c_bl','c_type');
foreach( $vals as $val ){
if(!isset($_POST[$val]))
{
header("location: index.php");return;
}
}
if($_POST[$vals[4]]!= '1' AND $_POST[$vals[4]]!= '0')
{
$type = '0';
}else{$type = $_POST[$vals[4]];}
if($_POST[$vals[0]] == ""){echo "??? ??? ?? ???? ????";}else{
if($_POST[$vals[1]] == ""){echo "????? ??? ??? ??? ????!";}else{
if($_POST[$vals[2]] == ""){echo "??? ??? ?? ???? ????";}else{
$name = htmlspecialchars($_POST[$vals[0]]);$email=htmlspecialchars($_POST[$vals[2]]);$text=$_POST[$vals[2]];$blog=htmlspecialchars($_POST[$vals[3]]);
$this->comment_send($_GET['a'],$name,$email,$text,$blog,$type);
$this->redirect("location: ");
}
}
}
}
include FILE_PATH.DIRECTORY_SEPARATOR."comment.php";
}
}
$m = new Gpage;
$m -> run( );