aki esta mas , lo pusiera todo pero es muy grande
Código PHP:
<?php
if(isset($_GET['action'])){
switch($_GET['action']){
case "add":
addblog();
break;
case "mod":
modblog();
break;
case "del":
delblog();
break;
case "out":
dologout();
break;
case "all":
displayblogsall();
break;
default:
displayblogs();
break;
}
}
else{
displayblogs();
}
function displayblogs(){
global $params;
$imgArray = getImages();
if($_GET['howmuch'] != ""){
if($_GET['howmuch'] == "all"){
$slimit = "";
}
else{
$slimit = $_GET['howmuch'];
}
}
else{
$slimit = "10";
}
if($slimit != ""){
$sqllimit = " LIMIT ".$slimit;
}
else{
$sqllimit = "";
}
if($_GET['whatmonth'] != ""){
$month = substr($_GET['whatmonth'],4);
$year = substr($_GET['whatmonth'],0,4);
$dateq = " WHERE MONTH(`date`) = $month AND YEAR(`date`) = $year";
}
else{
$dateq = "";
}
$query = "SELECT * FROM ".$params['dbpref']."blogs".$dateq." ORDER BY id DESC".$sqllimit;
$blogs = mysql_query($query);
$i=0;
while ($tempstore = mysql_fetch_array($blogs)){
foreach($tempstore as $key => $value){
$ablogs[$i][$key] = $value;
}
$i++;
}
if($_GET['ascdesc'] == "ASC"){
$ablogs = array_reverse($ablogs);
}
if($_GET['post'] != ""){
unset($ablogs);
$query = "SELECT * FROM ".$params['dbpref']."blogs WHERE id='".$_GET['post']."'";
$ablogs[0] = mysql_fetch_array(mysql_query($query));
}
?>
<br /><br />
<table class="tform" cellpadding="0" cellspacing="0">