Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: News.php Klaida

Parašė RuP3r· 2010 Geg. 11 15:05:32
#1

Sveiki,atsisiunčiau modą kad būtų naujienos kaip phpfusion.lt bėja iš to paties tinklapio,įrašiau ir man meta keturias klaidas.

1.
Notice: Us of undefined constant news_cat - assumed 'news_cat' in /home/hgaming/public_htmle/news.php on line 43




43 eilutė :
$result2 = dbquery("SELECT news_cat_name FROM ".DB_NEWS_CATS." WHERE news_cat_id='".$data[news_cat]."'");








2.
Notice: Undefined index: news_cat_name in /home/hgaming/public_html/news.php  on line 49




49 eilutė :
echo "<img src='".IMAGES."news_cats/".$cat['news_cat_image']."' alt='".$data['news_cat_name']."' align='left' style='border:0px;margin-top:3px;margin-right:5px' /></a></td>\n";








3.
Notice: Use of undefined constant news_subject - assumed 'news_subject' in /home/hgaming/public_html/news.php on line 51




51 eilutė :
echo "<a href='".BASEDIR."naujienos.php?skaityti=".$data['news_id']."' title='".$data['news_subject']."' class='slink'> <b>".trimlink($data[news_subject], 100)."</b></a>\n<br />\n";








4.
Notice: Use of undefined constant news_subject - assumed 'news_subject' in /home/hgaming/public_html/naujienos.php on line 65




65 eilutė :
echo "<a href='".BASEDIR."naujienos.php?skaityti=".$data['news_id']."'><b>".trimlink($data[news_subject], 100)." </b></a>\n";





Visas naujienos.php failas :

<?php
////////////////////////////
//nepster v7 naujienos.php
//by phpfusion.lt
////////////////////////////
require_once "maincore.php";
require_once THEMES."templates/header.php";

if ($settings['news_style'] == "1") { $i = 0; $rc = 0; $ncount = 1; $ncolumn = 1; $news_[0] = ""; $news_[1] = ""; $news_[2] = ""; } else { $i = 1; }
$items_per_page = 6;
add_to_title($locale['global_200'].$locale['global_077']);

