Page 1 of 2
Lightbox anpassen (html in lightbox caption) [SOLVED]
Posted: Tue 5. Feb 2008, 09:12
by phalancs
Kurze Frage: Wie kann ich die Full-View-Größe der Lightbox Bilder anpassen (es scheint mir nicht die Originalgrpöße der Bilder zu sein)? Jemand ne Idee? Auch würde mich brennen interessieren wie ich html in den Bildunterschriften aktivieren kann, das würde nämlich eine Armada an tollen Möglichkeiten eröffnen

(Na, wenigstens diese
[EXT] Dinger hätten doch funzen können).
Bin ja noch nich so "per Du" mit den neuen Funktionen 
Re: Lightbox anpassen
Posted: Tue 5. Feb 2008, 09:20
by update
Code: Select all
$phpwcms['img_prev_width'] = 1200; //max width of the large preview image
$phpwcms['img_prev_height'] = 800; //max height of the large preview image
So steht's bei mir in der conf.inc.php und seit dem werden die Dinger richtig gross

Re: Lightbox anpassen
Posted: Tue 5. Feb 2008, 09:25
by phalancs
"groß"artig. Danke
Nu muss ich mir nur noch die Bildunterschriften vorknöpfen.
Re: Lightbox anpassen
Posted: Tue 5. Feb 2008, 09:40
by update
Na dann... lies mal hier, vielleicht hilft das weiter:
http://forum.phpwcms.org/viewtopic.php? ... ge+caption
Auf jeden Fall geht so was wie [br]
usw standardmässig schon...
Cutomizing Lightbox Captions (enable HTML)
Posted: Tue 5. Feb 2008, 18:10
by phalancs
Cutomizing Lightbox Captions (enable HTML)
Liebe Freunde des CMS Customizing, ich habe folgende Lösung gefunden um HTML in den Captions der Lightbox zu aktivieren:
open include/inc_lib/cnt2.readform.inc.php
FIND
Code: Select all
$content["image_caption"] = clean_slweg($_POST["cimage_caption"]);
REPLACE WITH
Code: Select all
//enym: Enable html in Lightbox Caption
//$content["image_caption"] = clean_slweg($_POST["cimage_caption"]);
$content["image_caption"] = $_POST["cimage_caption"];
open include/inc_front/img.func.inc.php
FIND
Code: Select all
$caption[0] = html_specialchars($caption[0]);
REPLACE WITH
Code: Select all
//enym
//$caption[0] = html_specialchars($caption[0]);
$caption[0] = $caption[0];
Basicall you just need to change 2 lines in 2 files

