Note: this list is kept only as a demonstration for CVSNotice. For the latest CVS notices, see the Xaraya and Postnuke sites
View Statistics - Next Notice - Previous NoticeDirectory filter : [ all ] / postnuke_official / tests / blocklayout [ view in CVS ]
| Date | Directory [filter] | File(s) [view] | Author [filter] |
| 30 Jul 2002 03:52:03 | postnuke_official/tests/blocklayout | convert.php,NONE,1.1 | Paul Rosania |
| theme.php -> blocklayout theme converter. CAUTION: Use in well-ventilated area. Harmful or fatal if swallowed. | |||
Update of /home/cvsroot/postnuke_official/tests/blocklayout
In directory ns7.hostnuke.net:/tmp/cvs-serv14208
Added Files:
convert.php
Log Message:
theme.php -> blocklayout theme converter. CAUTION: Use in well-ventilated area. Harmful or fatal if swallowed.
--- NEW FILE: convert.php ---
<?php if (!isset($theme)) { ?>
<html><head><title>Legacy Theme Converter</title></head>
<body bgcolor="#ffffff">
<form action="<?php echo $PHP_SELF; ?>" method="post">
Theme name: <input type="text" name="theme" value="" />
<input type="submit" value="Go!" />
</form><br /><br />
Before doing this, you must chmod 777 the theme's directory.<br />
Be sure to chmod 755 the directory afterward.<br />
</body></html>
<?php
exit;
}
include 'includes/pnAPI.php';
pnInit();
echo 'Converting legacy theme \''.$theme.'\'...<br />'."\n";
$theme_dir = "themes/$theme/";
$theme_file = $theme_dir.'theme.php';
if (!file_exists($theme_file)) {
echo 'Theme \''.$theme.'\' not found.';
exit;
}
$file = join('', file($theme_file));
$file = str_replace("\"\n", "'\n", $file);
$file = str_replace('".', "'.", $file);
$file = str_replace('";', "';", $file);
$file = str_replace('."', ".'", $file);
$file = str_replace('\"', '"', $file);
$file = str_replace('echo "', "echo '", $file);
$file = str_replace('\n', '\'."\n".\'', $file);
$file = str_replace(".''", '', $file);
$fp = fopen($theme_dir . 'temp.php', 'w+');
fwrite($fp, $file);
fclose($fp);
// bring out right and center blocks
global $index;
$index = 1;
global $thename;
$thename = $theme;
include $theme_file;
if (file_exists($theme_dir . 'pnlang/eng/global.php')) {
include $theme_dir . 'pnlang/eng/global.php';
}
if (!file_exists($theme_dir.'pages')) {
mkdir($theme_dir.'pages', 0777);
}
if (!file_exists($theme_dir.'blocks')) {
mkdir($theme_dir.'blocks', 0777);
}
$fp = fopen($theme_dir.'pages/default.pnt', 'w');
// get header output
ob_start();
head();
themeheader();
$output = ob_get_contents();
ob_end_clean();
$output = str_replace('$thename', $theme, $output);
//$output = ereg_replace('\$([a-zA-Z_][a-zA-Z_0-9]*)', '<pnt:var name="\\1" />', $output);
fwrite($fp, $output);
fwrite($fp, "\n".'<pnt:module main="true" />'."\n");
// get footer output
ob_start();
themefooter();
$output = ob_get_contents();
ob_end_clean();
fwrite($fp, $output."</body>\n</html>\n");
fclose($fp);
$fp = fopen($theme_dir.'blocks/default.pnt', 'w');
ob_start();
themesidebox(array('position' => 'l',
'title' => '<pnt:var name="title" />',
'content' => '<pnt:var name="content" />'));
$output = ob_get_contents();
ob_end_clean();
fwrite($fp, $output);
fclose($fp);
$fp = fopen($theme_dir.'blocks/right.pnt', 'w');
ob_start();
themesidebox(array('position' => 'r',
'title' => '<pnt:var name="title" />',
'content' => '<pnt:var name="content" />'));
$output = ob_get_contents();
ob_end_clean();
fwrite($fp, $output);
fclose($fp);
echo 'done.';
// simulate blocks()
function blocks($side) { echo "\n<pnt:blockgroup name=\"$side\" />\n"; }
// simulate header.php
function head($themeOverrideCategory = "", $themeOverrideStory = "") {
global
$index,
$artpage,
$topic,
$hlpfile,
$hr,
$theme,
$bgcolor1,
$bgcolor2,
$bgcolor3,
$bgcolor4,
$bgcolor5,
$textcolor1,
$textcolor2,
$textcolor3,
$textcolor4,
$forumpage,
$thename,
$postnuke_theme,
$pntheme,
$themename,
$themeimages,
$additional_header;
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
echo "<html>\n<head>\n";
if (defined("_CHARSET") && _CHARSET != "") {
echo "<meta http-equiv=\"Content-Type\" ".
"content=\"text/html; charset="._CHARSET."\">\n";
}
/**
* all other page output
*/
echo '<title><pnt:var scope="config" name="sitename" /> :: <pnt:var scope="config" name="slogan" /></title>'."\n";
echo '<meta name="KEYWORDS" content="'.pnConfigGetVar('metakeywords')."\" />\n";
echo '<meta name="DESCRIPTION" content="&pnt-config-slogan;" />'."\n";
echo "<meta name=\"ROBOTS\" content=\"INDEX,FOLLOW\" />\n";
echo "<meta name=\"resource-type\" content=\"document\" />\n";
echo "<meta http-equiv=\"expires\" content=\"0\" />\n";
echo '<meta name="author" content="&pnt-config-sitename;" />'."\n";
echo '<meta name="copyright" content="Copyright (c) 2001 by &pnt-config-sitename;" />'."\n";
echo "<meta name=\"revisit-after\" content=\"1 days\" />\n";
echo "<meta name=\"distribution\" content=\"Global\" />\n";
echo '<meta name="generator" content="PostNuke &pnt-config-version_num; - http://postnuke.com" />'."\n";
echo "<meta name=\"rating\" content=\"General\" />\n";
echo "<link rel=\"StyleSheet\" href=\"" . pnUserGetTheme() . "/style/styleNN.css\" type=\"text/css\" />\n";
echo "<style type=\"text/css\">";
echo "@import url(\"".pnUserGetTheme()."/style/style.css\"); ";
echo "</style>\n";
//echo "<script type=\"text/javascript\" src=\"javascript/showimages.php\"></script>\n\n";
//echo "<script type=\"text/javascript\" src=\"javascript/openwindow.php?hlpfile=$hlpfile\"></script>\n\n";
}
// simulate footer.php
function footmsg()
{
echo '<font class="pn-sub">'."\n"
.'<pnt:var name="foot1" scope="config" /><br />'."\n</font>\n";
}
?>
View Statistics - Next Notice - Previous Notice
| Visit Developer Site - Browse CVS Repository |
Syndicate via backend.rss (max. once per hour please) | Powered by CVSNotice 0.1.3 |