Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Google Adsense Code insertion in "Smf 1-1 rc2" Theme  (Read 5223 times)

0 Members and 1 Guest are viewing this topic.

helloharoon

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Google Adsense Code insertion in "Smf 1-1 rc2" Theme
« on: November 04, 2007, 05:43:49 pm »

HI
how are you?'
i want to insert Google adsense Code on image display page, above image,
using the theme "Smf 1-1 rc2"
kindly assist.
Thanks
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: Google Adsense Code insertion in "Smf 1-1 rc2" Theme
« Reply #1 on: November 04, 2007, 05:50:12 pm »

Adsense above image:

Open theme.php

Find:


Code: [Select]
// HTML template for intermediate image display
$template_display_media = <<<EOT
        <tr>
                <td align="center" class="display_media" nowrap="nowrap">
                        <table cellspacing="2" cellpadding="0" class="imageborder">
                             
 <tr>
                                        <td align="center">

                                                {IMAGE}
And after:


Code: [Select]
<td align="center" class="display_media" nowrap="nowrap">
                        <table cellspacing="2" cellpadding="0" class="imageborder">

Paste your Adsense code.

As per usal if your theme.php doesent have the above code copy the code from sample/theme.php and paste it into your theme.php

If your not sure what you doing then make sure to make backup first.




Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

helloharoon

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Google Adsense Code insertion in "Smf 1-1 rc2" Theme
« Reply #2 on: November 04, 2007, 05:55:06 pm »

can we paste code from theme/Sample anywhere in the page?
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: Google Adsense Code insertion in "Smf 1-1 rc2" Theme
« Reply #3 on: November 04, 2007, 06:05:03 pm »

Quote from: GauGau
If a particular section (function or variable definition) doesn't exist in your custom theme, copy it (the missing section) from themes/sample/theme.php into a new line before
Code: [Select]
?>

So i would think you would need to copy the whole of the
$template_display_media section
ie from
$template_display_media to just after the EOT;  before $template_image_rating.
As i said make a backup if your not sure.
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

helloharoon

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Google Adsense Code insertion in "Smf 1-1 rc2" Theme
« Reply #4 on: November 04, 2007, 08:12:18 pm »

we have tried to do so but failed.

here is theme.php file


kindly tell us, where we have to put the code




Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2006 Coppermine Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.5
  $Source:
  $Revision:
  $Author:
  $Date:
**********************************************/

define('THEME_HAS_NO_SYS_MENU_BUTTONS'1);
define('THEME_HAS_NO_SUB_MENU_BUTTONS'1);
define('THEME_IS_XHTML10_TRANSITIONAL',1);  // Remove this if you edit this template until
                                            // you have validated it. See docs/theme.htm.

// HTML template for sys menu
$template_sys_menu = <<<EOT

<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
   <tr>
                        <td class="maintab_first">&nbsp;</td>
<!-- BEGIN home -->
<td valign="top" class="maintab_back">
<a href="{HOME_TGT}" title="{HOME_TITLE}">{HOME_LNK}</a>
</td>
<!-- END home -->
<!-- BEGIN my_gallery -->
<td valign="top" class="maintab_back">
<a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}">{MY_GAL_LNK}</a>
</td>
<!-- END my_gallery -->
<!-- BEGIN allow_memberlist -->
<td valign="top" class="maintab_back">
<a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}">{MEMBERLIST_LNK}</a>
                        </td>
<!-- END allow_memberlist -->
<!-- BEGIN my_profile -->
<td valign="top" class="maintab_back">
<a href="{MY_PROF_TGT}" title="{MY_PROF_LNK}">{MY_PROF_LNK}</a>
</td>
<!-- END my_profile -->
<!-- BEGIN faq -->
<td valign="top" class="maintab_back">
<a href="{FAQ_TGT}" title="{FAQ_TITLE}">{FAQ_LNK}</a>
</td>
<!-- END faq -->
<!-- BEGIN enter_admin_mode -->
<td valign="top" class="maintab_back">
<a href="{ADM_MODE_TGT}" title="{ADM_MODE_TITLE}">{ADM_MODE_LNK}</a>
</td>
<!-- END enter_admin_mode -->
<!-- BEGIN leave_admin_mode -->
<td valign="top" class="maintab_back">
<a href="{USR_MODE_TGT}" title="{USR_MODE_TITLE}">{USR_MODE_LNK}</a>
</td>
<!-- END leave_admin_mode -->
<!-- BEGIN upload_pic -->
<td valign="top" class="maintab_back">
<a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}">{UPL_PIC_LNK}</a>
</td>
<!-- END upload_pic -->
<!-- BEGIN register -->
<td valign="top" class="maintab_back">
<a href="{REGISTER_TGT}" title="{REGISTER_TITLE}">{REGISTER_LNK}</a>
</td>
<!-- END register -->
<!-- BEGIN login -->
<td valign="top" class="maintab_back">
<a href="{LOGIN_TGT}" title="{LOGIN_LNK}">{LOGIN_LNK}</a>
</td>
<!-- END login -->
<!-- BEGIN logout -->
<td valign="top" class="maintab_back">
<a href="{LOGOUT_TGT}" title="{LOGOUT_LNK}">{LOGOUT_LNK}</a>
</td>
<!-- END logout -->
<td class="maintab_last">&nbsp;</td>
</tr>
</table>

