当前位置: 首页>>代码示例>>PHP>>正文


PHP settings_recache函数代码示例

本文整理汇总了PHP中settings_recache函数的典型用法代码示例。如果您正苦于以下问题:PHP settings_recache函数的具体用法?PHP settings_recache怎么用?PHP settings_recache使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了settings_recache函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: guestBookPost

function guestBookPost($intSpamFiler, $intIsSecret)
{
    global $DMC, $DBPrefix, $arrSideModule;
    $parent = 0;
    $_POST['isSecret'] = !empty($_POST['isSecret']) ? $_POST['isSecret'] : 0;
    $author = !empty($_POST['username']) ? $_POST['username'] : $_SESSION['username'];
    $replypassword = !empty($_POST['replypassword']) ? md5($_POST['replypassword']) : "";
    if (!empty($_POST['homepage'])) {
        if (strpos(";" . $_POST['homepage'], "http://") < 1) {
            $homepage = "http://" . $_POST['homepage'];
        } else {
            $homepage = $_POST['homepage'];
        }
    } else {
        $homepage = "";
    }
    $email = !empty($_POST['email']) ? $_POST['email'] : "";
    $_POST['bookface'] = !empty($_POST['bookface']) ? $_POST['bookface'] : "face1";
    $sql = "insert into " . $DBPrefix . "guestbook(author,password,homepage,email,ip,content,postTime,isSecret,parent,face,isSpam) values('{$author}','{$replypassword}','" . encode($homepage) . "','" . encode($email) . "','" . getip() . "','" . encode($_POST['message']) . "','" . time() . "','" . max(intval($intIsSecret), intval($_POST['isSecret'])) . "','{$parent}','" . substr(encode($_POST['bookface']), 4) . "','" . $intSpamFiler . "')";
    //echo $sql;
    $DMC->query($sql);
    //更新cache
    settings_recount("guestbook");
    settings_recache();
    recentGbooks_recache();
    logs_sidebar_recache($arrSideModule);
    //保存时间
    $_SESSION['replytime'] = time();
}
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:29,代码来源:guestbook.lib.php

示例2: skinlist_recache

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);
}
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:41,代码来源:cache.php

