Changeset 63

Show
Ignore:
Timestamp:
04/06/08 14:41:49 (2 years ago)
Author:
weppos
Message:

* Reverted changes to skin file in r62

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/myasg/settings_skin.asp

    r62 r63  
    5959Dim strAsgInput 
    6060 
    61 public function preg_match_all(pattern, text, ByRef matches) 
    62      
    63     dim objRegexp, objMatches, aryResults() 
    64     dim ii 
    65      
    66     ' new regular expression 
    67     set objRegexp = new RegExp 
    68     with objRegexp 
    69         .Pattern = pattern 
    70         .IgnoreCase = true 
    71         .Global = true 
    72     end with 
    73      
    74     ' all matches 
    75     set objMatches  = objRegexp.Execute(text) 
    76     if objMatches.Count > 0 then 
    77         ii = 0 
    78         for each item in objMatches 
    79             redim preserve aryResults(ii + 1)  
    80             Set aryResults(ii) = item.SubMatches 
    81             ii = ii + 1 
    82             Response.Write(item.value & "<br />") 
    83         next 
    84         preg_match_all = true  
    85     else 
    86         preg_match_all = false  
    87     end if 
    88      
    89     set objRegexp = nothing 
    90     set objMatches = nothing 
    91     set objRegexp = nothing 
    92      
    93     matches = aryResults 
    94      
    95 end function 
    96  
    97  
    98 public function file_get_contents(path) 
    99      
    100     dim objFso, objText 
    101     dim strContent 
    102      
    103     Set objFso = Server.CreateObject("Scripting.FileSystemObject") 
    104      
    105     if objFso.FileExists(path) then 
    106         set objText = objFso.OpenTextFile(path, 1, false, -2) 
    107         strContent = objText.ReadAll 
    108         objText.Close 
    109         set objText = nothing 
    110     else 
    111         ' error 
    112         strContent = false 
    113     end if 
    114  
    115     set objFso = nothing 
    116     file_get_contents = strContent 
    117  
    118 end function 
    11961 
    12062 
     
    205147                <% 
    206148                 
    207                 'Dim matches, test, ii 
    208                 '' Const[ ]+([\d\w_]*)[ ]*=[ ]*"(.*?)".*'(.*) 
    209                 'test = preg_match_all("Const[ ]+([\d\w_]*)[ ]*=[ ]*""(.*?)"".*'(.*)", file_get_contents(pathFrom), matches) 
    210                 'Response.Write ubound(matches) 
    211                 'for ii = 0 to ubound(matches) - 1 
    212                 '    Response.Write(matches(ii)) 
    213                 'next 
    214                 'Response.End() 
    215                 ' 
    216149                Set ts = objFso.OpenTextFile(pathFrom, 1) 
    217150