Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Readarcticle.php klaidos

Parašė Wiav· 2009 Spa. 28 19:10:52
#1

Sveiki, nesuprantu "error" kame problema?

Fatal error: Call to undefined function render_article() in /home/folnin/domains/valdorfas.noriu.net/public_html/tinklapis/readarticle.php on line 47




Readarticle.php (failas)
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
require_once INCLUDES."comments_include.php";
require_once INCLUDES."ratings_include.php";

if (!isset($article_id) || !isNum($article_id)) fallback("index.php");
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;

$result = dbquery(
   "SELECT ta.*,tac.*, tu.user_id,user_name FROM ".$db_prefix."articles ta
   INNER JOIN ".$db_prefix."article_cats tac ON ta.article_cat=tac.article_cat_id
   LEFT JOIN ".$db_prefix."users tu ON ta.article_name=tu.user_id
   WHERE article_id='$article_id'"
);
$res = 0;
if (dbrows($result) != 0) {
   $data = dbarray($result);
   if (checkgroup($data['article_cat_access'])) {
      $res = 1;
      if ($rowstart == 0) $result = dbquery("UPDATE ".$db_prefix."articles SET article_reads=article_reads+1 WHERE article_id='$article_id'");
      $article = stripslashes($data['article_article']);
      $article = explode("<--PAGEBREAK-->", $article);
      $pagecount = count($article);
      $article_subject = stripslashes($data['article_subject']);
      $article_info = array(
         "article_id" => $data['article_id'],
         "user_id" => $data['user_id'],
         "user_name" => $data['user_name'],
         "article_date" => $data['article_datestamp'],
         "article_breaks" => $data['article_breaks'],
         "article_comments" => dbcount("(comment_id)", "comments", "comment_type='A' AND comment_item_id='".$data['article_id']."'"),
         "article_reads" => $data['article_reads'],
         "article_allow_comments" => $data['article_allow_comments']
      );
      render_article($article_subject, $article[$rowstart], $article_info);
      if (count($article) > 1) {
         $rows = $pagecount;
         echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,1,$rows,3,FUSION_SELF."?article_id=$article_id&amp;")."\n</div>\n";
      }
      if ($data['article_allow_comments']) showcomments("A","articles","article_id",$article_id,FUSION_SELF."?article_id=$article_id");
      if ($data['article_allow_ratings']) showratings("A",$article_id,FUSION_SELF."?article_id=$article_id");
   }
}
if ($res == 0) redirect("articles.php");

require_once "side_right.php";
require_once "footer.php";
?>



Redagavo Wiav· 2009 Spa. 28 20:10:09

Parašė Pakartoti slaptažodį· 2009 Spa. 28 20:10:35
#2

Neranda funkcijos render_article() pas tave theme.php. :)

Parašė Wiav· 2009 Spa. 28 20:10:46
#3

Kaip man reiktų tą funkciją įterpti?

Themes.php(failais)
?php
////
// Made by Qrmiz 2008
////

if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }
require_once INCLUDES."theme_functions_include.php";

// temos nustatymai
$body_text = "#000000";
$body_bg = "#FFFFFF";
$theme_width = "631";
$theme_width_l = "170";
$theme_width_r = "170";

function render_header($header_content) {
global $theme_width,$settings;
   /// HEADERIS START
   echo "<table width='$theme_width' border='0' cellspacing='0' cellpadding='0' align='center'><tr>";
   echo "<td class='top'><img src='".THEME."images/ttranc.gif' alt=''></td></tr>";
   echo "<tr><td align='center' class='main-table'><img src='".THEME."images/header.jpg' style='border:1px solid #999999' alt=''>";
   echo "</td></tr></table>";
   /// HEADERIS END --- START MAIN TABLE
   echo "<table align='center' width='$theme_width' cellspacing='0' cellpadding='0' border='0' class='main-table'>";
   echo "<tr><td>";
   /// START SUBLINKS
   echo "<br><table width='614' border='0' cellpadding='0' cellspacing='0' class='sublinks' align='center'><tr><td height='41' align='center'><a href='".BASEDIR."news.php' class='sublinks'>Naujienos</a></td><td><img src='".THEME."images/dots.gif' alt=''></td>\n";
   echo "<td align='center'><a href='".BASEDIR."viewpage.php?page_id=2' class='sublinks'>Apie mus</a></td><td><img src='".THEME."images/dots.gif' alt=''></td><td align='center'><a href='".BASEDIR."photogallery.php' class='sublinks'>Galerija</a></td><td><img src='".THEME."images/dots.gif' alt=''></td><td align='center'><a href='".FORUM."index.php' class='sublinks'>Forumas</a></td><td><img src='".THEME."images/dots.gif' alt=''></td><td align='center'><a href='".BASEDIR."contact.php' class='sublinks'>Kontaktai</a></td></tr></table>";
   /// END SUBLINKS
   echo "<table width='100%' cellspacing='5' cellpadding='0' align='center'>\n<tr>\n";
}

