something is wrong and i cant figure out what it is...
- Cae
- Expert


- Joined: Feb 25, 2004
- Posts: 734
- Status: Offline
well, im using these dynamic news php scripts on the site for my guild in EVE, and they arent working right...
the site is at http://www.lunarossacorp.com/index.php you need to use the 'index.php' part becasue right now i have it directed somewhere else...
anyways, the page has a php tag in it <? include("znews/view.php") ?> and as you can see if you went to the page, it throws up an error...
however, if you goto the view.php page itself here: http://www.lunarossacorp.com/znews/view.php there is no error... there is no other php stuff on the index page right now...
any ideas?
the site is at http://www.lunarossacorp.com/index.php you need to use the 'index.php' part becasue right now i have it directed somewhere else...
anyways, the page has a php tag in it <? include("znews/view.php") ?> and as you can see if you went to the page, it throws up an error...
however, if you goto the view.php page itself here: http://www.lunarossacorp.com/znews/view.php there is no error... there is no other php stuff on the index page right now...
any ideas?
- Anonymous
- Bot


- Joined: 25 Feb 2008
- Posts: ?
- Loc: Ozzuland
- Status: Online
April 11th, 2004, 8:23 pm
- GrimShadow
- Newbie


- Joined: Apr 12, 2004
- Posts: 6
- Loc: Chandler, Oklahoma
- Status: Offline
- Scorpius
- Proficient


- Joined: Mar 20, 2004
- Posts: 401
- Loc: Scorpion Hole
- Status: Offline
Ok, what I'm betting that it is, is that view.php has to require a configuration file, something like mysql.inc.php or something. And it is not configured to use that directory, just mysql.inc.php, you can either manually change that or get a different script. One that I've used and is a very good script is Utopia News Pro. http://www.utopiasoftware.net/newspro/index.php
But if you would want that news script, just post the view.php file and I'll see what I can do.
But if you would want that news script, just post the view.php file and I'll see what I can do.
- VentsyV
- Student


- Joined: Apr 09, 2004
- Posts: 65
- Status: Offline
- Cae
- Expert


- Joined: Feb 25, 2004
- Posts: 734
- Status: Offline
sorry, forgot i posted this here...
and no, i still havent gotten it to work yet...
yes
yes it does, and it has been configured...
no i dont, but its not my code, and i have used the same code on another site, and it works fine... you can get it <a href = "http://www.zubaz.net/znews/download.php">HERE</a> if youd like to look at it...
i might just switch to this... this znews crap is ticking me off... ill let you all know...
Quote:
do you have "znews/view.php" as a valid path from your home folder ?
yes
Quote:
view.php has to require a configuration file
yes it does, and it has been configured...
Quote:
mind tossing up the code that your using on the view.php page so I can see if I can help?
no i dont, but its not my code, and i have used the same code on another site, and it works fine... you can get it <a href = "http://www.zubaz.net/znews/download.php">HERE</a> if youd like to look at it...
Quote:
I've used and is a very good script is Utopia News Pro
i might just switch to this... this znews crap is ticking me off... ill let you all know...
- Cae
- Expert


- Joined: Feb 25, 2004
- Posts: 734
- Status: Offline
- rjstephens
- Professor


- Joined: Jul 28, 2003
- Posts: 774
- Loc: Brisbane, Australia
- Status: Offline
- Cae
- Expert


- Joined: Feb 25, 2004
- Posts: 734
- Status: Offline
- Scorpius
- Proficient


- Joined: Mar 20, 2004
- Posts: 401
- Loc: Scorpion Hole
- Status: Offline
Ok, well I think I might know the problem. I looked at the news.php file from Utopia news, and line 10 is when it is trying to require functions.inc.php, but it cant find it. Try to change
to
Hope that'll work for you.
Code: [ Select ]
require('functions.inc.php');
to
Code: [ Select ]
require('news/functions.inc.php');
Hope that'll work for you.
- Cae
- Expert


- Joined: Feb 25, 2004
- Posts: 734
- Status: Offline
- Scorpius
- Proficient


- Joined: Mar 20, 2004
- Posts: 401
- Loc: Scorpion Hole
- Status: Offline
- Cae
- Expert


