Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: adsense for registered users only  (Read 3302 times)

0 Members and 1 Guest are viewing this topic.

Pakistani1

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
adsense for registered users only
« on: June 03, 2007, 11:00:46 pm »

is there a way to add the adsense code that the advertisement is displayed to registered users only . ?
« Last Edit: June 06, 2007, 03:59:45 pm by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: adsense for registered users only
« Reply #1 on: June 04, 2007, 09:49:12 am »

Sure, just wrap the code into some custom PHP that determines if a user is logged in. For details, post details: where exactly is the adsense code suppossed to show up? Posting a link is almost mandatory when asking for support.
Logged

Pakistani1

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: adsense for registered users only
« Reply #2 on: June 05, 2007, 05:43:35 am »

site url
http://www.mastimagic.org/coppermine

i would like to display adds to registered users only just after the links and before the choose theme option ..

that is above the chose theme option.
thanx
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: adsense for registered users only
« Reply #3 on: June 05, 2007, 07:18:54 pm »

Then add the code to the user admin menu that will be only displayed if a user is logged in. Edit themes/yourtheme/theme.php, find
Code: [Select]
// HTML template for user admin menu
$template_user_admin_menu = <<<EOT
and edit as suggested below. If this piece of code doesn't exist in your custom theme. copy
Code: [Select]
// HTML template for user admin menu
$template_user_admin_menu = <<<EOT

                <div align="center">
                <table cellpadding="0" cellspacing="1">
                        <tr>
                                <td class="admin_menu"><a href="albmgr.php" title="{ALBMGR_TITLE}">{ALBMGR_LNK}</a></td>
                                <td class="admin_menu"><a href="modifyalb.php" title="{MODIFYALB_TITLE}">{MODIFYALB_LNK}</a></td>
                                <td class="admin_menu"><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a></td>
                                <td class="admin_menu"><a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_LNK}</a></td>
                        </tr>
                </table>
                </div>

EOT;
from themes/sample/theme.php into a new line before
Code: [Select]
?>of themes/yourtheme/theme.php

Just add you custom code between </div> and EOT;
Logged

Pakistani1

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: adsense for registered users only
« Reply #4 on: June 06, 2007, 01:13:57 pm »

Thanks it works gr8 .. !!
Logged
Pages: [1]   Go Up
 

Page created in 0.027 seconds with 20 queries.