As there is no real clearing of the caption string anymore, please be sure with what you do.
Re: Cutomizing Lightbox Captions (enable HTML)
Posted: Tue 5. Feb 2008, 21:43
by Jensensen
Hi phalancs,
thank you.
Well, I right now did a test. As this hack affects CP images i tried to place some HTML tags in the caption field.
OK it works, at least that way, that --> now the --> tags aren't 'html_specialchars'-ed [stripped off] anymore, but --> remains in the caption field. If you have --> lightbox enabled and click the image all this caption HTML code is displayed below the image and can be styled with CSS. So far, so good.
On the other hand the --> caption [as already mentioned in the parallel thread:
http://forum.phpwcms.org/viewtopic.php?f=16&t=16199 ] is rendered to the image TITLE --> title="...caption....".
As a consequence of this, when you are on the article page and hold the mouse over the images --> the HTML code as TITLE pop ups...
Am I wrong?
What else need to be changed -- btw: there ARE many files affecting image captions next to /include/inc_lib/content/cnt2.readform.inc.php -- [but keeps other CPs' output untouched?]
Wouldn't it be easier to add one additional field 'image description' to be shown with lightbox....???
[best solution: read out IPTC/EXIF data automatically to image description field

]
phalancs wrote:...As there is no real clearing of the caption string anymore, please be sure with what you do.
What does this mean...?
Re: Lightbox anpassen (html in lightbox caption) [SOLVED]
Posted: Tue 5. Feb 2008, 22:01
by phalancs
OK, da ich die Captions in der preview nicht zeige, ist mir das wahrscheinlich wurscht gewesen, aber dafür gibts auch nen easy trick.
Irgendwo in dem img.. datei wird das title Tag definiert, dort musste damnn wohl einfach ein clean_slweg() um die Variable jagen und die Html dinger verschwinden aus der anzeige.

Re: Lightbox anpassen (html in lightbox caption) [SOLVED]
Posted: Tue 5. Feb 2008, 22:19
by Jensensen
ja klar, aber dann ist der --> title im zweifelsfall bei --> allen CPs, die ein -->image ausgeben, --> futsch !!??
[edit]
ne, warte, umgekehrt - ähh, dann ist der title --> leer !!??
[/edit]
[edit]
nee, nicht leer, aber voll mit plain text ohne punkt und komma...
gut, geht zur not || stell dir vor, du hast einen table im caption-feld, dann knallt's alle td inhalte aneinander???!??
[/edit]
Re: Lightbox anpassen (html in lightbox caption) [SOLVED]
Posted: Tue 5. Feb 2008, 22:31
by phalancs
ich weiss nicht 100 pro was diese funktion alles rausschmeisst, aber für das, was ich den Captions zumute funzt es bisher (und ne Tabelle gehört da nicht dazu)

Also mir ging es primär darum in die Captions einen Link und ggf. ein Bild reinzubasteln. das mit dem Link funktioniert und das mit dem Bild hab ich noch nich getestetm, aber da bin ich mal ganz optimistisch.
P.S. Auf dieses title Tag könnte ich sowieso komplett verzichten, da es bei der Lightbox irgendwie irrelevant ist. Wenns also da Probleme gibt, dann schmeiss ich es auch raus. Abe rmit dem Cleaning hat es bisher gut geklappt.
Re: Lightbox anpassen (html in lightbox caption) [SOLVED]
Posted: Tue 5. Feb 2008, 22:42
by Jensensen
pragmatism practised by pragmatist

Re: Lightbox anpassen (html in lightbox caption) [SOLVED]
Posted: Tue 5. Feb 2008, 22:57
by phalancs
So wird man wen man lange mit diesem system arbeitet.

Re: Lightbox anpassen (html in lightbox caption) [SOLVED]
Posted: Tue 5. Feb 2008, 23:23
by Jensensen
schon richtig!
halte aber gleichsam für wichtig, dass es für alles und immer [und kunde] fluppt....
sozusagen --> proofed, generalized und workflow optimized
[ich krieg immer haue von ollie, wenn ich inne files rum mache....]
Re: Lightbox anpassen (html in lightbox caption) [SOLVED]
Posted: Tue 5. Feb 2008, 23:35
by phalancs
hehe, genau deswegen mach ich das ja so. Anders fluppt es ja für den Kunden nicht. Ja ansonsten geb ich Dir völlig recht, Corechanges sollte man vermeiden. Diesem "sollte" hab ich aber vor zwei Jahren abgeschworen.
Daher kaqm auch mein Zusat, dass man das nur machen soll, wenn man weiss was man tut. Wie ss immer so ist mit Hacks und Co

Re: Lightbox anpassen (html in lightbox caption) [SOLVED]
Posted: Wed 6. Feb 2008, 00:15
by Jensensen
phalancs wrote:...dass man das nur machen soll, wenn man weiss was man tut...
Japp
phalancs wrote:ich weiss nicht 100 pro was diese funktion alles rausschmeisst...
ist dir dabei die "gepimpte v1.2.6" noch nie um die ohren geflogen???
Re: Lightbox anpassen (html in lightbox caption) [SOLVED]
Posted: Wed 6. Feb 2008, 00:37
by phalancs
Nein, ist noch nie etwas um die Ohren geflogen.
Das hab ich salopp so geschrieben, da ich in diesem Falle nur nachgeschaut ob es für meinen Zweck reicht. Und das tut es. Sorry, aber ohne meine Standard-Veränderungen im Kern wäre phpwcms für mich nur halb so viel Wert. Schön ist das nicht. Aber gerade da ich jetzt einmal eine Seite nicht auf meiner "gepimpten 1.2.6" aufbaue, fällt mir das wieder schmerzlich auf.