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.02.02 Distro
Author Message
gator
Hangin' Around


Joined: Jul 24, 2003
Posts: 36
Location: Canada

PostPosted: Tue Feb 13, 2007 3:54 am Reply with quote

To start with...thanks for compiling this distro. I just upgraded from PHPNuke 7.6 to RavenNuke7.6 (latest distro). Everything seems to have gone fine except I can't create new blocks from the admin panel. When I attempt to create new blocks it simply returns me to the blocks admin page. No eeror message is generated and yes I have errors turned on. I read a few other post concerning this issue with early versions so I thought I would start a new thread.

I wonder if the problem is in the admin/modules/blocks.php file:

Code:
function BlocksAdd($title, $content, $url, $bposition, $active, $refresh, $headline, $blanguage, $blockfile, $view, $groups, $expire, $action, $subscription) {

    global $prefix, $db, $admin_file;
    if($view == 4) { $ingroups = implode("-",$groups); }
    if($view < 4) { $ingroups = ""; }
    if ($headline != 0) {
   $row = $db->sql_fetchrow($db->sql_query("select sitename, headlinesurl from ".$prefix."_headlines where hid='$headline'"));
    $title = $row['sitename'];
    $url = $row['headlinesurl'];
    }
    $row2 = $db->sql_fetchrow($db->sql_query("SELECT weight FROM ".$prefix."_blocks WHERE bposition='$bposition' ORDER BY weight DESC"));
    $weight = intval($row2['weight']);
    $weight++;
    $title = stripslashes(FixQuotes($title));
    $content = stripslashes(FixQuotes($content));
    $bkey = "";
    $btime = "";
    if (!empty($blockfile)) {
   $url = "";
   if (empty($title)) {
       $title = ereg_replace("block-","",$blockfile);
       $title = ereg_replace(".php","",$title);
       $title = ereg_replace("_"," ",$title);
   }
    }
    if (!empty($url)) {
   $btime = time();
   if (!ereg("http://",$url)) {
       $url = "http://$url";
   }
   $rdf = parse_url($url);
   $fp = fsockopen($rdf['host'], 80, $errno, $errstr, 15);
   if (!$fp) {
       rssfail();
       exit;
   }
   if ($fp) {
       fputs($fp, "GET " . $rdf['path'] . "?" . $rdf['query'] . " HTTP/1.0\r\n");
       fputs($fp, "HOST: " . $rdf['host'] . "\r\n\r\n");
       $string = "";
       while(!feof($fp)) {
          $pagetext = fgets($fp,228);
          $string .= chop($pagetext);
       }
       fputs($fp,"Connection: close\r\n\r\n");
       fclose($fp);
       $items = explode("</item>",$string);
       $content = "<font class=\"content\">";
       for ($i=0;$i<10;$i++) {
      $link = ereg_replace(".*<link>","",$items[$i]);
      $link = ereg_replace("</link>.*","",$link);
      $title2 = ereg_replace(".*<title>","",$items[$i]);
      $title2 = ereg_replace("</title>.*","",$title2);
      if ($items[$i] == "" AND $cont != 1) {
          $content = "";
      } else {
          if (strcmp($link,$title2) AND !empty($items[$i])) {
         $cont = 1;
         $content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"$link\" target=\"new\">$title2</a><br />\n";
          }
      }
       }
   }
    }
    $content = FixQuotes($content);
    if (($content == "") AND ($blockfile == "")) {
   rssfail();
    } else {
    if ($expire == "") {
        $expire = 0;
    }
    if ($expire != 0) {
        $expire = time() + ($expire * 86400);
    }
   $db->sql_query("insert into ".$prefix."_blocks values (NULL, '$bkey', '$title', '$content', '$url', '$bposition', '$weight', '$active', '$refresh', '$btime', '$blanguage', '$blockfile', '$view', '$ingroups', '$expire', '$action', '$subscription')");
   Header("Location: ".$admin_file.".php?op=BlocksAdmin");
    }
}


If you scroll down to the insert into query you will see:
Code:
$db->sql_query("insert into ".$prefix."_blocks values (NULL, '$bkey', '$title', '$content', '$url', '$bposition', '$weight', '$active', '$refresh', '$btime', '$blanguage', '$blockfile', '$view', '$ingroups', '$expire', '$action', '$subscription')"); 


Please not the $btime variable

Now when I look at the SQL included in the distro the entry is:

Code:
DROP TABLE IF EXISTS `nuke_blocks`;

CREATE TABLE `nuke_blocks` ( `bid` int(10) NOT NULL auto_increment, `bkey` varchar(15) NOT NULL default '', `title` varchar(60) NOT NULL default '', `content` text NOT NULL, `url` varchar(200) NOT NULL default '', `bposition` char(1) NOT NULL default '', `weight` int(10) NOT NULL default '1', `active` int(1) NOT NULL default '1', `refresh` int(10) NOT NULL default '0', `time` varchar(14) NOT NULL default '0', `blanguage` varchar(30) NOT NULL default '', `blockfile` varchar(255) NOT NULL default '', `view` int(1) NOT NULL default '0', `expire` varchar(14) NOT NULL default '0', `action` char(1) NOT NULL default '', `subscription` int(1) NOT NULL default '0', PRIMARY KEY  (`bid`), KEY `title` (`title`) ) TYPE=MyISAM;

