Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Raven's RavenNuke(tm) v2.00.00 - v2.02.00 Distro
Author Message
greg01
New Member
New Member



Joined: Mar 07, 2005
Posts: 19

PostPosted: Sun Apr 09, 2006 1:13 pm Reply with quote

Hello all,

Long time reader, first time poster. Just upgraded to Raven's Distro 2 and I'm having some issues. My install has nothing major as far as addons go, just sommaire, MS Info Block, and Coppermine.

First is News. When I create a news story, assign a topic, and preview the story, I have no issues. The topic icon shows just fine. However, when I post to home, the topic icon does not show. Plus, when I click on extended story, I get blank, white page and you can't comment on stories either. Can't figure it out. So, I picked up this nifty little block to display my news in. Topic shows fine, but extended story when clicked still shows blank, white page and no comments available. I would like to get both items working properly. Any ideas would be appreciated. If you would like to experience what I'm talking about, the link to my site:
http://www.theperfectgeneral.com

Code to the block is here:

Code:
<?php

######################################################################
# PHP-Nuke                                                           #
#====================================================================#
#  Copyright (c) 2003 - Francisco Burzi                              #
#  http://phpnuke.org/                                               #
#====================================================================#
# Dutchies block-fancy_newsblock.php for PHP-Nuke 6+                 #
#====================================================================#
#  Copyright (c) 2004 - (webmaster@dutchies.be)                      #
#  http://wwww.dutchies.be/                                          #
#====================================================================#
#  Use of this program is goverened by the terms of the GNU General  #
#     Public License (GPL - version 1 or 2) as published by the      #
#           Free Software Foundation (http://www.gnu.org/)           #
######################################################################

if (eregi("block-Fancy_Newsblock.php",$_SERVER['PHP_SELF'])) {Header("Location: index.php");
die();}


$limit     = 5;     // <= Total news items in block
$hnews     = 3;      // <= Maximum of highlighted news items in block
$showlinks = 1;      // Show more links at bottom
$strip     = "400";  // Size of the Max Number of characters displayed in highlighted news
$hnbdr     = 1;      // highlighted News Border off = 0 or border on = 1
$nnbdr     = 0;      // Normal News     Border off = 0 or border on = 1
$blbrd     = 0;      // border arround all items

//Dont change anything below!!
global $currentlang, $sitename, $ThemeSel;

if ($currentlang == "dutch") {
$title       = "Laatste";
$title1      = "Nieuws items";
$from        = "Geplaatst door";
$moreLink    = "Meer nieuws";
$topicLink   = "Onderwerp";
$archiveLink = "Nieuws Archief";
$submitLink  = "Nieuws Toevoegen";
$morenews    = "Lees meer";
$Printer     = "Print vriendelijk";
$friend      = "Stuur naar vriend";
$LDcounter   = "X Gelezen";
} else if ($currentlang == "french") {
$title       = "-";
$title1      = "-";
$from        = "-";
$moreLink    = "-";
$topicLink   = "-";
$archiveLink = "-";
$submitLink  = "-";
$morenews    = "-";
$Printer     = "-";
$friend      = "-";
$LDcounter   = "-";
} else {
$title       = "Latest";
$title1      = "News items";
$from        = "Posted by";
$moreLink    = "More news";
$topicLink   = "Subject";
$archiveLink = "News Archive";
$submitLink  = "Submit News";
$morenews    = "Read more";
$Printer     = "Print frindly";
$friend      = "Send to friend";
$LDcounter   = "times read";
}

function sa_darkColor($color, $level=16) {
$ret = strval($color);
if ($ret[0] == "#") {
$red = hexdec(substr($ret,1,2));
$grn = hexdec(substr($ret,3,2));
$blu = hexdec(substr($ret,5,2));
$red = (($red-$level) > 0) ? $red-$level : 0;
$grn = (($grn-$level) > 0) ? $grn-$level : 0;
$blu = (($blu-$level) > 0) ? $blu-$level : 0;
$ret = sprintf("#%02X%02X%02X", $red, $grn, $blu);
}
return $ret;
}

