{GALLERYX: ......} V1.2.2

An enhanced version of galleryx.php. :!: ….. → V1.2

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. :!:



Docu: –
Forum: http://forum.phpwcms.org/viewtopic.php?f=8&t=18266

Autor: K.Heermann (flip-flop) http://planmatrix.de
CMS version: >= 1.3.x
Version: V1.2.2

Tag: See the description

Fileiname: See the description

Folder: See the description

Condition:/config/phpwcms/conf.inc.php

  • $phpwcms['allow_ext_render'] = 1;


Since CMS version 1.6.528 (R528), the function you need trimhtml ($……) is no longer present in the CMS.

  • Solution: Replace the function calls trimhtml($……) by html_specialchars(trim($……)) in the files
    • /template/inc_script/galleryx/galleryx_main_v122.php
    • /template/inc_script/galleryx/galleryx_main_v122.inc.php
  • In the download file of version 1.2.2a this bug is corrected since 07.02.2013.


What is new (1.2.2):

  1. New sort by number implemented
  2. Special images in sub gallery (list) → sort number -1, -2, -3 …..
  3. 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

Filecenter


Frontend output example


Frontend/Backend capture edit


The own tag and how can I create one

Basic tag: {GALLERYX: galleryRoot_ID[int], subgallery_ID[int], subsubgallery_ID[int]}

===========================================================================================
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, 60×60, © My text, mygalleryx}

+----------+--------+-------+----------+-------+-----+---------+-------------+-------------+------------+---------------+
| {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/)

       [$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)

// [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; ';
// 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;
// [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]

some chnges

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

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

sort mode:

// 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';

some changes

// =====================================================
// 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]

english/phpwcms_replacer_rts/frontend_render/galleryx/galleryx-v1-2-2.txt · Last modified: 2013/02/07 10:10 by Knut Heermann (flip-flop)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0