示例3: str_replace

                @unlink(F2BLOG_ROOT . "./cache/html/{$mark_id}_index.php");
            }
        }
        $sql = "delete from " . $DBPrefix . "logs where {$stritem}";
        $DMC->query($sql);
        //删除关联的评论和引用
        $stritem1 = str_replace("id=", "logId=", $stritem);
        $sql = "delete from " . $DBPrefix . "comments where {$stritem1}";
        $DMC->query($sql);
        $sql = "delete from " . $DBPrefix . "trackbacks where {$stritem1}";
        $DMC->query($sql);
        settings_recount("logs");
        //更新Cache
        hottags_recache();
        categories_recache();
        settings_recache();
        recentLogs_recache();
        recentComments_recache();
        archives_recache();
        calendar_recache();
        attachments_recache();
        logsTitle_recache();
        logs_sidebar_recache($arrSideModule);
    }
}
//引用传送
if ($action == "sendtb") {
    $mark_id = $_GET['mark_id'];
    $quoteUrl = $_POST['quoteUrl'];
    $dataInfo = getRecordValue($DBPrefix . "logs", " id='{$mark_id}'");
    header("Content-Type: text/html; charset=utf-8");
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:31,代码来源:logs.php

示例4: update_data

function update_data($echo, $DMC)
{
    global $DBPrefix, $update_time, $update_logs;
    $delete_setting = true;
    //更新附件的文件类别 2009-05-12
    $modify_sql[] = "ALTER TABLE `{$DBPrefix}attachments` ADD INDEX `name` (`name`)";
    $modify_sql[] = "ALTER TABLE `{$DBPrefix}guestbook` ADD COLUMN `HTTP_REFERER` text NULL DEFAULT NULL AFTER `parent`";
    $modify_sql[] = "ALTER TABLE `{$DBPrefix}links` ADD INDEX `isApp` (`isApp`)";
    $modify_sql[] = "ALTER TABLE `{$DBPrefix}logs` ADD COLUMN `isTopNews` tinyint(1) NOT NULL DEFAULT 0 AFTER `isTop`";
    $modify_sql[] = "ALTER TABLE `{$DBPrefix}logs` ADD INDEX `postTime` (`postTime`,`saveType`)";
    $modify_sql[] = "ALTER TABLE `{$DBPrefix}logs` ADD INDEX `isComment` (`isComment`,`isTrackback`,`isTop`,`isTopNews`)";
    $modify_sql[] = "ALTER TABLE `{$DBPrefix}members` ADD INDEX `password` (`password`)";
    $modify_sql[] = "ALTER TABLE `{$DBPrefix}members` ADD INDEX `role` (`role`)";
    $modify_sql[] = "ALTER TABLE `{$DBPrefix}setting` ADD INDEX `settName` (`settName`)";
    $modify_sql[] = "ALTER TABLE `{$DBPrefix}trackbacks` ADD INDEX `isApp` (`isApp`)";
    $modify_sql[] = "ALTER TABLE `{$DBPrefix}logs` ADD `autoSplit` int(8) NOT NULL default '0'";
    //	強化驗證
    $modify_sql[] = "INSERT INTO `{$DBPrefix}filters` (`category`, `name`) VALUES (1, '=http')";
    $modify_sql[] = "INSERT INTO `{$DBPrefix}filters` (`category`, `name`) VALUES (1, '[url=')";
    $modify_sql[] = "INSERT INTO `{$DBPrefix}filters` (`category`, `name`) VALUES (1, '[href=')";
    //运行SQL语句
    foreach ($modify_sql as $key => $value) {
        $DMC->query($value, "T");
        if ($echo) {
            if ($DMC->error()) {
                echo $value . " ... <font color=red>" . $DMC->error() . "</font><br />";
            } else {
                echo $value . " ... <font color=blue>OK</font><br />";
            }
        }
    }
    $i = 0;
    $contents = "\$update_logs = array(\r\n";
    $contents .= "\t'{$i}' => '{$update_time}',\r\n";
    for ($i = 0; $i < count($update_logs); $i++) {
        $j = $i + 1;
        $contents .= "\t'{$j}' => '" . $update_logs[$i] . "',\r\n";
    }
    $contents .= ");";
    writetocache('update_logs', $contents);
    //清空缓存
    if ($delete_setting == true) {
        //0909升级需要重新建立setting文件。
        if (!@unlink(F2BLOG_ROOT . "./cache/cache_setting.php")) {
            echo "<script language=Javascript> \n";
            echo "alert('Please update cache!');\n";
            echo "</script>\n";
        }
    } else {
        //更新缓存
        settings_recache();
        links_recache();
    }
    return false;
}
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:55,代码来源:update.php

示例5: update_data


//.........这里部分代码省略.........
        list($intNums) = $DMC->fetchArray($DMC->query($SQL), MYSQL_NUM);
        if ($intNums == 0) {
            $modify_sql[] = "INSERT INTO `{$DBPrefix}filters` (`category`, `name`) VALUES (1, '[url=')";
        }
        $SQL = "select count(`name`) from `{$DBPrefix}filters` where `category`='1' and `name`='[href='";
        list($intNums) = $DMC->fetchArray($DMC->query($SQL), MYSQL_NUM);
        if ($intNums == 0) {
            $modify_sql[] = "INSERT INTO `{$DBPrefix}filters` (`category`, `name`) VALUES (1, '[href=')";
        }
        $SQL = "select count(`name`) from `{$DBPrefix}filters` where `category`='1' and `name`='缺 錢 個 人 兼 職'";
        list($intNums) = $DMC->fetchArray($DMC->query($SQL), MYSQL_NUM);
        if ($intNums == 0) {
            $modify_sql[] = "INSERT INTO `{$DBPrefix}filters` (`category`, `name`) VALUES (1, '缺 錢 個 人 兼 職')";
        }
        //	★全套愛愛★時間內不限次數★累ㄌ也ㄎ以找我按摩4小時3000★
        $SQL = "select count(`name`) from `{$DBPrefix}filters` where `category`='1' and `name`='全套愛愛'";
        list($intNums) = $DMC->fetchArray($DMC->query($SQL), MYSQL_NUM);
        if ($intNums == 0) {
            $modify_sql[] = "INSERT INTO `{$DBPrefix}filters` (`category`, `name`) VALUES (1, '全套愛愛')";
        }
        //	跟新設定檔
        $arr_setting['spamfilter'] = 'close';
    }
    //	update 20090625
    if (!in_array($update_logs, "20090625")) {
        //	  `isSecret` tinyint(1) NOT NULL default '0',
        $modify_sql[] = "ALTER TABLE `{$DBPrefix}comments` ADD COLUMN `isSpam` tinyint(1) NOT NULL DEFAULT 0 AFTER `isSecret`";
    }
    //	update 20090630
    if (!in_array($update_logs, "20090625")) {
        //	This site baclofen is about baclofen remedy.
        $SQL = "select count(`name`) from `{$DBPrefix}filters` where `category`='1' and `name`='This site'";
        list($intNums) = $DMC->fetchArray($DMC->query($SQL), MYSQL_NUM);
        if ($intNums == 0) {
            $modify_sql[] = "INSERT INTO `{$DBPrefix}filters` (`category`, `name`) VALUES (1, 'This site')";
        }
    }
    /*
    if (!in_array($update_logs,"20090709")) {
    $SQL="select count(`name`) from `{$DBPrefix}modules` where `name`='BlogNews'";
    list($intNums)=$DMC->fetchArray($DMC->query($SQL),MYSQL_NUM);
    if ($intNums==0) {
    $modify_sql[]="INSERT INTO `{$DBPrefix}modules` (`name`, `modTitle`, `disType`, `isHidden`, `indexOnly`, `orderNo`, `isSystem`, `htmlCode`, `pluginPath`, `isInstall`, `installFolder`, `installDate`, `settingXml`, `cateId`, `configPath`) VALUES('BlogNews', '跑馬燈', 3, 0, 0, 2, 1, '', 'include/plung.blognews.php', 0, '', 0, '', 0, '')";
    }
    else $modify_sql[]="update `{$DBPrefix}modules` set isSystem='1',`pluginPath`='include/plung.blognews.php' where `name`='BlogNews'";
    }
    */
    if (is_array($arr_setting)) {
        foreach ($arr_setting as $key => $value) {
            if (!$DMC->fetchArray($DMC->query("select * from " . $DBPrefix . "setting where settName='{$key}'"))) {
                $modify_sql[] = "insert into " . $DBPrefix . "setting values('{$key}','{$value}','0')";
            }
        }
    }
    //运行SQL语句
    foreach ($modify_sql as $key => $value) {
        $DMC->query($value, "T");
        if ($echo) {
            if ($DMC->error()) {
                echo $value . " ... <font color=red>" . $DMC->error() . "</font><br />";
            } else {
                echo $value . " ... <font color=blue>OK</font><br />";
            }
        }
    }
    $i = 0;
    $contents = "\$update_logs = array(\r\n";
    $contents .= "\t'{$i}' => '{$update_time}',\r\n";
    for ($i = 0; $i < count($update_logs); $i++) {
        $j = $i + 1;
        $contents .= "\t'{$j}' => '" . $update_logs[$i] . "',\r\n";
    }
    $contents .= ");";
    writetocache('update_logs', $contents);
    //清空缓存
    if (!@unlink(F2BLOG_ROOT . "./cache/cache_setting.php")) {
        echo "<script language=Javascript> \n";
        echo "alert('Please update cache!');\n";
        echo "</script>\n";
    }
    //更新缓存
    settings_recache();
    links_recache();
    filters_recache();
    /*
    //清空缓存
    if ($delete_setting==true){//0909升级需要重新建立setting文件。
    if (!@unlink(F2BLOG_ROOT."./cache/cache_setting.php")){
    echo "<script language=Javascript> \n";
    echo "alert('Please update cache!');\n";
    echo "</script>\n";
    }
    }else{
    //更新缓存
    settings_recache();
    links_recache();
    }
    */
    return false;
}
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:101,代码来源:update.php

