Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
pentarix
New Member
New Member



Joined: May 02, 2006
Posts: 5

PostPosted: Tue May 02, 2006 4:27 pm Reply with quote

I've just done a fresh install of PHPNuke .76 however when I import the new Topics, I can see any test articles I create, but I can't create any new articles/stories or see the old ones after I import them from the previous database. So now my news article won't display on the homepage and I'm not getting any error message.

When I import it states:

Quote:
Your SQL query has been executed successfully:
The content of your file has been inserted.

But you can Only registered users can see links on this board! Get registered or login! that the articles aren't displaying. Click on Only registered users can see links on this board! Get registered or login! and the article are showing, but if you go to the Only registered users can see links on this board! Get registered or login! module, it's blank.


I'm importing from postnuke, I've managed to import other things without any problems so far.

I've tried:
- deactivating and reactivating the module
- putting another module in the homepage (which displays fine)
- creating test news articles
- dropping the module table and then importing a new nuke_modules.sql
- deleting and reinstalling the database and site

Doing all that has led me to the conclusion that the problem occurs when I import my previous Stories. Is there something specific that I'm missing?

I've compared the code, if I change anything besides removing the pn_ prefix, it won't work at all. Any suggestions?

_________________
www.lifesupporters.com 
View user's profile Send private message
fkelly
Former Moderator in Good Standing



Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Tue May 02, 2006 5:12 pm Reply with quote

When you say importing the articles, exactly what do you mean? Do you have a database table that you are "importing" that does a "drop table if exists, then create table, then adds the data?" Sorry I don't remember the exact syntax SQL uses. If so, what I would do is do a field by field comparison between the table in Nuke 7.6 and the one that you are importing. I suspect that there may be some kind of mismatch ... a field that exists in one table but not in another for instance ... that is causing your problem.

If you are trying to compare all the tables in a database between version, a file comparison tool is handy but for a single table I'd just bring them up in phpmyadmin and look at them on the screen or at most do a print and get out a pen and compare the fields one by one.
 
View user's profile Send private message Visit poster's website
pentarix







PostPosted: Tue May 02, 2006 9:30 pm Reply with quote

fkelly wrote:
When you say importing the articles, exactly what do you mean? Do you have a database table that you are "importing" that does a "drop table if exists, then create table, then adds the data?"

Thanks for the reply! Yes that is exactly what I'm doing.

fkelly wrote:
Sorry I don't remember the exact syntax SQL uses. If so, what I would do is do a field by field comparison between the table in Nuke 7.6 and the one that you are importing. I suspect that there may be some kind of mismatch ... a field that exists in one table but not in another for instance ... that is causing your problem.


Here is the PostNuke nuke_stories.sql (this imports fine but won't display in homepage)

Code:
CREATE TABLE `nuke_stories` (

  `sid` int(11) NOT NULL auto_increment,
  `catid` int(11) NOT NULL default '0',
  `aid` varchar(30) NOT NULL default '',
  `title` varchar(255) default NULL,
  `time` datetime default NULL,
  `hometext` text,
  `bodytext` text NOT NULL,
  `comments` int(11) default '0',
  `counter` mediumint(8) unsigned default NULL,
  `topic` tinyint(4) NOT NULL default '1',
  `informant` varchar(20) NOT NULL default '',
  `notes` text NOT NULL,
  `ihome` tinyint(1) NOT NULL default '0',
  `themeoverride` varchar(30) NOT NULL default '',
  `language` varchar(30) NOT NULL default '',
  `withcomm` tinyint(1) NOT NULL default '0',
  `format_type` tinyint(1) unsigned NOT NULL default '0',
  PRIMARY KEY  (`sid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=103 ;


Here is the PHPNuke nuke_stories.sql

Code:
CREATE TABLE `nuke_stories` (

  `sid` int(11) NOT NULL auto_increment,
  `catid` int(11) NOT NULL default '0',
  `aid` varchar(25) NOT NULL default '',
  `title` varchar(80) default NULL,
  `time` datetime default NULL,
  `hometext` text,
  `bodytext` text NOT NULL,
  `comments` int(11) default '0',
  `counter` mediumint(8) unsigned default NULL,
  `topic` int(3) NOT NULL default '1',
  `informant` varchar(25) NOT NULL default '',
  `notes` text NOT NULL,
  `ihome` int(1) NOT NULL default '0',
  `alanguage` varchar(30) NOT NULL default '',
  `acomm` int(1) NOT NULL default '0',
  `haspoll` int(1) NOT NULL default '0',
  `pollID` int(10) NOT NULL default '0',
  `score` int(10) NOT NULL default '0',
  `ratings` int(10) NOT NULL default '0',
  `associated` text NOT NULL,
  PRIMARY KEY  (`sid`),
  KEY `catid` (`catid`),
  KEY `counter` (`counter`),
  KEY `topic` (`topic`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;


I left out the code for the individual story but they each correspond with these chunks of code. I see the differences but when I apply what appears in the PHPNuke code to the PostNuke code and then try to upload it, it doesn't work and really shouldn't unless I went through and modified each of the 100+ news articles.

Does anything in particular in the code stand out to anyone as being something that would cause this problem?
 
Guardian2003
Site Admin



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

PostPosted: Wed May 03, 2006 2:58 am Reply with quote

You would have to modify the data to fit with the different table structure.
 
View user's profile Send private message Send e-mail
pentarix







PostPosted: Wed May 03, 2006 3:28 am Reply with quote

Once I do, it doesn't work any longer, so it looks like I'll have to not only edit the data that I listed above, I'll also have to edit the code in every story so they match.

I'm just going to dump the Stories and start over, it's way more work then it's worth.

Thanks for the help!
 
fkelly







PostPosted: Wed May 03, 2006 7:43 am Reply with quote

Here is a hack you could try if you have access to PHPmyadmin.

After making sure you have a backup ...

Get your PostNuke nuke_stories table up on the screen, structure view

delete the fields in it that aren't in the Nuke stories table -- example themeoverride, but check carefully;

there's one (at least) the topic field which has a slightly different definition, in the two tables but just to be safe i'd change it in the PostNuke table, check for others

change the alanguage field name in the PN table to language; likewise change withcomm to acomm; check for others

add the fields at the bottom of the nuke table starting with pollid to the bottom of the PN table, make the definitions match.

Now compare the structures and make sure they align. Make any further adjustments.

Now dump the structure and data from the PN table. Use the drop table if exists and create table options so it writes over the old table. I think you've done this before but now the tables should align.

No guarantees but I'd bet on it working if you get the structures right.



Now if it has the same table name as the Nuke table you should be abl
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

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 ©