forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Miscellaneous => Topic started by: AWJunkies on January 31, 2006, 02:49:13 pm

Title: full albums pictures as bbcode thumbnails with link to normal or orginal picture
Post by: AWJunkies on January 31, 2006, 02:49:13 pm
##############################################################
## MOD Title: Full album pictures BBcode
## MOD Author: AWJunkies < aellis@awjunkies.com >
## MOD Description: To output a bbcode for all pictures within an album to display them on a thread in a BB.
## MOD Version: 1.0.0
## Installation Level: Intermediate
## Installation Time: 5 Minutes
## Files To Edit: index.php, themes.inc.php
## Included Files: (n/a)
##############################################################
##############################################################
## Author Notes: Delete the [] squares that are in the below text. They are not suposed to be there.
##############################################################
## MOD History:
##   2006-03-27 - Version 1.0.0
##      - Initial release
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

index.php

FIND:
Code: [Select]
function list_albums()Find within function:
Code: [Select]
$count = $alb_stat['pic_count'];After ADD:
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] ";
      }
      }

Find still within same function:
Code: [Select]
            $alb_list[$alb_idx]['album_adm_menu'] = (GALLERY_ADMIN_MODE || (USER_ADMIN_MODE && $cat == USER_ID + FIRST_USER_CAT)) ? html_albummenu($alb_thumb['aid']) : ' ';
After ADD:
Code: [Select]
        if ((GALLERY_ADMIN_MODE) || ($my_gallery_id == $cat)) {
            $alb_list[$alb_idx]['album_url'] = "<textarea type=text name=text rows=2 cols=20>$album_url_final</textarea>";
        }

include/themes.inc.php

Find:
Code: [Select]
function theme_display_album_list(&$alb_list, $nbAlb, $cat, $page, $total_pages)
Find within function:
Code: [Select]
'{ALB_DESC}' => $album['album_desc'],After ADD:
Code: [Select]
'{ALB_URL_LINKS}' => $album['album_url'],Find:
Code: [Select]
<!-- BEGIN album_cell -->Find within tpl function:
Code: [Select]
{ALB_INFOS}After that line ADD:
Code: [Select]
{ALB_URL_LINKS}Find:
Code: [Select]
<!-- BEGIN c_album_cell -->Find within tpl function:
Code: [Select]
{ALB_INFOS}After that line ADD:
Code: [Select]
{ALB_URL_LINKS}

