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 [2]   Go Down

Author Topic: full albums pictures as bbcode thumbnails with link to normal or orginal picture  (Read 40749 times)

0 Members and 1 Guest are viewing this topic.

girgut

  • Coppermine newbie
  • Offline Offline
  • Posts: 2

Thanks for the good job. I changed some of those codes and found a (maybe) better way.
I want to show all the urls with normal size link, if there is not a normal file, shows the fullsize picture. It is quite useful when you want to show some photos in a forum.

You can change this piece of code:
Code: [Select]
        $my_gallery_id = FIRST_USER_CAT + USER_ID;
        if ((GALLERY_ADMIN_MODE) || ($my_gallery_id == $cat)) {
                $sql = "SELECT filepath, filename " .
            " FROM {$CONFIG['TABLE_PICTURES']} " .
            " WHERE aid = $aid";

    $pics_q = cpg_db_query($sql);
    $pics = cpg_db_fetch_rowset($pics_q);
    mysql_free_result($pics_q);

foreach ( $pics as $pict) {
$album_url_final .= "[url=$CONFIG[ecards_more_pic_target]albums/$pict[filepath]$pict[filename]][img]$CONFIG[ecards_more_pic_target]albums/$pict[filepath]thumb_$pict[filename][/img][/url] ";
      }
      }

with mine new one:
Code: [Select]
       $my_gallery_id = FIRST_USER_CAT + USER_ID;
        if ((GALLERY_ADMIN_MODE) || ($my_gallery_id == $cat)) {
                $sql = "SELECT filepath, filename, pheight, pwidth" .
            " FROM {$CONFIG['TABLE_PICTURES']} " .
            " WHERE aid = $aid";

    $pics_q = cpg_db_query($sql);
    $pics = cpg_db_fetch_rowset($pics_q);
    mysql_free_result($pics_q);

foreach ($pics as $pict) {

$fullurl = "{$CONFIG['ecards_more_pic_target']}albums/".get_pic_url($pict, 'fullsize');
$normalurl = "{$CONFIG['ecards_more_pic_target']}albums/".get_pic_url($pict, 'normal');
$urlarray = array($fullurl,$normalurl);
$condition = true;

    if($CONFIG['thumb_use']=='ht' && $pict['pheight'] > $CONFIG['picture_width'] ){
      $condition = true;
    }elseif($CONFIG['thumb_use']=='wd' && $pict['pwidth'] > $CONFIG['picture_width']){
      $condition = true;
    }elseif($CONFIG['thumb_use']=='any' && max($pict['pwidth'], $pict['pheight']) > $CONFIG['picture_width']){
      $condition = true;
    }else{
      $condition = false;
    }

if ($CONFIG['make_intermediate'] && $condition) {
$album_url_final .= nl2br("[url=$urlarray[0]][img]$urlarray[1][/img][/url] \n");
} else {
$album_url_final .= nl2br("[url=$urlarray[0]][img]$urlarray[0][/img][/url] \n");
    }
      }

It does:
1. Compare the $CONFIG['picture_width'] with the pictures's size, and decide if there is a normal-size file or not.
2. If there is a normal-size file, show the url, otherwise show the full-size file' url. (you can change this as you need)
3. add a "\n" code every line of the url list, and put php to prase it into "<br />". (you can change this either)

It works at my CPG, but use it at your risk.
To say it again, my english is so poor :(


as per ur modification it showing complete error

Logged

lestat_ti

  • Coppermine newbie
  • Offline Offline
  • Posts: 1

Hi!
I want that BB codes don't send to Direct link images and go to the image page on album!

Anyone know how do this?

Maybe in this line

                 $album_url_final .= "albums/$pict[filepath]$pict[filename]](http://$CONFIG[ecards_more_pic_target]albums/$pict[filepath]thumb_$pict[filename]) ";

???????
Logged

ewper

  • Coppermine newbie
  • Offline Offline
  • Posts: 1

Great mod,

but when i install i get to  see

{ALB_URL_LINKS}

in sted of the links

what am i doing wrong?

thanks
Logged

kylemj

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25

Want that BB codes don't send to Direct link images and go to the image page on album or full size page
 if we have more than one album in a catogory then it is showing the first albums codes in all the other albums

I have been looking for updated one but can't find anything and end up coming back to this thread any fixes/improvements
Logged
Pages: 1 [2]   Go Up
 

Page created in 0.021 seconds with 20 queries.