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 40756 times)

0 Members and 1 Guest are viewing this topic.

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130

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

(http://www.allwheelphotos.com/albums/userpics/11043/thumb_DSC00132.JPG) (http://www.allwheelphotos.com/albums/userpics/11043/thumb_DSC00180.JPG) (http://www.allwheelphotos.com/albums/userpics/11043/thumb_DSC00187.JPG) (http://www.allwheelphotos.com/albums/userpics/11043/thumb_DSC00175.JPG) (http://www.allwheelphotos.com/albums/userpics/11043/thumb_DSC00174.JPG)
(http://www.allwheelphotos.com/albums/userpics/11043/thumb_DSC00149.JPG) (http://www.allwheelphotos.com/albums/userpics/11043/thumb_DSC00147.JPG) (http://www.allwheelphotos.com/albums/userpics/11043/thumb_DSC00143.JPG) (http://www.allwheelphotos.com/albums/userpics/11043/thumb_DSC00142.JPG) (http://www.allwheelphotos.com/albums/userpics/11043/thumb_DSC00133.JPG)

Here is a screenshot from what it looks like so far on my site (attached image)
« Last Edit: April 03, 2006, 07:44:13 am by GauGau »
Logged

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130

Completed please view post#1
« Last Edit: March 28, 2006, 01:27:45 am by AWJunkies »
Logged

theklub

  • Coppermine newbie
  • Offline Offline
  • Posts: 12

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
Logged

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130

Completed please view post#1
« Last Edit: March 28, 2006, 01:27:13 am by AWJunkies »
Logged

theklub

  • Coppermine newbie
  • Offline Offline
  • Posts: 12

you ever get this mode to work ? if so plz post the code
Logged

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130

MOD is done please add this to mod's section of the site.
« Last Edit: March 28, 2006, 01:26:30 am by AWJunkies »
Logged

Frazer

  • Coppermine newbie
  • Offline Offline
  • Posts: 7

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

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130

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.
Logged

theklub

  • Coppermine newbie
  • Offline Offline
  • Posts: 12

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

fovsports

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23

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.
Logged

fovsports

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23

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.
Logged

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130

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.
Logged

chowland

  • Coppermine newbie
  • Offline Offline
  • Posts: 4

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.
Logged

pszone

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22

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 = '';?
Logged

lukasino

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 31

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

 
Logged

Wookie

  • Coppermine newbie
  • Offline Offline
  • Posts: 7

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

Regards

Wookie
Logged

williamgates

  • Coppermine newbie
  • Offline Offline
  • Posts: 5


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

williamgates

  • Coppermine newbie
  • Offline Offline
  • Posts: 5


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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de

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

girgut

  • Coppermine newbie
  • Offline Offline
  • Posts: 2

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 ??? ???
Logged
Pages: [1] 2   Go Up
 

Page created in 0.031 seconds with 20 queries.