FIX OG
This commit is contained in:
parent
8a0d2f9dde
commit
d0c1fdf285
|
|
@ -66,7 +66,7 @@ class IndexController extends Controller
|
|||
$og['site_name'] = 'WikiPoints - '.$res['pointsCount'].' или даже больше поводов не сидеть дома';
|
||||
$og['type'] = 'article';
|
||||
$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')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,5 +15,18 @@ class Point extends Model
|
|||
{
|
||||
return new self();
|
||||
}
|
||||
|
||||
public function getImg()
|
||||
{
|
||||
$img = $this->img;
|
||||
if ($img == '')
|
||||
{
|
||||
$img = array_shift($this->photos);
|
||||
$img = '/photos/middle/' . $img->name;
|
||||
}
|
||||
|
||||
return $img;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue