|
|
cctnt
tagchen
Also
ich hab ein galleryscript gemacht und will jetzt das das original bild in nem popupfenster aufgeht wenn man auf den thumbnail klickt.
das mit dem popup is ja ned so schwer, allerdings will ich die ganzen leisten,scrollbars usw wegbekommen.
hier mal mein momentaner verlinkungscode
| php: |
1:
|
<?php printf ("<a href=\"%s\" target=\"_blank\"><img src=\"%s\" border=\"0\"></a> ", $thumbnail->path_org.$file, $thumbnail->path_thumb.$file); ?> |
|
das %s is für die bildernamen(werd ich euch wohl ned erzählen müssen oder)
kann mir wer helfen?
ich habs schon mit js versucht ging aber ned
deto
Tag,
da ich ich genau das richtige für dich, ein PopUp Script das alles außenrum weg macht, speziell für Bilder..
| code: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
|
function ViewImage(ifile,ix,iy,ititle)
{
var win;
var sWidth;
var sHeight;
win = window.open("","imageviewer","width="+ix+",height="+iy+",menubar=no,toolbar=no");
win.document.open();
win.document.write("<html><head><title>"+ititle+"</title>");
win.document.write("</head><body>");
win.document.write('<div style="position:absolute; width:'+ix+'px; height:'+iy+'px; left:0px;top:0px">');
win.document.write('<a href="#" onclick="self.close()"><img src='+ifile+' border="0" alt=""></a></div></body></html>');
win.document.close();
} |
|
Binde dieses JavaScript im Head-Teil ein, aufrufen tust du es folgendermaßen:
| php: |
1:
|
<?php <a href="#" onclick="ViewImages('pfad/meinbild.jpg', 'breite', 'hoehe', 'Seiten-Titel'"><img src="mein-thumbnail.jpg" border="0" alt=""></a> ?> |
|
Viel Spaß
cctnt
thx
aber ehrlichgesagt
das teil funzt ned
Parse error: parse error, unexpected T_STRING, expecting ')' in E:\Programme\xampp\htdocs\nwn\thumb.php on line 2
deto
ach lol, beim onclick-Event im Link musst du noch die Klammer zu machen, sorry. Aber des hättest auch selber finden können
cctnt
kriegs ned weg
hier mal mein link code mit deiner funktion
printf ("<a href="#" onclick="ViewImages('%s', 'breite', 'hoehe', 'Seiten-Titel'")><img src="%s" border="0" alt=""></a> ",
$thumbnail->path_org.$file, $thumbnail->path_thumb.$file);
Morty
| php: |
1:
|
<?php printf ("<a href="#" onclick="ViewImages('%s', 'breite', 'hoehe', 'Seiten-Titel)'"><img src="%s" border="0" alt=""></a> ", ?> |
|
The real Franky
| Zitat: |
Original von Morty
| php: |
1:
|
<?php printf ("<a href="#" onclick="ViewImages('%s', 'breite', 'hoehe', 'Seiten-Titel)'"><img src="%s" border="0" alt=""></a> ", ?> |
|
|
gehts so:?
| php: |
1:
|
<?php printf ("<a href=\"#\" onclick=\"ViewImages('%s', 'breite', 'hoehe', 'Seiten-Titel)'\"><img src=\"%s\" border=\"0\" alt=\"\"></a> "); ?> |
|
cctnt
nope
ich poste mal die ganze datei ok?
| php: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
|
<?php
function ViewImage(ifile,ix,iy,ititle)
{
var win;
var sWidth;
var sHeight;
win = window.open("","imageviewer","width="+ix+",height="+iy+",menubar=no,toolbar=no");
win.document.open();
win.document.write("<html><head><title>"+ititle+"</title>");
win.document.write("</head><body>");
win.document.write('<div style="position:absolute; width:'+ix+'px; height:'+iy+'px; left:0px;top:0px">');
win.document.write('<a href="#" onclick="self.close()"><img src='+ifile+' border="0" alt=""></a></div></body></html>');
win.document.close();
}
function getFiles($path) {
$result = false;
$dh=opendir($path);
if ($dh) {
while ($file = readdir($dh)) {
if (eregi("(\.gif)|(\.jpg)|(\.jpeg)|(\.png)$",$file)) {
$result[] = $file;
}
}
closedir($dh);
}
return $result;
}
require_once('./thumbnail.php');
$imgpath = "./screens/";
$errors = false;
$files = getFiles($imgpath);
if (is_array($files)) {
$thumbnail = new thumbnail;
$thumbnail->path_org = $imgpath;
foreach($files as $file) {
if ($thumbnail->getThumb($file)) {
// "<a href=\"%s\" target=\"_blank\" onClick=\"MM_openBrWindow('','','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=916,height=816')\"><img src=\"%s\" border=\"0\"></a> ",
printf ("<a href=\"#\" onclick=\"ViewImages('%s', 'breite', 'hoehe', 'Seiten-Titel)'\"><img src=\"%s\" border=\"0\" alt=\"\"></a> "),$thumbnail->path_org.$file, $thumbnail->path_thumb.$file);
} else {
$errors[$file] = $thumbnail->error['msg'];
}
}
if (is_array($errors)) {
foreach($errors as $key=>$val) {
print ('<hr>Fehler<br>');
printf('%s : %s', $key, $val);
}
}
} else {
print ("No Files found.");
}
?> |
|
deto
Oh my god...
red ich an ne wand?
Ich hab gesagt das das Java Script in den Head-Teil von HTML muss
so dann in etwa:
| code: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
|
<html>
<head>
<title>Meine Webseite</title>
<script language="javascript" type="text/javascript">
function ViewImage(ifile,ix,iy,ititle)
{
var win;
var sWidth;
var sHeight;
win = wndow.open("","imageviewer","width="+ix+",height="+iy+",menubar=no,toolbar=no");
win.document.open();
win.document.write("<html><head><title>"+ititle+"</title>");
win.document.write("</head><body>");
win.document.write('<div style="position:absolute; width:'+ix+'px; height:'+iy+'px; left:0px;top:0px">');
win.document.write('<a href="#" onclick="self.close()"><img src='+ifile+' border="0" alt=""></a></div></body></html>');
win.document.close();
}
</script>
</head>
<body> |
|
und dann kommen halt deine PHP Scripte und irgendwann den link...
| php: |
1:
|
<?php printf ("<a href=\"#\" onclick=\"ViewImages('%s', 'breite', 'hoehe', 'Seiten-Titel)'\"><img src=\"%s\" border=\"0\" alt=\"\"></a> "),$thumbnail->path_org.$file, $thumbnail->path_thumb.$file); ?> |
|
und nun sollte es schon gehn! Und das JavaScript funktioniert mit sicherheit sonst würde ich es ned auf meiner Homepage benutzen
cctnt
ups sry
das mit dem head hab ich übersehn
nur jetzt öffnet er die pics nimma
sobald ich auf nem thumbnail klicke, kommt fehler auf der seite
zeile 21 und das ist <?php
deto
schick mal den kompletten code der datei rein damit man besser arbeiten kann
cctnt
| php: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
|
<html>
<head>
<script language="javascript" type="text/javascript">
function ViewImage(ifile,ix,iy,ititle)
{
var win;
var sWidth;
var sHeight;
win = wndow.open("","imageviewer","width="+ix+",height="+iy+",menubar=no,toolbar=no");
win.document.open();
win.document.write("<html><head><title>"+ititle+"</title>");
win.document.write("</head><body>");
win.document.write('<div style="position:absolute; width:'+ix+'px; height:'+iy+'px; left:0px;top:0px">');
win.document.write('<a href="#" onclick="self.close()"><img src='+ifile+' border="0" alt=""></a></div></body></html>');
win.document.close();
}
</script>
</head>
<body>
<?php
function getFiles($path) {
$result = false;
$dh=opendir($path);
if ($dh) {
while ($file = readdir($dh)) {
if (eregi("(\.gif)|(\.jpg)|(\.jpeg)|(\.png)$",$file)) {
$result[] = $file;
}
}
closedir($dh);
}
return $result;
}
require_once('./thumbnail.php');
$imgpath = "./screens/";
$errors = false;
$files = getFiles($imgpath);
if (is_array($files)) {
$thumbnail = new thumbnail;
$thumbnail->path_org = $imgpath;
foreach($files as $file) {
if ($thumbnail->getThumb($file)) {
printf ("<a href=\"#\" onclick=\"ViewImages('%s', 'breite', 'hoehe', 'Seiten-Titel')\"><img src=\"%s\" border=\"0\" alt=\"\"></a> ",
$thumbnail->path_org.$file, $thumbnail->path_thumb.$file);
} else {
$errors[$file] = $thumbnail->error['msg'];
}
}
if (is_array($errors)) {
foreach($errors as $key=>$val) {
print ('<hr>Fehler<br>');
printf('%s : %s', $key, $val);
}
}
} else {
print ("No Files found.");
}
?> |
|
hier die gesamte thumb.php
deto
puh da bin ich mit meinem latein am ende, vielleicht kann ich den fehler finden wenn du die funktionen auch noch postest, also deine thumbnail funktion...
ansonsten hab ich kein plan mehr...
Snake
win = wndow.open
fehlt da nicht ein i?
deto
aarg shit ja,da hab ich mich verschreiben
ach diese textfelder in diesen foren sind immer so beschiessen klein und die schrift ist zum code rein pasten auch ned grad doll...
cctnt
aber das wars auch nicht
edit
ich habs gerade auf nen anderen weg hingekriegt.
trotzdem thx
Bevor ihr fragt wie? Ganz einfach.
und zwar hab ich den code vom thumbnail mit popup script hier in der codeschnippsel abteilung angepasst.
nur wie kann ich beim popup fenster den bgverändern?
TheDoom
An besten jemand Banned den.. n00b...
Geh ins script und mach ein
(nameDerVarDesPopUps).write('<style> body { background-image: url(); } </style>');
damit kann er bestimmt auch nix anfang'... -.- 
cctnt
@The Doom:
Nur weil ich ned deinen Skill habe,brauchste ned gleich patzig zu werden.
Du hast auch mal so angefangen oder?
und ich habs anders gemacht als im script werds aber adaptieren
TheDoom
Is schon länger her...
Ausserdem würde ich an deiner Stelle nicht dauernd fragen, sondern auch
2 oder 3, 4 mal die Posts der anderen durchlesen, bis ich es kapiere....
Scraper
@Doom: Es gibt keine dummen Fragen, nur dumme Antworten!
Zum Glück entscheidest du nicht, wer gebannt wird!
Ich hoffe das es hier nicht zu weiteren Ausschreitungen kommt.
|
|