示例6: update_data


//.........这里部分代码省略.........
        $arr_setting['showKeyword'] = '0';
        $arr_setting['autoUrl'] = '0';
        $arr_setting['showPrint'] = '0';
        $arr_setting['showDown'] = '0';
        $arr_setting['showMail'] = '0';
        $arr_setting['linkshow'] = '0';
        $arr_setting['showUBB'] = '0';
        $arr_setting['linklogo'] = 'images/logo.gif';
        $arr_setting['adminstyle'] = 'new';
        $arr_setting['footcode'] = '';
        $arr_setting['linkmarquee'] = '0';
        $arr_setting['currFormatDate'] = 'Y-m-d H:i';
        $arr_setting['listFormatDate'] = 'm-d';
        $arr_setting['showAlertStyle'] = '0';
        $arr_setting['weatherStatus'] = '1';
        $arr_setting['treeCategory'] = '0';
        foreach ($arr_setting as $key => $value) {
            if (!$DMC->fetchArray($DMC->query("select * from " . $DBPrefix . "setting where settName='{$key}'"))) {
                $modify_sql[] = "insert into " . $DBPrefix . "setting values('{$key}','{$value}','0')";
            }
        }
        //新增粘贴插件
        if (!$DMC->fetchArray($DMC->query("select * from " . $DBPrefix . "setting where settName='editPluginName' and settValue like '%paste%'"))) {
            $modify_sql[] = "update " . $DBPrefix . "setting set settValue=concat('paste,',settValue) where settName='editPluginName'";
            $modify_sql[] = "update " . $DBPrefix . "setting set settValue=replace(settValue,',justifyleft,justifycenter',',pastetext,pasteword,separator,justifyleft,justifycenter,justifyright') where settName='editPluginButton1'";
        }
        //清除属性(2007-02-01)
        if ($DMC->fetchArray($DMC->query("select * from " . $DBPrefix . "setting where settName='disTop'"))) {
            $modify_sql[] = "delete from {$DBPrefix}setting where settName='disTop' or settName='calendarmonth'";
        }
    }
    //更新数据表(2006-11-11)
    if (!$DMC->query("SELECT cateIcons FROM " . $DBPrefix . "categories", 'T')) {
        $modify_sql[] = "DROP TABLE IF EXISTS `{$DBPrefix}linkgroup`;";
        $modify_sql[] = "CREATE TABLE `{$DBPrefix}linkgroup` (\r\n\t\t\t\t\t\t`id` int(3) NOT NULL auto_increment,\r\n\t\t\t\t\t\t`name` varchar(50) NOT NULL,\r\n\t\t\t\t\t\t`isSidebar` tinyint(1) NOT NULL default '0',\r\n\t\t\t\t\t\t`orderNo` int(5) NOT NULL default '0',\r\n\t\t\t\t\t\tPRIMARY KEY  (`id`),\r\n\t\t\t\t\t\tKEY `name` (`name`)\r\n\t\t\t\t\t\t) ENGINE=MyISAM {$default_charset};\r\n\t\t\t\t\t  ";
        $modify_sql[] = "ALTER TABLE `{$DBPrefix}logs` ADD `autoSplit` int(8) NOT NULL default '0'";
        $modify_sql[] = "ALTER TABLE `{$DBPrefix}categories` ADD `cateIcons` tinyint(4) NOT NULL default '1'";
        $modify_sql[] = "ALTER TABLE `{$DBPrefix}links` ADD `lnkGrpId` int(3) NOT NULL default '1'";
        $modify_sql[] = "ALTER TABLE `{$DBPrefix}links` ADD `blogLogo` varchar(150) NOT NULL default ''";
        $modify_sql[] = "ALTER TABLE `{$DBPrefix}links` ADD `isApp` tinyint(1) NOT NULL default '0'";
        $modify_sql[] = "ALTER TABLE `{$DBPrefix}links` CHANGE `isHidden` `isSidebar` tinyint(1) NOT NULL default '0'";
        $modify_sql[] = "ALTER TABLE `{$DBPrefix}attachments` CHANGE `attTitle` `attTitle` varchar(150) NOT NULL default ''";
        $modify_sql[] = "ALTER TABLE `{$DBPrefix}members` CHANGE `role` `role` varchar(8) NOT NULL default 'user'";
        $modify_sql[] = "INSERT INTO `{$DBPrefix}modules` VALUES (17, 'links', '[var]strLinks[/var]', 1, 0, 0, 4, 1, '', 'include/links.inc.php', 0, '', 0, '', 0, '')";
        $modify_sql[] = "INSERT INTO `{$DBPrefix}modules` VALUES (18, 'archives', '[var]strArchives[/var]', 1, 0, 0, 4, 1, '', 'include/archives.inc.php', 0, '', 0, '', 0, '')";
        $modify_sql[] = "INSERT INTO `{$DBPrefix}modules` VALUES (19, 'userPanel', '[var]strUserPanel[/var]', 2, 1, 0, 1, 1, 'side_userPanel()', '', 0, '', 0, '', 0, '')";
        $modify_sql[] = "UPDATE `{$DBPrefix}modules` set modTitle='[var]strHomePageGBook[/var]' where id='16'";
        $modify_sql[] = "INSERT INTO `{$DBPrefix}linkgroup` VALUES ('1', 'Links', '1', '1')";
        $modify_sql[] = "UPDATE {$DBPrefix}links set lnkGrpId='1',isApp='1',isSidebar='1'";
        $modify_sql[] = "UPDATE {$DBPrefix}categories set cateIcons='1'";
    }
    //更新评论2007-02-01,因为恢复的地方没有使用它。
    if (!$DMC->query("SELECT homepage FROM " . $DBPrefix . "comments", 'T')) {
        $modify_sql[] = "ALTER TABLE `{$DBPrefix}setting` CHANGE `settValue` `settValue` text NOT NULL";
        $modify_sql[] = "ALTER TABLE `{$DBPrefix}comments` ADD `homepage` varchar(100) NOT NULL default ''";
        $modify_sql[] = "ALTER TABLE `{$DBPrefix}comments` ADD `email` varchar(100) NOT NULL default ''";
        $modify_sql[] = "ALTER TABLE `{$DBPrefix}comments` ADD `face` varchar(30) NOT NULL default ''";
    }
    //更新附件的文件类别(2007-02-01
    $arrResult = $DMC->fetchQueryAll($DMC->query("SELECT name,id FROM " . $DBPrefix . "attachments where not fileType like '%/%' and not fileType like '%-%' "));
    foreach ($arrResult as $value) {
        if ($value['name'] != "") {
            $fileType = updateFileType($value['name']);
            $modify_sql[] = "update " . $DBPrefix . "attachments set fileType='{$fileType}' where id='" . $value['id'] . "'";
        }
    }
    //运行SQL语句
    foreach ($modify_sql as $key => $value) {
        $DMC->query($value, "T");
        if ($echo) {
            if ($DMC->error()) {
                echo $value . " ... <font color=red>" . $DMC->error() . "</font><br />";
            } else {
                echo $value . " ... <font color=blue>OK</font><br />";
            }
        }
    }
    $i = 0;
    $contents = "\$update_logs = array(\r\n";
    $contents .= "\t'{$i}' => '{$update_time}',\r\n";
    for ($i = 0; $i < count($update_logs); $i++) {
        $j = $i + 1;
        $contents .= "\t'{$j}' => '" . $update_logs[$i] . "',\r\n";
    }
    $contents .= ");";
    writetocache('update_logs', $contents);
    //清空缓存
    if ($delete_setting == true) {
        //0909升级需要重新建立setting文件。
        if (!@unlink(F2BLOG_ROOT . "./cache/cache_setting.php")) {
            echo "<script language=Javascript> \n";
            echo "alert('Please update cache!');\n";
            echo "</script>\n";
        }
    } else {
        //更新缓存
        settings_recache();
        links_recache();
    }
}
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:101,代码来源:update.php

