Admin panel update

This commit is contained in:
Vladislav Khorev 2015-07-08 00:09:07 +00:00
parent c0c8ba61c6
commit 862c7e57b7
27 changed files with 542 additions and 99 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 325 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

View File

@ -2,10 +2,6 @@
<project-private xmlns="http://www.netbeans.org/ns/project-private/1"> <project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2"> <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group> <group/>
<file>file:/C:/Workplace/Apache2.4/htdocs/bashgid/protected/controllers/ArticleController.php</file>
<file>file:/C:/Workplace/Apache2.4/htdocs/bashgid/protected/models/Translation.php</file>
<file>file:/C:/Workplace/Apache2.4/htdocs/bashgid/protected/controllers/TranslationController.php</file>
</group>
</open-files> </open-files>
</project-private> </project-private>

View File

@ -1,88 +1,93 @@
<?php <?php
class SiteController extends Controller class SiteController extends Controller {
{
/**
* Declares class-based actions.
*/
public function actions()
{
return array(
// captcha action renders the CAPTCHA image displayed on the contact page
'captcha'=>array(
'class'=>'CCaptchaAction',
'backColor'=>0xFFFFFF,
),
// page action renders "static" pages stored under 'protected/views/site/pages'
// They can be accessed via: index.php?r=site/page&view=FileName
'page'=>array(
'class'=>'CViewAction',
),
);
}
/** /**
* This is the default 'index' action that is invoked * Declares class-based actions.
* when an action is not explicitly requested by users. */
*/ public function actions()
public function actionIndex()
{
// renders the view file 'protected/views/site/index.php'
// using the default layout 'protected/views/layouts/main.php'
$this->render('index');
}
/**
* This is the action to handle external exceptions.
*/
public function actionError()
{
if($error=Yii::app()->errorHandler->error)
{
if(Yii::app()->request->isAjaxRequest)
echo $error['message'];
else
$this->render('error', $error);
}
}
/**
* Displays the contact page
*/
public function actionContact()
{
$this->render('contact',array('model'=>$model));
}
/**
* Displays the login page
*/
public function actionLogin()
{
$model=new LoginForm;
// if it is ajax validation request
if(isset($_POST['ajax']) && $_POST['ajax']==='login-form')
{
echo CActiveForm::validate($model);
Yii::app()->end();
}
// collect user input data
if(isset($_POST['LoginForm']))
{
$model->attributes=$_POST['LoginForm'];
// validate user input and redirect to the previous page if valid
if($model->validate() && $model->login())
$this->redirect(Yii::app()->user->returnUrl);
}
// display the login form
$this->render('login',array('model'=>$model));
}
public function actionRegister()
{ {
return array(
// captcha action renders the CAPTCHA image displayed on the contact page
'captcha' => array(
'class' => 'CCaptchaAction',
'backColor' => 0xFFFFFF,
),
// page action renders "static" pages stored under 'protected/views/site/pages'
// They can be accessed via: index.php?r=site/page&view=FileName
'page' => array(
'class' => 'CViewAction',
),
);
}
/**
* This is the default 'index' action that is invoked
* when an action is not explicitly requested by users.
*/
public function actionIndex()
{
// renders the view file 'protected/views/site/index.php'
// using the default layout 'protected/views/layouts/main.php'
$this->render('index');
}
/**
* This is the action to handle external exceptions.
*/
public function actionError()
{
if ($error = Yii::app()->errorHandler->error)
{
if (Yii::app()->request->isAjaxRequest)
echo $error['message'];
else
$this->render('error', $error);
}
}
/**
* Displays the contact page
*/
public function actionContact()
{
$this->render('contact');
}
/**
* Displays the login page
*/
public function actionLogin()
{
$model = new LoginForm;
// if it is ajax validation request
if (isset($_POST['ajax']) && $_POST['ajax'] === 'login-form')
{
echo CActiveForm::validate($model);
Yii::app()->end();
}
// collect user input data
if (isset($_POST['LoginForm']))
{
$model->attributes = $_POST['LoginForm'];
// validate user input and redirect to the previous page if valid
if ($model->validate() && $model->login())
$this->redirect(Yii::app()->user->returnUrl);
}
// display the login form
$this->render('login', array('model' => $model));
$this->render('index');
}
public function actionRegister()
{
/*
$model = new User('register'); $model = new User('register');
if (isset($_POST['User'])) if (isset($_POST['User']))
@ -110,18 +115,134 @@ class SiteController extends Controller
} }
} }
$this->render('register', array('model' => $model)); $this->render('register', array('model' => $model));
*/
$this->render('index');
} }
/** /**
* Logs out the current user and redirect to homepage. * Logs out the current user and redirect to homepage.
*/ */
public function actionLogout() public function actionLogout()
{ {
Yii::app()->user->logout(); Yii::app()->user->logout();
$this->redirect(Yii::app()->homeUrl); $this->redirect(Yii::app()->homeUrl);
} }
private function better_crypt($input)
public function actionAddPhotosToArticle()
{
$model = new AddPhotosToArticleForm;
if (isset($_POST['AddPhotosToArticleForm']))
{
$model->attributes = $_POST['AddPhotosToArticleForm'];
$urlList = explode(PHP_EOL, $model->photoUrlText);
$article = Article::model()->find('name=:name', array(':name' => $model->articleName));
if ($article)
{
if (!Album::model()->find('name=:name', array(':name' => $model->articleName)))
{
$album = new Album();
$album->name = $model->articleName;
$album->title = $article->title;
$album->description = "";
$album->save();
}
if (!AlbumArticleRelation::model()->find('albumName=:name AND articleName=:name', array(':name' => $model->articleName)))
{
$albumArticleRelation = new AlbumArticleRelation();
$albumArticleRelation->albumName = $model->articleName;
$albumArticleRelation->articleName = $model->articleName;
$albumArticleRelation->save();
}
foreach ($urlList as $row)
{
$row = trim($row);
if ($row !== '')
{
//$localFileName = 'C:/Workplace/Apache2.4/htdocs/bashgid/bashgid_images/' . base64_encode($row) . '.jpg';
$localFileName = '/home/hallyu-http/bashgid.hallyu.ru/http/bashgid_images/' . base64_encode($row) . '.jpg';
copy($row, $localFileName);
$photo = Photo::model()->find('imageUrl=:imageUrl', array(':imageUrl' => $row));
if ($photo)
{
$photo->delete();
}
$photo = new Photo();
$photo->title = $article->title;
$photo->imageUrl = $row;
$photo->imageHash = md5_file($localFileName);
$photo->description = "";
$photo->save();
$photoAlbumRelation = new PhotoAlbumRelation();
$photoAlbumRelation->imageUrl = $row;
$photoAlbumRelation->name = $model->articleName;
$photoAlbumRelation->save();
}
}
}
$this->render('photosAdded', array('urlList' => $urlList));
return;
}
$this->render('addPhotosToArticle', array('model' => $model));
}
public function actionRecalcImageHash()
{
$photoArr = Photo::model()->findAll();
foreach($photoArr as $photo)
{
//$localFileName = 'C:/Workplace/Apache2.4/htdocs/bashgid/bashgid_images/' . base64_encode($photo->imageUrl) . '.jpg';
$localFileName = '/home/hallyu-http/bashgid.hallyu.ru/http/bashgid_images/' . base64_encode($photo->imageUrl) . '.jpg';
$imageHash = md5_file($localFileName);
$photo->imageHash = $imageHash;
$photo->save();
}
$this->redirect(Yii::app()->homeUrl);
}
private function better_crypt($input)
{ {
$salt = ""; $salt = "";
$salt_chars = array_merge(range('A', 'Z'), range('a', 'z'), range(0, 9)); $salt_chars = array_merge(range('A', 'Z'), range('a', 'z'), range(0, 9));
@ -131,4 +252,5 @@ class SiteController extends Controller
} }
return crypt($input, '$2y$10$' . $salt); return crypt($input, '$2y$10$' . $salt);
} }
} }

