{GALLERYX: ......} V1.2.1 -> (galleryx_call_v121.php)

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.

{GALLERYX: ......} V1.2.1 -> (galleryx_call_v121.php)

Postby flip-flop on Fri Jan 09, 2009 16:23

An enhanced version of galleryx.php. :!: ..... -> V1.2 (viewtopic.php?f=8&t=17970)

Update No.2 -> V1.2.1 (17.01.08)!!

I think that is the last version before everyone writes an module part (e.g. galleryx tag generator). All parameters prepared for doing such a issue.
Thanks to "claus" who had talked about and tested many many hours. :!:

What is new:
1. Switch for list title & date - detail title & date [on|off]
2. Prioritization of copyright - 1. DB, 2. RT, 3. file galleryx and [on|off]
3. Switch for copyright - off, at caption, at SLimbox, all
4. Switch for caption - off, at caption, at SLimbox, all, some prefix/suffix variables created
5. Splitting in different files:

User editable files:
PHP: /template/inc_script/galeryx/galleryx_main_v121.inc.php (parameter set: User edit file)
CSS: /template/inc_css/specific/galleryx.css (css for the output)
Templ.: /template/inc_cntpart/filelist/galleryx.html (Download template)
Non editable files:
PHP: /template/inc_script/galeryx/galleryx_main_v121.doc.php (little doc)
PHP: /template/inc_script/frontend_render/galleryx_call_v121.php (init file in frontend_render)
PHP: /template/inc_script/galeryx/galleryx_main_v121.php (main function)
PHP: /include/inc_lib/imagegalleryx121.inc.php (basic functions)

6. User wants to edit only the file /template/inc_script/galeryx/galleryx_main_v121.inc.php
It isn´t necessary any more to comment out the corresponding variables in "SHORT DEFINATION" (like in v1.1).

7. V1.2.1
7.1 Caption fallback text if there is no one in db
7.2 No longer report of the crappy thumb title text during hover. (The whole capture text with all formated tags has been reported :twisted: ).
Title-text for hover and alt-text for thumb images set with a tag in capture or with a parameter or autom. filename.
7.3 LightBox (SLimbox) capture better editable. The same output like the normal capture. You don´t need e.g. a [BR] tag for linebreak. Paragraph autom. created behind 2 x linefeed.


Description:
Basic tag: {GALLERYX: galleryRoot_ID[int], subgallery_ID[int], subsubgallery_ID[int]}
Put it into a CP (preferentially HTML or simple text).

{GALLERYX:.......} is a RT for large galleries with sub galleries. This tag uses the informations from the file center only.
Some parameters (~20) you can switch in the file galleryx.php directly. There is an defination area. (Or in list of parameters in your tag).

- Standardise parameter name
- Gallery list.
- Sub gallery with info text [on/off].
- Sub Sub gallery (detail) (where you find the images) with caption and copyright text [on/off].
- Show description from Sub gallery (list) in Sub Sub gallery (detail) [on/off].

- Copyright output using a hierarchical struct - 1. DB, 2. RT, 3. file galleryx and [on|off]
- Copyright switch off, at caption, at SLimbox, all
- Define an over all copyright text instead of file center copyright. (killed)

- Sorting mode [NAME-ASC / NAME_DESC] for the images in Sub Sub gallery (detail).

- Half automatic thumb width/height reduce if image count > X
- Direct output of a Sub Sub gallery by a given ID, a subgallery_ID[int] must be set to use this enhancement.
- Your own "go back" text.
- Your own css file and download template.
- You can build your own special tag very easy.

- Three mode display option:
-- gallery list, sub gallery (list) and sub sub gallery (detail)
-- sub gallery (list) and sub sub gallery (detail)
-- only the sub sub gallery (detail) like foxconncebit

-----------------------------------------------------------------------------------------------
Please disable the original /tempate/inc_script/frontend_render/gallery.php (e.g. rename to gallery.php_)