示例7: reAllCache

function reAllCache()
{
    settings_recache();
    modules_recache();
    categories_recache();
    hottags_recache();
    archives_recache();
    links_recache();
    keywords_recache();
    filters_recache();
    recentLogs_recache();
    recentGbooks_recache();
    recentComments_recache();
    calendar_recache();
    statistics_recache();
    categories_recount();
}
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:17,代码来源:cache.php

示例8: guestBookPost

function guestBookPost($intSpamFiler, $intIsSecret)
{
    global $DMC, $DBPrefix, $arrSideModule, $settingInfo;
    $_POST['isSecret'] = isset($_POST['isSecret']) ? $_POST['isSecret'] : 0;
    $author = isset($_POST['username']) ? $_POST['username'] : $_SESSION['username'];
    $replypassword = isset($_POST['replypassword']) ? md5($_POST['replypassword']) : "";
    //$_POST['homepage']=(isset($_POST['homepage']))?$_POST['homepage']:"";
    if (!empty($_POST['homepage'])) {
        if (strpos(";" . $_POST['homepage'], "http://") < 1) {
            $_POST['homepage'] = "http://" . $_POST['homepage'];
        }
    } else {
        $_POST['homepage'] = "";
    }
    $_POST['email'] = isset($_POST['email']) ? $_POST['email'] : "";
    $_POST['bookface'] = !empty($_POST['bookface']) ? $_POST['bookface'] : "face1";
    if ($_GET['load'] == "read") {
        //评论
        $sql = "insert into " . $DBPrefix . "comments(author,password,logId,homepage,email,face,ip,content,postTime,isSecret,parent) values('{$author}','{$replypassword}','" . $id . "','" . encode($_POST['homepage']) . "','" . encode($_POST['email']) . "','" . substr(encode($_POST['bookface']), 4) . "','" . getip() . "','" . encode($_POST['message']) . "','" . time() . "','" . max(intval($intIsSecret), intval($_POST['isSecret'])) . "','{$postid}')";
    } else {
        $sql = "insert into " . $DBPrefix . "guestbook(author,password,homepage,email,ip,content,postTime,isSecret,parent,face) values('{$author}','{$replypassword}','" . encode($_POST['homepage']) . "','" . encode($_POST['email']) . "','" . getip() . "','" . encode($_POST['message']) . "','" . time() . "','" . max(intval($intIsSecret), intval($_POST['isSecret'])) . "','{$postid}','" . substr(encode($_POST['bookface']), 4) . "')";
    }
    //echo $sql;
    $DMC->query($sql);
    //保存时间
    $_SESSION['replytime'] = time();
    //更新cache
    if ($_GET['load'] == "read") {
        //评论
        //更新LOGS评论数量
        settings_recount("comments");
        settings_recache();
        $DMC->query("UPDATE " . $DBPrefix . "logs SET commNums=commNums+1 WHERE id='{$id}'");
        //更新cache
        recentComments_recache();
        logs_sidebar_recache($arrSideModule);
    } else {
        settings_recount("guestbook");
        settings_recache();
        recentGbooks_recache();
        logs_sidebar_recache($arrSideModule);
    }
    //不使用Ajax技术
    if (strpos(";{$settingInfo['ajaxstatus']};", "G") < 1) {
        $load = $_GET['load'];
        $page = $_GET['page'];
        echo "<script language=javascript> \n";
        if ($_GET['load'] == "read") {
            if ($settingInfo['rewrite'] == 0) {
                $gourl = "index.php?load={$load}&id={$id}&page={$page}";
            }
            if ($settingInfo['rewrite'] == 1) {
                $gourl = "rewrite.php/{$load}-{$id}-{$page}";
            }
            if ($settingInfo['rewrite'] == 2) {
                $gourl = "{$load}-{$id}-{$page}";
            }
            echo " opener.location.href='{$gourl}{$settingInfo['stype']}';\n";
            echo " opener.reload;\n";
        } else {
            if ($settingInfo['rewrite'] == 0) {
                $gourl = "index.php?load={$load}&page={$page}";
            }
            if ($settingInfo['rewrite'] == 1) {
                $gourl = "rewrite.php/{$load}-{$page}";
            }
            if ($settingInfo['rewrite'] == 2) {
                $gourl = "{$load}-{$page}";
            }
            echo " opener.location.href='{$gourl}{$settingInfo['stype']}';\n";
            echo " opener.reload;\n";
        }
        echo " window.close();\n";
        echo "</script> \n";
        exit;
    }
}
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:77,代码来源:reply.php

