Page 1 of 4

{GALLERYX: ......} V1.2.2 -> (galleryx_call_v122.php)

Posted: Fri 9. Jan 2009, 17:23
by flip-flop
An enhanced version of galleryx.php. :!: ..... -> V1.2 (http://forum.phpwcms.org/viewtopic.php?f=8&t=17970)

Update No.3 -> V1.2.2 (22.02.09)!!
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.2.2):
1. New sort by number implemented
2. Special images in sub gallery (list) -> sort number -1, -2, -3 .....
2. Optional faster thumbs/images output (processing during first call in fe)

What is new (1.2.1):
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_v122.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_v122.doc.php (little doc)
PHP: /template/inc_script/frontend_render/galleryx_call_v122.php (init file in frontend_render)
PHP: /template/inc_script/galeryx/galleryx_main_v122.php (main function)
PHP: /include/inc_lib/imagegalleryx122.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.

8. V1.2.2
8.1 New sort by number implemented (file center since _r300 has a new numeric sort field) Negativ numbered images reserved for the list output. Such pictures are not indicated in detail gallery output.
8.2 Update for special images in sub gallery. -> sort number -1, -2, -3 ....
8.3 Optional faster thumbs/images output (processing during first call in fe). Normaly images are computed during the call in frontend via cmsimage.php ... For large galleries this slow down the thumb output. Using this option, the images are processed only one time after these were put on. At Accounts with a small execution time it is possible, that an server 500 occures during first fe output. -> Have a reload of this site and wait.


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)
Download v1.2.2: 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- ... 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]

[UPDATE v1.2.2]

Code: Select all

// LIST THUMB ------------------------------------------

// string defines the sorting mode of the list Sub Gallery thumbs:
	// RAND = get images by random)
	// SORT-ASC, SORT-DESC, SORT-NAME-ASC, SORT-NAME-DESC, SORT-CREATE-ASC, SORT-CREATE-DESC  (since r304)
	// NAME-ASC, NAME-DESC, CREATE-ASC, CREATE-DESC, 
	// LIST-SPECIAL-IMG -> A special thumb for gallery listing with sort number = -1, -2, -3, ....
$my_list_thumbnail_sort						= 'LIST-SPECIAL-IMG';

Code: Select all

// =====================================================
// sub sub gallery definition 
// =====================================================
// string defines the sorting mode
// ASC / DESC = get images sorted by date 
// NAME-ASC / NAME_DESC = get images sorted by name  (+kh) 
// RAND = get images by random)
// SORT-ASC, SORT-DESC, SORT-NAME-ASC, SORT-NAME-DESC, SORT-CREATE-ASC, SORT-CREATE-DESC  (since r304)
// NAME-ASC, NAME-DESC, CREATE-ASC, CREATE-DESC

$my_gallery_image_sort			= 'SORT-NAME-ASC'; 	// sorting gallery images


// GALLERY THUMBS ======================================
// sub sub gallery thumbs

$my_detail_thumb_fast_output	= 1;					// processing of all thumbs/images during first call of the galleryx [0|1]
[/UPDATE v1.2.2]

(German language follows).

Knut

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

Posted: Fri 9. Jan 2009, 18:51
by markus s
knut rules :idea:
- unaffordable -

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

Posted: Sat 10. Jan 2009, 00:20
by zuker
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)

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

Posted: Sat 10. Jan 2009, 10:40
by markus s
and if you use a [BR]... ?

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

Posted: Sat 10. Jan 2009, 11:59
by zuker
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

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

Posted: Sat 10. Jan 2009, 12:28
by flip-flop
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

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

Posted: Sat 10. Jan 2009, 12:51
by zuker
Thanks Knut for good intention.

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

Posted: Sat 10. Jan 2009, 13:09
by flip-flop
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.

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

Posted: Sat 10. Jan 2009, 13:58
by zuker
You are right, [br] solved that problem.

Nonetheless I hope you will find a solution for the basically problem. :wink:

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

Posted: Mon 19. Jan 2009, 01:03
by flip-flop
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

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

Posted: Mon 19. Jan 2009, 15:43
by zuker
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

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

Posted: Mon 19. Jan 2009, 16:10
by flip-flop
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

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

Posted: Mon 19. Jan 2009, 16:17
by zonk
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*

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

Posted: Mon 19. Jan 2009, 16:31
by flip-flop
Ich weiß es nicht. Ich habe einfach ein Zeitproblem.

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

Posted: Mon 19. Jan 2009, 16:35
by zonk
oki :)