EOT;

// HTML template for sub menu
$template_sub_menu = <<<EOT

<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
   <tr>
                        <td class="maintab_first">&nbsp;</td>
<!-- BEGIN custom_link -->
<td valign="top" class="maintab_back">
<a href="{CUSTOM_LNK_TGT}" title="{CUSTOM_LNK_TITLE}">{CUSTOM_LNK_LNK}</a>
</td>
<!-- END custom_link -->
<!-- BEGIN album_list -->
<td valign="top" class="maintab_back">
<a href="{ALB_LIST_TGT}" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a>
</td>
<!-- END album_list -->
<!-- BEGIN last upload -->
<td valign="top" class="maintab_back">
<a href="{LASTUP_TGT}" title="{LASTUP_LNK}">{LASTUP_LNK}</a>
                        </td>
<!-- END last upload -->
<!-- BEGIN comments -->
<td valign="top" class="maintab_back">
<a href="{LASTCOM_TGT}" title="{LASTCOM_LNK}">{LASTCOM_LNK}</a>
</td>
<!-- END commenst -->
<!-- BEGIN top viewd -->
<td valign="top" class="maintab_back">
<a href="{TOPN_TGT}" title="{TOPN_LNK}">{TOPN_LNK}</a>
</td>
<!-- END top viewed -->




<!-- BEGIN rating -->
<td valign="top" class="maintab_back">
<a href="{TOPRATED_TGT}" title="{TOPRATED_LNK}">{TOPRATED_LNK}</a>
</td>
<!-- END rating -->
<!-- BEGIN favorites -->
<td valign="top" class="maintab_back">
<a href="{FAV_TGT}" title="{FAV_LNK}">{FAV_LNK}</a>
</td>
<!-- END favorites -->
<!-- BEGIN search -->
<td valign="top" class="maintab_back">
<a href="{SEARCH_TGT}" title="{SEARCH_LNK}">{SEARCH_LNK}</a>
</td>
<!-- END search-->
<td class="maintab_last">&nbsp;</td>
</tr>
</table>

EOT;

?>
« Last Edit: November 05, 2007, 07:53:10 am by GauGau »
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: Google Adsense Code insertion in "Smf 1-1 rc2" Theme
« Reply #5 on: November 04, 2007, 08:22:03 pm »

Well you havnt copied the code like i said, therefore there is nowhere to put the code untill you do that.
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

helloharoon

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Google Adsense Code insertion in "Smf 1-1 rc2" Theme
« Reply #6 on: November 04, 2007, 08:28:03 pm »

this is plane theme file of the said theme..

kindly mention where have to put the code,
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: Google Adsense Code insertion in "Smf 1-1 rc2" Theme
« Reply #7 on: November 04, 2007, 08:39:02 pm »

Paste the $template_display_media section above
Code: [Select]
?>, this was mentioned a few posts earlier.
« Last Edit: November 05, 2007, 07:53:36 am by GauGau »
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Google Adsense Code insertion in "Smf 1-1 rc2" Theme
« Reply #8 on: November 05, 2007, 07:57:28 am »

Your theme.php would then look like this:
Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2006 Coppermine Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.5
  $Source:
  $Revision:
  $Author:
  $Date:
**********************************************/

define('THEME_HAS_NO_SYS_MENU_BUTTONS'1);
define('THEME_HAS_NO_SUB_MENU_BUTTONS'1);
define('THEME_IS_XHTML10_TRANSITIONAL',1);  // Remove this if you edit this template until
                                            // you have validated it. See docs/theme.htm.

// HTML template for sys menu
$template_sys_menu = <<<EOT

<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
   <tr>
                        <td class="maintab_first">&nbsp;</td>
<!-- BEGIN home -->
<td valign="top" class="maintab_back">
<a href="{HOME_TGT}" title="{HOME_TITLE}">{HOME_LNK}</a>
</td>
<!-- END home -->
<!-- BEGIN my_gallery -->
<td valign="top" class="maintab_back">
<a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}">{MY_GAL_LNK}</a>
</td>
<!-- END my_gallery -->
<!-- BEGIN allow_memberlist -->
<td valign="top" class="maintab_back">
<a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}">{MEMBERLIST_LNK}</a>
                        </td>