示例9: guestBookPost

function guestBookPost($id, $intSpamFiler, $intIsSecret, $settingInfo, $gourl)
{
    global $DMC, $DBPrefix, $arrSideModule;
    $parent = 0;
    $_POST['isSecret'] = $_POST['isSecret'] ? $_POST['isSecret'] : 0;
    $author = $_POST['username'] ? $_POST['username'] : $_SESSION['username'];
    $replypassword = $_POST['replypassword'] ? md5($_POST['replypassword']) : "";
    $_POST['bookface'] = !empty($_POST['bookface']) ? $_POST['bookface'] : "face1";
    if (isset($_POST['homepage'])) {
        if (strpos(";" . $_POST['homepage'], "http://") < 1) {
            $_POST['homepage'] = "http://" . $_POST['homepage'];
        }
    } else {
        $_POST['homepage'] = "";
    }
    $_POST['email'] = !empty($_POST['email']) ? $_POST['email'] : "";
    $sql = "insert into " . $DBPrefix . "comments(author,password,logId,homepage,email,face,ip,content,postTime,isSecret,parent) values('{$author}','{$replypassword}','" . $id . "','" . encode($_POST['homepage']) . "','" . encode($_POST['email']) . "','" . substr(encode($_POST['bookface']), 4) . "','" . getip() . "','" . encode($_POST['message']) . "','" . time() . "','" . max(intval($intIsSecret), intval($_POST['isSecret'])) . "','{$parent}')";
    //echo $sql;
    $DMC->query($sql);
    //更新LOGS评论数量
    settings_recount("comments");
    settings_recache();
    $DMC->query("UPDATE " . $DBPrefix . "logs SET commNums=commNums+1 WHERE id='{$id}'");
    //更新cache
    recentComments_recache();
    logs_sidebar_recache($arrSideModule);
    //保存时间
    $_SESSION['replytime'] = time();
    //清空内容
    $_POST['message'] = "";
    header("location:" . str_replace("&amp;", "&", $gourl) . "{$settingInfo['stype']}");
    exit;
}
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:33,代码来源:replylogs.inc.php

