function skinlist_recache() { global $settingInfo, $arrSideModule, $DMC, $DBPrefix; //列出Skins目录 $handle = opendir(F2BLOG_ROOT . "./skins/"); while (false !== ($file = readdir($handle))) { if (is_dir(F2BLOG_ROOT . "./skins/{$file}") && file_exists(F2BLOG_ROOT . "./skins/{$file}/skin.xml")) { $arrSkinList[$file] = getSkinInfo($file); } } closedir($handle); $contents = "\$skinlistcache = array(\r\n"; foreach ($arrSkinList as $key => $value) { $contents .= "\t'" . $key . "' => array(\n\t\t"; foreach ($value as $subkey => $subvalue) { if ($subvalue != "" && in_array($subkey, array('SkinName', 'SkinSource', 'SkinDesigner', 'DesignerURL', 'DesignerMail', 'UseFlash', 'FlashPath', 'FlashWidth', 'FlashHeight', 'FlashAlign', 'FlashTop', 'FlashTransparent'))) { $contents .= "'{$subkey}' => '" . $subvalue . "',\n\t\t"; } } $contents .= "),\n"; } $contents .= ");"; writetocache('skinlist', $contents); //保存当前skin信息 if (file_exists(F2BLOG_ROOT . "./skins/" . $settingInfo['defaultSkin'] . "/skin.xml")) { $arrDefaultSkinInfo = getSkinInfo($settingInfo['defaultSkin']); } else { //如果默认skin不存在,则选择上述列表中的第一个皮肤做为默认皮肤。 $arrDefaultSkinInfo = $value; $DMC->query("update " . $DBPrefix . "setting set settValue='" . $key . "' where settName='defaultSkin'"); settings_recache(); } $contents = "\$defaultskincache = array(\r\n"; foreach ($arrDefaultSkinInfo as $subkey => $subvalue) { if ($subvalue != "" && in_array($subkey, array('SkinName', 'SkinSource', 'SkinDesigner', 'DesignerURL', 'DesignerMail', 'UseFlash', 'FlashPath', 'FlashWidth', 'FlashHeight', 'FlashAlign', 'FlashTop', 'FlashTransparent'))) { $contents .= "\t'{$subkey}' => '" . $subvalue . "',\n"; } } $contents .= ");"; writetocache('defaultskin', $contents); }
<?php view_page($page_url); ?> </div> </div> <br> <div class="subcontent"> <table width="97%" border="0" cellspacing="0" cellpadding="0"> <?php $totSkin = count($dirlist); $totRows = ceil($totSkin / 2); for ($i = 0; $i < $totSkin; $i = $i + 2) { $arrSkin = getSkinInfo($dirlist[$i], ".."); //echo $dirlist[$i]."==".$dirlist[$i+1]; if ($i + 1 < $totSkin) { $arrSkin1 = getSkinInfo($dirlist[$i + 1], ".."); } else { $arrSkin1 = ""; } ?> <tr> <td class="skinbox" > <table class="skinboxfont" width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="20"> </td> <td width="100" height="20"> </td> <td width="20"> </td> <td> </td> </tr> <tr class="<?php echo $arrSkin['defSkin'];
" type="image/x-icon" /> <link rel="shortcut icon" href="<?php echo "attachments/" . $settingInfo['favicon']; ?> " type="image/x-icon" /> <script type="text/javascript" src="include/common.js"></script> <!--F2blog Plugins--> <?php do_action("f2_head"); ?> </head> <body> <?php //取得皮肤的信息 $getDefaultSkinInfo = getSkinInfo($blogSkins, "."); //读取flash skin if ($getDefaultSkinInfo['UseFlash'] != "0" && $getDefaultSkinInfo['FlashPath'] != "" && $getDefaultSkinInfo['FlashWidth'] != "" && $getDefaultSkinInfo['FlashHeight'] != "" && $getDefaultSkinInfo['FlashAlign'] != "" && $getDefaultSkinInfo['FlashTop'] != "") { if (file_exists("skins/{$blogSkins}/" . $getDefaultSkinInfo['FlashPath'])) { echo "<div id=\"FlashHead\" style=\"text-align:" . $getDefaultSkinInfo['FlashAlign'] . ";top:" . $getDefaultSkinInfo['FlashTop'] . "px;\"></div> \n"; if ($getDefaultSkinInfo['FlashTransparent'] != "0") { echo "<script type=\"text/javascript\">WriteHeadFlash('skins/{$blogSkins}/" . $getDefaultSkinInfo['FlashPath'] . "','" . $getDefaultSkinInfo['FlashWidth'] . "','" . $getDefaultSkinInfo['FlashHeight'] . "',true)</script> \n"; } else { echo "<script type=\"text/javascript\">WriteHeadFlash('skins/{$blogSkins}/" . $getDefaultSkinInfo['FlashPath'] . "','" . $getDefaultSkinInfo['FlashWidth'] . "','" . $getDefaultSkinInfo['FlashHeight'] . "',false)</script> \n"; } } } ?> <div id="container"> <!--顶部--> <div id="header">
<div id="content"> <div class="contenttitle"><?php echo $title; ?> </div> <br> <div class="subcontent"> <table width="97%" border="0" cellspacing="0" cellpadding="0"> <?php $totSkin = count($dirlist); $totRows = ceil($totSkin / 3); for ($i = 0; $i < $totSkin; $i = $i + 3) { $arrSkin = getSkinInfo($dirlist[$i]); $arrSkin1 = $i + 1 < $totSkin ? getSkinInfo($dirlist[$i + 1]) : ""; $arrSkin2 = $i + 2 < $totSkin ? getSkinInfo($dirlist[$i + 2]) : ""; ?> <tr> <td > <!--皮肤第一列--> <table class="skinboxfont" width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="20"> </td> <td width="100" height="20"> </td> <td width="20"> </td> <td> </td> </tr> <tr class="<?php echo $arrSkin['defSkin']; ?> ">