用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2398|回复: 6
收起左侧

[已解决] 新手继续帮忙~~急啊

[复制链接]
发表于 2012-3-31 15:24:00 | 显示全部楼层 |阅读模式
我接手了一个codeigniter 做的网站,以前没用过,现在有点混乱。有几个问题需要大侠们帮助。
我下载了在线网站文件和数据库,搭建本地环境熟悉它, 遇到问题:
真实网站路径例如: http://x.com/city/photo/23/62
本地路径http://local.com/city/photo/23/62
缺失page not found空白页。。。我开始以为是少拷了文件,结果去目录下一看
路径标示的文件都在根目录的upload文件夹下: upload/city/photo/ 这样的, 但本地测试为什么就是空白页呢? 很是不解,那个控制着路径变量? 还请指教,多谢,在线等~~~~
发表于 2012-3-31 15:26:36 | 显示全部楼层
修改 config.php $congif['base_url'] = 'http://local.com/upload/'
 楼主| 发表于 2012-3-31 15:45:24 | 显示全部楼层
但是,system文件夹和upload是平级目录啊。。。
 楼主| 发表于 2012-3-31 15:51:20 | 显示全部楼层
不对,首页都不显示了,
发表于 2012-3-31 15:59:09 | 显示全部楼层
 楼主| 发表于 2012-3-31 16:20:02 | 显示全部楼层
这是个city 的控制器, 并在view里找到对应的city_all.php city_tour.php但为什么得到空白页呢?
PHP复制代码
 
class City extends Controller {
 
    private $section = "city";
    private $submenu = array("place" => "Turistik Mekanlar",
                             "tour" => "Gezi Program?",
                             "transport" => "Ula??m",
                             "stay" => "Konaklama",
                             "photo" => "Foto?raflar",
                             "video" => "Videolar"
                            );
 
        function City()
        {
                parent::Controller();
 
                $this->load->model('city_model');
                $this->load->model('comment_model');
        }
 
    function index()
    {
        redirect("city/all");
    }
 
        function all()
        {
        $photos = $this->city_model->get_random_photos();
 
                $view_data = array(
            "section" => $this->section,
            "submenu" => $this->submenu,
            "cid" => 0,
            "ssm" => '',
            "breadcrumb" => "<a href='".base_url()."city/all'>?in Turizmi</a>",
            "subtitle" => "images/sub_title_ct.png",
            "submenutitle" => "images/sub_menu_title_ct.png",
            "media_list" => $photos
                );
 
                $this->template->write_view("content", "city_all", $view_data);
                $this->template->render();
        }
 
    function place($cid, $scid = null)
    {
        $city = $this->city_model->get_city($cid);
 
        if ($scid > 0)
        {
            $content = $this->city_model->get_sub_content($cid, $scid, "place");
            $subcontents = array();
            $back_link = $this->section . "/place/" . $cid;
        }
        else
        {
            $content = $this->city_model->get_content($cid, "place");
            $subcontents = $this->city_model->get_sub_contents($cid, "place");
            $back_link = "";
        }
 
        $photos = $this->city_model->get_photos($cid);
 
        $comments_id = md5($this->session->userdata('current_page'));
        $comments = $this->comment_model->get_comments($comments_id);
 
        $this->comment_model->add_comment_section(array("cid" => $comments_id, "section" => $this->session->userdata('current_page')));
 
        $view_data = array(
            "section" => $this->section,
            "submenu" => $this->submenu,
            "cid" => $cid,
            "ssm" => 'place',
            "breadcrumb" => "<a href='".base_url()."city/all'>?in Turizmi</a> > " . $city->name . " > <a href='".base_url()."city/place/".$cid."'>Turistik Mekanlar</a>" . ($scid > 0 ? " > <a href='".base_url()."city/place/".$cid."/".$scid."'>".$content->title."</a>" : ""),
            "subtitle" => "images/sub_title_ct.png",
            "submenutitle" => "images/sub_menu_title_ct.png",
            "city" => $city,
            "content" => $content,
            "subcontents" => $subcontents,
            "media_list" => $photos,
            "comments_id" => $comments_id,
            "comments" => $comments,
            "back_link" => $back_link
                );
 
        $this->template->write_view("content", "city_place", $view_data);
                $this->template->render();
    }
 