示例10: rethestats

function rethestats($cachename = '')
{
    global $DB, $db_prefix;
    if (!$cachename || $cachename == 'settings') {
        settings_recache();
    }
    if (!$cachename || $cachename == 'statistics') {
        // 更新首页显示的文章数
        $article_count = $DB->result($DB->query("SELECT COUNT(articleid) FROM {$db_prefix}articles WHERE visible = '1'"), 0);
        // 更新首页显示的评论数
        $comment_count = $DB->result($DB->query("SELECT COUNT(commentid) FROM {$db_prefix}comments c LEFT JOIN {$db_prefix}articles a ON (a.articleid=c.articleid) WHERE a.visible='1' AND c.visible='1'"), 0);
        // 更新首页显示的标签(Tags)数
        $tag_count = $DB->result($DB->query("SELECT COUNT(mid) FROM {$db_prefix}metas WHERE type='tag'"), 0);
        $DB->unbuffered_query("UPDATE {$db_prefix}statistics SET article_count='{$article_count}', comment_count='{$comment_count}', tag_count='{$tag_count}'");
        //$DB->unbuffered_query("DELETE FROM {$db_prefix}metas WHERE type='tag' AND count=0");
        // 更新主人发表文章数
        $query = $DB->query("SELECT userid,articles FROM {$db_prefix}users WHERE groupid='1' OR groupid='2'");
        while ($user = $DB->fetch_array($query)) {
            $total = $DB->result($DB->query("SELECT COUNT(articleid) FROM {$db_prefix}articles WHERE visible = '1' AND uid='" . $user['userid'] . "'"), 0);
            if ($user['articles'] != $total) {
                $DB->unbuffered_query("UPDATE {$db_prefix}users SET articles='{$total}' WHERE userid='" . $user['userid'] . "'");
            }
        }
        statistics_recache();
    }
    if (!$cachename || $cachename == 'newarticles') {
        newarticles_recache();
    }
    if (!$cachename || $cachename == 'stick') {
        stick_recache();
    }
    if (!$cachename || $cachename == 'newcomments') {
        newcomments_recache();
    }
    if (!$cachename || $cachename == 'categories') {
        // 更新所有文章的评论数
        $query = $DB->query("SELECT mid,count FROM {$db_prefix}metas");
        while ($meta = $DB->fetch_array($query)) {
            $ctotal = get_meta_article_count($meta['mid']);
            if ($meta['count'] != $ctotal) {
                update_meta_count($meta['mid'], $ctotal);
            }
        }
        categories_recache();
    }
    if (!$cachename || $cachename == 'archives') {
        // 重建文章数据
        $query = $DB->query("SELECT articleid,comments FROM {$db_prefix}articles");
        while ($article = $DB->fetch_array($query)) {
            // 更新所有文章的评论数
            $ctotal = $DB->result($DB->query("SELECT COUNT(commentid) FROM {$db_prefix}comments WHERE articleid='" . $article['articleid'] . "' AND visible='1'"), 0);
            if ($article['comments'] != $ctotal) {
                $DB->unbuffered_query("UPDATE {$db_prefix}articles SET comments='{$ctotal}' WHERE articleid='" . $article['articleid'] . "'");
            }
        }
        archives_recache();
    }
    if (!$cachename || $cachename == 'hottags') {
        hottags_recache();
    }
    if (!$cachename || $cachename == 'links') {
        links_recache();
    }
    if (!$cachename || $cachename == 'stylevars') {
        stylevars_recache();
    }
    if (!$cachename || $cachename == 'allarticleids') {
        allarticleids_recache();
    }
}
开发者ID:BGCX261,项目名称:zjnewcitycode-svn-to-git,代码行数:70,代码来源:cache.func.php

