Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: 1 [2]   Go Down

Author Topic: full albums pictures as bbcode thumbnails with link to normal or orginal picture  (Read 40822 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]](https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2F%24CONFIG%5Becards_more_pic_target%5Dalbums%2F%24pict%5Bfilepath%5Dthumb_%24pict%5Bfilename%5D&hash=ca8e02c0919617e60a45beb4191e054c766ad6e9) ";

???????
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.019 seconds with 20 queries.