| Author |
Message |
kguske Site Admin

Joined: Jun 04, 2004 Posts: 6044
|
Posted:
Wed Mar 28, 2007 4:20 pm |
|
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. |
|
|
|
 |
Gremmie Former Moderator in Good Standing

Joined: Apr 06, 2006 Posts: 2415 Location: Iowa, USA
|
Posted:
Wed Mar 28, 2007 8:47 pm |
|
I agree about going to the new [--pagebreak--] and posting a conversion script. Do we have a consensus? |
|
|
|
 |
Guardian2003 Site Admin

Joined: Aug 28, 2003 Posts: 6373 Location: Vsetin, Czech Republic
|
Posted:
Thu Mar 29, 2007 1:28 am |
|
|
|
 |
montego Site Admin

Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
|
Posted:
Thu Mar 29, 2007 7:04 am |
|
|
|
 |
alnuke New Member


Joined: Jun 07, 2005 Posts: 5
|
Posted:
Thu Mar 29, 2007 8:10 am |
|
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
 |
Last edited by alnuke on Thu Mar 29, 2007 8:49 am; edited 1 time in total |
|
|
 |
alnuke New Member


Joined: Jun 07, 2005 Posts: 5
|
Posted:
Thu Mar 29, 2007 8:10 am |
|
 |
Last edited by alnuke on Thu Mar 29, 2007 8:49 am; edited 1 time in total |
|
|
 |
Gremmie Former Moderator in Good Standing

Joined: Apr 06, 2006 Posts: 2415 Location: Iowa, USA
|
Posted:
Thu Mar 29, 2007 8:29 am |
|
| 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 Site Admin

Joined: Aug 28, 2003 Posts: 6373 Location: Vsetin, Czech Republic
|
Posted:
Thu Mar 29, 2007 8:59 am |
|
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 New Member


Joined: Jun 07, 2005 Posts: 5
|
Posted:
Thu Mar 29, 2007 9:07 am |
|
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 Site Admin

Joined: Jun 04, 2004 Posts: 6044
|
Posted:
Thu Mar 29, 2007 9:18 am |
|
|
|
 |
montego Site Admin

Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
|
Posted:
Thu Mar 29, 2007 5:56 pm |
|
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 Former Moderator in Good Standing

Joined: Apr 06, 2006 Posts: 2415 Location: Iowa, USA
|
Posted:
Thu Mar 29, 2007 6:37 pm |
|
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><!--pagebreak--></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-->', '<!--pagebreak-->'),
'[--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 Site Admin

Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
|
Posted:
Fri Mar 30, 2007 5:58 am |
|
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 Site Admin

Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
|
Posted:
Fri Mar 30, 2007 6:11 am |
|
Ok, this has been placed into the RN Bug Fixes forum here:
Any further discussion, if pertinent to the issue, should be posted in that thread. |
|
|
|
 |
montego Site Admin

Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
|
Posted:
Fri Mar 30, 2007 7:32 am |
|
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.  |
|
|
|
 |
Gremmie Former Moderator in Good Standing

Joined: Apr 06, 2006 Posts: 2415 Location: Iowa, USA
|
Posted:
Sun Apr 15, 2007 9:12 pm |
|
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 Site Admin

Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
|
Posted:
Mon Apr 16, 2007 6:28 am |
|
Let us continue the discussion over in the issue tracker. |
|
|
|
 |
|
|
|
|