Index: lizardbot.php |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | |_____||_______| |________||_| |_| |_| \__\ |____/ |
58 | 58 | |
59 | 59 | PHP-LizardBot: IRC bot developed by FastLizard4 (who else?) and the LizardBot Development Team |
60 | | -Version 7.1.0.0b (major.minor.build.revision) BETA |
| 60 | +Version 7.1.1.0b (major.minor.build.revision) BETA |
61 | 61 | Licensed under the Creative Commons GNU General Public License 2.0 (GPL) |
62 | 62 | For licensing details, contact me or read this page: |
63 | 63 | http://creativecommons.org/licenses/GPL/2.0/ |
— | — | @@ -92,7 +92,7 @@ |
93 | 93 | <?php |
94 | 94 | //Check for updates |
95 | 95 | echo "{$c_yellow}Checking for updates...\r\n"; |
96 | | -$version = "7.1.0.0b"; |
| 96 | +$version = "7.1.1.0b"; |
97 | 97 | $upfp = @fopen('http://lizardwiki.dyndns.org/w/index.php?title=LizardBot/Latest&action=raw', 'r'); |
98 | 98 | $data = @fgets($upfp); |
99 | 99 | @fclose($upfp); |
— | — | @@ -1317,7 +1317,7 @@ |
1318 | 1318 | if($d[3] == "{$setTrigger}update" && hasPriv('*')) { |
1319 | 1319 | $cmdcount++; |
1320 | 1320 | echo "Checking for updates...\r\n"; |
1321 | | - $version = "7.1.0.0b"; |
| 1321 | + $version = "7.1.1.0b"; |
1322 | 1322 | $upfp = @fopen('http://lizardwiki.dyndns.org/w/index.php?title=LizardBot/Latest&action=raw', 'r'); |
1323 | 1323 | $data = @fgets($upfp); |
1324 | 1324 | @fclose($upfp); |
— | — | @@ -1742,7 +1742,7 @@ |
1743 | 1743 | // CURLOPT_PROTOCOLS => CURLPROTO_HTTP, |
1744 | 1744 | CURLOPT_TIMEOUT => 30 , // 30 seconds is the maximum amount of time we want to wait for this to work |
1745 | 1745 | CURLOPT_RETURNTRANSFER => TRUE , // I would like my data back, kthx |
1746 | | - CURLOPT_USERAGENT => "PHP-LizardBot/7.1.0.0b (compatible; +http://lizardwiki.dyndns.org/wiki/LizardBot)" //Set our useragent |
| 1746 | + CURLOPT_USERAGENT => "PHP-LizardBot/7.1.1.0b (compatible; +http://lizardwiki.dyndns.org/wiki/LizardBot)" //Set our useragent |
1747 | 1747 | )); |
1748 | 1748 | if(!$apiPipeSetoptSuccess) { // Uhoh, it looks like that, for some reason, configuration of the pipe failed. |
1749 | 1749 | $data = "For some reason, curl_setopt_array() configuration failed. Perhaps you're running an obsolete version of PHP-cURL? Or perhaps your version of PHP is outdated?"; |
— | — | @@ -1813,7 +1813,11 @@ |
1814 | 1814 | if($apiPipeOut['data']['clicks'][0]['error']) { |
1815 | 1815 | $data = "The API returned an error for your short URL. Here it is: {$apiPipeOut['data']['clicks'][0]['error']}."; |
1816 | 1816 | } else { |
1817 | | - $data = "For the short URL {$apiPipeOut['data']['clicks'][0]['short_url']}, the number of user clicks (for {$setBitlyLogin}'s URL) is {$apiPipeOut['data']['clicks'][0]['user_clicks']} and the number of global clicks is {$apiPipeOut['data']['clicks'][0]['global_clicks']}."; |
| 1817 | + if($apiPipeOut['data']['clicks'][0]['global_clicks'] == $apiPipeOut['data']['clicks'][0]['user_clicks'] && $apiPipeOut['data']['clicks'][0]['user_clicks'] != 0) { |
| 1818 | + $data = "For the short URL {$apiPipeOut['data']['clicks'][0]['short_url']}, which is an \"aggregate\" or \"global\" bit.ly URL, there have been {$apiPipeOut['data']['clicks'][0]['global_clicks']} clicks."; |
| 1819 | + } else { |
| 1820 | + $data = "For the short URL {$apiPipeOut['data']['clicks'][0]['short_url']}, the number of clicks is {$apiPipeOut['data']['clicks'][0]['user_clicks']} and the number of global clicks on the aggregate (global) bit.ly URL is {$apiPipeOut['data']['clicks'][0]['global_clicks']}."; |
| 1821 | + } |
1818 | 1822 | } |
1819 | 1823 | } |
1820 | 1824 | } |
— | — | @@ -1879,7 +1883,11 @@ |
1880 | 1884 | if($apiPipeOut['data']['info'][0]['error']) { |
1881 | 1885 | $data = "The API returned an error for your short URL. Here it is: {$apiPipeOut['data']['info'][0]['error']}."; |
1882 | 1886 | } else { |
1883 | | - $data = "For the short URL {$apiPipeOut['data']['info'][0]['short_url']}, the page title is: \"{$apiPipeOut['data']['info'][0]['title']}\" and the bit.ly URL was created by the bit.ly user \"{$apiPipeOut['data']['info'][0]['created_by']}\"."; |
| 1887 | + if($apiPipeOut['data']['info'][0]['created_by'] == "bitly") { |
| 1888 | + $data = "For the short URL {$apiPipeOut['data']['info'][0]['short_url']}, the page title is: \"{$apiPipeOut['data']['info'][0]['title']}\". The bit.ly URL is an aggregate URL."; |
| 1889 | + } else { |
| 1890 | + $data = "For the short URL {$apiPipeOut['data']['info'][0]['short_url']}, the page title is: \"{$apiPipeOut['data']['info'][0]['title']}\" and the bit.ly URL was created by the bit.ly user \"{$apiPipeOut['data']['info'][0]['created_by']}\"."; |
| 1891 | + } |
1884 | 1892 | } |
1885 | 1893 | } |
1886 | 1894 | } |
— | — | @@ -2014,7 +2022,12 @@ |
2015 | 2023 | } |
2016 | 2024 | mysqli_free_result($result); |
2017 | 2025 | } |
2018 | | - $data .= "OK, I'll tell them the next time I see them talk in a channel I'm in."; |
| 2026 | + if($setRemindOnJoin) { |
| 2027 | + $orJoin = "or join "; |
| 2028 | + } else { |
| 2029 | + unset($orJoin); |
| 2030 | + } |
| 2031 | + $data .= "OK, I'll tell them the next time I see them talk in {$orJoin}a channel I'm in."; |
2019 | 2032 | } |
2020 | 2033 | unset($result); |
2021 | 2034 | mysqli_close($mysql); |
— | — | @@ -2023,7 +2036,7 @@ |
2024 | 2037 | echo "-!- PRIVMSG $c :" . $e . $data . "\r\n"; |
2025 | 2038 | } |
2026 | 2039 | //Code to allow retrieval of reminders, ignoring PMs to the bot |
2027 | | - if($d[1] == "PRIVMSG" && $d[2] != $nick) { |
| 2040 | + if(($d[1] == "PRIVMSG" || ($d[1] == "JOIN" && $setRemindOnJoin)) && $d[2] != $nick) { |
2028 | 2041 | $success = false; |
2029 | 2042 | $t = explode('!', $d[0]); |
2030 | 2043 | $userNick = $t[0]; |
Index: lizardbot.conf.php |
— | — | @@ -107,6 +107,8 @@ |
108 | 108 | |
109 | 109 | $setEnableReminders: Whether or not to enable the @remind command. Boolean, TRUE by default. REQUIRES MYSQL |
110 | 110 | TO BE ENABLED! |
| 111 | + $setRemindOnJoin: If this boolean variable is set to TRUE, the bot will also deliver reminders to people when |
| 112 | + it sees them join a channel the bot is in, not just when they talk in one. FALSE by default. |
111 | 113 | |
112 | 114 | $setEnableBitly: Set this boolean variable to TRUE if you want to enable support for bit.ly URL shortening and |
113 | 115 | other functions. WARNING: YOU MUST HAVE THE CURL EXTENSION INSTALLED FOR THIS TO WORK! |
— | — | @@ -286,6 +288,7 @@ |
287 | 289 | $setEnableAllTriggerHelp = TRUE; |
288 | 290 | |
289 | 291 | $setEnableReminders = TRUE; |
| 292 | + $setRemindOnJoin = FALSE; |
290 | 293 | |
291 | 294 | $setEnableBitly = FALSE; |
292 | 295 | $setBitlyAPISleep = 30; |