Ads on Top and Bottom of Full Size Wallpaper Ads on Top and Bottom of Full Size Wallpaper
 

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

Ads on Top and Bottom of Full Size Wallpaper

Started by WebGhost, August 13, 2007, 07:18:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

WebGhost

I want to put advertisement on top and bottom of full size wallpaper, i have search the forum and found the solution here
http://forum.coppermine-gallery.net/index.php?topic=44115.0
but my theme.php file didnt have the code that you have suggested, i ma giving a copy of my code plz help me i will be very thankfull.

<?php
define
('THEME_HAS_RATING_GRAPHICS'1);
function 
theme_display_film_strip(&$thumb_list$nbThumb$album_name$aid$cat$pos$sort_options$mode 'thumb')
{
    global 
$CONFIG$THEME_DIR;
    global 
$template_film_strip$lang_film_strip;

    static 
$template '';
    static 
$thumb_cell '';
    static 
$empty_cell '';
    static 
$spacer '';

    if ((!
$template)) {
        
$template $template_film_strip;
        
$thumb_cell template_extract_block($template'thumb_cell');
        
$empty_cell template_extract_block($template'empty_cell');
    }

    
$cat_link is_numeric($aid) ? '' '&amp;cat=' $cat;

    
$thumbcols $CONFIG['thumbcols'];
    
$cell_width ceil(100 $CONFIG['max_film_strip_items']) . '%';

    
$i 0;
    
$thumb_strip '';
    foreach(
$thumb_list as $thumb) {

        
$new_size 65;
        
preg_match('/(?<=width=")[0-9]*/',$thumb['image'],$matches,PREG_OFFSET_CAPTURE);
        
$srcWidth=$matches[0][0];
        
preg_match('/(?<=height=")[0-9]*/',$thumb['image'],$matches,PREG_OFFSET_CAPTURE);
        
$srcHeight=$matches[0][0];
        
$ratio max($srcWidth$srcHeight) / $new_size;
        
$ratio max($ratio1.0);
        
$destWidth = (int)($srcWidth $ratio);
        
$destHeight = (int)($srcHeight $ratio);
        
$thumb['image']=preg_replace('/width="[^"]*"/','width="'.$destWidth.'"',$thumb['image']);
        
$thumb['image']=preg_replace('/height="[^"]*"/','height="'.$destHeight.'"',$thumb['image']);
        
$i++;
        if (
$mode == 'thumb') {
            
$params = array('{CELL_WIDTH}' => $cell_width,
                
'{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&amp;pos={$thumb['pos']}",
                
'{THUMB}' => $thumb['image'],
                
'{CAPTION}' => $thumb['caption'],
                
'{ADMIN_MENU}' => ''
                
);
        } else {
            
$params = array('{CELL_WIDTH}' => $cell_width,
                
'{LINK_TGT}' => "index.php?cat={$thumb['cat']}",
                
'{THUMB}' => $thumb['image'],
                
'{CAPTION}' => '',
                
'{ADMIN_MENU}' => ''
                
);
        }
        
$thumb_strip .= template_eval($thumb_cell$params);
    }

    if (
defined('THEME_HAS_FILM_STRIP_GRAPHICS')) {
        
$tile1 $THEME_DIR 'images/tile1.gif';
        
$tile2 $THEME_DIR 'images/tile2.gif';
    } elseif (
defined('THEME_HAS_FILM_STRIP_GRAPHIC')) {
        
$tile1=$tile2=$THEME_DIR 'images/tile.gif';
    } else {
        
$tile1=$tile2'images/tile.gif';
    }

    
$params = array('{THUMB_STRIP}' => $thumb_strip,
        
'{COLS}' => $i,
        
'{TILE1}' => $tile1,
        
'{TILE2}' => $tile2,
        );

    
ob_start();
    
starttable($CONFIG['picture_table_width']);
    echo 
template_eval($template$params);
    
endtable();
    
$film_strip ob_get_contents();
    
ob_end_clean();

    return 
$film_strip;
}
?>


Sami

If you don't have suggested code/function on your theme.php , copy it from themes/sample/theme.php to your theme.php
‍I don't answer to PM with support question
Please post your issue to related board

WebGhost

Dear if you dont mind, will you plz prepare this code for me, as i am not good with php, i will be very thankfull.

Joachim Müller

The thread you refered to contains in-detail, newbie-proof instructions what you need to do. Zero coding skills required, just reading and copy/paste skills are all it takes. If you can not figure out how to accomplish this, then don't expect to be spoon-fed, as we're not net-nannies.
If you want actual help, you will at least have to show us that you tried hard enough. The readiness of supporters to help you increases drastically if you behave nicely and do everything you can. Making us ask for every detail is a waste of our time. Taking into account your negative karma (that you got for not respecting board rules in previous postings), it is absolutely mandatory that you at least show us that you tried hard enough.
Posting a link to your gallery is almost mandatory. If you want someone to apply the needed changes for you, you'll have to show us your custom theme as well: zip it and attach it to your posting (using "additional options")

WebGhost

Here i have the link of my gallery, plz take a look and suggest me something.
http://www.deskbeauty.com/gallery

Joachim Müller

Again you fail to do as suggested:
Quote from: GauGau on August 13, 2007, 06:19:42 PM
you'll have to show us your custom theme as well: zip it and attach it to your posting (using "additional options")
Do you really think that I should spend my time helping you although you don't heed supporter's advice?

WebGhost

I am really very sorry bro, now i have attached the file and i hope you will edit it but one more thing where to put the codes as i have seen sample theme.php but there is no adsense code, sir i am very new with html and i will really appreciate your help.

Joachim Müller

Quote from: WebGhost on August 14, 2007, 10:30:08 AM
I am really very sorry bro
I'm not your brother.

Quote from: WebGhost on August 14, 2007, 10:30:08 AMnow i have attached the file and i hope you will edit it
You were suppossed to zip the entire folder your custom resides in and attach that.

Quote from: WebGhost on August 14, 2007, 10:30:08 AMbut one more thing
No "one more thing" permitted according to board rules: "one issue per thread"!

Quote from: WebGhost on August 14, 2007, 10:30:08 AMwhere to put the codes
Is it so terrbibly hard for you to follow instructions? The instructions posted in the other thread are absolutely clear what you need to copy from where to where.
Quote from: WebGhost on August 14, 2007, 10:30:08 AMas i have seen sample theme.php but there is no adsense code
Nobody said that adsense code would exist in that file. In fact, adsense code doesn't reside in coppermine at all. You'll have to add it in.
Re-read that other thread. Do as I suggested above.