4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: om6acw on February 23, 2006, 07:54:23 AM
-
It is possible to make something like this http://coppermine-gallery.net/forum/index.php?topic=18759.0 for 4image gallery ?
-
I didnt get what does it represent and what is it for? what use of it?
-
http://www.luminous-landscape.com/tutorials/understanding-series/understanding-histograms.shtml
-
I didnt get what does it represent and what is it for? what use of it?
That script is to make a graph created from picture and show if it is overexposed or underexposed, that mod is used freqently by photographers.
-
that mod is used freqently by photographers.
:?: so the first question should be : is there a php script (or a class or any other script) which is able to do a picture histogram (like a digital camera :wink: ) ? so if the answer is no, surely it means that it should not be easy to do it. but who knows?
well, i think it's possible with GD or imagemagick but for the moment, all the questions i found on the net about this have no answer....
...for the moment... :roll:
-
there is a file:
http://www.phpclasses.org/browse/file/4643.html
The problem would be to integrate it into 4images. Thats where v@no or any other good coder can help, if he want to.
-
hmmm - why do you need this - just because it could be possible!
a fotografer have to controll his picture at home, where he could do some corection, and not on a Server in the web.
sincerly
vincent
-
a fotografer have to controll his picture at home, where he could do some corection, and not on a Server in the web.
But...that mod is for server...for the home people are using photoshop ;)
-
@V@no
so it is more a fun function - because you can't change a uploadet picture on the server! :?
vincent
-
hmmm - why do you need this - just because it could be possible!
a fotografer have to controll his picture at home, where he could do some corection, and not on a Server in the web.
sincerly
vincent
I dont need that for corection of pictures on server, I need to show histogram because I want to show to customer that picture is corectly exposed. There is no way to see how a picture is exposed without histogram.
-
that mod is used freqently by photographers.
:?: so the first question should be : is there a php script (or a class or any other script) which is able to do a picture histogram (like a digital camera :wink: ) ? so if the answer is no, surely it means that it should not be easy to do it. but who knows?
well, i think it's possible with GD or imagemagick but for the moment, all the questions i found on the net about this have no answer....
...for the moment... :roll:
php script is here :
<?php
// Histogram creation
// Created by Anton Sparrius (Spaz) 6/9/05 anton_spaz@yahoo.com
// Free to use and change, provided you keep these lines :)
//
$image = $_REQUEST['image'];
$filepath = $_REQUEST['filepath'];
$path = "albums/".$filepath;
$hist_file="hist_".substr($image,0,strlen($image)-4).".png";
if (file_exists($path.$hist_file)) {
$im=imagecreatefromPNG($path . $hist_file);
imagePNG($im);
imagedestroy($im);
} else {
$im=imagecreatefromjpeg($path.$image);
for($i=0;$i<imagesx($im);$i+=2)
{
for($j=0;$j<imagesy($im);$j++)
{
$rrggbb=imagecolorsforindex ($im, imagecolorat($im,$i,$j));
$r[$rrggbb['red']]+=1;
$g[$rrggbb['green']]+=1;
$b[$rrggbb['blue']]+=1;
}
}
for ($i=0;$i<256;$i++)
{
$max[$i]=($r[$i]+$g[$i]+$b[$i])/3;
}
$max_value=max($max)/150;
$m[0]=max($r);
$m[1]=max($b);
$m[2]=max($g);
$max_rgb=max($m)/150;
$im_out = imageCreate (280, 164);
$background = imageColorAllocate($im_out,70,70,70);
$hist=ImageColorAllocate($im_out,171,205,239);
$white=ImageColorAllocate($im_out,255,255,255);
$red=ImageColorAllocate($im_out,255,0,0);
$green=ImageColorAllocate($im_out,0,255,0);
$blue=ImageColorAllocate($im_out,0,0,255);
$ry=107;
$gy=107;
$by=107;
for($i=0;$i<256;$i++)
{
imageLine($im_out, $i+14, 157, $i+14, 157-($max[$i]/$max_value),$white);
imageLine($im_out, $i+13, $ry, $i+14, 157-($r[$i]/$max_rgb), $red);
imageLine($im_out, $i+13, $gy, $i+14, 157-($g[$i]/$max_rgb), $green);
imageLine($im_out, $i+13, $by, $i+14, 157-($b[$i]/$max_rgb), $blue);
$ry=157-($r[$i]/$max_rgb);
$gy=157-($g[$i]/$max_rgb);
$by=157-($b[$i]/$max_rgb);
}
imageLine($im_out,13,158,270,158,$hist);
imageLine($im_out,13,6,270,6,$hist);
imageLine($im_out,13,6,13,158,$hist);
imageLine($im_out,270,6,270,158,$hist);
imagePNG($im_out,$path . $hist_file);
imageDestroy($im);
imagedestroy($im_out);
$im=imagecreatefromPNG($path . $hist_file);
imagePNG($im);
imagedestroy($im);
}
?>
but I dont now how I can put this to 4image
On coppermine gallery looks like this (see attachment)
-
Histogramm in 4images :
Die Diskusion ist sicher berechtigt, in wie weit die Präsentation des Histogramms zu einem Bild auf der Website sinnvoll ist. Wer dieses Tool also auf seiner Website einsetzen möchte, sollte sich das vorher klar machen. Ich denke aber in einer "Fotografen-Galerie" kann man davon zur Bildbeurteilung durchaus Gebrauch machen, zumal die User die sich auf so einer Website tummeln sicher auch etwas damit anfangen können. Auf der anderen Seite kann man sich heute bereits in den Digicams das Histogramm zum frisch geschossenen Bild anzeigen lassen.
Ich habe das Histogramm für 4images mal mit folgendem Ergebnis umgesetzt :
Zu sehen und zu testen hier : Test Histogramm in 4images (http://klick.kl.funpic.de/details.php?image_id=20)
In dem von mir modifizierten details.php-Code für das Histogramm können die Dateitypen festgelegt werden, für die das Histogramm angezeigt werden soll, da nur eine beschränkte Dateien-Auswahl dafür in Betracht kommt. Sinnvoll sind hier sicher nur Dateien mit der Extensionen ... *.jpg und *.jpeg ! Doch die Auswahl steht dir zur Konfiguration offen.
Für die Umsetzung wäre nun folgendes zu erledigen.
[edit_10.02.2010]
Habe die hier ursprünglich veröffentlichte Version entfernt, da diese noch nicht ausgereift war. Obwohl das hier vermerkt war, wurde trotzdem immer wieder versucht diese Version zu installieren, obwohl ich hier bereits auf eine ausgereifte Version zum Download hingewiesen hatte. Da ich nicht immer wieder darauf in diesem Thread hinweisen will und mir anhören muss ... funktioniert nicht ... habe ich diese Vorversion entfernt.
[/edit_10.02.2010]
P.S. zur Arbeitsweise dieser Modifikation :
- mit Aufruf der Detailseite wird nach dem Check des Dateityps über die histo.php das Histogramm als Bilddatei erzeugt
- dieser Vorgang kann u.U. etwas Zeit in Anschruch nehmen bis das Histogramm auf der Detailseite angezeigt wird
- diese Histogramm-Datei hist_dateiname.png wird dann im gleichen Ordner wie das Original-Bild gespeichert
- bei wiederholtem Aufruf der Detailseite wird nun das bereits vorhandene Histogramm als Bild geladen
- dieser Vorgang verläuft dann natürlich schneller
@all
... I redesigned this MOD with some fixes ...
... you can download all neccesary files and the installations instruction ... Download - MOD Histogram (http://klick.kl.funpic.de/files.php?id=29) ...
@alle
... ich habe den MOD neu gestaltet mit einigen Fixes ...
... du kannst alle notwendigen Dateien und die Installationsanweisung downloaden ... Download - MOD Histogramm (http://klick.kl.funpic.de/files.php?id=29) ...
Beispiel / Example :
Hier ein mit dem aktuellen MOD generiertes Histogramm von dem Bild, welches auch über den oben aufgeführten Test-Link zu sehen ist ...
(http://klick.kl.funpic.de/bilder/histogram_sample.png)
-
@mawenzi : It seems very good...
:?: Is there a chance to get it in english ? :wink:
Thanks!
-
wow! thank you very much for this!
-
thanks a lot mawenzi :!: :!: :!:
-
hey mawenzi,
wouldn't it be better if you post it then in an seperate mod thread?
-
@ cheribibi,
an English translation is coming soon ... :wink:
@Loda,
warst ja wieder schneller als die Polizei erlaubt, danke für das Testen ... :mrgreen:
@om6acw,
tried my best ... found your inquiry very interesting ... :D
@ IcEcReaM,
nach dem Vorgeplänkel habe ich nicht gedacht, dass ein allgemeines Interesse besteht bzw. sich entwickeln könnte. Hast natürlich Recht ... :wink: . Werde mit der englischen Übersetzung die Sache als MOD posten ... :!:
mawenzi
-
@ IcEcReaM,
nach dem Vorgeplänkel habe ich nicht gedacht, dass ein allgemeines Interesse besteht bzw. sich entwickeln könnte. Hast natürlich Recht ... :wink: . Werde mit der englischen Übersetzung die Sache als MOD posten ... :!:
mawenzi
naja unterschätze mal die User nicht, die bauen sich alles ein, was sie bekommen können..^^
Aber mal ernst, ist denke ich immer besser, sowas als Mod zu posten,
da es dann bei der Suche nacher einfach ist,
wenn man gleich erkennen kann, dass es sich bei dem Thread um einen Mod handelt.
-
hallo!
i want to change the background for the histogramm. i want to insert an image as background for it. how can i do this?
-
Replace
$im_out = imageCreate (280, 164);
with:$im_out = imageCreateFromPNG ("background.png");
then upload your background.png image into same directory where histo.php is.
P.S. make sure the image is 280x164
-
jepp... thank you!
-
And how accurate this histogram is? can someone compare it with some software that also has histogram?
-
And how accurate this histogram is? can someone compare it with some software that also has histogram?
For me looks exactly same :
http://www.myanimalsworld.com/sk/details.php?image_id=147
-
And how accurate this histogram is? can someone compare it with some software that also has histogram?
exactly the same! i think...
1. screenshoot of an imageprogram
2. scrennshoot of the histogram in 4images
-
Great!
There are some ways to improve this:
1) instead of sending the image path to histo.php, send only the image id and let histo.php get all needed info about where the image is. This also will help people who is using the code from "pic security" topic that hides real path of the images.
2) caching the historgram images. As far as I understood the code of histo.php, it scans every single pixel in the image and it is quiet havy for a server. So saving the result into a file and then showing the saved image would improve the perfomance, but will take up more space on the server...
[EDIT]
never mind my 2) note...its already present... :oops:
-
Great!
... it works (http://klick.kl.funpic.de/details.php?image_id=3092) really great ... !
... This also will help people who is using the code from "pic security" topic that hides real path of the images.
... but where is the real path shown ... ?
... hist_path is also needed for hist_file (histo.png) ... ! ... or you stores the histo.png's in a new / extra folder ...
... like always ... there are several ways / solutions ...
[EDIT]
never mind my 2) note...its already present... :oops:
... :mrgreen: ...
-
... but where is the real path shown ... ?
... hist_path is also needed for hist_file (histo.png) ... ! ... or you stores the histo.png's in a new / extra folder ...
... like always ... there are several ways / solutions ...
this path:[qcode]histogramm.php?hist_image=kilimanjaro_axxxxi_2.jpg&hist_path=data/media/XX/&hist_file=02_hist_kilimanjaro_axxxxi_2.png[/qcode](filename and path altered in this example)
-
V@no ... you are right ... like always ... :!:
I've changed the code in details.php and histogramm.php ... and now is only send the hist_image_id to histogramm.php ... that's saver .
It works (http://klick.kl.funpic.de/details.php?image_id=3092) really greater ... !
and no path is shown ...
histogramm.php?hist_image_id=xxxx
thanks for the reference ...
-
Replace $im_out = imageCreate (280, 164);
with:$im_out = imageCreateFromPNG ("background.png");
then upload your background.png image into same directory where histo.php is.
P.S. make sure the image is 280x164
well i guess all the code is based on this size... so all graphics are drawn referring to this size...
... and how can i change the size of the output history picture (with graphics..)?
-
... and how can i change the size of the output history picture (with graphics..)?
... you can change width and height for 'imageCreate' ...
... but then you must adapt also the coordinates in all 'imageLine' to your new width and height ...
... but the inner coordinates for width=255 should not be changed i.m.o. ...
... it is the graph from left (darkest) to right (brightest) ("RGB-Farbraum" ... 8 Bits ... 0 - 255 ... 28=256 ) ...
... you can change through test ...
But I found some other little problems.
... by saving the hist_xxx.png in the cat-folders you find all these images in APC -> Check new images ... :?
... but when we save all the hist_'image_media_file'.png in a new folder e.g. /data/media/histo ... there can be also problems ...
... there is the possibility, that 2 pictures from different folders have the same file name ...
... and than is hist_'image_media_file'.png = hist_media_file.png in the same folder ...
... it sould be better we create the names of the histo.png with image_ids like hist_'image_id'.png ...
... and save the hist_'image_id'.png in /data/media/histo ...
I will try that in such a way ... or there are other suggestions ... :roll:
mawenzi
-
@mawenzi:
Try save all the files into one independent folder and name each file with image id.
For example if an image has ID 12568 the saved chache histogram image would have name 12568.png
I think that is the easiest way to do and no need to wory about creating additional folders for each category, etc ;)
-
so, after all small problems are solved (or there are still others ... ?) could now a MOD from it are made ... :D
-
yipeee... I'm waiting... :D
-
thanks a lot mawenzi :!: :!: :!:
kann mich nur anschliessen!
and a thx for vano (background)
http://hobby-fotografen.com/img1908.htm
-
@ V@no,
... and once again ... the most unusual histogram ... :wink: ...
... I knew, there is still coming something ...
-
I have make a Backgroundimage for the histogram.
Das ist schlichtweg falsch !
Du hast das Bild von meiner Seite kopiert und mit einer anderen Hintergrundfarbe versehen. Denn wenn du es erstellt hättest, dann wüstest du auch etwas mit den Koordinaten dazu anzufangen. Ich habe nichts dagegen, dass dieses Hintergrundbild zum Histogramm verwendet wird. Ich habe aber etwas dagegen, wenn jemand behauptet er hätte es erstellt obwohl er es definitiv nicht gemacht hat !
-
Ich habe oben bereits gesagt, dass ich nichts dagegen habe wenn das Bild verwendet wird.
Ich habe aber etwas gegen deine lächerlichen Ausführungen der Rechtfertigung. Du hast keine Ahnung von der Systematik der Koordinaten, warum das Hauptraster vom Unterraster versetzt ist, warum das Raster so beschriftet ist, welcher Schrifttyp da verwendet wird, angeblich warum das Bild incl. der Beschriftung deckungsgleich mit dem von mir erstellten Vorladebild ist (Du hast Schriftzeilen mit PS entfernt ... . Mein Histogramm-Bild wird komplett incl. Raster vom Script erstellt ... ohne Hintergrund.), geschweige denn wie die Histogramm-Linien in das Koordinatensytem passend integriert werden ... und schreibst dann so einen Müll ! Und sehe dir mal die letzten Beiträge an, die Wörter ... geklaut ... Dieb ... erscheinen nur bei dir !
kehre mal in dich ... mawenzi
-
genau das richtige Bild gefunden ... und wenn du dann noch richtig gelesen hättest ... es ist das Vorladebild ... dazu muss man aber wissen wie das Script läuft . Und ich sage es nochmals ( zum 3.mal ? ) : ich habe nichts dagegen wenn das Bild verwendet wird !
-
Frage zum Mod nochmal, nachdem ich nun doch wieder auch eingebaut habe.
Vielleicht habe ich es nun auf den drei Seiten übersehen, und einer hat schon mal diesbezüglich gefragt, aber wie sieht es aus, wenn ich ein Foto als Admin lösche? Das davon erstellte Histogramm bleibt bestehen, gelle? :?
-
... Das davon erstellte Histogramm bleibt bestehen, gelle? :?
... Ja .
-
hmmm...
Ist es dann möglich so was im Admin-Panel bei der Funktion Löschen von Bildern , das entsprechende histogramm zu löschen? sowas wie histo+{image_name} oder sowas.... Sonst hat man ja eines Tages unheimlich viele tote Bilder quasi auf seinem Server herumliegen oder muss immer mühevoll per FTP das entsprechende Bild separat löschen....
Dachte ja schon an die Lösung mit evtl. "Neue Bilder checken", aber das reagiert nicht auf die HISTO-Dateien....
-
Hallo,
habe nun auch versucht, dieses Script in 1.7.2 einzubinden.
Leider passiert hier irgendwie überhaupt nichts.
Lege ich in den Ordner 11 eine hist_PICT0011.png Datei, dann wird diese auch nicht angezeigt. Nur ein durchgestrichenes Bild mit dieser URL:
http://eiber.dyndns.biz/histo.php?hist_image=PICT0011.JPG&hist_file=hist_PICT0011.png&hist_path=data/media/11/
Die codes habe ich so eingefügt:
histo.php:
<?php
// Histogram creation
// Created by Anton Sparrius (Spaz) 6/9/05 anton_spaz@yahoo.com
// Free to use and change, provided you keep these lines :)
//
if (file_exists($hist_path.$hist_file)) {
$im=imagecreatefromPNG($hist_path . $hist_file);
imagePNG($im);
imagedestroy($im);
} else {
$im=imagecreatefromjpeg($hist_path.$hist_image);
for($i=0;$i<imagesx($im);$i+=2)
{
for($j=0;$j<imagesy($im);$j++)
{
$rrggbb=imagecolorsforindex ($im, imagecolorat($im,$i,$j));
$r[$rrggbb['red']]+=1;
$g[$rrggbb['green']]+=1;
$b[$rrggbb['blue']]+=1;
}
}
for ($i=0;$i<256;$i++)
{
$max[$i]=($r[$i]+$g[$i]+$b[$i])/3;
}
$max_value=max($max)/150;
$m[0]=max($r);
$m[1]=max($b);
$m[2]=max($g);
$max_rgb=max($m)/150;
$im_out = imageCreate (280, 164);
$background = imageColorAllocate($im_out,70,70,70);
$hist=ImageColorAllocate($im_out,171,205,239);
$white=ImageColorAllocate($im_out,255,255,255);
$red=ImageColorAllocate($im_out,255,0,0);
$green=ImageColorAllocate($im_out,0,255,0);
$blue=ImageColorAllocate($im_out,0,0,255);
$ry=107;
$gy=107;
$by=107;
for($i=0;$i<256;$i++)
{
imageLine($im_out, $i+14, 157, $i+14, 157-($max[$i]/$max_value),$white);
imageLine($im_out, $i+13, $ry, $i+14, 157-($r[$i]/$max_rgb), $red);
imageLine($im_out, $i+13, $gy, $i+14, 157-($g[$i]/$max_rgb), $green);
imageLine($im_out, $i+13, $by, $i+14, 157-($b[$i]/$max_rgb), $blue);
$ry=157-($r[$i]/$max_rgb);
$gy=157-($g[$i]/$max_rgb);
$by=157-($b[$i]/$max_rgb);
}
imageLine($im_out,13,158,270,158,$hist);
imageLine($im_out,13,6,270,6,$hist);
imageLine($im_out,13,6,13,158,$hist);
imageLine($im_out,270,6,270,158,$hist);
imagePNG($im_out,$hist_path . $hist_file);
imageDestroy($im);
imagedestroy($im_out);
$im=imagecreatefromPNG($hist_path . $hist_file);
imagePNG($im);
imagedestroy($im);
}
?>
details.php
//-----------------------------------------------------
//--- Show Image --------------------------------------
//-----------------------------------------------------
//--- Start Histogramm 27.02.2006 ----------------------
$hist_image = $image_row['image_media_file'];
$hist_file= "hist_".substr($hist_image,0,strlen($hist_image)-4).".png";
$hist_path = "data/media/".$cat_id."/";
$ext = substr($hist_image, strpos($hist_image, ".")+1, strlen($hist_image));
$AutorisedImageType = array ("jpg", "jpeg", "JPG", "JPEG"); // Dateitypen für die das Histogramm gezeigt werden soll
if (in_array($ext, $AutorisedImageType)) {
$histogramm_image = "<img src='histo.php?hist_image=".$hist_image."&hist_file=".$hist_file."&hist_path=".$hist_path."' border=\"1\">";
} else {
$histogramm_image = REPLACE_EMPTY;
}
$site_template->register_vars(array(
"histogramm" => "Histogramm:",
"histogramm_image" => $histogramm_image
));
//--- Ende Histogramm 27.02.2006 ------------------------
details.html
{if histogramm_image}
<tr>
<td valign="top" class="row1"><b>{histogramm}</b></td>
<td valign="top" class="row1">{histogramm_image}</td>
</tr>
{endif histogramm_image}
Die anderen codes sind von Seite1 übernommen worden
Irgendwie wird bei mir keine Datei erstellt und auch keine angezeigt
Hier noch der Testlink der Seite: http://eiber.dyndns.biz/details.php?image_id=55
Kann mir jemand von Euch bei diesem Problem weiterhelfen?
Danke im Voraus
Gruß
-
Halli Hallo,
geht mir ganz genau wie Dir.
Ich habe nun schon 5 mal hintereinander alles ein- und wieder ausgebaut, aber immer erscheint kein Histogram. Immer nur das durchgestriche Symbol.
Siehe hier http://mikeonline.name/gallery/details.php?image_id=6
Vielleicht hat ja jemand ne Idee an was es liegt.
-
ruft man bei dir auch die Seite auf http://mikeonline.name/gallery/histo.php?hist_image=DSC_0060.jpg&hist_file=hist_DSC_0060.png&hist_path=data/media/3/ kommen genauso diese Script Fehlermeldungen wie bei mir
Warning: imagesx(): supplied argument is not a valid Image resource in /var/www/web21/html/mike/gallery/histo.php on line 12
Warning: Wrong parameter count for max() in /var/www/web21/html/mike/gallery/histo.php on line 27
Warning: Wrong parameter count for max() in /var/www/web21/html/mike/gallery/histo.php on line 28
Warning: Wrong parameter count for max() in /var/www/web21/html/mike/gallery/histo.php on line 29
Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 45
Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 46
Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 47
Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 48
Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 49
Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 50
Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 51
Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 45
Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 46
Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 47
Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 48
Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 49
Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 50
Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 51
Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 45
usw........
gruß
-
:? Hmmm....
Also ihr habt euch genau an die Anleitung von Mawenzi gehalten, oder?
Auch Step 3.1 und 3.2?
Übrigens: Wieso kann ich mir dein Verzeichis auflisten lassen? Sind deine Schreib.- und Leserechte richtig gesetzt?
Wenn ich http://eiber.dyndns.biz/data/media/11/ eingebe im Browser, zeigt er mir den Inhalt dieses Verzeichnisses an. Sollte ja nicht sein, oder? :roll:
Vielleicht liegt es an den Schreib und Leserechte?
Ansonsten kann ich auch keinen Fehler momentan nachvollziehen...das histo.php ist richtig. Habe es mir dem hier vergliechen sowie mit meinem. Alles gleich bis auf das, das ich ein Hintergundbild verwende. Aber das sollte nicht der Fehler bei euch sein.
Ich denke mal, das der einzige, welcher euch dabei helfen kann, der Mawenzi ist.....
-
Also das mit den Berechtigungen passt, da ja das Verzeichnis von 4images so angelegt wird.
Hab das Script genauso eingebaut und die Zeilen gelöscht wie beschrieben... leider ohne Erfolg.
Das eizige was mich an der Anleitung verwunderte ist diese Zeile: $filepath .... in ... $hist_path umbenennen.
Wenn ich doch die 4 Zeilen löschen muss, dann hab ich keine Variable $filepath mehr in der histo.php
Gruß
-
A ha...Jetzt haben wir den Fehler.....evtl...
so ging es mir nämlich auch anfangs, das ich mich gewundert hatte, warum erst löschen und dann noch umbenennen, wenn nichts mehr da ist..
Das umbenennen ist aber vo anders gemeint. Du musst sämtliche "$filepath" in der histo.php in "$hist_path" umbenennen. Genauso alles andere...
Also alle "$image" variablen in "$hist_image"
alle "$path" in "$hist_path"
und alle "$filepath" in "$hist_path" umbenennen.
Durchsuch einfach deine histo.php nach diesen Variablen und benenne sie dann entsprechend um. Fertig.
Jetzt müsste es aber dann funtzen, oder?
-
Okay....Sehe gerade, das du bereits alle schon umbenannt hast....Ähmm, auf die Schnelle sehe ich nun auch keine Varaibale "$filepath" mehr, ausser in der Zeile, welche man aber löschen soll....
Also hier ist mal mein histo.php.:
<?php
// Histogram creation
// Created by Anton Sparrius (Spaz) 6/9/05 anton_spaz@yahoo.com
// Free to use and change, provided you keep these lines :)
//
if (file_exists($hist_path.$hist_file)) {
$im=imagecreatefromPNG($hist_path . $hist_file);
imagePNG($im);
imagedestroy($im);
} else {
$im=imagecreatefromjpeg($hist_path.$hist_image);
for($i=0;$i<imagesx($im);$i+=2)
{
for($j=0;$j<imagesy($im);$j++)
{
$rrggbb=imagecolorsforindex ($im, imagecolorat($im,$i,$j));
$r[$rrggbb['red']]+=1;
$g[$rrggbb['green']]+=1;
$b[$rrggbb['blue']]+=1;
}
}
for ($i=0;$i<256;$i++)
{
$max[$i]=($r[$i]+$g[$i]+$b[$i])/3;
}
$max_value=max($max)/150;
$m[0]=max($r);
$m[1]=max($b);
$m[2]=max($g);
$max_rgb=max($m)/150;
$im_out = imageCreate (280, 164);
$background = imageColorAllocate($im_out,70,70,70);
$hist=ImageColorAllocate($im_out,0,0,0);
$white=ImageColorAllocate($im_out,143,143,134);
$red=ImageColorAllocate($im_out,255,0,0);
$green=ImageColorAllocate($im_out,0,255,0);
$blue=ImageColorAllocate($im_out,0,0,255);
$ry=107;
$gy=107;
$by=107;
for($i=0;$i<256;$i++)
{
imageLine($im_out, $i+14, 157, $i+14, 157-($max[$i]/$max_value),$white);
imageLine($im_out, $i+13, $ry, $i+14, 157-($r[$i]/$max_rgb), $red);
imageLine($im_out, $i+13, $gy, $i+14, 157-($g[$i]/$max_rgb), $green);
imageLine($im_out, $i+13, $by, $i+14, 157-($b[$i]/$max_rgb), $blue);
$ry=157-($r[$i]/$max_rgb);
$gy=157-($g[$i]/$max_rgb);
$by=157-($b[$i]/$max_rgb);
}
imageLine($im_out,13,158,270,158,$hist);
imageLine($im_out,13,6,270,6,$hist);
imageLine($im_out,13,6,13,158,$hist);
imageLine($im_out,270,6,270,158,$hist);
imagePNG($im_out,$hist_path . $hist_file);
imageDestroy($im);
imagedestroy($im_out);
$im=imagecreatefromPNG($hist_path . $hist_file);
imagePNG($im);
imagedestroy($im);
}
?>
Kopier dir einfach mal diesen Code.....Vielleicht ist doch irgendwo ein Kommafehler drin oder sowas....
-
habe ich ja bereits getan ;)
Aber wenn ich diese Zeilen lösche:
$image = $_REQUEST['image'];
$filepath = $_REQUEST['filepath'];
$path = "albums/".$filepath;
$hist_file="hist_".substr($image,0,strlen($image)-4).".png";
dann habe ich keine weiter variable $filepath in der histo.php
Den Rest hab ich bereits umbenannt und zig mal kontolliert ob ich nichts vergessen habe.
Gruß
-
Danke Chicco für deine Hilfe.
habe nun deine histo.php online aber nach wie vor der selbige Fehler:
http://eiber.dyndns.biz/histo.php?hist_image=PICT0011.JPG&hist_file=hist_PICT0011.png&hist_path=data/media/11/
Warning: imagesx(): supplied argument is not a valid Image resource in C:\wwwroot\xampp\htdocs\histo.php on line 15
Warning: Wrong parameter count for max() in C:\wwwroot\xampp\htdocs\histo.php on line 30
Warning: Wrong parameter count for max() in C:\wwwroot\xampp\htdocs\histo.php on line 31
Warning: Wrong parameter count for max() in C:\wwwroot\xampp\htdocs\histo.php on line 32
Warning: Division by zero in C:\wwwroot\xampp\htdocs\histo.php on line 48
Warning: Division by zero in C:\wwwroot\xampp\htdocs\histo.php on line 49
Warning: Division by zero in C:\wwwroot\xampp\htdocs\histo.php on line 50
Warning: Division by zero in C:\wwwroot\xampp\htdocs\histo.php on line 51
Warning: Division by zero in C:\wwwroot\xampp\htdocs\histo.php on line 52
Warning: Division by zero in C:\wwwroot\xampp\htdocs\histo.php on line 53
Warning: Division by zero in C:\wwwroot\xampp\htdocs\histo.php on line 54
Warning: Division by zero in C:\wwwroot\xampp\htdocs\histo.php on line 48
Warning: Division by zero in C:\wwwroot\xampp\htdocs\histo.php on line 49
Warning: Division by zero in C:\wwwroot\xampp\htdocs\histo.php on line 50
Warning: Division by zero in C:\wwwroot\xampp\htdocs\histo.php on line 51
Gruß
Alex
-
HMMMMM :cry: :cry: :cry:
Also dann liegt es schon mal NICHT an der HISTO.PHP.......und wohl auch kaum an der Details.php....
Somit ein durchaus grösseres Problem, bei dem dir wohl echt nur einer helfen kann, wie ich bereits schon erwähnte....Der "Mawenzi".
Wenn es dann mal funktioniert, würde es mich trotzdem interessieren, an was es lag.
Sorry, das ich nicht helfen konnte....
Trotzdem einen schönen Sonntag. Auch wenn es gerade pisst....zumindest bei uns... :?
-
irgendwas muss es mit dem script aber zu tun haben.
gehe schon davon aus das es evt an der details.php liegt da wenn ich zub die zeile:
$hist_file="hist_".substr($image,0,strlen($image)-4).".png";
in die histo.php wieder übernehme, dann wird zumindest schon mal die hist_*imagename*.png angelegt die dann auch sichtbar ist.
Dieses dann aber im falschen Verzeichnis.
Histogramm wird aber keines erzeugt.
Vielleicht liegt es an der verwendeten PHP Version?
Hatte zuvor PHP5 mit deren schon das EXIF Script nicht funktionierte.
Und momentan verwende ich PHP4.4.1 mit diesen Optionen:
GD Support enabled
GD Version bundled (2.0.28 compatible)
FreeType Support enabled
FreeType Linkage with freetype
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
Gruß und Danke
Alex
-
Hallo zusammen,
gibt es nun schon eine Möglichkeit das das entsprechende Histogrammbild automatisch mit gelöscht wird, wenn ich eine Bilddatei lösche?
Cu
-
@ cheribibi,
an English translation is coming soon ... :wink:
When is the translation coming. :oops:
I get a red X and i don't know what to do or what it can be.
here you can see what i mean: http://wallpapers.sexy-picz.com/details.php?image_id=18
I hope if someone have a solution :lol:
-
Okay....Sehe gerade, das du bereits alle schon umbenannt hast....Ähmm, auf die Schnelle sehe ich nun auch keine Varaibale "$filepath" mehr, ausser in der Zeile, welche man aber löschen soll....
Also hier ist mal mein histo.php.:
<?php
// Histogram creation
// Created by Anton Sparrius (Spaz) 6/9/05 anton_spaz@yahoo.com
// Free to use and change, provided you keep these lines :)
//
if (file_exists($hist_path.$hist_file)) {
$im=imagecreatefromPNG($hist_path . $hist_file);
imagePNG($im);
imagedestroy($im);
} else {
$im=imagecreatefromjpeg($hist_path.$hist_image);
for($i=0;$i<imagesx($im);$i+=2)
{
for($j=0;$j<imagesy($im);$j++)
{
$rrggbb=imagecolorsforindex ($im, imagecolorat($im,$i,$j));
$r[$rrggbb['red']]+=1;
$g[$rrggbb['green']]+=1;
$b[$rrggbb['blue']]+=1;
}
}
for ($i=0;$i<256;$i++)
{
$max[$i]=($r[$i]+$g[$i]+$b[$i])/3;
}
$max_value=max($max)/150;
$m[0]=max($r);
$m[1]=max($b);
$m[2]=max($g);
$max_rgb=max($m)/150;
$im_out = imageCreate (280, 164);
$background = imageColorAllocate($im_out,70,70,70);
$hist=ImageColorAllocate($im_out,0,0,0);
$white=ImageColorAllocate($im_out,143,143,134);
$red=ImageColorAllocate($im_out,255,0,0);
$green=ImageColorAllocate($im_out,0,255,0);
$blue=ImageColorAllocate($im_out,0,0,255);
$ry=107;
$gy=107;
$by=107;
for($i=0;$i<256;$i++)
{
imageLine($im_out, $i+14, 157, $i+14, 157-($max[$i]/$max_value),$white);
imageLine($im_out, $i+13, $ry, $i+14, 157-($r[$i]/$max_rgb), $red);
imageLine($im_out, $i+13, $gy, $i+14, 157-($g[$i]/$max_rgb), $green);
imageLine($im_out, $i+13, $by, $i+14, 157-($b[$i]/$max_rgb), $blue);
$ry=157-($r[$i]/$max_rgb);
$gy=157-($g[$i]/$max_rgb);
$by=157-($b[$i]/$max_rgb);
}
imageLine($im_out,13,158,270,158,$hist);
imageLine($im_out,13,6,270,6,$hist);
imageLine($im_out,13,6,13,158,$hist);
imageLine($im_out,270,6,270,158,$hist);
imagePNG($im_out,$hist_path . $hist_file);
imageDestroy($im);
imagedestroy($im_out);
$im=imagecreatefromPNG($hist_path . $hist_file);
imagePNG($im);
imagedestroy($im);
}
?>
Kopier dir einfach mal diesen Code.....Vielleicht ist doch irgendwo ein Kommafehler drin oder sowas....
Problem solved by the code above :D :D :D
thanks Chicco :lol:
-
I surrender.. :cry:
How change background..??
$im_out = imageCreate (280, 164);with:
$im_out = imageCreateFromPNG ("background.png");
it does not act..
and
histogramm.php?hist_image=background.jpg&hist_path=data/media/88/&hist_file=02_hist_background.png
mistake line..
who will explain what and where..
-
danke für den mod! allerdings wird das histogramm nicht unter allen bildern gezeigt. woran kann das liegen?
(beispiel: http://www.xtrapix.net/details.php?image_id=32)
viele grüße
qwertz
thx for the mod! but, by some pictures on my page, there is no histogram seen. for example: http://www.xtrapix.net/details.php?image_id=32
much greetings
qwerty :wink:
-
Hallo qwertz,
dein Bild mit der image_id=32 hat den Dateinamen : 6.11.2004_018kleinfc2.jpg
Alle Bilddateinen mit "Punkten" im Dateinamen fallen beim Histogramm raus, da zur Bestimmung der zulässigen Dateiextension in diesem MOD bis zum ersten "Punkt" im Dateinamen gesucht wird und alles dahinter dann Dateiextension angesehen wird. Und was dann bei deiner Datei übrig bleibt ist sicher nicht als "Authorisierter" Dateityp gelistet. Somit fällt die Datei für ein Histogramm raus.
Die Datei mit Dateinamen 6_11_2004_018kleinfc2.jpg z.B. erzeugt ein Histogramm ... :wink:
mawenzi
-
danke schön!!! :D werde ich gleich ändern!
-
Also nochmals bezüglich des zusätzlichen Löschen vom Histogramm-Bild.
Dieser Teil hier in der member.php ist doch für das löschen des Bildes sowie dessen Thumbnails zuständig, oder:
$txt_clickstream = $lang['image_delete'];
$sql = "DELETE FROM ".IMAGES_TABLE."
WHERE image_id = $image_id";
$del_img = $site_db->query($sql);
if (!is_remote($image_row['image_media_file']) && !is_local_file($image_row['image_media_file'])) {
@unlink(MEDIA_PATH."/".$image_row['cat_id']."/".$image_row['image_media_file']);
}
if (!empty($image_row['image_thumb_file']) && !is_remote($image_row['image_thumb_file']) && !is_local_file($image_row['image_thumb_file'])) {
@unlink(THUMB_PATH."/".$image_row['cat_id']."/".$image_row['image_thumb_file']);
}
Kann ich diesen Bereich nicht nun erweitern, das er zusätzlich auch noch das Bild mit dem Zusatz "histo_" vorne dran löscht?
Also er löscht zum Beispiel das Bild test.jpg. Jetzt soll es auch gleich das Bild bzw. Datei "histo_test.png" löschen.
-
Also das Histogram Mod funzt sehr fein doch nun hab ich ein gröberes problem.
in zusamenhang mit them autothumb Mod
autothumb versucht thumbs von den hist_****.png bilder zu erstellen
was nicht sinn der sach ist
gibt es eine möglichkeit das zu umgehen.
Ob der thread jetzt in Check new Images mod oder in hist reingehört ?
Das problem hab ich erst seit Hist mod instaliert ist und natürlich kommen dann auch
die hist bilder auf die start seite als last added imag.
lg mohab
-
Deshalb ist es besser die Histogramme nicht im Kategorieordner, sondern in einem extra Ordner zu speichern. Um das abzuändern wäre folgendes zu erledigen.
1. einen neuen Ordner zum Speichern der Histogramme anlegen z.B.:
/data/histo
2. im Code für das Histogramm in der details.php finde :
$hist_path = "data/media/".$cat_id."/";
und ändere in
$hist_path = "data/histo/";
damit wäre das Problem erledigt ... :wink:
mawenzi
-
Ich probier es nun nochmals auf English (Gott steh mir bei)
Is it then possible like that which in the Admin panel with the function deletion of pictures to delete the appropriate histogram? sowas like histo+ {image_name} or other…. Otherwise one has a daily terribly many dead pictures quasi on its server to lie about or must always laboriously by ftp the appropriate picture separately delete….
Sorry for my English
-
Deshalb ist es besser die Histogramme nicht im Kategorieordner, sondern in einem extra Ordner zu speichern. Um das abzuändern wäre folgendes zu erledigen.
1. einen neuen Ordner zum Speichern der Histogramme anlegen z.B.:
/data/histo
2. im Code für das Histogramm in der details.php finde :
$hist_path = "data/media/".$cat_id."/";
und ändere in
$hist_path = "data/histo/";
damit wäre das Problem erledigt ... :wink:
mawenzi
not working for me, I have this error
Warning: imagecreatefromjpeg(data/histo/DSC_9510.jpg): failed to open stream: No such file or directory in /home/myanimw/public_html/4images/histo.php on line 14
Warning: imagesx(): supplied argument is not a valid Image resource in /home/myanimw/public_html/4images/histo.php on line 15
Warning: Wrong parameter count for max() in /home/myanimw/public_html/4images/histo.php on line 30
Warning: Wrong parameter count for max() in /home/myanimw/public_html/4images/histo.php on line 31
Warning: Wrong parameter count for max() in /home/myanimw/public_html/4images/histo.php on line 32
Warning: Division by zero in /home/myanimw/public_html/4images/histo.php on line 48
Warning: Division by zero in /home/myanimw/public_html/4images/histo.php on line 49
Warning: Division by zero in /home/myanimw/public_html/4images/histo.php on line 50
Warning: Division by zero in /home/myanimw/public_html/4images/histo.php on line 51
Warning: Division by zero in /home/myanimw/public_html/4images/histo.php on line 52
Warning: Division by zero in /home/myanimw/public_html/4images/histo.php on line 53
Warning: Division by zero in /home/myanimw/public_html/4images/histo.php on line 54
here is my histo.php
<?php
// Histogram creation
// Created by Anton Sparrius (Spaz) 6/9/05 anton_spaz@yahoo.com
// Free to use and change, provided you keep these lines :)
//
if (file_exists($hist_path.$hist_file)) {
$im=imagecreatefromPNG($hist_path . $hist_file);
imagePNG($im);
imagedestroy($im);
} else {
$im=imagecreatefromjpeg($hist_path.$hist_image);
for($i=0;$i<imagesx($im);$i+=2)
{
for($j=0;$j<imagesy($im);$j++)
{
$rrggbb=imagecolorsforindex ($im, imagecolorat($im,$i,$j));
$r[$rrggbb['red']]+=1;
$g[$rrggbb['green']]+=1;
$b[$rrggbb['blue']]+=1;
}
}
for ($i=0;$i<256;$i++)
{
$max[$i]=($r[$i]+$g[$i]+$b[$i])/3;
}
$max_value=max($max)/150;
$m[0]=max($r);
$m[1]=max($b);
$m[2]=max($g);
$max_rgb=max($m)/150;
$im_out = imageCreate (280, 164);
$background = imageColorAllocate($im_out,70,70,70);
$hist=ImageColorAllocate($im_out,0,0,0);
$white=ImageColorAllocate($im_out,143,143,134);
$red=ImageColorAllocate($im_out,255,0,0);
$green=ImageColorAllocate($im_out,0,255,0);
$blue=ImageColorAllocate($im_out,0,0,255);
$ry=107;
$gy=107;
$by=107;
for($i=0;$i<256;$i++)
{
imageLine($im_out, $i+14, 157, $i+14, 157-($max[$i]/$max_value),$white);
imageLine($im_out, $i+13, $ry, $i+14, 157-($r[$i]/$max_rgb), $red);
imageLine($im_out, $i+13, $gy, $i+14, 157-($g[$i]/$max_rgb), $green);
imageLine($im_out, $i+13, $by, $i+14, 157-($b[$i]/$max_rgb), $blue);
$ry=157-($r[$i]/$max_rgb);
$gy=157-($g[$i]/$max_rgb);
$by=157-($b[$i]/$max_rgb);
}
imageLine($im_out,13,158,270,158,$hist);
imageLine($im_out,13,6,270,6,$hist);
imageLine($im_out,13,6,13,158,$hist);
imageLine($im_out,270,6,270,158,$hist);
imagePNG($im_out,$hist_path . $hist_file);
imageDestroy($im);
imagedestroy($im_out);
$im=imagecreatefromPNG($hist_path . $hist_file);
imagePNG($im);
imagedestroy($im);
}
?>
and here part from details.php
//--- Start Histogramm 27.02.2006 ----------------------
$hist_image = $image_row['image_media_file'] ;
$hist_file= "hist_".substr($hist_image,0,strlen($hist_image)-4).".png";
$hist_path = "data/histo/";
$ext = substr($hist_image, strpos($hist_image, ".")+1, strlen($hist_image));
$AutorisedImageType = array ("jpg", "jpeg", "JPG", "JPEG"); // Dateitypen für die das Histogramm gezeigt werden soll
if (in_array($ext, $AutorisedImageType)) {
$histogramm_image = "<img src='histo.php?hist_image=".$hist_image."&hist_file=".$hist_file."&hist_path=".$hist_path."' border=\"1\">";
} else {
$histogramm_image = REPLACE_EMPTY;
}
$site_template->register_vars(array(
"histogramm" => "Histogram:",
"histogramm_image" => $histogramm_image
));
//--- Ende Histogramm 27.02.2006 ------------------------
it's something wrong???
-
Got this mod working with 4images 1.7.1-inter/with phpnuke 7.4 WORKS GREAT!!
-
Warning: imagesx(): supplied argument is not a valid Image resource in /home/myanimw/public_html/4images/histo.php on line 15
in histo.php add after
// Free to use and change, provided you keep these lines :)
//
this
if (isset($HTTP_GET_VARS['hist_image']) || isset($HTTP_POST_VARS['hist_image'])) {
$hist_image = (isset($HTTP_GET_VARS['hist_image'])) ? stripslashes(trim($HTTP_GET_VARS['hist_image'])) : stripslashes(trim($HTTP_POST_VARS['hist_image']));
}
else {
$hist_image = "";
}
if (isset($HTTP_GET_VARS['hist_path']) || isset($HTTP_POST_VARS['hist_path'])) {
$hist_path = (isset($HTTP_GET_VARS['hist_path'])) ? stripslashes(trim($HTTP_GET_VARS['hist_path'])) : stripslashes(trim($HTTP_POST_VARS['hist_path']));
}
else {
$hist_path = "";
}
if (isset($HTTP_GET_VARS['hist_file']) || isset($HTTP_POST_VARS['hist_file'])) {
$hist_file = (isset($HTTP_GET_VARS['hist_file'])) ? stripslashes(trim($HTTP_GET_VARS['hist_file'])) : stripslashes(trim($HTTP_POST_VARS['hist_file']));
}
else {
$hist_file = "";
}
-
@Sergey
... I think you already found an answer ... :wink:
-
sorry, due to hardly any english on this topic, I did install the mod, but not showing anything.
isn't there suppose to have a background image in the image folder as well for this to work??
or the hist.php, suppose to draw everything??
if there's a background image required, anyone have it that I can download off??
-
With SAD's soloution it works fine.
thx a lot :D
-
Hallo Mawenzi,
ich habe versucht das Histogram Mod komplett so einzubinden wie es hier beschrieben ist. Ich bekomme keine Fehlermeldungen, aber es werden keine Histogram Bilder angezeigt. Bei dem Aufruf des Bildes in meiner Galerie steht zwar als text Histogramm mit einem kleinen Viereck wie als aob er das Bild nicht findet.
Hier mein Link:
http://www.rainer-vogel.de/galerie/details.php?image_id=36
Ich habe komplett die histo.php im Ordner /data/histo. Die details.html im Template Ordner und die details.php im Root. Den Quellcode habe ich aus deinen vorhergehenden Postings komplett übernommen. Würdest du mir bitte helfen?
Danke schonmal, Birdy.
-
Hallo zusammen,
ich hab genau das gleiche Problem...
Beim Bearbeiten der "histo.php ist mir auch aufgefallen, der der Eintrag "$filepath" nicht vorhanden ist ... :?:
Hängt es vielleicht damit zusammen?
Grüßle
Udo
-
Habe jetzt alles wieder ein und ausgebaut. Ich bin schon fast am verzeifeln. Warum zeigt er mir nichts an?? 8O Wer könnte mir denn mal die details.html, die histo.php und die details.php von einer lauffähigen Seite zu mailen? Wie gesagt bei mir zeigt er nur den Text "Histogram" und ein kleines Viereck an.
Würde mich freuen über eine Antwort. Gut Udo, das ich nicht der einzige bin wo es nicht klappert.. :roll: :roll:
-
Habe jetzt alles wieder ein und ausgebaut. Ich bin schon fast am verzeifeln. Warum zeigt er mir nichts an?? 8O Wer könnte mir denn mal die details.html, die histo.php und die details.php von einer lauffähigen Seite zu mailen? Wie gesagt bei mir zeigt er nur den Text "Histogram" und ein kleines Viereck an.
Würde mich freuen über eine Antwort. Gut Udo, das ich nicht der einzige bin wo es nicht klappert.. :roll: :roll:
Ich hab fast den ganzen Tag damit verbracht, das Histogramm ans laufen zu bekommen - und? weißes Blatt mit rotem Kreuz.... :thumbdown:
Keine Ahnung, was ich noch anstellen soll.... :cry: :cry: :cry:
Vielleicht hat ja wirklich jemand erbarmen und schickt uns seine Daten... :)
Udo
-
@ mawenzi or/amd V@no
I've installed this mod and it works great, thank you!
The only part that I still cann't make it works is this one:
1. einen neuen Ordner zum Speichern der Histogramme anlegen z.B.:
/data/histo
2. im Code für das Histogramm in der details.php finde :
Code:
$hist_path = "data/media/".$cat_id."/";
und ändere in
Code:
$hist_path = "data/histo/";
damit wäre das Problem erledigt ...
As some other here has problem with it. Could you please give us some more help on this?
When I make these changes the histogram picture wont show att all! Is there any more places which must changes?
I and many other here will appreciate it much more!
Best Regards!
-
8O
Nobody knows how to fix it? :cry:
-
Hallolo.. :D
Also irgendwie funktionierts und irgendwie funktionierts auch wieder nicht....
Bei manchen Bildern wird ein "Histogramm" angelegt - bei anderen habe ich immer noch das weiße Blatt...
Das Histogramm das angezeigt wird sieht so aus:
http://www.entscheidende-augenblicke.de/details.php?image_id=86
oder so:
http://www.entscheidende-augenblicke.de/details.php?image_id=19
Hier der Code der Histo.php
<?php
// Histogram creation
// Created by Anton Sparrius (Spaz) 6/9/05 anton_spaz@yahoo.com
// Free to use and change, provided you keep these lines :)
if (isset($HTTP_GET_VARS['hist_image']) || isset($HTTP_POST_VARS['hist_image'])) {
$hist_image = (isset($HTTP_GET_VARS['hist_image'])) ? stripslashes(trim($HTTP_GET_VARS['hist_image'])) : stripslashes(trim($HTTP_POST_VARS['hist_image']));
}
else {
$hist_image = "";
}
if (isset($HTTP_GET_VARS['hist_path']) || isset($HTTP_POST_VARS['hist_path'])) {
$hist_path = (isset($HTTP_GET_VARS['hist_path'])) ? stripslashes(trim($HTTP_GET_VARS['hist_path'])) : stripslashes(trim($HTTP_POST_VARS['hist_path']));
}
else {
$hist_path = "";
}
if (isset($HTTP_GET_VARS['hist_file']) || isset($HTTP_POST_VARS['hist_file'])) {
$hist_file = (isset($HTTP_GET_VARS['hist_file'])) ? stripslashes(trim($HTTP_GET_VARS['hist_file'])) : stripslashes(trim($HTTP_POST_VARS['hist_file']));
}
else {
$hist_file = "";
}
// $hist_image = $_REQUEST['image'];
// $hist_path = $_REQUEST['filepath'];
// $hist_path = "albums/".$hist_path;
if (file_exists($hist_path.$hist_file)) {
$im=imagecreatefromPNG($hist_path . $hist_file);
imagePNG($im);
imagedestroy($im);
} else {
$im=imagecreatefromjpeg($hist_path.$hist_image);
for($i=0;$i<imagesx($im);$i+=2)
{
for($j=0;$j<imagesy($im);$j++)
{
$rrggbb=imagecolorsforindex ($im, imagecolorat($im,$i,$j));
$r[$rrggbb['red']]+=1;
$g[$rrggbb['green']]+=1;
$b[$rrggbb['blue']]+=1;
}
}
for ($i=0;$i<256;$i++)
{
$max[$i]=($r[$i]+$g[$i]+$b[$i])/3;
}
$max_value=max($max)/150;
$m[0]=max($r);
$m[1]=max($b);
$m[2]=max($g);
$max_rgb=max($m)/150;
$im_out = imageCreate (280, 164);
$background = imageColorAllocate($im_out,70,70,70);
$hist=ImageColorAllocate($im_out,0,0,0);
$white=ImageColorAllocate($im_out,143,143,134);
$red=ImageColorAllocate($im_out,255,0,0);
$green=ImageColorAllocate($im_out,0,255,0);
$blue=ImageColorAllocate($im_out,0,0,255);
$ry=107;
$gy=107;
$by=107;
for($i=0;$i<256;$i++)
{
imageLine($im_out, $i+14, 157, $i+14, 157-($max[$i]/$max_value),$white);
imageLine($im_out, $i+13, $ry, $i+14, 157-($r[$i]/$max_rgb), $red);
imageLine($im_out, $i+13, $gy, $i+14, 157-($g[$i]/$max_rgb), $green);
imageLine($im_out, $i+13, $by, $i+14, 157-($b[$i]/$max_rgb), $blue);
$ry=157-($r[$i]/$max_rgb);
$gy=157-($g[$i]/$max_rgb);
$by=157-($b[$i]/$max_rgb);
}
imageLine($im_out,13,158,270,158,$hist);
imageLine($im_out,13,6,270,6,$hist);
imageLine($im_out,13,6,13,158,$hist);
imageLine($im_out,270,6,270,158,$hist);
imagePNG($im_out,$hist_path . $hist_file);
imageDestroy($im);
imagedestroy($im_out);
$im=imagecreatefromPNG($hist_path . $hist_file);
imagePNG($im);
imagedestroy($im);
}
?>
...hier der Code der detais.php
<?php
//-----------------------------------------------------
//--- Show Image --------------------------------------
//-----------------------------------------------------
//--- Start Histogramm 27.02.2006 ----------------------
$hist_image = $image_row['image_media_file'] ;
$hist_file= "hist_".substr($hist_image,0,strlen($hist_image)-4).".png";
$hist_path = "data/histo/";
$ext = substr($hist_image, strpos($hist_image, ".")+1, strlen($hist_image));
$AutorisedImageType = array ("jpg", "jpeg", "JPG", "JPEG"); // Dateitypen für die das Histogramm gezeigt werden soll
if (in_array($ext, $AutorisedImageType)) {
$histogramm_image = "<img src='histo.php?hist_image=".$hist_image."&hist_file=".$hist_file."&hist_path=".$hist_path."' border=\"1\">";
} else {
$histogramm_image = REPLACE_EMPTY;
}
$site_template->register_vars(array(
"histogramm" => "Histogramm:",
"histogramm_image" => $histogramm_image
));
//--- Ende Histogramm 27.02.2006 ------------------------
?>
...und hier der Code der details.html
<?php
{if histogramm_image}
<tr>
<td valign="top" class="row1"><b>{histogramm}</b></td>
<td valign="top" class="row1">{histogramm_image}</td>
</tr>
{endif histogramm_image}
?>
Anmerkung: Die PHP-Markierung habe ich nur zur besseren farblichen Kennzeichnung hinzugefügt.
Vielleicht hat ja noch jemand ne Idee... :)
Grüßle
Udo
-
Replace $im_out = imageCreate (280, 164);
with:$im_out = imageCreateFromPNG ("background.png");
then upload your background.png image into same directory where histo.php is.
P.S. make sure the image is 280x164
das funktioniert leider falsch (oder ich habe was falsch gemacht). Das Histogramm liegt nicht genau auf dem background Bild.
-
i get this error
Warning: imagepng(): Unable to open 'data/media/27/hist_ugly-chimp_copy_copy.png' for writing in /home2/lamers/public_html/histo.php on line 61
Warning: imagecreatefrompng(data/media/27/hist_ugly-chimp_copy_copy.png): failed to open stream: No such file or directory in /home2/lamers/public_html/histo.php on line 64
Warning: imagepng(): supplied argument is not a valid Image resource in /home2/lamers/public_html/histo.php on line 65
Warning: imagedestroy(): supplied argument is not a valid Image resource in /home2/lamers/public_html/histo.php on line 66t this error
-
Hallo!
Ich habe versucht das Histogramm so zu bauen, wie es bei Ivan und mawenzi in der Galerie zu finden ist, sieht wesentlich besser aus, als die Version mit dem grauen Hintergrund... hat auch soweit geklappt, d. h. habe in der details.html ne Tabelle mit Hintergrund erzeugt, in der das Histogramm mit entsprechendem Hintergrund angezeigt wird, allerdings habe ich noch einige kleine Designfehler, bei denen ich nicht weiß wie ich sie beheben soll, vllt. könnt ihr mir ja helfen:
1. Wie bekommen ich diese hellblaue Umrandung weg?
2. Wie kann ich die Farbe des Gesamtgraphs von weiß auf grau ändern, wie bei euch?
3. Bei manchen Bildern wird bei mir überhaupt kein Histogramm angezeigt und bei anderen ein total Konfuses, woran kann das liegen? Nur in seltenen Fällen werden mir Graphen angezeigt die in etwa richtig sind.
4. Wie kann ich das Histogramm genau platzieren? Ich weiß zwar schon welche Zahlen dafür zuständig sind, aber ich kann daraus keine Schlussfolgerung ziehen, soll heißen ich verstehe das System dahinter nicht ganz.
Würd mich freuen wenn ihr mir helfen könnt!
Gruß
Phil
-
0. ein Link um sich dein Histogramm mal anzusehen und festzustellen was zu verbessern ist, wäre natürlich hilfreich ...
1. sämtliche Farbeinstellungen nimmt man in der histo.php bzw. histogramm.php vor ... RGB-Farbwerte einfach ändern ...
2. wie 1. ...
3. siehe 0. um das bewerten zu können ...
4. platzieren ... wo ? Zahlenwerte ... welche ? ...
Eine ausführliche Einbauanleitung incl. FAQ nach der auch die von dir genannten User ihr Histogramm für ihre Bilder erstellen lassen findest du hier (http://klick.kl.funpic.de/board.php) !
-
Danke!
Durch dein Forum haben sich alle meine Fragen erledigt!
Gruß
Phil
-
Wie kann man es machen, dass lediglich eine Zeile mit dem Link "Histogramm" in der detail. html eingebaut wird, und man bei Bedarf daraufklicken kann, und sich dann das Histogramm an gleicher Stelle öffnet?
Wäre auch interessant für die Exif-Datein usw., damit die Detailseite zunächst übersichtlich bleibt und die Informationen nur bei Bedarf aufgerufen werden können.
-
so wie auf www.sascha-droemer.de ???
-
Ja, genauso. Auch für Histogramm und für Kommentare!!!
-
meinste das kannste nicht "klauen"? *g*
-
... einfach ein Java-Toggle-Script (http://www.google.com/search?hl=de&rls=com.microsoft%3Aen-US&q=Java+Toggle+Script+&btnG=Suche&lr=) verwenden ...
... so etwa wie hier (http://klick.kl.funpic.de/details.php?image_id=3558) für IPTC- und EXIF-Info ...
-
Alles funktioniert soweit, nur das Histogramm selbst begeistert mich nicht von aussehen. Offensichtlich ist "histoback.gif" dafür zuständig, finde ich aber nicht in meinem Verzeichnis.
Wie kann ich das Standardhistoramm durch ein eigenes tauschen?
-
mawenzi,
could you place here your final variant with imageID and without many arguments?
All,
about $hist_path = "data/histo/";
There is a bug, because you need to change the histo.php accordingly.
I use the following solution:
1. Create subfolders (with 777 attributes) like in the data/media/:
data/histo/1
data/histo/2
....
data/histo/n (where n - is the last category).
2. Change details.php like this:
//--- Start Histogramm 27.02.2006 ----------------------
$hist_image = $image_row['image_media_file'] ;
$hist_file= "hist_".substr($hist_image,0,strlen($hist_image)-4).".png";
$hist_path = "data/media/".$cat_id."/";
$histout_path = "data/histo/".$cat_id."/";
$ext = substr($hist_image, strpos($hist_image, ".")+1, strlen($hist_image));
$AutorisedImageType = array ("jpg", "jpeg", "JPG", "JPEG");
if (in_array($ext, $AutorisedImageType)) {
$histogramm_image = "<img src='histo.php?hist_image=".$hist_image."&hist_file=".$hist_file."&histout_path=".$histout_path."&hist_path=".$hist_path."' border=\"1\">";
} else {
$histogramm_image = REPLACE_EMPTY;
}
$site_template->register_vars(array(
"histogramm" => "Гистограмма:",
"histogramm_image" => $histogramm_image
));
//--- Ende Histogramm 27.02.2006 ------------------------
There we added a new variable - $histout_path.
3. Replace all in the histo.php
$path.$hist_file
to
$histout_path.$hist_file
It's all.
-
Ich bin ja nicht wählerisch mit meinem Histogramm, aber ich will wenigstens den dunkleren Hintergrund in z.B. weiss ändern. Ich habe verstanden, dass man die RGB Werte in der Histo.php ändern muss. Ich habe jetzt fast alle Zahlen geändert. Ich sehe keinen Unterschied im Histogramm. Welche Zahlen muss ich denn jetzt ändern?
-
desperate_housewif,
did you removed the old histogram images from /data/meida? Also you need clear the cache in your browser.
-
Hi all,
it seems to me, that histogram is wrong in some case. Look for this:
http://gallery.imagemaster.ru/img8184.htm
http://gallery.imagemaster.ru/img8103.htm
You can save the pictures and open them in Photoshop and compare histograms. I think the problem arises in case when too many pixels in shadows (left side of histogram). It looks like a non-normalize histogram. Does anybody have any ideas?
Also, there is another problem - the histogram images don't remove from server when we remove the the image. Does anyone have a solution?
Thanks!
-
only scaling is diffent i think...
-
Acidgod,
thanks for the reply. I think so. But scaling is different only in some cases (as I've describe above). So, probably there is a decision of this problem? Anyway, I'll try to understand the code and find a solution.
-
can make some screenshots? where i can see the differents between Photoshop an this Mod?
-
Ok, I'll prepare it now.
But I found the "root of evil", it's a following code:
$max_value=max($max)/150;
$m[0]=max($r);
$m[1]=max($b);
$m[2]=max($g);
$max_rgb=max($m)/150;
If we change 150 to 450 e.g., on my examples we get a right scaling histogram. But for other images, the histogram will overflow top line (sorry for my English, I'm from Russia). :oops:
-
There is an example of histograms for the image:
http://gallery.imagemaster.ru/img8103.htm
Photoshop histogram is above, 4images is below.
-
I'm sorry, why I can't see this thread in "Mods & Plugins (Releases & Support)" branch?
-
(sorry for my English, I'm from Russia). :oops:
And i am German... (o:
My English is not even better... *g
I'm sorry, why I can't see this thread in "Mods & Plugins (Releases & Support)" branch?
Too much sticky Threads... )o:
http://www.4homepages.de/forum/index.php?board=15.200
There you can find it... (11 site)
And that is a problem only with black and white images, right?
-
Thanks! :) I already tried so and so....
No, the problem not only with b/w images. It seems to me that the problem with all pictures (b/w and color) which have a lot of 0,0,0 and 255,255,255 pixels. In other words with images who have a "splash" in shadow/higlights.
-
I think that the following algorithm can fix the situation (I'll describe it by words) :
1. In
$max_value=max($max)/150; and $max_rgb=max($m)/150;
we must ignore values with indexes with range (for example) 0 ... 20, and from 235 ... 255. Especially because in that range can get black/white frame of image.
2. Instead of search the ONE max value we must find the max value with some density (by other words, the max values is a value which have some pixels in 20..235 range (e.g. 10 or 20).
-
Hi mawenzi,
thanks a lot for this great mod. :D
Frank.
-
Hallo Ivan,
... so wie es aussieht, hast du ja die Version von meiner Website installiert ...
... werde mir die Sache mal ansehen ...
... aber wenn es zunächst bei dir mit einer .htacess funktioniert, dann bist du ja schon ein Schritt weiter ...
... und wenn es an "register_globals on" (auch meine Einstellung) liegt, dann ist es ja ein Serverproblem ...
-
My histogram is...
(http://angel.dxbg.com/histo1.gif)
How to make it look like that one.
(http://angel.dxbg.com/histo2.gif)
-
... here ... http://klick.kl.funpic.de/files.php ...
-
:D Thanks!
-
Over the past few days I have in my log the error: PHP Warning: Division by zero in / home / miweb.com / data / htdocs / gallery / histo.php on line 71, 72, 73, 74, 75 ..... ..
(I have been two years without that error)
These lines are:
imageLine($im_out, $i+14, 157, $i+14, 157-($max[$i]/$max_value),$white);
imageLine($im_out, $i+13, $ry, $i+14, 157-($r[$i]/$max_rgb), $red);
imageLine($im_out, $i+13, $gy, $i+14, 157-($g[$i]/$max_rgb), $green);
imageLine($im_out, $i+13, $by, $i+14, 157-($b[$i]/$max_rgb), $blue);
$ry=157-($r[$i]/$max_rgb);
$gy=157-($g[$i]/$max_rgb);
$by=157-($b[$i]/$max_rgb);
}
imageLine($im_out,13,158,270,158,$hist);
imageLine($im_out,13,6,270,6,$hist);
imageLine($im_out,13,6,13,158,$hist);
imageLine($im_out,270,6,270,158,$hist);
Versión de PHP is: 4.4.7
Any thoughts?
-
What is exact line for division zero error ?
-
[Sun Dec 23 01:48:13 2007] [error] PHP Warning: imagecreatefromjpeg(reportero.jpg) [<a href='function.imagecreatefromjpeg'>function.imagecreatefromjpeg</a>]: failed to open stream: No such file or directory in /home/miweb.com/data/htdocs/galeria/histo.php on line 37
[Sun Dec 23 01:48:13 2007] [error] PHP Warning: imagesx(): supplied argument is not a valid Image resource in /home/miweb.com/data/htdocs/galeria/histo.php on line 38
[Sun Dec 23 01:48:13 2007] [error] PHP Warning: Wrong parameter count for max() in /home/miweb.com/data/htdocs/galeria/histo.php on line 53
[Sun Dec 23 01:48:13 2007] [error] PHP Warning: Wrong parameter count for max() in /home/miweb.com/data/htdocs/galeria/histo.php on line 54
[Sun Dec 23 01:48:13 2007] [error] PHP Warning: Wrong parameter count for max() in /home/miweb.com/data/htdocs/galeria/histo.php on line 55
[Sun Dec 23 01:48:13 2007] [error] PHP Warning: Division by zero in /home/miweb.com/data/htdocs/galeria/histo.php on line 71
[Sun Dec 23 01:48:13 2007] [error] PHP Warning: Division by zero in /home/miweb.com/data/htdocs/galeria/histo.php on line 72
[Sun Dec 23 01:48:13 2007] [error] PHP Warning: Division by zero in /home/miweb.com/data/htdocs/galeria/histo.php on line 73
[Sun Dec 23 01:48:13 2007] [error] PHP Warning: Division by zero in /home/miweb.com/data/htdocs/galeria/histo.php on line 74
[Sun Dec 23 01:48:13 2007] [error] PHP Warning: Division by zero in /home/miweb.com/data/htdocs/galeria/histo.php on line 75
[Sun Dec 23 01:48:13 2007] [error] PHP Warning: Division by zero in /home/miweb.com/data/htdocs/galeria/histo.php on line 76
[Sun Dec 23 01:48:13 2007] [error] PHP Warning: Division by zero in /home/miweb.com/data/htdocs/galeria/histo.php on line 77
Lines 37 and 38:
$im=imagecreatefromjpeg($hist_path.$hist_image);
for($i=0;$i<imagesx($im);$i+=2)
Lines 53 to 55:
$m[0]=max($r);
$m[1]=max($b);
$m[2]=max($g);
Lines 71 to 77:
imageLine($im_out, $i+14, 157, $i+14, 157-($max[$i]/$max_value),$white);
imageLine($im_out, $i+13, $ry, $i+14, 157-($r[$i]/$max_rgb), $red);
imageLine($im_out, $i+13, $gy, $i+14, 157-($g[$i]/$max_rgb), $green);
imageLine($im_out, $i+13, $by, $i+14, 157-($b[$i]/$max_rgb), $blue);
$ry=157-($r[$i]/$max_rgb);
$gy=157-($g[$i]/$max_rgb);
$by=157-($b[$i]/$max_rgb);
This happens to me in two different galleries, but the best thing is that if the histogram is generated .....
I think it's problem of the library gd2 .... I do not know.
-
I think it's problem of the library gd2 .... I do not know.
Is show error for one image or all image ?
-
Hello Thunderstrike
It happens with new images or old, it does sometimes with any image.
-
If check in FTP for file structure - all ok in thumb and media folder ? Is look like alter image ...
-
No, it's not a problem for permits, are all 777 and passes in any category.
I have two galleries 4homepages on the same server and I ocrre the same. Since a few days ago.
-
No, it's not a problem for permits, are all 777 and passes in any category.
I no ask for permission. I ask if file structure is ok (kb, bytes) for all file. Is possible some alter image ...
-
Danke, sehr schöner MOD! :D
-
@all
... I redesigned this MOD with some fixes ...
... you can download all neccesary files and the installations instruction ... here (http://klick.kl.funpic.de/files.php) ...
@alle
... ich habe den MOD neu gestaltet mit einigen Fixes ...
... du kannst alle notwendigen Dateien und die Installationsanweisung downloaden ... hier (http://klick.kl.funpic.de/files.php) ...
-
Wenn es um die Global Sache geht, dann füge mal in die erste Zeile der histogramm.php
$hist_image_id = $_GET['hist_image_id'];
ein.
-
Hallo Ivan,
Wenn es um die Global Sache geht, dann füge mal in die erste Zeile der histogramm.php
$hist_image_id = $_GET['hist_image_id'];
ein.
... genau das behebt das Problem ... ;)
... in meinem Downloadpaket ist aber dieser Fix bereits enthalten ...
... also diese Zeile einfügen ... oder die histogramm.php nochmals downloaden ...
-
für php5 gerüstet.
Naja, hat ja nicht direkt mit PHP5 zu tun, eher mit den Core Einstellungen für register_globals.
Aber Hauptsache es funktioniert :)
-
@ Ivan
... schön das Histogramm bei dir wieder online zu sehen ... ;)
-
... was bedeutet ... "wenn keines (Bild) vorhanden ist" ...
- wenn kein Bild vorhanden ist, dann gibt es keine Detailseite auf der ein Histogramm gezeigt werden könnte ...
- wenn auf der Detailseite statt eines Bildes z.B. ein Video o.d.gl. gezeigt wird, so wird auch kein Histogramm gezeigt ...
- für welchen Dateityp die Erzeugung und Einblendung des Histogramms erfolgen soll, legst du über die Extensionen fest ...
... worin besteht das Problem ... ?
-
... welche Histogramm-Version und Einbindung in die details.php verwendest du ... ?
... ich hoffe doch stark ... diese hier (http://klick.kl.funpic.de/files.php) ... und nicht die vom Thread-Anfang ...
... und die if-Schleife ist Bestandteil der Einbindung in die details.php ... !
... die histogram.php wird nur über die details.php aufgerufen ... !
... und dort auch nur, wenn der Dateityp für ein Histogramm definiert ist ... (if-Schleife) !
... d.h. wird die histogram.php aufgerufen, so muss auch ein Bild vorliegen ... !
... ansonsten verwendest du eine falsche Einbindung oder hast falsche Dateitypen definiert ...
-
das histogramm wird angezeigt, auch wenn kein bild vorhanden ist.
ist das bei dir auch so?
... ich verstehe das nicht ... oder dein Deutsch ist mir zu südlich ...
... wenn es kein Bild gibt, dann kann es doch keine Detailseite geben, wo ein Histogramm gezeigt wird ... !?!
... URL please ...
-
... wenn keine Bilddatei vorhanden ist, jedoch ein Datenbankeintrag ... :roll:
... so kannst du zur Unterdrückung des Histogramms für die nicht vorhandene Biddatei diese if-Schleife verwenden ...
if (file_exists("data/media/".$image_row['cat_id']."/".$image_row['image_media_file'].") {
...
}
-
Hallo Ivan,
... kann ich nicht ganz nachvollziehen ...
... bei mir sind alle Attribute : -rw-r--r-- ...
-
Hi!
sagt mal von euch schon jemand den mod am "mobile server" zum laufen gebracht?
mfg Andi
-
@Rembrandt
... ich gehe mal davon aus, dass du das Erstellen von Histogramm-Bildern meinst ...
... das Anzeigen bereits generierter Histogramm-Bilder funktioniert definitiv ...
... das Erstellen muss ich auch erst mal testen ...
-
Âbend!
ja beim erstellen
[client 127.0.0.1] PHP Warning: Division by zero in W:\\www\\4images\\histo.php on line 48, referer: http://localhost/4images/details.php?image_id=36&sessionid=7af9f9034abae5225a91ffd952d12f0f
[client 127.0.0.1] PHP Warning: Division by zero in W:\\www\\4images\\histo.php on line 49, referer: http://localhost/4images/details.php?image_id=36&sessionid=7af9f9034abae5225a91ffd952d12f0f
[client 127.0.0.1] PHP Warning: Division by zero in W:\\www\\4images\\histo.php on line 50, referer: http://localhost/4images/details.php?image_id=36&sessionid=7af9f9034abae5225a91ffd952d12f0f
[client 127.0.0.1] PHP Warning: Division by zero in W:\\www\\4images\\histo.php on line 51, referer: http://localhost/4images/details.php?image_id=36&sessionid=7af9f9034abae5225a91ffd952d12f0f
[client 127.0.0.1] PHP Warning: Division by zero in W:\\www\\4images\\histo.php on line 52, referer: http://localhost/4images/details.php?image_id=36&sessionid=7af9f9034abae5225a91ffd952d12f0f
[client 127.0.0.1] PHP Warning: Division by zero in W:\\www\\4images\\histo.php on line 53, referer: http://localhost/4images/details.php?image_id=36&sessionid=7af9f9034abae5225a91ffd952d12f0f
[client 127.0.0.1] PHP Warning: Division by zero in W:\\www\\4images\\histo.php on line 54, referer: http://localhost/4images/details.php?image_id=36&sessionid=7af9f9034abae5225a91ffd952d12f0f
aber ich nehme an das ganz einfach die bilder nicht gefunden werden.
mfg Andi
-
hallo,
W:\\www\\4images\\histo.php
kurz mal ne Frage:
sollte der link nicht so lauten?
W:\www\4images\histo.php
KurtW
-
ja und welcher soll das sein, php5 verwende ich nicht, und die zeile mit global ist eingetragen.
auf meiner online seite funktioniert es ja auch wunderbar.
hallo,
W:\\www\\4images\\histo.php
kurz mal ne Frage:
sollte der link nicht so lauten?
W:\www\4images\histo.php
KurtW
hat mich auch schon gewundert, nur woher kommt das?
mfg Andi
-
Hello everyone,
I just tried installing this mod. The Histogram image does not display. Shows Missing Image Icon. Does anyone know the solution?
I cant read German and google translate isn't really helping that well.
-
I don't see any possible way anyone could help with such info ;)
link to the site where the histogram is installed might help though
-
Sorry V@no, your right. Heres an example
http://www.cydonian.com/photos/img1761.htm
-
http://www.cydonian.com/photos/histo.php?hist_image=IMG_2929_edited-1.jpg&hist_file=hist_IMG_2929_edited-1.png&hist_path=data/media/historical/
The requested URL /photos/histo.php was not found on this server.
-
Odd.
I renamed the histogramm.php (from mawenzi website) to histo.php
still doesnt work.
and that link you posted is now getting a slew of errors
-
I removed 2 blank empty lines at the end (?>) of the histo.php file. error warnings are gone but it now shows this
An unexpected error occured. Please try again later.
http://www.cydonian.com/photos/histo.php?hist_image=IMG_1113_edited-1.jpg&hist_file=hist_IMG_1113_edited-1.png&hist_path=data/media/historical/ (http://www.cydonian.com/photos/histo.php?hist_image=IMG_1113_edited-1.jpg&hist_file=hist_IMG_1113_edited-1.png&hist_path=data/media/historical/)
-
login as administrator, it should show you more details about the error.
-
unfortunately the error log shows no information, no matter how many times i try to access that link.
Could someone try and translate Mawenzi's installation notes to english?
-
Hi sigma,
http://www.cydonian.com/photos/histo.php?hist_image_id=1758
is working :wink:
But not in page 8O
Modcode:
3.1 Der folgende Code ist aus der histo.php zu löschen.
=> Delete the following code in histo.php
3.2 Alle folgenden Tags in der histo.php sind wie folgt umzubenennen.
=> Rename the following tags in histo.php
Kurt
-
This is what my histo.php looks like. Downloaded from Mawenzi's website yesterday. Renamed histogramm.php to histo.php
Dont see what I should delete. Looks like Mawenzi updated the php recently?
Edit by mawenzi :
Wenn man etwas von meiner Website herunterläd, dann sollte man es auch komplett machen ... incl. aller erforderlichen Dateien und Änderungen die dort angeboten sind und dann natürlich auch die dazugehörige Einbauanleitung beachten. Wie vorne zu lesen ist, habe ich die Modifikation "Histogramm" optmiert und biete sie komplett zum Download auf meiner Seite an. Und wie Kurt einige Post später schon richtig festgestellt hat, handelt es sich dabei um eine andere Versionen als die zum Anfang dieses Threads zu finden ist.
Also nicht Äpfel mit Birnen verwechseln und sich noch darüber beschweren, dass die Birne nach Apfel schmeckt ... ;)
-
$hist_image_id=$_GET['hist_image_id'];
where does the histo.php found this value :?: => not in the histo.php link from details.php :wink:
i thing, this are 2 different versions for the histogram....
test this in details.php
search:
$histogramm_image = "<img src='histo.php?hist_image=".$hist_image."&hist_file=".$hist_file."&hist_path=".$hist_path."' border=\"1\">";
replace with:
$histogramm_image = "<img src=\"histo.php?hist_image_id=".$image_row['image_id]."\" border=\"1\">";
Kurt
-
Parse error: syntax error, unexpected T_STRING, expecting ']' in /home/cydonian/public_html/photos/details.php on line 85
:(
-
sorry
$histogramm_image = "<img src=\"histo.php?hist_image_id=".$image_row['image_id']."\" border=\"1\">";
-
Works! Thank you Kurt!
-
:wink:
-
You might want add proper headers as well:
aboveif (file_exists($hist_path . $hist_file)) {
insert
header( 'Content-type: image/png' );
-
Im having big problems with 1.7.6 and using php5
site:
http://www.thelifephotography.com/details.php?image_id=184
histo.php in root:
<?php
//      Histogram creation
//      Created by Anton Sparrius (Spaz) 6/9/05  anton_spaz@yahoo.com
//      Free to use and change, provided you keep these lines :)
//
                        if (file_exists($hist_path.$hist_file)) {
                          $im=imagecreatefromPNG($hist_path . $hist_file);
                          imagePNG($im);
                          imagedestroy($im);
                        } else {
                        $im=imagecreatefromjpeg($hist_path.$hist_image);
                        for($i=0;$i<imagesx($im);$i+=2)
                        {
                                for($j=0;$j<imagesy($im);$j++)
                                {
                                        $rrggbb=imagecolorsforindex ($im, imagecolorat($im,$i,$j));
                                        $r[$rrggbb['red']]+=1;
                                        $g[$rrggbb['green']]+=1;
                                        $b[$rrggbb['blue']]+=1;
                                }
                        }
                        for ($i=0;$i<256;$i++)
                        {
                                $max[$i]=($r[$i]+$g[$i]+$b[$i])/3;
                        }
                        $max_value=max($max)/150;
                        $m[0]=max($r);
                        $m[1]=max($b);
                        $m[2]=max($g);
                        $max_rgb=max($m)/150;
                        $im_out = imageCreate (280, 164);
                        $background = imageColorAllocate($im_out,70,70,70);
                        $hist=ImageColorAllocate($im_out,0,0,0);
                        $white=ImageColorAllocate($im_out,143,143,134);
                        $red=ImageColorAllocate($im_out,255,0,0);
                        $green=ImageColorAllocate($im_out,0,255,0);
                        $blue=ImageColorAllocate($im_out,0,0,255);
                        $ry=107;
                        $gy=107;
                        $by=107;
                        for($i=0;$i<256;$i++)
                        {
                                imageLine($im_out, $i+14, 157, $i+14, 157-($max[$i]/$max_value),$white);
                                imageLine($im_out, $i+13, $ry, $i+14, 157-($r[$i]/$max_rgb), $red);
                                imageLine($im_out, $i+13, $gy, $i+14, 157-($g[$i]/$max_rgb), $green);
                                imageLine($im_out, $i+13, $by, $i+14, 157-($b[$i]/$max_rgb), $blue);
                                $ry=157-($r[$i]/$max_rgb);
                                $gy=157-($g[$i]/$max_rgb);
                                $by=157-($b[$i]/$max_rgb);
                        }
                        imageLine($im_out,13,158,270,158,$hist);
                        imageLine($im_out,13,6,270,6,$hist);
                        imageLine($im_out,13,6,13,158,$hist);
                        imageLine($im_out,270,6,270,158,$hist);
                        imagePNG($im_out,$hist_path . $hist_file);
                        imageDestroy($im);
                        imagedestroy($im_out);
                        $im=imagecreatefromPNG($hist_path . $hist_file);
                        imagePNG($im);
                        imagedestroy($im);
                        }
?>
details.php : <?php
/**************************************************************************
*                                                                        *
*    4images - A Web Based Image Gallery Management System              *
*    ----------------------------------------------------------------    *
*                                                                        *
*            File: details.php                                          *
*        Copyright: (C) 2002 Jan Sorgalla                                *
*            Email: jan@4homepages.de                                    *
*              Web: http://www.4homepages.de                            *
*    Scriptversion: 1.7.6                                                *
*                                                                        *
*    Never released without support from: Nicky (http://www.nicky.net)  *
*                                                                        *
**************************************************************************
*                                                                        *
*    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-      *
*    bedingungen (Lizenz.txt) für weitere Informationen.                *
*    ---------------------------------------------------------------    *
*    This script is NOT freeware! Please read the Copyright Notice      *
*    (Licence.txt) for further information.                              *
*                                                                        *
*************************************************************************/
$main_template = 'details';
define('GET_CACHES', 1);
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
include(ROOT_PATH.'includes/page_header.php');
/*
  MOD AJAX COMMENTS
  BEGIN INSERT
*/
include(ROOT_PATH."ajaxcomments.php");
/*
  MOD AJAX COMMENTS
  END INSERT
*/
if (!$image_id) {
    redirect($url);
}
$additional_sql = "";
if (!empty($additional_image_fields)) {
  foreach ($additional_image_fields as $key => $val) {
    $additional_sql .= ", i.".$key;
  }
}
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email")."
        FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_id = $image_id AND i.image_active = 1 AND c.cat_id = i.cat_id";
$image_row = $site_db->query_firstrow($sql);
$cat_id = (isset($image_row['cat_id'])) ? $image_row['cat_id'] : 0;
$is_image_owner = ($image_row['user_id'] > USER_AWAITING && $user_info['user_id'] == $image_row['user_id']) ? 1 : 0;
if (!check_permission("auth_viewcat", $cat_id) || !check_permission("auth_viewimage", $cat_id) || !$image_row) {
  redirect($url);
}
$random_cat_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image($cat_id);
$site_template->register_vars("random_cat_image", $random_cat_image);
unset($random_cat_image);
//-----------------------------------------------------
//--- Show Image --------------------------------------
//-----------------------------------------------------
//--- Start Histogramm 27.02.2006 ----------------------
$hist_image = $image_row['image_media_file'] ;
$hist_file= "hist_".substr($hist_image,0,strlen($hist_image)-4).".png";
$hist_path = "data/histo/";
$ext = substr($hist_image, strpos($hist_image, ".")+1, strlen($hist_image));
$AutorisedImageType = array ("jpg", "jpeg", "JPG", "JPEG");  // Dateitypen für die das Histogramm gezeigt werden soll
if (in_array($ext, $AutorisedImageType)) {
$histogramm_image = "<img src=\"histo.php?hist_image_id=".$image_row['image_id']."\" border=\"1\">";
} else {
  $histogramm_image = REPLACE_EMPTY;
}
$site_template->register_vars(array(
  "histogramm" => "Histogramm:",
  "histogramm_image" => $histogramm_image
));
//--- Ende Histogramm 27.02.2006 ------------------------
$image_allow_comments = (check_permission("auth_readcomment", $cat_id)) ? $image_row['image_allow_comments'] : 0;
$image_name = format_text($image_row['image_name'], 2);
show_image($image_row, $mode, 0, 1);
$in_mode = 0;
$sql = "";
if ($mode == "lightbox") {
  if (!empty($user_info['lightbox_image_ids'])) {
    $image_id_sql = str_replace(" ", ", ", trim($user_info['lightbox_image_ids']));
    $sql = "SELECT image_id, cat_id, image_name, image_media_file, image_thumb_file
            FROM ".IMAGES_TABLE."
            WHERE image_active = 1 AND image_id IN ($image_id_sql) AND (cat_id NOT IN (".get_auth_cat_sql("auth_viewimage", "NOTIN").", ".get_auth_cat_sql("auth_viewcat", "NOTIN")."))
            ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
    $in_mode = 1;
  }
}
elseif ($mode == "search") {
  if (!isset($session_info['searchid']) || empty($session_info['searchid'])) {
    $session_info['search_id'] = $site_sess->get_session_var("search_id");
  }
  if (!empty($session_info['search_id'])) {
    $search_id = unserialize($session_info['search_id']);
  }
  $sql_where_query = "";
  if (!empty($search_id['image_ids'])) {
    $sql_where_query .= "AND image_id IN (".$search_id['image_ids'].") ";
  }
  if (!empty($search_id['user_ids'])) {
    $sql_where_query .= "AND user_id IN (".$search_id['user_ids'].") ";
  }
  if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 1) {
    $new_cutoff = time() - 60 * 60 * 24 * $config['new_cutoff'];
    $sql_where_query .= "AND image_date >= $new_cutoff ";
  }
  if (!empty($search_id['search_cat']) && $search_id['search_cat'] != 0) {
    $cat_id_sql = 0;
    if (check_permission("auth_viewcat", $search_id['search_cat'])) {
      $sub_cat_ids = get_subcat_ids($search_id['search_cat'], $search_id['search_cat'], $cat_parent_cache);
      $cat_id_sql .= ", ".$search_id['search_cat'];
      if (!empty($sub_cat_ids[$search_id['search_cat']])) {
        foreach ($sub_cat_ids[$search_id['search_cat']] as $val) {
          if (check_permission("auth_viewcat", $val)) {
            $cat_id_sql .= ", ".$val;
          }
        }
      }
    }
    $cat_id_sql = $cat_id_sql !== 0 ? "AND cat_id IN ($cat_id_sql)" : "";
  }
  else {
    $cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
    $cat_id_sql = $cat_id_sql !== 0 ? "AND cat_id NOT IN (".$cat_id_sql.")" : "";
  }
  if (!empty($sql_where_query)) {
    $sql = "SELECT image_id, cat_id, image_name, image_media_file, image_thumb_file
            FROM ".IMAGES_TABLE."
            WHERE image_active = 1
            $sql_where_query
            $cat_id_sql
            ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
    $in_mode = 1;
  }
}
if (!$in_mode || empty($sql)) {
  $sql = "SELECT image_id, cat_id, image_name, image_media_file, image_thumb_file
          FROM ".IMAGES_TABLE."
          WHERE image_active = 1 AND cat_id = $cat_id
          ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
}
$result = $site_db->query($sql);
$image_id_cache = array();
$next_prev_cache = array();
$break = 0;
$prev_id = 0;
while($row = $site_db->fetch_array($result)) {
  $image_id_cache[] = $row['image_id'];
  $next_prev_cache[$row['image_id']] = $row;
  if ($break) {
    break;
  }
  if ($prev_id == $image_id) {
    $break = 1;
  }
  $prev_id = $row['image_id'];
}
$site_db->free_result();
if (!function_exists("array_search")) {
  function array_search($needle, $haystack) {
    $match = false;
    foreach ($haystack as $key => $value) {
      if ($value == $needle) {
        $match = $key;
      }
    }
    return $match;
  }
}
$act_key = array_search($image_id, $image_id_cache);
$next_image_id = (isset($image_id_cache[$act_key + 1])) ? $image_id_cache[$act_key + 1] : 0;
$prev_image_id = (isset($image_id_cache[$act_key - 1])) ? $image_id_cache[$act_key - 1] : 0;
unset($image_id_cache);
// Get next and previous image
if (!empty($next_prev_cache[$next_image_id])) {
  $next_image_name = format_text($next_prev_cache[$next_image_id]['image_name'], 2);
  $next_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$next_image_id.((!empty($mode)) ? "&mode=".$mode : ""));
  if (!get_file_path($next_prev_cache[$next_image_id]['image_media_file'], "media", $next_prev_cache[$next_image_id]['cat_id'], 0, 0)) {
    $next_image_file = ICON_PATH."/404.gif";
  }
  else {
    $next_image_file = get_file_path($next_prev_cache[$next_image_id]['image_media_file'], "media", $next_prev_cache[$next_image_id]['cat_id'], 0, 1);
  }
  if (!get_file_path($next_prev_cache[$next_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next_image_id]['cat_id'], 0, 0)) {
    $next_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$next_image_id]['image_media_file']).".gif";
  }
  else {
    $next_thumb_file = get_file_path($next_prev_cache[$next_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next_image_id]['cat_id'], 0, 1);
  }
}
else {
  $next_image_name = REPLACE_EMPTY;
  $next_image_url = REPLACE_EMPTY;
  $next_image_file = REPLACE_EMPTY;
  $next_thumb_file = REPLACE_EMPTY;
}
if (!empty($next_prev_cache[$prev_image_id])) {
  $prev_image_name = format_text($next_prev_cache[$prev_image_id]['image_name'], 2);
  $prev_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$prev_image_id.((!empty($mode)) ? "&mode=".$mode : ""));
  if (!get_file_path($next_prev_cache[$prev_image_id]['image_media_file'], "media", $next_prev_cache[$prev_image_id]['cat_id'], 0, 0)) {
    $prev_image_file = ICON_PATH."/404.gif";
  }
  else {
    $prev_image_file = get_file_path($next_prev_cache[$prev_image_id]['image_media_file'], "media", $next_prev_cache[$prev_image_id]['cat_id'], 0, 1);
  }
  if (!get_file_path($next_prev_cache[$prev_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev_image_id]['cat_id'], 0, 0)) {
    $prev_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$prev_image_id]['image_media_file']).".gif";
  }
  else {
    $prev_thumb_file = get_file_path($next_prev_cache[$prev_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev_image_id]['cat_id'], 0, 1);
  }
}
else {
  $prev_image_name = REPLACE_EMPTY;
  $prev_image_url = REPLACE_EMPTY;
  $prev_image_file = REPLACE_EMPTY;
  $prev_thumb_file = REPLACE_EMPTY;
}
$site_template->register_vars(array(
  "next_image_id" => $next_image_id,
  "next_image_name" => $next_image_name,
  "next_image_url" => $next_image_url,
  "next_image_file" => $next_image_file,
  "next_thumb_file" => $next_thumb_file,
  "prev_image_id" => $prev_image_id,
  "prev_image_name" => $prev_image_name,
  "prev_image_url" => $prev_image_url,
  "prev_image_file" => $prev_image_file,
  "prev_thumb_file" => $prev_thumb_file
));
unset($next_prev_cache);
/*--------------------------------------------- Start MOD: Photo Preview Hack ----------------------------------------- */
$result = $site_db->query($sql);
while($row = $site_db->fetch_array($result)){
    $image_preview[] = $row['image_id'];
    $preview_row[$row['image_id']] = $row;
}
$lastPage = count($image_preview);
$t_template = "<table height=\"0\"width=\"600\"  border=\"0\" cellspacing=\"5\" cellpadding=\"3\" align=\"center\"><tr>\n";
if($lastPage < 6){
    $start = 0;
    $end = $lastPage -1;
} elseif ($act_key == 0 || $act_key == 1){
    $start = 0;
    $end  = 4;
} elseif ($act_key == $lastPage-1 || $act_key == $lastPage -2){
    $start = $lastPage - 5;
    $end = $lastPage - 1;
} else {
    $start = $act_key -2;
    $end  = $act_key +2;
}
$sizeTimes = 0.5;
for($i=$start; $i<=$end; $i++){
    if ($preview_row[$image_preview[$i]]['image_id'] == $image_row['image_id']) {
    $t_template .= "<td style=\"border: 1px dashed #004C75; text-align:center; padding: .1cm \">\n";
    } else {
    $t_template .= "<td style=text-align:center; padding: .1cm\">\n";
    }
    $tag = get_thumbnail_code($preview_row[$image_preview[$i]]['image_media_file'], $preview_row[$image_preview[$i]]['image_thumb_file'], $preview_row[$image_preview[$i]]['image_id'], $preview_row[$image_preview[$i]]['cat_id'], format_text(trim($preview_row[$image_preview[$i]]['image_name']), 2), $mode, 1);
    $oriWidth = substr($tag, strpos($tag, "width")+7, strpos($tag, "\" height")-strlen($tag));
    $oriHeight = substr($tag, strpos($tag, "height")+8, strpos($tag, " alt")-strlen($tag)-1);
    $tag = str_replace('width="'.$oriWidth.'"', 'width="'.$oriWidth*$sizeTimes.'"', $tag);
    $tag = str_replace('height="'.$oriHeight.'"', 'height="'.$oriHeight*$sizeTimes.'"', $tag);
    $t_template .= $tag."<br>\n";
    $t_template .= "<font class=\"smalltext\">".$preview_row[$image_preview[$i]]['image_name']."</font>\n";
}
$t_template .= "</td></table>\n";
$site_template->register_vars("preview_box", $t_template);
unset($image_preview);
/*--- End MOD: Photo Preview Hack  ------------------------------------------ */
//-----------------------------------------------------
//--- Show Count Lightbox -----------------------------
//-----------------------------------------------------
$sql = "SELECT COUNT(*) AS counter
        FROM ".LIGHTBOXES_TABLE."
        WHERE lightbox_image_ids REGEXP '([^0-9]|^)".$image_row['image_id']."([^0-9]|$)'";
       
$lightbox_count = $site_db->query_firstrow($sql);
$site_template->register_vars(array(
  "lang_image_lightbox_count" => $lang['image_lightbox_count'],
  "lightbox_count" => (isset($lightbox_count['counter']) && $lightbox_count['counter']) ? $lightbox_count['counter'] : 0
));
unset($lightbox_count);
//-----------------------------------------------------
//--- Save Comment ------------------------------------
//-----------------------------------------------------
$error = 0;
if ($action == "postcomment" && isset($HTTP_POST_VARS[URL_ID])) {
  $id = intval($HTTP_POST_VARS[URL_ID]);
  $sql = "SELECT cat_id, image_allow_comments
          FROM ".IMAGES_TABLE."
          WHERE image_id = $id";
  $row = $site_db->query_firstrow($sql);
  if ($row['image_allow_comments'] == 0 || !check_permission("auth_postcomment", $row['cat_id']) || !$row) {
    $msg = $lang['comments_deactivated'];
  }
  else {
    $user_name = un_htmlspecialchars(trim($HTTP_POST_VARS['user_name']));
    $comment_headline = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_headline']));
    $comment_text = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_text']));
    $captcha = (isset($HTTP_POST_VARS['captcha'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['captcha'])) : "";
    // Flood Check
    $sql = "SELECT comment_ip, comment_date
            FROM ".COMMENTS_TABLE."
            WHERE image_id = $id
            ORDER BY comment_date DESC
            LIMIT 1";
    $spam_row = $site_db->query_firstrow($sql);
    $spamtime = $spam_row['comment_date'] + 180;
    if ($session_info['session_ip'] == $spam_row['comment_ip'] && time() <= $spamtime && $user_info['user_level'] != ADMIN)  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['spamming'];
      $error = 1;
    }
    $user_name_field = get_user_table_field("", "user_name");
    if (!empty($user_name_field)) {
      if ($site_db->not_empty("SELECT $user_name_field FROM ".USERS_TABLE." WHERE $user_name_field = '".strtolower($user_name)."' AND ".get_user_table_field("", "user_id")." <> '".$user_info['user_id']."'")) {
        $msg .= (($msg != "") ? "<br />" : "").$lang['username_exists'];
        $error = 1;
      }
    }
    if ($user_name == "")  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['name_required'];
      $error = 1;
    }
    if ($comment_headline == "")  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['headline_required'];
      $error = 1;
    }
    if ($comment_text == "")  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['comment_required'];
      $error = 1;
    }
    if ($captcha_enable_comments && !captcha_validate($captcha)) {
      $msg .= (($msg != "") ? "<br />" : "").$lang['captcha_required'];
      $error = 1;
    }
    if (!$error)  {
      $sql = "INSERT INTO ".COMMENTS_TABLE."
              (image_id, user_id, user_name, comment_headline, comment_text, comment_ip, comment_date)
              VALUES
              ($id, ".$user_info['user_id'].", '$user_name', '$comment_headline', '$comment_text', '".$session_info['session_ip']."', ".time().")";
      $site_db->query($sql);
      $commentid = $site_db->get_insert_id();
      update_comment_count($id, $user_info['user_id']);
      $msg = $lang['comment_success'];
    }
  }
  unset($row);
  unset($spam_row);
}
//-----------------------------------------------------
//--- Show Comments -----------------------------------
//-----------------------------------------------------
if ($image_allow_comments == 1) {
  $site_template->register_vars(array(
      "has_rss"  => true,
      "rss_title" => "RSS Feed: ".$image_name." (".str_replace(':', '', $lang['comments']).")",
      "rss_url"  => $script_url."/rss.php?action=comments&".URL_IMAGE_ID."=".$image_id
  ));
  $sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").get_user_table_field(", u.", "user_showemail").get_user_table_field(", u.", "user_invisible").get_user_table_field(", u.", "user_joindate").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").get_user_table_field(", u.", "user_homepage").get_user_table_field(", u.", "user_icq").", u.userpic
,c.comment_rating,c.comment_votes,c.comment_rating_users
          FROM ".COMMENTS_TABLE." c
          LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
          WHERE c.image_id = $image_id
         
ORDER BY c.comment_date ".(COMMENTS_ORDER ? "DESC" : "ASC")."";
  $result = $site_db->query($sql);
  $comment_row = array();
  while ($row = $site_db->fetch_array($result)) {
    $comment_row[] = $row;
  }
  $site_db->free_result($result);
  $num_comments = sizeof($comment_row);
  if (!$num_comments) {
    $comments = "<tr><td class=\"commentrow1\" colspan=\"2\">".$lang['no_comments']."</td></tr>";
  }
  else {
    $comments = "";
    $bgcounter = 0;
    for ($i = 0; $i < $num_comments; $i++) {
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
      $comment_user_email = "";
      $comment_user_email_save = "";
      $comment_user_mailform_link = "";
      $comment_user_email_button = "";
      $comment_user_homepage_button = "";
      $comment_user_icq_button = "";
      $comment_user_profile_button = "";
      $comment_user_status_img = REPLACE_EMPTY;
      $comment_user_name = format_text($comment_row[$i]['comment_user_name'], 2);
      $comment_user_info = $lang['userlevel_guest'];
      $comment_user_id = $comment_row[$i]['user_id'];
     
      if (isset($comment_row[$i][$user_table_fields['user_name']]) && $comment_user_id != GUEST) {
        $comment_user_name = format_text($comment_row[$i][$user_table_fields['user_name']], 2);
        $comment_user_profile_link = !empty($url_show_profile) ? $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_show_profile)) : $site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$comment_user_id);
        $comment_user_profile_button = "<a href=\"".$comment_user_profile_link."\"><img src=\"".get_gallery_image("profile.gif")."\" border=\"0\" alt=\"".$comment_user_name."\" /></a>";
        $comment_user_status_img = ($comment_row[$i][$user_table_fields['user_lastaction']] >= (time() - 300) && ((isset($comment_row[$i][$user_table_fields['user_invisible']]) && $comment_row[$i][$user_table_fields['user_invisible']] == 0) || $user_info['user_level'] == ADMIN)) ? "<img src=\"".get_gallery_image("user_online.gif")."\" border=\"0\" alt=\"Online\" />" : "<img src=\"".get_gallery_image("user_offline.gif")."\" border=\"0\" alt=\"Offline\" />";
        $comment_user_homepage = (isset($comment_row[$i][$user_table_fields['user_homepage']])) ? format_url($comment_row[$i][$user_table_fields['user_homepage']]) : "";
        if (!empty($comment_user_homepage)) {
          $comment_user_homepage_button = "<a href=\"".$comment_user_homepage."\" target=\"_blank\"><img src=\"".get_gallery_image("homepage.gif")."\" border=\"0\" alt=\"".$comment_user_homepage."\" /></a>";
        }
        $comment_user_icq = (isset($comment_row[$i][$user_table_fields['user_icq']])) ? format_text($comment_row[$i][$user_table_fields['user_icq']]) : "";
        if (!empty($comment_user_icq)) {
          $comment_user_icq_button = "<a href=\"http://www.icq.com/people/about_me.php?uin=".$comment_user_icq."\" target=\"_blank\"><img src=\"http://status.icq.com/online.gif?icq=".$comment_user_icq."&img=5\" width=\"18\" height=\"18\" border=\"0\" alt=\"".$comment_user_icq."\" /></a>";
        }
        if (!empty($comment_row[$i][$user_table_fields['user_email']]) && (!isset($comment_row[$i][$user_table_fields['user_showemail']]) || (isset($comment_row[$i][$user_table_fields['user_showemail']]) && $comment_row[$i][$user_table_fields['user_showemail']] == 1))) {
          $comment_user_email = format_text($comment_row[$i][$user_table_fields['user_email']]);
          $comment_user_email_save = format_text(str_replace("@", " at ", $comment_row[$i][$user_table_fields['user_email']]));
          if (!empty($url_mailform)) {
            $comment_user_mailform_link = $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_mailform));
          }
          else {
            $comment_user_mailform_link = $site_sess->url(ROOT_PATH."member.php?action=mailform&".URL_USER_ID."=".$comment_user_id);
          }
          $comment_user_email_button = "<a href=\"".$comment_user_mailform_link."\"><img src=\"".get_gallery_image("email.gif")."\" border=\"0\" alt=\"".$comment_user_email_save."\" /></a>";
        }
        if (!isset($comment_row[$i][$user_table_fields['user_level']]) || (isset($comment_row[$i][$user_table_fields['user_level']]) && $comment_row[$i][$user_table_fields['user_level']] == USER)) {
          $comment_user_info = $lang['userlevel_user'];
        }
        elseif ($comment_row[$i][$user_table_fields['user_level']] == ADMIN) {
          $comment_user_info = $lang['userlevel_admin'];
        }
        $comment_user_info .= "<br />";
        $comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_joindate']])) ? "<br />".$lang['join_date']." ".format_date($config['date_format'], $comment_row[$i][$user_table_fields['user_joindate']]) : "";
        $comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_comments']])) ? "<br />".$lang['comments']." ".$comment_row[$i][$user_table_fields['user_comments']] : "";
      }
      $comment_user_ip = ($user_info['user_level'] == ADMIN) ? $comment_row[$i]['comment_ip'] : "";
      $admin_links = "";
      if ($user_info['user_level'] == ADMIN) {
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a> ";
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
      }
      elseif ($is_image_owner) {
        $admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a> ";
        $admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
      }
      //--- Kommentar-Autor COUNTRY FLAGS ---
    if (!class_exists("GeoIP"))
    {
      include(ROOT_PATH."includes/geoip.inc");
    }
    $gi = geoip_open(ROOT_PATH."includes/GeoIP.dat",GEOIP_STANDARD);
    $countries = array();
    $cid = geoip_country_code_by_addr($gi, $comment_row[$i]['comment_ip']);
    if (empty($cid)) $cid = "lan";
    $countries[$cid] = isset($countries[$cid]) ? $countries[$cid]+1 : 1;
    $comment_user_flag = "<img src=\"".ROOT_PATH."flags/".strtolower($cid).".gif"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0>";
