Make Lightbox 1.0 simple enhancement for phpwcms contentpart

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Re: small update code - lightbox per page

Post by marcus@localhorst »

kolja wrote:i decided not to have the lightbox-code in my template, but on every page i like. so i modified the script the way that it only inserts light-box-usable code, if the lightbox.js-file is included in page's code.
Since some days I have a fix for that. (adding script only if wanted) But I was thinking about release a package for quicker install, or just provide the code?! :-/

normally it's no problem to have the JS inside every page, because it is cached, or does it crash with other JS scripts?

i will provide it in the next days.
best marcus
ab_01
Posts: 6
Joined: Wed 16. Aug 2006, 11:10

lightbox funktioniert nicht

Post by ab_01 »

Habe das selbe Problem wie vello - im CP Bilder funktioniert lightbox nicht, wenn ich jedoch einen HTML-CP nehme und den entspr. Tag hineinschreibe wird lightbox angesprochen. Wo ist da was falsch?
kolja
Posts: 43
Joined: Sun 19. Mar 2006, 13:40

Re: lightbox funktioniert nicht

Post by kolja »

ab_01 wrote:Habe das selbe Problem wie vello - im CP Bilder funktioniert lightbox nicht, wenn ich jedoch einen HTML-CP nehme und den entspr. Tag hineinschreibe wird lightbox angesprochen. Wo ist da was falsch?
im CP Bilder mußt Du doch eigentlich gar nichts anderes tun als einfach nur die Bilder einfügen? Hängst Du die Bilder im HTML-CP manuell rein?

ideen:
1.) prüfen, ob du wirklich den quelltext für die render-php 1:1 genommen hast (der fehler ist mir passiert - habe nachträglich was eingefügt von dem ich dachte, das ist noch nicht drin. das original am threadanfang paßt!;)
2.) laß dir mal den seitenquelltext der generierten seite anzeigen. zwei dinge mußt du finden:
- die eingebundenen JS-dateien samt CSS-einbindung
- bei jedem bild das rel="lightbox"
3.) ich hatte ein problem mit der $version-variable im render-skript. die ist - wenn ich mich richtig erinner - global deklariert. in der methode wird sie dann benutzt, aber evtl. nicht mehr erkannt. setz sie notfalls mal in der methode direkt vor prüfung auf den wert, den du benötigst

nur schnelle ideen... viel erfolg
ab_01
Posts: 6
Joined: Wed 16. Aug 2006, 11:10

Post by ab_01 »

Hallo kolja,

danke für deine Bemühungen. Hänge die Bilder im HTML-CP nicht manuell ein - habe ich nur probiert, da vello geschrieben hat, dass es damit bei ihm gegangen ist - das funktioniert auch bei mir, nur im CP Bilder nicht. Wenn ich mit der Maus auf ein Bild fahre, wird immer die Datei image_zoom.php aufgerufen.
Habe nochmals den Quelltext für die render-php vom Anfang hochgeladen, auch alle anderen Dateien der lightbox-zip.
Im Quelltext sehe ich jedoch kein rel=lightbox bei jedem Bild! - Vielleicht mache ich da wo einen Fehler.
Im Seitenheader habe ich die js - und css-Dateien so eingebunden, wie sie bei lightbox auf der Site angeboten werden. Mittlerweile habe ich ein "./" davor gesetzt - hat aber auch nichts gebracht.
Ich glaube, dass diese garnicht eingebunden werden.

Ich muss jetzt leider weg, aber vielleicht hast du (oder jemand anderer) noch irgendeine Idee.

Besten Dank jedenfalls.
Andreas
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Post by marcus@localhorst »

wenn immernoch die zoom_image.php für die links gezeigt wurde, dann wird die Bildertabelle nicht erkannt. Hast du eine phpwcms version 1.2.x ? (die 1.2.9 preview habe ich noch nicht angeschaut)
hast du diesen schritt nachvollzogen?
4. open the config/phpwcms/conf.template_default.inc.php
check the value $template_default["article"]["imagelist_class"]
is it imagelisttd? good!
it can be any other class name, but with that, we will detect the image gallery.
UPDATE: If you need to display the Caption in Lightbox, check if
$template_default["article"]["imagelist_caption_class"] = "imglistcaption";
again, it could be any other classname, but then you need to change the
variables on top of the updated Codesnipped

