Ola Amigos,
beim lokalen erstellen eines Projektes bricht der Zeta bei einer bestimmten Site immer ab.
Das Protokoll schreibt (alles in rot):
Fehler (10.5.0.22) - Skript-Fehler:
---------------
Variable ist nicht definiert: 'CreateFolder'
---------------
Zeile 70, Spalte 9.
---------------
Quelltext:
001: option explicit
002:
003: ExecuteScript
004:
(...Versteckte Zeilen...)
012:
013:
014:
015:
016: sub EnsureScriptLibraryIncluded()
017: ' Ensure that the scripting Context.Scope.Library is included.
018: dim sourceFolderAbsolute
019: sourceFolderAbsolute = "$(ZPStationaryFolder)\Scripting\ServerSideScripting"
020:
021: if not Context.Scope.CurrentWebProject.HasFolderAsset( sourceFolderAbsolute ) then
022: dim folderAsset
023: set folderAsset = Context.Scope.CurrentWebProject.CreateFolderAsset
024:
025: folderAsset.SourceFolderPathAbsolute = sourceFolderAbsolute
026: folderAsset.IncludeSubfolders = true
027: folderAsset.DestinationFolderRelative = "/media/Scripting/ServerSideScripting"
028: folderAsset.Store()
029:
030: Context.Scope.Library.Log "Added folder asset for server side scripting Context.Scope.Library."
031: end if
032: end sub
033: sub EnsureFileTypePhp()
034: if Context.Scope.CurrentPage.FileType<>".php" and Context.Scope.CurrentPage.FileType<>".phtml" and Context.Scope.CurrentPage.FileType<>".shtml" then
035: Context.Scope.Library.LogWarning "The file type of the page '" & Context.Scope.CurrentPage.Name & "' is not '.php'. Please adjust the file type of the page to correctly display the article '" & Context.Scope.CurrentArticle.Name & "'. To adjust the file type open the page properties and click the 'Paths and folders' tab."
036:
037: ''''''''''''''''Context.Scope.CurrentPage.FileType = ".php"
038: ''''''''''''''''Context.Scope.CurrentPage.Store
039: end if
040: end sub
041:
042:
043:
044:
045: ' BEGINN - Make shop configuration
046:
047: public PhpConfigFilePath
048: public PhpShopIncFilePath
049:
050: sub CreateShopConfig()
051:
052: dim configFileName
053: configFileName = "config.inc.php"
054:
055: dim configFilePath
056: configFilePath = Context.Scope.Library.CombinePath( _
057: Context.Scope.Library.ExpandDollarMacros("$(WebOutputBaseFolder)"), _
058: "/media/Scripting/ServerSideScripting/PHP/shop" )
059:
060: configFilePath = Context.Scope.Library.CombinePath( configFilePath, configFileName )
061: configFilePath = Replace( configFilePath, "/", "\")
062:
063: dim configFolderPath
064: configFolderPath = Context.Scope.CurrentWebProject.GetPathFromFullFilePath( configFilePath )
065:
066: dim fso
067: set fso = CreateObject("Scripting.FileSystemObject")
068:
069: if not fso.FolderExists( configFolderPath ) then
070: CreateFolder( configFolderPath )
071: end if
072:
073:
074: dim configFileRelativePathV
075: configFileRelativePathV = "/media/Scripting/ServerSideScripting/PHP/shop/" & configFileName
076:
077: dim configFilePathV
078: configFilePathV = Context.Scope.CurrentWebProject.GetRelativePathFromTo( _
079: Context.Scope.CurrentPage.VirtualPath, _
080: "/media/Scripting/ServerSideScripting/PHP/shop/" & configFileName )
081:
082: dim configFileRelativePathFtpV
083: configFileRelativePathFtpV = _
084: Context.Scope.CurrentWebProject.FtpServerFolderName & _
085: Context.Scope.Library.LTrimEx(configFileRelativePathV, "/")
086:
087: dim configFilePathFtpV
088: configFilePathFtpV = Context.Scope.Library.CombinePathV( _
089: Context.Scope.CurrentWebProject.FtpServerFolderName, _
090: configFilePathV )
091:
092: configFilePathFtpV = Context.Scope.Library.LTrimEx(configFilePathFtpV, "/")
093: configFilePathV = "/" & Context.Scope.Library.LTrimEx(configFilePathV, "/")
094:
095:
096: dim file
097: set file = fso.CreateTextFile(configFilePath, true)
098:
099: file.WriteLine("100: file.WriteLine("class Configuration {")
101: file.WriteLine( "public static $conf_shopemail = 'order@fire-wood.de';" )
102: file.WriteLine( "public static $conf_shopname = 'Holz bestellen - ';" )
103:
104: dim shippingCosts
105: shippingCosts = Replace("0",",",".")
106:
107: SetLocale("en-US")
108: shippingCosts = FormatNumber(shippingCosts,,,,0)
109:
110: file.WriteLine( "public static $conf_shippingcosts = " & shippingCosts &";" )
111:
112: file.WriteLine( "public static $conf_currency = 'EUR';" )
113: file.WriteLine( "public static $conf_curr_comma = ',';" )
114: file.WriteLine( "public static $conf_curr_thousands = '.';" )
115: file.WriteLine( "public static $conf_curr_decimals = '2';" )
116:
117: file.WriteLine( "public static $conf_payment_advance = '1';" )
118: file.WriteLine( "public static $conf_payment_bill = '1';" )
119: file.WriteLine( "public static $conf_payment_delivery = '1';" )
120:
121: file.WriteLine( "public static $conf_page_agb = '" & Context.Scope.Library.RemoveInlineEditingPlaceholders("impressum.html#a1000") & "';" )
122:
123: file.WriteLine( "public static $conf_text_ordermailfooter = '" & Context.Scope.CurrentArticle.Values.GetValue("OrderMailFooterText") & "';" )
124: file.WriteLine( "public static $conf_basketurl = '" & Context.Scope.Library.RemoveInlineEditingPlaceholders(Context.Scope.CurrentPage.AbsoluteUrl) & "';" )
125:
126: file.WriteLine("}")
127: file.WriteLine("?>")
128: file.Close
129:
130: set file = nothing
131:
132: ' Add to publishing chain.
133: Context.Scope.CurrentWebProject.NotifyFileCreated( configFilePath )
134:
135: set fso = nothing
136:
137: ' The path for the PHP is somewhat different.
138:
139: PhpConfigFilePath = Context.Scope.Library.LTrimEx(configFilePathV, "/")
140: PhpShopIncFilePath = Context.Scope.CurrentWebProject.GetRelativePathFromTo( _
141: Context.Scope.CurrentPage.VirtualPathRelative, _
142: "media/Scripting/ServerSideScripting/PHP/shop/shop.inc.php")
143:
144: end sub
145: ' END - Make shop configuration
146:
147:
148:
149:
150: public sub ExecuteScript()
151: Context.Write "" & vbCrLf
180: Context.Write "
" & vbCrLf
181: Context.Write ""
182:
183: if Context.Scope.CurrentArticle.Name <> "" then
184:
185: Context.Write "Kaminholz
"
186:
187: end if
188:
189: Context.Write "" & vbCrLf
190: Context.Write "" & vbCrLf
191: Context.Write ""
192:
193:
194: ' This file will contain code for PHP server side scripting.
195:
196:
197: Context.Write "" & vbCrLf
198: Context.Write "" & vbCrLf
199: Context.Write ""
200: Context.Write "" & vbCrLf
201: Context.Write ""
202:
203:
204: 'EnsureScriptLibraryIncluded
205: EnsureFileTypePhp
206:
207:
208: Context.Write "" & vbCrLf
209: Context.Write "" & vbCrLf
210: Context.Write "Bitte beachten Sie, daß dieser Artikel nur online auf Ihrem Webserver korrekt angezeigt wird und die Darstellung in der Vorschau nur eingeschränkt möglich ist.
" & vbCrLf
211: Context.Write "
" & vbCrLf
244: Context.Write "" & vbCrLf
245: Context.Write "" & vbCrLf
246: Context.Write ""
247:
248:
249: ' Special workaround to get out some http headers before content is sent to the client
250: dim text
251:
252: text = """253: text = text & "header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); "
254: text = text & "header('Last-Modified: ' . Gmdate('D, d M Y H:i:s') . ' GMT'); "
255: text = text & "header('Cache-Control: no-store, no-cache, must-revalidate'); "
256: text = text & "header('Cache-Control: post-check=0, pre-check=0', false); "
257: text = text & "header('Pragma: no-cache'); "
258: text = text & "?>"""
259:
260: Context.Scope.AddScriptToRunOnFinishedPage( "<" & "$Context.Write(" & text & " & vbCrLf & Context.Scope.RenderedText )$" & ">" )
261:
262:
263:
264: Context.Write ""
267:
268: end sub
269:.
Sicherlich ein Denkfehler von mir, jedoch komm ich nicht drauf, was mein Fehler sein wird:
Ich danke von Herzen für jede Hilfe
Gruß