//--- Kommentar-Autor COUNTRY FLAGS ---
      $site_template->register_vars(array(
        "comment_id" => $comment_row[$i]['comment_id'],
        "comment_user_flag" => $comment_user_flag,
        "comment_user_id" => $comment_user_id,
        "comment_user_status_img" => $comment_user_status_img,
        "comment_user_name" => $comment_user_name,
        "comment_user_info" => $comment_user_info,
        "comment_user_profile_button" => $comment_user_profile_button,
        "comment_user_email" => $comment_user_email,
        "comment_user_email_save" => $comment_user_email_save,
        "comment_user_mailform_link" => $comment_user_mailform_link,
        "comment_user_email_button" => $comment_user_email_button,
        "comment_user_homepage_button" => $comment_user_homepage_button,
        "comment_user_icq_button" => $comment_user_icq_button,
        "comment_user_ip" => $comment_user_ip,
        "comment_userpic" => ($config['userpic'] && $comment_row[$i]['userpic']) ? ROOT_PATH."data/userpic/".$comment_row[$i]['userpic'] : "",
        "comment_headline" => format_text($comment_row[$i]['comment_headline'], 0, $config['wordwrap_comments'], 0, 0),
        "comment_text" => format_text($comment_row[$i]['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
        "comment_date" => format_date($config['date_format']." ".$config['time_format'], $comment_row[$i]['comment_date']),
        "row_bg_number" => $row_bg_number,
        "admin_links" => $admin_links
      ));
      /*
  MOD AJAX COMMENTS
  BEGIN INSERT
*/
      if (COMMENT_RATING_ANABLE)
      {
        $comment_row[$i]['cat_id'] = $cat_id;
        $comment_row[$i]['image_allow_comments'] = $image_allow_comments;
        comment_rating_template($comment_row[$i]);
      }
/*
  MOD AJAX COMMENTS
  END INSERT
*/
      $comments .= $site_template->parse_template("comment_bit");
    } // end while
  } //end else
  /*
  MOD AJAX COMMENTS
  START REPLACE
*/
  $site_template->register_vars(array(
    "comments" => $comments,
    "comments_num" => $num_comments,
    "commentbg" => (isset($row_bg_number)) ? $row_bg_number : 0,
    "page" => $page,
    "perpage" => $commentperpage,
  ));
