Sorry. I had a series of client meetings/functions & just made it back.
I see that it's finally released to the wild!!!
I know it's a bit late, but if you want to stem the inpending flow of emails
from admins wondering what happened to their layouts, here's code fix the
problem with convert/mod/pagemaster:
replace line 103
$current_section->template = "default.tpl";
with
$current_section->template = newLayout($old_page->layout,
count($new_page->order)+1);
replace line 209
$section_data[] = "default.tpl";
with
$section_data[] = newLayout($old_page->layout,
count($new_page->order)+1);
then insert this function:
/**
* This function converts the old template styles to the new.
*
* We need to set section templates depending on what layout the userpage
* was using and which section number in order we're on. The Layouts
* go as follows:
*
* 1,4) Transfer to image_right.tpl. All sections use the same template.
*
* 2,3) Transfer to image_left.tpl. All sections use the same template.
*
* 5) Odd Sections are image_right. Even Sections are image_left.
*
* 6) Odd Sections are image_left. Even Sections are image_right.
*
* @author Eloi George <el...@NO...>
* @module userpages->pagemaster conversion script
* @param int layout : Layout id of this page.
* @param int position : Section's position in the section_order array.
* @return string : Name of equivalent layout
**/
function newLayout (&$layout, $position)
{
/* Determine is this section's position is even or odd-numbered */
$odd = fmod($position, 2);
/* Layouts 1 or 4 */
if ($layout==1 || $layout==4)
return "image_right.tpl";
/* Layouts 2 or 3 */
if ($layout==2 || $layout==3)
return "image_left.tpl";
/* Layout 5 */
if ($layout==5)
if ($odd)
return "image_right.tpl";
else
return "image_left.tpl";
/* Layout 6 */
if ($layout==6)
if ($odd)
return "image_left.tpl";
else
return "image_right.tpl";
/* If all else fails, give it the default template */
return "default.tpl";
}
Again, you guys have done a really great job!!!!
-Eloi George-
|