ADD линк для публикации точки в ВК

This commit is contained in:
Krivchikov Dmitry 2015-04-05 17:45:33 +03:00
parent c43369dc12
commit 885673a6fd
2 changed files with 41 additions and 0 deletions

View File

@ -160,6 +160,35 @@ class PageController extends Controller
} }
} }
static function actionVkpoint()
{
$pointId = (int) App::getParam('id');
if (App::$user && App::$user->isAdmin == 1 && $pointId)
{
$point = Point::model()->getByPK($pointId);
if ($point->id == NULL)
{
App::error404();
}
$point->descriptionHtml = nl2br($point->description);
$point->name = htmlspecialchars($point->name);
$categories = Category::model()->getAll(array('order' => 'ord ASC', 'asArray' => true));
$point->descriptionHtml = Helper::replaceLinks($point->descriptionHtml);
self::renderPartial('vkPoint.php', array(
'point' => $point,
'photos' => $point->photos,
));
} else
{
App::error404();
}
}
static function action404($message) static function action404($message)
{ {
self::renderPartial('error404.php', array( self::renderPartial('error404.php', array(

12
ground/views/vkPoint.php Normal file
View File

@ -0,0 +1,12 @@
<?php
foreach ($photos as $photo) {
print 'http://wikipoints.ru/photos/big/'.$photo->name.'</br>';
}
?>
<?= $point->name ?> (, )<br/>
<br>
<?= $point->description ?><br/>
<br/>
Продолжить чтение и посмотреть на карте: http://wikipoints.ru/page/point/id/<?= $point->id ?>
#wikipoints #выходные #путешествия #туризм # # # #