Skip to content

Commit

Permalink
Merge pull request #9 from SJTU-UMJI-Tech/develop
Browse files Browse the repository at this point in the history
Release v0.1.0
  • Loading branch information
tc-imba committed Apr 9, 2016
2 parents b1072b7 + 68269fe commit ba15136
Show file tree
Hide file tree
Showing 45 changed files with 503 additions and 270 deletions.
2 changes: 1 addition & 1 deletion application/config/_notes/dwsync.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="config.php" server="G:/github/JIBBS/" local="131023435156463386" remote="131023435150000000" Dst="0" />
<file name="config.php" server="G:/github/JIBBS/" local="131046815803468748" remote="131046815800000000" Dst="0" />
<file name="routes.php" server="G:/github/JIBBS/" local="131009634156049971" remote="131009634150000000" Dst="0" />
<file name="autoload.php" server="G:/github/JIBBS/" local="131023435156453405" remote="131023435150000000" Dst="0" />
<file name="user_agents.php" server="G:/github/JIBBS/" local="131023435156523420" remote="131023435150000000" Dst="0" />
Expand Down
2 changes: 1 addition & 1 deletion application/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
| a PHP script and you can easily do that on your own.
|
*/
$config['base_url'] = 'http://59.78.30.168:8000';
$config['base_url'] = 'http://127.0.0.1';

