Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues
Author Message
tntplus1
New Member
New Member



Joined: Nov 22, 2010
Posts: 14

PostPosted: Tue Nov 30, 2010 11:51 pm Reply with quote

Hi everyone,

Please help me with this. Each time I want to add a new page in the nukeNav->Content, my new page does not show up. I filled all required fields and clicked the button "Yes" at the end with the knowledge that my page will be validated before it will be activated. After I clicked the "Yes" button, no error occurs. However, my "Content Index" is not updated (e.g.: it does not show that I have one waiting page. Also when I clicked on "Manage Categories", my new page is not in the category; therefore, I cannot activate it. I use phpMyAdmin to check and my new page is not added in my database. Please help! I am really tired after trying to add the same page over and over again and it is never added in my db not show up in Raven Nuke Content.

Also, not sure if this is relevant to the issue: I logged in as admin user but for some reason, Raven Nuke still shows that I am "anonymous".

Thanks in advance for all the help you guys can provide.
 
View user's profile Send private message
PHrEEkie
Subject Matter Expert



Joined: Feb 23, 2004
Posts: 358

PostPosted: Wed Dec 01, 2010 2:50 am Reply with quote

Admin is not a user... it's a separate login from your user, and does not appear online as a user. Therefore, you can be logged in as Admin but showing as Anonymous. You can also login as a user, and be online as both...

I have just gone through all of the Content files while I was doing a mod, I know them inside and out.. are u running RN2.40.01 and this is the Content Plus module?

_________________
PHP - Breaking your legacy scripts one build at a time. 
View user's profile Send private message
PHrEEkie







PostPosted: Wed Dec 01, 2010 2:57 am Reply with quote

Also wanted to add... there are two ways of adding a page, which is weird you mention the admin part. When logged in as Admin, you can add pages, but they do not require validation. If you add a page as a user, then the page would be dropped into the queue. You say you're expecting them to be waiting validation, yet you are online as "anonymous". Those two conditions don't jive...

Can you login as Admin, and add a page as an admin, and tell us whether or not it saves the page correctly? We need to know which script isn't saving, or if neither of them are.
 
tntplus1







PostPosted: Wed Dec 01, 2010 9:50 am Reply with quote

Hi PHrEEkie,

Thank you for your replies.
I am using RavenNuke[tm] Version 2.40.01 Released [.7z pkg. 6.51meg].

OK, I logged in as admin. From the left panel, I see "nukeNAV" and "Administration" menu, and both have the "Content" item. I selected "Administration"->"Content". This opens up a "Content Plus 2.2.2: Site Administration". I selected "Add Content", then filled up all fields (title, sub-title, categories, tags, header text, page text, signature, etc.), then I checked the radio button "Yes" to answer the question "Activate this page?". I then clicked the button "Send". This is the message that I've got:
"Your new content has been successfully added."

Everything seems OK, right?
However, when I go back to the "Content Plus 2.2.2: Site Administration" and clicked "Manage Content", I don't see my new page. It mysteriously disappeared. Where did it go? I use phpMyAdmin to check the records in my table <prefix_>pages, the new page was never added.

Please help! I don't want to give up on Raven Nuke and search for another CMS, but if I cannot add new content, what else could I do?

Thank you so much for any help you can provide.
 
spasticdonkey
RavenNuke(tm) Development Team



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

PostPosted: Wed Dec 01, 2010 10:27 am Reply with quote

are you using firefox? if so, http://www.ravenphpscripts.com/postt18799.html

i assume you have tried refreshing the page..

are you using an rn theme?

try setting $display_errors = true; in config.php and adjusting $loglevel in rnconfig.php

then add a page and see if you get any errors.

if none of that helps, post/pm a site url I'll take a look and see if I have any advice.. make sure the content module is active and viewable Smile
 
View user's profile Send private message Visit poster's website
PHrEEkie







PostPosted: Wed Dec 01, 2010 11:43 am Reply with quote

ok my friend, let's see what that script is doing... hope your comfortable copy/pasting some temporary script edits...

The only file we will be touching is:
/modules/Content/admin/index.php

Note this is the admin index, NOT the main index!

First, ensure you backup that file locally somewhere.

Next at around line 979, find this section within the CPSave() function:

Code:
    if ($error) {

      echo '<span style="font-weight: bold;">'._CP_ERROR.'</span>: '._CP_CPADDERROR.'<br /><br />'.PHP_EOL;
      echo ''._CP_GOBACK.'<br />'.PHP_EOL;
    } else {
        $result = $db->sql_query('INSERT INTO '.$prefix.'_pages VALUES (NULL, \''.$cid.'\', \''.$title.'\', \''.$subtitle.'\', \''.$tags.'\', \''.$active.'\', \''.$page_header.'\', \''.$text.'\', \''.$page_footer.'\', \''.$signature.'\', now(), \'0\', \''.$clanguage.'\', \''.$uname.'\')');
      echo ''._CP_CPSAVESUCCESS.'';
      header('Refresh: 4, '.$admin_file.'.php?op=ContentPlus');
    }


Note the echo of _CP_CPSAVESUCCESS. You are reaching that line if the script is telling you the page was saved successfully. We are going to modify that whole section, so replace ALL of that, with this:

Code:
    if ($error) {

      echo '<span style="font-weight: bold;">'._CP_ERROR.'</span>: '._CP_CPADDERROR.'<br /><br />'.PHP_EOL;
      echo ''._CP_GOBACK.'<br />'.PHP_EOL;
    } else {
      $sql = 'INSERT INTO '.$prefix.'_pages VALUES (NULL, \''.$cid.'\', \''.$title.'\', \''.$subtitle.'\', \''.$tags.'\', \''.$active.'\', \''.$page_header.'\', \''.$text.'\', \''.$page_footer.'\', \''.$signature.'\', now(), \'0\', \''.$clanguage.'\', \''.$uname.'\')';
      if(!$result = $db->sql_query('INSERT INTO '.$prefix.'_pages VALUES (NULL, \''.$cid.'\', \''.$title.'\', \''.$subtitle.'\', \''.$tags.'\', \''.$active.'\', \''.$page_header.'\', \''.$text.'\', \''.$page_footer.'\', \''.$signature.'\', now(), \'0\', \''.$clanguage.'\', \''.$uname.'\')')) {
         $error = $db->sql_error($sql);
         echo'<br />MySQL said: <b>' . $error['message'] . '</b>';
         echo'<br />MySQL Error Code: <b>' . $error['code'] . '</b>';
         die('<br /><br />$sql =<br />' . $sql);
      } else {
         echo'There were no MySQL errors reported!';
         die('<br /><br />$sql =<br />' . $sql);
      }
      echo ''._CP_CPSAVESUCCESS.'';
      header('Refresh: 4, '.$admin_file.'.php?op=ContentPlus');
    }


We have put in two script break points. One will stop and show any MySQL error, the other our own new success text, and in both cases, the SQL insert statement that was executed.

Please install this mod, login as admin, select Add Content from admin section, fill in title, pick a category, and just add 'test' (no quotes) to the Page Text area (no header, footer, etc..). Scroll down and click Save. Copy/paste the results back here.

- Keith
 
fkelly
Former Moderator in Good Standing



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

PostPosted: Wed Dec 01, 2010 12:33 pm Reply with quote

I would recommend that you follow Spastic's recommendation before you start modifying PHP files (although that might be necessary eventually). Specifically set $loglevel in your rnconfig file to 1 and make sure the dblog file in your rnlogs directory is writable. Attempt to add a content item and then check the dblog file afterwards. If there are any MYSQL errors taking place they will be logged there. There were several database changes required to get the new content module working and you may not have made those successfully.

If nothing shows in the dblog but the content item is still not being saved then Keith's approach may provide some enlightenment.
 
View user's profile Send private message Visit poster's website
tntplus1







PostPosted: Wed Dec 01, 2010 12:34 pm Reply with quote

Hi spasticdonkey & PHrEEkie,

Thanks for your replies,
I did your what you guys asked me to do: change in FireFox, set display_errors = true and modified the modules/content/admin/index.php. This is the message that I got:

There were no MySQL errors reported!

$sql =
INSERT INTO relaxingcorners_db_pages VALUES (NULL, '2', 'test', 'test', 'test', '1', '

test
', '

testing
', '', '', now(), '0', 'english', 'tnadmin')

AND my test page shows up in the "Content Index" and my db.

HOWEVER, when I tried to add my "real" new page I got this error:

MySQL said: Data too long for column 'text' at row 1
MySQL Error Code: 1406

and my new page is not added either in Content or in my db.


Is there anyway you can change in raven nuke code to allow unlimited length of the "text" column? Also please note that I use unicode, so each character needs 2 bytes. (all my pages are not written in English).

Thanks very much guys.
 
PHrEEkie







PostPosted: Wed Dec 01, 2010 12:43 pm Reply with quote

You can alter the table _pages and increase the storage capacity for the various parts of the page. It is currently TEXT, but can be changed to MEDIUMTEXT (up to 16 MB) or LONGTEXT (up to 4 GB). The current setting, TEXT, can only hold about 64k.

- Keith
 
tntplus1







PostPosted: Wed Dec 01, 2010 12:56 pm Reply with quote

Hi guys,

Thank you ALL soooo much. I changed the type of the "text" column to LONGTEXT and the issue resolved!!! Hooray!!! Now, my very long new page is added in Raven Nuke->Content and in my db.

Thank you so much.

You guys are the best Smile.
 
PHrEEkie







PostPosted: Wed Dec 01, 2010 3:46 pm Reply with quote

fkelly wrote:
I would recommend that you follow Spastic's recommendation before you start modifying PHP files (although that might be necessary eventually)


Sorry fkelly... it's my trouble-shooting style. I usually always prepend advice to edit with "if you're comfortable" and "make a backup locally first", and that usually negates any disasters.

While I admire the error reporting features built in to the newest releases (and good lord how we could have used those 10 yrs ago!), it actually adds yet another layer of potential problems, or "weak points". The directory for the error reports needs to be created by hand (if I recall there...), and then must definitely be made writeable. If a mistake is made in that regard, then no report is saved. Again, just my style, and I use it often, I want the info now, want it clear, and want it printed right to the screen. I also usually run my edits locally before posting them, to make sure we don't waste time with a missing semi-colon or other syntax mistake. I did that here, and intentionally added an error to trip it.

Nothing personal, I know my name is new to you and a lot of the Team, so I'm just letting you know that if I start offering help at the leveling of asking for script edits, I'm on the ball and follow it through. I have been a Nuke tech since working with Tom and Doggy on the original phpBB port, and believe me, I know a lot of "well intentioning" casual forum posters want to help, and sometimes cause more problems on top of the original. I'm not one of those. Wink When I'm in a good mood, I'm actually well-intentioning. Very Happy

cheers,
- Keith
 
fkelly







PostPosted: Wed Dec 01, 2010 4:21 pm Reply with quote

Keith; no problem. Admittedly the SQL error logging in RN is bare bones. The rnlogs directory and empty dblog file do come with the distribution so any installation that follows the directions will create them. The topic of making the directory writable is covered in the instructions too and also mentioned in the rnconfig file. But, yes it is up to the admin to do it correctly. I'd love to find time to write a true administrative interface for the SQL log files to present on the ACP screen. Have it monitor the file size of dblog, and even manage the file, truncating it when it gets beyond a certain size etc. Even display the most recent errors on the ACP and/or notify the admin when there are new errors. So much to do, so little time.

In my own development work I use both the dblog AND the approach you have taken. I usually echo out the SQL statements I'm creating even before I try to execute them just to make sure they are well formed. Here in the Forums we deal with users at all levels of expertise ... some may never have edited a PHP file before and others may know way more than we do. So we usually take the least complicated approach first then escalate as needed.

But at any rate thanks for helping out with this.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues

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 ©