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: Mod Submission (Image Links)  (Read 15636 times)

0 Members and 1 Guest are viewing this topic.

orc_tamer

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Mod Submission (Image Links)
« on: June 15, 2007, 07:43:05 pm »

This is a simple mod that adds links to the images just like Photobucket, ImageShack, ect.

All you have to do is import themes.inc.php to the include folder. I works with every theme.

This mod was made by Orc_Tamer (e-mail orctamer@gmail.com) and Rinpun (e-mail/msn contact blakeh@datagrove.com)

Here is an example page http://orctamer.no-ip.org/hero/displayimage.php?album=1&pos=2


For any reason make sure to keep a backup file!
« Last Edit: June 25, 2007, 07:02:41 pm by GauGau »
Logged

orc_tamer

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Mod Submission (Image Links)
« Reply #1 on: June 15, 2007, 07:49:56 pm »

On line : 2121-2123

You must change http://orctamer.no-ip.org/hero/ to your coppermine extension of your site
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Mod Submission (Image Links)
« Reply #2 on: June 16, 2007, 10:06:11 pm »

For those who interested on this mod , there is a better way to this
instead of copy/over-wirte provided theme.inc.php on your theme.inc.php you could add this code to themes/your theme/theme.php
just before ?>
Code: [Select]
function theme_html_picture()
{
    global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $USER;
    global $album, $comment_date_fmt, $template_display_media;
    global $lang_display_image_php, $lang_picinfo;

    $pid = $CURRENT_PIC_DATA['pid'];
    $pic_title = '';

    if (!isset($USER['liv']) || !is_array($USER['liv'])) {
        $USER['liv'] = array();
    }
    // Add 1 to hit counter
    if (!USER_IS_ADMIN && !in_array($pid, $USER['liv']) && isset($_COOKIE[$CONFIG['cookie_name'] . '_data'])) {
        add_hit($pid);
        if (count($USER['liv']) > 4) array_shift($USER['liv']);
        array_push($USER['liv'], $pid);
    }

    if($CONFIG['thumb_use']=='ht' && $CURRENT_PIC_DATA['pheight'] > $CONFIG['picture_width'] ){ // The wierd comparision is because only picture_width is stored
      $condition = true;
    }elseif($CONFIG['thumb_use']=='wd' && $CURRENT_PIC_DATA['pwidth'] > $CONFIG['picture_width']){
      $condition = true;
    }elseif($CONFIG['thumb_use']=='any' && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']){
      $condition = true;
    }else{
     $condition = false;
    }

    if ($CURRENT_PIC_DATA['title'] != '') {
        $pic_title .= $CURRENT_PIC_DATA['title'] . "\n";
    }
    if ($CURRENT_PIC_DATA['caption'] != '') {
        $pic_title .= $CURRENT_PIC_DATA['caption'] . "\n";
    }
    if ($CURRENT_PIC_DATA['keywords'] != '') {
        $pic_title .= $lang_picinfo['Keywords'] . ": " . $CURRENT_PIC_DATA['keywords'];
    }

    if (!$CURRENT_PIC_DATA['title'] && !$CURRENT_PIC_DATA['caption']) {
        template_extract_block($template_display_media, 'img_desc');
    } else {
        if (!$CURRENT_PIC_DATA['title']) {
            template_extract_block($template_display_media, 'title');
        }
        if (!$CURRENT_PIC_DATA['caption']) {
            template_extract_block($template_display_media, 'caption');
        }
    }

    $CURRENT_PIC_DATA['menu'] = html_picture_menu(); //((USER_ADMIN_MODE && $CURRENT_ALBUM_DATA['category'] == FIRST_USER_CAT + USER_ID) || ($CONFIG['users_can_edit_pics'] && $CURRENT_PIC_DATA['owner_id'] == USER_ID && USER_ID != 0) || GALLERY_ADMIN_MODE) ? html_picture_menu($pid) : '';

    if ($CONFIG['make_intermediate'] && $condition ) {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'normal');
    } else {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
    }

    $image_size = compute_img_size($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight'], $CONFIG['picture_width']);

    $pic_title = '';
    $mime_content = cpg_get_type($CURRENT_PIC_DATA['filename']);


    if ($mime_content['content']=='movie' || $mime_content['content']=='audio') {

        if ($CURRENT_PIC_DATA['pwidth']==0 || $CURRENT_PIC_DATA['pheight']==0) {
            $CURRENT_PIC_DATA['pwidth']  = 320; // Default width

            // Set default height; if file is a movie
            if ($mime_content['content']=='movie') {
                $CURRENT_PIC_DATA['pheight'] = 240; // Default height
            }
        }

        $ctrl_offset['mov']=15;
        $ctrl_offset['wmv']=45;
        $ctrl_offset['swf']=0;
        $ctrl_offset['rm']=0;
        $ctrl_offset_default=45;
        $ctrl_height = (isset($ctrl_offset[$mime_content['extension']]))?($ctrl_offset[$mime_content['extension']]):$ctrl_offset_default;
        $image_size['whole']='width="'.$CURRENT_PIC_DATA['pwidth'].'" height="'.($CURRENT_PIC_DATA['pheight']+$ctrl_height).'"';
    }

    if ($mime_content['content']=='image') {
        if (isset($image_size['reduced'])) {
            $winsizeX = $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            $winsizeY = $CURRENT_PIC_DATA['pheight']+3; //the +'s are the mysterious FF and IE paddings
            $pic_html = "<a href=\"javascript:;\" onclick=\"MM_openBrWindow('displayimage.php?pid=$pid&amp;fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
            $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
          $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />
";
            $pic_html .= "</a>\n";
            /**************************************/
/* Begin Mod Submission (Image Links) */
            /**************************************/
//This is the modified section that mades the links for you
// Add you gallery URL instead of http://orctamer.no-ip.org/hero/ to this code
$pic_html .= "<table><tr><td>Image URL:</td><td><input type=\"text\" size=\"50\" readonly value=\"" . htmlentities("http://orctamer.no-ip.org/hero/" . get_pic_url($CURRENT_PIC_DATA, 'fullsize') . "",ENT_QUOTES) . "\" /></td></tr>";
$pic_html .= "<tr><td>HTML Link:</td><td><input type=\"text\" size=\"50\" readonly value=\"" . htmlentities("<img src=\"http://orctamer.no-ip.org/hero/" . get_pic_url($CURRENT_PIC_DATA, 'fullsize') . "\" />",ENT_QUOTES) . "\" /></td></tr>";
$pic_html .= "<tr><td>Forum Link:</td><td><input type=\"text\" size=\"50\" readonly value=\"" . htmlentities("[IMG]http://orctamer.no-ip.org/hero/" . get_pic_url($CURRENT_PIC_DATA, 'fullsize') . "[/IMG]",ENT_QUOTES) . "\" /></td></tr><tr><td></td><td>Mod made by Rinpun and Orc_Tamer</td></tr></table>";

            /**************************************/
/*  End Mod Submission (Image Links)  */
            /**************************************/

        } else {
            $pic_html = "<img src=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\" border=\"0\" alt=\"\" /><br />\n";
        }
    } elseif ($mime_content['content']=='document') {
        $pic_thumb_url = get_pic_url($CURRENT_PIC_DATA,'thumb');
        $pic_html = "<a href=\"{$picture_url}\" target=\"_blank\" class=\"document_link\"><img src=\"".$pic_thumb_url."\" border=\"0\" class=\"image\" /></a>\n<br />";
    } else {
        $autostart = ($CONFIG['media_autostart']) ? ('true'):('false');

        $players['WMP'] = array('id' => 'MediaPlayer',
                                'clsid' => 'classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ',
                                'codebase' => 'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112" ',
                                'mime' => 'type="application/x-mplayer2" ',
                               );
        $players['RMP'] = array('id' => 'RealPlayer',
                                'clsid' => 'classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" ',
                                'codebase' => '',
                                'mime' => 'type="audio/x-pn-realaudio-plugin" '
                               );
        $players['QT']  = array('id' => 'QuickTime',
                                'clsid' => 'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ',
                                'codebase' => 'codebase="http://www.apple.com/qtactivex/qtplugin.cab" ',
                                'mime' => 'type="video/x-quicktime" '
                               );
        $players['SWF'] = array('id' => 'SWFlash',
                                'clsid' => ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ',
                                'codebase' => 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ',
                                'mime' => 'type="application/x-shockwave-flash" '
                               );
        $players['UNK'] = array('id' => 'DefaultPlayer',
                                'clsid' => '',
                                'codebase' => '',
                                'mime' => ''
                               );

        if (isset($_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'])) {
            $user_player = $_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'];
        } else {
            $user_player = $mime_content['player'];
        }

                // There isn't a player selected or user wants client-side control
        if (!$user_player) {
            $user_player = 'UNK';
        }

        $player = $players[$user_player];

        $pic_html  = '<object id="'.$player['id'].'" '.$player['clsid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
        $pic_html .= "<param name=\"autostart\" value=\"$autostart\" /><param name=\"src\" value=\"". $picture_url . "\" />";
        $pic_html .= '<embed '.$image_size['whole'].' src="'. $picture_url . '" autostart="'.$autostart.'" '.$player['mime'].'></embed>';
        $pic_html .= "</object><br />\n";
    }

    $CURRENT_PIC_DATA['html'] = $pic_html;
    $CURRENT_PIC_DATA['header'] = '';
    $CURRENT_PIC_DATA['footer'] = '';

    $CURRENT_PIC_DATA = CPGPluginAPI::filter('file_data',$CURRENT_PIC_DATA);

    $params = array('{CELL_HEIGHT}' => '100',
        '{IMAGE}' => $CURRENT_PIC_DATA['header'].$CURRENT_PIC_DATA['html'].$CURRENT_PIC_DATA['footer'],
        '{ADMIN_MENU}' => $CURRENT_PIC_DATA['menu'],
        '{TITLE}' => bb_decode($CURRENT_PIC_DATA['title']),
        '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
        );

    return template_eval($template_display_media, $params);
}

- you should change http://orctamer.no-ip.org/hero/ with your gallery url

Thanks orc_tamer for Mod
« Last Edit: January 05, 2009, 09:46:39 am by Sami »
Logged
‍I don't answer to PM with support question
Please post your issue to related board

cruzer323

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Mod Submission (Image Links)
« Reply #3 on: December 30, 2008, 11:51:25 am »

I know this is an old topic, but I was wondering whether I could insert the above code into themes.inc.php, instead of over-writing the entire file.
Can I do this, and if so, where do I put it?
Logged

Nibbler

  • Guest
Re: Mod Submission (Image Links)
« Reply #4 on: December 30, 2008, 03:09:05 pm »

Read the post. The code goes into your custom theme.php
Logged

VaporDesigns

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
    • Vapor Designs
Re: Mod Submission (Image Links)
« Reply #5 on: January 07, 2009, 06:25:15 pm »

perfect....just what i was looking for  ;)
Logged

VaporDesigns

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
    • Vapor Designs
Re: Mod Submission (Image Links)
« Reply #6 on: January 08, 2009, 04:37:25 am »

This mod does not work? I added the edits to the Custom theme.php ....and changed the url's but it still does not work.

Link to gallery: http://Http://vapordesigns.info
Logged

Deus

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 152
    • DJ-Daz
Re: Mod Submission (Image Links)
« Reply #7 on: January 08, 2009, 11:59:54 am »

I've just tried this, and it does'nt work for me either.
I tried to edit the theme.php and replace theme.inc.php
I can't link to the test gallery as it is my localhost.

Logged
https://dj-daz.com
DJ tutorials

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4822
    • Windsurf.me
Re: Mod Submission (Image Links)
« Reply #8 on: January 08, 2009, 12:24:34 pm »

It is about a year old so probably hasn't been tested for 1.4.19.

Maybe this plugin would suit.


http://forum.coppermine-gallery.net/index.php/topic,36302.0.html
Logged
It is a mistake to think you can solve any major problems just with potatoes.

Deus

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 152
    • DJ-Daz
Re: Mod Submission (Image Links)
« Reply #9 on: January 08, 2009, 05:19:35 pm »

Thank you Phill, just what I needed.
Logged
https://dj-daz.com
DJ tutorials

VaporDesigns

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
    • Vapor Designs
Re: Mod Submission (Image Links)
« Reply #10 on: January 10, 2009, 12:33:42 am »

It is about a year old so probably hasn't been tested for 1.4.19.

Maybe this plugin would suit.


http://forum.coppermine-gallery.net/index.php/topic,36302.0.html

thx
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 21 queries.