ohiodarter
Hangin' Around
![](modules/Forums/images/avatars/blank.gif)
Joined: Nov 06, 2002
Posts: 32
|
Posted:
Sat Feb 04, 2006 12:46 am |
|
This is what I have in each. My site was hacked two days ago due to outdated software. I deleted everything and loaded RavenNuke. I then selectively filled some of my tables with data from my old site but didnt change the structure of anything. But I too cannot add blocks no matter what I do. Here is what I have.
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>·</big></strong> <a href=\"$link\" target=\"new\">$title2</a><br>\n";
}
}
}
}
|
Then the database is as such;
Code:-- Table structure for table `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 AUTO_INCREMENT=183 ;
|
|
|
|
ohiodarter
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Feb 07, 2006 10:08 am |
|
Well, I thought I had this figured out. Found an error to be in the nuke_blocks structure. As was pointed out, there was an additional field added in Ravens distro. Subscriptions. I added the field and then went through each entry and added ,0 to it. That way the structure had the correct number of fields and the entried all had the same number. Apparently I am still missing something as I cannot add blocks still... I am going to list all three examples. First I will list how it looked in my 7.0 install. Then I will list what Raven has in the distro. Lastly I will list what I changed my original sql to to match Ravens structure. I am hoping that maybe I just did something stupid and somebody will catch it for me. Thanks to anybody who can help out.
ORIGINAL SQL;
Code:
--
-- Table structure for table `nuke_blocks`
--
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 '',
PRIMARY KEY (bid),
KEY bid (bid),
KEY title (title)
) TYPE=MyISAM;
--
-- Dumping data for table `nuke_blocks`
--
INSERT INTO nuke_blocks (bid, bkey, title, content, url, bposition, weight, active, refresh, time, blanguage, blockfile, view, expire, action) VALUES (1,'','Modules','','','l',2,1,0,'','','block-Modules.php',0,'0','');
INSERT INTO nuke_blocks (bid, bkey, title, content, url, bposition, weight, active, refresh, time, blanguage, blockfile, view, expire, action) VALUES (2,'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',3,1,0,'985591188','','',2,'0','');
INSERT INTO nuke_blocks (bid, bkey, title, content, url, bposition, weight, active, refresh, time, blanguage, blockfile, view, expire, action) VALUES (4,'','Search','','','l',4,0,3600,'','','block-Search.php',0,'0','');
INSERT INTO nuke_blocks (bid, bkey, title, content, url, bposition, weight, active, refresh, time, blanguage, blockfile, view, expire, action) VALUES (5,'','Languages','','','l',5,0,3600,'','','block-Languages.php',0,'0','');
|
RAVENS SQL;
Code:
-- --------------------------------------------------------
--
-- Table structure for table `nuke_blocks`
--
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;
--
-- Dumping data for table `nuke_blocks`
--
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);
|
MY NEW SQL ENTRY;
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 bid (bid),
KEY title (title)
) TYPE=MyISAM;
--
-- Dumping data for table `nuke_blocks`
--
INSERT INTO nuke_blocks VALUES (NULL,'','Modules','','','l',2,1,0,'','','block-Modules.php',0,'0','',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',3,1,0,'985591188','','',2,'0','',0);
INSERT INTO nuke_blocks VALUES (NULL,'','Search','','','l',4,0,3600,'','','block-Search.php',0,'0','',0);
INSERT INTO nuke_blocks VALUES (NULL,'','Languages','','','l',5,0,3600,'','','block-Languages.php',0,'0','',0);
|
|
|
|