function SiteFocus($sidename, $sidetitle, $htmlcode, $isInstall) { //解析XML文件 include_once "include/xmlparse.inc.php"; $xmlArray = xmlArray("plugins/SiteFocus/site.xml"); foreach ($xmlArray['item'] as $value) { $site_name[] = $value['imgtext']; $site_url[] = $value['imgurl']; $site_link[] = $value['imglink']; } $imgText = @implode("|", $site_name); $imgUrl = @implode("|", $site_url); $imgLink = @implode("|", $site_link); if (isset($_COOKIE["content_{$sidename}"])) { $display = $_COOKIE["content_{$sidename}"]; } else { $display = $isInstall > 0 ? "none" : ""; } ?> <!--Site Focus--> <div class="sidepanel" id="Side_Site_Focus"> <h4 class="Ptitle" style="cursor: pointer;" onclick="sidebarTools('<?php echo "content_{$sidename}"; ?> ')"><?php echo $sidetitle; ?> </h4> <div class="Pcontent" id="<?php echo "content_{$sidename}"; ?> " style="display:<?php echo $display; ?> "> <script type="text/javascript"> var focus_width=160; var focus_height=120; var text_height=18; var swf_height = focus_height+text_height; var pics="<?php echo $imgUrl; ?> "; var links=encodeURIComponent("<?php echo $imgLink; ?> "); var texts="<?php echo $imgText; ?> "; document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">'); document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="plugins/SiteFocus/focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">'); document.write('<param name="menu" value="false"><param name=wmode value="opaque">'); document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'"></object>'); </script> </span> </a> <span id=focustext class=f14b></span></div> <div class="Pfoot"></div> </div> <?php }
function TimeCounter($sidename, $sidetitle, $htmlcode, $isInstall) { global $settingInfo; //解析XML文件 include_once "include/xmlparse.inc.php"; $xmlArray = xmlArray("plugins/TimeCounter/TimeCounter.xml"); foreach ($xmlArray['item'] as $value) { $arrCounterTitle[] = $value['CounterTitle']; $arrTargetDate[] = $value['TargetDate']; $arrTargetTime[] = $value['TargetTime']; $arrCounterStyle[] = $value['CounterStyle']; } if (isset($_COOKIE["content_{$sidename}"])) { $display = $_COOKIE["content_{$sidename}"]; } else { $display = $isInstall > 0 ? "none" : ""; } ?> <div class="sidepanel" id="Side_Site_TimeCounter"> <h4 class="Ptitle" style="cursor: pointer;" onclick="sidebarTools('<?php echo "content_{$sidename}"; ?> ')"><?php echo $sidetitle; ?> </h4> <div class="Pcontent" id="<?php echo "content_{$sidename}"; ?> " style="display:<?php echo $display; ?> "> <?php foreach ($arrCounterTitle as $key => $value) { //$timestamp=str_format_time($arrTargetDate[$key]." ".$arrTargetTime[$key])-2592000; $timestamp = $arrTargetDate[$key] . " " . $arrTargetTime[$key]; if (preg_match("/[0-9]{4}-[0-9]{1,2}-[0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}/i", $timestamp)) { list($date, $time) = explode(" ", $timestamp); list($year, $month, $day) = explode("-", $date); list($hour, $minute, $second) = explode(":", $time); $timestamp = gmmktime($hour, $minute, $second, $month - 1, $day, $year); if (PHP_VERSION > 4) { $offset = $settingInfo['timezone']; $timestamp = $timestamp - $offset * 3600; } } $counter = format_time("Y,m,d,H,i,s", $timestamp); ?> <div><?php echo $value; ?> </div> <div id="TimeCounter_<?php echo $key; ?> " style="<?php echo $arrCounterStyle[$key]; ?> "></div> <SCRIPT type="text/javascript"> <!-- function show_date_time_<?php echo $key; ?> (){ window.setTimeout("show_date_time_<?php echo $key; ?> ()", 1000); target=new Date(<?php echo $counter; ?> ); today=new Date(); timeold=(target.getTime()-today.getTime()); sectimeold=timeold/1000; secondsold=Math.floor(sectimeold); msPerDay=24*60*60*1000; e_daysold=timeold/msPerDay; daysold=Math.floor(e_daysold); e_hrsold=(e_daysold-daysold)*24; hrsold=Math.floor(e_hrsold); e_minsold=(e_hrsold-hrsold)*60; minsold=Math.floor((e_hrsold-hrsold)*60); seconds=Math.floor((e_minsold-minsold)*60); if (daysold<0) { document.getElementById("TimeCounter_<?php echo $key; ?> ").innerHTML="逾期,倒计时已经失效"; } else { if (daysold<10) {daysold="0"+daysold} if (daysold<100) {daysold="0"+daysold} if (hrsold<10) {hrsold="0"+hrsold} if (minsold<10) {minsold="0"+minsold} if (seconds<10) {seconds="0"+seconds} if (daysold<3) { document.getElementById("TimeCounter_<?php echo $key; ?> ").innerHTML="<font color=red>"+daysold+"天"+hrsold+"小时"+minsold+"分"+seconds+"秒</font>"; } else { document.getElementById("TimeCounter_<?php echo $key; ?> ").innerHTML=daysold+"天"+hrsold+"小时"+minsold+"分"+seconds+"秒"; } } } show_date_time_<?php echo $key; ?> (); //--> </SCRIPT> <?php } ?> </div> <div class="Pfoot"></div> </div> <?php }
Tool URI: http://korsen.f2bLog.com Description: blogbus格式汇入f2bLog Author: korsen Version: 1.0 Author URI: http://korsen.f2bLog.com */ $plugins_path = "../"; include "../include/function.php"; echo "<h2>BLOGBUS汇入F2blog程序</h2>"; $blogbus_xml = "blogbus.xml"; if (!file_exists($blogbus_xml)) { echo "注意事项:汇入的xml名称必须是blogbus.xml,并且通过ftp上传到tools目录下面。"; } else { //解析XML文件 include_once "../include/xmlparse.inc.php"; $xmlArray = xmlArray($blogbus_xml); foreach ($xmlArray['Log'] as $key => $value) { $logTitle[] = encode($value['Title']); $postTime[] = strtotime($value['LogDate']); $logContent[] = str_replace("'", "'", $value['Content']); $saveType[] = 1; $isComment[] = 1; $isTrackback[] = 1; $author[] = $value['Writer']; $quoteUrl[] = $value['TrackBack']; $tags[] = $value['Tags']; $arr_comments[$key] = empty($value['Comments'][0]['Comment']) ? array() : $value['Comments'][0]['Comment']; } //删除类别和删除日志 $DMC->query("TRUNCATE TABLE " . $DBPrefix . "categories"); $DMC->query("TRUNCATE TABLE " . $DBPrefix . "logs");
if (!defined('IN_F2BLOG')) { die('Access Denied.'); } //输出头部信息 dohead($title, ""); require 'admin_menu.php'; //读取编辑器 include_once F2BLOG_ROOT . "./include/xmlparse.inc.php"; $handle = opendir("../editor/"); $arr_editorName = array(); $arr_editorPath = array(); $editorpath = ""; while ($file = readdir($handle)) { if (preg_match("/editor_(.+)\\.xml/is", $file)) { $arr_editor = xmlArray(F2BLOG_ROOT . "./editor/{$file}"); $arr_editorName[] = $arr_editor['EditorName']; $arr_editorRemark[$arr_editor['EditorName']] = $arr_editor['EditorDecription']; $arr_editorPath[$arr_editor['EditorName']] = $arr_editor['EditorPath']; $arr_editorCode[$arr_editor['EditorName']] = $arr_editor['EditorCode']; //取得相对应的编辑器 if ($arr_editor['EditorName'] == $logsediter) { $editorpath = F2BLOG_ROOT . "./" . $arr_editor['EditorPath']; $editorcode = $arr_editor['EditorCode']; } } } //没有该编辑器,将取得默认编辑器。 if (!file_exists($editorpath)) { $editorcode = $arr_editorCode[$settingInfo['defaultedits']]; $editorpath = F2BLOG_ROOT . "./" . $arr_editorPath[$settingInfo['defaultedits']];
function getEditorPluginInfo($plugindir, $basedir) { global $settingInfo; $arrPlugin = array(); $wdir = "{$basedir}/editor/plugins/" . $plugindir . "/"; $xmlfile = $wdir . "plugin.xml"; if (file_exists($xmlfile)) { include_once F2BLOG_ROOT . "./include/xmlparse.inc.php"; $arrPluginList = xmlArray($xmlfile); $arrPlugin['PluginName'] = $arrPluginList['PluginName']; $arrPlugin['PluginVersion'] = $arrPluginList['PluginVersion']; $arrPlugin['FunctionName'] = $arrPluginList['FunctionName']; $arrPlugin['FunctionImage'] = $arrPluginList['FunctionImage']; $arrPlugin['FunctionDesc'] = $arrPluginList['FunctionDesc']; $arrPlugin['pubDate'] = $arrPluginList['pubDate']; $arrPlugin['PluginAuthor'] = $arrPluginList['PluginAuthor']; $arrPlugin['AuthorURL'] = $arrPluginList['AuthorURL']; $arrPlugin['AuthorMail'] = $arrPluginList['AuthorMail']; } return $arrPlugin; }
function birth($sidename, $sidetitle, $htmlcode, $isInstall) { global $settingInfo; include_once "include/xmlparse.inc.php"; $xmlArray = xmlArray("plugins/birth/birth.xml"); foreach ($xmlArray['item'] as $value) { $arrbirthTitle[] = $value['birthTitle']; $arrbirthDate[] = $value['birthDate']; $arrtextColor[] = $value['textColor']; } if (isset($_COOKIE["content_{$sidename}"])) { $display = $_COOKIE["content_{$sidename}"]; } else { $display = $isInstall > 0 ? "none" : ""; } ?> <div class="sidepanel" id="Side_Site_birth"> <h4 class="Ptitle" style="cursor: pointer;" onclick="sidebarTools('<?php echo "content_{$sidename}"; ?> ')"><?php echo $sidetitle; ?> </h4> <div class="Pcontent" id="<?php echo "content_{$sidename}"; ?> " style="display:<?php echo $display; ?> "> <?php foreach ($arrbirthTitle as $key => $value) { $timestamp = $arrbirthDate[$key] . " 00:00:00"; if (preg_match("/[0-9]{4}-[0-9]{1,2}-[0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}/i", $timestamp)) { list($date, $time) = explode(" ", $timestamp); list($year, $month, $day) = explode("-", $date); list($hour, $minute, $second) = explode(":", $time); $timestamp = gmmktime($hour, $minute, $second, $month, $day, $year); if (PHP_VERSION > 4) { $offset = $settingInfo['timezone']; $timestamp = $timestamp - $offset * 3600; } } $byear = format_time("Y", $timestamp); $bmonth = format_time("n", $timestamp); $bday = format_time("j", $timestamp); $textColor = $arrtextColor[$key]; ?> <SCRIPT type="text/javascript"> var rstr=""; rstr=show_date("<?php echo $value; ?> ",<?php echo $byear; ?> ,<?php echo $bmonth; ?> ,<?php echo $bday; ?> ,"<?php echo $textColor; ?> "); document.write(rstr); </SCRIPT> <?php } ?> </div> <div class="Pfoot"></div> </div> <?php }