I just wanted to share a little mod that a customer asked me to integrate:
He wanted to earn cash from people downloading his site's phocaGallery images.
This is possible with AdFly url shortener and ad service API
Here is how to proceed
1. Get a adf.ly/?id=8726147 (free AdFly Account)
2. From your account, get a the API key and your UID
Here is the modification for the DIRECT DOWNLOAD button type on category view
Open this file:
components/com_phocagallery/views/category/tmpl/default_images.php
find :
// Direct Download but not if there is a youtube
Right below it add:
Code: Select all
$key = 'cfea8b20afcad652f6608d1e88ed08b6';
$uid = '8726147';
$url = JURI::Root().'index.php?option=com_phocagallery&view=detail&catid='.$cv->catslug.'&id='.$cv->slug. $this->tmpl['tmplcom'].'&phocadownload='.$cv->display_icon_download.'&Itemid='. $this->itemId ;
$api = 'http://api.adf.ly/api.php?';
$api .= 'key='.$key;
$api .= '&uid='.$uid;
$api .= '&advert_type=int';
$api .= '&domain=adf.ly';
$api .= '&url='.urlencode($url);
if ($data = file_get_contents($api) )
$url = $data;
Code: Select all
JRoute::_('index.php?option=com_phocagallery&view=detail&catid='.$cv->catslug.'&id='.$cv->slug. $this->tmpl['tmplcom'].'&phocadownload='.$cv->display_icon_download.'&Itemid='. $this->itemId )
Code: Select all
$url

Of course you must replace the API key ($key) and UID ($uid) variabes values is yours