- Joined: Feb 25, 2004
- Posts: 734
- Status: Offline
sorry, i was typing fast... its view.php
the include code is
<? include(znews/view.php); ?>
here is the code for view.php:
there ya go....
the include code is
<? include(znews/view.php); ?>
here is the code for view.php:
Code: [ Select ]
<?php
@include_once("db_include.php");
?>
<? //DISPLAY NEWS
$glob = $tableprefix."_globalvars";
$gquery = mysql_query("SELECT * FROM `$glob` ");
while ($var = mysql_fetch_array($gquery)) {
$variable = $var[variable];
$value = $var[value];
$gvars[$variable] = $value;
}
$gvars[supervars][htmlnews] = true;
$months= array( '1' => 'January',
'2' => 'February',
'3' => 'March',
'4' => 'April',
'5' => 'May',
'6' => 'June',
'7' => 'July',
'8' => 'August',
'9' => 'September',
'10' => 'October',
'11' => 'November',
'12' => 'December');
$monthnumdays = array( '1' => '31',
'2' => '28',
'3' => '31',
'4' => '30',
'5' => '31',
'6' => '30',
'7' => '31',
'8' => '31',
'9' => '30',
'10' => '31',
'11' => '30',
'12' => '31');
if ($gvars[newsaging] == "3") {
$backlim = $gvars[maxnewsnum];
$lim = "LIMIT 0,$backlim ";
$where = "WHERE 1";
}
if ($gvars[newsaging] == "2") {
$maxage = explode(":", $gvars[maxnewsage]);
$timestamp = time();
$timestamp -= (($maxage[0] * 86400) + (($maxage[1] + $gvars[timeshift]) * 3600));
$dquery = mysql_query("SELECT FROM_UNIXTIME($timestamp)");
$servert = mysql_result($dquery, 0);
$threshdate = $servert;
$where = "WHERE `date`>'$threshdate'";
}
if ($gvars[newsaging] == "1") {
$where = "WHERE `current`='yes'";
}
if (!empty($date)) {
$where .= " AND date BETWEEN '$date 00:00:00' AND '$date 23:59:59'";
}
if (!empty($cat)) {
$where .= " AND category='$cat'";
$notDefaultTemp = true;
}
if (!empty($id)) {
$where = "WHERE `id`='$id'";
}
if ($mode == "showall") {
$where = "WHERE 1";
$lim = '';
}
//SIG
echo "<!-- News Generated by ZNews 3.0 (http://zubaz.net/znews) -->\n";
//IS THERE NEWS?
$newscount = mysql_query("SELECT COUNT(*) FROM `$gvars[tablename]_posts` $where ");
$ncount = mysql_result($newscount,0,0);
if($ncount != 0) {
//NEWS
$nquery = mysql_query("SELECT * FROM `$gvars[tablename]_posts` $where ORDER BY `date` DESC $lim");
while ($post = mysql_fetch_array($nquery)) {
// HANDLE DATE
$data=explode(" ", "$post[date]");
$actualdatearray=explode("-", "$data[0]");
$actualtimearray=explode(":", "$data[1]");
$hour=$actualtimearray[0] + $gvars[timeshift]; //the minus 0 is the time offset, change that according to your difference from your server
$tod="am";
$month=$actualdatearray[1];
$month++;
$month--;
$actualdatearray[2]++;
$actualdatearray[2]--;
if ($hour==12) {
$tod="pm";
}
if ($hour<=0) {
$hour = $hour + 12;
$tod="pm";
if ($hour==12) {
$tod="am";
}
$actualdatearray[2] = $actualdatearray[2] - 1;
if ($actualdatearray[2] == 0) { // this should fix the month and year from the time difference
$month = $month - 1;
if ($actualdatearray[0] % 4 == 0) { $monthnumdays[2] = '29'; } // leap year check
$actualdatearray[2] = $monthnumdays[$month];
if ($month == 0) {
$actualdatearray[0] = $actualdatearray[0] - 1;
$month = 12;
}
}
} elseif ($hour>12) {
$hour = $hour - 12;
$tod="pm";
}
// GET CATEGORY
if ($gvars[categories]=="1") {
$catquery = mysql_query("SELECT * FROM `$gvars[tablename]_categories` WHERE `name`='$post[category]' ");
$cat = mysql_fetch_array($catquery);
}
// GET TEMPLATE
if(!empty($cat[template])) {
$tempname = $cat[template];
} else {
$tempname = "default";
}
$tempquery = mysql_query("SELECT * FROM `$gvars[tablename]_templates` WHERE `name`='$tempname' ");
$templateArray = mysql_fetch_array($tempquery);
$template = $templateArray[template];
// GET AUTHOR DATA
$aquery=mysql_query("SELECT * FROM `$gvars[tablename]_users` WHERE `username`='$post[author]' ");
$autharray=mysql_fetch_array($aquery);
// REPLACE COMPONENTS
$template=str_replace("[MONTH]", $months[$month], $template);
$template=str_replace("[M#]", $month, $template);
$template=str_replace("[DAY]", $actualdatearray[2], $template);
$template=str_replace("[YEAR]", $actualdatearray[0], $template);
$template=str_replace("[TIME]", "$hour:$actualtimearray[1]", $template);
$template=str_replace("[TOD]", $tod, $template);
$template=str_replace("[TITLE]", $post[title], $template);
$template=str_replace("[AUTHOR]", $autharray[username], $template);
if ($gvars[abstracting]=="1") {
$template=str_replace("[ABSTRACT]", $post[abstract], $template);
}
$news = $post[post];
//REPLACERS
if ($gvars[replacers] == "1") {
$replacerquery=mysql_query("SELECT * FROM `$gvars[tablename]_replacers` ");
while($r=mysql_fetch_array($replacerquery)) { //this is the replacer function
$news=str_replace($r[before], $r[after], $news);
}
}
//ZFormatting
if (!$gvars[supervars][htmlnews]) {
$news = str_replace ("<", "<", $news);
$news = str_replace (">", ">", $news);
}
$news = preg_replace ("/\[B\](.*)\[\/B\]/siU", "<B>\\1</B>", $news);
$news = preg_replace ("/\[U\](.*)\[\/U\]/siU", "<U>\\1</U>", $news);
$news = preg_replace ("/\[I\](.*)\[\/I\]/siU", "<I>\\1</I>", $news);
$news = preg_replace ("/\[IMG\](http:\/\/[a-z0-9\/\\._\-\?\&= ]+)\[\/IMG\]/siU", "<IMG SRC=\"\\1\" ALT=\"\">", $news);
$news = preg_replace ("/\[URL\](http:\/\/[a-z0-9\/\\._\-\?\&= ]+)\[\/URL\]/siU", "<A HREF=\"\\1\" TARGET=\"_BLANK\">\\1</A>", $news);
$news = preg_replace ("/\[URL=(http:\/\/[a-z0-9\/\\._\-\?\&= ]+)\](.*)\[\/URL\]/siU", "<A HREF=\"\\1\" TARGET=\"_BLANK\">\\2</A>", $news);
$news = preg_replace ("/\[COLOR=(.*)\](.*)\[\/COLOR\]/siU", "<FONT COLOR=\"\\1\">\\2</FONT>", $news);
$template = str_replace("[POST]", nl2br($news), $template);
$template=str_replace("[AUTHEMAIL]", $autharray[email], $template);
$template=str_replace("[IDPICTUREURL]", $autharray[idpic], $template);
$template=str_replace("[SIGPICTUREURL]", $autharray[sigpic], $template);
$template=str_replace("[CATSHORT]", $cat[name], $template);
$template=str_replace("[CATEGORY]", $cat[fullname], $template);
if ($gvars[commenting]!="off") { $template=str_replace("[COMMENTSURL]", "comments.php?commentto=$post[id]", $template); }
//Count the comments
$comcount = mysql_query("SELECT COUNT(*) FROM `$gvars[tablename]_comments` WHERE `commentto`='$post[id]' ");
$comcount_result = mysql_result($comcount,0,0);
$template=str_replace("[COMMENTNUM]", $comcount_result, $template);
//NEWS OUTPUT
echo $template;
//SIG
echo "<!-- News Generated by ZNews 3.0 (http://zubaz.net/znews) -->\n";
}
} else {
echo "No news found.";
}
?>
@include_once("db_include.php");
?>
<? //DISPLAY NEWS
$glob = $tableprefix."_globalvars";
$gquery = mysql_query("SELECT * FROM `$glob` ");
while ($var = mysql_fetch_array($gquery)) {
$variable = $var[variable];
$value = $var[value];
$gvars[$variable] = $value;
}
$gvars[supervars][htmlnews] = true;
$months= array( '1' => 'January',
'2' => 'February',
'3' => 'March',
'4' => 'April',
'5' => 'May',
'6' => 'June',
'7' => 'July',
'8' => 'August',
'9' => 'September',
'10' => 'October',
'11' => 'November',
'12' => 'December');
$monthnumdays = array( '1' => '31',
'2' => '28',
'3' => '31',
'4' => '30',
'5' => '31',
'6' => '30',
'7' => '31',
'8' => '31',
'9' => '30',
'10' => '31',
'11' => '30',
'12' => '31');
if ($gvars[newsaging] == "3") {
$backlim = $gvars[maxnewsnum];
$lim = "LIMIT 0,$backlim ";
$where = "WHERE 1";
}
if ($gvars[newsaging] == "2") {
$maxage = explode(":", $gvars[maxnewsage]);
$timestamp = time();
$timestamp -= (($maxage[0] * 86400) + (($maxage[1] + $gvars[timeshift]) * 3600));
$dquery = mysql_query("SELECT FROM_UNIXTIME($timestamp)");
$servert = mysql_result($dquery, 0);
$threshdate = $servert;
$where = "WHERE `date`>'$threshdate'";
}
if ($gvars[newsaging] == "1") {
$where = "WHERE `current`='yes'";
}
if (!empty($date)) {
$where .= " AND date BETWEEN '$date 00:00:00' AND '$date 23:59:59'";
}
if (!empty($cat)) {
$where .= " AND category='$cat'";
$notDefaultTemp = true;
}
if (!empty($id)) {
$where = "WHERE `id`='$id'";
}
if ($mode == "showall") {
$where = "WHERE 1";
$lim = '';
}
//SIG
echo "<!-- News Generated by ZNews 3.0 (http://zubaz.net/znews) -->\n";
//IS THERE NEWS?
$newscount = mysql_query("SELECT COUNT(*) FROM `$gvars[tablename]_posts` $where ");
$ncount = mysql_result($newscount,0,0);
if($ncount != 0) {
//NEWS
$nquery = mysql_query("SELECT * FROM `$gvars[tablename]_posts` $where ORDER BY `date` DESC $lim");
while ($post = mysql_fetch_array($nquery)) {
// HANDLE DATE
$data=explode(" ", "$post[date]");
$actualdatearray=explode("-", "$data[0]");
$actualtimearray=explode(":", "$data[1]");
$hour=$actualtimearray[0] + $gvars[timeshift]; //the minus 0 is the time offset, change that according to your difference from your server
$tod="am";
$month=$actualdatearray[1];
$month++;
$month--;
$actualdatearray[2]++;
$actualdatearray[2]--;
if ($hour==12) {
$tod="pm";
}
if ($hour<=0) {
$hour = $hour + 12;
$tod="pm";
if ($hour==12) {
$tod="am";
}
$actualdatearray[2] = $actualdatearray[2] - 1;
if ($actualdatearray[2] == 0) { // this should fix the month and year from the time difference
$month = $month - 1;
if ($actualdatearray[0] % 4 == 0) { $monthnumdays[2] = '29'; } // leap year check
$actualdatearray[2] = $monthnumdays[$month];
if ($month == 0) {
$actualdatearray[0] = $actualdatearray[0] - 1;
$month = 12;
}
}
} elseif ($hour>12) {
$hour = $hour - 12;
$tod="pm";
}
// GET CATEGORY
if ($gvars[categories]=="1") {
$catquery = mysql_query("SELECT * FROM `$gvars[tablename]_categories` WHERE `name`='$post[category]' ");
$cat = mysql_fetch_array($catquery);
}
// GET TEMPLATE
if(!empty($cat[template])) {
$tempname = $cat[template];
} else {
$tempname = "default";
}
$tempquery = mysql_query("SELECT * FROM `$gvars[tablename]_templates` WHERE `name`='$tempname' ");
$templateArray = mysql_fetch_array($tempquery);
$template = $templateArray[template];
// GET AUTHOR DATA
$aquery=mysql_query("SELECT * FROM `$gvars[tablename]_users` WHERE `username`='$post[author]' ");
$autharray=mysql_fetch_array($aquery);
// REPLACE COMPONENTS
$template=str_replace("[MONTH]", $months[$month], $template);
$template=str_replace("[M#]", $month, $template);
$template=str_replace("[DAY]", $actualdatearray[2], $template);
$template=str_replace("[YEAR]", $actualdatearray[0], $template);
$template=str_replace("[TIME]", "$hour:$actualtimearray[1]", $template);
$template=str_replace("[TOD]", $tod, $template);
$template=str_replace("[TITLE]", $post[title], $template);
$template=str_replace("[AUTHOR]", $autharray[username], $template);
if ($gvars[abstracting]=="1") {
$template=str_replace("[ABSTRACT]", $post[abstract], $template);
}
$news = $post[post];
//REPLACERS
if ($gvars[replacers] == "1") {
$replacerquery=mysql_query("SELECT * FROM `$gvars[tablename]_replacers` ");
while($r=mysql_fetch_array($replacerquery)) { //this is the replacer function
$news=str_replace($r[before], $r[after], $news);
}
}
//ZFormatting
if (!$gvars[supervars][htmlnews]) {
$news = str_replace ("<", "<", $news);
$news = str_replace (">", ">", $news);
}
$news = preg_replace ("/\[B\](.*)\[\/B\]/siU", "<B>\\1</B>", $news);
$news = preg_replace ("/\[U\](.*)\[\/U\]/siU", "<U>\\1</U>", $news);
$news = preg_replace ("/\[I\](.*)\[\/I\]/siU", "<I>\\1</I>", $news);
$news = preg_replace ("/\[IMG\](http:\/\/[a-z0-9\/\\._\-\?\&= ]+)\[\/IMG\]/siU", "<IMG SRC=\"\\1\" ALT=\"\">", $news);
$news = preg_replace ("/\[URL\](http:\/\/[a-z0-9\/\\._\-\?\&= ]+)\[\/URL\]/siU", "<A HREF=\"\\1\" TARGET=\"_BLANK\">\\1</A>", $news);
$news = preg_replace ("/\[URL=(http:\/\/[a-z0-9\/\\._\-\?\&= ]+)\](.*)\[\/URL\]/siU", "<A HREF=\"\\1\" TARGET=\"_BLANK\">\\2</A>", $news);
$news = preg_replace ("/\[COLOR=(.*)\](.*)\[\/COLOR\]/siU", "<FONT COLOR=\"\\1\">\\2</FONT>", $news);
$template = str_replace("[POST]", nl2br($news), $template);
$template=str_replace("[AUTHEMAIL]", $autharray[email], $template);
$template=str_replace("[IDPICTUREURL]", $autharray[idpic], $template);
$template=str_replace("[SIGPICTUREURL]", $autharray[sigpic], $template);
$template=str_replace("[CATSHORT]", $cat[name], $template);
$template=str_replace("[CATEGORY]", $cat[fullname], $template);
if ($gvars[commenting]!="off") { $template=str_replace("[COMMENTSURL]", "comments.php?commentto=$post[id]", $template); }
//Count the comments
$comcount = mysql_query("SELECT COUNT(*) FROM `$gvars[tablename]_comments` WHERE `commentto`='$post[id]' ");
$comcount_result = mysql_result($comcount,0,0);
$template=str_replace("[COMMENTNUM]", $comcount_result, $template);
//NEWS OUTPUT
echo $template;
//SIG
echo "<!-- News Generated by ZNews 3.0 (http://zubaz.net/znews) -->\n";
}
} else {
echo "No news found.";
}
?>
- <?php
- @include_once("db_include.php");
- ?>
- <? //DISPLAY NEWS
- $glob = $tableprefix."_globalvars";
- $gquery = mysql_query("SELECT * FROM `$glob` ");
- while ($var = mysql_fetch_array($gquery)) {
- $variable = $var[variable];
- $value = $var[value];
- $gvars[$variable] = $value;
- }
- $gvars[supervars][htmlnews] = true;
- $months= array( '1' => 'January',
- '2' => 'February',
- '3' => 'March',
- '4' => 'April',
- '5' => 'May',
- '6' => 'June',
- '7' => 'July',
- '8' => 'August',
- '9' => 'September',
- '10' => 'October',
- '11' => 'November',
- '12' => 'December');
- $monthnumdays = array( '1' => '31',
- '2' => '28',
- '3' => '31',
- '4' => '30',
- '5' => '31',
- '6' => '30',
- '7' => '31',
- '8' => '31',
- '9' => '30',
- '10' => '31',
- '11' => '30',
- '12' => '31');
- if ($gvars[newsaging] == "3") {
- $backlim = $gvars[maxnewsnum];
- $lim = "LIMIT 0,$backlim ";
- $where = "WHERE 1";
- }
- if ($gvars[newsaging] == "2") {
- $maxage = explode(":", $gvars[maxnewsage]);
- $timestamp = time();
- $timestamp -= (($maxage[0] * 86400) + (($maxage[1] + $gvars[timeshift]) * 3600));
- $dquery = mysql_query("SELECT FROM_UNIXTIME($timestamp)");
- $servert = mysql_result($dquery, 0);
- $threshdate = $servert;
- $where = "WHERE `date`>'$threshdate'";
- }
- if ($gvars[newsaging] == "1") {
- $where = "WHERE `current`='yes'";
- }
- if (!empty($date)) {
- $where .= " AND date BETWEEN '$date 00:00:00' AND '$date 23:59:59'";
- }
- if (!empty($cat)) {
- $where .= " AND category='$cat'";
- $notDefaultTemp = true;
- }
- if (!empty($id)) {
- $where = "WHERE `id`='$id'";
- }
- if ($mode == "showall") {
- $where = "WHERE 1";
- $lim = '';
- }
- //SIG
- echo "<!-- News Generated by ZNews 3.0 (http://zubaz.net/znews) -->\n";
- //IS THERE NEWS?
- $newscount = mysql_query("SELECT COUNT(*) FROM `$gvars[tablename]_posts` $where ");
- $ncount = mysql_result($newscount,0,0);
- if($ncount != 0) {
- //NEWS
- $nquery = mysql_query("SELECT * FROM `$gvars[tablename]_posts` $where ORDER BY `date` DESC $lim");
- while ($post = mysql_fetch_array($nquery)) {
- // HANDLE DATE
- $data=explode(" ", "$post[date]");
- $actualdatearray=explode("-", "$data[0]");
- $actualtimearray=explode(":", "$data[1]");
- $hour=$actualtimearray[0] + $gvars[timeshift]; //the minus 0 is the time offset, change that according to your difference from your server
- $tod="am";
- $month=$actualdatearray[1];
- $month++;
- $month--;
- $actualdatearray[2]++;
- $actualdatearray[2]--;
- if ($hour==12) {
- $tod="pm";
- }
- if ($hour<=0) {
- $hour = $hour + 12;
- $tod="pm";
- if ($hour==12) {
- $tod="am";
- }
- $actualdatearray[2] = $actualdatearray[2] - 1;
- if ($actualdatearray[2] == 0) { // this should fix the month and year from the time difference
- $month = $month - 1;
- if ($actualdatearray[0] % 4 == 0) { $monthnumdays[2] = '29'; } // leap year check
- $actualdatearray[2] = $monthnumdays[$month];
- if ($month == 0) {
- $actualdatearray[0] = $actualdatearray[0] - 1;
- $month = 12;
- }
- }
- } elseif ($hour>12) {
- $hour = $hour - 12;
- $tod="pm";
- }
- // GET CATEGORY
- if ($gvars[categories]=="1") {
- $catquery = mysql_query("SELECT * FROM `$gvars[tablename]_categories` WHERE `name`='$post[category]' ");
- $cat = mysql_fetch_array($catquery);
- }
- // GET TEMPLATE
- if(!empty($cat[template])) {
- $tempname = $cat[template];
- } else {
- $tempname = "default";
- }
- $tempquery = mysql_query("SELECT * FROM `$gvars[tablename]_templates` WHERE `name`='$tempname' ");
- $templateArray = mysql_fetch_array($tempquery);
- $template = $templateArray[template];
- // GET AUTHOR DATA
- $aquery=mysql_query("SELECT * FROM `$gvars[tablename]_users` WHERE `username`='$post[author]' ");
- $autharray=mysql_fetch_array($aquery);
- // REPLACE COMPONENTS
- $template=str_replace("[MONTH]", $months[$month], $template);
- $template=str_replace("[M#]", $month, $template);
- $template=str_replace("[DAY]", $actualdatearray[2], $template);
- $template=str_replace("[YEAR]", $actualdatearray[0], $template);
- $template=str_replace("[TIME]", "$hour:$actualtimearray[1]", $template);
- $template=str_replace("[TOD]", $tod, $template);
- $template=str_replace("[TITLE]", $post[title], $template);
- $template=str_replace("[AUTHOR]", $autharray[username], $template);
- if ($gvars[abstracting]=="1") {
- $template=str_replace("[ABSTRACT]", $post[abstract], $template);
- }
- $news = $post[post];
- //REPLACERS
- if ($gvars[replacers] == "1") {
- $replacerquery=mysql_query("SELECT * FROM `$gvars[tablename]_replacers` ");
- while($r=mysql_fetch_array($replacerquery)) { //this is the replacer function
- $news=str_replace($r[before], $r[after], $news);
- }
- }
- //ZFormatting
- if (!$gvars[supervars][htmlnews]) {
- $news = str_replace ("<", "<", $news);
- $news = str_replace (">", ">", $news);
- }
- $news = preg_replace ("/\[B\](.*)\[\/B\]/siU", "<B>\\1</B>", $news);
- $news = preg_replace ("/\[U\](.*)\[\/U\]/siU", "<U>\\1</U>", $news);
- $news = preg_replace ("/\[I\](.*)\[\/I\]/siU", "<I>\\1</I>", $news);
- $news = preg_replace ("/\[IMG\](http:\/\/[a-z0-9\/\\._\-\?\&= ]+)\[\/IMG\]/siU", "<IMG SRC=\"\\1\" ALT=\"\">", $news);
- $news = preg_replace ("/\[URL\](http:\/\/[a-z0-9\/\\._\-\?\&= ]+)\[\/URL\]/siU", "<A HREF=\"\\1\" TARGET=\"_BLANK\">\\1</A>", $news);
- $news = preg_replace ("/\[URL=(http:\/\/[a-z0-9\/\\._\-\?\&= ]+)\](.*)\[\/URL\]/siU", "<A HREF=\"\\1\" TARGET=\"_BLANK\">\\2</A>", $news);
- $news = preg_replace ("/\[COLOR=(.*)\](.*)\[\/COLOR\]/siU", "<FONT COLOR=\"\\1\">\\2</FONT>", $news);
- $template = str_replace("[POST]", nl2br($news), $template);
- $template=str_replace("[AUTHEMAIL]", $autharray[email], $template);
- $template=str_replace("[IDPICTUREURL]", $autharray[idpic], $template);
- $template=str_replace("[SIGPICTUREURL]", $autharray[sigpic], $template);
- $template=str_replace("[CATSHORT]", $cat[name], $template);
- $template=str_replace("[CATEGORY]", $cat[fullname], $template);
- if ($gvars[commenting]!="off") { $template=str_replace("[COMMENTSURL]", "comments.php?commentto=$post[id]", $template); }
- //Count the comments
- $comcount = mysql_query("SELECT COUNT(*) FROM `$gvars[tablename]_comments` WHERE `commentto`='$post[id]' ");
- $comcount_result = mysql_result($comcount,0,0);
- $template=str_replace("[COMMENTNUM]", $comcount_result, $template);
- //NEWS OUTPUT
- echo $template;
- //SIG
- echo "<!-- News Generated by ZNews 3.0 (http://zubaz.net/znews) -->\n";
- }
- } else {
- echo "No news found.";
- }
- ?>
there ya go....
- Scorpius
- Proficient


