{{indexmenu_n>110}} ====== Bilder: Ausgabe von Title ====== Mit diesem kleinen Script kann der {TITLE} TAG innerhalb %% ......... %% im CP-Template ersetzt werden. ===== TAGs: ===== * **CP Titel:** ##%% [[%TITLE%]] %%## * **Bild title:** ##%% [[%{IMGID}::TITLE%]] %%## ---- Docu: -- \\ Forum: [[http://forum.phpwcms.org/viewtopic.php?p=132499|CP-Template: Caption erschein an der Stelle des Inhalttitels]] **Autor:** K.Heermann (flip-flop) http://planmatrix.de \\ **CMS Version:** >= 1.4x \\ **Version:** V1.0 //(24.09.2011)// \\ **Bedingung:** -> [[http://www.phpwcms-docu.de/confincphp_de.phtml|/config/phpwcms/conf.inc.php]] \\ * $phpwcms['allow_ext_init'] = 1; ---- \\ \\ ===== PHP: ===== Datei: **/template/inc_script/frontend_init/cp_trig_images_title.php** ......... * * TAG: [[%Count::........%]] Title from Caption title * TAG: [[%........%]] Title from CP title * * Identifier in template: *************************************************************************************/ // ----------------------------------------------------------------------------------- // OBLIGATE CHECK FOR PHPWCMS CONSTANTS if (!defined('PHPWCMS_ROOT')) {die("You Cannot Access This Script Directly, Have a Nice Day.");} // ----------------------------------------------------------------------------------- function CP_IMGDIV_TITLE01($text, & $data) { if($data['acontent_type'] == 29 AND strpos($text, '') ) { // 29 is CP img div // dumpVar($data); // dumpVar($text); // --- Title from caption title ------------------------ $image = @unserialize($data["acontent_form"]); foreach($image['images'] as $key => $value) { $caption[$key] = getImageCaption($image['images'][$key][6]); // [[%Count::TITLE%]] title aus Bildunterzeile einsetzen $text = preg_replace('/\[\[%'.$key.'::TITLE%\]\]/is', $caption[$key][3], $text); } // ----------------------------------------------------- // dumpVar($caption); // --- Title from CP title ----------------------------- // [[%TITLE%]] Title einsetzen $text = str_replace('[[%TITLE%]]', $data[acontent_title], $text); // --- Title from caption title ------------------------ } return $text; } register_cp_trigger('CP_IMGDIV_TAG01'); ?> \\ ===== Beispiel: =====
[TITLE]

[[%TITLE%]]

[/TITLE] [TITLE]

[[%{IMGID}::TITLE%]]

[/TITLE] [SUBTITLE]

{SUBTITLE}

[/SUBTITLE]
..... .....
\\