This commit is contained in:
Krivchikov Dmitry 2014-08-09 19:34:48 +04:00
parent 8a0d2f9dde
commit d0c1fdf285
2 changed files with 14 additions and 1 deletions

View File

@ -66,7 +66,7 @@ class IndexController extends Controller
$og['site_name'] = 'WikiPoints - '.$res['pointsCount'].' или даже больше поводов не сидеть дома'; $og['site_name'] = 'WikiPoints - '.$res['pointsCount'].' или даже больше поводов не сидеть дома';
$og['type'] = 'article'; $og['type'] = 'article';
$og['url'] = 'http://wikipoints.ru/?point='.$id; $og['url'] = 'http://wikipoints.ru/?point='.$id;
$og['image'] = $point->img; $og['image'] = $point->getImg();
} }
else if(isset($_GET['point']) && $_GET['point'] && strtolower($_GET['point']) == 'random') else if(isset($_GET['point']) && $_GET['point'] && strtolower($_GET['point']) == 'random')
{ {

View File

@ -15,5 +15,18 @@ class Point extends Model
{ {
return new self(); return new self();
} }
public function getImg()
{
$img = $this->img;
if ($img == '')
{
$img = array_shift($this->photos);
$img = '/photos/middle/' . $img->name;
}
return $img;
}
} }