- Joined: Mar 20, 2004
- Posts: 401
- Loc: Scorpion Hole
- Status: Offline
Well, on your page it says that your using news/news.php, and you've said now that your using znews/view.php. I cannot see the error unless you can change your page to include znews/view.php.
Edit: Ok I see what you did. Before you were telling us to look at http://www.lunarossacorp.com/index.php. But that is not using znews anymore but your homepage link (http://www.animenobaka.com/main.php) look as if it is using the znews. I've been looking at the other site, not the Anime one.
Edit: Ok I see what you did. Before you were telling us to look at http://www.lunarossacorp.com/index.php. But that is not using znews anymore but your homepage link (http://www.animenobaka.com/main.php) look as if it is using the znews. I've been looking at the other site, not the Anime one.
- Scorpius
- Proficient


- Joined: Mar 20, 2004
- Posts: 401
- Loc: Scorpion Hole
- Status: Offline
OK, well I installed znews on my server, and it seems to be working perfectly fine. You can look at it, I just put it on a little page that only include the view.php file.
http://sc0rp.ath.cx/testindex.php.
The code to that page is:
A few things that it could be is the version of MySQL your server is running. I don't know for a fact, but that would be something to check out. Since I host my own server, I always have the most recent versions of things. My server has MySQL 5.0.0-alpha-standard. So if you could talk your host into upgrading, or maybe you might have to pay for it, you could also do that if this is a large problem for you.
Hope I was of some help to you.
http://sc0rp.ath.cx/testindex.php.
The code to that page is:
Code: [ Select ]
<?
echo "<strong>NEWS</strong>";
include("znews/view.php");
?>
echo "<strong>NEWS</strong>";
include("znews/view.php");
?>
- <?
- echo "<strong>NEWS</strong>";
- include("znews/view.php");
- ?>
A few things that it could be is the version of MySQL your server is running. I don't know for a fact, but that would be something to check out. Since I host my own server, I always have the most recent versions of things. My server has MySQL 5.0.0-alpha-standard. So if you could talk your host into upgrading, or maybe you might have to pay for it, you could also do that if this is a large problem for you.
Hope I was of some help to you.
- Cae
- Expert


