full albums pictures as bbcode thumbnails with link to normal or orginal picture - Page 2 full albums pictures as bbcode thumbnails with link to normal or orginal picture - Page 2
 

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

Main Menu

full albums pictures as bbcode thumbnails with link to normal or orginal picture

Started by AWJunkies, January 31, 2006, 02:49:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

girgut

Quote from: williamgates on February 10, 2008, 09:42:31 AM
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:
        $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:
       $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



ewper

Great mod,

but when i install i get to  see

{ALB_URL_LINKS}

in sted of the links

what am i doing wrong?

thanks

kylemj

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