To find out, how much Picture-CP are present on the actual site, we need to give a classname for the gallerytable, too
$template_default["article"]["imagelist_table_class"] = "imagegallery";
it could be any other classname, but then you need to change the
variables on top of the up-updated Codesnipped

Code: Select all

$imagecpclass   = "imagegallery";
$imagecellclass = "imagelisttd";
$imagecaptclass = "imglistcaption"; 
hast du diese variablen wie oben beschrieben, richtig gesetzt?


schau im quelltext nach, die CSS Klasse der Bildertabelle sollte gesetzt sein, die Bildertabellenzelle und die Klasse der Bildbeschreibung.

Diese angaben sich wichtig damit das skript weiss "Aha, hier Lightbox anwenden"

ansonsten schick mir einen link auf deine seite oder den quellcode.

grüße
marcus
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Post by marcus@localhorst »

@all - please check starting thread for Update!
http://www.phpwcms.de/forum/viewtopic.php?p=75912#75912
ab_01
Posts: 6
Joined: Wed 16. Aug 2006, 11:10

Post by ab_01 »

Hallo Marcus,

komme leider erst jetzt dazu, mich um deine Antwort zu kümmern. Hab jetzt nochmals alles überprüft, mir wäre kein Fehler aufgefallen (bez. conf.template_default.inc.php).
Wenn ich den Quelltext ansehe sieht's so aus:

Code: Select all

<table border="0" cellspacing="0" width="1%" cellpadding="0" summary="406"  class="imagegallery">
<tr><td class="imagelisttd">
<a href="image_zoom.php?show=NjQxNzhmNzVmZjNiNWFjMWMwM2RiYTA5MTJjYTAzMGQuanBnP3dpZHRoPSI1MzgiIGhlaWdodD0iNDA0Ig%3D%3D" onclick="checkClickZoom();clickZoom('image_zoom.php?show=NjQxNzhmNzVmZjNiNWFjMWMwM2RiYTA5MTJjYTAzMGQuanBnP3dpZHRoPSI1MzgiIGhlaWdodD0iNDA0Ig%3D%3D','previewpic','width=538,height=404');return false;"><img src="content/images/f4f76646b66d00c64a2693fa55b5fa24.jpg" width="190" height="143" border="0" class="imagelistimg" alt="Mitarbeiter der Bäckerei Bruckner" title="Mitarbeiter der Bäckerei Bruckner" /></a>
</td>
</tr>
<tr>
<td><img src="img/leer.gif" width="1" height="10" border="0" alt="" /></td></tr>
<tr><td class="imagelisttd">
<a href="image_zoom.php?show=OTM3ZDI4MWVkMGNmOGRjOTNiMDkxZWUwMTI4ZGNlZDMuanBnP3dpZHRoPSIzNjIiIGhlaWdodD0iNTQwIg%3D%3D" onclick="checkClickZoom();clickZoom('image_zoom.php?show=OTM3ZDI4MWVkMGNmOGRjOTNiMDkxZWUwMTI4ZGNlZDMuanBnP3dpZHRoPSIzNjIiIGhlaWdodD0iNTQwIg%3D%3D','previewpic','width=362,height=540');return false;"><img src="content/images/72536f349cf5e9080a42959ec195900e.jpg" width="190" height="283" border="0" class="imagelistimg" alt="frische Faschingskrapfen" title="frische Faschingskrapfen" /></a>
</td>
</tr>
Phpwcms-Version ist: phpwcmsxt - v020
ist da eventuell etwas anders?

Danke für deine Bemühungen
Andreas
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Post by marcus@localhorst »

soso, phpwcmsxt... :-)

mmh, ich kenne das system soweit nicht und ich weiss nicht was da wie modifiziert wurde, aber wenn das dein output ist, dann unterscheidet es sich vom orginal dahingehend, das da mehr zeilenumbrüche drin sind.
damit wird das suchmuster nicht mehr erfüllt.

Bitte versuche folgendes:

Du findest in meinem Script diese Angaben:
$search ='#<td class="'.$imagecellclass.'">(.*)<\/td>#U'; // U = ungreedy
...
$searchcapt ='#<td class="'.$imagecaptclass.'">(.*)<\/td>#U'; // U = ungreedy