This is what it looks like when copied and pasted into the bbforum:

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.allwheelphotos.com%2Falbums%2Fuserpics%2F11043%2Fthumb_DSC00132.JPG&hash=8af949b46eaad347f74d05db01684be24765e86b) (http://www.allwheelphotos.com/albums/userpics/11043/DSC00132.JPG) (https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.allwheelphotos.com%2Falbums%2Fuserpics%2F11043%2Fthumb_DSC00180.JPG&hash=2f2df3613f85106552c49b78e1d877f7fb15e518) (http://www.allwheelphotos.com/albums/userpics/11043/DSC00180.JPG) (https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.allwheelphotos.com%2Falbums%2Fuserpics%2F11043%2Fthumb_DSC00187.JPG&hash=5198e76aa778b9a4259e3149c34f2b74211cada8) (http://www.allwheelphotos.com/albums/userpics/11043/DSC00187.JPG) (https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.allwheelphotos.com%2Falbums%2Fuserpics%2F11043%2Fthumb_DSC00175.JPG&hash=1eb00e317539b173d5a2d234584d78b3ad0d3202) (http://www.allwheelphotos.com/albums/userpics/11043/DSC00175.JPG) (https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.allwheelphotos.com%2Falbums%2Fuserpics%2F11043%2Fthumb_DSC00174.JPG&hash=c8a78f348488931c8b74f9624b29ac1378cff535) (http://www.allwheelphotos.com/albums/userpics/11043/DSC00174.JPG)
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.allwheelphotos.com%2Falbums%2Fuserpics%2F11043%2Fthumb_DSC00149.JPG&hash=4097bb7a24a4ce18b35177caa128033536c25d20) (http://www.allwheelphotos.com/albums/userpics/11043/DSC00149.JPG) (https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.allwheelphotos.com%2Falbums%2Fuserpics%2F11043%2Fthumb_DSC00147.JPG&hash=e844261400bc304598714c3089fa8e16e1b450e7) (http://www.allwheelphotos.com/albums/userpics/11043/DSC00147.JPG) (https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.allwheelphotos.com%2Falbums%2Fuserpics%2F11043%2Fthumb_DSC00143.JPG&hash=a38744339d354dc2ddbef8f1fbe8d8b0ca60ce9b) (http://www.allwheelphotos.com/albums/userpics/11043/DSC00143.JPG) (https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.allwheelphotos.com%2Falbums%2Fuserpics%2F11043%2Fthumb_DSC00142.JPG&hash=e495c00734406f104bcde0f127f7b390f51af10f) (http://www.allwheelphotos.com/albums/userpics/11043/DSC00142.JPG) (https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.allwheelphotos.com%2Falbums%2Fuserpics%2F11043%2Fthumb_DSC00133.JPG&hash=f6698458689cf0568d1d8e2a7ee88b3e4918ae3f) (http://www.allwheelphotos.com/albums/userpics/11043/DSC00133.JPG)

Here is a screenshot from what it looks like so far on my site (attached image)
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal picture
Post by: AWJunkies on February 02, 2006, 04:16:24 am
Completed please view post#1
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal pic
Post by: theklub on February 15, 2006, 10:30:03 pm
what file did u edit and where did u put that code i want to get that to display on my site man if u could tell me that'd be freakin awesome
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal picture
Post by: AWJunkies on February 16, 2006, 01:13:42 am
Completed please view post#1
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal pic
Post by: theklub on March 05, 2006, 06:59:21 pm
you ever get this mode to work ? if so plz post the code
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal picture
Post by: AWJunkies on March 21, 2006, 08:25:24 pm
MOD is done please add this to mod's section of the site.
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal picture
Post by: Frazer on April 02, 2006, 12:47:24 am
Hi and thanks for the code, it's implemented on our gallery. We noticed that if you select the second album, bbcode is given for all the images from the first album too. Adding $album_url_final = ''; at the top of your first block fixes this - please let me know if this is incorrect  :)
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal picture
Post by: AWJunkies on April 05, 2006, 10:01:06 pm
Yes you have to put that. I forgot to put that in the edits so I will add it thanks. Did the edit code in like 5 minutes really quickly and always miss small things.
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal pic
Post by: theklub on May 21, 2006, 05:05:12 am
is there a way to get this link into the normal gallery instead of to the picture alone?
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal pic
Post by: fovsports on July 02, 2006, 05:59:13 pm
I would like to implement this into the site I'm building. Tried the above coding, but no luck. Getting errors. I believe it is my injection of the mod into the code locations. which [] are we suppose to delete, and exactly where input the code is a little confusing.
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal pic
Post by: fovsports on July 05, 2006, 06:42:58 pm
Has anybody got this cool mod to work. I would really like to get this one to work. I have tried the TAGBLITZ plugin with nothing but problems with cookies not being read after installing that plugin.
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal pic
Post by: AWJunkies on December 08, 2006, 08:41:15 am
I am back let me know if you need help installing this mod it works perfect for past year+. I will go over the code and make sure it checks out ok and double check it.
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal picture
Post by: chowland on August 17, 2007, 02:26:41 pm
Hi,
Just a quick question, as I was curious if it's illegal to post the changed files rather than explain which lines to change.
I realize that others make modifications to their index.php and ect, but for people like me with pretty much a generic install and a couple of mods, it might  be easier to post the changed files.
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal pic
Post by: pszone on October 27, 2007, 11:40:45 am
Everything works fine exept:

Hi and thanks for the code, it's implemented on our gallery. We noticed that if you select the second album, bbcode is given for all the images from the first album too. Adding $album_url_final = ''; at the top of your first block fixes this - please let me know if this is incorrect  :)


Where exactly I need to put this $album_url_final = '';?
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal pic
Post by: lukasino on October 27, 2007, 10:08:28 pm
Hello,

I need to generate batch Code for all images in albums to forum (with thumbnails) 5,10,15 images is no problem but a i have 400 wallpapers in albums and i need this code :) (copy and paste 400 code i's terrible)

please help

 
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal picture
Post by: Wookie on October 30, 2007, 06:47:53 pm
Could this be made to work on Meta albums too?If so, how would I go about setting it up?

Regards

Wookie
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal pic
Post by: 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:
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 :(
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal pic
Post by: williamgates on February 10, 2008, 09:46:59 am

Is here can't edit my own reply?
I found some error, but fortunately there are not in the code ;)
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal pic
Post by: Joachim Müller on February 10, 2008, 10:10:38 am
Editing your posts has been disabled due to abuse in the past. Just reply to this thread with your clarification.
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal pic
Post by: girgut on May 25, 2008, 12:37:02 am
It is an execlent Mod
BUT
i think there is a problem with the MOD

cos
i have installed the Mod in my site

there is a problem

that if we have more than one album in a catogory then it is showing the first albums codes in all the other albums

or is it this way that we have to put a single catogory for each album

i think u(author) wer also having the same problem
cos in the image u wer showing in the first post it is also showing the same way

check it out ??? ???
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal pic
Post by: girgut on May 25, 2008, 12:41:25 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:
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

Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal picture
Post by: lestat_ti on June 10, 2008, 07:14:19 pm
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) (http://$CONFIG[ecards_more_pic_target) ";

???????
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal picture
Post by: ewper on December 01, 2008, 09:37:36 am
Great mod,

but when i install i get to  see

{ALB_URL_LINKS}

in sted of the links

what am i doing wrong?

thanks
Title: Re: full albums pictures as bbcode thumbnails with link to normal or orginal picture
Post by: kylemj on August 23, 2010, 12:05:46 am
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