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 -> RN Bug Fixes
Author Message
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6437

PostPosted: Wed Mar 28, 2007 4:20 pm Reply with quote

TinyMCE was 7.7. Not sure about the pagebreak convention, but I like using the new pagebreak convention, and converting the content to use it once.

_________________
I search, therefore I exist...
Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
Gremmie
Former Moderator in Good Standing



Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA

PostPosted: Wed Mar 28, 2007 8:47 pm Reply with quote

I agree about going to the new [--pagebreak--] and posting a conversion script. Do we have a consensus?

_________________
Only registered users can see links on this board! Get registered or login! - An Event Calendar for PHP-Nuke
Only registered users can see links on this board! Get registered or login! - A Google Maps Nuke Module 
View user's profile Send private message
Guardian2003
Site Admin



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

PostPosted: Thu Mar 29, 2007 1:28 am Reply with quote

Sounds like a plan!
 
View user's profile Send private message Send e-mail
montego
Site Admin



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

PostPosted: Thu Mar 29, 2007 7:04 am Reply with quote

Agreed. You da' man!

_________________
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
alnuke
New Member
New Member



Joined: Jun 07, 2005
Posts: 5

PostPosted: Thu Mar 29, 2007 8:10 am Reply with quote

i tried this <!--pagebreak--> in my local machine and does not have any problem

i can see the links to go to the previous and next page at the bottom of the pages.

if you want to put this <!--pagebreak--> you have to click on the source and then add it where you want

Image

Image


Last edited by alnuke on Thu Mar 29, 2007 8:49 am; edited 1 time in total 
View user's profile Send private message
alnuke







PostPosted: Thu Mar 29, 2007 8:10 am Reply with quote

Image

Image


Last edited by alnuke on Thu Mar 29, 2007 8:49 am; edited 1 time in total 
Gremmie







PostPosted: Thu Mar 29, 2007 8:29 am Reply with quote

alnuke wrote:
i tried this <!--pagebreak--> in my local machine and does not have any problem

if you want to put this <!--pagebreak--> you have to click on the source and then add it where you want


Wow...! Very interesting. Thank you for pointing this out. Let me try that also. So if you edit the source directly the editor must not be htmlentity'izing the text. That makes sense.

So the immediate question is, do we leave it like this and just educate people about this trick, or make it more foolproof and still cut over to [--pagebreak--] (it would work in either edit source mode or not). I'm inclined to still go with the [--pagebreak--] since that seems more user friendly and more in line with the original intent of the feature (pre-advanced editor). But a case could be made for not changing anything too.
 
Guardian2003







PostPosted: Thu Mar 29, 2007 8:59 am Reply with quote

I would still be inclined to go with [--pagebreak--] as it is less likely to give us issues in the future. I think its likely there will be more people convert to RN from 7.7+ than converting from 7.5 or lower to RN.
Not thats its any consolation but I'm assuming that anyone 'upgrading' from 7.6 to 7.7+ would have this same problem.
 
alnuke







PostPosted: Thu Mar 29, 2007 9:07 am Reply with quote

the only difficulty i encountered by putting it directly in the source is that when it involves long paragraph or many pages because there is no gaps between paragraphs in the source code that can guide me where to put <!--pagebreak-->.

so in my opinion, [--pagebreak--] option is better
 
kguske







PostPosted: Thu Mar 29, 2007 9:18 am Reply with quote

Agreed.
 
montego







PostPosted: Thu Mar 29, 2007 5:56 pm Reply with quote

We'll have to "cut-over" the page text as well to match. Unfortunately, it does not appear to be in the language define. Not an issue, just thought of it and wanted to mention it.
 
Gremmie







PostPosted: Thu Mar 29, 2007 6:37 pm Reply with quote

Here are the fixes.

In modules/Content/index.php, find this line of code:

Code:


$contentpages = explode( "<!--pagebreak-->", $mytext );


Replace it with this:

Code:


$contentpages = explode( '[--pagebreak--]', $mytext );


Then, for each language you support, you need to update the admin language file. For example, in modules/Content/admin/language/lang-english.php find this:

Code:


if (!defined('_PAGEBREAK')) { define('_PAGEBREAK','If you want multiple pages you can write <b>&lt;!--pagebreak--&gt;</b> where you want to cut.'); }


Replace it with
Code:


if (!defined('_PAGEBREAK')) { define('_PAGEBREAK','If you want multiple pages you can write <b>[--pagebreak--]</b> where you want to cut.'); }


And here is a conversion s~cript

Code:


<?php
///////////////////////////////////////////////////////////////////////
// content_pagebreak_convert.php by Gremmie
// This script converts content with the old <!--pagebreak--> style
// pagebreaks into the newer [--pagebreak--] style.
//
// To use:
// 1) Upload this script to the root directory of your PHP-Nuke
// site (the same directory as index.php).
// 2) Log into your site as an admin.
// 3) Execute the script from your browser, e.g.
// http://www.mysite.com/content_pagebreak_convert.php
// 4) Delete this script from your server
//
///////////////////////////////////////////////////////////////////////

include 'mainfile.php';
include 'header.php';
OpenTable();

if (is_admin($admin))
{
   $sql = 'SELECT pid, text FROM ' . $prefix . '_pages';
   $result = $db->sql_query($sql);
   while ($row = $db->sql_fetchrow($result))
   {
      $pid = intval($row['pid']);
      $text = $row['text'];

      $text = str_replace(array('<!--pagebreak-->', '&lt;!--pagebreak--&gt;'),
                          '[--pagebreak--]',
                          $text);
      $text = addslashes($text);

      $sql = "UPDATE {$prefix}_pages SET text = '$text' WHERE pid = '$pid'";
      $result2 = $db->sql_query($sql);
      if ($result2 === false)
      {
         echo "Oops, problem updating row #$pid!<br />";
      }
   }
   echo '<b>Conversion complete</b><br /><br />';
   echo '<b>Please delete this script from your server now.</b><br /><br />';
}
else
{
   echo '<b>You must be admin to run this script</b><br /><br />';
}

CloseTable();
include 'footer.php';
?>

 
montego







PostPosted: Fri Mar 30, 2007 5:58 am Reply with quote

This looks great Gremmie! (Still cannot believe my previous post... what a dope I am sometimes... hadn't looked in admin/language.)

I will move this over as a RN Bugs, especially since it "breaks" the true functionality of the Content module.
 
montego







PostPosted: Fri Mar 30, 2007 6:11 am Reply with quote

Ok, this has been placed into the RN Bug Fixes forum here:

http://www.ravenphpscripts.com/postx13031-0-0.html

Any further discussion, if pertinent to the issue, should be posted in that thread.
 
montego







PostPosted: Fri Mar 30, 2007 7:32 am Reply with quote

Yes, I removed my post and subsequent posts for two reasons: 1) to avoid confusing people with my brain fart, and 2) to save face. Embarassed Rolling Eyes
 
Gremmie







PostPosted: Sun Apr 15, 2007 9:12 pm Reply with quote

This issue has been assigned to me in the issue tracker. I can fix the code, but how do you want to handle the conversion script? Include with future versions of RN and update the docs to mention it?
 
montego







PostPosted: Mon Apr 16, 2007 6:28 am Reply with quote

Let us continue the discussion over in the issue tracker.
 
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 -> RN Bug Fixes

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 ©