Rev 596 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 596 | Rev 728 | ||
|---|---|---|---|
| Line 117... | Line 117... | ||
| 117 | $datetime =~ s/://g; |
117 | $datetime =~ s/://g; |
| 118 | $datetime =~ s/\n//g; |
118 | $datetime =~ s/\n//g; |
| 119 | $datetime =~ s/\r//g; |
119 | $datetime =~ s/\r//g; |
| 120 | $datetime =~ s/ /_/g; |
120 | $datetime =~ s/ /_/g; |
| 121 | $datetime = lc($datetime); |
121 | $datetime = lc($datetime); |
| - | 122 | ||
| - | 123 | if ($currentfile) { |
|
| - | 124 | if ($debugmode == 0) { |
|
| - | 125 | print OUTFILE "\n\\\\\nNext page: [[".$datetime."]] \\\\ \n"; |
|
| - | 126 | print OUTFILE "Back to index: [[".$namespace."]] \\\\ \n"; |
|
| - | 127 | ||
| - | 128 | } |
|
| - | 129 | } |
|
| 122 | 130 | ||
| 123 | $currentfile = $datetime .".txt"; |
131 | $currentfile = $datetime .".txt"; |
| 124 | # skriv $datetimenice och $datetime till $contentspath |
132 | # skriv $datetimenice och $datetime till $contentspath |
| 125 | $fileopenerr = 0; |
133 | $fileopenerr = 0; |
| 126 | open (CONTENTSFILE, "<".$contentspath) or $fileopenerr = 1; |
134 | open (CONTENTSFILE, "<".$contentspath) or $fileopenerr = 1; |
| 127 | if ($fileopenerr == 0) { |
135 | if ($fileopenerr == 0) { |
| 128 | @contentsfilecontents = <CONTENTSFILE>; |
136 | @contentsfilecontents = <CONTENTSFILE>; |
| 129 | close(CONTENTSFILE); |
137 | close(CONTENTSFILE); |
| 130 | if ($debugmode == 0) { |
138 | if ($debugmode == 0) { |
| 131 | open (CONTENTSFILE, ">".$contentspath) or $fileopenerr = 1; |
139 | open (CONTENTSFILE, ">".$contentspath) or $fileopenerr = 1; |
| 132 | if ($fileopenerr == 0) { |
140 | if ($fileopenerr == 0) { |
| 133 | print CONTENTSFILE "[[$namespace$datetime|$datetimenice]] \\\\ \n"; |
141 | print CONTENTSFILE "[[$namespace$datetime|$datetimenice]] \\\\ \n"; |
| 134 | foreach (@contentsfilecontents) { |
142 | foreach (@contentsfilecontents) { |
| 135 | print CONTENTSFILE $_; |
143 | print CONTENTSFILE $_; |
| 136 | } |
144 | } |
| 137 | close(CONTENTSFILE); |
145 | close(CONTENTSFILE); |
| 138 | } |
146 | } |
| 139 | } |
147 | } |
| 140 | } else { |
148 | } else { |
| 141 | exit; |
149 | exit; |
| 142 | } |
150 | } |
| 143 | 151 | ||
| 144 | if ($debugmode == 0) { |
152 | if ($debugmode == 0) { |
| 145 | $fileopenerr = 0; |
153 | $fileopenerr = 0; |
| 146 | open (OUTFILE, ">>".$outputpath.$currentfile) or $fileopenerr = 1; |
154 | open (OUTFILE, ">>".$outputpath.$currentfile) or $fileopenerr = 1; |
| 147 | if ($fileopenerr == 1) { |
155 | if ($fileopenerr == 1) { |
| 148 | print "Could not open ".$outputpath."/".$currentfile; |
156 | print "Could not open ".$outputpath."/".$currentfile; |
| 149 | exit; |
157 | exit; |
| 150 | } |
158 | } |
| 151 | } |
159 | } |
| - | 160 | if ($currentfile) { |
|
| - | 161 | if ($debugmode == 0) { |
|
| - | 162 | print OUTFILE "====== ".$datetimenice." ======\n"; |
|
| - | 163 | } |
|
| 152 | 164 | } |
|
| 153 | #print $datetime; |
165 | #print $datetime; |
| 154 | } |
166 | } |
| 155 | 167 | ||
| 156 |
|
168 | elsif ($currentfile) { |
| 157 | $parsedLine = $line; |
169 | $parsedLine = $line; |
| 158 | $parsedLine =~ s/\n//g; |
170 | $parsedLine =~ s/\n//g; |
| 159 | $parsedLine =~ s/\r//g; |
171 | $parsedLine =~ s/\r//g; |
| 160 | #$parsedLine = $parsedLine; |
172 | #$parsedLine = $parsedLine; |
| 161 | 173 | ||