$linkfind ='#<a href="image_zoom.php\?show=(.*)".*[^>]>(.*)</a>#Ue';
Ändere #U zu #Us
Das schaltet den Multiline Modus an. (der letzte Eintrag sollte #Use sein!)

geb bescheid was passiert ;-)
danke
Marcus
ab_01
Posts: 6
Joined: Wed 16. Aug 2006, 11:10

Post by ab_01 »

Hallo Marcus,

erstmals besten Dank für deine Unterstützung - die Änderung hat soweit funktioniert, dass anstelle vom zoom_img.php jetzt lightbox aufgerufen wird - allerdings bleibts beim Aufruf - die Bilder werden nicht geladen.
In der unteren Browser-Zeile habe ich gesehen, dass die Bilder gleich direkt unter der tld (also http://www.meinedomain.tld/xxx.jgp) geladen werden wollen. Befinden sich diese nicht im Ordner content/images?

lg
Andreas
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Post by marcus@localhorst »

ab_01 wrote:Hallo Marcus,

erstmals besten Dank für deine Unterstützung - die Änderung hat soweit funktioniert, dass anstelle vom zoom_img.php jetzt lightbox aufgerufen wird - allerdings bleibts beim Aufruf - die Bilder werden nicht geladen.
In der unteren Browser-Zeile habe ich gesehen, dass die Bilder gleich direkt unter der tld (also http://www.meinedomain.tld/xxx.jgp) geladen werden wollen. Befinden sich diese nicht im Ordner content/images?

lg
Andreas
das ist n komischer bug.
suche nach diesem Teil:

Code: Select all

if ($version != 0){
 $img = $GLOBALS["phpwcms"]["content_path"]."images/".$img; // this is the full picturepath for phpwcms v1.2.x
}else{
$img = $GLOBALS["phpwcms"]["file_tmp"]."".$GLOBALS["phpwcms"]["dir_preview"]."".$img;
} 
und ersetze ihn durch

Code: Select all

 $img = $GLOBALS["phpwcms"]["content_path"]."images/".$img; // this is the full picturepath for phpwcms v1.2.x 
die Versionsunterscheidung ist asche, weiss auch nicht was ich mir dabei gedacht habe ;-)
ab_01
Posts: 6
Joined: Wed 16. Aug 2006, 11:10

Post by ab_01 »

Hallo Marcus,

Wahnsinn - funktioniert. Ich danke dir für deine Unterstützung von mir Ahnungslosen.

Besten Dank
Andreas
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Post by marcus@localhorst »

ab_01 wrote:Hallo Marcus,

Wahnsinn - funktioniert. Ich danke dir für deine Unterstützung von mir Ahnungslosen.

Besten Dank
Andreas
kein problem, war ja im letzten falle mein fehler ;-)
User avatar
anthony.abraira
Posts: 99
Joined: Sun 11. Sep 2005, 07:42
Location: Mars Hill, NC
Contact:

Another method

Post by anthony.abraira »

I have successfully installed this feature to my image content part. However, I find this will be better if you can bunch a group of images under a series of pics. For example I would like to create the image content part and the top image be the one displayed. However on the frontend once clicked, it would open the series of images. This will permit me to format my page more precisely and group the necessary images in a contained series. Is this possible? Do you know of anybody that is doing this?

8)
"The trick is living without an answer."
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Post by marcus@localhorst »

If I understand right, you want to have one pic which hold the slidshow of the other pics on click?
i think it is possible with rewriting my code.
(detecting the first pic in loop and hiding the others via css, but maybe there are problems with the table structure?!
it would be better if the gallerydata (pictures etc) would turn into an array for free use.
maybe I will do this later)

what I did, some month ago, is hacking the Picture CP to use it with mooshow.
I could send you the hacked file if you want (but then, every Picture CP will be mooshow'ed).

greetings
marcus
breitsch
Posts: 473
Joined: Sun 6. Mar 2005, 23:12
Location: bern switzerland

Post by breitsch »

Hi

Thats how I integrated Lightbox (and more) in phpwcms:
So you can choose for each CP Images what display-option for frontend you like! No further settings necessary!

Image

It's lot of hard-code hacking.
If interested plaese PM me.
http://www.youtube.com/watch?v=jqxENMKaeCU
because it's important!
breitsch
Post Reply