Foto Slideshow
Ik heb een template van een site gekregen via via, inclusief een foto slideshow.
Nu werkt de site, alleen als de slide show zou moeten werken krijg ik een fout code:
Parse error: syntax error, unexpected '"' on line 8
Kan ik de hele code van de slideshow aan jullie laten zien?
En dat ik natuurlijk te horen krijg wat ik precies moet veranderen en waar.
gr,
Vin
toon lijn 6 tot 9 .
$SCRIPT_NAME=$_SERVER["SCRIPT_NAME"];
if((!isset($SERVER_NAME))||($SERVER_NAME==""))
$SERVER_NAME=$_SERVER["SERVER_NAME"];
if(!isset($stylesheet))
$stylesheet= "<link rel=\"stylesheet\" type=\"text/css\" href=\"$SCRIPT_NAME?css\">"; //$stylesheet="<link rel=
\"stylesheet\" type=\"text/css\" href=\"/home/phpshow.php\">";
Maar welke regel is nou het probleem dan? Want hier worden 3 variabelen geset die niet bestaan. Dat heeft naar m`n idee niets met een foto slideshow te maken.
Kan ik het hele script hier posten?
Want het zal vast iets megasimpels zijn.
Kijk zo:
Code (php)
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
<?
if((!isset($SCRIPT_NAME))||($SCRIPT_NAME==""))
$SCRIPT_NAME=$_SERVER["SCRIPT_NAME"];
if((!isset($SERVER_NAME))||($SERVER_NAME==""))
$SERVER_NAME=$_SERVER["SERVER_NAME"];
if(!isset($stylesheet))
$stylesheet= "<link rel=\"stylesheet\" type=\"text/css\" href=\"$SCRIPT_NAME?css\">"; //$stylesheet="<link rel=
\"stylesheet\" type=\"text/css\" href=\"/home/phpshow.php\">";
?>
if((!isset($SCRIPT_NAME))||($SCRIPT_NAME==""))
$SCRIPT_NAME=$_SERVER["SCRIPT_NAME"];
if((!isset($SERVER_NAME))||($SERVER_NAME==""))
$SERVER_NAME=$_SERVER["SERVER_NAME"];
if(!isset($stylesheet))
$stylesheet= "<link rel=\"stylesheet\" type=\"text/css\" href=\"$SCRIPT_NAME?css\">"; //$stylesheet="<link rel=
\"stylesheet\" type=\"text/css\" href=\"/home/phpshow.php\">";
?>
Gewijzigd op 28/01/2011 21:17:12 door Jurrian Nijland
Code (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?PHP
//put this file in the same directory as your pictures and call it - works!
//mixed functionality file in order to have everything in one file.
//Details available at http://phpshow.panmental.de
//
//IN CASE OF PROBLEMS RUN "phpshow.php?diag" TO GET SOME DIAGNOSIS
//
//DO NOT PUT ANYTHING IN FRONT OF THE OPENING "<?PHP" TAG;
//IF YOU DO YOU IT ANYWAY YOU HAVE TO SET $GD_WORKAROUND="oldGD"; AND $allowZip=false;
//
//first parameter (e.g. "phpshow.php?image&...") is the mode
//available modes are
//image: returns the picture resized
//browse: overview of all pics
//slides: slideshow
//opaque: semi-transparent png images for fading
//css: stylesheet
//
//author: Johannes Knabe, July 2004 - July 2008, [email protected]
//note that all the "if(!isset($..." allow for easy overwriting of the defaults, e.g. you can have a script
//that pre-defines some of these values (say: $browsertitle="South America trip" ) and then refers to the
//main script location (for example: include '../scripts/phpshow.php'; )
if((!isset($SCRIPT_NAME))||($SCRIPT_NAME==""))
$SCRIPT_NAME=$_SERVER["SCRIPT_NAME"];
if((!isset($SERVER_NAME))||($SERVER_NAME==""))
$SERVER_NAME=$_SERVER["SERVER_NAME"];
if(!isset($stylesheet))
$stylesheet= "<link rel=\"stylesheet\" type=\"text/css\" href=\"$SCRIPT_NAME?css\">"; //$stylesheet="<link rel=
\"stylesheet\" type=\"text/css\" href=\"/home/phpshow.php\">";
if(!isset($browsertitle))
$browsertitle="Image browser";
if(!isset($slidetitle))
$slidetitle= "Slideshow";
if(!isset($description))
$description= ""; //leave blank for no search engine indexing
if(!isset($keywords))
$keywords= ""; //leave blank for no search engine indexing
if(!isset($autoplay)){
if((isset($hideControlElements))&&($hideControlElements))
$autoplay=true; //if there are no controls then we have to start automatically of course
else
$autoplay=false; //Shall presentation start automatically when in slideshow mode?
}
if(!isset($stopOnMouseOver))
$stopOnMouseOver=true;//Shall playing be interrupted while the mouse is over a photo (slideshow mode)?
if(!isset($openLinksIn))
$openLinksIn="_blank"; //if there is a link associated with the clicked image, open link in this window (can also be
"_self" or "_parent" or some name).
if(!isset($openLinkOpts))
$openLinkOpts=""; //optionally you can set options for the new window (height, width, menubar, resizable ...)
//with value "auto" the script will use the preferred language of the browser, or, if not present, English.
if(!isset($lang))
$lang="auto"; //can also be set to fixed "English" or "German" or "Swedish" or "Dutch" or "Norwegian" or "Portuguese"
or "French" or "Russian" or "Italian"
//$hideControlElements=true;//useful for embedded frames
//$basePath="./"; //use "." for browsing current directory
//or for example "./photos" to browse subdir photos
//browser settings
if(!isset($imgsperline))
$imgsperline=5; //5 columns
if(!isset($imgspercolumn))
$imgspercolumn=3; //default 3 rows
$maxperpage=$imgsperline*$imgspercolumn;
//IF BROWSE MODE DOES NOT WORK PROPERLY CHANGE $GD_WORKAROUND=""; TO $GD_WORKAROUND="oldGD";
//thumbnail settings
if(!isset($GD_WORKAROUND))
$GD_WORKAROUND=""; //set this to "oldGD" or "newGD" to switch off automatic GD version detection
//set to "oldGD" if you experience any trouble with the browse mode!
if(!isset($scrwidth))
$scrwidth=1020; //important _only_ for resulution of preview thumbs in browser mode
if(!isset($thumbQuality))
$thumbQuality=90; //jpeg compression of thumbs (0 worst, 100 best quality but also largest size)
if(!isset($resample))
$resample=true; //resample images when creating thumbs - set to true if you have a fast server as quality
is a lot better, but takes a bit of processing
$imgwidth=$scrwidth/$imgsperline; // - if possible make $scrwidth be divisible by both columns and rows without remainder
$realimgwidth=$imgwidth+5; //plus 4 for cellspacing and 1 for imageborder
if(!isset($allowZip))
$allowZip=true; //do you want to give people the opportunity to download all photos in one zip-file?
//slideshow settings
if(!isset($initialDelay))
$initialDelay=5;//how long shall the overall display time (in seconds) of a picture be initially
if(!isset($preloadForward))
$preloadForward=3;//how many pictures do you want to preload ahead?
if(!isset($useFading))
$useFading =true;//do you want to blend between images? (does not work in oldGD mode!)
if(!isset($fadeMode))
$fadeMode =rand(0,4);//0:classic, 1:right-to-left, 2:left-to-right, 3:square fading type
if(!isset($fadeColor))
$fadeColor =255; //fade to this grey tone [e.g. 255 is #FFFFFF, 0 equals #000000]
if(!isset($bgcolor))
$bgcolor="#fff";//*#aaa;/*this #aaa and the border #aaa's to #000*/
if(!isset($fadeSteps))
$fadeSteps =6; //how many shade levels for fadeing
if(!isset($fadeTime))
$fadeTime =70; //milliseconds for one shade level
//(i.e. overall fade time = $fadeSteps*$fadeTime;
// overall fade time must not be bigger than 1200!)
if(!isset($startFit))
$startFit =true;//shall the slideshow initially fit images to screen or show the actual size
if(!isset($showTitle))
$showTitle =true;//when the mouse is moved over the current image shall it's title be shown as a tooltip?
if(!isset($dateOrder))
$dateOrder=false;//sort images by date rather than by their filename
if(!isset($randomOrder))
$randomOrder=false;//display in random order; this only makes sense for slideshows and not browsing!
if(!isset($showPicSize))
$showPicSize=false;//show or hide the size of the picture, e.g. (640x480)
if(!isset($showPicNum))
$showPicNum=true; //show or hide the number of the current image and total number, e.g. 5/11
//select language:
if($lang=="auto"){
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
$_SERVER['HTTP_ACCEPT_LANGUAGE']=strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']);
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="de")
$lang="German"; //some kind of German set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="sv")
$lang="Swedish"; //some kind of Swedish set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="nl")
$lang="Dutch"; //some kind of Dutch set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="no")
$lang="Norwegian"; //some kind of Norwegian set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="nb")
$lang="Norwegian"; //some kind of Norwegian set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="nn")
$lang="Norwegian"; //some kind of Norwegian set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="pt")
$lang="Portuguese"; //some kind of Portuguese set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="fr")
$lang="French"; //some kind of French set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="ru")
$lang="Russian"; //some kind of Russian set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="es")
$lang="Spanish"; //some kind of Spanish set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="it")
$lang="Italian"; //some kind of Italian set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="da")
$lang="Danish"; //some kind of Italian set as preferred language
if($lang=="auto") //OK, no language found we have available, settle for default
$lang="English";
}else
$lang="English";//default if preferred language is not transmitted
}
//begin language specific strings for ENGLISH
$pauseString="pause";
$playString="play";
$actualString="actual size";
$fitString="fit on screen";
$browseString="browse pictures";
$slidesString="start slideshow";
$nextString="next";
$backString="back";
$nextPageString="next page";
$priorPageString="prior page";
$secString="sec";
$delayString="delay";
$notLoadedString="Image not fully loaded yet, please be patient...";
$downloadString="Click OK if you want to download all #NUM# photos in one single zip archive with a size of approximately
#SIZE#.";
$downloadButton="download all";
$aftertext ="<div class=\"smallprint\" align=\"center\">If you are shown on a picture and don't want this let me know and
I will remove it.<br/>
<i>This page is autogenerated, <a target=\"_blank\" href=\"http://phpshow.panmental.de/\">get the
//put this file in the same directory as your pictures and call it - works!
//mixed functionality file in order to have everything in one file.
//Details available at http://phpshow.panmental.de
//
//IN CASE OF PROBLEMS RUN "phpshow.php?diag" TO GET SOME DIAGNOSIS
//
//DO NOT PUT ANYTHING IN FRONT OF THE OPENING "<?PHP" TAG;
//IF YOU DO YOU IT ANYWAY YOU HAVE TO SET $GD_WORKAROUND="oldGD"; AND $allowZip=false;
//
//first parameter (e.g. "phpshow.php?image&...") is the mode
//available modes are
//image: returns the picture resized
//browse: overview of all pics
//slides: slideshow
//opaque: semi-transparent png images for fading
//css: stylesheet
//
//author: Johannes Knabe, July 2004 - July 2008, [email protected]
//note that all the "if(!isset($..." allow for easy overwriting of the defaults, e.g. you can have a script
//that pre-defines some of these values (say: $browsertitle="South America trip" ) and then refers to the
//main script location (for example: include '../scripts/phpshow.php'; )
if((!isset($SCRIPT_NAME))||($SCRIPT_NAME==""))
$SCRIPT_NAME=$_SERVER["SCRIPT_NAME"];
if((!isset($SERVER_NAME))||($SERVER_NAME==""))
$SERVER_NAME=$_SERVER["SERVER_NAME"];
if(!isset($stylesheet))
$stylesheet= "<link rel=\"stylesheet\" type=\"text/css\" href=\"$SCRIPT_NAME?css\">"; //$stylesheet="<link rel=
\"stylesheet\" type=\"text/css\" href=\"/home/phpshow.php\">";
if(!isset($browsertitle))
$browsertitle="Image browser";
if(!isset($slidetitle))
$slidetitle= "Slideshow";
if(!isset($description))
$description= ""; //leave blank for no search engine indexing
if(!isset($keywords))
$keywords= ""; //leave blank for no search engine indexing
if(!isset($autoplay)){
if((isset($hideControlElements))&&($hideControlElements))
$autoplay=true; //if there are no controls then we have to start automatically of course
else
$autoplay=false; //Shall presentation start automatically when in slideshow mode?
}
if(!isset($stopOnMouseOver))
$stopOnMouseOver=true;//Shall playing be interrupted while the mouse is over a photo (slideshow mode)?
if(!isset($openLinksIn))
$openLinksIn="_blank"; //if there is a link associated with the clicked image, open link in this window (can also be
"_self" or "_parent" or some name).
if(!isset($openLinkOpts))
$openLinkOpts=""; //optionally you can set options for the new window (height, width, menubar, resizable ...)
//with value "auto" the script will use the preferred language of the browser, or, if not present, English.
if(!isset($lang))
$lang="auto"; //can also be set to fixed "English" or "German" or "Swedish" or "Dutch" or "Norwegian" or "Portuguese"
or "French" or "Russian" or "Italian"
//$hideControlElements=true;//useful for embedded frames
//$basePath="./"; //use "." for browsing current directory
//or for example "./photos" to browse subdir photos
//browser settings
if(!isset($imgsperline))
$imgsperline=5; //5 columns
if(!isset($imgspercolumn))
$imgspercolumn=3; //default 3 rows
$maxperpage=$imgsperline*$imgspercolumn;
//IF BROWSE MODE DOES NOT WORK PROPERLY CHANGE $GD_WORKAROUND=""; TO $GD_WORKAROUND="oldGD";
//thumbnail settings
if(!isset($GD_WORKAROUND))
$GD_WORKAROUND=""; //set this to "oldGD" or "newGD" to switch off automatic GD version detection
//set to "oldGD" if you experience any trouble with the browse mode!
if(!isset($scrwidth))
$scrwidth=1020; //important _only_ for resulution of preview thumbs in browser mode
if(!isset($thumbQuality))
$thumbQuality=90; //jpeg compression of thumbs (0 worst, 100 best quality but also largest size)
if(!isset($resample))
$resample=true; //resample images when creating thumbs - set to true if you have a fast server as quality
is a lot better, but takes a bit of processing
$imgwidth=$scrwidth/$imgsperline; // - if possible make $scrwidth be divisible by both columns and rows without remainder
$realimgwidth=$imgwidth+5; //plus 4 for cellspacing and 1 for imageborder
if(!isset($allowZip))
$allowZip=true; //do you want to give people the opportunity to download all photos in one zip-file?
//slideshow settings
if(!isset($initialDelay))
$initialDelay=5;//how long shall the overall display time (in seconds) of a picture be initially
if(!isset($preloadForward))
$preloadForward=3;//how many pictures do you want to preload ahead?
if(!isset($useFading))
$useFading =true;//do you want to blend between images? (does not work in oldGD mode!)
if(!isset($fadeMode))
$fadeMode =rand(0,4);//0:classic, 1:right-to-left, 2:left-to-right, 3:square fading type
if(!isset($fadeColor))
$fadeColor =255; //fade to this grey tone [e.g. 255 is #FFFFFF, 0 equals #000000]
if(!isset($bgcolor))
$bgcolor="#fff";//*#aaa;/*this #aaa and the border #aaa's to #000*/
if(!isset($fadeSteps))
$fadeSteps =6; //how many shade levels for fadeing
if(!isset($fadeTime))
$fadeTime =70; //milliseconds for one shade level
//(i.e. overall fade time = $fadeSteps*$fadeTime;
// overall fade time must not be bigger than 1200!)
if(!isset($startFit))
$startFit =true;//shall the slideshow initially fit images to screen or show the actual size
if(!isset($showTitle))
$showTitle =true;//when the mouse is moved over the current image shall it's title be shown as a tooltip?
if(!isset($dateOrder))
$dateOrder=false;//sort images by date rather than by their filename
if(!isset($randomOrder))
$randomOrder=false;//display in random order; this only makes sense for slideshows and not browsing!
if(!isset($showPicSize))
$showPicSize=false;//show or hide the size of the picture, e.g. (640x480)
if(!isset($showPicNum))
$showPicNum=true; //show or hide the number of the current image and total number, e.g. 5/11
//select language:
if($lang=="auto"){
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
$_SERVER['HTTP_ACCEPT_LANGUAGE']=strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']);
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="de")
$lang="German"; //some kind of German set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="sv")
$lang="Swedish"; //some kind of Swedish set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="nl")
$lang="Dutch"; //some kind of Dutch set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="no")
$lang="Norwegian"; //some kind of Norwegian set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="nb")
$lang="Norwegian"; //some kind of Norwegian set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="nn")
$lang="Norwegian"; //some kind of Norwegian set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="pt")
$lang="Portuguese"; //some kind of Portuguese set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="fr")
$lang="French"; //some kind of French set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="ru")
$lang="Russian"; //some kind of Russian set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="es")
$lang="Spanish"; //some kind of Spanish set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="it")
$lang="Italian"; //some kind of Italian set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="da")
$lang="Danish"; //some kind of Italian set as preferred language
if($lang=="auto") //OK, no language found we have available, settle for default
$lang="English";
}else
$lang="English";//default if preferred language is not transmitted
}
//begin language specific strings for ENGLISH
$pauseString="pause";
$playString="play";
$actualString="actual size";
$fitString="fit on screen";
$browseString="browse pictures";
$slidesString="start slideshow";
$nextString="next";
$backString="back";
$nextPageString="next page";
$priorPageString="prior page";
$secString="sec";
$delayString="delay";
$notLoadedString="Image not fully loaded yet, please be patient...";
$downloadString="Click OK if you want to download all #NUM# photos in one single zip archive with a size of approximately
#SIZE#.";
$downloadButton="download all";
$aftertext ="<div class=\"smallprint\" align=\"center\">If you are shown on a picture and don't want this let me know and
I will remove it.<br/>
<i>This page is autogenerated, <a target=\"_blank\" href=\"http://phpshow.panmental.de/\">get the
Gewijzigd op 28/01/2011 21:32:18 door Vin P
maak van lijn 30 tot en met 32 dit:
Code (php)
1
2
2
$stylesheet= '<link rel="stylesheet" type="text/css" href="'.$SCRIPT_NAME.'?css">';
#ben je zeker dat het niet .css moet zijn idpv ?css
#ben je zeker dat het niet .css moet zijn idpv ?css
Gewijzigd op 28/01/2011 21:25:56 door Jasper DS
dus als ik dat verander moet hij het doen?
En moet ik css veranderen naar php, en de naam veranderen naar de fotoslideshow?
check mijn edit.
Alvast bedankt voor de moeite
doe jij ook even terug een stuk van je code weg, dan moeten we niet zo hard scrollen.
En ik krijg helaas nog steeds dezelfde error over line 8..
wat heb je nu op lijn 30?
--(Wacht even. Hij heeft het over een error op lijn 8. Waarom zit je nu met lijn 30? De fout zit hem in lijn 8 van het "actieve" stuk script ook hea?)-- Dus over deze regel:
Het lijkt mij ook niet helemaal te kloppen.
Moet dit niet dit zijn?
Gewijzigd op 28/01/2011 21:44:42 door Jurrian Nijland
jurrian, we hebben het over dezelfde regel. Het is lijn 30
Zie mijn edit =)
Toevoeging op 28/01/2011 21:45:15:
Volgens mij moet je ook geen witregel tussen die regel 30 & 32.
Code (php)
1
2
3
4
5
2
3
4
5
<?php
$stylesheet= "<link rel=\"stylesheet\" type=\"text/css\" href=\"$SCRIPT_NAME?css\">";
//$stylesheet="<link rel=\"stylesheet\" type=\"text/css\"href=\"/home/phpshow.php\">";
?>
$stylesheet= "<link rel=\"stylesheet\" type=\"text/css\" href=\"$SCRIPT_NAME?css\">";
//$stylesheet="<link rel=\"stylesheet\" type=\"text/css\"href=\"/home/phpshow.php\">";
?>
Gewijzigd op 28/01/2011 21:48:28 door Jurrian Nijland
Toevoeging op 28/01/2011 21:53:15:
Kijk we komen al een stapje dichterbij :)
Ik krijg nu een witte lijn in beeld met de volgende error:
Not Found
The requested URL /photos/phpshow.php?newGD&slides&0 was not found on this server.