Location: PHPKode > projects > Absolut Engine > absolut-engine-33870/admin/admin.php
<?
@include("coreclass.php");
$ae=new CArticles();
$ae->EngineInitialize();
$ae->RequestVariables();
// Logs user in
if ($ae->action==1)
   {
   $ae->RequestVariables(1);
   $ae->UserLogin($user,$pass);
   }
$ae->UserVerifySession();
// Logs user out
if ($ae->action==2)
   {
   $ae->RequestVariables(1);
   $ae->UserLogout($user,$pass);
   }
if ($ae->datefrom) $ae->filtdatefrom=$ae->DateConversion($ae->datefrom);
if ($ae->dateto) $ae->filtdateto=$ae->DateConversion($ae->dateto);
$condition.="WHERE ";
setcookie('filtarticlenumber',$ae->filtarticlenumber,time()+999999999,'/');
setcookie('filtsectionID',$ae->filtsectionID,time()+999999999,'/');
setcookie('filtuserID',$ae->filtuserID,time()+999999999,'/');
if ($ae->datefrom) setcookie('filtdatefrom',$ae->filtdatefrom,time()+999999999,'/');
if ($ae->dateto) setcookie('filtdateto',$ae->filtdateto,time()+999999999,'/');
if ($ae->filtsectionID)
   {
   $condition.="sectionID='".$ae->filtsectionID."' AND ";
   }
if ($ae->filtuserID)
   {
   $condition.="authorID='".$ae->filtuserID."' AND ";
   }
if ($ae->filtdatefrom)
   {
   $condition.="adate>='".$ae->filtdatefrom."' AND ";
   }
if ($ae->filtdateto)
   {
   $condition.="adate<='".$ae->filtdateto."' AND ";
   }
$condition.=" 1"; // Dummy statement to close AND clause
$condition.=" ORDER BY ";
if ($ae->sortby=="date")
   {
   setcookie('sortby','date',time()+999999999,'/');
   setcookie('sortorder',$ae->sortorder,time()+999999999,'/');
   if ($ae->sortorder=="asc") $ae->sortorder="desc"; else $ae->sortorder="asc";
   $condition.="adate ".$ae->sortorder.",atime ".$ae->sortorder;
   }
elseif ($ae->sortby=="title")
   {
   setcookie('sortby','title',time()+999999999,'/');
   setcookie('sortorder',$ae->sortorder,time()+999999999,'/');
   if ($ae->sortorder=="asc") $ae->sortorder="desc"; else $ae->sortorder="asc";
   $condition.="title ".$ae->sortorder;
   }
elseif ($ae->sortby=="section")
   {
   setcookie('sortby','section',time()+999999999,'/');
   setcookie('sortorder',$ae->sortorder,time()+999999999,'/');
   if ($ae->sortorder=="asc") $ae->sortorder="desc"; else $ae->sortorder="asc";
   $condition.="sectionID ".$ae->sortorder;
   }
elseif ($ae->sortby=="priority")
   {
   setcookie('sortby','priority',time()+999999999,'/');
   setcookie('sortorder',$ae->sortorder,time()+999999999,'/');
   if ($ae->sortorder=="asc") $ae->sortorder="desc"; else $ae->sortorder="asc";
   $condition.="priority ".$ae->sortorder;
   }
elseif ($ae->sortby=="status")
   {
   setcookie('sortby','status',time()+999999999,'/');
   setcookie('sortorder',$ae->sortorder,time()+999999999,'/');
   if ($ae->sortorder=="asc") $ae->sortorder="desc"; else $ae->sortorder="asc";
   $condition.="status ".$ae->sortorder;
   }
elseif ($ae->sortby=="author")
   {
   setcookie('sortby','author',time()+999999999,'/');
   setcookie('sortorder',$ae->sortorder,time()+999999999,'/');
   if ($ae->sortorder=="asc") $ae->sortorder="desc"; else $ae->sortorder="asc";
   $condition.="authorID ".$ae->sortorder;
   }
else
   {
   $condition.="adate DESC, atime DESC";
   }
$noback=TRUE;
@include("header.php");

@include("menu.php");

