Discuz!官方免费开源建站系统

 找回密码
 立即注册
搜索

让人恶心的forum.php 不处理好了就等着百度降权拔毛吧

  [复制链接]
1155815 发表于 2011-5-10 11:43:33 | 显示全部楼层
期待改进
回复

使用道具 举报

wangyoujin2008 发表于 2011-5-18 01:12:35 | 显示全部楼层
{:soso__14981092395392896032_1:}
回复

使用道具 举报

killer125 发表于 2011-5-18 16:11:32 | 显示全部楼层
有什么麻烦的,我一个小文件把全站的什么forum.php都改为index.php了。

<?php
        function change($filename) {
                $changes = array (
                        '/forum.php/'=>'index.php',
                        '/home.php/'=>'index.php',
                        '/group.php/'=>'index.php',
                        '/portal.php/'=>'index.php',
                        '/misc.php/'=>'index.php',
                        '/member.php/'=>'index.php'
                );
                $keys = array_keys($changes);
                $values = array_values($changes);

                $fp = fopen($filename, "r");
                $text = "";
                while (!feof($fp)){
                        $text .= fgets($fp);
                }
                fclose($fp);

                $text = preg_replace($keys, $values, $text);
                $fp = fopen($filename, "w");
                if ($fp) {
                        fwrite($fp, $text);
                        fclose($fp);
                        return true;
                } else {
                        return false;
                }
        }

        function changeDir($dirname) {
                $parrent = '{*.js,*.php,*.htm,*.xml}';
                $parrent = str_replace('\\', '/', $dirname).'/'.$parrent;

                $path = str_replace('\\', '/', dirname(__FILE__));
                $efiles = array(                                        //列出不要替换的文件
                        $path."/change.php",
                        $path."/index.php",
                        $path."/home.php",
                        $path."/forum.php",
                        $path."/group.php",
                        $path."/misc.php",
                        $path."/member.php",
                        $path."/portal.php",
                        $path."/userapp.php"
                );

                $files = glob($parrent,GLOB_BRACE);
                foreach($files as $file) {
                        if (in_array($file, $efiles)) {   
                                continue;
                        }

                        if (change($file)) {                                //输出显示那些文件被改过
                                echo "<p>file changed:".$file."</p>";
                        } else {
                                echo "<p>change failed:".$file."</p>";
                        }
                }

                $dirs = glob($dirname.'/*', GLOB_ONLYDIR);
                foreach($dirs as $dir) {
                        changeDir($dir);
                }

        }

        changeDir(dirname(__FILE__));
?>

回复

使用道具 举报

killer125 发表于 2011-5-18 16:13:59 | 显示全部楼层
index.php被我改成了这样,自动转到对应的forum.php文件去。还有一个工作没完成的,就是把forum.php等文件的内容合并到index.php中来,这样就可以把forum.php这类文件全删除掉了。

<?php
$temp_parms = $_GET;
if($_SERVER['REQUEST_METHOD'] == 'POST' && !empty($_POST)) {
        $temp_parms = array_merge($_GET, $_POST);
}

$forum_modarray = array('ajax','announcement','attachment','forumdisplay', 'group','image','index','misc','modcp','notice','post','redirect','relatekw','relatethread','rss','topicadmin','trade','viewthread','tag');
$home_modarray = array('space', 'spacecp', 'misc', 'magic', 'editor', 'invite', 'task', 'medal');
$member_modarray = array('activate', 'clearcookies', 'emailverify', 'getpasswd','groupexpiry', 'logging', 'lostpasswd','register', 'regverify', 'switchstatus', 'connect');
$misc_modarray = array('seccode', 'secqaa', 'initsys', 'miscinvite', 'faq', 'report', 'swfupload', 'manyou', 'stat', 'ranklist', 'buyinvitecode', 'tag', 'diyhelp', 'mobile');
$group_modarray = array('index', 'my', 'attentiongroup');
$portal_modarray = array('list', 'view', 'comment', 'portalcp', 'topic', 'attachment');

if (!$temp_parms['mod']) {
        require './forum.php';
} elseif ($temp_parms['mod'] == 'index') {
        if (!$temp_parms['gid']) {
                require './forum.php';
        } else {
                require './group.php';
        }
} elseif ($temp_parms['mod'] == 'attachment') {
        if ($temp_parms['id']) {
                require './portal.php';
        } else {
                require './forum.php';
        }
} elseif ($temp_parms['mod'] == 'tag') {
        if ($temp_parms['op']) {
                require './forum.php';
        } else {
                require './misc.php';
        }
} elseif ($temp_parms['mod'] == 'misc') {
        if ($temp_parms['gp_ac']) {
                require './home.php';
        } else {
                require './forum.php';
        }
} elseif (in_array($temp_parms['mod'], $forum_modarray)) {
        require './forum.php';
} elseif (in_array($temp_parms['mod'], $home_modarray)) {
        require './home.php';
} elseif (in_array($temp_parms['mod'], $member_modarray)) {
        require './member.php';
} elseif (in_array($temp_parms['mod'], $misc_modarray)) {
        require './misc.php';
} elseif (in_array($temp_parms['mod'], $group_modarray)) {
        require './group.php';
} elseif (in_array($temp_parms['mod'], $portal_modarray)) {
        require './portal.php';
} else {
        echo "error!";
}

?>

回复

使用道具 举报

success_ok 发表于 2011-5-24 14:05:10 | 显示全部楼层
官方赶快解决啊 各个频道 手机版都有此问题
回复

使用道具 举报

lynn10 发表于 2011-5-24 15:07:17 | 显示全部楼层
支持........
回复

使用道具 举报

cxqing 发表于 2011-5-24 15:27:20 | 显示全部楼层
不知道现在改进好没有
回复

使用道具 举报

xinfengj8 发表于 2011-5-24 16:12:20 | 显示全部楼层
(EM:131:)
回复

使用道具 举报

xinfengj8 发表于 2011-5-24 16:14:22 | 显示全部楼层
回复

使用道具 举报

a89671557 发表于 2011-5-24 21:26:45 | 显示全部楼层
卫视交流网 发表于 2011-5-8 09:31
我设置后所有资讯文章均能正常打开,你可进入我站试试
www.wxdsjl.com 卫视交流网
www.jslsw.com 江苏涟 ...

你没有开门户首页,当然是正常的啊。你直接把论坛首页做成首页了。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-8-24 18:51 , Processed in 0.138456 second(s), 13 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表