Example #1
0
function modules_recache()
{
    global $DMC, $DBPrefix;
    $query_sql = "select id,name,modTitle from " . $DBPrefix . "modules where disType='0' and isHidden='0' order by orderNo";
    $query_result = $DMC->query($query_sql);
    $arr_parent = $DMC->fetchQueryAll($query_result);
    for ($i = 0; $i < count($arr_parent); $i++) {
        //get sub category
        $sub_sql = "select * from " . $DBPrefix . "modules where disType='" . $arr_parent[$i]['id'] . "' and isHidden='0' order by orderNo";
        $sub_result = $DMC->query($sub_sql);
        $arr_sub[$i] = $DMC->fetchQueryAll($sub_result);
    }
    //保存菜单
    $sub_contents = "";
    $plugin_array_name = array();
    for ($i = 0; $i < count($arr_parent); $i++) {
        switch ($i) {
            case 0:
                //顶部栏
                $out_fields = array("modTitle", "installDate", "pluginPath", "indexOnly");
                $sub_contents .= "\$arrTopModule = array(\r\n";
                break;
            case 1:
                //侧边栏
                $out_fields = array("modTitle", "htmlCode", "isInstall", "installDate", "indexOnly");
                $sub_contents .= "\$arrSideModule = array(\r\n";
                break;
            case 2:
                //主体栏
                $out_fields = array("modTitle", "installDate", "indexOnly", "htmlCode");
                $sub_contents .= "\$arrMainModule = array(\r\n";
                break;
            case 3:
                //功能栏
                $out_fields = array("modTitle", "installDate");
                $sub_contents .= "\$arrFuncModule = array(\r\n";
                break;
        }
        for ($j = 0; $j < count($arr_sub[$i]); $j++) {
            $sub_contents .= "\t'" . $arr_sub[$i][$j]['name'] . "' => array(\n\t\t";
            foreach ($out_fields as $value) {
                if (strpos($arr_sub[$i][$j][$value], "[/var]") > 0) {
                    $arr_sub[$i][$j][$value] = replace_string($arr_sub[$i][$j][$value]);
                }
                if ($value == "installDate" && $arr_sub[$i][$j]["installDate"] > 0 || $value != "installDate") {
                    $sub_contents .= "'{$value}' => '" . $arr_sub[$i][$j][$value] . "',\n\t\t";
                }
            }
            $sub_contents .= "),\n";
            if ($arr_sub[$i][$j]['installDate'] > 0) {
                $plugin_array_name[] = $arr_sub[$i][$j]['name'];
            }
        }
        $sub_contents .= "\n);\n\n";
    }
    $sub_contents .= "\$arrPluginName = array(\r\n";
    for ($i = 0; $i < count($plugin_array_name); $i++) {
        $sub_contents .= "\t'" . $i . "' => '" . $plugin_array_name[$i] . "',\n";
    }
    $sub_contents .= ");";
    //保存Cache
    $contents = $sub_contents;
    writetocache('modules', $contents);
    //生成头部cache
    logs_header_recache($arr_sub[0]);
    //生成侧边栏cache
    logs_sidebar_recache($arr_sub[1]);
}
        echo $strDeleteLog;
        ?>
')) {return false}"><?php 
        echo $strDelete;
        ?>
</a>
		<?php 
    }
    ?>
	  </div>
	</div>
	<?php 
    //读取內容插件或模組
    for ($i = 0; $i < count($arrMainModule); $i++) {
        $mainname = $arrMainModule[$i]['name'];
        $maintitle = replace_string($arrMainModule[$i]['modTitle']);
        $htmlcode = $arrMainModule[$i]['htmlCode'];
        $indexOnly = $arrMainModule[$i]['indexOnly'];
        $installDate = $arrMainModule[$i]['installDate'];
        $pluginPath = $arrMainModule[$i]['pluginPath'];
        //$strModuleContentShow=array("0所有内容头部","1所有内容尾部","2首页内容头部","3首页内容尾部","4首页日志尾部","5读取日志尾部");
        if ($indexOnly == 5) {
            //读取日志尾部
            if ($installDate > 0) {
                //表示为插件
                do_filter($mainname, $mainname, $maintitle, $htmlcode);
            } else {
                main_module($mainname, $maintitle, $htmlcode);
            }
        }
    }
