Page 1 of 1

Gallery - Detail and advertising`

Posted: 17 Sep 2010, 23:11
by skatharozoumis
Hello,

i have one problem, i followed your documentation about the adsense and how to add the code with the easy adsense module but it just wont work.

I need to have the advertisement appear to the bottom and the left of the photo.

for example :

Code: Select all

http://www.mixed.gr/entertainment/34-greek-funny-pictures-1/detail/585-greek_funny_photos-206
on the left and on the bottom to have ads.

I just cant do it.

Anyone can help me or share his files ?

Thanks in advance

Re: Gallery - Detail and advertising`

Posted: 20 Sep 2010, 16:13
by Jan
Hi, the code in default.php is an html code, so it depends on you where you paste your adsense code.

Not sure what you mean with "I just can do it" but you need to open the default.php and customize it.

Jan

Re: Gallery - Detail and advertising`

Posted: 24 Sep 2010, 13:27
by skatharozoumis
Here are my steps.

1. Create a Phoca - Google AdSense Easy module and publish in in phocaads position

2.

find
components/com_phocagallery/views/detail/view.html.php

after $params = &$mainframe->getParams(); ,

paste the following code:

Code: Select all

// PHOCA ADS EDIT - - - - - - - - - - 
$adsRenderer    = $document->loadRenderer('module'); 
$adsOutput        = ''; 
$adsPosition    = JModuleHelper::getModules('phocaads'); 

if (isset($adsPosition[0])) { 
    $paramsM    = new JParameter( $adsPosition[0]->params ); 
    if (isset($adsPosition[0]->module) && $adsPosition[0]->module ==
      'mod_phoca_google_adsense' && isset($adsPosition[0]->params)) { 
        $adsense_code        = $paramsM->get( 'adsense_code',''); 
        $ip_block_list        = $paramsM->get( 'ip_block_list',''); 
        $alternate_content    = $paramsM->get( 'alternate_content',''
          ); 
        $module_css_style    = $paramsM->get( 'module_css_style',''); 
        $ip_array            = explode( ';', $ip_block_list ); 
        $ipa                = 1;//display 
         
        foreach ($ip_array as $value){ 
            if ($_SERVER["REMOTE_ADDR"] == trim($value)) { 
                $ipa = 0; 
            } 
        } 
        if ($module_css_style) { 
            $adsOutput .= '<div style="'.$module_css_style.'">'; 
        } 
        if ($ipa == 1){ 
            $adsOutput .=  $adsense_code; 
        } else { 
            $adsOutput .=  $alternate_content; 
        } 
        if ($module_css_style) { 
            $adsOutput .=  '</div>'; 
        } 
    } 
} 
$this->assignRef( 'adsoutput', $adsOutput ); 
// PHOCA ADS EDIT - - - - - - - - - - 
3.

find
components/com_phocagallery/views/detail/tmpl/default.php

before if ($this->tmpl['detailbuttons'] == 1){),

paste the following code

Code: Select all

?> 
<tr> 
    <td colspan="6" align="center"><?php echo $this->adsoutput; ?>
      </td> 
</tr> 

?> 

But still no adsense is displayed.

Detail View Settings --> Detail Window --> is set to No Pop Up Via Phoca Gallery backnend parametres

Am i doing something wrong ?

Re: Gallery - Detail and advertising`

Posted: 26 Sep 2010, 14:22
by Jan
Hi, did you paste there some html code to see if the code is really displayed on that place?

Re: Gallery - Detail and advertising`

Posted: 29 Mar 2012, 16:44
by lifemaster
Hi guys,

i have the same troubles. When i config the module to position ( above body,below etc. ), the googleads will be displayed. so i have edit both php files. After that i have change the position to phocaads but the ads will not be displayed.

For information, i dont find the code part after $params = &$mainframe->getParams();
Maybe in my phocagallery version this part never exists.
I have add the code after class PhocaGalleryViewDetail extends JView
Maybe its wrong but i dont find a answer for that on the net.

Can anybody help me in my case



Very Thanks
Daniel