--------------------------------------
Download v1.0.0: DOWNLOAD (zip)
Download v1.1.0: DOWNLOAD (zip)
Download v1.2.0: DOWNLOAD (zip)
Download v1.2.1: DOWNLOAD (zip) recommended !
--------------------------------------

[EN] file center:
--------------------------------------
Image

[EN] Frontend output example:
--------------------------------------
Image

[EN] Frontend/Backend capture edit:
--------------------------------------
Image



[DE] Dateizentrale:
--------------------------------------
Image

[DE] Frontend-Ausgabebeispiel (erweitert):
----------------------------------------------------
Image


[DE] Frontend/Backend capture editieren:
--------------------------------------
Image


The own tag and how can I create one:
-----------------------------------------------------------------------------------------------
Basic tag: {GALLERYX: galleryRoot_ID[int], subgallery_ID[int], subsubgallery_ID[int]}
Code: Select all
===========================================================================================
Input parameter (handing over)
===========================================================================================
$parameter              = explode(',', trimhtml($parameter));
$my_gallery_rootid      = empty($parameter[0]) ? 0  : intval($parameter[0]);
$my_gallery_subid       = empty($parameter[1]) ? 0  : intval($parameter[1]);
$my_gallery_sub_subid   = empty($parameter[2]) ? 0  : intval($parameter[2]);

// Some examples how a new parameter in your tag could be look like.   
// $my_detail_title_date_on       = empty($parameter[3]) ? 3  : intval($parameter[3]);
// $my_detail_zoom                 = empty($parameter[4]) ? 0  : intval($parameter[4]);
// $my_detail_lightbox            = empty($parameter[5]) ? 0  : intval($parameter[5]);
// $my_detail_thumb_count_to_min  = empty($parameter[6]) ? 0  : intval($parameter[6]);
// $my_detail_thumb_width_height  = empty($parameter[7]) ? '80x80'  :  trim($parameter[7]);
// $my_detail_copyr_text          = empty($parameter[8]) ? '(c) Max Muster'  : trim($parameter[8]);
// $my_gallery_css                = empty($parameter[9]) ? 'galleryx'  : trim($parameter[9]);


1. Have a look to this tag e.g.: {GALLERYX: 25, 31, 32, 2, 1, 1, 15, 60x60, (c) My text, mygalleryx}
Code: Select all
+----------+--------+-------+----------+-------+-----+---------+-------------+-------------+------------+---------------+
| {GALLERYX:   25   |   31  |    32    |   2   |  1  |     1   |     15      |    60x60    | (c) My text|  mygalleryx } |
|          |        |       |          |       |     |         |             |             |            |               |
| {GALLERYX: root_ID| sub_ID| subsub_ID| title | zoom| lightbox| thumb_      | thumb_      | copyr text | mygallery css}|
|          |        |       |          | /date |     |         | count_to_min| width_height|            |               |
|          |        |       |          |       |     |         |             |             |            |               |
| Index    |  [0]   |  [1]  |   [2]    |  [3]  | [4] |    [5]  |     [6]     |      [7]    |     [8]    |      [9]      |
+----------+--------+-------+----------+-------+-----+---------+-------------+-------------+------------+---------------+

