{"action":"created","issue":{"url":"https://api.github.com/repos/Novik/ruTorrent/issues/1727","repository_url":"https://api.github.com/repos/Novik/ruTorrent","labels_url":"https://api.github.com/repos/Novik/ruTorrent/issues/1727/labels{/name}","comments_url":"https://api.github.com/repos/Novik/ruTorrent/issues/1727/comments","events_url":"https://api.github.com/repos/Novik/ruTorrent/issues/1727/events","html_url":"https://github.com/Novik/ruTorrent/issues/1727","id":335759104,"node_id":"MDU6SXNzdWUzMzU3NTkxMDQ=","number":1727,"title":"Themes dont arrange alphabetically","user":{"login":"sparky3387","id":1683850,"node_id":"MDQ6VXNlcjE2ODM4NTA=","avatar_url":"https://avatars3.githubusercontent.com/u/1683850?v=4","gravatar_id":"","url":"https://api.github.com/users/sparky3387","html_url":"https://github.com/sparky3387","followers_url":"https://api.github.com/users/sparky3387/followers","following_url":"https://api.github.com/users/sparky3387/following{/other_user}","gists_url":"https://api.github.com/users/sparky3387/gists{/gist_id}","starred_url":"https://api.github.com/users/sparky3387/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sparky3387/subscriptions","organizations_url":"https://api.github.com/users/sparky3387/orgs","repos_url":"https://api.github.com/users/sparky3387/repos","events_url":"https://api.github.com/users/sparky3387/events{/privacy}","received_events_url":"https://api.github.com/users/sparky3387/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-26T10:39:47Z","updated_at":"2018-06-30T06:56:23Z","closed_at":null,"author_association":"NONE","body":"Themes in rutorrent dont arrange correcly, they arrange by filesystem order, not alphanumerically as expected, using natcasesort and scandir resolves the issue\r\n\r\n```\r\n--- init.php.old        2018-06-26 20:22:03.237226394 +1000\r\n+++ init.php    2018-06-26 20:31:04.601007730 +1000\r\n@@ -5,18 +5,17 @@\r\n $jResult.=$theme->get();\r\n\r\n $themes = \"plugin.themes = [\";\r\n-if($hth = opendir('../plugins/theme/themes'))\r\n+if($hth = scandir('../plugins/theme/themes'))\r\n {\r\n-        while(false !== ($file = readdir($hth)))\r\n-        {\r\n-                if($file[0] != \".\" && is_dir('../plugins/theme/themes/'.$file))\r\n-                {\r\n-                        if($themes != \"plugin.themes = [\")\r\n-                                $themes.=',';\r\n-                        $themes.=(\"'\".$file.\"'\");\r\n-                }\r\n-        }\r\n-        closedir($hth);\r\n+       natcasesort($hth);\r\n+       foreach ($hth as $file) {\r\n+               if($file != \"..\" && $file != \".\" && is_dir('../plugins/theme/themes/'.$file))\r\n+               {\r\n+                       if($themes != \"plugin.themes = [\")\r\n+                               $themes.=',';\r\n+                       $themes.=(\"'\".$file.\"'\");\r\n+               }\r\n+       }\r\n }\r\n```"},"comment":{"url":"https://api.github.com/repos/Novik/ruTorrent/issues/comments/401522310","html_url":"https://github.com/Novik/ruTorrent/issues/1727#issuecomment-401522310","issue_url":"https://api.github.com/repos/Novik/ruTorrent/issues/1727","id":401522310,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTUyMjMxMA==","user":{"login":"Micdu70","id":8136676,"node_id":"MDQ6VXNlcjgxMzY2NzY=","avatar_url":"https://avatars0.githubusercontent.com/u/8136676?v=4","gravatar_id":"","url":"https://api.github.com/users/Micdu70","html_url":"https://github.com/Micdu70","followers_url":"https://api.github.com/users/Micdu70/followers","following_url":"https://api.github.com/users/Micdu70/following{/other_user}","gists_url":"https://api.github.com/users/Micdu70/gists{/gist_id}","starred_url":"https://api.github.com/users/Micdu70/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Micdu70/subscriptions","organizations_url":"https://api.github.com/users/Micdu70/orgs","repos_url":"https://api.github.com/users/Micdu70/repos","events_url":"https://api.github.com/users/Micdu70/events{/privacy}","received_events_url":"https://api.github.com/users/Micdu70/received_events","type":"User","site_admin":false},"created_at":"2018-06-30T06:56:23Z","updated_at":"2018-06-30T06:56:23Z","author_association":"CONTRIBUTOR","body":"PR using glob function above"}}
{"actor":{"display_login":"Micdu70"}}