Location: PHPKode > projects > Content*Builder > contentbuilder/plugins/article2/showComments.inc.php
<?
   $link1 = $PHP_SELF.'?load='.$config["urlIdent"].'&sub=commentManager&'.SID;

   $tpl->readTemplatesFromFile($config['templates']."comments.template");
   $tpl->addGlobalVar("SUB", "artOptions");
   
	if(!(ADMIN & $cbPerms)) {
		if(!(MOD_OWN & $cbPerms) AND !(MOD_ALL & $cbPerms)) {
	    	echo $error_msg["permission-denied"];
	    	exit();
	   	}
	}
	  

   if(isset($del)) {
      $cdate     = explode("_", $cid);
      $ctime     = explode("-", $cdate[1]);
      $ctime     = implode(":", $ctime);
      $cdatetime = $cdate[0].' '.$ctime;
      mysql_query("DELETE FROM ".TABLE."_comments WHERE cmdatum = '$cdatetime' AND ide = '$id'");
   }

   $artQuery = mysql_fetch_array(mysql_query("SELECT * FROM ".TABLE."_headlines, ".TABLE."_article WHERE ide = '$id'"));
   $cquery = mysql_query("SELECT * FROM ".TABLE."_comments WHERE ide = '$id'");
   if(!empty($cquery)) {
      if($artQuery['title']) {
         $title = $artQuery['title'];
      } elseif($artQuery['headline']) {
         $title = $artQuery['headline'];
      }

      while($get = mysql_fetch_array($cquery)) {
         $cdate = explode(" ", $get['cmdatum']);
         $ctime = explode(":", $cdate[1]);
         $ctime = implode("-", $ctime);
         $cid = $cdate[0].'_'.$ctime;

         $ctitle[] = $get["cmheadline"];
         $ctext[]  = $get["cmtext"];
         $clink[]  = $link1.'&del=1&cid='.$cid.'&id='.$id;
         $deltext[]= $amText["delete"];

         unset($cid);
      }
      $tpl->addVars("show_comments",
         array("THIS_IS" => $amText["comment-of"],
               "TITLE"  => $title));

      $tpl->addVars("sc_row",
         array("CTITLE"  => $ctitle,
               "CTEXT"   => $ctext,
               "LINK"    => $clink,
               "DELTEXT" => $deltext));

      $tpl->setAttribute("show_comments", "visibility", "visible");

   } else {

      $tpl->addVar("message", "MESSAGE", $amText["no-comments"]);
      $tpl->setAttribute("message", "visibility", "visible");
   }

   $tpl->displayParsedTemplate("comments");
?>
Return current item: Content*Builder