echo '<div id="content">';
if (!$ae->filtarticlenumber) $ae->filtarticlenumber=10;
$condition.=" LIMIT ".$ae->filtarticlenumber;
$ae->DBQuery("SELECT * FROM ".$ae->table[3]." ".$condition);
echo '<table cellspacing="0" id="data">';
echo '<thead>';
echo '<tr>';
echo '<td width="1%" class="bordertopleft"><img src="images/tl.gif" alt=""></td>';
echo '<td width="15%">';
if ($ae->sortby=="date" OR !$ae->sortby) echo '<span class="help" title="',$ae->textbasic[88],'">*</span>';
echo '<h2>',$ae->textbasic[22],'</h2> <a href="admin.php?sortby=date&sortorder=',$ae->sortorder,'&username=',$ae->username,'&session=',$ae->session,'" title="',$ae->textbasic[87],'">';
if ($ae->sortorder=="asc")
   {
   echo '<img src="images/asc.gif" alt="',$ae->textbasic[87],'" />';
   }
else
   {
   echo '<img src="images/desc.gif" alt="',$ae->textbasic[87],'" />';
   }
echo '</a></td>';
echo '<td width="36%">';
if ($ae->sortby=="title") echo '<span title="',$ae->textbasic[88],'">*</span>';
echo '<h2>',$ae->textbasic[23],'</h2> <a href="admin.php?sortby=title&sortorder=',$ae->sortorder,'&username=',$ae->username,'&session=',$ae->session,'" title="',$ae->textbasic[87],'">';
if ($ae->sortorder=="asc")
   {
   echo '<img src="images/asc.gif" alt="',$ae->textbasic[87],'" />';
   }
else
   {
   echo '<img src="images/desc.gif" alt="',$ae->textbasic[87],'" />';
   }
echo '</a></td>';
echo '<td width="17%">';
if ($ae->sortby=="section") echo '<span title="',$ae->textbasic[88],'">*</span>';
echo '<h2>',$ae->textbasic[32],'</h2> <a href="admin.php?sortby=section&sortorder=',$ae->sortorder,'&username=',$ae->username,'&session=',$ae->session,'" title="',$ae->textbasic[87],'">';
if ($ae->sortorder=="asc")
   {
   echo '<img src="images/asc.gif" alt="',$ae->textbasic[87],'" />';
   }
else
   {
   echo '<img src="images/desc.gif" alt="',$ae->textbasic[87],'" />';
   }
echo '</a></td>';
echo '<td width="2%">';
if ($ae->sortby=="priority") echo '<span title="',$ae->textbasic[88],'">*</span>';
echo '<a href="admin.php?sortby=priority&sortorder=',$ae->sortorder,'&username=',$ae->username,'&session=',$ae->session,'" title="',$ae->textbasic[87],'">';
if ($ae->sortorder=="asc")
   {
   echo '<img src="images/asc.gif" alt="',$ae->textbasic[87],'" />';
   }
else
   {
   echo '<img src="images/desc.gif" alt="',$ae->textbasic[87],'" />';
   }
echo '</a></td>';
echo '<td width="2%">';
if ($ae->sortby=="status") echo '<span title="',$ae->textbasic[88],'">*</span>';
echo '<a href="admin.php?sortby=status&sortorder=',$ae->sortorder,'&username=',$ae->username,'&session=',$ae->session,'" title="',$ae->textbasic[87],'">';
if ($ae->sortorder=="asc")
   {
   echo '<img src="images/asc.gif" alt="',$ae->textbasic[87],'" />';
   }
else
   {
   echo '<img src="images/desc.gif" alt="',$ae->textbasic[87],'" />';
   }
echo '</a></td>';
echo '<td width="15%">';
if ($ae->sortby=="author") echo '<span title="',$ae->textbasic[88],'">*</span>';
echo '<h2>',$ae->textbasic[33],'</h2> <a href="admin.php?sortby=author&sortorder=',$ae->sortorder,'&username=',$ae->username,'&session=',$ae->session,'" title="',$ae->textbasic[87],'">';
if ($ae->sortorder=="asc")
   {
   echo '<img src="images/asc.gif" alt="',$ae->textbasic[87],'" />';
   }