2. Second we must create a new tag: For this individual configuration you can see the parameter set above in "Input parameter (handing over)" (the commented one - uncomment them and it ought to run.)
We have only two types of variables, [int] and [string].
For [int] please use the intval function (http://us.php.net/manual/en/function.intval.php)
For [string] please use the "trim function" (http://de3.php.net/trim)

Figure out the "short if syntax" (http://www.scottklarr.com/topic/76/tip-of-the-day-php-short-hand-if-statement/)
Code: Select all
       [$variable       = (statement)           ? "return if true"  : "return if false";]

e.g.:   $my_gallery_css = empty($parameter[9])  ? 'galleryx'        : trim($parameter[9]);
And take care to the running index e.g.   [9]                                        [9]

3. Third we must comment out the coresponding variables in section "SHORT DEFINATION"

[UPDATE]

$my_list_description_date = 0; // [0|1] date off/on in description text
Code: Select all
// [0|1|2|3] [0=off | 1=info |2=off | 3=info and date ]   in sub gallery
$my_list_descr_info_date_on  = 3;  // [0|1|2|3] Show description in list -> no separate date available
$my_list_descr_prefix        = '<div class="list-descr">';  // '<div style="font-size: 11px">';
$my_list_descr_suffix        = '</div>';
$my_list_descr_date_prefix   = '<strong>';
$my_list_descr_date_suffix   = '</strong> &#8211; ';


Code: Select all
// caption set in sub sub gallery -> caption and/or lightbox
// [0|1|2|3] [0=off | 1=capt |2=light | 3=capt&light ]   in sub sub gallery
$my_detail_caption_on             = 3;


Code: Select all
// [0|1|2|3] [off | title=on | date=on | title and date = on]   in sub sub gallery
$my_detail_title_date        = 3;

Before installing the new file struct, disable the file /template/inc_script/frontend_render/galleryx.php
After you have uploaded, compare your settings and tags in galleryx.php -> /template/inc_script/galeryx/galleryx_main_v121.inc.php.
[/UPDATE]

[UPDATE v1.2.1]
Code: Select all
// special linebreak in caption/copyright for lightbox solves the \n\t problem
$my_detail_cc_light_linebreak    = 1; // [0|1] [0=off (old behavior) | 1=on (no [BR] needed for linebreak)]

// fallback text if there is no one in db
$my_detail_caption_text         = ''; // the caption text for sub sub and lightbox

// thumb text: title for hover and alt for thumb image
// only for lightbox: important for a right caption carry to lightbox
// blank: filename.ext is generated for title text
// At filecenter info field you can use the tag[TT]......[/TT] for setting up too
$my_detail_caption_title      = ''; // the thumb title text (blank: filename.ext is autom. inserted)

// blank: filename.ext is generated for alt text
// At filecenter info field you can use the tag[AT]......[/AT] for setting up too (blank: filename.ext is autom. inserted)
$my_detail_caption_alt         = ''; // the thumb alt text


Add, if you want, this css snippet to the bottom into /template/slimbox/css/slimbox.css
Code: Select all
#lbCaption { /* kh changed */
   font-weight: normal; /* bold; */
}
#lbCaption p { /* +kh */
   font-weight: normal; /* bold; */
   padding: 0 0 6px 0;
}

[/UPDATE v1.2.1]

(German language follows).

Knut
Last edited by flip-flop on Mon Jan 19, 2009 01:42, edited 5 times in total.
>> DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
User avatar
flip-flop
 
Posts: 5552
Joined: Sat May 21, 2005 19:25
Location: HAMM (Germany)

Re: {GALLERYX: ......} V1.2 -> (galleryx_call_v12.php)

Postby markus s on Fri Jan 09, 2009 17:51

knut rules :idea:
- unaffordable -
moderator
Image
User avatar
markus s
Moderator
 
Posts: 389
Joined: Sat Dec 16, 2006 18:21
Location: Brixlegg / Tirol

Re: {GALLERYX: ......} V1.2 -> (galleryx_call_v12.php)

Postby zuker on Fri Jan 09, 2009 23:20

Briliant! I have made a test passingly and it seems that everything working perfectly.

Only one thing. May be someone knows how to force lightbox to display image description text with line breaks. I mean i have image caption/long info text like this:

Jewish Angel
2005
Oil on Canvas
92cm x 61,5cm


In lightbox I get the result :

Jewish Angel 2005 Oil on Canvas 92cm x 61,5cm

(all text jumps in to one line)
٩(͡๏̯͡๏)۶
User avatar
zuker
 
Posts: 47
Joined: Fri May 18, 2007 15:13
Location: Lithuania

Re: {GALLERYX: ......} V1.2 -> (galleryx_call_v12.php)

Postby markus s on Sat Jan 10, 2009 09:40

and if you use a [BR]... ?
moderator
Image
User avatar
markus s
Moderator
 
Posts: 389
Joined: Sat Dec 16, 2006 18:21
Location: Brixlegg / Tirol

Re: {GALLERYX: ......} V1.2 -> (galleryx_call_v12.php)

Postby zuker on Sat Jan 10, 2009 10:59

I have already tried this.
When I use [BR] I get the following result bellow thumbnail:


Angel[BR]
2005[BR]
Oil on Canvas[BR]
92cm x 61,5cm


In lightbox the result is OK :

Angel
2005
Oil on Canvas
92cm x 61,5cm
٩(͡๏̯͡๏)۶
User avatar
zuker
 
Posts: 47
Joined: Fri May 18, 2007 15:13
Location: Lithuania

Re: {GALLERYX: ......} V1.2 -> (galleryx_call_v12.php)

Postby flip-flop on Sat Jan 10, 2009 11:28

I know about this inconsistency and have a closer look into the relevant function (parseLightboxCaption in front.func.inc.php) for cutting out this and implement an own one in imagegalleryx12.inc.php

Knut
>> DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
User avatar
flip-flop
 
Posts: 5552
Joined: Sat May 21, 2005 19:25
Location: HAMM (Germany)

Re: {GALLERYX: ......} V1.2 -> (galleryx_call_v12.php)

Postby zuker on Sat Jan 10, 2009 11:51

Thanks Knut for good intention.
٩(͡๏̯͡๏)۶
User avatar
zuker
 
Posts: 47
Joined: Fri May 18, 2007 15:13
Location: Lithuania

Re: {GALLERYX: ......} V1.2 -> (galleryx_call_v12.php)

Postby flip-flop on Sat Jan 10, 2009 12:09

Mhh,
this must work [BR] -> [br] (I think thats a system function problem)
Code: Select all
Angel[br]2005[br]Oil on Canvas[br]92cm x 61,5cm

but it isn´t a solution for the basically problem.
>> DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
User avatar
flip-flop
 
Posts: 5552
Joined: Sat May 21, 2005 19:25
Location: HAMM (Germany)

Re: {GALLERYX: ......} V1.2 -> (galleryx_call_v12.php)

Postby zuker on Sat Jan 10, 2009 12:58

You are right, [br] solved that problem.

Nonetheless I hope you will find a solution for the basically problem. :wink:
٩(͡๏̯͡๏)۶
User avatar
zuker
 
Posts: 47
Joined: Fri May 18, 2007 15:13
Location: Lithuania

Re: {GALLERYX: ......} V1.2.1 -> (galleryx_call_v121.php)

Postby flip-flop on Mon Jan 19, 2009 00:03

Update to v1.2.1 is out. -> http://forum.phpwcms.org/viewtopic.php?f=8&t=18266

7. V1.2.1
7.1 Caption fallback text if there is no one in db
7.2 No longer report of the crappy thumb title text during hover. (The whole capture text with all formated tags has been reported :twisted: ).
Title-text for hover and alt-text for thumb images set with a tag in capture or with a parameter or autom. filename.
7.3 LightBox (SLimbox) capture better editable. The same output like the normal capture. You don´t need e.g. a [BR] tag for linebreak. Paragraph autom. created behind 2 x linefeed.

[EN] Frontend/Backend capture edit:
--------------------------------------
Image

Knut
>> DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
User avatar
flip-flop
 
Posts: 5552
Joined: Sat May 21, 2005 19:25
Location: HAMM (Germany)

Re: {GALLERYX: ......} V1.2.1 -> (galleryx_call_v121.php)

Postby zuker on Mon Jan 19, 2009 14:43

Just perfect :)