示例11: blogger_deletePost

function blogger_deletePost($values)
{
    global $settingInfo, $DMC, $DBPrefix, $arrSideModule;
    global $strArrayMonth, $strArrayDay, $strYear, $strMonth, $arrWeek, $strDayLogs, $strCalendar;
    global $strModifyInfo, $strLogout, $strLoginSubmit, $strUserRegister;
    global $strSearchErr, $strKeyword, $strSearchTitle, $strSearchContent, $strSearchTitleContent, $strFind;
    $userdetail = check_user_pw($values['username'], $values['password']);
    $records = $DMC->fetchArray($DMC->query("SELECT * FROM `{$DBPrefix}logs` WHERE `id`='{$values['postid']}'"));
    if ($records['id'] == '') {
        xml_error("Entry does not exist.");
    } else {
        $DMC->query("DELETE FROM `{$DBPrefix}logs` WHERE `id`='{$values['postid']}'");
        //更新Cache
        settings_recount("logs");
        settings_recache();
        categories_recount();
        categories_recache();
        recentLogs_recache();
        archives_recache();
        calendar_recache();
        logsTitle_recache();
        logs_sidebar_recache($arrSideModule);
        $xml_logContent = make_xml_piece("boolean", '1');
        $body_xml = xml_generate($xml_logContent);
        //writetofile ("text2.xml", $body_xml); //For debug use
        send_response($body_xml);
    }
}
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:28,代码来源:xmlrpc.php

