Bild einfügen / Insert image

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
droptix
Posts: 8
Joined: Tue 7. Dec 2004, 16:58

Bild einfügen / Insert image

Post by droptix »

Wenn ich in einen Artikel einen neuen Inhalt vom Typ "Bilder" einfüge, öffnet sich ein neues PopUp-Fenster mit den verfügbaren Dateien. Nach der Bildauswahl schließt sich das PopUp immer gleich wieder. Möchte ich mehrere Bilder auf einmal einfügen, muss ich jedes Bild einzeln hinzufügen. Ich möchte einen kleinen Patch schreiben und für den Quellcode zur Verfügung stellen, damit auch mehrere oder auch alle Bilder eines Ordners auf einmal eingefügt werden können (nützlich für Galerien).

Dafür brauche ich folgende Info: Wenn sich das PopUp öffnet, weiß es dann, ob der Inhaltstyp "Bilder" angeklickt wurde? Wenn ja, welche Variablen (und Werte) verraten das? Ansonsten müsste man für diesen Fall nämlich noch eine Variable per $_GET an das PopUp übergeben, um das unterscheiden zu können.

--

When I create new content for an existing article of the type "images" a new popup-window is opened showing all available files. After selecting an image the popup-window closes immediately. If I want to select more than one images, I have to open the popup each time and insert every image singly. For this reason I want to write a little patch and offer it for inclusion into the sourcecode. It shall that solve this problem and allow more than one image to select (useful for galleries).

But I need some more information: When the popup-window opens, does it know that the selected content-type was "images"? If yes, which variables (and vaues) reveal this info? Otherwise you would have to add another $_GET variable by opening the popup-window.
rushclub
Posts: 915
Joined: Tue 17. Feb 2004, 18:52

Post by rushclub »

einfach auf das plus drücken, dann geht das fenster nicht zu.

rush
3 (!) Jahre warten reichen mir. Ich bin erst mal weg.
droptix
Posts: 8
Joined: Tue 7. Dec 2004, 16:58

Post by droptix »

Okay, danke. Löst aber trotzdem nicht die Frage :D denn ich möchte auch mit einem Klick den ganzen Ordner rüberschaufeln und nicht jedes Bild einzeln hinzufügen.
droptix
Posts: 8
Joined: Tue 7. Dec 2004, 16:58

prePatch

Post by droptix »

Diese drei Code-Schnipsel reichen aus, um den gewünschten Effekt zu erzielen. Allerdings soll der "ALLE" Button nur erscheinen, wenn auch mehrere Bilder eingefügt werden können. Deswegen brauche ich die oben gefragte Info.

--

These three code-snippets last out for the desired effect. But the "ALL"-button only shall be available if more than one image can be selected. This for I need the information asked above.

Code: Select all

phpwcms Development release 1.2.3 [phpwcms_1.2.3-DEV.zip]

-- description --

Patch for adding all files of a folder. Useful for creating galleries.

-- installation/configuration --

Insert the following code in or after the given line.

-- code --

IN line 26 (empty):

$addAllFiles = "<div style=\"position:absolute; top:5px; left:279px;\"><a href=\"javascript:;\" onClick=\"";

IN line 255 (empty):

$addAllFiles .= $js;

AFTER line 284 (press enter, then insert):

<?php
$addAllFiles .= "\">ALLE <img src=\"img/button/add_9x9a.gif\" width=\"9\" height=\"9\" border=\"0\"></a></div>";
echo($addAllFiles);
?>
droptix
Posts: 8
Joined: Tue 7. Dec 2004, 16:58

phpwcms_1.2.5-DEV

Post by droptix »

Hier derselbe Kram für die neue Version 1.2.5 und zukünftige Versionen. / Here the same stuff for the new version 1.2.5 and future versions:

Code: Select all

phpwcms Development release 1.2.5 [phpwcms_1.2.5-DEV.zip]

-- description --

Patch for adding all files of a folder. Useful for creating galleries.

-- installation/configuration --

File: filebrowser.php

Insert the following code in or after the given line.

-- code --

1.2.5-DEV: IN line 27 (empty):

Für die Zukunft / For the future: Such dir eine leere Zeile oder erstelle eine neue irgendwo am Anfang der Datei, z.B. nach den session-Funktionen und allen Includes, aber noch vor der ersten Aktion. / Choose an empty or make a new line somewhere at the beginning of the file, for example after the session-functions and all includes but before the first action.

$addAllFiles = "<div style=\"position:absolute; top:5px; left:279px;\"><a href=\"javascript:;\" onClick=\"";

1.2.5-DEV: IN line 257 (empty):

Für die Zukunft / For the future: In der Datei kommt eine switch-Funktion mit mehreren case-Anweisungen vor. In dieser switch-Funktion wird das JavaScript für jedes Thumbnail erstellt. Danach hängen wir das fertige JS einfach an unsere frisch erstellte Variable ran. / In the file appears a switch-function with several case-instructions. Inside this switch-function the JavaScript for each thumbnail is generated. After that we append the JS to our fresh defined variable.

$addAllFiles .= $js;

1.2.5-DEV: AFTER line 296 (press enter, then insert):

Für die Zukunft / For the future: Ziemlich am Ende wird der HTML-Code mit dem </html>-Tag geschlossen. Davor wird die letzte Tabelle geschlossen. Die beste Position für den neuen "ALLE"-Button wäre nach dem letzten HTML-Element aber noch vor dem </body> Tag. / Pretty at the end the HTML-code is closed by the </html> tag. Before it the last table is closed. The best position for the new "ALL"-button would be a place after the last HTML-element but before the closing </body>-tag.

<?php
$addAllFiles .= "\">ALLE <img src=\"img/button/add_9x9a.gif\" width=\"9\" height=\"9\" border=\"0\"></a></div>";
echo($addAllFiles);
?>
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Post by Kosse »

Hi droptix,

nice thing, usefull! I'll try it.

Thx
Cheers
flo
Posts: 5
Joined: Sun 23. Oct 2005, 02:12
Location: Frankfurt am Main
Contact:

Post by flo »

Hey droptix,

funktioniert einwandfrei, nur zu empfehlen, kann einem viel Arbeit abnehmen :-)

Gruß,
Flo
Post Reply