Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
shi-yang committed Jun 9, 2017
2 parents 7970c6a + cbb7d1b commit 917f7d5
Show file tree
Hide file tree
Showing 6,170 changed files with 507,097 additions and 201,005 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
22 changes: 13 additions & 9 deletions README.md
@@ -1,10 +1,16 @@
iisns - 地球村入口
------------------
> This project is only my spare time developed to learn yii2, will be submitted code from time to time. Have any questions can contact me. My e-mail address can be obtained from my GitHub homepage.Welcome to contribute your code. ^_^
> 这个项目只是我业余时间开发用来学习 yii2 的,会不定期提交代码。有什么问题都可以联系我。可以通过我的 GitHub 主页获取我的邮箱地址。欢迎贡献代码~ ^_^
**iiSNS is the SNS community system based on yii2, a one-stop solution to community stations. Can write articles, do records, upload pictures, forums. But also can be used for content management system (CMS). iiSNS is a free open source project licensed under the MIT license.**

**iiSNS 是基于 yii2 的 SNS 社区系统,一站式解决社区建站。可以写文章,做记录,上传图片,论坛聊天等。还可以用来做内容管理系统(CMS)。iiSNS 是一个免费的开源项目,在 MIT 许可证下授权发布。**


特点与功能特性
-----
------------
前后台分离,单入口应用程序,可创建主题,遵循 MVC 模式,按需加载功能,输入验证及输出过滤,模块化开发,兼容移动端(响应式布局),丰富的扩展库且易扩展,易使用易二次开发,国际化(I18N,目前支持中文、英文,通过添加语言文件还可支持更多语言)

前台
Expand All @@ -22,29 +28,28 @@ iisns - 地球村入口
- 新媒体行业
- 企业文化建设