INSERT INTO `nuke_blocks` VALUES (NULL, '', 'Modules', '', '', 'l', 1, 1, 0, '', '', 'block-Modules.php', 0,  '0', 'd', 0);
INSERT INTO `nuke_blocks` VALUES (NULL, 'admin', 'Administration', '<strong><big>·</big></strong> <a href="admin.php">Administration</a><br>\r\n<strong><big>·</big></strong> <a href="admin.php?op=adminStory">NEW Story</a><br>\r\n<strong><big>·</big></strong> <a href="admin.php?op=create">Change Survey</a><br>\r\n<strong><big>·</big></strong> <a href="admin.php?op=content">Content</a><br>\r\n<strong><big>·</big></strong> <a href="admin.php?op=logout">Logout</a>', '', 'l', 2, 1, 0, '985591188', '', '', 2, '0', 'd', 0);
INSERT INTO `nuke_blocks` VALUES (NULL, '', 'Who''s Online', '', '', 'l', 3, 1, 0, '', '', 'block-Who_is_Online.php', 0, '0', 'd', 0);
INSERT INTO `nuke_blocks` VALUES (NULL, '', 'Search', '', '', 'l', 4, 0, 3600, '', '', 'block-Search.php', 0, '0', 'd', 0);
INSERT INTO `nuke_blocks` VALUES (NULL, '', 'Languages', '', '', 'l', 5, 1, 3600, '', '', 'block-Languages.php', 0, '0', 'd', 0);
INSERT INTO `nuke_blocks` VALUES (NULL, '', 'Random Headlines', '', '', 'l', 6, 0, 3600, '', '', 'block-Random_Headlines.php', 0, '0', 'd', 0);
INSERT INTO `nuke_blocks` VALUES (NULL, 'userbox', 'User''s Custom Box', '', '', 'r', 1, 1, 0, '', '', '', 1, '0', 'd', 0);
INSERT INTO `nuke_blocks` VALUES (NULL, '', 'Categories Menu', '', '', 'r', 2, 0, 0, '', '', 'block-Categories.php', 0, '0', 'd', 0);
INSERT INTO `nuke_blocks` VALUES (NULL, '', 'Survey', '', '', 'r', 3, 1, 3600, '', '', 'block-Survey.php', 0, '0', 'd', 0);
INSERT INTO `nuke_blocks` VALUES (NULL, '', 'Login', '', '', 'r', 4, 1, 3600, '', '', 'block-Login.php', 3, '0', 'd', 0);
INSERT INTO `nuke_blocks` VALUES (NULL, '', 'Big Story of Today', '', '', 'r', 5, 1, 3600, '', '', 'block-Big_Story_of_Today.php', 0, '0', 'd', 0);
INSERT INTO `nuke_blocks` VALUES (NULL, '', 'Old Articles', '', '', 'r', 6, 1, 3600, '', '', 'block-Old_Articles.php', 0, '0', 'd', 0);
INSERT INTO `nuke_blocks` VALUES (NULL, '', 'Information', '<br><center><font class="content">\r\n<a href="http://phpnuke.org"><img src="images/powered/powered5.jpg" border="0" alt="Powered by PHP-Nuke" title="Powered by PHP-Nuke" width="88" height="31"></a></font></center><br>', '', 'r', 7, 0, 0, '', '', '', 0, '0', 'd', 0);


I'm not a very good php coder and really don't understand the inner workings of nuke, but is there a problem with the $btime variable (i.e. $time (SQL)vs. $btime (blocks.php). Should they be the same?

I have tried changing the variable in my mysql dbase using phpmyadmin to $btime but I get the same problem.

Thanks

_________________
.::.
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
gator
PostPosted: Tue Feb 13, 2007 5:37 am Reply with quote

In addition I am unable to edit a block? I can however activate and deactivate blocks?

For some reason the BlocksAdd function and BlockEdit function are not working
 
gator
PostPosted: Tue Feb 13, 2007 5:52 am Reply with quote

Ok I figured this out. In the RavenNuke install there are three sql files:

1. core SQL
2. nsn groups SQL
3. sentinel SQL

The key to my problem was that the nsn groups SQL makes some alterations to the core SQL. In a simple install, the above code works perfectly. I was rebuilding my MYSQL dbase from bits and pieces and thus deviated from the typical install.

For those having the same problem here are the table entries that were giving me grief:

ALTER TABLE `nuke_blocks` ADD `groups` TEXT NOT NULL AFTER `view`;
ALTER TABLE `nuke_message` ADD `groups` TEXT NOT NULL AFTER `view`;
ALTER TABLE `nuke_modules` ADD `groups` TEXT NOT NULL AFTER `view`;
 
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9456
Location: Arizona

PostPosted: Tue Feb 13, 2007 11:14 pm Reply with quote

Yup. Been addressed in a few threads before, but this is a nice succinct one. Thanks!

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
___jay___
New Member
New Member


Joined: Feb 09, 2007
Posts: 19

PostPosted: Fri Mar 09, 2007 4:39 pm Reply with quote

Thank you sir, problem solved.
 
View user's profile Send private message
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.02.02 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 ©