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

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.

AWJunkies

##############################################################
## 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:
function list_albums()
Find within function:
$count = $alb_stat['pic_count'];
After ADD:
        $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:
            $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:
        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:
function theme_display_album_list(&$alb_list, $nbAlb, $cat, $page, $total_pages)

Find within function:
'{ALB_DESC}' => $album['album_desc'],
After ADD:
'{ALB_URL_LINKS}' => $album['album_url'],
Find:
<!-- BEGIN album_cell -->
Find within tpl function:
{ALB_INFOS}
After that line ADD:
{ALB_URL_LINKS}
Find:<!-- BEGIN c_album_cell -->
Find within tpl function:
{ALB_INFOS}
After that line ADD:
{ALB_URL_LINKS}


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

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.allwheelphotos.com%2Falbums%2Fuserpics%2F11043%2Fthumb_DSC00132.JPG&hash=8af949b46eaad347f74d05db01684be24765e86b) (https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.allwheelphotos.com%2Falbums%2Fuserpics%2F11043%2Fthumb_DSC00180.JPG&hash=2f2df3613f85106552c49b78e1d877f7fb15e518) (https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.allwheelphotos.com%2Falbums%2Fuserpics%2F11043%2Fthumb_DSC00187.JPG&hash=5198e76aa778b9a4259e3149c34f2b74211cada8) (https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.allwheelphotos.com%2Falbums%2Fuserpics%2F11043%2Fthumb_DSC00175.JPG&hash=1eb00e317539b173d5a2d234584d78b3ad0d3202) (https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.allwheelphotos.com%2Falbums%2Fuserpics%2F11043%2Fthumb_DSC00174.JPG&hash=c8a78f348488931c8b74f9624b29ac1378cff535)
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.allwheelphotos.com%2Falbums%2Fuserpics%2F11043%2Fthumb_DSC00149.JPG&hash=4097bb7a24a4ce18b35177caa128033536c25d20) (https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.allwheelphotos.com%2Falbums%2Fuserpics%2F11043%2Fthumb_DSC00147.JPG&hash=e844261400bc304598714c3089fa8e16e1b450e7) (https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.allwheelphotos.com%2Falbums%2Fuserpics%2F11043%2Fthumb_DSC00143.JPG&hash=a38744339d354dc2ddbef8f1fbe8d8b0ca60ce9b) (https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.allwheelphotos.com%2Falbums%2Fuserpics%2F11043%2Fthumb_DSC00142.JPG&hash=e495c00734406f104bcde0f127f7b390f51af10f) (https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.allwheelphotos.com%2Falbums%2Fuserpics%2F11043%2Fthumb_DSC00133.JPG&hash=f6698458689cf0568d1d8e2a7ee88b3e4918ae3f)

Here is a screenshot from what it looks like so far on my site (attached image)

AWJunkies

Completed please view post#1

theklub

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

AWJunkies

Completed please view post#1

theklub


AWJunkies

MOD is done please add this to mod's section of the site.

Frazer

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  :)

AWJunkies

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.

theklub

is there a way to get this link into the normal gallery instead of to the picture alone?

fovsports

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.

fovsports

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.

AWJunkies

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.

chowland

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.

pszone

Everything works fine exept:

Quote from: 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  :)


Where exactly I need to put this $album_url_final = '';?

lukasino

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


Wookie

Could this be made to work on Meta albums too?If so, how would I go about setting it up?

Regards

Wookie

williamgates


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 :(

williamgates


Is here can't edit my own reply?
I found some error, but fortunately there are not in the code ;)

Joachim Müller

Editing your posts has been disabled due to abuse in the past. Just reply to this thread with your clarification.

girgut

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 ??? ???