diff --git a/application/config/_notes/dwsync.xml b/application/config/_notes/dwsync.xml
index 952292d..39e0c82 100644
--- a/application/config/_notes/dwsync.xml
+++ b/application/config/_notes/dwsync.xml
@@ -1,6 +1,6 @@
-
+
diff --git a/application/config/config.php b/application/config/config.php
index d33174a..09af1c9 100644
--- a/application/config/config.php
+++ b/application/config/config.php
@@ -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';
/*
|--------------------------------------------------------------------------
diff --git a/application/controllers/Ajax.php b/application/controllers/Ajax.php
index 9bb1896..c921263 100644
--- a/application/controllers/Ajax.php
+++ b/application/controllers/Ajax.php
@@ -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++;
}
diff --git a/application/controllers/Member.php b/application/controllers/Member.php
index 9e5f037..d7a2450 100644
--- a/application/controllers/Member.php
+++ b/application/controllers/Member.php
@@ -11,7 +11,8 @@ public function __construct()
public function _remap($username)
{
-
+ $data['site_title'] = $username;
+ $this->load->view('member', $data);
}
diff --git a/application/controllers/Module.php b/application/controllers/Module.php
new file mode 100644
index 0000000..3c4d963
--- /dev/null
+++ b/application/controllers/Module.php
@@ -0,0 +1,43 @@
+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);
+ }
+
+
+}
+
+?>
\ No newline at end of file
diff --git a/application/controllers/Topic.php b/application/controllers/Topic.php
index abed8b0..dd4ef1e 100644
--- a/application/controllers/Topic.php
+++ b/application/controllers/Topic.php
@@ -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)
@@ -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);
+ }
}
+
+
}
?>
\ No newline at end of file
diff --git a/application/controllers/Welcome.php b/application/controllers/Welcome.php
index 7be8c9f..12530eb 100644
--- a/application/controllers/Welcome.php
+++ b/application/controllers/Welcome.php
@@ -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);
}
diff --git a/application/controllers/_notes/dwsync.xml b/application/controllers/_notes/dwsync.xml
index 90c04a2..d464c13 100644
--- a/application/controllers/_notes/dwsync.xml
+++ b/application/controllers/_notes/dwsync.xml
@@ -1,11 +1,12 @@
-
+
-
-
+
+
-
+
+
\ No newline at end of file
diff --git a/application/libraries/_notes/dwsync.xml b/application/libraries/_notes/dwsync.xml
index 3e330bb..5154cc4 100644
--- a/application/libraries/_notes/dwsync.xml
+++ b/application/libraries/_notes/dwsync.xml
@@ -5,6 +5,6 @@
-
+
\ No newline at end of file
diff --git a/application/models/_notes/dwsync.xml b/application/models/_notes/dwsync.xml
index 3790f6b..ec80fa7 100644
--- a/application/models/_notes/dwsync.xml
+++ b/application/models/_notes/dwsync.xml
@@ -6,4 +6,6 @@
+
+
\ No newline at end of file
diff --git a/application/views/_notes/dwsync.xml b/application/views/_notes/dwsync.xml
index b932dc3..a2f4064 100644
--- a/application/views/_notes/dwsync.xml
+++ b/application/views/_notes/dwsync.xml
@@ -1,10 +1,13 @@
-
-
-
+
+
+
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/application/views/common/_notes/dwsync.xml b/application/views/common/_notes/dwsync.xml
index dfd9bf1..4892566 100644
--- a/application/views/common/_notes/dwsync.xml
+++ b/application/views/common/_notes/dwsync.xml
@@ -1,11 +1,7 @@
-
-
-
-
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/application/views/common/footer_common.php b/application/views/common/footer.php
similarity index 100%
rename from application/views/common/footer_common.php
rename to application/views/common/footer.php
diff --git a/application/views/common/generate.php b/application/views/common/generate.php
index 72c3d20..9945cfe 100644
--- a/application/views/common/generate.php
+++ b/application/views/common/generate.php
@@ -22,7 +22,7 @@ function generate_preview_topic(topic_data)
'' +
'' +
'
' +
- '
' +
+ '
' +
'
' +
'' + topic_data['module_name'] + ' • ' +
'' + topic_data['user_name'] + ' • ' +
diff --git a/application/views/common/header_common.php b/application/views/common/header.php
similarity index 86%
rename from application/views/common/header_common.php
rename to application/views/common/header.php
index a89280e..005e9c4 100644
--- a/application/views/common/header_common.php
+++ b/application/views/common/header.php
@@ -1,22 +1,33 @@
-
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
@@ -9,132 +9,8 @@
$(document).ready(function()
{
- var topic_per_page = ;
- var arr=[];
- // Generate titles in main_heading and publish_module_menu
- var head_str = 'module_model->get_module_arr());?>';
- var head_name_array = head_str.split(',');
- for (index in head_name_array)
- {
- $("#main_heading").append('
');
- $("#publish_module_menu").append('
' + head_name_array[index] + '');
- }
-
- // The changes of main_body
- $.extend(
- {
- main_body_change: function(data, topic_num)
- {
- $("#main_body").html(data);
-
- arr['topic_num'] = topic_num;
-
- $("a.ji-pagination").click(function(e)
- {
- var data = [];
- data.max_page = Math.ceil(arr['topic_num'] / topic_per_page);
- data.page_id = $(e.target).attr("pageid");
- data.need_change = false;
- data.step = ;
- data.page_now = arr['topic_page'];
-
- pagination_change(data);
-
- if (data.page_now != arr['topic_page'])
- {
- arr['topic_page'] = data.page_now;
- generate_preview_list(arr, $.main_body_change);
- }
- });
-
- },
-
- main_body_trig: function(id)
- {
- selected_module_id = id;
- $("#publish_module_text").html(head_name_array[id-1]);
- arr['module_id'] = id;
- arr['topic_page'] = 1;
- generate_preview_list(arr, $.main_body_change);
- }
- });
-
- // The click actions of the titles in main_heading
- var $head_last_clicked = $("#main_heading_1");
- $head_last_clicked.attr('class','btn btn-primary btn-block active');
- $.main_body_trig(1);
-
- $("#main_heading button").click(function(e)
- {
- $head_last_clicked.attr('class','btn btn-link btn-block');
- $head_last_clicked = $(e.target);
- $head_last_clicked.attr('class','btn btn-primary btn-block active');
- $.main_body_trig($head_last_clicked.attr('module_id'));
- });
-
- // Select the module (publishing)
- var selected_module_id = 1;
- $("#publish_module_text").html(head_name_array[0]);
- $(".publish_module_select").click(function(e)
- {
- selected_module_id = $(e.target).attr('sid');
- $("#publish_module_text").html($(e.target).html());
- });
- $("#publish_button").click(function()
- {
- var topic = $("#publish_topic").val();
- if (topic == '')
- {
- alert("请输入帖子标题");
- return;
- }
- if (editor.count('text') > )
- {
- alert("帖子长度超过限制");
- return;
- }
- var content = editor.html();
- if (content == '')
- {
- alert("请输入帖子内容");
- return;
- }
- content = content.replace(',', '¸');
- $.ajax
- ({
- type: 'POST',
- url: '',
- data:
- {
- module_id : selected_module_id,
- topic: topic,
- content: content
- },
- success: function(data)
- {
- //alert(data);
- switch(data)
- {
- case 'topic undefined' : alert('发送失败:帖子标题为空'); break;
- case 'user undefined' : alert('发送失败:用户未登录'); break;
- case 'content undefined' : alert('发送失败:帖子内容为空'); break;
- case 'module undefined' : alert('发送失败:帖子分类未选择'); break;
- default:
- topic_id = data;
- window.location.href = '' + '/' + topic_id;
-
- }
- },
- error: function()
- {
- alert('发送失败');
- },
- dataType: 'text'
- });
- });
-
});
@@ -151,82 +27,41 @@
- 欢迎参加 JIBBS ALPHA 测试!
+ 欢迎访问 JIBBS 正式版 (v0.1.0)
- 参与测试的邮箱将在正式版中获得奖励
+ 感谢33位测试者提出的宝贵建议
目前有大量功能仍在完善中
- 欢迎访问我们的github
+ 如个人资料完善,个人主页等
- 有任何bug反馈和功能建议请直接发帖或在issue中提出,谢谢!
+ 欢迎访问我们的github
- 帖子加载卡住基本上是密院的数据库卡住了,轻喷
+ 有任何bug反馈和功能建议请直接在相关板块发帖或在issue中提出,谢谢!
-
-
-
+
+
-
+
-
-
+
\ No newline at end of file
diff --git a/application/views/member.php b/application/views/member.php
new file mode 100644
index 0000000..5558f38
--- /dev/null
+++ b/application/views/member.php
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
个人主页
+
+
+
+
+ 对不起,该功能暂未开放,尽情期待,谢谢您的支持!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/application/views/module.php b/application/views/module.php
new file mode 100644
index 0000000..17423ad
--- /dev/null
+++ b/application/views/module.php
@@ -0,0 +1,23 @@
+
+
+
+
+
+