Differences

This shows you the differences between two versions of the page.

english:technics:database:phpwcms_articlecontent [2009/11/17 11:01]
Knut Heermann (flip-flop) created
english:technics:database:phpwcms_articlecontent [2018/06/03 18:09] (current)
Line 4: Line 4:
-field dump: dumpVar($GLOBALS['crow']);  
 +
 +===== E.g. for the CP images <div> =====
 +
 +
 +in /frontend_init/ using the function cp_trigger:
 +
 +<code php|h cp_trigger|h>
 +<?php
 +// -------------------------------------------------------------------------------------------
 +// obligate check for phpwcms constants
 +  if (!defined('PHPWCMS_ROOT')) {
 +    die("You Cannot Access This Script Directly, Have a Nice Day."); }
 +// -------------------------------------------------------------------------------------------
 + 
 +
 +function CP_IMAGES_SLIDESHOW2($text, & $data) {
 + 
 +  if( $data['acontent_type'] == 29 )  // CP: 29 => image <div>   CP: 31 => image special
 +  {
 +    // ----------- table dump
 +    dumpVar($GLOBALS['crow']);
 +
 +
 +    // ----------- field dump acontent_form
 +    $CP = @unserialize($GLOBALS['crow']["acontent_form"]);
 +    dumpVar($CP);
 + 
 +  }
 +
 +  return $text;
 +}
 + 
 +register_cp_trigger('CP_IMAGES_SLIDESHOW2');
 +
 +?>
 +</code>
 +
 +\\
 +
 +===== table dump =====
 +
 +<code php>dumpVar($GLOBALS['crow']);</code>
 +
 +\\
 +**Result:**