function sa_lightColor($color, $level=16) {
$ret = strval($color);
if ($ret[0] == "#") {
$red = hexdec(substr($ret,1,2));
$grn = hexdec(substr($ret,3,2));
$blu = hexdec(substr($ret,5,2));
$red = (($red+$level) < 255) ? $red+$level : 255;
$grn = (($grn+$level) < 255) ? $grn+$level : 255;
$blu = (($blu+$level) < 255) ? $blu+$level : 255;
$ret = sprintf("#%02X%02X%02X", $red, $grn, $blu);
}
return $ret;
}
global $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $nukeurl, $db, $prefix, $admin, $topic, $topicname, $topicimage, $topictext, $informant, $multilingual, $currentlang;

$bgdark1  = sa_darkColor ($bgcolor1, 5);
$bgdark2  = sa_darkColor ($bgcolor2, 25);
$bgdark3  = sa_darkColor ($bgcolor3, 25);

$bglight1 = sa_lightColor($bgcolor1, 25);
$bglight2 = sa_lightColor($bgcolor2, 15);
$bglight3 = sa_lightColor($bgcolor3, 5);

if ($multilingual == 1) {$querylang = "AND (alanguage='$currentlang' OR alanguage='')";} else {$querylang = "";}
$content = "<div align=center><img src=\"images/Fancy_NB/dutch-ies.gif\" border=\"0\" Alt=\"$nukeurl\"><table cellspacing=\"2\" cellPadding=\"1\" width=\"100%\" border=\"$blbrd\" bordercolor=\"$bgdark2\" bgcolor=\"$bgcolor1\"><tr><td align=\"center\">";

$sql = "SELECT t1.title AS cat, t0.score, t0.sid, t0.catid, t0.alanguage, t0.informant, t0.title, t0.time, t0.hometext, t0.topic, t0.comments, t0.counter, t2.topicimage, t2.topicid, t2.topictext FROM ".$prefix."_stories t0, ".$prefix."_stories_cat t1, ".$prefix."_topics t2 WHERE t0.catid=t1.catid AND t0.topic=t2.topicid $querylang ORDER BY t0.sid DESC LIMIT 0, $limit";
$result = $db->sql_query($sql);
$rc = 0;
while ($row = $db->sql_fetchrow($result)) {
$score = $row[score];
$sid = $row[sid];
$title  = $row[title];
$inform = $row[informant];
$langu  = $row[alanguage];
$text   = $row[hometext];
$D = substr($row[time], 8, 2);
$M = substr($row[time], 5, 2);
$Y = substr($row[time], 2, 2);
$time = $D."/".$M."/".$Y;
$linkstrip7 = stripslashes($text);
if(strlen($linkstrip7) > $strip) {
$linkstrip7 = substr($linkstrip7,0,$strip);
$linkstrip7 .= "...";}
$comtotal = $row[comments];
$counter = $row[counter];
if ($hnbdr==1) {$hncs = 1;} else {$hncs = 2;}
if ($nnbdr==1) {$nncs = 1;} else {$nncs = 1;}
if ($rc<$hnews) {
$pict     = "images/topics/$row[topicimage]";
$size     = getimagesize($pict);
$width    = "$size[1]";
$content .= "<table cellspacing=\"$hncs\" align=\"center\" cellPadding=\"2\" width=\"100%\" border=\"$hnbdr\" bordercolor=\"$bgdark2\" bgcolor=\"$bgdark1\"><tr><td bgcolor=\"$bglight1\" align=center valign=\"top\" width=\"".$width."\"><b><a href=\"modules.php?name=News&amp;new_topic=$row[topic]\"><img src=\"$pict\" border=\"0\" Alt=\"$row[topictext]\"></a></b></td>";
$content .= "<td bgcolor=\"$bglight1\" valign=\"top\" title=\"$from $inform\" onMouseOver=this.style.backgroundColor=\"$bgdark1\" onMouseOut=this.style.backgroundColor=\"$bglight1\" onclick=\"window.location.href='modules.php?name=News&amp;file=article&amp;sid=$sid'\"><a href=\"modules.php?name=News&amp;file=article&amp;sid=$sid\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"3\"><b>$title</b></font></a><br>";
$content .= "<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">$linkstrip7</font></td></tr></table>\n";
if ($hnews!=$limit) {$content .= "<table><tr><td height=\"3\"></td></tr></table>";}
} else {
$pict     = "images/Fancy_NB/$row[topicid].gif";
$content .= "<table cellspacing=\"$nncs\" align=\"center\" cellPadding=\"2\" width=\"99.5%\" border=\"$nnbdr\" bordercolor=\"$bgdark2\" bgcolor=\"$bgdark1\">";
$content .= "<tr><td bgcolor=\"$bglight1\" align=center width=\"3%\"><b><a href=\"modules.php?name=News&amp;new_topic=$row[topic]\"><img src=\"$pict\" border=\"0\" Alt=\"$row[topictext]\"></a></b></td>";
$content .= "<td bgcolor=\"$bglight1\" align=center width=\"9%\">$time</td><td bgcolor=\"$bglight1\" align=left valign=\"top\" width=\"84%\" title=\"$from $inform\" onMouseOver=this.style.backgroundColor=\"$bgdark1\" onMouseOut=this.style.backgroundColor=\"$bglight1\" onclick=\"window.location.href='modules.php?name=News&amp;file=article&amp;sid=$sid'\"><a href=\"modules.php?name=News&amp;file=article&amp;sid=$sid\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><b>$title</b></font></a></td><td bgcolor=\"$bglight1\" align=right width=\"4%\" title=\"$LDcounter\">$counter</td></tr></table>\n";
}
$rc = $rc+1;
}
$content .= "</td></tr><tr><td align=center>";
if ($hnews!=$limit) {
$sql1 = "SELECT topicid, topictext FROM ".$prefix."_topics order by topicid";
$result4 = $db->sql_query($sql1);
while( list($topicid, $topictext) = $db->sql_fetchrow( $result4 )){
$content .= "<img src=\"images/Fancy_NB/$topicid.gif\" border=\"0\" Alt=\"$topictext\" align=\"absmiddle\"> $topictext&nbsp;";
}
}
$content .= "</td></tr>";
if ($showlinks==1){$content .= "<tr><td align=center><A HREF=\"news.html\">$moreLink</A>&nbsp;<strong><big>&middot;</big></strong>&nbsp;<A HREF=\"topics.html\">$topicLink</A>&nbsp;<strong><big>&middot;</big></strong>&nbsp;<A HREF=\"archive.html\">$archiveLink</A>&nbsp;<strong><big>&middot;</big></strong>&nbsp;<A HREF=\"modules.php?name=FCKeditor\">$submitLink</A></td></tr>";}
$content .= "</table>";
?>


