Advanced search  

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]

Pages: [1]   Go Down

Author Topic: [Solved]: I've tried so hard - Google text links on fullsize popup :(  (Read 5474 times)

0 Members and 1 Guest are viewing this topic.

eyez69

  • Coppermine newbie
  • Offline Offline
  • Posts: 6

Hi All,

I have gone blind staring and editing code to get a single line of text links under the image on the fullsize popup at my website gallery http://www.beer-thai.com

This is my theme.php

Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copycenter (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$
**********************************************/

// ------------------------------------------------------------------------- //
// This theme has all CORE items removed                                     //
// ------------------------------------------------------------------------- //
// define('THEME_IS_XHTML10_TRANSITIONAL',1);

// Added to display flim_strip
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) {
        
//modify $new_size for max dimension of thumbnails in filmstrip
        
$new_size 80;
        
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;
}

// HTML template for the category list
$template_cat_list = <<<EOT
<!-- BEGIN header -->
        <tr>
                <td class="tableh1" width="80%" align="center"><b>{CATEGORY}</b></td>
                <td class="tableh1" width="10%" align="center"><b>{ALBUMS}</b></td>
                <td class="tableh1" width="10%" align="center"><b>{PICTURES}</b></td>
        </tr>
<!-- END header -->
<!-- BEGIN catrow_noalb -->
        <tr>
                <td class="catrow_noalb" colspan="3"><table border="0"><tr><td align="center" valign="middle"><img src="themes/fiblue3d/images/folder.gif" border="0" width="25" height="25" alt="" align="center" />{CAT_THUMB}</td><td align="center"><span class="catlink"><b>{CAT_TITLE}</b></span>{CAT_DESC}</td></tr></table></td>
        </tr>
<!-- END catrow_noalb -->
<!-- BEGIN catrow -->
        <tr>
                <td class="catrow" align="center"><table border="0"><tr><td valign="middle"><img src="themes/fiblue3d/images/folder.gif" border="0" width="25" height="25" alt="" align="center" />{CAT_THUMB}</td><td><span class="catlink"><b>{CAT_TITLE}</b></span>{CAT_DESC}</td></tr></table></td>
                <td class="catrow" align="center">{ALB_COUNT}</td>
                <td class="catrow" align="center">{PIC_COUNT}</td>
        </tr>
        <tr>
            <td class="tableb" colspan="3">{CAT_ALBUMS}</td>
        </tr>
<!-- END catrow -->
<!-- BEGIN footer -->
        <tr>
                <td colspan="3" class="tableh1" align="center"><span class="statlink"><b>{STATISTICS}</b></span></td>
        </tr>
<!-- END footer -->
<!-- BEGIN spacer -->
        <img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END spacer -->

EOT;


?>


I know that I shouldn't ask, but can someone edit this for me and repost before I go mad (madder)

thanx

beer-thai
« Last Edit: June 23, 2008, 09:59:27 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: I've tried so hard - Google text links on fullsize popup :(
« Reply #1 on: June 16, 2008, 01:54:39 pm »

Just add this