- Joined: Feb 25, 2004
- Posts: 734
- Status: Offline
ok, sorry for the confusion, let me clarify...
znews is used on both http://www.animenobaka.com and http://www.lunarossacorp.com
they are both having trouble with znews
znews used to work on ANB.com, however, our host moved the site and that screwed a bunch of stuff up, however, it is being fixed...
the site that i am trying to solve the znews problem on is indeed LRC.com, and it has never worked there... it is installed to '/news' although it had been PREVIOUSLY installed to '/znews' sorry ive been trying to get it to work, and have reinstalled it serveral times...
hope that helps... sorry for the confusion
znews is used on both http://www.animenobaka.com and http://www.lunarossacorp.com
they are both having trouble with znews
znews used to work on ANB.com, however, our host moved the site and that screwed a bunch of stuff up, however, it is being fixed...
the site that i am trying to solve the znews problem on is indeed LRC.com, and it has never worked there... it is installed to '/news' although it had been PREVIOUSLY installed to '/znews' sorry ive been trying to get it to work, and have reinstalled it serveral times...
hope that helps... sorry for the confusion
- Anonymous
- Bot


- Joined: 25 Feb 2008
- Posts: ?
- Loc: Ozzuland
- Status: Online
April 19th, 2004, 11:54 am
1, 2
To Reply to this topic you need to LOGIN or REGISTER. It is free.
Post Information
- Total Posts in this topic: 16 posts
- Users browsing this forum: No registered users and 197 guests
- You cannot post new topics in this forum
- You cannot reply to topics in this forum
- You cannot edit your posts in this forum
- You cannot delete your posts in this forum
- You cannot post attachments in this forum