Second problem is this. I can't assign individual moderators to forums. When I try, I get this error:
Code:
Could not obtain moderator status


DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND aa.group_id = ug.group_id AND aa.auth_mod = 1

SELECT ug.user_id, COUNT(auth_mod) AS is_auth_mod FROM nuke_bbauth_access aa, nuke_bbuser_group ug WHERE ug.user_id IN () AND aa.group_id = ug.group_id AND aa.auth_mod = 1 GROUP BY ug.user_id

Line : 530
File : admin_ug_auth.php


Sorry for the long post. Again, any help is appreciated.
 
View user's profile Send private message
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Mon Apr 10, 2006 7:07 am Reply with quote

First problem, try replacing
Code:
if (eregi("block-Fancy_Newsblock.php",$_SERVER['PHP_SELF'])) {Header("Location: index.php"); 

die();}
with
Code:
if ( !defined('BLOCK_FILE') ) {

    Header("Location: ../index.php");
    die();
}
see if that helps.

Second issue - check your nuke_bbauth_access table to see if the field auth_mod actually exists.

Which version of nuke did you upgrade from?
 
View user's profile Send private message Send e-mail
greg01







PostPosted: Mon Apr 10, 2006 3:46 pm Reply with quote

Nope, I changed the block as you suggested and just get a white page. Same thing I get when I click on the actual news module when posted in home.

Yes, the field does exist.

I did a fresh install of RN, then imported my table data as necessary. However, I did not import any news data. Thanks for the response.
 
Guardian2003







PostPosted: Mon Apr 10, 2006 9:48 pm Reply with quote

Yes, having no news in the DB would have that affect.
I have installed it on my test site at [ Only registered users can see links on this board! Get registered or login! ] as the second center block down with the title 'NewsTest' and it works fine apart from the missing images which came with your download of the block file.
Incidentally, you should keep that file change for security - this will also allow you to rename the block file without any adverse affects.
 
greg01







PostPosted: Wed Apr 12, 2006 10:47 pm Reply with quote

Ok, the problem with the topics icons not showing was my theme. I changed my theme and they show fine in news posts. I removed the news block. Now the only issue I'm having is the blank, white page when I click on a news story from home or click on comments.
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Raven's RavenNuke(tm) v2.00.00 - v2.02.00 Distro

View next topic
View previous topic
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 vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©