something is wrong and i cant figure out what it is...

  • Cae
  • Expert
  • Expert
  • User avatar
  • Posts: 734

Post 3+ Months Ago

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?
  • GrimShadow
  • Newbie
  • Newbie
  • GrimShadow
  • Posts: 6
  • Loc: Chandler, Oklahoma

Post 3+ Months Ago

hmm, mind tossing up the code that your using on the view.php page so I can see if I can help?
  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

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.
  • VentsyV
  • Student
  • Student
  • VentsyV
  • Posts: 65

Post 3+ Months Ago

do you have "znews/view.php" as a valid path from your home folder ?
  • Cae
  • Expert
  • Expert
  • User avatar
  • Posts: 734

Post 3+ Months Ago

sorry, forgot i posted this here... :P and no, i still havent gotten it to work yet...

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
  • Expert
  • User avatar
  • Posts: 734

Post 3+ Months Ago

ok, i just tried the Utopia News Pro stuff... same problem... i swear i am going to go over to that bloddy server and throw it across the room! :throwmonitor:
  • rjstephens
  • Professor
  • Professor
  • User avatar
  • Posts: 774
  • Loc: Brisbane, Australia

Post 3+ Months Ago

Anything is possible, the impossible just takes longer.
  • Cae
  • Expert
  • Expert
  • User avatar
  • Posts: 734

Post 3+ Months Ago

hahaha, i should read my sig more often, lol

well, i got the hosting ppl to go and move the site to a different server, maybe that will do something... *please let it do something!*
  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

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
Code: [ Select ]
require('functions.inc.php');

to
Code: [ Select ]
require('news/functions.inc.php');

Hope that'll work for you.
  • Cae
  • Expert
  • Expert
  • User avatar
  • Posts: 734

Post 3+ Months Ago

but the vewi.php file is in the same folder (news) as the veiw.php file, so even though i am calling the veiw.php file from another folder, beings veiw.php is in the sam folder it shouldnt matter should it?
  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

Ok, first off you spelt view like 3 different ways in that post. And second, can you post the code you use to include it, and the view.php code, or you can E-mail them to me.
  • Cae
  • Expert
  • Expert
  • User avatar
  • Posts: 734

Post 3+ Months Ago