<code php> <code php>
Array Array
( (
-    [acontent_id] => 85 +    [acontent_id] => 85                            // biunique CP-ID  
-    [acontent_aid] => 26+    [acontent_aid] => 26                           // biunique article-ID
    [acontent_uid] => 1     [acontent_uid] => 1
-    [acontent_created] => 2009-11-11 23:11:19 +    [acontent_created] => 2009-11-11 23:11:19      // CP created 
-    [acontent_tstamp] => 2009-11-17 09:58:32 +    [acontent_tstamp] => 2009-11-17 09:58:32       // CP last changes 
-    [acontent_title] => Image < div > slidedhow +    [acontent_title] => Image < div > slidedhow    // title text 
-    [acontent_text] => <p>Text, Text, Text</p> +    [acontent_text] => <p>Text, Text, Text</p>     // wysiwyg text 
-<p>Text, Text, {CITY} Text{a:anker-div}</p> +<p>Text, Text, {CITY} Text{a:anker-div}</p>  
-    [acontent_type] => 29 +    [acontent_type] => 29                          // content typ  (images <div> = 29) 
-    [acontent_sorting] => 0+    [acontent_sorting] => 0                        // sort value
    [acontent_image] =>     [acontent_image] =>
    [acontent_files] =>     [acontent_files] =>
-    [acontent_visible] => 1 +    [acontent_visible] => 1                        // status: visible 
-    [acontent_subtitle] =>  +    [acontent_subtitle] =>                         // subtitle text 
-    [acontent_before] => 15 +    [acontent_before] => 15                        // space: before 
-    [acontent_after] => 20 +    [acontent_after] => 20                         // space: after 
-    [acontent_top] => 0 +    [acontent_top] => 0                            // top link 
-    [acontent_redirect] => +    [acontent_redirect] =>
    [acontent_html] =>     [acontent_html] =>
-    [acontent_trash] => 0+    [acontent_trash] => 0                          // 9=trash
    [acontent_alink] =>     [acontent_alink] =>
    [acontent_media] =>     [acontent_media] =>
-    [acontent_form] => a:11:{s:6:"images";a:7:{i:0;a:7:{i:0;s:1:"6";i:1;s:20:"Dscn1531_800x600.jpg";i:2;s:32:"129371f7f736a0a8d0b9083b2e10fc8f";i:3;s:3:"jpg";i:4;i:80;i:5;i:60;i:6;s:23:"Liegestuhl, sehr bequem";}i:1;a:7:{i:0;s:1:"9";i:1;s:20:"IMG_4527-480x640.jpg";i:2;s:32:"ff974ae44a4f41ada71eaf4356d19aaa";i:3;s:3:"jpg";i:4;i:80;i:5;i:60;i:6;s:31:"Lia guckt blöd aus der Wäsche";}i:2;a:7:{i:0;s:1:"2";i:1;s:17:"060129_124625.jpg";i:2;s:32:"8d89ce4314ca482ab4cf8a6eeb16560e";i:3;s:3:"jpg";i:4;i:80;i:5;i:60;i:6;s:30:"Herr Schmidt ordnet die Blumen";}i:3;a:7:{i:0;s:2:"19";i:1;s:20:"cimg1435_800x600.jpg";i:2;s:32:"89a45c92e024ba54a43ab1ea554ad06a";i:3;s:3:"jpg";i:4;i:80;i:5;i:60;i:6;s:18:"Moderne Tankstelle";}i:4;a:7:{i:0;s:2:"20";i:1;s:20:"dscn0702_800x600.jpg";i:2;s:32:"3fedf26f925cf675ea250c90476e43ca";i:3;s:3:"jpg";i:4;i:80;i:5;i:60;i:6;s:14:"Wiese mit Baum";}i:5;a:7:{i:0;s:1:"3";i:1;s:16:"lia_bild1316.jpg";i:2;s:32:"ecdb09f7d4a109e9c72f40e99ceb5373";i:3;s:3:"jpg";i:4;i:80;i:5;i:60;i:6;s:9:"Lia klein";}i:6;a:7:{i:0;s:1:"8";i:1;s:20:"img_4533_640x480.jpg";i:2;s:32:"1af27f44f306794f178bb4a1ec5d544b";i:3;s:3:"jpg";i:4;i:80;i:5;i:60;i:6;s:10:"Lia mittel";}}s:5:"width";i:80;s:6:"height";i:60;s:3:"pos";i:0;s:3:"col";i:10;s:4:"zoom";i:0;s:4:"crop";i:1;s:5:"space";i:3;s:8:"lightbox";i:0;s:9:"nocaption";i:0;s:12:"center_image";i:2;}+    [acontent_form] =>  (see above "Content of the field")    // e.g. all image parameters in serialized form
    [acontent_newsletter] =>     [acontent_newsletter] =>
-    [acontent_block] => CONTENT +    [acontent_block] => CONTENT                    // display type 
-    [acontent_anchor] => 1 +    [acontent_anchor] => 1                         // [0|1] off|on 
-    [acontent_template] => slideshow2.tmpl +    [acontent_template] => slideshow2.tmpl         // usedn template file 
-    [acontent_spacer] => 0+    [acontent_spacer] => 0                         // ??
    [acontent_tid] => 0     [acontent_tid] => 0
    [acontent_livedate] => 0000-00-00 00:00:00     [acontent_livedate] => 0000-00-00 00:00:00
    [acontent_killdate] => 0000-00-00 00:00:00     [acontent_killdate] => 0000-00-00 00:00:00
    [acontent_module] =>     [acontent_module] =>
-    [acontent_comment] => {PREVNEXT}{KENBURNS+    [acontent_comment] => {PREV-NEXT}{KEN-BURNS}   // Comment field 
-    [acontent_paginate_page] => 0 +    [acontent_paginate_page] => 0                  // subsection No 
-    [acontent_paginate_title] => +    [acontent_paginate_title] =>                   // subsection (pagination) title
    [acontent_category] =>     [acontent_category] =>
    [acontent_granted] => 0     [acontent_granted] => 0
Line 49: Line 93:
</code> </code>
 +\\
-especially the field acontent_form 
-<code> +==== field acontent_form ==== 
- $CP = @unserialize($GLOBALS['crow']["acontent_form"])+ 
-/* ======= CP image &lt;div&gt; parameter +\\ 
- [images] // Array for every image +** 
- { +Content of the field:**  
- [0] =&gt; Array // Array No.[0][1][2][*]: following the sort order in CP image &lt;div&gt+<code mysql
- +a:11: 
- [0] =&gt; 6 // biunique image ID +{s:6:"images";a:7: 
- [1] =&gt; Dscn1531_800x600.jpg // real filename +
- [2] =&gt; 129371f7f736a0a8d0b9083b2e10fc8f // hash in /filearchive/* +i:0;a:7:{i:0;s:1:&quot;6&quot;;i:1;s:20:"Dscn1531_800x600.jpg";i:2;s:32:"129371f7f736a0a8d0b9083b2e10fc8f";i:3;s:3:"jpg";i:4;i:80;i:5;i:60;i:6;s:23:"Liegestuhl, sehr bequem";} 
- [3] =&gt; jpg // file extend +i:1;a:7:{i:0;s:1:&quot;9";i:1;s:20:"IMG_4527-480x640.jpg";i:2;s:32:&quot;ff974ae44a4f41ada71eaf4356d19aaa&quot;;i:3;s:3:"jpg";i:4;i:80;i:5;i:60;i:6;s:31:"Lia guckt blöd aus der Wäsche";} 
- [4] =&gt; 80 // thumb width +i:2;a:7:{i:0;s:1:&quot;2";i:1;s:17:"060129_124625.jpg";i:2;s:32:"8d89ce4314ca482ab4cf8a6eeb16560e";i:3;s:3:"jpg";i:4;i:80;i:5;i:60;i:6;s:30:"Herr Schmidt ordnet die Blumen";} 
- [5] =&gt; 60 // thumb height +i:3;a:7:{i:0;s:2:"19";i:1;s:20:&quot;cimg1435_800x600.jpg";i:2;s:32:&quot;89a45c92e024ba54a43ab1ea554ad06a";i:3;s:3:&quot;jpg";i:4;i:80;i:5;i:60;i:6;s:18:"Moderne Tankstelle";} 
- [6] =&gt; Liegestuhl, sehr bequem // caption test +i:4;a:7:{i:0;s:2:&quot;20";i:1;s:20:"dscn0702_800x600.jpg";i:2;s:32:"3fedf26f925cf675ea250c90476e43ca";i:3;s:3:"jpg";i:4;i:80;i:5;i:60;i:6;s:14:"Wiese mit Baum";} 
- ) +i:5;a:7:{i:0;s:1:&quot;3";i:1;s:16:"lia_bild1316.jpg";i:2;s:32:"ecdb09f7d4a109e9c72f40e99ceb5373";i:3;s:3:"jpg";i:4;i:80;i:5;i:60;i:6;s:9:"Lia klein";} 
- +i:6;a:7:{i:0;s:1:&quot;8";i:1;s:20:"img_4533_640x480.jpg";i:2;s:32:"1af27f44f306794f178bb4a1ec5d544b";i:3;s:3:"jpg";i:4;i:80;i:5;i:60;i:6;s:10:"Lia mittel";} 
- // general parameters +
- [width] =&gt; 80 // max [width] of the thumbs +s:5:"width&quot;;i:80;s:6:"height&quot;;i:60;s:3:"pos&quot;;i:0;s:3:"col&quot;;i:10;s:4:"zoom&quot;;i:0;s:4:"crop&quot;;i:1;s:5:"space&quot;;i:3;s:8:"lightbox&quot;;i:0;s:9:"nocaption&quot;;i:0;s:12:"center_image&quot;;i:2; 
- [height] =&gt; 60 // max [height] of the thumbs +}
- [pos] =&gt; 0 // ??? +
- [col] =&gt; 10 // [No.] of columns +
- [zoom] =&gt; 0 // behavior: [0|1] = enlarge/zoom [off|on] +
- [crop] =&gt; 1 // [0|1] = crop thumbnail [off|on] +
- [space] =&gt; 3 // image space[No.]px +
- [lightbox] =&gt; 0 // [0|1] lighbox [off|on] +
- [nocaption] =&gt; 0 // [0|1] hide caption for thumbnails [off|on] +
- [center_image] =&gt; 0 // [0|1|2|3] = [no center|center horiz./vert.|center horiz.|center=vert.] +
-  ========================== */+
</code> </code>
 +
 +\\
 +<code php>
 +$CP = @unserialize($GLOBALS['crow']["acontent_form"]);
 +dumpVar($CP);
 +</code>
 +
 +\\
 +**Result:**
 +<code php>
 +// ======= CP image <div> parameter
 +Array
 +(
 +    [images] => Array
 +        (
 +            [0] => Array
 +                (
 +                    [0] => 6                                    // biunique image ID
 +                    [1] => Dscn1531_800x600.jpg                 // real filename
 +                    [2] => 129371f7f736a0a8d0b9083b2e10fc8f     // hash in /filearchive/*
 +                    [3] => jpg                                  // file extend
 +                    [4] => 80                                   // thumb width
 +                    [5] => 60                                   // thumb height
 +                    [6] => Liegestuhl, sehr bequem              // caption test
 +                )
 +        }
 +            // general parameters
 +            [width] => 80           // max [width] of the thumbs
 +            [height] => 60          // max [height] of the thumbs
 +            [pos] => 0              // ???
 +            [col] => 10             // [No.] of columns
 +            [zoom] => 0             // behavior: [0|1] = enlarge/zoom [off|on]
 +            [crop] => 1             // [0|1] = crop thumbnail [off|on]
 +            [space] => 3            // image space[No.]px
 +            [lightbox] => 0         // [0|1] lighbox [off|on]
 +            [nocaption] => 0        // [0|1] hide caption for thumbnails [off|on]
 +            [center_image] => 0     // [0|1|2|3] = [no center|center horiz./vert.|center horiz.|center=vert.]
 +}
 +//  ==========================
 +</code>
 +
 +~~UP~~
 +\\
 +
 +===== BE screen shot =====
 +
 +{{:english:technics:database:images-div01_1.gif|}}
english/technics/database/phpwcms_articlecontent.1258452079.txt.gz · Last modified: 2018/06/03 18:08 (external edit)
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