I have tested and it seems that almost everything working like a charm except one thing. When I enter caption text only for few pictures other pictures that are without caption gets the same text (see image below).

Image
٩(͡๏̯͡๏)۶
User avatar
zuker
 
Posts: 47
Joined: Fri May 18, 2007 15:13
Location: Lithuania

Re: {GALLERYX: ......} V1.2.1 -> (galleryx_call_v121.php)

Postby flip-flop on Mon Jan 19, 2009 15:10

Oh yes, thanks for testing.

Around line 728 in \include\inc_lib\imagegalleryx121.inc.php
please change:
} // END detail_thumbnail_caption

to
$my_caption_text = ''; // Reset temp caption text

} // END detail_thumbnail_caption


Better solution around line 649:
change
Code: Select all
         // ---------------
         
         // =============== +kh parses the caption text for [TT] Title-Text and [AT] Alt-Text
         if(($image['f_longinfo'] != '') ) { // parse for tags in all situations
            $my_caption_text    = '';
            $my_title_tag       = '';
            $my_alt_tag         = '';
            $my_title_tag       = $this->my_get_tag_section('TT', $image['f_longinfo']);
            $my_alt_tag          = $this->my_get_tag_section('AT', $image['f_longinfo']);
            $my_caption_text    = $this->my_replace_tag_section('TT', $image['f_longinfo']);   // save caption and kill "[XX]text[/XX]"
            $my_caption_text   = $this->my_replace_tag_section('AT', $my_caption_text);          // save caption and kill "[XX]text[/XX]"
         }
         // ===============

