Website is working!

This commit is contained in:
Vladislav Khorev 2014-11-22 13:14:22 +00:00
parent c978ba8e19
commit 2ed0710575
24 changed files with 644 additions and 119 deletions

View File

@ -1,13 +1,25 @@
<?php
//ini_set('error_reporting', E_ALL);
//ini_set('display_errors', 'On'); //On or Off
// change the following paths if necessary
$yii=dirname(__FILE__).'/../../../yii1.1.15/framework/yii.php';
if (strncasecmp(PHP_OS, 'WIN', 3) == 0)
{
$yii=dirname(__FILE__).'/../../../yii1.1.15/framework/yii.php';
}
else
{
$yii=dirname(__FILE__).'/../../yii1.1.15/framework/yii.php';
}
$config=dirname(__FILE__).'/protected/config/main.php';
// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
//defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
require_once($yii);
Yii::createWebApplication($config)->run();

View File

@ -0,0 +1,30 @@
<?php
/**
* ApplicationConfigBehavior is a behavior for the application.
* It loads additional config paramenters that cannot be statically
* written in config/main
*/
class ApplicationConfigBehavior extends CBehavior
{
/**
* Declares events and the event handler methods
* See yii documentation on behaviour
*/
public function events()
{
return array_merge(parent::events(), array(
'onBeginRequest'=>'beginRequest',
));
}
/**
* Load configuration that cannot be put in config/main
*/
public function beginRequest()
{
if (isset(Yii::app()->request->cookies['pref_lang']))
$this->owner->language= Yii::app()->request->cookies['pref_lang']->value; //set a language for each request
else
$this->owner->language='en';
}
}

View File

@ -0,0 +1,10 @@
<?php
class LangBox extends CWidget
{
public function run()
{
$currentLang = Yii::app()->language;
$this->render('application.views.site.langBox', array('currentLang' => $currentLang));
}
}
?>

View File

@ -34,4 +34,5 @@ class UserIdentity extends CUserIdentity
$this->errorCode=self::ERROR_PASSWORD_INVALID;
return false;
}
}

View File

