Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 06:07:24 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155547 Posts in 21714 Topics by 7736 Members
Latest Member: chris85
* Home Help Search Login Register
Pages: 1 2 3 [4]   Go Down
Print
Author Topic: [ADDON - 2.6.x] Page Cloner  (Read 24306 times)
NorHei
Forum administrator
*****
Offline Offline

Posts: 485



WWW
« Reply #75 on: February 01, 2012, 07:08:17 PM »

hmm... removed pagecloner completely, reinistalled , it now copies code pages too...
Logged

It is easier to change the specification to fit the program than vice versa.
Xagone
AddOn Development
*
Offline Offline

Posts: 478



WWW
« Reply #76 on: February 19, 2012, 10:45:03 PM »

Smiley
found a bug, if you tried to copie a page with an ' in it... Smiley

added mysql_real_escape_s tring around page_title when inserting into DB, fixed it.
Logged

Xagone Inc. (formerly VotreEspace)
http://www.xagone.com/
BlackBird
AddOn Development
*
Offline Offline

Posts: 2069



WWW
« Reply #77 on: February 20, 2012, 11:01:02 AM »

Thanks for the hint. I've created a GitHub Repo for the Page Cloner now to allow anyone to create pull requests.

https://github.com/webbird/pagecloner
Logged

Alle großen Veränderungen beginnen im Kleinen
badknight
Security Team

Offline Offline

Posts: 246



WWW
« Reply #78 on: March 06, 2012, 08:04:03 PM »

i found a little bug:

if you use mpform and you want to clone it:

1) in the mod_mpform_settings => field tbl_suffix there is the "old" section_id

2) if you clone the mpform and not modify any fields the table "mod_mpform_results_ SECTION_ID" is missing.

the $tpl_suffix in tool_doclone.php must look like this:

Code:
$tbl_suffix = addslashes($section_id);

And after the
Code:
$database->query("INSERT INTO ".TABLE_PREFIX."mod_mpform_fields (section_id, page_id, position, title, type, required, value, extra, help) VALUES ('$section_id','$page_id','$position','$title','$type','$required','$value','$extra', '$help')");
        }

You must add a little code like this:

Code:
$results = TABLE_PREFIX . "mod_mpform_results_" . $section_id;
$s = "CREATE TABLE `$results` ( `session_id` VARCHAR(20) NOT NULL,"
. ' `started_when` INT NOT NULL DEFAULT \'0\' ,'      // time when first form was sent to browser
. ' `submitted_when` INT NOT NULL DEFAULT \'0\' ,'    // time when last form was sent back to server
. ' `referer` VARCHAR( 255 ) NOT NULL, ' // referer page
. ' PRIMARY KEY ( `session_id` ) '
. ' )';
$database->query($s);
// load field ID's
$sql = "SELECT field_id FROM ".TABLE_PREFIX."mod_mpform_fields WHERE section_id = ".$section_id;
$get_field_id = $database->query($sql);
        while ($is_fieldid=$get_field_id->fetchRow()) {
$fieldSQL = "ALTER TABLE `$results` add `field" . $is_fieldid["field_id"] . "` TEXT NOT NULL";
$database->query($fieldSQL);
}

note: it's just a quick & dirty solution
Logged

Ich würde gern die Welt verändern, doch Gott gibt mir den Quellcode nicht...
Pages: 1 2 3 [4]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!