Index: trunk/tools/rotatebot/rotbot.php |
— | — | @@ -62,7 +62,7 @@ |
63 | 63 | $wrongfiles = array(); |
64 | 64 | |
65 | 65 | //Kategorie auf Bilder überprüfen |
66 | | -$katname = "Images_requiring_rotation_by_bot"; |
| 66 | +//$katname = "Images_requiring_rotation_by_bot"; |
67 | 67 | logfile("Prüfe 'Category:$katname' auf Bilder"); |
68 | 68 | |
69 | 69 | $queryurl = "http://commons.wikimedia.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:".$katname."&format=php&cmprop=ids|title|sortkey|timestamp&cmnamespace=6&cmsort=timestamp&cmtype=file&cmlimit=".$config['limit']; |
— | — | @@ -201,20 +201,21 @@ |
202 | 202 | } |
203 | 203 | else |
204 | 204 | { |
205 | | - logfile("API: Error: not a array!"); |
206 | | - logfile($totrevs); |
| 205 | + logfile("API: Error: not a array!"); |
| 206 | + logfile($totrevs); |
207 | 207 | } |
| 208 | + } |
208 | 209 | } |
209 | | -} |
210 | | - |
| 210 | +$wrongfile = false; |
211 | 211 | //Benutzer prüfen! ######################################### |
212 | 212 | if($catcontent[$arraykey]['tmplsetter']) //autoconfirmed |
213 | 213 | { |
214 | 214 | $wgAuthor = $catcontent[$arraykey]['tmplsetter']; |
215 | 215 | logfile("check user ".$wgAuthor."."); |
216 | 216 | |
| 217 | + $cachedbar = array(); |
217 | 218 | //Datenbank abfragen nach status |
218 | | - if(!$cachedbar["$wgAuthor"]) |
| 219 | + if(!isset($cachedbar["$wgAuthor"])) |
219 | 220 | { |
220 | 221 | $mysresult = mysql_query( "SELECT * FROM user WHERE user_name='".mysql_real_escape_string($wgAuthor)."'", $myslink) or suicide("MySQL error"); |
221 | 222 | $a_row = mysql_fetch_row($mysresult); |
— | — | @@ -675,8 +676,8 @@ |
676 | 677 | } |
677 | 678 | logfile("Upload finished. Do error pictures now."); |
678 | 679 | |
| 680 | +mkdir( $homedir . "cache" ); |
679 | 681 | |
680 | | - |
681 | 682 | //Cache leeren |
682 | 683 | foreach($catcontent2 as $filename => $arraycontent) |
683 | 684 | { |
Index: trunk/tools/rotatebot/settings.php |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | $homedir = "/home/luxo/rotbot/"; |
5 | | -$cookies = "/home/lux/cks"; |
| 5 | +//$cookies = "/home/lux/cks"; |
6 | 6 | $exiftool = "/home/luxor/rotbot/exiftool/exiftool"; |
7 | 7 | $useragent = "Luxo (Toolserver; php) luxo@ts.wikimedia.org"; // ' User:Rotatebot by Luxo on the Toolserver / PHP' |
8 | 8 | |
— | — | @@ -13,3 +13,7 @@ |
14 | 14 | |
15 | 15 | $username = ""; // Bot username |
16 | 16 | $password = ""; // Bot password |
| 17 | + |
| 18 | +$katname = ""; |
| 19 | +$cookies = array(); |
| 20 | + |
Index: trunk/tools/rotatebot/login.php |
— | — | @@ -138,7 +138,8 @@ |
139 | 139 | } |
140 | 140 | logfile("Seite geladen, Anmeldung prüfen."); |
141 | 141 | |
142 | | - if(strstr($bodyy,'"wgUserName": "' . $username . '",')) |
| 142 | + $noUnderscore = str_replace( '_', ' ', $username ); |
| 143 | + if(strstr($bodyy,'"wgUserName": "' . $noUnderscore . '",')) |
143 | 144 | { |
144 | 145 | logfile("Anmeldung erfolgreich!"); |
145 | 146 | |