更多用途,等你来发掘。演示:[www.iisns.com](http://www.iisns.com)
等等。演示[www.iisns.com](http://www.iisns.com)


文档
--------
[安装教程](https://github.com/shi-yang/iisns/wiki/iiSNS-%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B) |
[目录结构](https://github.com/shi-yang/iisns/wiki/iiSNS-%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84)
你可以点击下面的链接来查看开发和安装 iiSNS 的文档

更多帮助文档将会在Wiki上放出: [https://github.com/shi-yang/iisns/wiki](https://github.com/shi-yang/iisns/wiki)
[https://github.com/shi-yang/iisns/wiki](https://github.com/shi-yang/iisns/wiki)

获取支持与帮助
----------
提交问题:[Git issues](https://github.com/shi-yang/iisns/issues)

到 iiSNS 论坛上提出: [http://www.iisns.com/forum/iisns](http://www.iisns.com/forum/iisns)
到 iiSNS 论坛上提出: [http://www.iisns.com/@iisns](http://www.iisns.com/@iisns)

参与贡献代码
--------
----------

您参与的iisns的发展是非常欢迎!您可以以下几种方式参与:

- [报告问题](https://github.com/shi-yang/iisns/issues)
- [提供反馈意见或设计讨论](http://www.iisns.com/index.php/forum/iisns)
- [提供反馈意见或设计讨论](http://www.iisns.com/@iisns)
- 贡献核心代码或修复的bug

许可
Expand All @@ -60,4 +65,3 @@ iiSNS 的发布是遵循 [The MIT License](https://github.com/shi-yang/iisns/blo
![iiSNS](https://github.com/shi-yang/preview/blob/master/iisns_v2.1.2/Screen-shot 2015-06-20 11.30.19.png)
![iiSNS](https://github.com/shi-yang/preview/blob/master/iisns_v2.1.2/Screen-shot 2015-06-20 11.36.42.png)
![iiSNS](https://github.com/shi-yang/preview/blob/master/iisns_v2.1.2/Screen-shot 2015-06-20 11.41.22.png)

15 changes: 15 additions & 0 deletions backend/codeception.yml
@@ -0,0 +1,15 @@
namespace: backend\tests
actor: Tester
paths:
tests: tests
log: tests/_output
data: tests/_data
helpers: tests/_support
settings:
bootstrap: _bootstrap.php
colors: true
memory_limit: 1024M
modules:
config:
Yii2:
configFile: 'config/test-local.php'
10 changes: 7 additions & 3 deletions backend/controllers/PostController.php
Expand Up @@ -41,12 +41,16 @@ public function actionIndex()
$model = $this->findModel($v);
if (isset($_POST['review']) && $_POST['review'] == 'APPROVED') {
$model->explore_status = Post::EXPLORE_STATUS_APPROVED;
Yii::$app->getSession()->setFlash('success', '操作审核成功');
$message = "#{$v}: 操作审核成功";
} else {
$model->explore_status = Post::EXPLORE_STATUS_PENDING;
Yii::$app->getSession()->setFlash('success', '下架成功');
$message = "#{$v}: 下架成功";
}
if ($model->update()) {
$this->success($message);
} else {
$this->error("#{$v}: Error");
}
$model->save();
}
return $this->redirect(['index']);
}
Expand Down
9 changes: 5 additions & 4 deletions backend/controllers/SiteController.php
Expand Up @@ -52,11 +52,12 @@ public function actions()

public function actionIndex()
{
$userCount = Yii::$app->db->createCommand("SELECT count(*) as num FROM {{%user}}")->queryScalar();
$postCount = Yii::$app->db->createCommand("SELECT count(*) as num FROM {{%forum_post}}")->queryScalar();
$statistics['userCount'] = Yii::$app->db->createCommand("SELECT count(*) as num FROM {{%user}}")->queryScalar();
$statistics['postCount'] = Yii::$app->db->createCommand("SELECT count(*) as num FROM {{%home_post}}")->queryScalar();
$statistics['photoCount'] = Yii::$app->db->createCommand("SELECT count(*) as num FROM {{%home_photo}}")->queryScalar();
$statistics['forumCount'] = Yii::$app->db->createCommand("SELECT count(*) as num FROM {{%forum}}")->queryScalar();
return $this->render('index',[
'userCount' => $userCount,
'postCount' => $postCount,
'statistics' => $statistics,
]);
}

Expand Down
4 changes: 2 additions & 2 deletions backend/models/Post.php
Expand Up @@ -35,9 +35,9 @@ public static function tableName()
public function rules()
{
return [
[['title', 'content', 'tags', 'user_id', 'created_at', 'updated_at'], 'required'],
[['title', 'content', 'tags', 'user_id', 'created_at'], 'required'],
[['content', 'tags'], 'string'],
[['user_id', 'created_at', 'updated_at'], 'integer'],
[['user_id', 'created_at', 'updated_at', 'explore_status'], 'integer'],
[['title'], 'string', 'max' => 128]
];
}
Expand Down
2 changes: 1 addition & 1 deletion backend/modules/forum/controllers/BoardController.php
Expand Up @@ -33,7 +33,7 @@ public function actions()
{
return [
'upload' => [
'class' => 'shiyang\umeditor\UMeditorAction',
'class' => 'common\widgets\umeditor\UMeditorAction',
]
];
}
Expand Down
2 changes: 1 addition & 1 deletion backend/modules/forum/controllers/BroadcastController.php
Expand Up @@ -30,7 +30,7 @@ public function actions()
{
return [
'upload' => [
'class' => 'shiyang\umeditor\UMeditorAction',
'class' => 'common\widgets\umeditor\UMeditorAction',
]
];
}
Expand Down
2 changes: 1 addition & 1 deletion backend/modules/forum/controllers/ForumController.php
Expand Up @@ -28,7 +28,7 @@ public function actions()
{
return [
'upload' => [
'class' => 'shiyang\umeditor\UMeditorAction',
'class' => 'common\widgets\umeditor\UMeditorAction',
]
];
}
Expand Down
2 changes: 1 addition & 1 deletion backend/modules/forum/controllers/PostController.php
Expand Up @@ -32,7 +32,7 @@ public function actions()
{
return [
'upload' => [
'class' => 'shiyang\umeditor\UMeditorAction',
'class' => 'common\widgets\umeditor\UMeditorAction',
]
];
}
Expand Down
2 changes: 1 addition & 1 deletion backend/modules/forum/controllers/ThreadController.php
Expand Up @@ -33,7 +33,7 @@ public function actions()
{
return [
'upload' => [
'class' => 'shiyang\umeditor\UMeditorAction',
'class' => 'common\widgets\umeditor\UMeditorAction',
]
];
}
Expand Down
2 changes: 1 addition & 1 deletion backend/modules/forum/views/broadcast/_form.php
Expand Up @@ -11,7 +11,7 @@
'template' => '<div class="input-group"><span class="input-group-addon">' . Yii::t('app', 'Title') . '</span>{input}</div>',
])->textInput(['maxlength' => 128, 'autocomplete'=>'off']) ?>

<?= $form->field($newBroadcast, 'content')->widget('shiyang\umeditor\UMeditor', [
<?= $form->field($newBroadcast, 'content')->widget('common\widgets\umeditor\UMeditor', [
'clientOptions' => [
'initialFrameHeight' => 100,
'toolbar' => [
Expand Down
2 changes: 1 addition & 1 deletion backend/modules/forum/views/layouts/forum.php
Expand Up @@ -2,7 +2,7 @@

use yii\widgets\Breadcrumbs;
use yii\helpers\Url;
use frontend\widgets\Alert;
use common\widgets\Alert;

?>

Expand Down
2 changes: 1 addition & 1 deletion backend/modules/forum/views/post/_form.php
Expand Up @@ -23,7 +23,7 @@
<div class="post-form col-sm-10">
<?php if (!Yii::$app->user->isGuest) :?>
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'content')->widget('shiyang\umeditor\UMeditor', [
<?= $form->field($model, 'content')->widget('common\widgets\umeditor\UMeditor', [
'clientOptions' => [
'initialFrameHeight' => 100,
'toolbar' => [
Expand Down
2 changes: 1 addition & 1 deletion backend/modules/forum/views/thread/_form.php
Expand Up @@ -27,7 +27,7 @@
])->textInput(['maxlength' => 128, 'autocomplete'=>'off'])
?>

<?= $form->field($model, 'content')->widget('shiyang\umeditor\UMeditor', [
<?= $form->field($model, 'content')->widget('common\widgets\umeditor\UMeditor', [
'clientOptions' => [
'initialFrameHeight' => 100,
'toolbar' => [
Expand Down
2 changes: 1 addition & 1 deletion backend/views/layouts/main.php
Expand Up @@ -3,7 +3,7 @@
use yii\helpers\Url;
use yii\widgets\Breadcrumbs;
use backend\assets\AdminLteAsset;
use frontend\widgets\Alert;
use common\widgets\Alert;

/* @var $this \yii\web\View */
/* @var $content string */
Expand Down
2 changes: 1 addition & 1 deletion backend/views/post/_form.php
Expand Up @@ -16,7 +16,7 @@

<?= $form->field($model, 'content', [
'template' => '{input}{error}{hint}'
])->widget('shiyang\umeditor\UMeditor', [
])->widget('common\widgets\umeditor\UMeditor', [
'clientOptions' => [
'initialFrameHeight' => 100,
'toolbar' => [
Expand Down
63 changes: 7 additions & 56 deletions backend/views/site/index.php
Expand Up @@ -12,7 +12,7 @@
</span>
<div class="info-box-content">
<span class="info-box-text"><?= Yii::t('app', 'Registered users') ?></span>
<span class="info-box-number"><?= $userCount ?></span>
<span class="info-box-number"><?= $statistics['userCount'] ?></span>
</div>
</div>
</div><!-- ./col -->
Expand All @@ -23,7 +23,7 @@
</span>
<div class="info-box-content">
<span class="info-box-text">Forum Posts</span>
<span class="info-box-number"><?= $postCount ?></span>
<span class="info-box-number"><?= $statistics['postCount'] ?></span>
</div>
</div>
</div><!-- ./col -->
Expand All @@ -33,8 +33,8 @@
<i class="glyphicon glyphicon-apple"></i>
</span>
<div class="info-box-content">
<span class="info-box-text">CPU Traffic</span>
<span class="info-box-number">9999999999<small>%</small></span>
<span class="info-box-text">Photos</span>
<span class="info-box-number"><?= $statistics['photoCount'] ?></span>
</div>
</div>
</div><!-- ./col -->
Expand All @@ -44,62 +44,13 @@
<i class="glyphicon glyphicon-knight"></i>
</span>
<div class="info-box-content">
<span class="info-box-text">CPU Traffic</span>
<span class="info-box-number">9999999999<small>%</small></span>
<span class="info-box-text">Forum</span>
<span class="info-box-number"><?= $statistics['forumCount'] ?></span>
</div>
</div>
</div><!-- ./col -->
</div><!-- /.row -->

<div class="row">
<div class="col-md-6">
<div class="box box-solid">
<div class="box-header with-border">
<i class="fa fa-text-width"></i>

<h3 class="box-title">Headlines</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<h1>h1. Bootstrap heading</h1>

<h2>h2. Bootstrap heading</h2>

<h3>h3. Bootstrap heading</h3>
<h4>h4. Bootstrap heading</h4>
<h5>h5. Bootstrap heading</h5>
<h6>h6. Bootstrap heading</h6>
</div>
<!-- /.box-body -->
</div>
</div>
<div class="col-md-6">
<div class="box box-solid">
<div class="box-header with-border">
<i class="fa fa-text-width"></i>
<h3 class="box-title">Text Emphasis</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<p class="lead">Lead to emphasize importance</p>

<p class="text-green">Text green to emphasize success</p>

<p class="text-aqua">Text aqua to emphasize info</p>

<p class="text-light-blue">Text light blue to emphasize info (2)</p>

<p class="text-red">Text red to emphasize danger</p>

<p class="text-yellow">Text yellow to emphasize warning</p>

<p class="text-muted">Text muted to emphasize general</p>
</div>
<!-- /.box-body -->
</div>
</div>
</div>

<div class="row">
<div class="col-xs-12">
<div class="box">
Expand All @@ -115,7 +66,7 @@
<tbody>
<tr>
<td>iiSNS version</td>
<td><?= Yii::$app->setting->get('version') ?></td>
<td><?= Yii::$app->setting->getVersion() ?></td>
</tr>
<tr>
<td>The operating system</td>
Expand Down
9 changes: 9 additions & 0 deletions codeception.yml
@@ -0,0 +1,9 @@
# global codeception file to run tests from all apps
include:
- common
- frontend
- backend
paths:
log: console/runtime/logs
settings:
colors: true
15 changes: 15 additions & 0 deletions common/codeception.yml
@@ -0,0 +1,15 @@
namespace: common\tests
actor: Tester
paths:
tests: tests
log: tests/_output
data: tests/_data
helpers: tests/_support
settings:
bootstrap: _bootstrap.php
colors: true
memory_limit: 1024M
modules:
config:
Yii2:
configFile: 'config/test-local.php'
3 changes: 3 additions & 0 deletions common/components/BaseController.php
Expand Up @@ -9,13 +9,16 @@

use Yii;
use yii\web\Controller;
use common\traits\FlashTrait;

/**
* @author Shiyang <dr@shiyang.me>
* @since 2.0
*/
class BaseController extends Controller
{
use FlashTrait;

public function init()
{
$this->setLanguage();
Expand Down
9 changes: 9 additions & 0 deletions common/components/Setting.php
Expand Up @@ -113,4 +113,13 @@ public function getData()
$settings = Yii::$app->db->createCommand("SELECT * FROM {{%setting}}")->queryAll();
return \yii\helpers\ArrayHelper::map($settings, 'key', 'value');
}

/**
* Returns a string representing the current version of the iisns.
* @return string the version of iisns
*/
public static function getVersion()
{
return '0.6.0';
}
}

0 comments on commit 917f7d5

Please sign in to comment.