    function tour($cid, $scid = null)
    {
        $city = $this->city_model->get_city($cid);
 
        if ($scid > 0)
        {
            $content = $this->city_model->get_sub_content($cid, $scid, "tour");
            $subcontents = array();
            $back_link = $this->section . "/tour/" . $cid;
        }
        else
        {
            $content = $this->city_model->get_content($cid, "tour");
            $subcontents = $this->city_model->get_sub_contents($cid, "tour");
            $back_link = "";
        }
 
        $photos = $this->city_model->get_photos($cid);
 
        $comments_id = md5($this->session->userdata('current_page'));
        $comments = $this->comment_model->get_comments($comments_id);
 
        $this->comment_model->add_comment_section(array("cid" => $comments_id, "section" => $this->session->userdata('current_page')));
 
        $view_data = array(
            "section" => $this->section,
            "submenu" => $this->submenu,
            "cid" => $cid,
            "ssm" => 'tour',
            "breadcrumb" => "<a href='".base_url()."city/all'>?in Turizmi</a> > " . $city->name . " > <a href='".base_url()."city/tour/".$cid."'>Gezi Program?</a>" . ($scid > 0 ? " > <a href='".base_url()."city/tour/".$cid."/".$scid."'>".$content->title."</a>" : ""),
            "subtitle" => "images/sub_title_ct.png",
            "submenutitle" => "images/sub_menu_title_ct.png",
            "city" => $city,
            "content" => $content,
            "subcontents" => $subcontents,
            "media_list" => $photos,
            "comments_id" => $comments_id,
            "comments" => $comments,
            "back_link" => $back_link
                );
 
        $this->template->write_view("content", "city_tour", $view_data);
                $this->template->render();
    }
 
    function transport($cid, $scid = null)
    {
        $city = $this->city_model->get_city($cid);
 
        if ($scid > 0)
        {
            $content = $this->city_model->get_sub_content($cid, $scid, "transport");
            $subcontents = array();
            $back_link = $this->section . "/transport/" . $cid;
        }
        else
        {
            $content = $this->city_model->get_content($cid, "transport");
            $subcontents = $this->city_model->get_sub_contents($cid, "transport");
            $back_link = "";
        }
 
        $photos = $this->city_model->get_photos($cid);
 
        $comments_id = md5($this->session->userdata('current_page'));
        $comments = $this->comment_model->get_comments($comments_id);
 
        $this->comment_model->add_comment_section(array("cid" => $comments_id, "section" => $this->session->userdata('current_page')));
 
        $view_data = array(
            "section" => $this->section,
            "submenu" => $this->submenu,
            "cid" => $cid,
            "ssm" => 'transport',
            "breadcrumb" => "<a href='".base_url()."city/all'>?in Turizmi</a> > " . $city->name . " > <a href='".base_url()."city/transport/".$cid."'>Ula??m</a>" . ($scid > 0 ? " > <a href='".base_url()."city/transport/".$cid."/".$scid."'>".$content->title."</a>" : ""),
            "subtitle" => "images/sub_title_ct.png",
            "submenutitle" => "images/sub_menu_title_ct.png",
            "city" => $city,
            "content" => $content,
            "subcontents" => $subcontents,
            "media_list" => $photos,
            "comments_id" => $comments_id,
            "comments" => $comments,
            "back_link" => $back_link
                );
 
        $this->template->write_view("content", "city_transport", $view_data);
                $this->template->render();
    }
 