@ -7,7 +7,11 @@
// CWebApplication properties can be configured here.
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'My Web Application',
'name'=>'Hello China!',
'sourceLanguage'=>'en',
'language'=>'en',
'timeZone' => 'Europe/Moscow',
'behaviors' => array('ApplicationConfigBehavior'),
// preloading 'log' component
'preload'=>array('log'),
@ -21,12 +25,13 @@ return array(
'modules'=>array(
// uncomment the following to enable the Gii tool
/*
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'ChinaJournal55%%%echo',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1'),
),
),*/
),

View File

@ -28,6 +28,12 @@ class SiteController extends Controller
public function actionIndex()
{
if(isset($_POST['lang']))
{
Yii::app()->request->cookies['pref_lang'] = new CHttpCookie('pref_lang', $_POST['lang']);
Yii::app()->language = $_POST['lang'];
}
$dataProvider=new CActiveDataProvider('Post', array(
'criteria'=>array(
'order'=>'date DESC, id DESC',
@ -86,24 +92,20 @@ class SiteController extends Controller
public function actionRegister()
{
$model=new RegisterForm('register');
$model=new User('register');
if(isset($_POST['RegisterForm']))
if(isset($_POST['User']))
{
$model->attributes=$_POST['RegisterForm'];
$model->attributes=$_POST['User'];
if($model->validate())
{
$password_hash = $this->better_crypt($model->password);
$model->password = $this->better_crypt($model->password);
$user=new User;
$user->username= $model->username;
$user->email = $model->email;
$user->password= $password_hash;
$user->save();
$this->redirect(Yii::app()->user->returnUrl);
$model->save();
//$this->redirect(Yii::app()->user->returnUrl);
$this->redirect(array("site/login"));
return;
}
@ -148,7 +150,14 @@ class SiteController extends Controller
$imageFileName = 'uploaded/' . $username . '-' . ($user->postCount + 1) . '.' . $model->image->extensionName;
$model->image->saveAs('C:/Workplace/Apache2.4/htdocs/cj/' . $imageFileName);
if (strncasecmp(PHP_OS, 'WIN', 3) == 0)
{
$model->image->saveAs('C:/Workplace/Apache2.4/htdocs/cj/' . $imageFileName);
}
else
{
$model->image->saveAs('/home/fishrungames-http/fishrungames.ru/http/cj/' . $imageFileName);
}
$user->postCount = $user->postCount + 1;
@ -160,6 +169,7 @@ class SiteController extends Controller
$post->title = $model->title;
$post->text = $model->text;
$post->imageFileName = $imageFileName;
$post->date = date('Y-m-d H:i:s');
$post->save();

View File

@ -1,8 +1,18 @@
CREATE TABLE `cjbase`.`tbl_user` (
CREATE TABLE `tbl_user` (
`id` INT NOT NULL AUTO_INCREMENT,
`username` VARCHAR(45) NOT NULL,
`email` VARCHAR(45) NOT NULL,
`password` TEXT NOT NULL,
`level` INT NOT NULL DEFAULT 0,
`postCount` INT NOT NULL DEFAULT 0,
PRIMARY KEY (`id`));
CREATE TABLE `tbl_post` (
`id` INT NOT NULL AUTO_INCREMENT,
`username` VARCHAR(45) NOT NULL,
`title` VARCHAR(45) NOT NULL,
`text` TEXT NOT NULL,
`imageFileName` TEXT NOT NULL,
`date` DATETIME NOT NULL,
PRIMARY KEY (`id`));

View File

@ -0,0 +1,35 @@
<?php
return array(
'Main' => '主页',
'About journal' => '关于日报',
'Add post' => '添加动态',
'Login' => '登录',
'Register' => '注册',
'Logout' => '退出',
'All rights reserved.' => '版权所有.',
'New posts' => '新动态',
'Fields with {*} are required.' => '请注意正确填写 {*} 部分',
'Please, fix following errors:' => '请修正下述错误:',
'Please fill out the following form with your login credentials:' => '请正确输入您的注册身份信息',
'Field should not be blank' => '不得输入空格',
'Line is too long' => '字数符号过长',
'Login or password is incorrect' => '登录名或密码错误',
'Username:' => '用户名:',
'Password:' => '密码:',
'Remember me' => '记住我',
'Please fill out the registation form' => '请填写注册信息表格',
'Email address is not correct' => '电子邮件格式错误',
'Confirmation code is not correct' => '验证码错误',
'User {attribute} is already registered in system' => '用户名 {属性} 已被注册',
'Email:' => '电子邮件:',
'Confirmation code:' => '验证码:',
'Image must be jpg, gif or png, and its size should not exceed 8 megabytes' => '图片必须是jpg,gif或png格式且图片大小不得超过8MB',
'Title:' => '标题:',
'Text:' => '文本:',
'Image:' => '图片:',
'Send' => '发送',
'Posted by: ' => '作者: ',
'Published at: ' => '发表于: ',
'Hello China!' => '你好,中国!',
);
?>

View File

@ -0,0 +1,35 @@
<?php
return array(
'Main' => 'Главная',
'About journal' => 'О журнале',
'Add post' => 'Добавить пост',
'Login' => 'Вход',
'Register' => 'Регистрация',
'Logout' => 'Выйти',
'All rights reserved.' => 'Все права сохранены.',
'New posts' => 'Свежие посты',
'Fields with {*} are required.' => 'Поля, отмеченные символом {*} обязательны для заполнения',
'Please, fix following errors:' => 'Пожалуйста, исправьте ошибки:',
'Please fill out the following form with your login credentials:' => 'Пожалуйста, введите логин и пароль для входа в систему',
'Field should not be blank' => 'Поле не должно быть пустым',
'Line is too long' => 'Строка слишком длинная',
'Login or password is incorrect' => 'Логин или пароль введен неверно',
'Username:' => 'Имя пользователя:',
'Password:' => 'Пароль:',
'Remember me' => 'Запомнить меня',
'Please fill out the registation form' => 'Пожалуйста, заполните анкету для регистрации',
'Email address is not correct' => 'Email-адрес введен некорректно',
'Confirmation code is not correct' => 'Код подтверждения введен некорректно',
'User {attribute} is already registered in system' => 'Пользователь {attribute} уже зарегистрирован в системе',
'Email:' => 'Email:',
'Confirmation code:' => 'Код подтверждения:',
'Image must be jpg, gif or png, and its size should not exceed 8 megabytes' => 'Изображение должно быть в формате jpg, gif или png и иметь размер не более 8 мегабайт',
'Title:' => 'Заголовок:',
'Text:' => 'Текст:',
'Image:' => 'Изображение:',
'Send' => 'Отправить',
'Posted by: ' => 'Автор поста: ',
'Published at: ' => 'Опубликовано: ',
'Hello China!' => 'Привет, Китай!',
);
?>

View File

@ -6,6 +6,7 @@ class AddPostForm extends CFormModel
public $title;
public $text;
public $image;
public $date;
/**
@ -16,10 +17,20 @@ class AddPostForm extends CFormModel
public function rules()
{
return array(
array('title, text, image', 'required'),
array('image', 'file', 'types'=>'jpg, gif, png'),
array('title, text, image', 'required', 'message'=>'{attribute} ' . Yii::t('app', 'Field should not be blank')),
array('title', 'length', 'max'=>45, 'tooLong'=>'{attribute} ' . Yii::t('app', 'Line is too long')),
array('image', 'file', 'types'=>'jpg, gif, png', 'maxSize'=>8388608, 'message'=>'{attribute} ' . Yii::t('app', 'Image must be jpg, gif or png, and its size should not exceed 8 megabytes')),
);
}
function attributeLabels(){
return array(
'title' => Yii::t('app', 'Title:'),
'text' => Yii::t('app', 'Text:'),
'image' => Yii::t('app', 'Image:'),
);
}
}

View File

@ -22,7 +22,9 @@ class LoginForm extends CFormModel
{
return array(
// username and password are required
array('username, password', 'required'),
array('username, password', 'required', 'message'=>'{attribute} ' . Yii::t('app', 'Field should not be blank')),
array('username, password', 'length', 'max'=>45, 'tooLong'=>'{attribute} ' . Yii::t('app', 'Line is too long')),
// rememberMe needs to be a boolean
array('rememberMe', 'boolean'),
// password needs to be authenticated
@ -30,15 +32,7 @@ class LoginForm extends CFormModel
);
}
/**
* Declares attribute labels.
*/
public function attributeLabels()
{
return array(
'rememberMe'=>'Remember me next time',
);
}
/**
* Authenticates the password.
@ -50,7 +44,7 @@ class LoginForm extends CFormModel
{
$this->_identity=new UserIdentity($this->username,$this->password);
if(!$this->_identity->authenticate())
$this->addError('password','Incorrect username or password.');
$this->addError('password', Yii::t('app', 'Login or password is incorrect'));
}
}
@ -74,4 +68,12 @@ class LoginForm extends CFormModel
else
return false;
}
function attributeLabels(){
return array(
'username' => Yii::t('app', 'Username:'),
'password' => Yii::t('app', 'Password:'),
'rememberMe' => Yii::t('app', 'Remember me'),
);
}
}

View File

@ -1,45 +0,0 @@
<?php
/**
* LoginForm class.
* LoginForm is the data structure for keeping
* user login form data. It is used by the 'login' action of 'SiteController'.
*/
class RegisterForm extends CFormModel
{
public $username;
public $password;
public $email;
/**
* Declares the validation rules.
* The rules state that username and password are required,
* and password needs to be authenticated.
*/
public function rules()
{
return array(
array('username, password, email', 'required'),
array('email', 'email'),
array('username', 'unique'),
);
}
public function unique($attribute,$params)
{
if(!$this->hasErrors())
{
$count = user::model()->count('username=:username', array('username'=>$this->username));
if ($count != 0)
$this->addError('username','Username already exists');
$count = user::model()->count('email=:email', array('email'=>$this->email));
if ($count != 0)
$this->addError('email','Email already exists');
}
}
}

View File

@ -2,6 +2,9 @@
class User extends CActiveRecord
{
public $verifyCode;
public static function model($className=__CLASS__)
{
return parent::model($className);
@ -15,9 +18,32 @@ class User extends CActiveRecord
public function rules()
{
return array(
array('username, password, email', 'required'),
array('email', 'email'),
array('username, password, email', 'required', 'message'=>'{attribute} ' . Yii::t('app', 'Field should not be blank')),
array('username, password, email', 'length', 'max'=>45, 'tooLong'=>'{attribute} ' . Yii::t('app', 'Line is too long')),
array('email', 'email', 'message'=>Yii::t('app', 'Email address is not correct')),
array('username, email', 'unique'),
array('verifyCode', 'captcha', 'allowEmpty'=>false, 'message'=>Yii::t('app', 'Confirmation code is not correct')),
);
}
public function unique($attribute,$params)
{
if(!$this->hasErrors())
{
$count = user::model()->count($attribute . '=:attribute', array('attribute'=>$this->attributes[$attribute]));
if ($count != 0)
$this->addError($attribute, Yii::t('app', 'User {attribute} is already registered in system'), array('{attribute}' => $this->attributes[$attribute]));
}
}
function attributeLabels(){
return array(
'username' => Yii::t('app', 'Username:'),
'password' => Yii::t('app', 'Password:'),
'email' => Yii::t('app', 'Email:'),
'verifyCode' => Yii::t('app', 'Confirmation code:'),
);
}
}

View File

@ -321,3 +321,343 @@ in C:\Workplace\Apache2.4\htdocs\cj\index.php (13)
2014/11/21 10:49:26 [warning] [application] Failed to set unsafe attribute "image" of "AddPostForm".
in C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php (148)
in C:\Workplace\Apache2.4\htdocs\cj\index.php (13)
2014/11/21 11:35:50 [error] [php] Missing argument 1 for CActiveRecord::getAttribute(), called in C:\Workplace\yii1.1.15\framework\base\CComponent.php on line 111 and defined (C:\Workplace\yii1.1.15\framework\db\ar\CActiveRecord.php:691)
Stack trace:
#0 C:\Workplace\Apache2.4\htdocs\cj\protected\models\User.php(29): User->__get()
#1 C:\Workplace\yii1.1.15\framework\validators\CInlineValidator.php(42): User->unique()
#2 C:\Workplace\yii1.1.15\framework\validators\CValidator.php(213): CInlineValidator->validateAttribute()
#3 C:\Workplace\yii1.1.15\framework\base\CModel.php(159): CInlineValidator->validate()
#4 C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php(94): User->validate()
#5 C:\Workplace\yii1.1.15\framework\web\actions\CInlineAction.php(49): SiteController->actionRegister()
#6 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams()
#7 C:\Workplace\yii1.1.15\framework\web\CController.php(286): SiteController->runAction()
#8 C:\Workplace\yii1.1.15\framework\web\CController.php(265): SiteController->runActionWithFilters()
#9 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): SiteController->run()
#10 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController()
#11 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#12 C:\Workplace\Apache2.4\htdocs\cj\index.php(13): CWebApplication->run()
REQUEST_URI=/cj/index.php?r=site/register
in C:\Workplace\Apache2.4\htdocs\cj\protected\models\User.php (29)
in C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php (94)
in C:\Workplace\Apache2.4\htdocs\cj\index.php (13)
2014/11/21 23:23:28 [error] [exception.CException] exception 'CException' with message 'GD with FreeType or ImageMagick PHP extensions are required.' in C:\Workplace\yii1.1.15\framework\web\widgets\captcha\CCaptcha.php:88
Stack trace:
#0 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(173): CCaptcha->run()
#1 C:\Workplace\Apache2.4\htdocs\cj\protected\views\site\register.php(45): CBaseController->widget('CCaptcha')
#2 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(126): require('C:\\Workplace\\Ap...')
#3 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(95): CBaseController->renderInternal('C:\\Workplace\\Ap...', Array, true)
#4 C:\Workplace\yii1.1.15\framework\web\CController.php(869): CBaseController->renderFile('C:\\Workplace\\Ap...', Array, true)
#5 C:\Workplace\yii1.1.15\framework\web\CController.php(782): CController->renderPartial('register', Array, true)
#6 C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php(106): CController->render('register', Array)
#7 C:\Workplace\yii1.1.15\framework\web\actions\CInlineAction.php(49): SiteController->actionRegister()
#8 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams(Array)
#9 C:\Workplace\yii1.1.15\framework\web\CController.php(286): CController->runAction(Object(CInlineAction))
#10 C:\Workplace\yii1.1.15\framework\web\CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#11 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): CController->run('register')
#12 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController('site/register')
#13 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#14 C:\Workplace\Apache2.4\htdocs\cj\index.php(13): CApplication->run()
#15 {main}
REQUEST_URI=/cj/index.php?r=site/register
HTTP_REFERER=http://localhost/cj/index.php?r=site/login
---
2014/11/21 23:46:07 [warning] [application] Failed to set unsafe attribute "image" of "AddPostForm".
in C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php (134)
in C:\Workplace\Apache2.4\htdocs\cj\index.php (13)
2014/11/21 23:53:18 [warning] [application] Failed to set unsafe attribute "image" of "AddPostForm".
in C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php (134)
in C:\Workplace\Apache2.4\htdocs\cj\index.php (13)
2014/11/22 00:05:41 [warning] [application] Failed to set unsafe attribute "image" of "AddPostForm".
in C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php (134)
in C:\Workplace\Apache2.4\htdocs\cj\index.php (13)
2014/11/22 00:05:48 [warning] [application] Failed to set unsafe attribute "image" of "AddPostForm".
in C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php (134)
in C:\Workplace\Apache2.4\htdocs\cj\index.php (13)
2014/11/22 00:05:48 [error] [system.db.CDbCommand] CDbCommand::execute() failed: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: 'CURRENT_TIMESTAMP' for column 'date' at row 1. The SQL statement executed was: INSERT INTO `tbl_post` (`date`, `username`, `title`, `text`, `imageFileName`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4).
in C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php (160)
in C:\Workplace\Apache2.4\htdocs\cj\index.php (13)
2014/11/22 00:05:48 [error] [exception.CDbException] exception 'CDbException' with message 'CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: 'CURRENT_TIMESTAMP' for column 'date' at row 1. The SQL statement executed was: INSERT INTO `tbl_post` (`date`, `username`, `title`, `text`, `imageFileName`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4)' in C:\Workplace\yii1.1.15\framework\db\CDbCommand.php:358
Stack trace:
#0 C:\Workplace\yii1.1.15\framework\db\ar\CActiveRecord.php(1077): CDbCommand->execute()
#1 C:\Workplace\yii1.1.15\framework\db\ar\CActiveRecord.php(806): CActiveRecord->insert(NULL)
#2 C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php(160): CActiveRecord->save()
#3 C:\Workplace\yii1.1.15\framework\web\actions\CInlineAction.php(49): SiteController->actionAddPost()
#4 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams(Array)
#5 C:\Workplace\yii1.1.15\framework\web\CController.php(286): CController->runAction(Object(CInlineAction))
#6 C:\Workplace\yii1.1.15\framework\web\CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#7 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): CController->run('addPost')
#8 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController('site/addPost')
#9 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#10 C:\Workplace\Apache2.4\htdocs\cj\index.php(13): CApplication->run()
#11 {main}
REQUEST_URI=/cj/index.php?r=site/addPost
HTTP_REFERER=http://localhost/cj/index.php?r=site/addPost
---
2014/11/22 00:09:56 [warning] [application] Failed to set unsafe attribute "image" of "AddPostForm".
in C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php (134)
in C:\Workplace\Apache2.4\htdocs\cj\index.php (13)
2014/11/22 00:09:57 [error] [system.db.CDbCommand] CDbCommand::execute() failed: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: 'CURRENT_TIMESTAMP' for column 'date' at row 1. The SQL statement executed was: INSERT INTO `tbl_post` (`date`, `username`, `title`, `text`, `imageFileName`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4).
in C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php (160)
in C:\Workplace\Apache2.4\htdocs\cj\index.php (13)
2014/11/22 00:09:57 [error] [exception.CDbException] exception 'CDbException' with message 'CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: 'CURRENT_TIMESTAMP' for column 'date' at row 1. The SQL statement executed was: INSERT INTO `tbl_post` (`date`, `username`, `title`, `text`, `imageFileName`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4)' in C:\Workplace\yii1.1.15\framework\db\CDbCommand.php:358
Stack trace:
#0 C:\Workplace\yii1.1.15\framework\db\ar\CActiveRecord.php(1077): CDbCommand->execute()
#1 C:\Workplace\yii1.1.15\framework\db\ar\CActiveRecord.php(806): CActiveRecord->insert(NULL)
#2 C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php(160): CActiveRecord->save()
#3 C:\Workplace\yii1.1.15\framework\web\actions\CInlineAction.php(49): SiteController->actionAddPost()
#4 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams(Array)
#5 C:\Workplace\yii1.1.15\framework\web\CController.php(286): CController->runAction(Object(CInlineAction))
#6 C:\Workplace\yii1.1.15\framework\web\CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#7 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): CController->run('addPost')
#8 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController('site/addPost')
#9 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#10 C:\Workplace\Apache2.4\htdocs\cj\index.php(13): CApplication->run()
#11 {main}
REQUEST_URI=/cj/index.php?r=site/addPost
HTTP_REFERER=http://localhost/cj/index.php?r=site/addPost
---
2014/11/22 00:11:53 [warning] [application] Failed to set unsafe attribute "image" of "AddPostForm".
in C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php (134)
in C:\Workplace\Apache2.4\htdocs\cj\index.php (13)
2014/11/22 00:11:53 [error] [system.db.CDbCommand] CDbCommand::execute() failed: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: 'CURRENT_TIMESTAMP' for column 'date' at row 1. The SQL statement executed was: INSERT INTO `tbl_post` (`date`, `username`, `title`, `text`, `imageFileName`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4).
in C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php (160)
in C:\Workplace\Apache2.4\htdocs\cj\index.php (13)
2014/11/22 00:11:53 [error] [exception.CDbException] exception 'CDbException' with message 'CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: 'CURRENT_TIMESTAMP' for column 'date' at row 1. The SQL statement executed was: INSERT INTO `tbl_post` (`date`, `username`, `title`, `text`, `imageFileName`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4)' in C:\Workplace\yii1.1.15\framework\db\CDbCommand.php:358
Stack trace:
#0 C:\Workplace\yii1.1.15\framework\db\ar\CActiveRecord.php(1077): CDbCommand->execute()
#1 C:\Workplace\yii1.1.15\framework\db\ar\CActiveRecord.php(806): CActiveRecord->insert(NULL)
#2 C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php(160): CActiveRecord->save()
#3 C:\Workplace\yii1.1.15\framework\web\actions\CInlineAction.php(49): SiteController->actionAddPost()
#4 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams(Array)
#5 C:\Workplace\yii1.1.15\framework\web\CController.php(286): CController->runAction(Object(CInlineAction))
#6 C:\Workplace\yii1.1.15\framework\web\CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#7 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): CController->run('addPost')
#8 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController('site/addPost')
#9 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#10 C:\Workplace\Apache2.4\htdocs\cj\index.php(13): CApplication->run()
#11 {main}
REQUEST_URI=/cj/index.php?r=site/addPost
HTTP_REFERER=http://localhost/cj/index.php?r=site/addPost
---
2014/11/22 00:15:31 [warning] [application] Failed to set unsafe attribute "image" of "AddPostForm".
in C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php (134)
in C:\Workplace\Apache2.4\htdocs\cj\index.php (13)
2014/11/22 00:16:01 [warning] [application] Failed to set unsafe attribute "image" of "AddPostForm".
in C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php (134)
in C:\Workplace\Apache2.4\htdocs\cj\index.php (13)
2014/11/22 00:18:12 [warning] [application] Failed to set unsafe attribute "image" of "AddPostForm".
in C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php (134)
in C:\Workplace\Apache2.4\htdocs\cj\index.php (13)
2014/11/22 02:45:13 [error] [php] Missing argument 2 for YiiBase::t(), called in C:\Workplace\Apache2.4\htdocs\cj\protected\views\site\login.php on line 26 and defined (C:\Workplace\yii1.1.15\framework\YiiBase.php:577)
Stack trace:
#0 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(95): SiteController->renderInternal()
#1 C:\Workplace\yii1.1.15\framework\web\CController.php(869): SiteController->renderFile()
#2 C:\Workplace\yii1.1.15\framework\web\CController.php(782): SiteController->renderPartial()
#3 C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php(84): SiteController->render()
#4 C:\Workplace\yii1.1.15\framework\web\actions\CInlineAction.php(49): SiteController->actionLogin()
#5 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams()
#6 C:\Workplace\yii1.1.15\framework\web\CController.php(286): SiteController->runAction()
#7 C:\Workplace\yii1.1.15\framework\web\CController.php(265): SiteController->runActionWithFilters()
#8 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): SiteController->run()
#9 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController()
#10 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#11 C:\Workplace\Apache2.4\htdocs\cj\index.php(19): CWebApplication->run()
REQUEST_URI=/cj/index.php?r=site/login
2014/11/22 02:58:17 [error] [exception.CException] exception 'CException' with message 'Alias "components.LangBox" is invalid. Make sure it points to an existing directory or file.' in C:\Workplace\yii1.1.15\framework\YiiBase.php:347
Stack trace:
#0 C:\Workplace\yii1.1.15\framework\web\CWidgetFactory.php(146): YiiBase::import('components.Lang...', true)
#1 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(146): CWidgetFactory->createWidget(Object(SiteController), 'components.Lang...', Array)
#2 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(189): CBaseController->createWidget('components.Lang...', Array)
#3 C:\Workplace\Apache2.4\htdocs\cj\protected\views\layouts\main.php(30): CBaseController->beginWidget('components.Lang...')
#4 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(126): require('C:\\Workplace\\Ap...')
#5 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(95): CBaseController->renderInternal('C:\\Workplace\\Ap...', Array, true)
#6 C:\Workplace\yii1.1.15\framework\web\widgets\CContentDecorator.php(76): CBaseController->renderFile('C:\\Workplace\\Ap...', Array, true)
#7 C:\Workplace\yii1.1.15\framework\web\widgets\CContentDecorator.php(54): CContentDecorator->decorate('<div id="conten...')
#8 C:\Workplace\yii1.1.15\framework\web\widgets\COutputProcessor.php(44): CContentDecorator->processOutput('<div id="conten...')
#9 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(206): COutputProcessor->run()
#10 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(300): CBaseController->endWidget('CContentDecorat...')
#11 C:\Workplace\Apache2.4\htdocs\cj\protected\views\layouts\column1.php(6): CBaseController->endContent()
#12 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(126): require('C:\\Workplace\\Ap...')
#13 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(95): CBaseController->renderInternal('C:\\Workplace\\Ap...', Array, true)
#14 C:\Workplace\yii1.1.15\framework\web\CController.php(784): CBaseController->renderFile('C:\\Workplace\\Ap...', Array, true)
#15 C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php(43): CController->render('index', Array)
#16 C:\Workplace\yii1.1.15\framework\web\actions\CInlineAction.php(49): SiteController->actionIndex()
#17 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams(Array)
#18 C:\Workplace\yii1.1.15\framework\web\CController.php(286): CController->runAction(Object(CInlineAction))
#19 C:\Workplace\yii1.1.15\framework\web\CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#20 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): CController->run('index')
#21 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController('site/index')
#22 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#23 C:\Workplace\Apache2.4\htdocs\cj\index.php(19): CApplication->run()
#24 {main}
REQUEST_URI=/cj/index.php?r=site/index
HTTP_REFERER=http://localhost/cj/index.php?r=site/index
---
2014/11/22 02:58:30 [error] [exception.CException] exception 'CException' with message 'LangBox cannot find the view "langBox".' in C:\Workplace\yii1.1.15\framework\web\widgets\CWidget.php:246
Stack trace:
#0 C:\Workplace\Apache2.4\htdocs\cj\protected\components\LangBox.php(7): CWidget->render('langBox', Array)
#1 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(206): LangBox->run()
#2 C:\Workplace\Apache2.4\htdocs\cj\protected\views\layouts\main.php(31): CBaseController->endWidget()
#3 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(126): require('C:\\Workplace\\Ap...')
#4 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(95): CBaseController->renderInternal('C:\\Workplace\\Ap...', Array, true)
#5 C:\Workplace\yii1.1.15\framework\web\widgets\CContentDecorator.php(76): CBaseController->renderFile('C:\\Workplace\\Ap...', Array, true)
#6 C:\Workplace\yii1.1.15\framework\web\widgets\CContentDecorator.php(54): CContentDecorator->decorate('<div id="conten...')
#7 C:\Workplace\yii1.1.15\framework\web\widgets\COutputProcessor.php(44): CContentDecorator->processOutput('<div id="conten...')
#8 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(206): COutputProcessor->run()
#9 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(300): CBaseController->endWidget('CContentDecorat...')
#10 C:\Workplace\Apache2.4\htdocs\cj\protected\views\layouts\column1.php(6): CBaseController->endContent()
#11 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(126): require('C:\\Workplace\\Ap...')
#12 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(95): CBaseController->renderInternal('C:\\Workplace\\Ap...', Array, true)
#13 C:\Workplace\yii1.1.15\framework\web\CController.php(784): CBaseController->renderFile('C:\\Workplace\\Ap...', Array, true)
#14 C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php(43): CController->render('index', Array)
#15 C:\Workplace\yii1.1.15\framework\web\actions\CInlineAction.php(49): SiteController->actionIndex()
#16 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams(Array)
#17 C:\Workplace\yii1.1.15\framework\web\CController.php(286): CController->runAction(Object(CInlineAction))
#18 C:\Workplace\yii1.1.15\framework\web\CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#19 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): CController->run('index')
#20 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController('site/index')
#21 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#22 C:\Workplace\Apache2.4\htdocs\cj\index.php(19): CApplication->run()
#23 {main}
REQUEST_URI=/cj/index.php?r=site/index
---
2014/11/22 02:58:52 [error] [exception.CException] exception 'CException' with message 'LangBox cannot find the view "views.langBox".' in C:\Workplace\yii1.1.15\framework\web\widgets\CWidget.php:246
Stack trace:
#0 C:\Workplace\Apache2.4\htdocs\cj\protected\components\LangBox.php(7): CWidget->render('views.langBox', Array)
#1 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(206): LangBox->run()
#2 C:\Workplace\Apache2.4\htdocs\cj\protected\views\layouts\main.php(31): CBaseController->endWidget()
#3 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(126): require('C:\\Workplace\\Ap...')
#4 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(95): CBaseController->renderInternal('C:\\Workplace\\Ap...', Array, true)
#5 C:\Workplace\yii1.1.15\framework\web\widgets\CContentDecorator.php(76): CBaseController->renderFile('C:\\Workplace\\Ap...', Array, true)
#6 C:\Workplace\yii1.1.15\framework\web\widgets\CContentDecorator.php(54): CContentDecorator->decorate('<div id="conten...')
#7 C:\Workplace\yii1.1.15\framework\web\widgets\COutputProcessor.php(44): CContentDecorator->processOutput('<div id="conten...')
#8 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(206): COutputProcessor->run()
#9 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(300): CBaseController->endWidget('CContentDecorat...')
#10 C:\Workplace\Apache2.4\htdocs\cj\protected\views\layouts\column1.php(6): CBaseController->endContent()
#11 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(126): require('C:\\Workplace\\Ap...')
#12 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(95): CBaseController->renderInternal('C:\\Workplace\\Ap...', Array, true)
#13 C:\Workplace\yii1.1.15\framework\web\CController.php(784): CBaseController->renderFile('C:\\Workplace\\Ap...', Array, true)
#14 C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php(43): CController->render('index', Array)
#15 C:\Workplace\yii1.1.15\framework\web\actions\CInlineAction.php(49): SiteController->actionIndex()
#16 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams(Array)
#17 C:\Workplace\yii1.1.15\framework\web\CController.php(286): CController->runAction(Object(CInlineAction))
#18 C:\Workplace\yii1.1.15\framework\web\CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#19 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): CController->run('index')
#20 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController('site/index')
#21 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#22 C:\Workplace\Apache2.4\htdocs\cj\index.php(19): CApplication->run()
#23 {main}
REQUEST_URI=/cj/index.php?r=site/index
---
2014/11/22 03:00:26 [error] [exception.CException] exception 'CException' with message 'LangBox cannot find the view "views.site.langBox".' in C:\Workplace\yii1.1.15\framework\web\widgets\CWidget.php:246
Stack trace:
#0 C:\Workplace\Apache2.4\htdocs\cj\protected\components\LangBox.php(7): CWidget->render('views.site.lang...', Array)
#1 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(206): LangBox->run()
#2 C:\Workplace\Apache2.4\htdocs\cj\protected\views\layouts\main.php(31): CBaseController->endWidget()
#3 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(126): require('C:\\Workplace\\Ap...')
#4 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(95): CBaseController->renderInternal('C:\\Workplace\\Ap...', Array, true)
#5 C:\Workplace\yii1.1.15\framework\web\widgets\CContentDecorator.php(76): CBaseController->renderFile('C:\\Workplace\\Ap...', Array, true)
#6 C:\Workplace\yii1.1.15\framework\web\widgets\CContentDecorator.php(54): CContentDecorator->decorate('<div id="conten...')
#7 C:\Workplace\yii1.1.15\framework\web\widgets\COutputProcessor.php(44): CContentDecorator->processOutput('<div id="conten...')
#8 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(206): COutputProcessor->run()
#9 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(300): CBaseController->endWidget('CContentDecorat...')
#10 C:\Workplace\Apache2.4\htdocs\cj\protected\views\layouts\column1.php(6): CBaseController->endContent()
#11 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(126): require('C:\\Workplace\\Ap...')
#12 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(95): CBaseController->renderInternal('C:\\Workplace\\Ap...', Array, true)
#13 C:\Workplace\yii1.1.15\framework\web\CController.php(784): CBaseController->renderFile('C:\\Workplace\\Ap...', Array, true)
#14 C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php(43): CController->render('index', Array)
#15 C:\Workplace\yii1.1.15\framework\web\actions\CInlineAction.php(49): SiteController->actionIndex()
#16 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams(Array)
#17 C:\Workplace\yii1.1.15\framework\web\CController.php(286): CController->runAction(Object(CInlineAction))
#18 C:\Workplace\yii1.1.15\framework\web\CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#19 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): CController->run('index')
#20 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController('site/index')
#21 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#22 C:\Workplace\Apache2.4\htdocs\cj\index.php(19): CApplication->run()
#23 {main}
REQUEST_URI=/cj/index.php?r=site/index
---
2014/11/22 03:00:33 [error] [exception.CException] exception 'CException' with message 'LangBox cannot find the view "langBox".' in C:\Workplace\yii1.1.15\framework\web\widgets\CWidget.php:246
Stack trace:
#0 C:\Workplace\Apache2.4\htdocs\cj\protected\components\LangBox.php(7): CWidget->render('langBox', Array)
#1 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(206): LangBox->run()
#2 C:\Workplace\Apache2.4\htdocs\cj\protected\views\layouts\main.php(31): CBaseController->endWidget()
#3 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(126): require('C:\\Workplace\\Ap...')
#4 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(95): CBaseController->renderInternal('C:\\Workplace\\Ap...', Array, true)
#5 C:\Workplace\yii1.1.15\framework\web\widgets\CContentDecorator.php(76): CBaseController->renderFile('C:\\Workplace\\Ap...', Array, true)
#6 C:\Workplace\yii1.1.15\framework\web\widgets\CContentDecorator.php(54): CContentDecorator->decorate('<div id="conten...')
#7 C:\Workplace\yii1.1.15\framework\web\widgets\COutputProcessor.php(44): CContentDecorator->processOutput('<div id="conten...')
#8 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(206): COutputProcessor->run()
#9 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(300): CBaseController->endWidget('CContentDecorat...')
#10 C:\Workplace\Apache2.4\htdocs\cj\protected\views\layouts\column1.php(6): CBaseController->endContent()
#11 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(126): require('C:\\Workplace\\Ap...')
#12 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(95): CBaseController->renderInternal('C:\\Workplace\\Ap...', Array, true)
#13 C:\Workplace\yii1.1.15\framework\web\CController.php(784): CBaseController->renderFile('C:\\Workplace\\Ap...', Array, true)
#14 C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php(43): CController->render('index', Array)
#15 C:\Workplace\yii1.1.15\framework\web\actions\CInlineAction.php(49): SiteController->actionIndex()
#16 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams(Array)
#17 C:\Workplace\yii1.1.15\framework\web\CController.php(286): CController->runAction(Object(CInlineAction))
#18 C:\Workplace\yii1.1.15\framework\web\CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#19 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): CController->run('index')
#20 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController('site/index')
#21 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#22 C:\Workplace\Apache2.4\htdocs\cj\index.php(19): CApplication->run()
#23 {main}
REQUEST_URI=/cj/index.php?r=site/index
---
2014/11/22 03:01:14 [error] [exception.CException] exception 'CException' with message 'LangBox cannot find the view "langBox".' in C:\Workplace\yii1.1.15\framework\web\widgets\CWidget.php:246
Stack trace:
#0 C:\Workplace\Apache2.4\htdocs\cj\protected\components\LangBox.php(7): CWidget->render('langBox', Array)
#1 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(206): LangBox->run()
#2 C:\Workplace\Apache2.4\htdocs\cj\protected\views\layouts\main.php(31): CBaseController->endWidget()
#3 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(126): require('C:\\Workplace\\Ap...')
#4 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(95): CBaseController->renderInternal('C:\\Workplace\\Ap...', Array, true)
#5 C:\Workplace\yii1.1.15\framework\web\widgets\CContentDecorator.php(76): CBaseController->renderFile('C:\\Workplace\\Ap...', Array, true)
#6 C:\Workplace\yii1.1.15\framework\web\widgets\CContentDecorator.php(54): CContentDecorator->decorate('<div id="conten...')
#7 C:\Workplace\yii1.1.15\framework\web\widgets\COutputProcessor.php(44): CContentDecorator->processOutput('<div id="conten...')
#8 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(206): COutputProcessor->run()
#9 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(300): CBaseController->endWidget('CContentDecorat...')
#10 C:\Workplace\Apache2.4\htdocs\cj\protected\views\layouts\column1.php(6): CBaseController->endContent()
#11 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(126): require('C:\\Workplace\\Ap...')
#12 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(95): CBaseController->renderInternal('C:\\Workplace\\Ap...', Array, true)
#13 C:\Workplace\yii1.1.15\framework\web\CController.php(784): CBaseController->renderFile('C:\\Workplace\\Ap...', Array, true)
#14 C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php(43): CController->render('index', Array)
#15 C:\Workplace\yii1.1.15\framework\web\actions\CInlineAction.php(49): SiteController->actionIndex()
#16 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams(Array)
#17 C:\Workplace\yii1.1.15\framework\web\CController.php(286): CController->runAction(Object(CInlineAction))
#18 C:\Workplace\yii1.1.15\framework\web\CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#19 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): CController->run('index')
#20 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController('site/index')
#21 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#22 C:\Workplace\Apache2.4\htdocs\cj\index.php(19): CApplication->run()
#23 {main}
REQUEST_URI=/cj/index.php?r=site/index
HTTP_REFERER=http://localhost/cj/index.php?r=site/page&view=about
---
2014/11/22 03:11:38 [error] [php] Indirect modification of overloaded element of CCookieCollection has no effect (C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php:33)
Stack trace:
#0 C:\Workplace\yii1.1.15\framework\web\CController.php(286): SiteController->runAction()
#1 C:\Workplace\yii1.1.15\framework\web\CController.php(265): SiteController->runActionWithFilters()
#2 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): SiteController->run()
#3 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController()
#4 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#5 C:\Workplace\Apache2.4\htdocs\cj\index.php(19): CWebApplication->run()
REQUEST_URI=/cj/index.php?r=site/index
2014/11/22 03:11:48 [error] [php] Undefined variable: lang (C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php:34)
Stack trace:
#0 C:\Workplace\yii1.1.15\framework\web\CController.php(286): SiteController->runAction()
#1 C:\Workplace\yii1.1.15\framework\web\CController.php(265): SiteController->runActionWithFilters()
#2 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): SiteController->run()
#3 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController()
#4 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#5 C:\Workplace\Apache2.4\htdocs\cj\index.php(19): CWebApplication->run()
REQUEST_URI=/cj/index.php?r=site/index
2014/11/22 03:11:51 [error] [php] Undefined variable: lang (C:\Workplace\Apache2.4\htdocs\cj\protected\controllers\SiteController.php:34)
Stack trace:
#0 C:\Workplace\yii1.1.15\framework\web\CController.php(286): SiteController->runAction()
#1 C:\Workplace\yii1.1.15\framework\web\CController.php(265): SiteController->runActionWithFilters()
#2 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): SiteController->run()
#3 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController()
#4 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#5 C:\Workplace\Apache2.4\htdocs\cj\index.php(19): CWebApplication->run()
REQUEST_URI=/cj/index.php?r=site/index

View File

@ -23,23 +23,31 @@
<div class="container" id="page">
<div id="header">
<div id="logo"><?php echo CHtml::encode(Yii::app()->name); ?></div>
<div id="logo"><?php echo CHtml::encode(Yii::t('app', Yii::app()->name)); ?></div>
</div><!-- header -->
<div id="language">
<?php $this->beginWidget('LangBox'); ?>
<?php $this->endWidget(); ?>
</div>
<div id="mainmenu">
<?php $this->widget('zii.widgets.CMenu',array(
'items'=>array(
array('label'=>'Home', 'url'=>array('/site/index')),
array('label'=>'About', 'url'=>array('/site/page', 'view'=>'about')),
array('label'=>'AddPost', 'url'=>array('/site/addPost'), 'visible'=>!Yii::app()->user->isGuest),
array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)
array('label'=>Yii::t('app', 'Main'), 'url'=>array('/site/index')),
array('label'=>Yii::t('app', 'About journal'), 'url'=>array('/site/page', 'view'=>'about')),
array('label'=>Yii::t('app', 'Add post'), 'url'=>array('/site/addPost'), 'visible'=>!Yii::app()->user->isGuest),
array('label'=>Yii::t('app', 'Login'), 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
array('label'=>Yii::t('app', 'Register'), 'url'=>array('/site/register'), 'visible'=>Yii::app()->user->isGuest),
array('label'=>Yii::t('app', 'Logout') . ' ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)
),
)); ?>
</div><!-- mainmenu -->
<?php if(isset($this->breadcrumbs)):?>
<?php $this->widget('zii.widgets.CBreadcrumbs', array(
'links'=>$this->breadcrumbs,
'homeLink' => CHtml::link(Yii::t('app', 'Main'), Yii::app()->homeUrl),
)); ?><!-- breadcrumbs -->
<?php endif?>
@ -48,8 +56,8 @@
<div class="clear"></div>
<div id="footer">
Copyright &copy; <?php echo date('Y'); ?> by My Company.<br/>
All Rights Reserved.<br/>
Copyright &copy; <?php echo date('Y'); ?><br/>
<?=Yii::t('app', 'All rights reserved.')?><br/>
<?php echo Yii::powered(); ?>
</div><!-- footer -->

View File

@ -1,13 +1,13 @@
<?php
/* @var $this SiteController */
$this->pageTitle=Yii::app()->name;
$this->pageTitle=Yii::t('app', Yii::app()->name);
?>
<hr>
<p><?php echo $data->title; ?></p>
<p><?php echo $data->username; ?></p>
<h1><?php echo $data->title; ?></h1>
<p><?php echo $data->text; ?></p>
<img src="<?php echo $data->imageFileName; ?>">
<img src="<?php echo $data->imageFileName; ?>" style="max-width:600px"><BR>
<i><?=Yii::t('app', 'Posted by: ')?><b><?php echo $data->username; ?></b></i><BR>
<i><?=Yii::t('app', 'Published at: ')?><b><?php echo $data->date; ?></b></i><BR>

View File

@ -2,6 +2,8 @@
/* @var $this AddPostFormController */
/* @var $model AddPostForm */
/* @var $form CActiveForm */
$this->pageTitle=Yii::t('app', Yii::app()->name) . ' - ' . Yii::t('app', 'Add post');
?>
<div class="form">
@ -16,9 +18,9 @@
'htmlOptions' => array('enctype' => 'multipart/form-data'),
)); ?>
<p class="note">Fields with <span class="required">*</span> are required.</p>
<p class="note"><?=Yii::t('app', 'Fields with {*} are required.', array('{*}'=>'<span class="required">*</span>'))?></p>
<?php echo $form->errorSummary($model); ?>
<?php echo $form->errorSummary($model, Yii::t('app', 'Please, fix following errors:')); ?>
<div class="row">
<?php echo $form->labelEx($model,'title'); ?>
@ -39,7 +41,7 @@
</div>
<div class="row buttons">
<?php echo CHtml::submitButton('Submit'); ?>
<?php echo CHtml::submitButton(Yii::t('app', 'Send')); ?>
</div>
<?php $this->endWidget(); ?>

View File

@ -1,10 +1,10 @@
<?php
/* @var $this SiteController */
$this->pageTitle=Yii::app()->name;
$this->pageTitle=Yii::t('app', Yii::app()->name);
?>
<h1>Welcome to <i><?php echo CHtml::encode(Yii::app()->name); ?></i></h1>
<h1><?=Yii::t('app', 'New posts')?></h1>
<?php $this->widget('zii.widgets.CListView', array(

View File

@ -0,0 +1,7 @@
<?php echo CHtml::form(); ?>
<div id="langdrop">
<?php echo CHtml::dropDownList('lang', $currentLang, array(
'en' => 'English', 'ru' => 'Русский', 'cn' => '中文'), array('submit' => array('site/index'))); ?>
</div>
<?php echo CHtml::endForm(); ?>

View File

@ -3,15 +3,13 @@
/* @var $model LoginForm */
/* @var $form CActiveForm */
$this->pageTitle=Yii::app()->name . ' - Login';
$this->breadcrumbs=array(
'Login',
);
$this->pageTitle=Yii::t('app', Yii::app()->name) . ' - ' . Yii::t('app', 'Login');
?>
<h1>Login</h1>
<h1><?=Yii::t('app', 'Login')?></h1>
<p>Please fill out the following form with your login credentials:</p>
<p><?=Yii::t('app', 'Please fill out the following form with your login credentials:')?></p>
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
@ -22,7 +20,10 @@ $this->breadcrumbs=array(
),
)); ?>
<p class="note">Fields with <span class="required">*</span> are required.</p>
<p class="note"><?=Yii::t('app', 'Fields with {*} are required.', array('{*}'=>'<span class="required">*</span>'))?></p>
<?php echo $form->errorSummary($model, Yii::t('app', 'Please, fix following errors:')); ?>
<div class="row">
<?php echo $form->labelEx($model,'username'); ?>
@ -43,10 +44,10 @@ $this->breadcrumbs=array(
</div>
<div class="row buttons">
<?php echo CHtml::submitButton('Login'); ?>
<?php echo CHtml::submitButton(Yii::t('app', 'Login')); ?>
</div>
<?php $this->endWidget(); ?>
<?php echo CHtml::link('Register',array('site/register')); ?>
<BR>
<?php echo CHtml::link(Yii::t('app', 'Register'), array('site/register')); ?>
</div><!-- form -->

View File

@ -1,12 +1,9 @@
<?php
/* @var $this SiteController */
$this->pageTitle=Yii::app()->name . ' - About';
$this->breadcrumbs=array(
'About',
);
?>
<h1>About</h1>
$this->pageTitle=Yii::app()->name . ' - About journal';
<p>This is a "static" page. You may change the content of this page
by updating the file <code><?php echo __FILE__; ?></code>.</p>
?>
<h1>About journal</h1>
<p>This journal is devoted to China and Chinese language</p>

View File

@ -0,0 +1,9 @@
<?php
/* @var $this SiteController */
$this->pageTitle=Yii::app()->name . ' - 关于日报';
?>
<h1>关于日报</h1>
<p>本日报适用于学习中国文化及中文学习者.</p>

View File

@ -0,0 +1,9 @@
<?php
/* @var $this SiteController */
$this->pageTitle=Yii::app()->name . ' - О журнале';
?>
<h1>О журнале</h1>
<p>Это журнал, посвященный Китаю и изучению Китайского языка.</p>

View File

@ -2,6 +2,8 @@
/* @var $this RegisterFormController */
/* @var $model RegisterForm */
/* @var $form CActiveForm */
$this->pageTitle=Yii::t('app', Yii::app()->name) . ' - ' . Yii::t('app', 'Register');
?>
<div class="form">
@ -14,10 +16,13 @@
// you need to use the performAjaxValidation()-method described there.
'enableAjaxValidation'=>false,
)); ?>
<h1><?=Yii::t('app', 'Register')?></h1>
<p class="note">Fields with <span class="required">*</span> are required.</p>
<p><?=Yii::t('app', 'Please fill out the registation form')?></p>
<?php echo $form->errorSummary($model); ?>
<p class="note"><?=Yii::t('app', 'Fields with {*} are required.', array('{*}'=>'<span class="required">*</span>'))?></p>
<?php echo $form->errorSummary($model, Yii::t('app', 'Please, fix following errors:')); ?>
<div class="row">
<?php echo $form->labelEx($model,'username'); ?>
@ -37,9 +42,14 @@
<?php echo $form->error($model,'email'); ?>
</div>
<div class="row">
<?php echo CHtml::activeLabelEx($model, 'verifyCode'); ?>
<?php $this->widget('CCaptcha'); ?><BR>
<?php echo CHtml::activeTextField($model, 'verifyCode'); ?>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton('Submit'); ?>
<?php echo CHtml::submitButton(Yii::t('app', 'Register')); ?>
</div>
<?php $this->endWidget(); ?>