Code: [Select]
// Display the full size image
function theme_display_fullsize_pic()
{
    global $CONFIG, $THEME_DIR, $ALBUM_SET;
    global $lang_errors, $lang_fullsize_popup, $lang_charset;

    if (isset($_GET['picfile']))
    {
        if (!GALLERY_ADMIN_MODE) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);

    $picfile = $_GET['picfile'];
    $picname = $CONFIG['fullpath'] . $picfile;
    $imagesize = @getimagesize($picname);
    $imagedata = array('name' => $picfile, 'path' => path2url($picname), 'geometry' => $imagesize[3]);
    }
    elseif (isset($_GET['pid']))
    {
    $pid = (int)$_GET['pid'];
    $sql = "SELECT * " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE pid='$pid' $ALBUM_SET";
    $result = cpg_db_query($sql);

    if (!mysql_num_rows($result)) cpg_die(ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);

    $row = mysql_fetch_array($result);
    $pic_url = get_pic_url($row, 'fullsize');
    $geom = 'width="' . $row['pwidth'] . '" height="' . $row['pheight'] . '"';
    $imagedata = array('name' => $row['filename'], 'path' => $pic_url, 'geometry' => $geom);
    }

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=<?php echo $CONFIG['charset'] == 'language file' $lang_charset $CONFIG['charset'?>" />
  <title><?php echo $CONFIG['gallery_name'?>: <?php echo $lang_fullsize_popup['click_to_close'];
      
?>
</title>
  <script type="text/javascript" src="scripts.js"></script>
  <style type="text/css">
  body { margin: 0; padding: 0; background-color: gray; }
  img { margin:0; padding:0; border:0; }
  #content { margin:0 auto; padding:0; border:0; }
  table { border:0; height:100%; width:100%; border-collapse:collapse}
  td {         vertical-align: middle; text-align:center; }
  </style>
  </head>
  <body>
    <script language="JavaScript" type="text/JavaScript">
      adjust_popup();
    </script>
    <table>
      <tr>
            <td>
          <div id="content">
              <?php     echo  '<a href="javascript: window.close()"><img src="'
                
htmlspecialchars($imagedata['path']) . '" '
                
$imagedata['geometry']
                . 
'alt="'
                
htmlspecialchars($imagedata['name'])
                . 
'" title="'
                
htmlspecialchars($imagedata['name'])
                . 
"\n" $lang_fullsize_popup['click_to_close']
                . 
'" /></a><br />' ."\n";
               
?>

              <p>Links here</p>
          </div>
        </td>
      </tr>
    </table>
  </body>
</html>
<?php
}
Logged

eyez69

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: I've tried so hard - Google text links on fullsize popup :(
« Reply #2 on: June 16, 2008, 05:39:28 pm »

Still not having luck with this, I have that code everywhere I can think of but nothing changes on the full size popup, I have also tried changing the permissions on theme.php.

This is the code that I want under the full size image.

Code: [Select]
<script type="text/javascript"><!--
google_ad_client = "pub-0269717150018777";
/* 728x15, created 6/16/08 */
google_ad_slot = "8870363323";
google_ad_width = 728;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

Maybe I should just stick to posing in front of the camera and leave this stuff to the profs. because my head hurts now  ??? :o


Logged

eyez69

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: I've tried so hard - Google text links on fullsize popup :(
« Reply #3 on: June 21, 2008, 11:59:42 am »

So, anybody can tell me where I am going wrong? Please :)
Logged

Nibbler

  • Guest
Re: I've tried so hard - Google text links on fullsize popup :(
« Reply #4 on: June 21, 2008, 01:01:08 pm »

Don't put the code 'everywhere you can think of' - put it in the right place and nowhere else. The code needs to go into your custom theme.php, which seems to be themes/fiblack3dblue/theme.php.
Logged

steveeh131047

  • Supporter
  • Coppermine frequent poster
  • ****
  • Offline Offline
  • Posts: 217
Re: I've tried so hard - Google text links on fullsize popup :(
« Reply #5 on: June 21, 2008, 01:48:51 pm »

eyez69,

I just tried out Nibbler's code with your GoogleAd insert and it works fine.

Copy Nibbler's code into themes/yourtheme/theme.php. Then insert your script into Nibbler's code, immediately after his Javascript dleclaration in the HTML <head> like this:

Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=<?php echo $CONFIG['charset'] == 'language file' $lang_charset $CONFIG['charset'?>" />
  <title><?php echo $CONFIG['gallery_name'?>: <?php echo $lang_fullsize_popup['click_to_close'];
      
?>
</title>
  <script type="text/javascript" src="scripts.js"></script>

<script type="text/javascript"><!--
google_ad_client = "pub-0269717150018777";
/* 728x15, created 6/16/08 */
google_ad_slot = "8870363323";
google_ad_width = 728;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


  <style type="text/css">
  body { margin: 0; padding: 0; background-color: gray; }
  img { margin:0; padding:0; border:0; }
  #content { margin:0 auto; padding:0; border:0; }
  table { border:0; height:100%; width:100%; border-collapse:collapse}
  td {         vertical-align: middle; text-align:center; }
  </style>

Good luck,
Steve
Logged

steveeh131047

  • Supporter
  • Coppermine frequent poster
  • ****
  • Offline Offline
  • Posts: 217
Re: I've tried so hard - Google text links on fullsize popup :(
« Reply #6 on: June 21, 2008, 02:09:25 pm »

eyez69,

I think I got that wrong  :(  - too busy watching the Formula 1 qualifying from the French Grand Prix.  Just insert your script into Nibbler's code where it says "Links here".

When the large image pops up you may just need to scroll the window to see the ads at the bottom.
Logged

eyez69

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: I've tried so hard - Google text links on fullsize popup :(
« Reply #7 on: June 23, 2008, 07:36:32 pm »

Thx for all your help, this topic I hope can help others and can now be considered solved :)
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.