<!-- END allow_memberlist -->
<!-- BEGIN my_profile -->
<td valign="top" class="maintab_back">
<a href="{MY_PROF_TGT}" title="{MY_PROF_LNK}">{MY_PROF_LNK}</a>
</td>
<!-- END my_profile -->
<!-- BEGIN faq -->
<td valign="top" class="maintab_back">
<a href="{FAQ_TGT}" title="{FAQ_TITLE}">{FAQ_LNK}</a>
</td>
<!-- END faq -->
<!-- BEGIN enter_admin_mode -->
<td valign="top" class="maintab_back">
<a href="{ADM_MODE_TGT}" title="{ADM_MODE_TITLE}">{ADM_MODE_LNK}</a>
</td>
<!-- END enter_admin_mode -->
<!-- BEGIN leave_admin_mode -->
<td valign="top" class="maintab_back">
<a href="{USR_MODE_TGT}" title="{USR_MODE_TITLE}">{USR_MODE_LNK}</a>
</td>
<!-- END leave_admin_mode -->
<!-- BEGIN upload_pic -->
<td valign="top" class="maintab_back">
<a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}">{UPL_PIC_LNK}</a>
</td>
<!-- END upload_pic -->
<!-- BEGIN register -->
<td valign="top" class="maintab_back">
<a href="{REGISTER_TGT}" title="{REGISTER_TITLE}">{REGISTER_LNK}</a>
</td>
<!-- END register -->
<!-- BEGIN login -->
<td valign="top" class="maintab_back">
<a href="{LOGIN_TGT}" title="{LOGIN_LNK}">{LOGIN_LNK}</a>
</td>
<!-- END login -->
<!-- BEGIN logout -->
<td valign="top" class="maintab_back">
<a href="{LOGOUT_TGT}" title="{LOGOUT_LNK}">{LOGOUT_LNK}</a>
</td>
<!-- END logout -->
<td class="maintab_last">&nbsp;</td>
</tr>
</table>

EOT;

// HTML template for sub menu
$template_sub_menu = <<<EOT

<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
   <tr>
                        <td class="maintab_first">&nbsp;</td>
<!-- BEGIN custom_link -->
<td valign="top" class="maintab_back">
<a href="{CUSTOM_LNK_TGT}" title="{CUSTOM_LNK_TITLE}">{CUSTOM_LNK_LNK}</a>
</td>
<!-- END custom_link -->
<!-- BEGIN album_list -->
<td valign="top" class="maintab_back">
<a href="{ALB_LIST_TGT}" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a>
</td>
<!-- END album_list -->
<!-- BEGIN last upload -->
<td valign="top" class="maintab_back">
<a href="{LASTUP_TGT}" title="{LASTUP_LNK}">{LASTUP_LNK}</a>
                        </td>
<!-- END last upload -->
<!-- BEGIN comments -->
<td valign="top" class="maintab_back">
<a href="{LASTCOM_TGT}" title="{LASTCOM_LNK}">{LASTCOM_LNK}</a>
</td>
<!-- END commenst -->
<!-- BEGIN top viewd -->
<td valign="top" class="maintab_back">
<a href="{TOPN_TGT}" title="{TOPN_LNK}">{TOPN_LNK}</a>
</td>
<!-- END top viewed -->




<!-- BEGIN rating -->
<td valign="top" class="maintab_back">
<a href="{TOPRATED_TGT}" title="{TOPRATED_LNK}">{TOPRATED_LNK}</a>
</td>
<!-- END rating -->
<!-- BEGIN favorites -->
<td valign="top" class="maintab_back">
<a href="{FAV_TGT}" title="{FAV_LNK}">{FAV_LNK}</a>
</td>
<!-- END favorites -->
<!-- BEGIN search -->
<td valign="top" class="maintab_back">
<a href="{SEARCH_TGT}" title="{SEARCH_LNK}">{SEARCH_LNK}</a>
</td>
<!-- END search-->
<td class="maintab_last">&nbsp;</td>
</tr>
</table>

EOT;

// HTML template for intermediate image display
$template_display_media = <<<EOT
        <tr>
                <td align="center" class="display_media" nowrap="nowrap">
                        <table cellspacing="2" cellpadding="0" class="imageborder">
                                <tr>
                                        <td align="center">
                                                {IMAGE}

                                        </td>
                                </tr>
                        </table>
                </td></tr>
                <tr><td>
                                                <table width="100%" cellspacing="2" cellpadding="0" class="tableb">
                                <tr>
                                        <td align="center">

                                                {ADMIN_MENU}
                                        </td>
                                </tr>
                        </table>





<!-- BEGIN img_desc -->
                        <table cellpadding="0" cellspacing="0" class="tableb" width="100%">
<!-- BEGIN title -->
                                <tr>
                                        <td class="tableb"><center><b>
                                                {TITLE}
                                        </b></center></td>
                                </tr>
<!-- END title -->
<!-- BEGIN caption -->
                                <tr>
                                        <td class="tableb"><center>
                                                {CAPTION}
                                        </center></td>
                                </tr>
<!-- END caption -->
                        </table>
<!-- END img_desc -->
                </td>
        </tr>

EOT;

?>
Paste your adsense code wherever you see fit, preferably into a new line after
Code: [Select]
                                                {CAPTION}
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 19 queries.