Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
doffer83
Worker
Worker


Joined: Apr 17, 2011
Posts: 117
Location: Amsterdam

PostPosted: Sun Aug 04, 2013 3:49 pm Reply with quote

I am almost finished with upgrade to Ravennuke 2.5x ... evey thing went well I guess .. now I suddenly found that articles I publish are not being saved/posted . I tried via the cp to add an article but just the same... no error just nothing posted.


it is on a subdomein.. no prob I think right.
Only registered users can see links on this board! Get registered or login!

_________________
We are sorry that Tony Soprano is dead, We wish Assad the Syrian maffia boss had died instead. RIP Tony 
View user's profile Send private message Visit poster's website
spasticdonkey
RavenNuke(tm) Development Team


Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Sun Aug 04, 2013 4:40 pm Reply with quote

Do you see the stories posted on the main admin page at the bottom? I ask because it's possible the stories were posted in a language other than the one you are viewing the site in.
 
View user's profile Send private message Visit poster's website
doffer83
PostPosted: Mon Aug 05, 2013 12:53 am Reply with quote

spasticdonkey, No, I thought about that you are right.

I just posted an article as a test in more than one language.. but without success I can't see it in the cp neither

Unfortunately I face this stupid thing.. I have fixed more difficulty errors -_- what a pitty Bang Head

Smile

Let me think I just tried on my local sever 2. same prob O_o
 
neralex
Site Admin


Joined: Aug 22, 2007
Posts: 1459

PostPosted: Mon Aug 05, 2013 3:14 am Reply with quote

In my local installations of RN251 and RN25 i don't have a issue to add articles - all fine here. I think you have created own mistakes while upgrading because if the News module is "untouched", then is all fine.

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message
doffer83
PostPosted: Mon Aug 05, 2013 4:25 am Reply with quote

neralex wrote:
In my local installations of RN251 and RN25 i don't have a issue to add articles - all fine here. I think you have created own mistakes while upgrading because if the News module is "untouched", then is all fine.


I see. I just installed the news module of ton 2.6 and replaced every file as told in the read me. but no .. still the same. I also tried to edit an old article and that works good.

Rolling Eyes I can start smoking again Smile
 
neralex
PostPosted: Mon Aug 05, 2013 4:44 am Reply with quote

Then it could be you have a issue with the db-fields. Turn on the error reporting and activate the sql log level (1) in rnconfig.php and check the the dblog file in the rnlogs folder after set write permissions to 755 to the dblog file. Then you should see the sql errors while storing data in the database. Compare the stories db-table from the RN core package and your old stories db-table.
 
doffer83
PostPosted: Mon Aug 05, 2013 5:20 am Reply with quote

I see some errors..

August 5, 2013, 12:59 pm File: /home/***REMOVED***/db/mysqli.php - Line: 201

more than one nuke_seo_feed table not exist ... (I just inserted it all)
Code:


Code: 1064 - Message: 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 'where pollID='0'' at line 1
SQL was: UPDATE nuke_poll_desc SET artid= where pollID='0'

August 5, 2013, 12:59 pm File: /home/***REMOVED***/db/mysqli.php - Line: 201
Code: 1064 - Message: 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 ug.user_pending = 0 AND a.group_id = ug.group_id' at line 1
SQL was: SELECT a.forum_id, auth_view, auth_read, a.auth_mod FROM `nuke_bbauth_access` a, `nuke_bbuser_group` ug WHERE ug.user_id = AND ug.user_pending = 0 AND a.group_id = ug.group_id


what about the mysqli.. I think it is mysql in phpnuke.
 
neralex
PostPosted: Mon Aug 05, 2013 5:57 am Reply with quote

RN using mysqli and not more mysql, that is the reason why the mysqli.php returns errors.
Only registered users can see links on this board! Get registered or login!

Your first error shows you, that you don't have passed a value for the field artid= because there must be a value like artid=1. The reason for this is, that the insert query to store the article is not working and then can't find the select query the new id. Please check the logfile again, there must be more errors before the error with the polls was reported.
 
doffer83
PostPosted: Mon Aug 05, 2013 6:04 am Reply with quote

right I can see the poll error

Code:
Code: 1064 - Message: 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 'where pollID='0'' at line 1

SQL was: UPDATE nuke_poll_desc SET artid= where pollID='0'


So do I have to do something around the mysqli?? or even the database.

I can send you a copy of the log file if it is safe and okey
 
neralex
PostPosted: Mon Aug 05, 2013 6:12 am Reply with quote

RN using mysqli and you don't must do nothing if you are using the lates RN. Only if you want port old modules, then you must do some changes but this is another story.

Make dump of the structure (not the data) from your _stories db-table and post it here, please. Then search in your logfile an error with a insert query for the _stories table and post the error also here.
 
neralex
PostPosted: Mon Aug 05, 2013 6:39 am Reply with quote

Code:
August 5, 2013, 1:01 pm File: /home/***REMOVED***/db/mysqli.php - Line: 201