View File

@ -0,0 +1,37 @@
<?php
/**
* LoginForm class.
* LoginForm is the data structure for keeping
* user login form data. It is used by the 'login' action of 'SiteController'.
*/
class AddPhotosToArticleForm extends CFormModel {
public $articleName;
public $photoUrlText;
/**
* Declares the validation rules.
* The rules state that username and password are required,
* and password needs to be authenticated.
*/
public function rules()
{
return array(
// username and password are required
array('articleName, photoUrlText', 'required'),
);
}
/**
* Declares attribute labels.
*/
public function attributeLabels()
{
return array(
'articleName' => 'Article Name',
'photoUrlText' => 'Photo Url Text',
);
}
}

View File

@ -701,3 +701,215 @@ Stack trace:
REQUEST_URI=/bashgid/index.php?r=article/editMax&n=mc_article_0 REQUEST_URI=/bashgid/index.php?r=article/editMax&n=mc_article_0
HTTP_REFERER=http://localhost/bashgid/index.php?r=journal/editArticlesMax HTTP_REFERER=http://localhost/bashgid/index.php?r=journal/editArticlesMax
--- ---
2015/07/07 19:38:40 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'Unable to resolve the request "index/addPhotosToArticle".' in C:\Workplace\yii1.1.15\framework\web\CWebApplication.php:286
Stack trace:
#0 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController('index/addPhotos...')
#1 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#2 C:\Workplace\Apache2.4\htdocs\bashgid\index.php(21): CApplication->run()
#3 {main}
REQUEST_URI=/bashgid/index.php?r=index/addPhotosToArticle
HTTP_REFERER=http://localhost/bashgid/index.php
---
2015/07/07 19:39:00 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'Unable to resolve the request "index/addPhotosToArticle".' in C:\Workplace\yii1.1.15\framework\web\CWebApplication.php:286
Stack trace:
#0 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController('index/addPhotos...')
#1 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#2 C:\Workplace\Apache2.4\htdocs\bashgid\index.php(21): CApplication->run()
#3 {main}
REQUEST_URI=/bashgid/index.php?r=index/addPhotosToArticle
---
2015/07/07 19:39:03 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'Unable to resolve the request "index/addPhotosToArticle".' in C:\Workplace\yii1.1.15\framework\web\CWebApplication.php:286
Stack trace:
#0 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController('index/addPhotos...')
#1 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#2 C:\Workplace\Apache2.4\htdocs\bashgid\index.php(21): CApplication->run()
#3 {main}
REQUEST_URI=/bashgid/index.php?r=index/addPhotosToArticle
---
2015/07/07 19:39:19 [error] [exception.CException] exception 'CException' with message 'Property "Article.hidden" is not defined.' in C:\Workplace\yii1.1.15\framework\base\CComponent.php:130
Stack trace:
#0 C:\Workplace\yii1.1.15\framework\db\ar\CActiveRecord.php(145): CComponent->__get('hidden')
#1 C:\Workplace\yii1.1.15\framework\web\helpers\CHtml.php(2529): CActiveRecord->__get('hidden')
#2 C:\Workplace\yii1.1.15\framework\web\helpers\CHtml.php(2252): CHtml::resolveValue(Object(Article), 'hidden')
#3 C:\Workplace\yii1.1.15\framework\web\helpers\CHtml.php(1434): CHtml::activeInputField('text', Object(Article), 'hidden', Array)
#4 C:\Workplace\yii1.1.15\framework\web\widgets\CActiveForm.php(725): CHtml::activeTextField(Object(Article), 'hidden', Array)
#5 C:\Workplace\Apache2.4\htdocs\bashgid\protected\views\article\_search.php(76): CActiveForm->textField(Object(Article), 'hidden')
#6 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(126): require('C:\\Workplace\\Ap...')
#7 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(95): CBaseController->renderInternal('C:\\Workplace\\Ap...', Array, true)
#8 C:\Workplace\yii1.1.15\framework\web\CController.php(869): CBaseController->renderFile('C:\\Workplace\\Ap...', Array, true)
#9 C:\Workplace\Apache2.4\htdocs\bashgid\protected\views\article\admin.php(40): CController->renderPartial('_search', Array)
#10 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(126): require('C:\\Workplace\\Ap...')
#11 C:\Workplace\yii1.1.15\framework\web\CBaseController.php(95): CBaseController->renderInternal('C:\\Workplace\\Ap...', Array, true)
#12 C:\Workplace\yii1.1.15\framework\web\CController.php(869): CBaseController->renderFile('C:\\Workplace\\Ap...', Array, true)
#13 C:\Workplace\yii1.1.15\framework\web\CController.php(782): CController->renderPartial('admin', Array, true)
#14 C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\ArticleController.php(147): CController->render('admin', Array)
#15 C:\Workplace\yii1.1.15\framework\web\actions\CInlineAction.php(49): ArticleController->actionAdmin()
#16 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams(Array)
#17 C:\Workplace\yii1.1.15\framework\web\filters\CFilterChain.php(133): CController->runAction(Object(CInlineAction))
#18 C:\Workplace\yii1.1.15\framework\web\filters\CFilter.php(40): CFilterChain->run()
#19 C:\Workplace\yii1.1.15\framework\web\CController.php(1145): CFilter->filter(Object(CFilterChain))
#20 C:\Workplace\yii1.1.15\framework\web\filters\CInlineFilter.php(58): CController->filterAccessControl(Object(CFilterChain))
#21 C:\Workplace\yii1.1.15\framework\web\filters\CFilterChain.php(130): CInlineFilter->filter(Object(CFilterChain))
#22 C:\Workplace\yii1.1.15\framework\web\CController.php(291): CFilterChain->run()
#23 C:\Workplace\yii1.1.15\framework\web\CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#24 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): CController->run('admin')
#25 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController('article/admin')
#26 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#27 C:\Workplace\Apache2.4\htdocs\bashgid\index.php(21): CApplication->run()
#28 {main}
REQUEST_URI=/bashgid/index.php?r=article/admin
HTTP_REFERER=http://localhost/bashgid/index.php?r=site/index
---
2015/07/07 19:48:06 [error] [php] Undefined variable: row (C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php:135)
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\bashgid\index.php(21): CWebApplication->run()
REQUEST_URI=/bashgid/index.php?r=site/addPhotosToArticle
in C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php (135)
in C:\Workplace\Apache2.4\htdocs\bashgid\index.php (21)
2015/07/07 19:48:49 [error] [php] : failed to open stream: No such file or directory (C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php:140)
Stack trace:
#0 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams()
#1 C:\Workplace\yii1.1.15\framework\web\CController.php(286): SiteController->runAction()
#2 C:\Workplace\yii1.1.15\framework\web\CController.php(265): SiteController->runActionWithFilters()
#3 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): SiteController->run()
#4 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController()
#5 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#6 C:\Workplace\Apache2.4\htdocs\bashgid\index.php(21): CWebApplication->run()
REQUEST_URI=/bashgid/index.php?r=site/addPhotosToArticle
in C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php (140)
in C:\Workplace\Apache2.4\htdocs\bashgid\index.php (21)
2015/07/07 20:12:21 [error] [php] : failed to open stream: No such file or directory (C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php:140)
Stack trace:
#0 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams()
#1 C:\Workplace\yii1.1.15\framework\web\CController.php(286): SiteController->runAction()
#2 C:\Workplace\yii1.1.15\framework\web\CController.php(265): SiteController->runActionWithFilters()
#3 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): SiteController->run()
#4 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController()
#5 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#6 C:\Workplace\Apache2.4\htdocs\bashgid\index.php(21): CWebApplication->run()
REQUEST_URI=/bashgid/index.php?r=site/addPhotosToArticle
in C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php (140)
in C:\Workplace\Apache2.4\htdocs\bashgid\index.php (21)
2015/07/07 20:12:37 [error] [php] Array to string conversion (C:\Workplace\Apache2.4\htdocs\bashgid\protected\views\site\photosAdded.php:17)
Stack trace:
#0 C:\Workplace\yii1.1.15\framework\web\CController.php(869): SiteController->renderFile()
#1 C:\Workplace\yii1.1.15\framework\web\CController.php(782): SiteController->renderPartial()
#2 C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php(145): SiteController->render()
#3 C:\Workplace\yii1.1.15\framework\web\actions\CInlineAction.php(49): SiteController->actionAddPhotosToArticle()
#4 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams()
#5 C:\Workplace\yii1.1.15\framework\web\CController.php(286): SiteController->runAction()
#6 C:\Workplace\yii1.1.15\framework\web\CController.php(265): SiteController->runActionWithFilters()
#7 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): SiteController->run()
#8 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController()
#9 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#10 C:\Workplace\Apache2.4\htdocs\bashgid\index.php(21): CWebApplication->run()
REQUEST_URI=/bashgid/index.php?r=site/addPhotosToArticle
in C:\Workplace\Apache2.4\htdocs\bashgid\protected\views\site\photosAdded.php (17)
in C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php (145)
in C:\Workplace\Apache2.4\htdocs\bashgid\index.php (21)
2015/07/07 20:14:30 [error] [php] : failed to open stream: No such file or directory (C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php:141)
Stack trace:
#0 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams()
#1 C:\Workplace\yii1.1.15\framework\web\CController.php(286): SiteController->runAction()
#2 C:\Workplace\yii1.1.15\framework\web\CController.php(265): SiteController->runActionWithFilters()
#3 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): SiteController->run()
#4 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController()
#5 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#6 C:\Workplace\Apache2.4\htdocs\bashgid\index.php(21): CWebApplication->run()
REQUEST_URI=/bashgid/index.php?r=site/addPhotosToArticle
in C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php (141)
in C:\Workplace\Apache2.4\htdocs\bashgid\index.php (21)
2015/07/07 20:16:22 [error] [php] : failed to open stream: No such file or directory (C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php:141)
Stack trace:
#0 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams()
#1 C:\Workplace\yii1.1.15\framework\web\CController.php(286): SiteController->runAction()
#2 C:\Workplace\yii1.1.15\framework\web\CController.php(265): SiteController->runActionWithFilters()
#3 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): SiteController->run()
#4 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController()
#5 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#6 C:\Workplace\Apache2.4\htdocs\bashgid\index.php(21): CWebApplication->run()
REQUEST_URI=/bashgid/index.php?r=site/addPhotosToArticle
in C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php (141)
in C:\Workplace\Apache2.4\htdocs\bashgid\index.php (21)
2015/07/07 20:17:06 [error] [php] : failed to open stream: No such file or directory (C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php:141)
Stack trace:
#0 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams()
#1 C:\Workplace\yii1.1.15\framework\web\CController.php(286): SiteController->runAction()
#2 C:\Workplace\yii1.1.15\framework\web\CController.php(265): SiteController->runActionWithFilters()
#3 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): SiteController->run()
#4 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController()
#5 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#6 C:\Workplace\Apache2.4\htdocs\bashgid\index.php(21): CWebApplication->run()
REQUEST_URI=/bashgid/index.php?r=site/addPhotosToArticle
in C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php (141)
in C:\Workplace\Apache2.4\htdocs\bashgid\index.php (21)
2015/07/07 20:17:33 [error] [php] copy(C:/Workplace/Apache2.4/htdocs/bashgid/bashgid_imagesbashgid_images/nnk.jpg): failed to open stream: No such file or directory (C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php:141)
Stack trace:
#0 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams()
#1 C:\Workplace\yii1.1.15\framework\web\CController.php(286): SiteController->runAction()
#2 C:\Workplace\yii1.1.15\framework\web\CController.php(265): SiteController->runActionWithFilters()
#3 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): SiteController->run()
#4 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController()
#5 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#6 C:\Workplace\Apache2.4\htdocs\bashgid\index.php(21): CWebApplication->run()
REQUEST_URI=/bashgid/index.php?r=site/addPhotosToArticle
in C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php (141)
in C:\Workplace\Apache2.4\htdocs\bashgid\index.php (21)
2015/07/07 20:30:51 [error] [php] include(Almum.php): failed to open stream: No such file or directory (C:\Workplace\yii1.1.15\framework\YiiBase.php:427)
Stack trace:
#0 C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php(141): spl_autoload_call()
#1 C:\Workplace\yii1.1.15\framework\web\actions\CInlineAction.php(49): SiteController->actionAddPhotosToArticle()
#2 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams()
#3 C:\Workplace\yii1.1.15\framework\web\CController.php(286): SiteController->runAction()
#4 C:\Workplace\yii1.1.15\framework\web\CController.php(265): SiteController->runActionWithFilters()
#5 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): SiteController->run()
#6 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController()
#7 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#8 C:\Workplace\Apache2.4\htdocs\bashgid\index.php(21): CWebApplication->run()
REQUEST_URI=/bashgid/index.php?r=site/addPhotosToArticle
in C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php (141)
in C:\Workplace\Apache2.4\htdocs\bashgid\index.php (21)
2015/07/07 22:38:48 [error] [php] include(MyModel.php): failed to open stream: No such file or directory (C:\Workplace\yii1.1.15\framework\YiiBase.php:427)
Stack trace:
#0 C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php(217): spl_autoload_call()
#1 C:\Workplace\yii1.1.15\framework\web\actions\CInlineAction.php(49): SiteController->actionRecalcImageHash()
#2 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams()
#3 C:\Workplace\yii1.1.15\framework\web\CController.php(286): SiteController->runAction()
#4 C:\Workplace\yii1.1.15\framework\web\CController.php(265): SiteController->runActionWithFilters()
#5 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): SiteController->run()
#6 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController()
#7 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#8 C:\Workplace\Apache2.4\htdocs\bashgid\index.php(21): CWebApplication->run()
REQUEST_URI=/bashgid/index.php?r=site/recalcImageHash
in C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php (217)
in C:\Workplace\Apache2.4\htdocs\bashgid\index.php (21)
2015/07/07 22:38:52 [error] [php] include(MyModel.php): failed to open stream: No such file or directory (C:\Workplace\yii1.1.15\framework\YiiBase.php:427)
Stack trace:
#0 C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php(217): spl_autoload_call()
#1 C:\Workplace\yii1.1.15\framework\web\actions\CInlineAction.php(49): SiteController->actionRecalcImageHash()
#2 C:\Workplace\yii1.1.15\framework\web\CController.php(308): CInlineAction->runWithParams()
#3 C:\Workplace\yii1.1.15\framework\web\CController.php(286): SiteController->runAction()
#4 C:\Workplace\yii1.1.15\framework\web\CController.php(265): SiteController->runActionWithFilters()
#5 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(282): SiteController->run()
#6 C:\Workplace\yii1.1.15\framework\web\CWebApplication.php(141): CWebApplication->runController()
#7 C:\Workplace\yii1.1.15\framework\base\CApplication.php(180): CWebApplication->processRequest()
#8 C:\Workplace\Apache2.4\htdocs\bashgid\index.php(21): CWebApplication->run()
REQUEST_URI=/bashgid/index.php?r=site/recalcImageHash
in C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php (217)
in C:\Workplace\Apache2.4\htdocs\bashgid\index.php (21)
2015/07/07 22:39:08 [error] [php] Undefined variable: row (C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php:222)
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\bashgid\index.php(21): CWebApplication->run()
REQUEST_URI=/bashgid/index.php?r=site/recalcImageHash
in C:\Workplace\Apache2.4\htdocs\bashgid\protected\controllers\SiteController.php (222)
in C:\Workplace\Apache2.4\htdocs\bashgid\index.php (21)