to

Code: Select all
         // ---------------
         
         // Reset temp data
         $my_caption_text    = '';
         $my_title_tag       = '';
         $my_alt_tag         = '';
         
         // =============== +kh parses the caption text for [TT] Title-Text and [AT] Alt-Text
         if(($image['f_longinfo'] != '') ) { // parse for tags in all situations
            $my_title_tag       = $this->my_get_tag_section('TT', $image['f_longinfo']);
            $my_alt_tag          = $this->my_get_tag_section('AT', $image['f_longinfo']);
            $my_caption_text    = $this->my_replace_tag_section('TT', $image['f_longinfo']);   // save caption and kill "[XX]text[/XX]"
            $my_caption_text   = $this->my_replace_tag_section('AT', $my_caption_text);          // save caption and kill "[XX]text[/XX]"
         }
         // ===============


V1.2.1 is updated
Last edited by flip-flop on Mon Jan 19, 2009 15:36, edited 3 times in total.
>> DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
User avatar
flip-flop
 
Posts: 5552
Joined: Sat May 21, 2005 19:25
Location: HAMM (Germany)

Re: {GALLERYX: ......} V1.2.1 -> (galleryx_call_v121.php)

Postby zonk on Mon Jan 19, 2009 15:17

Wann gibts dess hier in deutsch .. =) ... habs zwar zu laufen, aber ich denke man kann noch viel mehr machen, wenn man die Erklärung hier 100%ig lesen kann :-)

*duckundrenn*
User avatar
zonk
 
Posts: 148
Joined: Thu Apr 05, 2007 10:21
Location: Nauheim

Re: {GALLERYX: ......} V1.2.1 -> (galleryx_call_v121.php)

Postby flip-flop on Mon Jan 19, 2009 15:31

Ich weiß es nicht. Ich habe einfach ein Zeitproblem.
>> DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
User avatar
flip-flop
 
Posts: 5552
Joined: Sat May 21, 2005 19:25
Location: HAMM (Germany)

Re: {GALLERYX: ......} V1.2.1 -> (galleryx_call_v121.php)

Postby zonk on Mon Jan 19, 2009 15:35

oki :)
User avatar
zonk
 
Posts: 148
Joined: Thu Apr 05, 2007 10:21
Location: Nauheim

Next

Return to hacks & enhancements

Who is online

Users browsing this forum: Alexa [Bot], MSNbot Media and 0 guests