Code: 1136 - Message: Column count doesn't match value count at row 1
SQL was: insert into nuke_stories values (NULL, '0', 'admin', 'test88877', now(), '<p>&nbsp;,kjh.lkj./kjmn</p>', '<p>&nbsp;/l.kj</p>', 0, 0, '1', 'admin', '', '0', '', '0', '0', '0', 0, 0, '')


This error from your dblog shows you that your stories have not all needed fields. It seems you don't have upgraded the _stories db-table from your old nuke to RN structure of this table.

Try to rename your old nuke_stories table and run this one in your phpmyadmin. After that you must insert your existing articles from the renamed table or you can add the needed field-structure in your existing nuke_stories table.

Code:
CREATE TABLE IF NOT EXISTS `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  AUTO_INCREMENT=1 ;
 
doffer83
PostPosted: Mon Aug 05, 2013 8:03 am Reply with quote

neralex,

It works now but of course without my old articles.. I want thank you first

Now I want try to find out how to insert my existing articles.. after that I can publish the new site I guess

it would be great if you can tell me how to do that.

Danke Smile
 
neralex
PostPosted: Mon Aug 05, 2013 8:25 am Reply with quote

I can write it for you but i need the name of your old table, i mean the renamed table with the existing articles.
 
neralex
PostPosted: Mon Aug 05, 2013 9:36 am Reply with quote

doffer83 wrote:
this is the file I was renamed it to nuke_stories2


open: modules/News/admin/case.php

Add after break;:

Code:
    case 'newstransfer':

    include_once('modules/' . $module_name . '/admin/transfer.php');
    break;


After that it should looks like this:

Code:
switch($op) {


    case 'YesDelCategory':
    case 'subdelete':
    case 'DelCategory':
    case 'NoMoveCategory':
    case 'EditCategory':
    case 'SaveEditCategory':
    case 'AddCategory':
    case 'SaveCategory':
    case 'DisplayStory':
    case 'PreviewAgain':
    case 'PostStory':
    case 'EditStory':
    case 'RemoveStory':
    case 'ChangeStory':
    case 'DeleteStory':
    case 'adminStory':
    case 'PreviewAdminStory':
    case 'PostAdminStory':
    case 'autoDelete':
    case 'autoEdit':
    case 'autoSaveEdit':
    case 'submissions':
    case 'newsedit':
    case 'tonSave':
    include_once('modules/'.$module_name.'/admin/index.php');
    break;

    case 'newstransfer':
    include_once('modules/' . $module_name . '/admin/transfer.php');
    break;

}


Create a new php-file with the name transfer.php and place it with the following code inside in the admin folder of the News module:

Code:
<?php

if (!defined('ADMIN_FILE')) {die ('Access Denied');}
if (!defined('PHP_EOL')) define('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n");

$module_name = basename(dirname(dirname(__FILE__)));
if (is_mod_admin('admin') || is_mod_admin($module_name)) {

   if (!isset($ok)) $ok = '';
   if (!isset($op)) $op = '';

   switch($op) {

      case 'newstransfer':
      news_transfer($ok);
      break;

   }

} else {
   include_once 'header.php';
   GraphicAdmin();
   OpenTable();
   echo '<div class="text-center"><span class="thick">ERROR</span><br /><br />You do not have administration permission.</div>' , PHP_EOL;
   CloseTable();
   include_once 'footer.php';
}
die();

function news_transfer($ok=0) {
   global $prefix, $db, $module_name, $admin_file, $op;
   list($article_count) = $db->sql_fetchrow($db->sql_query('SELECT COUNT(`sid`) FROM `' . $prefix . '_stories2`'), SQL_NUM);
   if ($ok && $article_count > 0) {
      csrf_check();
      $status = 0;
      $count = 0;
      $delqry = $db->sql_query('DELETE FROM `' . $prefix . '_stories`');
      if ($delqry) {
         list($check) = $db->sql_fetchrow($db->sql_query('SELECT COUNT(`sid`) FROM `' . $prefix . '_stories`'), SQL_NUM);
         if ($check == 0) {
            $db->sql_query('ALTER TABLE `' . $prefix . '_stories` AUTO_INCREMENT = 1');
            $status = 1;
         }         
      }
      if ($status == 1) {
         $result = $db->sql_query('SELECT * FROM `' . $prefix . '_stories2` ORDER BY `sid` ASC');
         if ($db->sql_numrows($result) > 0) {
            while ($transfer = $db->sql_fetchrow($result)) {
               $aid = $transfer['aid'];
               $catid = $transfer['catid'];
               $title = $db->sql_escape_string(htmlspecialchars_decode(check_html($transfer['title'], 'nohtml'),ENT_QUOTES));
               $time = $transfer['time'];
               $hometext = $db->sql_escape_string(check_html($transfer['hometext'], ''));
               $bodytext = $db->sql_escape_string(check_html($transfer['bodytext'], ''));
               $comments = $transfer['comments'];
               if (!is_numeric($comments)) $comments = 0;
               $counter = $transfer['counter'];
               if (!is_numeric($counter)) $counter = 0;
               $topic = $transfer['topic'];
               if (is_numeric($topic)) $topic = 1;
               $informant = $db->sql_escape_string(htmlspecialchars_decode(check_html($transfer['informant'], 'nohtml'),ENT_QUOTES));
               $notes = $db->sql_escape_string(check_html($transfer['notes'], ''));
               $ihome = $transfer['ihome'];
               if (!is_numeric($ihome)) $ihome = 0;
               $alanguage = $db->sql_escape_string($transfer['alanguage']);
               $acomm = $transfer['acomm'];
               if (!is_numeric($acomm)) $acomm = 0;
               $haspoll = $transfer['haspoll'];
               if (is_numeric($haspoll)) $haspoll = 0;
               $pollID = $transfer['pollID'];
               if (!is_numeric($pollID)) $pollID = 0;
               $score = $transfer['score'];
               if (!is_numeric($score)) $score = 0;
               $ratings = $transfer['ratings'];
               if (!is_numeric($ratings)) $ratings = 0;
               $associated = $db->sql_escape_string($transfer['associated']);
               $insert = $db->sql_query('INSERT INTO `' . $prefix . '_stories` VALUES '."(NULL, '$catid', '$aid', '$title', '$time', '$hometext', '$bodytext', '$comments', '$counter', '$topic', '$informant', '$notes', '$ihome', '$alanguage', '$acomm', '$haspoll', '$pollID', '$score', '$ratings', '$associated')");
               if ($insert) {
                  $count++;
               }
               if ($count == 1000) {
                  sleep(2);
               }
            } # end of while
         }
      }      
      include_once 'header.php';
      OpenTable();
      echo '<div class="text-center">' , PHP_EOL
         , 'You have ' , $count , ' articles transfered!' , PHP_EOL
         , '<br /><br />' , PHP_EOL
         , '[ <a href="'  , $admin_file , '.php">Go back!</a> ]' , PHP_EOL
         , '<br /><br />' , PHP_EOL
         , '</div>' , PHP_EOL;
      CloseTable();
      include_once 'footer.php';

   } else {
      include_once 'header.php';
      OpenTable();
      echo '<div class="text-center">' , PHP_EOL;
      if ($article_count > 0) {
         echo 'You can ' , $article_count , ' articles transfer to the new db-table!' , PHP_EOL
            , '<br /><br />' , PHP_EOL
            , '[ <a class="rn_csrf" href="'  , $admin_file , '.php?op=' , $op , '&amp;ok=1">' , _YES , '</a> ] - [ <a href="'  , $admin_file , '.php">' , _NO , '</a> ]' , PHP_EOL
            , '<br /><br />' , PHP_EOL;
      } else {
         echo 'No old articles found!' , PHP_EOL;
      }
      echo '</div>' , PHP_EOL;
      CloseTable();
      include_once 'footer.php';
   }
}


After the download the placement in the admin-folder of the News module you should call the function newstransfer from the downloaded file as admin:

Code:
/admin.php?op=newstransfer


Now you should see the a counting of your old articles in the renamed table. If you have pressed YES, then the new _stories would cleared and set back to the AUTO_INCREMENT = 1. After that runs a loop over your old articles and should store all old articles in the new _stories table. Please note, all new entries gets new article IDs. If its will not work, then let me know it and post here the error messages.


Last edited by neralex on Mon Aug 05, 2013 6:10 pm; edited 3 times in total 
doffer83
PostPosted: Mon Aug 05, 2013 9:52 am Reply with quote

Great job neralex.. I saw the totale number of the articles;

You can 1265 articles transfer to the new db-table. Only just the first article ever of the

site has been transferd. more articles would be amazing solution

high 5
 
neralex
PostPosted: Mon Aug 05, 2013 10:25 am Reply with quote

Do you have checked the dblog file for errors or get you php errors?
 
doffer83
PostPosted: Mon Aug 05, 2013 11:47 am Reply with quote

Neralex :

August 5, 2013, 5:52 pm File: /home/***REMOVED***/db/mysqli.php - Line: 201
Code: 1064 - Message: 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 ug.user_pending = 0 AND a.group_id = ug.group_id' at line 1
SQL was: SELECT a.forum_id, auth_view, auth_read, a.auth_mod FROM `nuke_bbauth_access` a, `nuke_bbuser_group` ug WHERE ug.user_id = AND ug.user_pending = 0 AND a.group_id = ug.group_id

only that I find in the log file
 
neralex
PostPosted: Mon Aug 05, 2013 12:07 pm Reply with quote

Ok that's are not issues with the news transfer. I have the transfer.php a little bit modified and self tested with 300 entries from your dump - it works! So i can't find a issue. Please use the code of the transfer.php in the post before. Wait so long until the loop ends. After that you should get a message with the transfered entries.


Last edited by neralex on Mon Aug 05, 2013 6:06 pm; edited 3 times in total 
doffer83
PostPosted: Mon Aug 05, 2013 12:52 pm Reply with quote

jaaaaaaaaaaaaaa Smile it is done
 
neralex
PostPosted: Mon Aug 05, 2013 1:41 pm Reply with quote

cool! Smile
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

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 ©