coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: Pakistani1 on June 03, 2007, 11:00:46 PM

Title: adsense for registered users only
Post by: Pakistani1 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 . ?
Title: Re: adsense for registered users only
Post by: Joachim Müller 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.
Title: Re: adsense for registered users only
Post by: Pakistani1 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
Title: Re: adsense for registered users only
Post by: Joachim Müller 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// 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;
Title: Re: adsense for registered users only
Post by: Pakistani1 on June 06, 2007, 01:13:57 PM
Thanks it works gr8 .. !!