/*
|--------------------------------------------------------------------------
Expand Down
43 changes: 24 additions & 19 deletions application/controllers/Ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,28 +173,33 @@ public function get_topic_reply()
foreach ($reply_arr as $reply)
{
$user = $this->user_model->get_user_by_id($reply->user_id);
if ($reply->state != 0 && $user->id != $this->session->userdata('uid'))
{
$reply_str[$index] = array('state' => -1);
}
else
$reply_str[$index] = array
(
'user_name' => $user->username,
'user_avatar' => $user->avatar,
'content' => $reply->content,
'time_ago' => $this->get_time_delay($reply->UPDATE_TIMESTAMP),
'create_time' => $reply->CREATE_TIMESTAMP,
'update_time' => $reply->UPDATE_TIMESTAMP,
'floor_id' => $reply->floor_id,
'reply_floor' => $reply->reply_floor,
'state' => $reply->state
);
if ($reply->state != 0)
{
$reply_str[$index] = array
(
'user_name' => $user->username,
'user_avatar' => $user->avatar,
'content' => $reply->content,
'time_ago' => $this->get_time_delay($reply->UPDATE_TIMESTAMP),
'create_time' => $reply->CREATE_TIMESTAMP,
'update_time' => $reply->UPDATE_TIMESTAMP,
'floor_id' => $reply->floor_id,
'reply_floor' => $reply->reply_floor,
'state' => $reply->state
);
if (!isset($reply_str[0][$reply->reply_floor]) && $reply->reply_floor > 0 && $reply->reply_floor <= $this->input->get('first') || $reply->reply_floor > $this->input->get('first') + $this->input->get('step'))
if ($user->id == $this->session->userdata('uid'))
{
$reply_str[0][$reply->reply_floor] = $this->reply_model->get_reply_summary(array('topic_id'=>$this->input->get('topic_id'), 'floor_id'=>$reply->reply_floor));
$reply_str[$index]['user_type'] = 'author';
}
else
{
$reply_str[$index++] = array('state' => -1);
continue;
}
}
if (!isset($reply_str[0][$reply->reply_floor]) && $reply->reply_floor > 0 && $reply->reply_floor <= $this->input->get('first') || $reply->reply_floor > $this->input->get('first') + $this->input->get('step'))
{
$reply_str[0][$reply->reply_floor] = $this->reply_model->get_reply_summary(array('topic_id'=>$this->input->get('topic_id'), 'floor_id'=>$reply->reply_floor));
}
$index++;
}
Expand Down
3 changes: 2 additions & 1 deletion application/controllers/Member.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public function __construct()

public function _remap($username)
{

$data['site_title'] = $username;
$this->load->view('member', $data);


}
Expand Down
43 changes: 43 additions & 0 deletions application/controllers/Module.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Module extends Front_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('module_model');
}

private function view($id)
{
$data['site_title'] = '模块';
$module_name_array = $this->module_model->get_module_arr();
$data['module_name_array'] = json_encode($module_name_array);
if ($id == NULL)
{
$data['module_now'] = 1;
}
else if ($id[0] < 1)
{
$data['module_now'] = 1;
}
else if ($id[0] > count($module_name_array))
{
$data['module_now'] = count($module_name_array);
}
else
{
$data['module_now'] = $id[0];
}
$this->load->view('module', $data);
}

public function _remap($id)
{
$this->view($id);
}


}

?>
26 changes: 23 additions & 3 deletions application/controllers/Topic.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@ public function __construct()
$this->load->model('user_model');
}

public function _remap($id, $num)
private function add()
{
$this->load->model('module_model');
$data['site_title'] = '发表帖子';
$data['module_name_array'] = json_encode($this->module_model->get_module_arr());
$this->load->view('topic_add', $data);
}

private function view($id, $num)
{

$data['topic_id'] = $id;
$topic = $this->topic_model->get_topic_by_id($id);
if ($topic->id == 0)
Expand Down Expand Up @@ -43,9 +50,22 @@ public function _remap($id, $num)
}
$this->load->view('topic', $data);
}

}

public function _remap($id, $num)
{
if ($id == 'add')
{
$this->add();
}
else
{
$this->view($id, $num);
}

}


}

?>
4 changes: 3 additions & 1 deletion application/controllers/Welcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ class Welcome extends Front_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('site_model');
//$this->load->model('site_model');
$this->load->model('module_model');
}

public function index()
{
$data['site_title'] = '首页';
$data['module_name_array'] = json_encode($this->module_model->get_module_arr());
$data['module_now'] = 0;
$this->load->view('home', $data);
}

Expand Down
9 changes: 5 additions & 4 deletions application/controllers/_notes/dwsync.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="user.php" server="G:/github/JIBBS/" local="131039936052312317" remote="131039936050000000" Dst="0" />
<file name="Welcome.php" server="G:/github/JIBBS/" local="131017401272180013" remote="131017401270000000" Dst="0" />
<file name="Welcome.php" server="G:/github/JIBBS/" local="131027578114604894" remote="131027578110000000" Dst="0" />
<file name="index.html" server="G:/github/JIBBS/" local="131009634156090000" remote="131009634150000000" Dst="0" />
<file name="User.php" server="G:/github/JIBBS/" local="131015783281031959" remote="131015783280000000" Dst="0" />
<file name="Ajax.php" server="G:/github/JIBBS/" local="131039873444940509" remote="131039873440000000" Dst="0" />
<file name="User.php" server="G:/github/JIBBS/" local="131046815803495305" remote="131046815800000000" Dst="0" />
<file name="Ajax.php" server="G:/github/JIBBS/" local="131046815803485285" remote="131046815800000000" Dst="0" />
<file name="Mailtest.php" server="G:/github/JIBBS/" local="131022297098048529" remote="131022297090000000" Dst="0" />
<file name="Topic.php" server="G:/github/JIBBS/" local="131039881683631203" remote="131039881680000000" Dst="0" />
<file name="Member.php" server="G:/github/JIBBS/" local="131039881680000000" remote="131039881680000000" Dst="0" />
<file name="Member.php" server="G:/github/JIBBS/" local="131046914720876570" remote="131046914720000000" Dst="0" />
<file name="Module.php" server="G:/github/JIBBS/" local="131046937550000000" remote="131046937550000000" Dst="0" />
</dwsync>
2 changes: 1 addition & 1 deletion application/libraries/_notes/dwsync.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<file name="Topic_obj.php" server="G:/github/JIBBS/" local="131023581922848874" remote="131023581920000000" Dst="0" />
<file name="User_Obj.php" server="G:/github/JIBBS/" local="131026708272609997" remote="131026708270000000" Dst="0" />
<file name="Topic_Obj.php" server="G:/github/JIBBS/" local="131033838178236946" remote="131033838170000000" Dst="0" />
<file name="Module_Obj.php" server="G:/github/JIBBS/" local="131023591330000000" remote="131023591330000000" Dst="0" />
<file name="Reply_Obj.php" server="G:/github/JIBBS/" local="131029501393023142" remote="131029501390000000" Dst="0" />
<file name="Module_obj.php" server="G:/github/JIBBS/" local="131046815803495305" remote="131046815800000000" Dst="0" />
</dwsync>
2 changes: 2 additions & 0 deletions application/models/_notes/dwsync.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
<file name="module_model.php" server="G:/github/JIBBS/" local="131023600404245480" remote="131023600400000000" Dst="0" />
<file name="topic_model.php" server="G:/github/JIBBS/" local="131033838178262220" remote="131033838170000000" Dst="0" />
<file name="reply_model.php" server="G:/github/JIBBS/" local="131033838178250549" remote="131033838170000000" Dst="0" />
<file name="Topic_model.php" server="G:/github/JIBBS/" local="131046815803565355" remote="131046815800000000" Dst="0" />
<file name="Module_model.php" server="G:/github/JIBBS/" local="131046815803545533" remote="131046815800000000" Dst="0" />
</dwsync>
15 changes: 9 additions & 6 deletions application/views/_notes/dwsync.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="user_register.php" server="G:/github/JIBBS/" local="131039873359889762" remote="131039873350000000" Dst="0" />
<file name="user_login.php" server="G:/github/JIBBS/" local="131039873359879755" remote="131039873350000000" Dst="0" />
<file name="home.php" server="G:/github/JIBBS/" local="131039873445035585" remote="131039873440000000" Dst="0" />
<file name="user_register.php" server="G:/github/JIBBS/" local="131046919905396226" remote="131046919900000000" Dst="0" />
<file name="user_login.php" server="G:/github/JIBBS/" local="131046919905195947" remote="131046919900000000" Dst="0" />
<file name="home.php" server="G:/github/JIBBS/" local="131046974818461296" remote="131046974810000000" Dst="0" />
<file name="index.html" server="G:/github/JIBBS/" local="131009634156265121" remote="131009634150000000" Dst="0" />
<file name="topic.php" server="G:/github/JIBBS/" local="131039873445070610" remote="131039873440000000" Dst="0" />
<file name="user_avatar.php" server="G:/github/JIBBS/" local="131039873350000000" remote="131039873350000000" Dst="0" />
<file name="user_settings.php" server="G:/github/JIBBS/" local="131039914880000000" remote="131039914880000000" Dst="0" />
<file name="topic.php" server="G:/github/JIBBS/" local="131046928702190060" remote="131046928700000000" Dst="0" />
<file name="user_avatar.php" server="G:/github/JIBBS/" local="131046919905025800" remote="131046919900000000" Dst="0" />
<file name="user_settings.php" server="G:/github/JIBBS/" local="131046919905616379" remote="131046919900000000" Dst="0" />
<file name="member.php" server="G:/github/JIBBS/" local="131046915957237870" remote="131046915950000000" Dst="0" />
<file name="topic_add.php" server="G:/github/JIBBS/" local="131046937973019698" remote="131046937970000000" Dst="0" />
<file name="module.php" server="G:/github/JIBBS/" local="131046937970000000" remote="131046937970000000" Dst="0" />
</dwsync>
12 changes: 4 additions & 8 deletions application/views/common/_notes/dwsync.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="header_common.php" server="G:/github/JIBBS/" local="131039942847590380" remote="131039942840000000" Dst="0" />
<file name="text_validation.php" server="G:/github/JIBBS/" local="131023435159415835" remote="131023435150000000" Dst="0" />
<file name="sidebar_common.php" server="G:/github/JIBBS/" local="131039873359849733" remote="131039873350000000" Dst="0" />
<file name="footer_common.php" server="G:/github/JIBBS/" local="131023435159395816" remote="131023435150000000" Dst="0" />
<file name="generate.php" server="G:/github/JIBBS/" local="131039873444995548" remote="131039873440000000" Dst="0" />
<file name="header_syntaxhighlighter.php" server="G:/github/JIBBS/" local="131029501393113184" remote="131029501390000000" Dst="0" />
<file name="kindeditor.php" server="G:/github/JIBBS/" local="131039877100985378" remote="131039877100000000" Dst="0" />
<file name="editor_login.php" server="G:/github/JIBBS/" local="131039873444985541" remote="131039873440000000" Dst="0" />
<file name="generate.php" server="G:/github/JIBBS/" local="131046914720946453" remote="131046914720000000" Dst="0" />
<file name="footer.php" server="G:/github/JIBBS/" local="131046815803575362" remote="131046815800000000" Dst="0" />
<file name="header.php" server="G:/github/JIBBS/" local="131046925714532834" remote="131046925710000000" Dst="0" />
<file name="sidebar.php" server="G:/github/JIBBS/" local="131046976457310687" remote="131046976450000000" Dst="0" />
</dwsync>
File renamed without changes.
2 changes: 1 addition & 1 deletion application/views/common/generate.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function generate_preview_topic(topic_data)
'</div>' +
'<a class="media-left" href="<?php echo base_url('member');?>/' + topic_data['user_name'] + '"><img class="img-rounded" src="' + get_avatar_path(topic_data['user_name'], topic_data['user_avatar'], '') + '" alt="' + topic_data['user_name'] + '_avatar"></a>' +
'<div class="media-body">' +
'<h4 class="media-heading topic-list-heading"><a href="<?php echo base_url('topic');?>/' + topic_data['topic_id'] + '">' + Base64.decode(topic_data['topic_name']) + '</a></h4>' +
'<h4 class="media-heading topic-list-heading"><a href="<?php echo base_url('topic');?>/' + topic_data['topic_id'] + '/1">' + Base64.decode(topic_data['topic_name']) + '</a></h4>' +
'<p class="small text-muted">' +
'<span><a href="<?php echo base_url('module');?>/' + topic_data['module_id'] + '">' + topic_data['module_name'] + '</a></span>&nbsp;•&nbsp;' +
'<span><a href="<?php echo base_url('member');?>/' + topic_data['user_name'] + '">' + topic_data['user_name'] + '</a></span>&nbsp;•&nbsp;' +
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<html lang="zh-cn"><head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="<?php echo base_url('static/img/favicon.png');?>">
<script src="../../../static/js/jquery.min.js"></script>
<script src="../../../static/js/bootstrap.min.js"></script>
<link href="<?php echo base_url('static/css/bootstrap.min.css');?>" rel="stylesheet">
<link href="<?php echo base_url('static/css/custom.css');?>" rel="stylesheet">
<link rel="shortcut icon" href="/static/img/favicon.png">

<!-- Local Scripts -->
<!--
<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
-->
<!-- End of Local Scripts -->

<!-- Online Scripts -->
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<!-- End of Online Scripts -->

<link href="/static/css/custom.css" rel="stylesheet">


<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<![endif]-->

<script type="text/javascript">
function get_avatar_path(username, avatar, type)
{
Expand Down Expand Up @@ -78,15 +89,15 @@ function refresh_common_href()
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li<?php if (uri_string()=='') {echo ' class="active"';}?>><a href="<?php echo base_url();?>"><strong>首页</strong></a></li>
<li<?php if (uri_string()=='node') {echo ' class="active"';}?>><a href="<?php echo base_url('');?>"><strong>节点</strong></a></li>
<li<?php if (uri_string()=='topic/add') {echo ' class="active"';}?>><a href="<?php echo base_url('');?>"><strong>发表</strong></a></li>
<li<?php if (uri_string()=='node') {echo ' class="active"';}?>><a href="<?php echo base_url('module');?>"><strong>模块</strong></a></li>
<li<?php if (uri_string()=='topic/add') {echo ' class="active"';}?>><a href="<?php echo base_url('topic/add');?>"><strong>发表</strong></a></li>
</ul>
<form class="navbar-form navbar-left" role="search" action="http://www.google.com/search" method="get" target="_blank">
<!--<form class="navbar-form navbar-left" role="search" action="http://www.google.com/search" method="get" target="_blank">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search" name="q">
<input type="hidden" name="sitesearch" value="<?php echo base_url()?>">
</div>
</form>
</form>-->
<ul class="nav navbar-nav navbar-right">
<?php if ($this->session->userdata('username')) : ?>
<li><a href="<?php echo base_url('member/'.$this->session->userdata('username')); ?>"><?php echo $this->session->userdata('username'); ?></a></li>
Expand Down
Loading

0 comments on commit ba15136

Please sign in to comment.