    function stay($cid, $scid = null)
    {
        $city = $this->city_model->get_city($cid);
 
        if ($scid > 0)
        {
            $content = $this->city_model->get_sub_content($cid, $scid, "stay");
            $subcontents = array();
            $back_link = $this->section . "/stay/" . $cid;
        }
        else
        {
            $content = $this->city_model->get_content($cid, "stay");
            $subcontents = $this->city_model->get_sub_contents($cid, "stay");
            $back_link = "";
        }
 
        $photos = $this->city_model->get_photos($cid);
 
        $comments_id = md5($this->session->userdata('current_page'));
        $comments = $this->comment_model->get_comments($comments_id);
 
        $this->comment_model->add_comment_section(array("cid" => $comments_id, "section" => $this->session->userdata('current_page')));
 
        $view_data = array(
            "section" => $this->section,
            "submenu" => $this->submenu,
            "cid" => $cid,
            "ssm" => 'stay',
            "breadcrumb" => "<a href='".base_url()."city/all'>?in Turizmi</a> > " . $city->name . " > <a href='".base_url()."city/stay/".$cid."'>Konaklama</a>" . ($scid > 0 ? " > <a href='".base_url()."city/stay/".$cid."/".$scid."'>".$content->title."</a>" : ""),
            "subtitle" => "images/sub_title_ct.png",
            "submenutitle" => "images/sub_menu_title_ct.png",
            "city" => $city,
            "content" => $content,
            "subcontents" => $subcontents,
            "media_list" => $photos,
            "comments_id" => $comments_id,
            "comments" => $comments,
            "back_link" => $back_link
                );
 
        $this->template->write_view("content", "city_stay", $view_data);
                $this->template->render();
    }
 
    function photo($cid, $pid = 0)
    {
        if (!($pid > 0))
        {
            $first_pid = $this->city_model->get_first_photo_id($cid);
            if ($first_pid > 0)
            {
                redirect("city/photo/" . $cid . "/" . $first_pid . "#1");
            }
        }
 
        $city = $this->city_model->get_city($cid);
        $photo = $this->city_model->get_photo($cid, $pid);
 
        $photos = $this->city_model->get_photos($cid);
 
        $comments_id = md5($this->session->userdata('current_page'));
        $comments = $this->comment_model->get_comments($comments_id);
 
        $this->comment_model->add_comment_section(array("cid" => $comments_id, "section" => $this->session->userdata('current_page')));
 
        $view_data = array(
            "section" => $this->section,
            "submenu" => $this->submenu,
            "cid" => $cid,
            "ssm" => 'photo',
            "breadcrumb" => "<a href='".base_url()."city/all'>?in Turizmi</a> > " . $city->name . " > <a href='".base_url()."city/photo/".$cid."'>Foto?raflar</a>",
            "subtitle" => "images/sub_title_ct.png",
            "submenutitle" => "images/sub_menu_title_ct.png",
            "city" => $city,
            "content" => $photo,
            "media_list" => $photos,
            "comments_id" => $comments_id,
            "comments" => $comments
                );
 
        $this->template->write_view("content", "city_photo", $view_data);
                $this->template->render();
    }
 
    function video($cid, $vid = 0)
    {
        if (!($vid > 0))
        {
            $random_vid = $this->city_model->get_random_video_id($cid);
            if ($random_vid > 0)
            {
                redirect("city/video/" . $cid . "/" . $random_vid);
            }
        }
 
        $city = $this->city_model->get_city($cid);
        $video = $this->city_model->get_video($cid, $vid);
 
        $photos = $this->city_model->get_photos($cid);
 
        $comments_id = md5($this->session->userdata('current_page'));
        $comments = $this->comment_model->get_comments($comments_id);
 
        $this->comment_model->add_comment_section(array("cid" => $comments_id, "section" => $this->session->userdata('current_page')));
 
        $view_data = array(
            "section" => $this->section,
            "submenu" => $this->submenu,
            "cid" => $cid,
            "ssm" => 'video',
            "breadcrumb" => "<a href='".base_url()."city/all'>?in Turizmi</a> > " . $city->name . " > <a href='".base_url()."city/video/".$cid."'>Videolar</a>",
            "subtitle" => "images/sub_title_ct.png",
            "submenutitle" => "images/sub_menu_title_ct.png",
            "city" => $city,
            "content" => $video,
            "media_list" => $photos,
            "comments_id" => $comments_id,
            "comments" => $comments
                );
 
        $this->template->write_view("content", "city_video", $view_data);
                $this->template->render();
    }
}
复制代码
发表于 2012-3-31 18:12:28 | 显示全部楼层
救命啊!

local.com?

是localhost啊!

本版积分规则