示例12: guestBookPost

function guestBookPost($intSpamFiler, $intIsSecret)
{
    global $DMC, $DBPrefix, $arrSideModule;
    $parent = 0;
    $_POST['isSecret'] = $_POST['isSecret'] ? $_POST['isSecret'] : 0;
    $author = $_POST['username'] ? $_POST['username'] : $_SESSION['username'];
    $replypassword = $_POST['replypassword'] ? md5($_POST['replypassword']) : "";
    $_POST['bookface'] = !empty($_POST['bookface']) ? $_POST['bookface'] : "face1";
    if (!empty($_POST['homepage'])) {
        if (strpos(";" . $_POST['homepage'], "http://") < 1) {
            $_POST['homepage'] = "http://" . $_POST['homepage'];
        }
    } else {
        $_POST['homepage'] = "";
    }
    $sql = "insert into " . $DBPrefix . "guestbook(author,password,homepage,email,ip,content,postTime,isSecret,parent,face,isSpam) values('{$author}','{$replypassword}','" . encode($_POST['homepage']) . "','" . encode($_POST['email']) . "','" . getip() . "','" . encode($_POST['message']) . "','" . time() . "','" . max(intval($intIsSecret), intval($_POST['isSecret'])) . "','{$parent}','" . substr(encode($_POST['bookface']), 4) . "','" . $intSpamFiler . "')";
    //echo $sql;
    $DMC->query($sql);
    //更新cache
    settings_recount("guestbook");
    settings_recache();
    recentGbooks_recache();
    logs_sidebar_recache($arrSideModule);
    //保存时间
    $_SESSION['replytime'] = time();
    //清空内容
    $_POST['message'] = "";
    //echo "<script language=\"javascript\">window.location.href='$gourl';</script>";
    //echo "<script language=\"javascript\">window.reload</script>";
    header("location:" . str_replace("&amp;", "&", $gourl) . "{$settingInfo['stype']}");
    exit;
}
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:32,代码来源:guestbook.inc.php

示例13: restats

function restats()
{
    allarticleids_recache();
    links_recache();
    newarticles_recache();
    newcomments_recache();
    settings_recache();
    categories_recache();
    statistics_recache();
    archives_recache();
    hottags_recache();
    stylevars_recache();
    stick_recache();
}
开发者ID:BGCX261,项目名称:zjnewcitycode-svn-to-git,代码行数:14,代码来源:admin.func.php


注:本文中的settings_recache函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。