Example #3
0
     $borwseTitle = $strHotTags;
     break;
 case "userinfo":
     $load_file = "include/userinfo.inc.php";
     $borwseTitle = $strHotTags;
     break;
 default:
     for ($i = 0; $i < count($arrTopModule); $i++) {
         if ($load == $arrTopModule[$i]['name'] && strpos($arrTopModule[$i]['pluginPath'], ".inc.php") > 0) {
             $load_file = $arrTopModule[$i]['pluginPath'];
             $borwseTitle = replace_string($arrTopModule[$i]['modTitle']);
             break;
         }
         if ($load == $arrTopModule[$i]['name'] && strpos($arrTopModule[$i]['pluginPath'], ".big.php") > 0) {
             $load_file = $arrTopModule[$i]['pluginPath'];
             $borwseTitle = replace_string($arrTopModule[$i]['modTitle']);
             break;
         }
     }
     //装载默认首页
     if (!isset($load_file)) {
         //保存列表/普通显示
         if ($_GET['disType'] == "" and $_COOKIE['disType'] == "") {
             $disType = $settingInfo['disType'];
         } else {
             if ($_GET['disType'] != "") {
                 $disType = $_GET['disType'];
                 setcookie("disType", $disType, time() + 1 * 24 * 3600, $cookie_path);
             } else {
                 $disType = $_COOKIE['disType'];
             }
    ?>
				  </td>
				</tr>
				<?php 
    //取得子菜单
    $sub_sql = "select * from " . $DBPrefix . "modules where disType='" . $arr_parent[$i]['id'] . "' order by {$order}";
    $query_result = $DMC->query($sub_sql);
    $index = 0;
    while ($fa = $DMC->fetchArray($query_result)) {
        $index++;
        $parent = $fa['disType'];
        $imgHidden = $fa['isHidden'] == 1 ? "&nbsp;&nbsp;<img src='themes/{$settingInfo['adminstyle']}/lock.gif' alt='{$strModAlrHidden}' title='{$strModAlrHidden}'>" : "&nbsp;";
        $imgSideHidden = $fa['isInstall'] == 1 ? "&nbsp;&nbsp;<img src='themes/{$settingInfo['adminstyle']}/lock.gif' title='{$strModuleSideStyleHidden}'>" : "&nbsp;";
        //$imgIndexOnly=($fa['indexOnly']==1)?"&nbsp;&nbsp;<img src='themes/{$settingInfo['adminstyle']}/add_top.gif' title='$strModIndexOnly'>":"&nbsp;";
        $imgPlugin = $fa['installDate'] != 0 ? "&nbsp;&nbsp;<img src='themes/{$settingInfo['adminstyle']}/plugin.gif' title='{$strPlugin}'>" : "&nbsp;";
        $modTitle = replace_string($fa['modTitle']);
        if ($fa['isSystem'] != 1) {
            $isSystem = "<a href='{$edit_url}&mark_id=" . $fa['id'] . "&action=edit'><img src='themes/{$settingInfo['adminstyle']}/icon_modif.gif' alt='{$strEdit}' title='{$strEdit}' border=\"0\"></a>";
            $isSystem .= "&nbsp;<a href='#' onclick=\"ConfirmForm('{$edit_url}&mark_id=" . $fa['id'] . "&action=delete','{$strAlertDeleteOption}')\"><img src='themes/{$settingInfo['adminstyle']}/del.gif' alt='{$strDelete}' title='{$strDelete}' border=\"0\"></a>";
            $isClass = "";
        } else {
            $isSystem = "&nbsp;";
            $isClass = "table_color3";
        }
        //显示方式
        if ($parent == 1) {
            $imgIndexOnly = $fa['indexOnly'] == 1 ? $strYes : $strNo;
        } else {
            if ($parent == 2) {
                $imgIndexOnly = $fa['indexOnly'] == 1 ? "<img src='themes/{$settingInfo['adminstyle']}/add_top.gif' title='{$strSidebarViewPosition}' alt='{$strSidebarViewPosition}'>" : "";
            } else {
Example #5
0
 /**
  * Search for an existing tracking image and insert a new one if none are present.
  *
  * Parses the tracking image and unique ID out of the body if there are any.
  *
  * The email will be tracked, but only if one and only one of the recipients
  * corresponds to a contact in X2Engine (remember, the user can switch the
  * recipient list at the last minute by modifying the "To:" field).
  *
  * Otherwise, there's absolutely no way of telling with any certainty who
  * exactly opened the email (all recipients will be sent the same email,
  * so any one of them could be the one who opens the email and accesses the
  * email tracking image). Thus, in such cases, it is pointless to create an
  * event/action that says "so-and so has opened an email" because who opened
  * the email is ambiguous and practically unknowable, and thus impractical
  * to create an email tracking record.
  *
  * @param bool $replace reset the image markup and unique ID, and replace
  * 	the existing tracking image.
  */
 public function insertTrackingImage($replace = false)
 {
     $recipientContacts = $this->recipientContacts;
     if (count($recipientContacts) == 1) {
         // Note, if there is more than one contact in the recipient list, it is
         // impossible to distinguish who opened the email, because both will be
         // sent the same email. Thus it will be disabled for this use case until
         // we have time to re-write this class a bit so that it supports sending
         // distinct email bodies for each different recipient (so that each can
         // have its own different tracking image)
         $theContact = reset($recipientContacts);
         if (!empty($theContact)) {
             // The one person who was sent an email is an existing contact
             $insertNew = true;
             $pattern = self::insertedPattern('track', '(<img.*\\/>)', 1, 'u');
             if (preg_match($pattern, $this->message, $matchImg)) {
                 if ($replace) {
                     // Reset unique ID and insert a new tracking image with a new unique ID
                     $this->_trackingImage = null;
                     $this->_uniqueId = null;
                     $this->message = replace_string($matchImg[0], self::insertedPattern('track', $this->trackingImage), $this->message);
                 } else {
                     $this->_trackingImage = $matchImg[1];
                     if (preg_match(self::UIDREGEX, $this->_trackingImage, $matchId)) {
                         $this->_uniqueId = $matchId[1];
                         $insertNew = false;
                     }
                 }
             }
             if ($insertNew) {
                 $this->insertInBody(self::insertedPattern('track', $this->trackingImage));
             }
         }
     }
 }
			  <td width="10%" align="center"><?php 
echo $strCategoryOrderNo;
?>
</td>
			  <td width="30%"><?php 
echo $strModName;
?>
</td>
			  <td width="30%"><?php 
echo $strModuleDescription;
?>
</td>
			</tr>
			<?php 
for ($i = 0; $i < count($arr_parent); $i++) {
    $modTitle = replace_string($arr_parent[$i]['modTitle']);
    ?>
				<tr>
				  <td width="10%" align="center">
					<input type="hidden" name="arrid[]" value="<?php 
    echo $arr_parent[$i]['id'];
    ?>
">
					<input name="orderNo[]" id="orderNo" class="textbox" type="TEXT" size=2 maxlength=5 value="<?php 
    echo $arr_parent[$i]['orderNo'];
    ?>
" onKeyPress="if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false; "></td>
				  <td width="30%"><?php 
    echo $arr_parent[$i]['name'];
    ?>
</td>
Example #7
0
echo $settingInfo['blogTitle'];
?>
      </div>
    </div>
    <!--顶部菜单-->
    <div id="menu">
      <div id="Left"></div>
      <div id="Right"></div>
      <ul>
		<li class="menuL"></li>
		<?php 
//读取顶部栏
for ($i = 0; $i < count($arrTopModule); $i++) {
    $topid = $arrTopModule[$i]['id'];
    $topname = $arrTopModule[$i]['name'];
    $toptitle = replace_string($arrTopModule[$i]['modTitle']);
    $htmlcode = $arrTopModule[$i]['htmlCode'];
    $pluginPath = $arrTopModule[$i]['pluginPath'];
    $installDate = $arrTopModule[$i]['installDate'];
    if ($pluginPath == "#") {
        echo "<li><a class=\"menuA\" id=\"{$topname}\" title=\"{$toptitle}\">{$toptitle}</a>" . str_replace("&quot;", "\"", dencode($htmlcode)) . "</li> \n";
    } else {
        if (strpos($pluginPath, ".inc.php") > 0 || strpos($pluginPath, ".big.php") > 0) {
            echo "<li><a class=\"menuA\" id=\"{$topname}\" title=\"{$toptitle}\" href=\"index.php?load={$topname}\">{$toptitle}</a></li> \n";
        } else {
            if ($installDate > 0) {
                //表示为插件
                do_filter($topname, $topname, $toptitle);
            } else {
                echo "<li><a class=\"menuA\" id=\"{$topname}\" title=\"{$toptitle}\" href=\"{$pluginPath}\">{$toptitle}</a></li> \n";
            }
Example #8
0
 </div>
        </div>
        <!--顶部菜单-->
        <div id="menu">
            <div id="Left"></div>
            <div id="Right"></div>
            <ul>
                <li class="menuL"></li>
                <?php 
$sql = "select * from " . $DBPrefix . "modules where disType='1' and isHidden='0'  order by orderNo";
$result = $DMC->query($sql);
$key = 1;
while ($aryDetail = $DMC->fetchArray($result)) {
    //	var_dump($aryDetail);
    if (strpos($aryDetail['modTitle'], "[/var]") > 0) {
        $aryDetail['modTitle'] = replace_string($aryDetail['modTitle']);
    }
    $topname = is_int($key) ? $aryDetail['name'] : $key;
    $toptitle = $aryDetail['modTitle'];
    $htmlcode = $aryDetail['htmlCode'];
    $pluginPath = $aryDetail['pluginPath'];
    $installDate = empty($aryDetail['installDate']) ? "" : $aryDetail['installDate'];
    $indexOnly = $aryDetail['indexOnly'];
    $gourl = "index.php?load={$topname}";
    if ($installDate > 0) {
        //表示为插件
        do_filter("'.{$topname}.'", "'.{$topname}.'", "',{$toptitle}.'");
    } else {
        print "<li><a class=\"menuA\" id=\"{$topname}\" title=\"{$toptitle}\" href=\"{$gourl}\">{$toptitle}</a></li> \n";
    }
    $k++;
<?php

# 禁止直接访问该页面
if (basename($_SERVER['PHP_SELF']) == "read_sidebar.php") {
    header("HTTP/1.0 404 Not Found");
}
//读取侧边栏
for ($i = 0; $i < count($arrSideModule); $i++) {
    $sidename = $arrSideModule[$i]['name'];
    $sidetitle = replace_string($arrSideModule[$i]['modTitle']);
    $htmlcode = $arrSideModule[$i]['htmlCode'];
    $installDate = $arrSideModule[$i]['installDate'];
    $pluginPath = $arrSideModule[$i]['pluginPath'];
    $isInstall = $arrSideModule[$i]['isInstall'];
    //echo $htmlCode."<br>";
    if (ereg("^side_.+()\$", $htmlcode)) {
        switch ($sidename) {
            case "category":
                side_category($sidename, $sidetitle, $isInstall);
                #类别1
                break;
            case "calendar":
                side_calendar($sidename, $sidetitle, $isInstall);
                #日历2
                break;
            case "guestbook":
                side_guestbook($sidename, $sidetitle, $isInstall);
                #最新留言3
                break;
            case "hotTags":
                side_hotTags($sidename, $sidetitle, $isInstall);
Example #10
0
 public function array_commit()
 {
     foreach ($this->set_array_items as $item) {
         $file_db_list_key = $this->file_id . "-" . $item;
         $item_list_str = get_string($file_db_list_key);
         if ($item_list_str == ERROR) {
             $item_list_str = "";
         }
         for ($cnt = 0; $cnt < count($this->set_array_confs[$item]); $cnt++) {
             $confs = $this->set_array_confs[$item][$cnt];
             do {
                 $array_conf_id = genUniqueId();
                 $b_exists = is_exists_key($array_conf_id);
                 if ($b_exists == ERROR) {
                     break;
                 }
             } while ($b_exists);
             if ($b_exists == ERROR) {
                 return ERROR;
             }
             $line = "";
             foreach ($confs as $key => $value) {
                 if ($line != "") {
                     $line .= ",";
                 }
                 $line .= $key . "=" . $value;
             }
             replace_string($array_conf_id, $line);
             if ($item_list_str != "") {
                 $item_list_str .= ",";
             }
             $item_list_str .= $array_conf_id;
         }
         replace_string($file_db_list_key, $item_list_str);
     }
     $set_array_items = array();
     $set_array_confs = array();
     return NOERR;
 }