Szukam porady.Mam następujący moduł newsów na stronie:
<?php require_once ("include/functions.php"); require_once ("include/raconfigmzes.php"); require_once ("include/blocks.php"); ?> <table cellpadding=0 cellspacing=0 align=center width=100% style="margin-bottom:20px;"> <tr> <TD width=100% align=left valign=top> <table width="100%" border="0"> <tr> <td style="border:0px solid #C0D7F3;" width="50%" valign="top"><span style="text-align:center;background: url('nav_black.jpg');display:block;color:#FFFFFF;font-size:11px;font-weight:bold;line-height:27px;height:27px;margin-bottom:12px;border-bottom:0px solid #C0D7F3;-moz-border-radius:10px;">Nowości na Portalu</span> <? print_news($GLOBALS['block_newslimit']); ."\t</tr>\n" ."</table><br />"); ?>
Wszystko działa ok.Jako admin można dodawać newsy z poziomu strony tylko jako linki lub prosty text , ale nie można pisać w PHP czy HTML.
News.php
<?php require_once ("include/functions.php"); require_once ("include/raconfigmzes.php"); dbconn(); standardheader('Manage News'); if ($CURUSER["edit_news"]!="yes") { err_msg(ERROR,ERR_NOT_AUTH); stdfoot(); } else $action =""; if ($action=="del") { if ($CURUSER["delete_news"]=="yes") { redirect("index.php"); } else { err_msg(ERROR,CANT_DELETE_NEWS); stdfoot(); } } elseif ($action=="edit") { if ($CURUSER["edit_news"]=="yes") { if (!$rnews) { err_msg(ERROR,ERR_BAD_NEWS_ID); stdfoot(); } if ($row) { $news=unesc($row["news"]); $title=unesc($row["title"]); } else { err_msg(ERROR,ERR_NO_NEWS_ID); stdfoot(); } } else { err_msg(ERROR,CANT_DELETE_NEWS); stdfoot(); } } else { elseif ($_POST["conferma"]==FRM_CONFIRM) { { $news=$_POST["news"]; $uid=$CURUSER["uid"]; $title=$_POST["title"]; if ($news=="" || $title=="") { err_msg(ERROR,ERR_INS_TITLE_NEWS); } else { $news=sqlesc($news); $title=sqlesc($title); $action=$_POST['action']; if ($action=="edit") else mysql_query("INSERT INTO news (news,title,user_id,date) VALUES ($news,$title,$uid,NOW())") or die(mysql_error()); redirect("index.php"); } } } elseif ($_POST["conferma"]==FRM_CANCEL) { redirect("index.php"); } else { $title=""; $news=""; } } block_begin(NEWS_PANEL); ?> <div align="left"> <form action="news.php" name="news" method="post"> <table border="0" class="lista"> <tr> <td align="left" colspan=2 class="header" > </td> </tr> <tr> <td align="left" class="lista" style="font-size:10pt"> </td> <td align="left" class="lista"> </td> </tr> <tr> <td align="left" class="lista" valign="top" style="font-size:10pt"> </td> <td align="left" class="lista"> </td> </tr> <tr> </tr> <tr> <td align="left" class="header" > </td> <td align="left"class="header" > </td> </tr> </table> </form> </div> <?php block_end(); ?>