else
   {
   echo '<img src="images/desc.gif" alt="',$ae->textbasic[87],'" />';
   }
echo '</a></td>';
echo '<td width="13%">&nbsp;</td>';
echo '<td width="1%" class="bordertopright"><img src="images/tr.gif" alt=""></td>';
echo '</tr>';
echo '</thead>';
echo '<tbody>';
$i=0;
while ($ae->DBGetRow())
{
$ae->GetArticle();
$color=fmod($i,2);
$i++;
if ($color==1) echo '<tr>'; else echo '<tr>';
echo '<td width="1%" class="borderleft">&nbsp;</td>';
echo '<td width="15%">';
$ae->GetArticleDate();
echo ' ';
$ae->GetArticleTime();
echo '</td><td width="36%" class="title">';
echo '<a href="../showarticle.php?articleID=',$ae->GetArticleID(),'" target="preview" onclick="window.open(\'../showarticle.php.?articleID=',$ae->GetArticleID(),'\',\'preview\',\'resizable=yes,scrollbars=yes,width=720,height=400\');">';
$ae->GetArticleTitle();
echo '</a>';
echo '</td><td width="17%">';
$ae->GetArticleSection();
echo '</td><td width="2%">';
if ($ae->currentuserposition<=2)
   {
   if ($ae->priority)
      {
      echo '<a href="modify.php?command=36&articleID=',$ae->GetArticleID(),'&username=',$ae->username,'&session=',$ae->session,'" class="priority" title="',$ae->textbasic[17],'">&nbsp;</a>';
      }
   else
      {
      echo '<a href="modify.php?command=35&articleID=',$ae->GetArticleID(),'&username=',$ae->username,'&session=',$ae->session,'" class="nopriority" title="',$ae->textbasic[16],'">&nbsp;</a>';
      }
   }
else
   {
   if ($ae->priority)
      {
      echo '<span class="priority">&nbsp;</a>';
      }
   else
      {
      echo '<span class="nopriority">&nbsp;</a>';
      }
   }
echo '</td><td width="2%">';
if ($ae->currentuserposition<=2)
   {
   if ($ae->status)
      {
      echo '<a href="modify.php?command=38&articleID=',$ae->GetArticleID(),'&username=',$ae->username,'&session=',$ae->session,'" class="published" title="',$ae->textbasic[86],'">&nbsp;</a>';
      }
   else
      {
      echo '<a href="modify.php?command=37&articleID=',$ae->GetArticleID(),'&username=',$ae->username,'&session=',$ae->session,'" class="onhold" title="',$ae->textbasic[45],'">&nbsp;</a>';
      }
   }
else
   {
   if ($ae->status)
      {
      echo '<span class="published">&nbsp;</span>';
      }
   else
      {
      echo '<span class="onhold">&nbsp;</span>';
      }
   }
echo '</td><td width="15%">';
$ae->GetArticleAuthor();
echo '<td class="action" width="11%">';
if (($ae->authorID==$ae->currentuserID AND $ae->status==0) OR $ae->currentuserposition<=2)
{
echo '<a href="editarticle.php?articleID=',$ae->GetArticleID(),'&username=',$ae->username,'&session=',$ae->session,'">',$ae->textbasic[106],'</a>';
echo '<a href="modify.php?command=1&articleID=',$ae->GetArticleID(),'&username=',$ae->username,'&session=',$ae->session,'" onclick="return confirm(\'',$ae->textbasic[53],'\')">',$ae->textbasic[110],'</a>';
}
else echo '&nbsp;';
echo '</td>';
echo '<td width="1%" class="borderright">&nbsp;</td>';
echo '</tr>';
}
echo '<tr>';
echo '<td width="18px" class="borderbottomleft"><img src="images/bl.gif" alt=""></td>';
echo '<td colspan="7" class="borderbottom">&nbsp;</td>';
echo '<td width="18px" class="borderbottomright"><img src="images/br.gif" alt=""></td>';
echo '</tr>';
echo '</tbody>';
echo '</table>';
echo '</div>';

@include("footer.php");
?>
Return current item: Absolut Engine