This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
Sequenzia/app/helpers/AdvertisementsHelper.php

23 lines
808 B
PHP
Raw Normal View History

2013-10-27 01:06:58 +02:00
<?php
class AdvertisementsHelper extends Rails\ActionView\Helper
{
public function print_advertisement($ad_type)
{
if (CONFIG()->can_see_ads(current_user())) {
2013-11-21 20:08:11 +01:00
$ad = Advertisement::random($ad_type);
if ($ad) {
return $this->contentTag("div",
$this->linkTo(
$this->imageTag(
$ad->image_url,
['alt' => "Advertisement", 'width' => $ad->width, 'height' => $ad->height]
),
$this->redirectAdvertisementPath($ad),
['target' => '_blank']
),
['style' => "margin-bottom: 1em;"]
);
}
2013-10-27 01:06:58 +02:00
}
}
}