function render_footer($license=false) {
global $theme_width,$locale,$settings;
   echo "</tr>\n</table></td></tr></table></td></tr></table>";
   echo "<table width='$theme_width' border='0' cellspacing='0' cellpadding='0' align='center'><tr>";
   echo "<td class='bot'><img src='".THEME."images/ttranc.gif' alt=''></td></tr></table>";
}

function render_news($subject, $news, $info) {
global $locale, $news_info;
   
   echo "<table width='100%' cellpadding='0' cellspacing='0' align='center'><tr>";
   echo "<td width='40' align='center'><img src='".THEME."images/nicon.gif' border='0' alt=''></td><td width='100%' class='nsub'>".showdate("%Y %m %d", $news_info['news_date'])." $subject</td>";
   echo "</tr><tr>";
   echo "<td class='news-body' colspan='2'>$news";
   echo " ".($info['news_ext'] == "y" ? "<a href='news.php?readmore=".$info['news_id']."'>Plačiau...\n" : "")."</td>";
   echo "</tr></table>\n";
}

function opentable($title) {
   echo "<table width='100%' cellpadding='0' cellspacing='0' align='center'>";
   echo "<tr><td><img src='".THEME."images/bullet.gif' border='0' alt=''></td><td width='100%' class='panel-main2'>$title</td>";
   echo "</tr><tr>";
   echo "<td class='table-body' colspan='2'>\n";
}

function closetable() {
   echo "</td></tr></table>\n";
}


function openside($title) {
   echo "<table width='100%' cellpadding='0' cellspacing='0' class='sidetbl'><tr>";
   echo "<td width='100%' class='panel-main'>$title</td></tr><tr>";
   echo "<td class='side-body'>\n";
}

function closeside() {
   echo "</td></tr></table>";
   tablebreak();
}


function tablebreak() {
   echo "<table width='100%' cellspacing='2' cellpadding='2'>";
   echo "<tr><td></td></tr></table>\n";
}
?>



Redagavo Wiav· 2009 Spa. 28 20:10:06

Parašė Pakartoti slaptažodį· 2009 Spa. 28 20:10:44
#4

function render_article($subject, $article, $info) {
   
echo "<table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td class='capmain'>$subject</td>
</tr>
<tr>
<td class='main-body'>
".($info['article_breaks'] == "y" ? nl2br($article) : $article)."
</td>
</tr>
<tr>
<td align='center' class='news-footer'>\n";
echo openform("A",$info['article_id']).articleposter($info," &middot;").articleopts($info,"&middot;").closeform("A",$info['article_id']);
echo "</td>
</tr>
</table>\n";

}



Parašė Wiav· 2009 Spa. 28 20:10:44
#5

Dabar atsirado "error"

Parse error: syntax error, unexpected T_STRING in /home/folnin/domains/valdorfas.noriu.net/public_html/tinklapis/themes/Personal/theme.php on line 94




Gal blogai įterpiau?
<?php
////
// Made by Qrmiz 2008
////

if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }
require_once INCLUDES."theme_functions_include.php";

// temos nustatymai
$body_text = "#000000";
$body_bg = "#FFFFFF";
$theme_width = "631";
$theme_width_l = "170";
$theme_width_r = "170";

