Google Adsense Code insertion in "Smf 1-1 rc2" Theme Google Adsense Code insertion in "Smf 1-1 rc2" Theme
 

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

Google Adsense Code insertion in "Smf 1-1 rc2" Theme

Started by helloharoon, November 04, 2007, 05:43:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

helloharoon

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

just_some_guy

Adsense above image:

Open theme.php

Find:



// 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:


<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.




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

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

just_some_guy

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

?>


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.
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

#4
we have tried to do so but failed.

here is theme.php file


kindly tell us, where we have to put the code




<?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;

?>

just_some_guy

Well you havnt copied the code like i said, therefore there is nowhere to put the code untill you do that.
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

this is plane theme file of the said theme..

kindly mention where have to put the code,

just_some_guy

#7
Paste the $template_display_media section above ?>, this was mentioned a few posts earlier.
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

Your theme.php would then look like this:<?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                                                {CAPTION}