require("../zinc/head.php");
require("../_inc/fn/fmtdate.php");
require("../_inc/fn/writepages.php");
require("../_inc/fn/writepages_js.php");
require("../_inc/fn/getuserpic.php");
require("../_inc/fn/interview/entertainment_fn.php");
require("../_inc/fn/confirmny.php");
require("../zinc/db.php");
$db = mysql_connect($dbserver,$dbuser,$dbpw);
mysql_select_db($dbname,$db);
main();
mysql_close($db);
//*/
require("../zinc/foot.php");
//==============================================================================
function main(){
global $gbDT;
print('
');
if($_REQUEST['id']!="")dpBlog($_REQUEST['id']);
else dpBlogFullList();
print(' |  | ');
print(' | ');
print('
');
if($_REQUEST['id']!="")dpBlogReview($_REQUEST['id']);
else{
dpInterviewList(5);
dpDJList(5);
}
print(' |
');
}
//=======================================================
function dpBlogFullList(){
GLOBAL $db;
//------------------------------------------------
$maxshown=5;
$filter="";
//------------------------------------------------
$curpage=1;
if(isset($_GET['st']))$curpage=$_GET['st'];
$curpos=($curpage-1)*$maxshown+1;
//------------------------------------------------
$maxrec=0;
$result=mysql_query("select count(*) as cnt from cz_news where news_status=1",$db);
if( ($rs=mysql_fetch_array($result))){ $maxrec=$rs['cnt'];}
mysql_free_result($result);
//------------------------------------------------
$cnt=0;
$result=mysql_query("select n.*,t.nt_name,m.username from cz_news n,cz_news_type t,cz_members m where n.news_status=1 and n.nt_id=t.nt_id and n.mem_id=m.mem_id order by news_dt desc LIMIT ".($curpos-1).",".($maxshown),$db);
$col=1;
while( ($rs=mysql_fetch_array($result))){
if(++$col>1)$col=0;
print('');
print('');
print('');
print(''.$rs['news_title'].' '.$rs['nt_name'].' | '.fmtdate("l - F d, Y h:ia",$rs['news_dt']));
print(' |
');
print('');
}
mysql_free_result($result);
if($maxrec>$maxshown)print('
'.writepages($maxrec,$maxshown,$curpage,"blog.php?").'
');
}
//=======================================================
function dpBlog($id){
GLOBAL $db;
//------------------------------------------------
$maxshown=5;
$filter="";
//------------------------------------------------
$curpage=1;
if(isset($_GET['st']))$curpage=$_GET['st'];
$curpos=($curpage-1)*$maxshown+1;
//------------------------------------------------
$cnt=0;
$result=mysql_query("select n.*,t.nt_name,m.username from cz_news n,cz_news_type t,cz_members m where n.news_status=1 and n.nt_id=t.nt_id and n.mem_id=m.mem_id and news_id=".$id,$db);
if( ($rs=mysql_fetch_array($result))){
if(++$col>1)$col=0;
print('');
print('');
print('');
print(''.$rs['news_title'].' '.$rs['nt_name'].' | '.fmtdate("l - F d, Y h:ia",$rs['news_dt']));
print(' |
');
print('');
print(' '.str_replace("\n"," ",str_replace(" ');
print('
|
');
//if($rs['has_cmt']==1)
}
mysql_free_result($result);
}
//=======================================================
function dpBlogReview($id){
GLOBAL $db,$gbMemID;
divConfirm('confirmCmtDel','delete?','Delete','newsCmtDelete(document.fmconfirmCmtDel);');
?>
$curpage=1;
$maxshown=5;
$maxcnt=0;
//------------------------------------------
print('
');
if($gbMemID==0){
print('
');
}
else{
print('');
}
print('
');
//------------------------------------------
print('');
}
?>