Upgrading a theme from 9.1.2 to 9.2
-> Dragonfly Theming Tips & Tricks

#1: Upgrading a theme from 9.1.2 to 9.2 Author: rlguraLocation: Cleveland, OH USA PostPosted: Wed Jan 14, 2009 4:28 am
    ----
Upgrade from 9.1 to 9.2:

* Make sure your This_Theme/templates/block.html exists and works properly

* If you're including This_Theme/templates/admin, include new settings.html (actually refresh all of these from default)
(still recommended not to include temlates/admin)

* Styles changes:
Add class: img {border: 0;}
Add additional style sheets (opera.css, safari.css, adminblocks.css)

* Additional files:
/javascript/adminblocks.js
/images/drag.png
/images/thumbtack.gif
/images/tabletree.png
/images/recycle_full.png
/images/recycle_empty.png
/images/cursors/*

* Themes.php changes:

Find and replace: with:
blocks('left'); ---> $Blocks->display('l');
blocks('right'); ---> $Blocks->display('r');
blocks('center') ---> $Blocks->display('c');
blocks('down') ---> $Blocks->display('d');
hideblock( ---> $Blocks->hideblock(


in function themeheader():
add $Blocks to global variable list and add $css_ie:
Array:
	$css_ie = ereg('MSIE 7.0', $user_agent) ? 'ie7' : (ereg('MSIE ([0-6].[0-9]{1,2})', $user_agent) ? 'ie6' : ((isset($_SESSION['SECURITY']['UA']) && $_SESSION['SECURITY']['UA'] == 'Safari') ? 'safari' : ((isset($_SESSION['SECURITY']['UA']) && $_SESSION['SECURITY']['UA'] == 'Opera') ? 'opera' : '')));

Change this:
Array:
	// left blocks ?
	if (blocks_visible('l')) {
		$img = hideblock('600') ? 'plus.gif' : 'minus.gif';
		$imgl = '<img align="left" alt="Toggle Content" title="Toggle Content" id="pic600" src="themes/'.$CPG_SESS['theme'].'/images/'.$img.'" onclick="blockswitch(\'600\');" style="cursor:pointer" />';
	}
	// right blocks ?
	if (blocks_visible('r')) {
		$img = hideblock('601') ? 'plus.gif' : 'minus.gif';
		$imgr = '<img align="right" alt="Toggle Content" title="Toggle Content" id="pic601" src="themes/'.$CPG_SESS['theme'].'/images/'.$img.'" onclick="blockswitch(\'601\');" style="cursor:pointer" />';
	}

to this:
Array:
	// left blocks ?
	if ($Blocks->l && ($Blocks->showblocks & 1)) {
		$img = $Blocks->hideblock('600') ? 'plus.gif' : 'minus.gif';
		$imgl = '<img alt="'._TOGGLE.'" title="'._TOGGLE.'" id="pic600" src="themes/'.$CPG_SESS['theme'].'/images/'.$img.'" onclick="blockswitch(\'600\');" style="cursor:pointer; float:left; padding:2px 0 2px 0;" />';
	}
	// right blocks ?
	if ($Blocks->r && ($Blocks->showblocks & 2)) {
		$img = $Blocks->hideblock('601') ? 'plus.gif' : 'minus.gif';
		$imgr = '<img alt="'._TOGGLE.'" title="'._TOGGLE.'" id="pic601" src="themes/'.$CPG_SESS['theme'].'/images/'.$img.'" onclick="blockswitch(\'601\');" style="cursor:pointer; float:right; padding:2px 0 2px 0;" />';
	}

Change in $cpgtpl->assign_vars(array(
Array:
		
'CSS_IE'		=> ($css_ie) ? '<link rel="stylesheet" type="text/css" href="themes/'.$CPG_SESS['theme'].'/style/'.$css_ie.'.css" />' : '',
'S_TOGGLE'		=> _TOGGLE,
Remove 'B_L_HIDDEN' => hideblock....

In function themefooter():
add $Blocks to global variable list

Remove these functions:
themesidebox(),



* Template file changes:

Find & replace:
Header.html: src="{leftblock.S_IMAGE}" ---> src="{leftblock.S_IMAGE}.gif"
Footer.hmtl: src="{rightblock.S_IMAGE}" ---> src="{rightblock.S_IMAGE}.gif"
Block.html: src="{block.S_IMAGE}" ---> src="{block.S_IMAGE}.gif"

News:
in Index.html, find {newstopic.S_MORELINK} and replace with:
Array:
{newstopic.S_MORELINK}{newstopic.S_COMMLINK}{newstopic.S_PRNTLINK}{newstopic.S_FRNDLINK}{newstopic.S_CATLINK}{newstopic.S_SCORLINK}



-> Dragonfly Theming Tips & Tricks

All times are GMT

Page 1 of 1