/*
  MOD AJAX COMMENTS
  END REPLACE
*/
  unset($comments);
  //-----------------------------------------------------
  //--- BBCode & Form -----------------------------------
  //-----------------------------------------------------
  $allow_posting = check_permission("auth_postcomment", $cat_id);
  $bbcode = "";
  if ($config['bb_comments'] == 1 && $allow_posting) {
    $site_template->register_vars(array(
      "lang_bbcode" => $lang['bbcode'],
      "lang_tag_prompt" => $lang['tag_prompt'],
      "lang_link_text_prompt" => $lang['link_text_prompt'],
      "lang_link_url_prompt" => $lang['link_url_prompt'],
      "lang_link_email_prompt" => $lang['link_email_prompt'],
      "lang_list_type_prompt" => $lang['list_type_prompt'],
      "lang_list_item_prompt" => $lang['list_item_prompt']
    ));
    $bbcode = $site_template->parse_template("bbcode");
  }
  if (!$allow_posting) {
    $comment_form = "";
  }
  else {
    $user_name = (isset($HTTP_POST_VARS['user_name']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['user_name'])), 2) : (($user_info['user_level'] != GUEST) ? format_text($user_info['user_name'], 2) : "");
    $comment_headline = (isset($HTTP_POST_VARS['comment_headline']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['comment_headline'])), 2) : "";
    $comment_text = (isset($HTTP_POST_VARS['comment_text']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['comment_text'])), 2) : "";
    $site_template->register_vars(array(
      "bbcode" => $bbcode,
      "user_name" => $user_name,
      "comment_headline" => $comment_headline,
      "comment_text" => $comment_text,
      "lang_post_comment" => $lang['post_comment'],
      "lang_name" => $lang['name'],
      "lang_headline" => $lang['headline'],
      "lang_comment" => $lang['comment'],
      "lang_captcha" => $lang['captcha'],
      "lang_captcha_desc" => $lang['captcha_desc'],
      "captcha_comments" => (bool)$captcha_enable_comments
    ));
    $comment_form = $site_template->parse_template("comment_form");
  }
  $site_template->register_vars("comment_form", $comment_form);
  unset($comment_form);
} // end if allow_comments
// Admin Links
$admin_links = "";
if ($user_info['user_level'] == ADMIN) {
  $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=editimage&image_id=".$image_id))."\" target=\"_blank\">".$lang['edit']."</a> ";
  $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=removeimage&image_id=".$image_id))."\" target=\"_blank\">".$lang['delete']."</a>";
}
elseif ($is_image_owner) {
  $admin_links .= ($config['user_edit_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editimage&".URL_IMAGE_ID."=".$image_id)."\">".$lang['edit']."</a> ";
  $admin_links .= ($config['user_delete_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removeimage&".URL_IMAGE_ID."=".$image_id)."\">".$lang['delete']."</a>";
}
$site_template->register_vars("admin_links", $admin_links);
// Update Hits
if ($user_info['user_level'] != ADMIN) {
  $sql = "UPDATE ".IMAGES_TABLE."
          SET image_hits = image_hits + 1
          WHERE image_id = $image_id";
  $site_db->query($sql);
}
//-----------------------------------------------------
//---Clickstream---------------------------------------
//-----------------------------------------------------
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];
if ($mode == "lightbox" && $in_mode) {
  $page_url = "";
if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) {
    if (!empty($regs[1]) && $regs[1] != 1) {
      $page_url = "?".URL_PAGE."=".$regs[1];
    }
  }
  $clickstream .= "<a href=\"".$site_sess->url(ROOT_PATH."lightbox.php".$page_url)."\" class=\"clickstream\">".$lang['lightbox']."</a>".$config['category_separator'];
}
elseif ($mode == "search" && $in_mode) {
  $page_url = "";
  if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) {
    if (!empty($regs[1]) && $regs[1] != 1) {
      $page_url = "&".URL_PAGE."=".$regs[1];
    }
  }
  $clickstream .= "<a href=\"".$site_sess->url(ROOT_PATH."search.php?show_result=1".$page_url)."\" class=\"clickstream\">".$lang['search']."</a>".$config['category_separator'];
}
else {
  $clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
}
$clickstream .= $image_name."</span>";
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  "msg" => $msg,
  "clickstream" => $clickstream,
  "lang_category" => $lang['category'],
  "lang_added_by" => $lang['added_by'],
  "lang_description" => $lang['description'],
  "lang_keywords" => $lang['keywords'],
  "lang_date" => $lang['date'],
  "lang_hits" => $lang['hits'],
  "lang_downloads" => $lang['downloads'],
  "lang_rating" => $lang['rating'],
  "lang_votes" => $lang['votes'],
  "lang_author" => $lang['author'],
  "lang_comment" => $lang['comment'],
  "lang_prev_image" => $lang['prev_image'],
  "lang_next_image" => $lang['next_image'],
  "lang_file_size" => $lang['file_size']
));
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
?>
-
continuing from previous post
I have created the data/histo directory
I have uploaded the background.php file to the root directory
I get a broken image.... if I try to view the broken image I get a ton of errors pages long. I think this is a cool mod if anyone has =any idea....
-
hey Robert ...
... there is something wrong with your php-editor or something else ...
... try the code download for histogramm.php (not histo.php) and details.php again ... and use another php-editor ...
... you are the first downloader who presented such a code after downloading ... ;)
... and please use for reading the installation instruction : Google-Translator ...
...
... your problems have nothing to do with version 1.7.6 and using php5 ...
... edit ...
... and please read this here (http://209.85.135.132/translate_c?hl=de&sl=de&tl=en&u=http://www.4homepages.de/forum/index.php%3FPHPSESSID%3Da0fe4d13d31323321c86cad7d2fc6a1a%26topic%3D11844.msg126008&usg=ALkJrhjlX-_l2cvBcJjcDCJbeoVAUe17dw#msg126008) ...
-
Wow... dont know where those characters came from.. I use ultraedit... weird I think that was a forum error ... my files dont look like that . sorry...
I lived in Brotterode Thuringen for many years... So my German is not that bad.... Aber ich haub keine lust fur schreiben ich weisse meine deutsche ich sehr schreklische und hwssiliche und unbekkant. Naja///
So you see it is cool when I read German and speaking it probably sounds funny enough... but I still think it is better than my Chinese :) THAnk god 4images is not Chinese as I cant read it at all even after 8 years...
ANyways the problem I made was I created the directory in the wrong directory. I was confused as you have support in the forum on your download page, and people replying to the original thread on this page/// It seems like they are replying to the original threads modifications and not to the modifications made to the version on your site. SO I was not sure what was up and tried to follow through using the original one in the thread.....
I think you shouls put the changes in the mod from your forum onto this one so people could follow the changes and know which is the one to troubleshoot. Right now it is like two different mods in one thread.. or two threads in two forums... 8O
-
@ AntiNSA2
... I saw ... the histogram is installed ... with german discription ... ;)
... almost perfect ...
-
Ah German , english... its all the same : ) the people that read histogram need no translations :) If I get time (Really bigt if always busy) Ill put the stuff up here in English :)
-
BTW thanks cool mod.. I wanted to sak... do you know how much externally added before 4images watermarks alter the histogram?
-
I am coming back to this great working mod, and have read through the thread again... but couldnt find how to resize the histogram? I think it is way to big....
Where are the settings?
THanks! (4 all the great mods)
-
I believe I have followed all the steps correctly..,
yet the histogram is not showing.
in here (http://batamphotoclub.org/gallery)
please help
thank you!
-
anyone..?
:cry:
-
I believe I have followed all the steps correctly..,
... you're certain ... ? ... and also this ... ?
@all
... I redesigned this MOD with some fixes ...
... you can download all neccesary files and the installations instruction ... here (http://klick.kl.funpic.de/files.php) ...
-
... you're certain ... ? ... and also this ... ?
@all
... I redesigned this MOD with some fixes ...
... you can download all neccesary files and the installations instruction ... here (http://klick.kl.funpic.de/files.php) ...
I've checked and re-checked several times.. following the guidance from this thread.
the Histogram MOD in the link you provided is not downloadable.. it says OFF
thanx!
-
... sorry to read, that you are not be able to get this ON ...
-
the Histogram MOD in the link you provided is not downloadable.. it says OFF
thanx!
The file available for registered members only. Register then you can download the package.
@mawenzi:
I don't know if you aware of this, but if you add id=NN in the url it will display correct page and highlight the file with that id?
http://klick.kl.funpic.de/files.php?id=29
-
The file available for registered members only. Register then you can download the package.
thank you for the explanation V@no.., I wouldn't know.. :lol:
seeing a foreign language confused me already....
I'll try to register..
hopefully I don't get lost.. :lol:
oops.. registration failed, cannot register...
:(
-
@ d1eter ...
... there can't be a failed registration ...
... for some time you don't need a mail for register on my website ...
... the text in the red box is only a hint for that ...
... after registering you can directly logged in with your name and password on my site ... it's that simple ...
@V@no ...
... yes, the link in this manner is perfect ... :mrgreen:
... I'll edit my first post in this way ...
-
@ d1eter ...
... I just saw the perfect working histogram incl. a histogram-info translation in english on your website ...
... looks very nice ...
@ AntiNSA2 ...
... for a smaller histogram-design you can use the attributes "width" and "hight" for the histo-image to your needs ...
-
@ d1eter ...
... I just saw the perfect working histogram incl. a histogram-info translation in english on your website ...
... looks very nice ...
yes mawenzi...,
couldn't have done it without your perfectly working script... :wink:
thank you!
the background gif still in german though... :oops:
-
@d1eter ...
... so you need a background.gif in ... english ... ?
-
that'll look nice.. isn't it..
:P
-
Where can i download this modification?
the links from the original posting are down
-
@ uli480
... sorry ... but my server is down at time ...
... try to download in some days ...
... and if you can see the histogram-image in the original-post, then you can download the modification from my website ...
Edit ...
... the download and the tutorial are now again available from my website ...
-
the server is still down. can you please upload it in the forum? thx :-)
-
The server prompts you to enter a verification code when entering the code says that is not true. Put in another place. Thanks.
-
What is needed php library for the normal functioning of MOD?
-
Does anyone has this file as you aren't able to download it any more?
Thank you!
Regards,
Patrick
-
Does anyone has this file as you aren't able to download it any more?
Thank you!
Regards,
Patrick
nobody?