View File

@ -0,0 +1,44 @@
<?php
/* @var $this SiteController */
/* @var $model LoginForm */
/* @var $form CActiveForm */
$this->pageTitle=Yii::app()->name . ' - Add many photos';
$this->breadcrumbs=array(
'Add many photos',
);
?>
<h1>Автоматическое добавление картинок в статью</h1>
<p>Введите имя статьи:</p>
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'login-form',
'enableClientValidation'=>true,
'clientOptions'=>array(
'validateOnSubmit'=>true,
),
)); ?>
<p class="note">Поля, отмеченные <span class="required">*</span> обязательны.</p>
<div class="row">
<?php echo $form->labelEx($model,'articleName'); ?>
<?php echo $form->textField($model,'articleName'); ?>
<?php echo $form->error($model,'articleName'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'photoUrlText'); ?>
<?php echo $form->textArea($model,'photoUrlText',array('rows'=>6, 'cols'=>50)); ?>
<?php echo $form->error($model,'photoUrlText'); ?>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton('Add photos'); ?>
</div>
<?php $this->endWidget(); ?>
</div><!-- form -->

View File

@ -27,6 +27,13 @@ if (!Yii::app()->user->isGuest)
)); ));
$this->widget('zii.widgets.CMenu', array(
'items' => array(
array('label' => 'Редактировать фото в статье', 'url' => array('site/addPhotosToArticle')),
array('label' => 'Обновить хэш', 'url' => array('site/recalcImageHash')),
),
));
/*
if (Journal::getCurrentUserJournal()) if (Journal::getCurrentUserJournal())
{ {
$this->widget('zii.widgets.CMenu', array( $this->widget('zii.widgets.CMenu', array(
@ -44,7 +51,7 @@ if (!Yii::app()->user->isGuest)
array('label' => 'Добавить ваш раздел', 'url' => array('journal/addMax')), array('label' => 'Добавить ваш раздел', 'url' => array('journal/addMax')),
), ),
)); ));
} }*/
} }
else else

View File

@ -0,0 +1,25 @@
<?php
/* @var $this SiteController */
/* @var $model LoginForm */
/* @var $form CActiveForm */
$this->pageTitle = Yii::app()->name . ' - Add many photos';
$this->breadcrumbs = array(
'Add many photos',
);
?>
<h1>Автоматическое добавление картинок в статью</h1>
<p>Введите имя статьи:</p>
<?php
echo "<hr>";
foreach ($urlList as $row)
{
echo "<p>" . $row . "</p>";
}
?>
</div><!-- form -->