function render_header($header_content) {
global $theme_width,$settings;
   /// HEADERIS START
   echo "<table width='$theme_width' border='0' cellspacing='0' cellpadding='0' align='center'><tr>";
   echo "<td class='top'><img src='".THEME."images/ttranc.gif' alt=''></td></tr>";
   echo "<tr><td align='center' class='main-table'><img src='".THEME."images/header.jpg' style='border:1px solid #999999' alt=''>";
   echo "</td></tr></table>";
   /// HEADERIS END --- START MAIN TABLE
   echo "<table align='center' width='$theme_width' cellspacing='0' cellpadding='0' border='0' class='main-table'>";
   echo "<tr><td>";
   /// START SUBLINKS
   echo "<br><table width='614' border='0' cellpadding='0' cellspacing='0' class='sublinks' align='center'><tr><td height='41' align='center'><a href='".BASEDIR."news.php' class='sublinks'>Naujienos</a></td><td><img src='".THEME."images/dots.gif' alt=''></td>\n";
   echo "<td align='center'><a href='".BASEDIR."viewpage.php?page_id=2' class='sublinks'>Apie mus</a></td><td><img src='".THEME."images/dots.gif' alt=''></td><td align='center'><a href='".BASEDIR."photogallery.php' class='sublinks'>Galerija</a></td><td><img src='".THEME."images/dots.gif' alt=''></td><td align='center'><a href='".FORUM."index.php' class='sublinks'>Forumas</a></td><td><img src='".THEME."images/dots.gif' alt=''></td><td align='center'><a href='".BASEDIR."contact.php' class='sublinks'>Kontaktai</a></td></tr></table>";
   /// END SUBLINKS
   echo "<table width='100%' cellspacing='5' cellpadding='0' align='center'>\n<tr>\n";
}

function render_footer($license=false) {
global $theme_width,$locale,$settings;
   echo "</tr>\n</table></td></tr></table></td></tr></table>";
   echo "<table width='$theme_width' border='0' cellspacing='0' cellpadding='0' align='center'><tr>";
   echo "<td class='bot'><img src='".THEME."images/ttranc.gif' alt=''></td></tr></table>";
}

function render_news($subject, $news, $info) {
global $locale, $news_info;
   
   echo "<table width='100%' cellpadding='0' cellspacing='0' align='center'><tr>";
   echo "<td width='40' align='center'><img src='".THEME."images/nicon.gif' border='0' alt=''></td><td width='100%' class='nsub'>".showdate("%Y %m %d", $news_info['news_date'])." $subject</td>";
   echo "</tr><tr>";
   echo "<td class='news-body' colspan='2'>$news";
   echo " ".($info['news_ext'] == "y" ? "<a href='news.php?readmore=".$info['news_id']."'>Plačiau...\n" : "")."</td>";
   echo "</tr></table>\n";
}

function opentable($title) {
   echo "<table width='100%' cellpadding='0' cellspacing='0' align='center'>";
   echo "<tr><td><img src='".THEME."images/bullet.gif' border='0' alt=''></td><td width='100%' class='panel-main2'>$title</td>";
   echo "</tr><tr>";
   echo "<td class='table-body' colspan='2'>\n";
}

function closetable() {
   echo "</td></tr></table>\n";
}


function openside($title) {
   echo "<table width='100%' cellpadding='0' cellspacing='0' class='sidetbl'><tr>";
   echo "<td width='100%' class='panel-main'>$title</td></tr><tr>";
   echo "<td class='side-body'>\n";
}

function closeside() {
   echo "</td></tr></table>";
   tablebreak();
}


function tablebreak() {
   echo "<table width='100%' cellspacing='2' cellpadding='2'>";
   echo "<tr><td></td></tr></table>\n";
}


function render_article($subject, $article, $info) {
   
echo "<table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td class='capmain'>$subject</td>
</tr>
<tr>
<td class='main-body'>
".($info['article_breaks'] == "y" ? nl2br($article) : $article)."
</td>
</tr>
<tr>
<td align='center' class='news-footer'>\n";
echo openform("A",$info['article_id']).articleposter($info," &middot;"merkia akį.articleopts($info,"&middot;"merkia akį.closeform("A",$info['article_id']);
echo "</td>
</tr>
</table>\n";

}
?>



Redagavo Wiav· 2009 Spa. 28 20:10:19

Parašė Pakartoti slaptažodį· 2009 Spa. 28 20:10:06
#6

Vnž išsiimk iš similitude tą f-iją ir įdėk po render_news() f-ijos. :)

Parašė Wiav· 2009 Spa. 28 20:10:08
#7

Ačiū, kad padėjai. Rakinam.

Parašė maxas66· 2009 Spa. 28 20:10:39
#8

Yra funkcija, pats gali užrakint ;]