adsense for registered users only adsense for registered users only
 

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]

Main Menu

adsense for registered users only

Started by Pakistani1, June 03, 2007, 11:00:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Pakistani1

is there a way to add the adsense code that the advertisement is displayed to registered users only . ?

Joachim Müller

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.

Pakistani1

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

Joachim Müller

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// 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// 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?>of themes/yourtheme/theme.php

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

Pakistani1