sorry, i was typing fast... its view.php

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 ("<", "&lt;", $news);
$news = str_replace (">", "&gt;", $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.";
}
?>
  1. <?php
  2. @include_once("db_include.php");
  3. ?>
  4. <? //DISPLAY NEWS
  5. $glob = $tableprefix."_globalvars";
  6. $gquery = mysql_query("SELECT * FROM `$glob` ");
  7. while ($var = mysql_fetch_array($gquery)) {
  8.     $variable = $var[variable];
  9.     $value = $var[value];
  10.     $gvars[$variable] = $value;
  11.     }
  12. $gvars[supervars][htmlnews] = true;
  13.     
  14. $months=    array( '1' => 'January',
  15.              '2' => 'February',
  16.              '3' => 'March',
  17.              '4' => 'April',
  18.              '5' => 'May',
  19.              '6' => 'June',
  20.              '7' => 'July',
  21.              '8' => 'August',
  22.              '9' => 'September',
  23.              '10' => 'October',
  24.              '11' => 'November',
  25.              '12' => 'December');
  26. $monthnumdays = array( '1' => '31',
  27.              '2' => '28',
  28.              '3' => '31',
  29.              '4' => '30',
  30.              '5' => '31',
  31.              '6' => '30',
  32.              '7' => '31',
  33.              '8' => '31',
  34.              '9' => '30',
  35.              '10' => '31',
  36.              '11' => '30',
  37.              '12' => '31');
  38. if ($gvars[newsaging] == "3") {
  39.     $backlim = $gvars[maxnewsnum];
  40.     $lim = "LIMIT 0,$backlim ";
  41.     $where = "WHERE 1";
  42. }
  43. if ($gvars[newsaging] == "2") {
  44.     $maxage = explode(":", $gvars[maxnewsage]);
  45.     $timestamp = time();
  46.     $timestamp -= (($maxage[0] * 86400) + (($maxage[1] + $gvars[timeshift]) * 3600));
  47.     $dquery = mysql_query("SELECT FROM_UNIXTIME($timestamp)");
  48.     $servert = mysql_result($dquery, 0);
  49.     $threshdate = $servert;
  50.     $where = "WHERE `date`>'$threshdate'";
  51.     }
  52. if ($gvars[newsaging] == "1") {
  53.     $where = "WHERE `current`='yes'";
  54. }
  55. if (!empty($date)) {    
  56.     $where .= " AND date BETWEEN '$date 00:00:00' AND '$date 23:59:59'";
  57. }
  58. if (!empty($cat)) {
  59.     $where .= " AND category='$cat'";
  60.     $notDefaultTemp = true;
  61. }
  62. if (!empty($id)) {
  63.     $where = "WHERE `id`='$id'";
  64. }
  65. if ($mode == "showall") {
  66.     $where = "WHERE 1";
  67.     $lim = '';
  68. }
  69. //SIG
  70. echo "<!-- News Generated by ZNews 3.0 (http://zubaz.net/znews) -->\n";
  71. //IS THERE NEWS?
  72. $newscount = mysql_query("SELECT COUNT(*) FROM `$gvars[tablename]_posts` $where ");
  73. $ncount = mysql_result($newscount,0,0);
  74. if($ncount != 0) {
  75. //NEWS
  76. $nquery = mysql_query("SELECT * FROM `$gvars[tablename]_posts` $where ORDER BY `date` DESC $lim");
  77. while ($post = mysql_fetch_array($nquery)) {
  78. // HANDLE DATE
  79. $data=explode(" ", "$post[date]");
  80. $actualdatearray=explode("-", "$data[0]");
  81. $actualtimearray=explode(":", "$data[1]");
  82.     $hour=$actualtimearray[0] + $gvars[timeshift]; //the minus 0 is the time offset, change that according to your difference from your server
  83.     $tod="am";
  84.     $month=$actualdatearray[1];
  85.     $month++;
  86.     $month--;
  87.     $actualdatearray[2]++;
  88.     $actualdatearray[2]--;
  89.     if ($hour==12) {
  90.         $tod="pm";
  91.     }
  92.     if ($hour<=0) {
  93.         $hour = $hour + 12;
  94.         $tod="pm";
  95.         if ($hour==12) {
  96.             $tod="am";
  97.         }
  98.         $actualdatearray[2] = $actualdatearray[2] - 1;
  99.             if ($actualdatearray[2] == 0) { // this should fix the month and year from the time difference
  100.                 $month = $month - 1;
  101.                 if ($actualdatearray[0] % 4 == 0) { $monthnumdays[2] = '29'; } // leap year check
  102.                 $actualdatearray[2] = $monthnumdays[$month];
  103.                 if ($month == 0) {
  104.                     $actualdatearray[0] = $actualdatearray[0] - 1;
  105.                     $month = 12;
  106.                     }
  107.                 }
  108.         } elseif ($hour>12) {
  109.         $hour = $hour - 12;
  110.         $tod="pm";
  111.         }
  112.         
  113. // GET CATEGORY
  114. if ($gvars[categories]=="1") {
  115.     $catquery = mysql_query("SELECT * FROM `$gvars[tablename]_categories` WHERE `name`='$post[category]' ");
  116.     $cat = mysql_fetch_array($catquery);
  117.     }
  118.     
  119. // GET TEMPLATE
  120. if(!empty($cat[template])) {
  121.     $tempname = $cat[template];
  122.     } else {
  123.     $tempname = "default";
  124.     }
  125. $tempquery = mysql_query("SELECT * FROM `$gvars[tablename]_templates` WHERE `name`='$tempname' ");
  126. $templateArray = mysql_fetch_array($tempquery);
  127. $template = $templateArray[template];
  128. // GET AUTHOR DATA
  129. $aquery=mysql_query("SELECT * FROM `$gvars[tablename]_users` WHERE `username`='$post[author]' ");
  130. $autharray=mysql_fetch_array($aquery);
  131. // REPLACE COMPONENTS
  132. $template=str_replace("[MONTH]", $months[$month], $template);
  133. $template=str_replace("[M#]", $month, $template);
  134. $template=str_replace("[DAY]", $actualdatearray[2], $template);
  135. $template=str_replace("[YEAR]", $actualdatearray[0], $template);
  136. $template=str_replace("[TIME]", "$hour:$actualtimearray[1]", $template);
  137. $template=str_replace("[TOD]", $tod, $template);
  138. $template=str_replace("[TITLE]", $post[title], $template);
  139. $template=str_replace("[AUTHOR]", $autharray[username], $template);
  140. if ($gvars[abstracting]=="1") {
  141.     $template=str_replace("[ABSTRACT]", $post[abstract], $template);
  142.     }
  143. $news = $post[post];
  144. //REPLACERS
  145. if ($gvars[replacers] == "1") {
  146.     $replacerquery=mysql_query("SELECT * FROM `$gvars[tablename]_replacers` ");
  147.     while($r=mysql_fetch_array($replacerquery)) { //this is the replacer function
  148.         $news=str_replace($r[before], $r[after], $news);
  149.     }
  150. }
  151. //ZFormatting
  152. if (!$gvars[supervars][htmlnews]) {
  153. $news = str_replace ("<", "&lt;", $news);
  154. $news = str_replace (">", "&gt;", $news);
  155. }
  156. $news = preg_replace ("/\[B\](.*)\[\/B\]/siU", "<B>\\1</B>", $news);
  157. $news = preg_replace ("/\[U\](.*)\[\/U\]/siU", "<U>\\1</U>", $news);
  158. $news = preg_replace ("/\[I\](.*)\[\/I\]/siU", "<I>\\1</I>", $news);
  159. $news = preg_replace ("/\[IMG\](http:\/\/[a-z0-9\/\\._\-\?\&= ]+)\[\/IMG\]/siU", "<IMG SRC=\"\\1\" ALT=\"\">", $news);
  160. $news = preg_replace ("/\[URL\](http:\/\/[a-z0-9\/\\._\-\?\&= ]+)\[\/URL\]/siU", "<A HREF=\"\\1\" TARGET=\"_BLANK\">\\1</A>", $news);
  161. $news = preg_replace ("/\[URL=(http:\/\/[a-z0-9\/\\._\-\?\&= ]+)\](.*)\[\/URL\]/siU", "<A HREF=\"\\1\" TARGET=\"_BLANK\">\\2</A>", $news);
  162. $news = preg_replace ("/\[COLOR=(.*)\](.*)\[\/COLOR\]/siU", "<FONT COLOR=\"\\1\">\\2</FONT>", $news);
  163. $template = str_replace("[POST]", nl2br($news), $template);
  164. $template=str_replace("[AUTHEMAIL]", $autharray[email], $template);
  165. $template=str_replace("[IDPICTUREURL]", $autharray[idpic], $template);
  166. $template=str_replace("[SIGPICTUREURL]", $autharray[sigpic], $template);
  167. $template=str_replace("[CATSHORT]", $cat[name], $template);
  168. $template=str_replace("[CATEGORY]", $cat[fullname], $template);
  169. if ($gvars[commenting]!="off") { $template=str_replace("[COMMENTSURL]", "comments.php?commentto=$post[id]", $template); }
  170. //Count the comments
  171. $comcount = mysql_query("SELECT COUNT(*) FROM `$gvars[tablename]_comments` WHERE `commentto`='$post[id]' ");
  172. $comcount_result = mysql_result($comcount,0,0);
  173. $template=str_replace("[COMMENTNUM]", $comcount_result, $template);
  174. //NEWS OUTPUT
  175. echo $template;
  176. //SIG
  177. echo "<!-- News Generated by ZNews 3.0 (http://zubaz.net/znews) -->\n";
  178. }
  179. } else {
  180. echo "No news found.";
  181. }
  182. ?>


there ya go....
  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

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.
  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

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:
Code: [ Select ]
<?
echo "<strong>NEWS</strong>";
include("znews/view.php");
?>
  1. <?
  2. echo "<strong>NEWS</strong>";
  3. include("znews/view.php");
  4. ?>


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
  • Expert
  • User avatar
  • Posts: 734

Post 3+ Months Ago

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
  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

Well, as I said before, I have installed it on my server, and I even used your view.php file. It works perfectly fine for me so it most likely is a problem with the server itself. Ask your host to upgrade its MySQL version.

Post Information

  • Total Posts in this topic: 16 posts
  • Users browsing this forum: No registered users and 69 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.