if (isset($_GET['skaityti']) && !isNum($_GET['skaityti'])) fallback(FUSION_SELF);
if (!isset($_GET['skaityti'])) {
$rows = dbcount("(news_id)", DB_NEWS, groupaccess('news_visibility')." AND (news_start='0'||news_start<='".time()."') AND (news_end='0'||news_end>='".time()."')");
   if (!isset($_GET['rowstart']) || !isNum($_GET['rowstart'])) $_GET['rowstart'] = 0;
   if ($rows != 0) {
   $result = dbquery(
"SELECT tn.*, tc.*, user_id, user_name FROM ".DB_NEWS." tn
LEFT JOIN ".DB_USERS." tu ON tn.news_name=tu.user_id
LEFT JOIN ".DB_NEWS_CATS." tc ON tn.news_cat=tc.news_cat_id
WHERE ".groupaccess('news_visibility')." AND (news_start='0'||news_start<='".time()."') AND (news_end='0'||news_end>='".time()."')
         ORDER BY news_sticky DESC, news_datestamp DESC LIMIT ".$_GET['rowstart'].",$items_per_page"
      );      
$numrows = dbrows($result);   
if (isset($_GET['visos'])) {
opentable("Visos naujienos");
$query3 = dbquery("SELECT * FROM ".DB_NEWS." ORDER BY news_datestamp DESC");
if (mysql_num_rows($query3) == 0) {
echo "<center>Naujienø n&#235;ra</center>";
} else {
while ($data = dbarray($query3)) {
echo "<a href='".BASEDIR."naujienos.php?skaityti=".$data['news_id']."'><b>".trimlink($data[news_subject], 100)." </b>";
echo "<br /></a>";
  }
}
closetable();
} elseif ($settings['news_style'] == "1") {
openside("Naujienos");
$result=dbquery("SELECT * FROM ".DB_PREFIX."news ORDER BY news_datestamp DESC LIMIT 0,$items_per_page");
if(dbrows($result)!=0){
while($data=dbarray($result)){
$result2 = dbquery("SELECT news_cat_name FROM ".DB_NEWS_CATS." WHERE news_cat_id='".$data[news_cat]."'");
$news_news = $data['news_breaks'] == "y" ? nl2br(stripslashes($data['news_news'])) : stripslashes($data['news_news']);
$query = dbquery("SELECT news_cat_image FROM ".DB_NEWS_CATS." WHERE news_cat_id = '".$data['news_cat']."'");
$cat = dbarray($query);
echo "<table width='100%' cellpadding='0' cellspacing='0' style='border-top:1px #ccc dotted;' />\n";
echo "<tr>\n<td valign=top>\n";
echo "<img src='".IMAGES."news_cats/".$cat['news_cat_image']."' alt='".$data['news_cat_name']."' align='left' style='border:0px;margin-top:3px;margin-right:5px' /></a></td>\n";
echo "<td valign=top>\n";
echo "<a href='".BASEDIR."naujienos.php?skaityti=".$data['news_id']."' title='".$data['news_subject']."' class='slink'> <b>".trimlink($data[news_subject], 100)."</b></a>\n<br />\n";
echo "<i><u> Para&#240;yta: ".showdate("%Y %m %d", $data['news_datestamp'])."&nbsp;\n";
echo "Komentarai: ".dbcount("(comment_id)", DB_COMMENTS, "comment_type='N' AND comment_item_id='".$data['news_id']."'");
echo " Skait&#235;: ".$data['news_reads']."</a></i></u><br /><br />";
echo $data['news_breaks'] == "y" ? nl2br(stripslashes($data['news_news'])) : stripslashes($data['news_news'])."</td>";
echo "</tr></table>\n";
echo "<br />\n";
   }   
$result3 = dbquery("SELECT * FROM ".DB_PREFIX."news WHERE ".groupaccess('news_visibility')." AND (news_start='0' || news_start<='".time()."') AND (news_end='0'||news_end>='".time()."') ORDER BY news_datestamp DESC LIMIT 4,5");
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
while ($data = dbarray($result3)) {
$comments_n = dbcount("(comment_id)", DB_COMMENTS, "comment_type='N' AND comment_item_id='".$data['news_id']."'");
echo "<tr>\n<td class='small2' style='border-top:1px #ccc dotted;'>\n";
echo "<img src='".THEME."images/bullet.gif'> ".showdate("%Y %m %d", $data['news_datestamp'])." </span>\n";
echo "<a href='".BASEDIR."naujienos.php?skaityti=".$data['news_id']."'><b>".trimlink($data[news_subject], 100)." </b></a>\n";
echo " [".$data['news_reads']." | ".$comments_n."] </td>\n";
echo "</tr>\n";
}
echo "<tr><td class='small2' style='border-top:1px #ccc dotted;'>\n";
echo "<a href='".BASEDIR."naujienos.php?visos'> Visos naujienos</a>\n";
echo " - <a href='".BASEDIR."news_cats.php'> Naujienu kategorijos</a></td>\n";
echo "</tr>\n";
echo "</table>\n";
}
closeside();
   }
} else {
openside("Naujienu nera");
echo "Naujienu nera";
closeside();
   }
} else {
   include INCLUDES."comments_include.php";
   include INCLUDES."ratings_include.php";
$result = dbquery(
      "SELECT tn.*, user_id, user_name FROM ".DB_NEWS." tn
      LEFT JOIN ".DB_USERS." tu ON tn.news_name=tu.user_id
      WHERE news_id='".$_GET['skaityti']."'"
   );
   if (dbrows($result)!=0) {
      $data = dbarray($result);
      if (checkgroup($data['news_visibility'])) {
         $news_cat_image = "";
if (!isset($_POST['post_comment']) && !isset($_POST['post_rating'])) {
$result2 = dbquery("UPDATE ".DB_NEWS." SET news_reads=news_reads+1 WHERE news_id='".$_GET['skaityti']."'");
             $data['news_reads']++;
         }
         $news_subject = $data['news_subject'];
         if ($data['news_cat'] != 0) {
            $result2 = dbquery("SELECT * FROM ".DB_NEWS_CATS." WHERE news_cat_id='".$data['news_cat']."'");
            if (dbrows($result2)) {
               $data2 = dbarray($result2);
$news_cat_image = "<a href='news_cats.php?cat_id=".$data2['news_cat_id']."'>
<img src='".IMAGES_NC.$data2['news_cat_image']."' alt='".$data2['news_cat_name']."' align='left' style='border:0px;margin-top:3px;margin-right:5px'></a>\n";
            }
         }
         $news_news = stripslashes($data['news_extended'] ? $data['news_extended'] : $data['news_news']);
         if ($data['news_breaks'] == "y") { $news_news = nl2br($news_news); }
         if ($news_cat_image != "") $news_news = $news_cat_image.$news_news;
         $news_info = array(
            "news_id" => $data['news_id'],
            "user_id" => $data['user_id'],
            "user_name" => $data['user_name'],
            "news_date" => $data['news_datestamp'],
            "news_ext" => "n",
            "news_reads" => $data['news_reads'],
            "news_comments" => dbcount("(comment_id)", DB_COMMENTS, "comment_type='N' AND comment_item_id='".$data['news_id']."'"),
            "news_allow_comments" => $data['news_allow_comments']
         );
         render_news($news_subject, $news_news, $news_info);
         if ($data['news_allow_comments']) showcomments("N",DB_NEWS,"news_id",$_GET['skaityti'],FUSION_SELF."?skaityti=".$_GET['skaityti']."");
if ($data['news_allow_ratings']) showratings("N",$_GET['skaityti'],FUSION_SELF."?skaityti='".$_GET['skaityti']."'");
      } else {
         redirect(FUSION_SELF);
      }
   } else {
      redirect(FUSION_SELF);
   }
}
require_once THEMES."templates/footer.php";
?>





Gal kas moka sutvarkyti ar galėtų pasakyti kur problema jei ne kode?