Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
92643bad03 | |||
be34272e1b | |||
e6265ba296 | |||
8bf25230f2 | |||
0fa1279764 | |||
cd0e2ec19c |
17
CHANGELOG
Normal file
17
CHANGELOG
Normal file
@ -0,0 +1,17 @@
|
||||
Version 1.4 - Apr. 10, 2015
|
||||
Various changes and additions
|
||||
|
||||
Version 1.3 - Apr. 4, 2015
|
||||
Bugfixes on logout and kicking
|
||||
|
||||
Version 1.2 - Apr. 2, 2015
|
||||
Include letters when generating captchas not only numbers
|
||||
Moved rules to database to make changes more easily in the setup
|
||||
|
||||
Version 1.1 - Apr. 2, 2015
|
||||
Some simplifications
|
||||
Added ignore feature
|
||||
|
||||
Version 1.0 - Mar. 31, 2015
|
||||
Initial release
|
||||
|
16
README
16
README
@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
GENERAL INFORMATION:
|
||||
|
||||
This is a PHP Chat based on LE CHAT v.1.14 . An up-to-date copy of this script can be downloaded at http://github.com/DanWin/le-chat-php
|
||||
This is a PHP Chat based on LE CHAT v.1.14 . An up-to-date copy of this script can be downloaded at https://github.com/DanWin/le-chat-php
|
||||
The original perl LE CHAT script by Lucky Eddie can be downloaded at http://4fvfamdpoulu2nms.onion/lechat/ or via a tor2web proxy like https://4fvfamdpoulu2nms.tor2web.blutmagie.de/lechat/ if you don't have TOR installed.
|
||||
If you add your own cool features or have a feature request, please tell me and I will add them, if I like them.
|
||||
Please also let me know about any bugs you find in the code, so I can fix them.
|
||||
@ -60,6 +60,7 @@ Then copy the script to your web-server directory and call the script in your br
|
||||
http://(server)/(script-name).php?action=setup
|
||||
Now you can create the Superadmin account. With this account you can administer the chat and add new members and set the guest access.
|
||||
As soon as you are done with the setup, all necessary database tables will be created and the chat can be used.
|
||||
Note: If you updated the script, please visit http://(server)/(script-name).php?action=setup again, to make sure, that any database changes are applied and no errors occure.
|
||||
|
||||
TRANSLATING:
|
||||
|
||||
@ -71,6 +72,19 @@ When you are done, you have to edit the chat script, to include your translation
|
||||
to the $L array in the load_lang() function at the bottom, similar to what I did for the German translation.
|
||||
Please share your translation with me, so I can add it to the official version.
|
||||
|
||||
REGEX:
|
||||
|
||||
Yes, the chat supports regular expression filtering of messages. As regex tends to be difficult for most people, I decided to give it an extra section here.
|
||||
Regex is very powerful and can be used to filter messages that contain certain expressions and replace them with something else.
|
||||
It can be used e.g. to turn BB Code into html, so it is possible to use BB Code in the chat to format messages.
|
||||
To do this, use this Regex-Match '\[(u|b)\](.*?)\[\/\1\]' and this Regex-Replace '<$1>$2</$1>' and your text will be '[b]bold[/b]' or '[u]underlined[/u]'.
|
||||
You can also use smilies by using this Regex-Match '(?-i::(cry|eek|lol|sad|smile|surprised|wink):)' and this Regex-Replace '<img src="/pictures/$1.gif" alt=":$1:">'
|
||||
And now if you enter ':smile:' an image with the smiley will be loaded from your server at '/pictures/smile.gif'.
|
||||
The following should be escaped by putting '\' in front of it, if you are trying to match one of these characters '/ \ ^ . $ | ( ) [ ] * + ? { } ,'.
|
||||
I used '/' as delimiter, so you will have to escape that, too. The only options I used is 'i' to make the regex case insensitive.
|
||||
If you want to test your regex, before applying you can use this site and enter your Regex and Replacement there and click on preg_replace: http://www.phpliveregex.com/
|
||||
If you never used regex before, check out this starting guide to begin with regular expressions: http://docs.activestate.com/komodo/4.4/regex-intro.html
|
||||
|
||||
LIVE DEMO:
|
||||
|
||||
If you want to see the script in action, you can visit my TOR hidden site http://tt3j2x4k5ycaa5zt.onion/chat.php or via a tor2web proxy like http://tt3j2x4k5ycaa5zt.tor2web.blutmagie.de/chat.php if you don't have TOR installed.
|
||||
|
17
README.md
17
README.md
@ -1,7 +1,7 @@
|
||||
General Information:
|
||||
--------------------
|
||||
|
||||
This is a PHP Chat based on LE CHAT v.1.14 . An up-to-date copy of this script can be downloaded at http://github.com/DanWin/le-chat-php
|
||||
This is a PHP Chat based on LE CHAT v.1.14 . An up-to-date copy of this script can be downloaded at https://github.com/DanWin/le-chat-php
|
||||
The original perl LE CHAT script by Lucky Eddie can be downloaded at [his site](http://4fvfamdpoulu2nms.onion/lechat/) or via a tor2web proxy like [this one](https://4fvfamdpoulu2nms.tor2web.blutmagie.de/lechat/) if you don't have TOR installed.
|
||||
If you add your own cool features or have a feature request, please tell me and I will add them, if I like them.
|
||||
Please also let me know about any bugs you find in the code, so I can fix them.
|
||||
@ -45,6 +45,7 @@ Then copy the script to your web-server directory and call the script in your br
|
||||
http://(server)/(script-name).php?action=setup
|
||||
Now you can create the Superadmin account. With this account you can administer the chat and add new members and set the guest access.
|
||||
As soon as you are done with the setup, all necessary database tables will be created and the chat can be used.
|
||||
Note: If you updated the script, please visit http://(server)/(script-name).php?action=setup again, to make sure, that any database changes are applied and no errors occure.
|
||||
|
||||
Translating:
|
||||
------------
|
||||
@ -57,6 +58,20 @@ When you are done, you have to edit the chat script, to include your translation
|
||||
to the $L array in the load_lang() function at the bottom, similar to what I did for the German translation.
|
||||
Please share your translation with me, so I can add it to the official version.
|
||||
|
||||
Regex:
|
||||
------
|
||||
|
||||
Yes, the chat supports regular expression filtering of messages. As regex tends to be difficult for most people, I decided to give it an extra section here.
|
||||
Regex is very powerful and can be used to filter messages that contain certain expressions and replace them with something else.
|
||||
It can be used e.g. to turn BB Code into html, so it is possible to use BB Code in the chat to format messages.
|
||||
To do this, use this Regex-Match '\[(u|b)\](.*?)\[\/\1\]' and this Regex-Replace '<$1>$2</$1>' and your text will be '[b]bold[/b]' or '[u]underlined[/u]'.
|
||||
You can also use smilies by using this Regex-Match '(?-i::(cry|eek|lol|sad|smile|surprised|wink):)' and this Regex-Replace '<img src="/pictures/$1.gif" alt=":$1:">'
|
||||
And now if you enter ':smile:' an image with the smiley will be loaded from your server at '/pictures/smile.gif'.
|
||||
The following should be escaped by putting '\' in front of it, if you are trying to match one of these characters '/ \ ^ . $ | ( ) [ ] * + ? { } ,'.
|
||||
I used '/' as delimiter, so you will have to escape that, too. The only options I used is 'i' to make the regex case insensitive.
|
||||
If you want to test your regex, before applying you can use [this site](http://www.phpliveregex.com/) and enter your Regex and Replacement there and click on preg_replace.
|
||||
If you never used regex before, check out [this starting guide](http://docs.activestate.com/komodo/4.4/regex-intro.html) to begin with regular expressions.
|
||||
|
||||
Live demo:
|
||||
----------
|
||||
|
||||
|
369
chat.php
369
chat.php
@ -55,9 +55,9 @@ if(!isSet($_REQUEST['action'])){
|
||||
}elseif($_REQUEST['action']=='post'){
|
||||
check_session();
|
||||
if(isSet($_REQUEST['kick']) && isSet($_REQUEST['sendto']) && valid_nick($_REQUEST['sendto'])){
|
||||
if($U['status']>=5 || ($countmods==0 && $U['status']>=3)){
|
||||
kick_chatter(array($_REQUEST['sendto']), $_REQUEST['message']);
|
||||
if(isSet($_REQUEST['what']) && $_REQUEST['what']=='purge') del_all_messages($_REQUEST['sendto']);
|
||||
if($U['status']>=5 || ($C['memkick'] && $countmods==0 && $U['status']>=3)){
|
||||
if(isSet($_REQUEST['what']) && $_REQUEST['what']=='purge') kick_chatter(array($_REQUEST['sendto']), $_REQUEST['message'], true);
|
||||
else kick_chatter(array($_REQUEST['sendto']), $_REQUEST['message'], false);
|
||||
}
|
||||
}elseif(isSet($_REQUEST['message']) && isSet($_REQUEST['sendto']) && !preg_match('/^\s*$/',$_REQUEST['message'])){
|
||||
validate_input();
|
||||
@ -108,12 +108,8 @@ if(!isSet($_REQUEST['action'])){
|
||||
send_admin();
|
||||
}elseif($_REQUEST['do']=='kick'){
|
||||
if(!isSet($_REQUEST['name'])) send_admin();
|
||||
kick_chatter($_REQUEST['name'], $_REQUEST['kickmessage']);
|
||||
if(isSet($_REQUEST['what']) && $_REQUEST['what']=='purge'){
|
||||
foreach($_REQUEST['name'] as $name){
|
||||
del_all_messages($name);
|
||||
}
|
||||
}
|
||||
if(isSet($_REQUEST['what']) && $_REQUEST['what']=='purge') kick_chatter($_REQUEST['name'], $_REQUEST['kickmessage'], true);
|
||||
else kick_chatter($_REQUEST['name'], $_REQUEST['kickmessage'], false);
|
||||
send_admin();
|
||||
}elseif($_REQUEST['do']=='logout'){
|
||||
if(!isSet($_REQUEST['name'])) send_admin();
|
||||
@ -146,23 +142,27 @@ if(!isSet($_REQUEST['action'])){
|
||||
}
|
||||
send_admin();
|
||||
}elseif($_REQUEST['action']=='setup'){
|
||||
$tables=array('captcha', 'filter', 'members', 'messages', 'notes', 'sessions', 'settings');
|
||||
$tables=array('captcha', 'filter', 'ignored', 'members', 'messages', 'notes', 'sessions', 'settings');
|
||||
$num_tables=0;
|
||||
$result=mysqli_query($mysqli, 'SHOW TABLES');
|
||||
while($tmp=mysqli_fetch_array($result, MYSQLI_NUM)){
|
||||
if(in_array($tmp[0],$tables)) $num_tables++;
|
||||
}
|
||||
if($num_tables<7) send_init();
|
||||
update_db();
|
||||
if(!valid_admin()) send_alogin();
|
||||
if(!isSet($_REQUEST['do'])){
|
||||
}elseif($_REQUEST['do']=='guestaccess'){
|
||||
if(isSet($_REQUEST['set']) && preg_match('/^[0123]$/', $_REQUEST['set'])){
|
||||
update_setting('guestaccess', $_REQUEST['set']);
|
||||
}
|
||||
}elseif($_REQUEST['do']=='dbupdate'){
|
||||
update_db();
|
||||
}elseif($_REQUEST['do']=='messages'){
|
||||
update_messages();
|
||||
}elseif($_REQUEST['do']=='rules'){
|
||||
$_REQUEST['rulestxt']=preg_replace("/\r\n/", '<br>', $_REQUEST['rulestxt']);
|
||||
$_REQUEST['rulestxt']=preg_replace("/\n/", '<br>', $_REQUEST['rulestxt']);
|
||||
$_REQUEST['rulestxt']=preg_replace("/\r/", '<br>', $_REQUEST['rulestxt']);
|
||||
update_setting('rulestxt', $_REQUEST['rulestxt']);
|
||||
}
|
||||
send_setup();
|
||||
}elseif($_REQUEST['action']=='init'){
|
||||
@ -244,17 +244,31 @@ function send_redirect(){
|
||||
}
|
||||
}
|
||||
|
||||
function send_captcha($code){
|
||||
global $C;
|
||||
function send_captcha(){
|
||||
global $C, $I, $mysqli;
|
||||
$length=strlen($C['captchachars']);
|
||||
$code='';
|
||||
for($i=0;$i<5;$i++) {
|
||||
$code .= $C['captchachars'][rand(0, $length-1)];
|
||||
}
|
||||
$randid=rand(0, 99999999);
|
||||
$enc=base64_encode(openssl_encrypt("$code, $randid", 'aes-128-cbc', $C['captchapass'], 0, '1234567890123456'));
|
||||
$stmt=mysqli_prepare($mysqli, 'INSERT INTO `captcha` (`id`, `time`) VALUES (?, \''.time().'\')');
|
||||
mysqli_stmt_bind_param($stmt, 'd', $randid);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
$im=imagecreatetruecolor(55, 24);
|
||||
$bg=imagecolorallocate($im, 0, 0, 0);
|
||||
$fg=imagecolorallocate($im, 255, 255, 255);
|
||||
imagefill($im, 0, 0, $bg);
|
||||
imagestring($im, 5, 5, 5, $code, $fg);
|
||||
echo "<tr><td align=\"left\">$I[copy]";
|
||||
echo '<img width="55" height="24" src="data:image/gif;base64,';
|
||||
ob_start();
|
||||
imagegif($im);
|
||||
imagedestroy($im);
|
||||
return '<img width="55" height="24" src="data:image/gif;base64,'.base64_encode(ob_get_clean()).'">';
|
||||
echo base64_encode(ob_get_clean()).'">';
|
||||
echo '</td><td align="right">'.hidden('challenge', $enc).'<input type="text" name="captcha" size="15" autocomplete="off"></td></tr>';
|
||||
}
|
||||
|
||||
function send_setup(){
|
||||
@ -264,26 +278,22 @@ function send_setup(){
|
||||
echo "<center><h2>$I[setup]</h2><table cellspacing=\"0\">";
|
||||
thr();
|
||||
echo "<tr><td><table cellspacing=\"0\" width=\"100%\"><tr><td align=\"left\"><b>$I[guestacc]</b></td><td align=\"right\">";
|
||||
echo "<$H[form]>".hidden('action', 'setup').hidden('do', 'guestaccess').hidden('nick', $_REQUEST['nick']).hidden('pass', $_REQUEST['pass'])."<table cellspacing=\"0\">";
|
||||
echo "<tr><td align=\"left\"> <input type=\"radio\" name=\"set\" id=\"set1\" value=\"1\"";
|
||||
if($ga==1) echo " checked";
|
||||
echo "<$H[form]>".hidden('action', 'setup').hidden('do', 'guestaccess').hidden('nick', $_REQUEST['nick']).hidden('pass', $_REQUEST['pass']).'<table cellspacing="0">';
|
||||
echo '<tr><td align="left"> <input type="radio" name="set" id="set1" value="1"';
|
||||
if($ga==1) echo ' checked';
|
||||
echo "><label for=\"set1\"> $I[guestallow]</label></td><td> </td><tr>";
|
||||
echo "<tr><td align=\"left\"> <input type=\"radio\" name=\"set\" id=\"set2\" value=\"2\"";
|
||||
if($ga==2) echo " checked";
|
||||
echo '<tr><td align="left"> <input type="radio" name="set" id="set2" value="2"';
|
||||
if($ga==2) echo ' checked';
|
||||
echo "><label for=\"set2\"> $I[guestwait]</label></td><td> </td><tr>";
|
||||
echo "<tr><td align=\"left\"> <input type=\"radio\" name=\"set\" id=\"set3\" value=\"3\"";
|
||||
if($ga==3) echo " checked";
|
||||
echo '<tr><td align="left"> <input type="radio" name="set" id="set3" value="3"';
|
||||
if($ga==3) echo ' checked';
|
||||
echo "><label for=\"set3\"> $I[adminallow]</label></td><td> </td><tr>";
|
||||
echo "<tr><td align=\"left\"> <input type=\"radio\" name=\"set\" id=\"set0\" value=\"0\"";
|
||||
if($ga==0) echo " checked";
|
||||
echo "><label for=\"set0\"> $I[guestdisallow]</label></td><td> </td></tr><tr><td> </td><td align=\"right\">".submit($I['change'])."</td></tr></table></form></td></tr></table></td></tr>";
|
||||
thr();
|
||||
echo "<tr><td><table cellspacing=\"0\" width=\"100%\"><tr><td align=\"left\"><b>$I[dbupdate]</b></td><td align=\"right\">";
|
||||
echo "<$H[form]>".hidden('action', 'setup').hidden('do', 'dbupdate').hidden('nick', $_REQUEST['nick']).hidden('pass', $_REQUEST['pass'])."<table cellspacing=\"0\">";
|
||||
echo '<tr><td> </td><td>'.submit($I['update']).'</td></tr></table></form></td></tr></table></td></tr>';
|
||||
echo '<tr><td align="left"> <input type="radio" name="set" id="set0" value="0"';
|
||||
if($ga==0) echo ' checked';
|
||||
echo "><label for=\"set0\"> $I[guestdisallow]</label></td><td> </td></tr><tr><td> </td><td align=\"right\">".submit($I['change']).'</td></tr></table></form></td></tr></table></td></tr>';
|
||||
thr();
|
||||
echo "<tr><td><table cellspacing=\"0\" width=\"100%\"><tr><td align=\"left\"><b>$I[sysmessages]</b></td><td align=\"right\">";
|
||||
echo "<$H[form]>".hidden('action', 'setup').hidden('do', 'messages').hidden('nick', $_REQUEST['nick']).hidden('pass', $_REQUEST['pass'])."<table cellspacing=\"0\">";
|
||||
echo "<$H[form]>".hidden('action', 'setup').hidden('do', 'messages').hidden('nick', $_REQUEST['nick']).hidden('pass', $_REQUEST['pass']).'<table cellspacing="0">';
|
||||
echo "<tr><td> $I[msgenter]</td><td> <input type=\"text\" name=\"msgenter\" value=\"".get_setting('msgenter').'"></td></tr>';
|
||||
echo "<tr><td> $I[msgexit]</td><td> <input type=\"text\" name=\"msgexit\" value=\"".get_setting('msgexit').'"></td></tr>';
|
||||
echo "<tr><td> $I[msgmemreg]</td><td> <input type=\"text\" name=\"msgmemreg\" value=\"".get_setting('msgmemreg').'"></td></tr>';
|
||||
@ -294,6 +304,11 @@ function send_setup(){
|
||||
echo "<tr><td> $I[msgclean]</td><td> <input type=\"text\" name=\"msgclean\" value=\"".get_setting('msgclean').'"></td></tr>';
|
||||
echo '<tr><td> </td><td align="right">'.submit($I['apply']).'</td></tr></table></form></td></tr></table></td></tr>';
|
||||
thr();
|
||||
echo "<tr><td><table cellspacing=\"0\" width=\"100%\"><tr><td align=\"left\"><b>$I[rules]</b></td><td align=\"right\">";
|
||||
echo "<$H[form]>".hidden('action', 'setup').hidden('do', 'rules').hidden('nick', $_REQUEST['nick']).hidden('pass', $_REQUEST['pass']).'<table cellspacing="0">';
|
||||
echo '<tr><td colspan=2><textarea name="rulestxt" rows="4" cols="60">'.htmlspecialchars(get_setting('rulestxt')).'</textarea></td></tr>';
|
||||
echo '<tr><td> </td><td align="right">'.submit($I['apply']).'</td></tr></table></form></td></tr></table></td></tr>';
|
||||
thr();
|
||||
echo "</table><$H[form]>".hidden('action', 'setup').submit($I['logout']).'</form>';
|
||||
print_credits();
|
||||
print_end();
|
||||
@ -313,12 +328,21 @@ function send_init(){
|
||||
print_end();
|
||||
}
|
||||
|
||||
function send_alogin(){
|
||||
function send_update(){
|
||||
global $H, $I;
|
||||
print_start();
|
||||
echo "<center><h2>$I[dbupdate]</h2><br><$H[form]>".hidden('action', 'setup').submit($I['initgosetup']).'</form><br>';
|
||||
print_credits();
|
||||
print_end();
|
||||
}
|
||||
|
||||
function send_alogin(){
|
||||
global $H, $I, $C;
|
||||
print_start();
|
||||
echo "<center><$H[form]>".hidden('action', 'setup').'<table>';
|
||||
echo "<tr><td align=\"left\">$I[nick]</td><td><input type=\"text\" name=\"nick\" size=\"15\"></td></tr>";
|
||||
echo "<tr><td align=\"left\">$I[pass]</td><td><input type=\"password\" name=\"pass\" size=\"15\"></td></tr>";
|
||||
if($C['enablecaptcha']) send_captcha();
|
||||
echo "<tr><td colspan=\"2\" align=\"right\">".submit($I['login']).'</td></tr></table></form>';
|
||||
print_credits();
|
||||
print_end();
|
||||
@ -495,8 +519,8 @@ function send_filter($arg=''){
|
||||
if($filter['regex']==0) $filter['match']=preg_replace('/(\\\\(.))/', "$2", $filter['match']);
|
||||
echo '<tr><td>'.frmadm('filter').hidden('id', $filter['id']);
|
||||
echo "<table cellspacing=\"0\" width=\"100%\"><tr><td style=\"width:8em\"><b>$I[filter] $filter[id]:</b></td>";
|
||||
echo "<td style=\"width:12em\"><input type=\"text\" name=\"match\" value=\"".htmlspecialchars($filter['match'])."\" size=\"20\" style=\"background-color:#$U[bgcolour];$U[style]\"></td>";
|
||||
echo "<td style=\"width:12em\"><input type=\"text\" name=\"replace\" value=\"".htmlspecialchars($filter['replace'])."\" size=\"20\" style=\"background-color:#$U[bgcolour];$U[style]\"></td>";
|
||||
echo "<td style=\"width:12em\"><input type=\"text\" name=\"match\" value=\"".htmlspecialchars($filter['match'])."\" size=\"20\" style=\"$U[style]\"></td>";
|
||||
echo "<td style=\"width:12em\"><input type=\"text\" name=\"replace\" value=\"".htmlspecialchars($filter['replace'])."\" size=\"20\" style=\"$U[style]\"></td>";
|
||||
echo "<td style=\"width:9em\"><input type=\"checkbox\" name=\"allowinpm\" id=\"allowinpm-$filter[id]\" value=\"1\"$check><label for=\"allowinpm-$filter[id]\">$I[allowpm]</label></td>";
|
||||
echo "<td style=\"width:5em\"><input type=\"checkbox\" name=\"regex\" id=\"regex-$filter[id]\" value=\"1\"$checked><label for=\"regex-$filter[id]\">$I[regex]</label></td>";
|
||||
echo "<td style=\"width:5em\"><input type=\"checkbox\" name=\"kick\" id=\"kick-$filter[id]\" value=\"1\"$checkedk><label for=\"kick-$filter[id]\">$I[kick]</label></td>";
|
||||
@ -505,8 +529,8 @@ function send_filter($arg=''){
|
||||
}
|
||||
echo '<tr><td>'.frmadm('filter').hidden('id', '+');
|
||||
echo "<table cellspacing=\"0\" width=\"100%\"><tr><td align=\"left\" style=\"width:8em\"><b>$I[newfilter]</b></td>";
|
||||
echo "<td style=\"width:12em\"><input type=\"text\" name=\"match\" value=\"\" size=\"20\" style=\"background-color:#$U[bgcolour];$U[style]\"></td>";
|
||||
echo "<td style=\"width:12em\"><input type=\"text\" name=\"replace\" value=\"\" size=\"20\" style=\"background-color:#$U[bgcolour];$U[style]\"></td>";
|
||||
echo "<td style=\"width:12em\"><input type=\"text\" name=\"match\" value=\"\" size=\"20\" style=\"$U[style]\"></td>";
|
||||
echo "<td style=\"width:12em\"><input type=\"text\" name=\"replace\" value=\"\" size=\"20\" style=\"$U[style]\"></td>";
|
||||
echo "<td style=\"width:9em\"><input type=\"checkbox\" name=\"allowinpm\" id=\"allowinpm\" value=\"1\"><label for=\"allowinpm\">$I[allowpm]</label></td>";
|
||||
echo "<td style=\"width:5em\"><input type=\"checkbox\" name=\"regex\" id=\"regex\" value=\"1\"><label for=\"regex\">$I[regex]</label></td>";
|
||||
echo "<td style=\"width:5em\"><input type=\"checkbox\" name=\"kick\" id=\"kick\" value=\"1\"><label for=\"kick\">$I[kick]</label></td>";
|
||||
@ -592,7 +616,7 @@ function send_approve_waiting(){
|
||||
}else{
|
||||
echo "$I[waitempty]<br><br>";
|
||||
}
|
||||
print "$H[backtochat]</center>";
|
||||
echo "$H[backtochat]</center>";
|
||||
print_end();
|
||||
}
|
||||
|
||||
@ -644,7 +668,7 @@ function send_waiting_room(){
|
||||
echo "</head>$H[begin_body]<center><h2>$I[waitingroom]</h2><p>".sprintf($I['admwaittext'], $U['displayname']).'</p><br><p>'.sprintf($I['waitreload'], $C['defaultrefresh']).'</p><br><br>';
|
||||
}
|
||||
echo "<hr><form action=\"$_SERVER[SCRIPT_NAME]\" method=\"post\">".hidden('action', 'wait').hidden('session', $U['session']).submit($I['reload']).'</form><br>';
|
||||
echo "<h2>$I[rules]</h2><b>$C[rulestxt]</b></center>";
|
||||
echo "<h2>$I[rules]</h2><b>".get_setting('rulestxt').'</b></center>';
|
||||
print_end();
|
||||
}
|
||||
}
|
||||
@ -659,18 +683,18 @@ function send_choose_messages(){
|
||||
}
|
||||
|
||||
function send_post(){
|
||||
global $U, $C, $P, $I, $countmods;
|
||||
global $U, $C, $P, $I, $countmods, $mysqli;
|
||||
$U['postid']=substr(time(), -6);
|
||||
print_start();
|
||||
echo "<center><table cellspacing=\"0\"><tr><td align=\"center\">".frmpst('post').hidden('postid', $U['postid']).@hidden('multi', $_REQUEST['multi']);
|
||||
echo "<table cellspacing=\"0\"><tr><td valign=\"top\">$U[displayname]</td><td valign=\"top\">:</td>";
|
||||
if(!isSet($U['rejected'])) $U['rejected']='';
|
||||
if(isSet($_REQUEST['multi']) && $_REQUEST['multi']=="on"){
|
||||
echo "<td valign=\"top\"><textarea name=\"message\" wrap=\"virtual\" rows=\"$U[boxheight]\" cols=\"$U[boxwidth]\" style=\"background-color:#$U[bgcolour];$U[style]\">$U[rejected]</textarea></td>";
|
||||
echo "<td valign=\"top\"><textarea name=\"message\" wrap=\"virtual\" rows=\"$U[boxheight]\" cols=\"$U[boxwidth]\" style=\"$U[style]\">$U[rejected]</textarea></td>";
|
||||
}else{
|
||||
echo "<td valign=\"top\"><input type=\"text\" name=\"message\" value=\"$U[rejected]\" size=\"$U[boxwidth]\" maxlength=\"$C[maxmessage]\" style=\"background-color:#$U[bgcolour];$U[style]\"></td>";
|
||||
echo "<td valign=\"top\"><input type=\"text\" name=\"message\" value=\"$U[rejected]\" size=\"$U[boxwidth]\" maxlength=\"$C[maxmessage]\" style=\"$U[style]\"></td>";
|
||||
}
|
||||
echo '<td valign="top">'.submit($I['talkto'])."</td><td valign=\"top\"><select name=\"sendto\" size=\"1\" style=\"background-color:#$C[colbg];color:#$C[coltxt]\">";
|
||||
echo '<td valign="top">'.submit($I['talkto'])."</td><td valign=\"top\"><select name=\"sendto\" size=\"1\">";
|
||||
echo '<option '; if(isSet($_REQUEST['sendto']) && $_REQUEST['sendto']=='*') echo 'selected '; echo "value=\"*\">-$I[toall]-</option>";
|
||||
if($U['status']>=3){
|
||||
echo '<option ';
|
||||
@ -687,16 +711,25 @@ function send_post(){
|
||||
if(isSet($_REQUEST['sendto']) && $_REQUEST['sendto']=='&') echo 'selected ';
|
||||
echo "value=\"&\">-$I[toadmin]-</option>";
|
||||
}
|
||||
$ignored=array();
|
||||
$stmt=mysqli_prepare($mysqli, '(SELECT `by` FROM `ignored` WHERE `ignored`=? OR `by`=?) UNION (SELECT `ignored` FROM `ignored` WHERE `ignored`=? OR `by`=?)');
|
||||
mysqli_stmt_bind_param($stmt, 'ssss', $U['nickname'], $U['nickname'], $U['nickname'], $U['nickname']);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_bind_result($stmt, $ign);
|
||||
while(mysqli_stmt_fetch($stmt)){
|
||||
$ignored[]=$ign;
|
||||
}
|
||||
mysqli_stmt_close($stmt);
|
||||
array_multisort(array_map('strtolower', array_keys($P)), SORT_ASC, SORT_STRING, $P);
|
||||
foreach($P as $user){
|
||||
if($U['nickname']!==$user[0]){
|
||||
if($U['nickname']!==$user[0] && !in_array($user[0], $ignored)){
|
||||
echo '<option ';
|
||||
if(isSet($_REQUEST['sendto']) && $_REQUEST['sendto']==$user[0]) echo 'selected ';
|
||||
echo "value=\"$user[0]\" style=\"$user[2]\">$user[0]</option>";
|
||||
}
|
||||
}
|
||||
echo '</select>';
|
||||
if($U['status']>=5 || ($countmods==0 && $U['status']>=3)){
|
||||
if($U['status']>=5 || ($C['memkick'] && $countmods==0 && $U['status']>=3)){
|
||||
echo "<input type=\"checkbox\" name=\"kick\" id=\"kick\" value=\"kick\"><label for=\"kick\"> $I[kick]</label>";
|
||||
echo "<input type=\"checkbox\" name=\"what\" id=\"what\" value=\"purge\" checked><label for=\"what\"> $I[alsopurge]</label>";
|
||||
}
|
||||
@ -717,7 +750,7 @@ function send_post(){
|
||||
function send_help(){
|
||||
global $U, $C, $H, $I;
|
||||
print_start();
|
||||
echo "<h2>$I[rules]</h2>$C[rulestxt]<br><br><hr><h2>$I[help]</h2>$I[helpguest]";
|
||||
echo "<h2>$I[rules]</h2>".get_setting('rulestxt')."<br><br><hr><h2>$I[help]</h2>$I[helpguest]";
|
||||
if($C['imgembed'] || $C['vidembed']) echo "<br>$I[helpembed]";
|
||||
if($U['status']>=3){
|
||||
echo "<br>$I[helpmem]<br>";
|
||||
@ -732,10 +765,47 @@ function send_help(){
|
||||
}
|
||||
|
||||
function send_profile($arg=''){
|
||||
global $U, $F, $H, $I;
|
||||
global $U, $F, $H, $I, $P, $C, $mysqli;
|
||||
print_start();
|
||||
echo "<center><$H[form]>".hidden('action', 'profile').hidden('do', 'save').hidden('session', $U['session'])."<h2>$I[profile]</h2><i>$arg</i><table cellspacing=\"0\">";
|
||||
thr();
|
||||
array_multisort(array_map('strtolower', array_keys($P)), SORT_ASC, SORT_STRING, $P);
|
||||
$ignored=array();
|
||||
$stmt=mysqli_prepare($mysqli, 'SELECT `ignored` FROM `ignored` WHERE `by`=?');
|
||||
mysqli_stmt_bind_param($stmt, 's', $U['nickname']);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_store_result($stmt);
|
||||
if(mysqli_stmt_num_rows($stmt)>0){
|
||||
mysqli_stmt_bind_result($stmt, $ign);
|
||||
echo "<tr><td><table cellspacing=\"0\" width=\"100%\"><tr><td align=\"left\"><b>$I[unignore]</b></td><td align=\"right\"><table cellspacing=\"0\">";
|
||||
echo "<tr><td> </td><td><select name=\"unignore\" size=\"1\"><option value=\"\">$I[choose]</option>";
|
||||
while(mysqli_stmt_fetch($stmt)){
|
||||
$ignored[]=$ign;
|
||||
$style='';
|
||||
foreach($P as $user){
|
||||
if($ign==$user[0]){
|
||||
$style=" style=\"$user[2]\"";
|
||||
break;
|
||||
}
|
||||
}
|
||||
echo "<option value=\"$ign\"$style>$ign</option>";
|
||||
}
|
||||
echo '</select></td></tr></table></td></tr></table></td></tr>';
|
||||
thr();
|
||||
}
|
||||
mysqli_stmt_free_result($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
if(count($P)-count($ignored)>1){
|
||||
echo "<tr><td><table cellspacing=\"0\" width=\"100%\"><tr><td align=\"left\"><b>$I[ignore]</b></td><td align=\"right\"><table cellspacing=\"0\">";
|
||||
echo "<tr><td> </td><td><select name=\"ignore\" size=\"1\"><option value=\"\">$I[choose]</option>";
|
||||
foreach($P as $user){
|
||||
if($U['nickname']!==$user[0] && !in_array($user[0], $ignored)){
|
||||
echo "<option value=\"$user[0]\" style=\"$user[2]\">$user[0]</option>";
|
||||
}
|
||||
}
|
||||
echo '</select></td></tr></table></td></tr></table></td></tr>';
|
||||
thr();
|
||||
}
|
||||
echo "<tr><td><table cellspacing=\"0\" width=\"100%\"><tr><td align=\"left\"><b>$I[refreshrate]</b></td><td align=\"right\"><table cellspacing=\"0\">";
|
||||
echo "<tr><td> </td><td><input type=\"text\" name=\"refresh\" size=\"3\" maxlength=\"3\" value=\"$U[refresh]\"></td></tr></table></td></tr></table></td></tr>";
|
||||
thr();
|
||||
@ -767,11 +837,13 @@ function send_profile($arg=''){
|
||||
if($U['timestamps']) echo ' checked';
|
||||
echo "></td><td><label for=\"timestamps\"><b>$I[timestamps]</b></label></td></tr></table></td></tr></table></td></tr>";
|
||||
thr();
|
||||
if($C['imgembed'] || $C['vidembed']){
|
||||
echo "<tr><td><table cellspacing=\"0\" width=\"100%\"><tr><td align=\"left\"><b>$I[embed]</b></td><td align=\"right\"><table cellspacing=\"0\">";
|
||||
echo "<tr><td> </td><td><input type=\"checkbox\" name=\"embed\" id=\"embed\" value=\"on\"";
|
||||
if($U['embed']) echo ' checked';
|
||||
echo "></td><td><label for=\"embed\"><b>$I[embed]</b></label></td></tr></table></td></tr></table></td></tr>";
|
||||
thr();
|
||||
}
|
||||
echo "<tr><td><table cellspacing=\"0\" width=\"100%\"><tr><td align=\"left\"><b>$I[pbsize]</b></td><td align=\"right\"><table cellspacing=\"0\">";
|
||||
echo "<tr><td> </td><td>$I[width]</td><td><input type=\"text\" name=\"boxwidth\" size=\"3\" maxlength=\"3\" value=\"$U[boxwidth]\"></td>";
|
||||
echo "<td> </td><td>$I[height]</td><td><input type=\"text\" name=\"boxheight\" size=\"3\" maxlength=\"3\" value=\"$U[boxheight]\"></td>";
|
||||
@ -838,33 +910,23 @@ function send_colours(){
|
||||
}
|
||||
|
||||
function send_login(){
|
||||
global $C, $H, $I, $mysqli, $L;
|
||||
global $C, $H, $I, $L;
|
||||
setcookie('test', '1');
|
||||
print_start();
|
||||
echo "<center><h1>$C[chatname]</h1><$H[form] target=\"_parent\">".hidden('action', 'login');
|
||||
if($C['enablecaptcha']){
|
||||
$code=rand(0, 99999);
|
||||
$randid=rand(0, 99999999);
|
||||
$enc=base64_encode(openssl_encrypt("$code, $randid", 'aes-128-cbc', $C['captchapass'], 0, '1234567890123456'));
|
||||
$stmt=mysqli_prepare($mysqli, 'INSERT INTO `captcha` (`id`, `time`) VALUES (?, \''.time().'\')');
|
||||
mysqli_stmt_bind_param($stmt, 'd', $randid);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
echo hidden('challenge', $enc);
|
||||
}
|
||||
echo "<table border=\"2\" width=\"1\" rules=\"none\"><tr><td align=\"left\">$I[nick]</td><td align=\"right\"><input type=\"text\" name=\"nick\" size=\"15\"></td></tr>";
|
||||
echo "<tr><td align=\"left\">$I[pass]</td><td align=\"right\"><input type=\"password\" name=\"pass\" size=\"15\"></td></tr>";
|
||||
if($C['enablecaptcha']){
|
||||
echo "<tr><td align=\"left\">$I[copy]";
|
||||
echo send_captcha($code);
|
||||
echo '</td><td align="right"><input type="text" name="captcha" size="15" autocomplete="off"></td></tr>';
|
||||
}
|
||||
echo "<tr><td colspan=\"2\" align=\"center\">$I[choosecol]<br><select style=\"text-align:center;color:#$C[coltxt];background-color:#$C[colbg];\" name=\"colour\"><option value=\"\">* $I[randomcol] *</option>";
|
||||
if($C['enablecaptcha']) send_captcha();
|
||||
if(get_setting('guestaccess')>0){
|
||||
echo "<tr><td colspan=\"2\" align=\"center\">$I[choosecol]<br><select style=\"text-align:center;\" name=\"colour\"><option value=\"\">* $I[randomcol] *</option>";
|
||||
print_colours();
|
||||
echo '</select></td></tr>';
|
||||
$nowchatting=get_nowchatting();
|
||||
echo '<tr><td colspan="2" align="center">'.submit($I['enter'])."</td></tr></table></form>$nowchatting";
|
||||
echo "<h2>$I[rules]</h2><b>$C[rulestxt]</b><br><br><p>$I[changelang]";
|
||||
}else{
|
||||
echo "<tr><td colspan=\"2\" align=\"center\">$I[noguests]</td></tr>";
|
||||
}
|
||||
echo '<tr><td colspan="2" align="center">'.submit($I['enter'])."</td></tr></table></form>";
|
||||
get_nowchatting();
|
||||
echo "<h2>$I[rules]</h2><b>".get_setting('rulestxt')."</b><br><br><p>$I[changelang]";
|
||||
foreach($L as $lang=>$name){
|
||||
echo " <a href=\"$_SERVER[SCRIPT_NAME]?lang=$lang\">$name</a>";
|
||||
}
|
||||
@ -917,7 +979,6 @@ function create_session(){
|
||||
$U['passhash']=md5(sha1(md5($U['nickname'].$_REQUEST['pass'])));
|
||||
$U['colour']=$_REQUEST['colour'];
|
||||
$U['status']=1;
|
||||
if(!valid_nick($U['nickname'])) send_error(sprintf($I['invalnick'], $C['maxname']));
|
||||
check_member();
|
||||
add_user_defaults();
|
||||
if($C['enablecaptcha'] && ($U['status']==1 || !$C['dismemcaptcha'])){
|
||||
@ -936,7 +997,8 @@ function create_session(){
|
||||
mysqli_stmt_close($stmt);
|
||||
}
|
||||
if($U['status']==1){
|
||||
if(!allowed_nick($U['nickname'])) send_error(sprintf($I['invalnick'], $C['maxname']));
|
||||
if(!valid_nick($U['nickname'])) send_error(sprintf($I['invalnick'], $C['maxname']));
|
||||
if(!valid_pass($_REQUEST['pass'])) send_error(sprintf($I['invalpass'], $C['minpass']));
|
||||
$ga=get_setting('guestaccess');
|
||||
if($ga==0) send_error($I['noguests']);
|
||||
}
|
||||
@ -975,7 +1037,7 @@ function write_new_session(){
|
||||
setcookie($C['cookiename'], $U['session']);
|
||||
if($C['msglogin'] && $U['status']>=3) add_system_message(sprintf(get_setting('msgenter'), $U['displayname']));
|
||||
}elseif($inuse){
|
||||
send_error($I['invalpass']);
|
||||
send_error($I['wrongpass']);
|
||||
}elseif($U['status']==0){
|
||||
setcookie($C['cookiename'], false);
|
||||
send_error("$I[kicked]<br>$U[kickmessage]");
|
||||
@ -1072,11 +1134,15 @@ function kill_session(){
|
||||
mysqli_stmt_bind_param($stmt, 's', $U['nickname']);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
$stmt=mysqli_prepare($mysqli, 'DELETE FROM `ignored` WHERE `ignored`=? OR `by`=?');
|
||||
mysqli_stmt_bind_param($stmt, 'ss', $U['nickname'], $U['nickname']);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
}
|
||||
elseif($C['msglogout'] && $U['status']>=3) add_system_message(sprintf(get_setting('msgexit'), $U['displayname']));
|
||||
}
|
||||
|
||||
function kick_chatter($names, $mes){
|
||||
function kick_chatter($names, $mes, $purge){
|
||||
global $C, $U, $P, $mysqli;
|
||||
$lonick='';
|
||||
$lines=parse_sessions();
|
||||
@ -1088,6 +1154,7 @@ function kick_chatter($names, $mes){
|
||||
if(($temp['nickname']==$U['nickname'] && $U['nickname']==$name) || ($U['status']>$temp['status'] && (($temp['nickname']==$name && $temp['status']>0) || ($name=='&' && $temp['status']==1)))){
|
||||
mysqli_stmt_bind_param($stmt, 'ss', $mes, $temp['session']);
|
||||
mysqli_stmt_execute($stmt);
|
||||
if($purge) del_all_messages($temp['nickname']);
|
||||
$lonick.="$temp[displayname], ";
|
||||
$i++;
|
||||
unset($P[$name]);
|
||||
@ -1097,11 +1164,11 @@ function kick_chatter($names, $mes){
|
||||
}
|
||||
mysqli_stmt_close($stmt);
|
||||
if($C['msgkick']){
|
||||
if($lonick!==''){
|
||||
if($names[0]=='&'){
|
||||
add_system_message(get_setting('msgallkick'));
|
||||
}else{
|
||||
$lonick=preg_replace('/\,\s$/','',$lonick);
|
||||
if($lonick!==''){
|
||||
if($i>1){
|
||||
add_system_message(sprintf(get_setting('msgmultikick'), $lonick));
|
||||
}else{
|
||||
@ -1110,6 +1177,8 @@ function kick_chatter($names, $mes){
|
||||
}
|
||||
}
|
||||
}
|
||||
if($lonick!=='') return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
function logout_chatter($names){
|
||||
@ -1118,6 +1187,7 @@ function logout_chatter($names){
|
||||
$stmt=mysqli_prepare($mysqli, 'DELETE FROM `sessions` WHERE `session`=? AND `status`<? AND `status`!=\'0\'');
|
||||
$stmt1=mysqli_prepare($mysqli, 'UPDATE `messages` SET `poster`=\'\' WHERE `poster`=? AND `poststatus`=\'9\'');
|
||||
$stmt2=mysqli_prepare($mysqli, 'UPDATE `messages` SET `recipient`=\'\' WHERE `recipient`=? AND `poststatus`=\'9\'');
|
||||
$stmt3=mysqli_prepare($mysqli, 'DELETE FROM `ignored` WHERE `ignored`=? OR `by`=?');
|
||||
if(isSet($lines)){
|
||||
foreach($names as $name){
|
||||
foreach($lines as $temp){
|
||||
@ -1127,8 +1197,10 @@ function logout_chatter($names){
|
||||
if($temp['status']==1){
|
||||
mysqli_stmt_bind_param($stmt1, 's', $temp['nickname']);
|
||||
mysqli_stmt_bind_param($stmt2, 's', $temp['nickname']);
|
||||
mysqli_stmt_bind_param($stmt3, 'ss', $temp['nickname'], $temp['nickname']);
|
||||
mysqli_stmt_execute($stmt1);
|
||||
mysqli_stmt_execute($stmt2);
|
||||
mysqli_stmt_execute($stmt3);
|
||||
}
|
||||
unset($P[$name]);
|
||||
}
|
||||
@ -1138,6 +1210,7 @@ function logout_chatter($names){
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_stmt_close($stmt1);
|
||||
mysqli_stmt_close($stmt2);
|
||||
mysqli_stmt_close($stmt3);
|
||||
}
|
||||
|
||||
function update_session(){
|
||||
@ -1173,7 +1246,7 @@ function check_session(){
|
||||
function get_nowchatting(){
|
||||
global $M, $G, $P, $I;
|
||||
parse_sessions();
|
||||
return sprintf($I['curchat'], count($P)).'<br>'.implode(' ', $M).' '.implode(' ', $G);
|
||||
echo sprintf($I['curchat'], count($P)).'<br>'.implode(' ', $M).' '.implode(' ', $G);
|
||||
}
|
||||
|
||||
function parse_sessions(){
|
||||
@ -1183,19 +1256,23 @@ function parse_sessions(){
|
||||
$stmt=mysqli_prepare($mysqli, 'DELETE FROM `sessions` WHERE `nickname`=?');
|
||||
$stmt1=mysqli_prepare($mysqli, 'UPDATE `messages` SET `poster`=\'\' WHERE `poster`=? AND `poststatus`=\'9\'');
|
||||
$stmt2=mysqli_prepare($mysqli, 'UPDATE `messages` SET `recipient`=\'\' WHERE `recipient`=? AND `poststatus`=\'9\'');
|
||||
$stmt3=mysqli_prepare($mysqli, 'DELETE FROM `ignored` WHERE `ignored`=? OR `by`=?');
|
||||
while($temp=mysqli_fetch_array($result, MYSQLI_ASSOC)){
|
||||
mysqli_stmt_bind_param($stmt, 's', $temp['nickname']);
|
||||
mysqli_stmt_execute($stmt);
|
||||
if($temp['status']<=1){
|
||||
mysqli_stmt_bind_param($stmt1, 's', $temp['nickname']);
|
||||
mysqli_stmt_bind_param($stmt2, 's', $temp['nickname']);
|
||||
mysqli_stmt_bind_param($stmt3, 'ss', $temp['nickname'], $temp['nickname']);
|
||||
mysqli_stmt_execute($stmt1);
|
||||
mysqli_stmt_execute($stmt2);
|
||||
mysqli_stmt_execute($stmt3);
|
||||
}
|
||||
}
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_stmt_close($stmt1);
|
||||
mysqli_stmt_close($stmt2);
|
||||
mysqli_stmt_close($stmt3);
|
||||
}
|
||||
$result=mysqli_query($mysqli, 'SELECT * FROM `sessions` WHERE `entry`=\'0\' ORDER BY `status` DESC, `lastpost` DESC');
|
||||
if(mysqli_num_rows($result)>0){
|
||||
@ -1244,7 +1321,7 @@ function check_member(){
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
}else{
|
||||
send_error($I['invalpass']);
|
||||
send_error($I['wrongpass']);
|
||||
}
|
||||
}else{
|
||||
mysqli_stmt_close($stmt);
|
||||
@ -1305,6 +1382,7 @@ function register_new(){
|
||||
if($_REQUEST['name']=='') send_admin();
|
||||
if(isSet($P[$_REQUEST['name']])) send_admin(sprintf($I['cantreg'], $_REQUEST['name']));
|
||||
if(!valid_nick($_REQUEST['name'])) send_admin(sprintf($I['invalnick'], $C['maxname']));
|
||||
if(!valid_pass($_REQUEST['pass'])) send_admin(sprintf($I['invalpass'], $C['minpass']));
|
||||
$stmt=mysqli_prepare($mysqli, 'SELECT * FROM `members` WHERE `nickname`=?');
|
||||
mysqli_stmt_bind_param($stmt, 's', $_REQUEST['name']);
|
||||
mysqli_stmt_execute($stmt);
|
||||
@ -1407,65 +1485,41 @@ function amend_profile(){
|
||||
|
||||
function save_profile(){
|
||||
global $U, $C, $I, $mysqli;
|
||||
if(isSet($_REQUEST['oldpass']) && $_REQUEST['oldpass']=='' && ($_REQUEST['newpass']!=='' || $_REQUEST['confirmpass']!=='')){
|
||||
send_profile($I['wrongpass']);
|
||||
}elseif(isSet($_REQUEST['newpass']) && $_REQUEST['newpass']!==$_REQUEST['confirmpass']){
|
||||
if(!isSet($_REQUEST['oldpass'])) $_REQUEST['oldpass']='';
|
||||
if(!isSet($_REQUEST['newpass'])) $_REQUEST['newpass']='';
|
||||
if(!isSet($_REQUEST['confirmpass'])) $_REQUEST['confirmpass']='';
|
||||
if($_REQUEST['newpass']!==$_REQUEST['confirmpass']){
|
||||
send_profile($I['noconfirm']);
|
||||
}
|
||||
// check and rewrite session
|
||||
if(isSet($_REQUEST['oldpass']) && $_REQUEST['oldpass']!==''){
|
||||
}elseif($_REQUEST['newpass']!==''){
|
||||
$U['oldhash']=md5(sha1(md5($U['nickname'].$_REQUEST['oldpass'])));
|
||||
}else{
|
||||
$U['oldhash']=$U['passhash'];
|
||||
}
|
||||
if(isSet($_REQUEST['newpass']) && $_REQUEST['newpass']!==''){
|
||||
$U['newhash']=md5(sha1(md5($U['nickname'].$_REQUEST['newpass'])));
|
||||
}else{
|
||||
$U['newhash']=$U['passhash'];
|
||||
$U['oldhash']=$U['newhash']=$U['passhash'];
|
||||
}
|
||||
$U['orihash']=$U['passhash'];
|
||||
$stmt=mysqli_prepare($mysqli, 'SELECT * FROM `sessions` WHERE `session`=? AND `passhash`=?');
|
||||
mysqli_stmt_bind_param($stmt, 'ss', $U['session'], $U['oldhash']);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_store_result($stmt);
|
||||
if(mysqli_stmt_num_rows($stmt)>0){
|
||||
mysqli_stmt_free_result($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
amend_profile();
|
||||
if($U['passhash']!==$U['oldhash']) send_profile($I['wrongpass']);
|
||||
$U['passhash']=$U['newhash'];
|
||||
amend_profile();
|
||||
$stmt=mysqli_prepare($mysqli, 'UPDATE `sessions` SET `refresh`=?, `displayname`=?, `fontinfo`=?, `style`=?, `passhash`=?, `boxwidth`=?, `boxheight`=?, `bgcolour`=?, `notesboxwidth`=?, `notesboxheight`=?, `timestamps`=?, `embed`=? WHERE `session`=?');
|
||||
mysqli_stmt_bind_param($stmt, 'dssssddsdddds', $U['refresh'], $U['displayname'], $U['fontinfo'], $U['style'], $U['passhash'], $U['boxwidth'], $U['boxheight'], $U['bgcolour'], $U['notesboxwidth'], $U['notesboxheight'], $U['timestamps'], $U['embed'], $U['session']);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
}else{
|
||||
mysqli_stmt_free_result($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
}
|
||||
if($U['orihash']!==$U['oldhash']) send_profile($I['wrongpass']);
|
||||
// rewrite member file
|
||||
if($U['status']>=2){
|
||||
$err='';
|
||||
$stmt=mysqli_prepare($mysqli, 'SELECT `passhash`, `status` FROM `members` WHERE `nickname`=?');
|
||||
mysqli_stmt_bind_param($stmt, 's', $U['nickname']);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_bind_result($stmt, $temp['passhash'], $temp['status']);
|
||||
if(mysqli_stmt_fetch($stmt)){
|
||||
mysqli_stmt_close($stmt);
|
||||
$U['sessionstatus']=$U['status'];
|
||||
$U['status']=$temp['status'];
|
||||
if($temp['passhash']!==$U['orihash']){
|
||||
$err=$I['wrongpass'];
|
||||
}else{
|
||||
$stmt=mysqli_prepare($mysqli, 'UPDATE `members` SET `passhash`=?, `refresh`=?, `colour`=?, `bgcolour`=?, `fontface`=?, `fonttags`=?, `boxwidth`=?, `boxheight`=?, `notesboxwidth`=?, `notesboxheight`=?, `timestamps`=?, `embed`=? WHERE `nickname`=?');
|
||||
mysqli_stmt_bind_param($stmt, 'sdssssdddddds', $U['passhash'], $U['refresh'], $U['colour'], $U['bgcolour'], $U['fontface'], $U['fonttags'], $U['boxwidth'], $U['boxheight'], $U['notesboxwidth'], $U['notesboxheight'], $U['timestamps'], $U['embed'], $U['nickname']);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
}
|
||||
$U['status']=$U['sessionstatus'];
|
||||
}else{
|
||||
if(isSet($_REQUEST['unignore']) && $_REQUEST['unignore']!=''){
|
||||
$stmt=mysqli_prepare($mysqli, 'DELETE FROM `ignored` WHERE `ignored`=? AND `by`=?');
|
||||
mysqli_stmt_bind_param($stmt, 'ss', $_REQUEST['unignore'], $U['nickname']);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
}
|
||||
if($err!=='') send_profile($err);
|
||||
if(isSet($_REQUEST['ignore']) && $_REQUEST['ignore']!=''){
|
||||
$stmt=mysqli_prepare($mysqli, 'INSERT INTO `ignored` (`ignored`,`by`) VALUES (?, ?)');
|
||||
mysqli_stmt_bind_param($stmt, 'ss', $_REQUEST['ignore'], $U['nickname']);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
}
|
||||
send_profile($I['succprofile']);
|
||||
}
|
||||
@ -1507,7 +1561,7 @@ function add_user_defaults(){
|
||||
// message handling
|
||||
|
||||
function validate_input(){
|
||||
global $U, $P, $C;
|
||||
global $U, $P, $C, $mysqli;
|
||||
$U['message']=substr($_REQUEST['message'], 0, $C['maxmessage']);
|
||||
if(!isSet($U['rejected'])) $U['rejected']=substr($_REQUEST['message'], $C['maxmessage']);
|
||||
if(preg_match('/&[^;]{0,8}$/', $U['message']) && preg_match('/^([^;]{0,8};)/', $U['rejected'], $match)){
|
||||
@ -1550,17 +1604,26 @@ function validate_input(){
|
||||
$U['poststatus']='6';
|
||||
$U['displaysend']="[Admin] $U[displayname] - ";
|
||||
}else{// known nick in room?
|
||||
$stmt=mysqli_prepare($mysqli, 'SELECT * FROM `ignored` WHERE (`ignored`=? AND `by`=?) OR (`ignored`=? AND `by`=?)');
|
||||
mysqli_stmt_bind_param($stmt, 'ssss', $U['nickname'], $_REQUEST['sendto'], $_REQUEST['sendto'], $U['nickname']);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_store_result($stmt);
|
||||
if(mysqli_stmt_num_rows($stmt)==0){
|
||||
foreach($P as $chatter){
|
||||
if($_REQUEST['sendto']==$chatter[0]){
|
||||
$U['recipient']=$chatter[0];
|
||||
$U['displayrecp']=style_this($chatter[0], $chatter[2]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
mysqli_stmt_free_result($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
if($U['recipient']!==''){
|
||||
$U['poststatus']='9';
|
||||
$U['delstatus']='9';
|
||||
$U['displaysend']="[$U[displayname] to $U[displayrecp]] - ";
|
||||
}else{// nick left already
|
||||
}else{// nick left already or ignores us
|
||||
$U['message']='';
|
||||
$U['rejected']='';
|
||||
}
|
||||
@ -1581,7 +1644,7 @@ function apply_filter($pm){
|
||||
if(!$pm) $U['message']=preg_replace("/$filter[match]/i", $filter['replace'], $U['message'], -1, $count);
|
||||
elseif(!$filter['allowinpm']) $U['message']=preg_replace("/$filter[match]/i", $filter['replace'], $U['message'], -1, $count);
|
||||
if($count>0 && $filter['kick']){
|
||||
kick_chatter(array($U['nickname']), '');
|
||||
kick_chatter(array($U['nickname']), '', false);
|
||||
send_error("$I[kicked]");
|
||||
}
|
||||
}
|
||||
@ -1712,8 +1775,12 @@ function del_last_message(){
|
||||
function print_messages($delstatus=''){
|
||||
global $U, $C, $mysqli;
|
||||
mysqli_query($mysqli, 'DELETE FROM `messages` WHERE `postdate`<=\''.(time()-60*$C['messageexpire'])."'");
|
||||
$stmt=mysqli_prepare($mysqli, 'SELECT `postdate`, `postid`, `text`, `delstatus` FROM `messages` WHERE `id` IN (SELECT * FROM (SELECT `id` FROM `messages` WHERE `poststatus`=\'1\' ORDER BY `postdate` DESC LIMIT ?) AS t) OR (`poststatus`>\'1\' AND `poststatus`<=?) OR (`poststatus`=\'9\' AND (`poster`=? OR `recipient`=?)) ORDER BY `postdate` DESC');
|
||||
mysqli_stmt_bind_param($stmt, 'ddss', $C['messagelimit'], $U['status'], $U['nickname'], $U['nickname']);
|
||||
$stmt=mysqli_prepare($mysqli, 'SELECT `postdate`, `postid`, `text`, `delstatus` FROM `messages` WHERE ('.
|
||||
'`id` IN (SELECT * FROM (SELECT `id` FROM `messages` WHERE `poststatus`=\'1\' ORDER BY `postdate` DESC LIMIT ?) AS t) '.
|
||||
'OR (`poststatus`>\'1\' AND `poststatus`<=?) '.
|
||||
'OR (`poststatus`=\'9\' AND ( (`poster`=? AND `recipient` NOT IN (SELECT * FROM (SELECT `ignored` FROM `ignored` WHERE `by`=?) AS t) ) OR `recipient`=?) )'.
|
||||
') AND `poster` NOT IN (SELECT * FROM (SELECT `ignored` FROM `ignored` WHERE `by`=?) AS t) ORDER BY `postdate` DESC');
|
||||
mysqli_stmt_bind_param($stmt, 'ddssss', $C['messagelimit'], $U['status'], $U['nickname'], $U['nickname'], $U['nickname'], $U['nickname']);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_bind_result($stmt, $message['postdate'], $message['postid'], $message['text'], $message['delstatus']);
|
||||
while(mysqli_stmt_fetch($stmt)){
|
||||
@ -1738,8 +1805,23 @@ function print_messages($delstatus=''){
|
||||
// this and that
|
||||
|
||||
function valid_admin(){
|
||||
global $mysqli;
|
||||
global $mysqli, $C;
|
||||
if(isSet($_REQUEST['nick']) && isSet($_REQUEST['pass'])){
|
||||
if($C['enablecaptcha']){
|
||||
$captcha=explode(',', openssl_decrypt(base64_decode($_REQUEST['challenge']), 'aes-128-cbc', $C['captchapass'], 0, '1234567890123456'));
|
||||
if(current($captcha)!==$_REQUEST['captcha']) return false;
|
||||
$stmt=mysqli_prepare($mysqli, 'SELECT * FROM `captcha` WHERE `id`=?');
|
||||
mysqli_stmt_bind_param($stmt, 'd', end($captcha));
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_store_result($stmt);
|
||||
if(mysqli_stmt_num_rows($stmt)==0) return false;
|
||||
mysqli_stmt_free_result($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
$stmt=mysqli_prepare($mysqli, 'DELETE FROM `captcha` WHERE `id`=? OR `time`<\''.(time()-60*10)."'");
|
||||
mysqli_stmt_bind_param($stmt, 'd', end($captcha));
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
}
|
||||
$stmt=mysqli_prepare($mysqli, 'SELECT * FROM `members` WHERE `nickname`=? AND `passhash`=? AND `status`>=\'7\'');
|
||||
mysqli_stmt_bind_param($stmt, 'ss', $_REQUEST['nick'], $pass=md5(sha1(md5($_REQUEST['nick'].$_REQUEST['pass']))));
|
||||
mysqli_stmt_execute($stmt);
|
||||
@ -1752,12 +1834,13 @@ function valid_admin(){
|
||||
}
|
||||
|
||||
function valid_nick($nick){
|
||||
return preg_match('/^[a-z0-9]*$/i', $nick);
|
||||
global $C;
|
||||
return preg_match("/^[a-z0-9]{1,$C[maxname]}$/i", $nick);
|
||||
}
|
||||
|
||||
function allowed_nick($nick){
|
||||
function valid_pass($pass){
|
||||
global $C;
|
||||
return preg_match("/^.{1,$C[maxname]}$/", $nick);
|
||||
return preg_match('/^.{'.$C['minpass'].',}$/', $pass);
|
||||
}
|
||||
|
||||
function cleanup_nick($nick){
|
||||
@ -1866,25 +1949,28 @@ function style_this($text, $styleinfo){
|
||||
function init_chat(){
|
||||
global $H, $C, $U, $I, $mysqli;
|
||||
$suwrite='';
|
||||
$tables=array('captcha', 'filter', 'members', 'messages', 'notes', 'sessions', 'settings');
|
||||
$tables=array('captcha', 'filter', 'ignored', 'members', 'messages', 'notes', 'sessions', 'settings');
|
||||
$num_tables=0;
|
||||
$result=mysqli_query($mysqli, 'SHOW TABLES');
|
||||
while($tmp=mysqli_fetch_array($result, MYSQLI_NUM)){
|
||||
if(in_array($tmp[0],$tables)) $num_tables++;
|
||||
}
|
||||
if($num_tables==7){
|
||||
if($num_tables>=7){
|
||||
$suwrite=$I['initdbexist'];
|
||||
$result=mysqli_query($mysqli, 'SELECT * FROM `members` WHERE `status`=\'8\'');
|
||||
if(mysqli_num_rows($result)>0){
|
||||
$suwrite=$I['initsuexist'];
|
||||
}
|
||||
}elseif(!valid_nick($_REQUEST['sunick']) || $_REQUEST['sunick']==''){
|
||||
}elseif(!valid_nick($_REQUEST['sunick'])){
|
||||
$suwrite=sprintf($I['invalnick'], $C['maxname']);
|
||||
}elseif(!valid_pass($_REQUEST['supass'])){
|
||||
$suwrite=sprintf($I['invalpass'], $C['minpass']);
|
||||
}elseif($_REQUEST['supass']!==$_REQUEST['supassc']){
|
||||
$suwrite=$I['noconfirm'];
|
||||
}else{
|
||||
mysqli_multi_query($mysqli, 'CREATE TABLE IF NOT EXISTS `captcha` (`id` int(10) unsigned NOT NULL, `time` int(10) unsigned NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8; '.
|
||||
'CREATE TABLE IF NOT EXISTS `filter` (`id` tinyint(3) unsigned NOT NULL, `match` tinytext NOT NULL, `replace` text NOT NULL, `allowinpm` tinyint(1) unsigned NOT NULL, `regex` tinyint(1) unsigned NOT NULL, `kick` tinyint(1) unsigned NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8; '.
|
||||
'CREATE TABLE IF NOT EXISTS `ignored` (`id` int(10) unsigned NOT NULL, `ignored` tinytext NOT NULL, `by` tinytext NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8; '.
|
||||
'CREATE TABLE IF NOT EXISTS `members` (`id` tinyint(3) unsigned NOT NULL, `nickname` tinytext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `passhash` tinytext NOT NULL, `status` tinyint(3) unsigned NOT NULL, `refresh` tinyint(3) unsigned NOT NULL, `colour` tinytext NOT NULL, `bgcolour` tinytext NOT NULL, `fontface` tinytext NOT NULL, `fonttags` tinytext NOT NULL, `boxwidth` tinyint(3) unsigned NOT NULL, `boxheight` tinyint(3) unsigned NOT NULL, `notesboxheight` tinyint(3) unsigned NOT NULL, `notesboxwidth` tinyint(3) unsigned NOT NULL, `regedby` tinytext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `lastlogin` int(10) unsigned NOT NULL, `timestamps` tinyint(1) unsigned NOT NULL, `embed` tinyint(1) unsigned NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8; '.
|
||||
'CREATE TABLE IF NOT EXISTS `messages` (`id` int(10) unsigned NOT NULL, `postdate` int(10) unsigned NOT NULL, `postid` int(10) unsigned NOT NULL, `poststatus` tinyint(3) unsigned NOT NULL, `poster` tinytext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `recipient` tinytext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `text` text NOT NULL, `delstatus` tinyint(3) unsigned NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8; '.
|
||||
'CREATE TABLE IF NOT EXISTS `notes` (`id` int(10) unsigned NOT NULL, `type` tinytext NOT NULL, `lastedited` int(10) unsigned NOT NULL, `editedby` tinytext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `text` text NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8; '.
|
||||
@ -1892,12 +1978,14 @@ function init_chat(){
|
||||
'CREATE TABLE IF NOT EXISTS `settings` (`id` tinyint(3) unsigned NOT NULL, `setting` tinytext NOT NULL, `value` tinytext NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8; '.
|
||||
'ALTER TABLE `captcha` ADD UNIQUE KEY `id` (`id`); '.
|
||||
'ALTER TABLE `filter` ADD PRIMARY KEY (`id`); '.
|
||||
'ALTER TABLE `ignored` ADD PRIMARY KEY (`id`); '.
|
||||
'ALTER TABLE `members` ADD PRIMARY KEY (`id`); '.
|
||||
'ALTER TABLE `messages` ADD PRIMARY KEY (`id`); '.
|
||||
'ALTER TABLE `notes` ADD PRIMARY KEY (`id`); '.
|
||||
'ALTER TABLE `sessions` ADD PRIMARY KEY (`id`); '.
|
||||
'ALTER TABLE `settings` ADD PRIMARY KEY (`id`); '.
|
||||
'ALTER TABLE `filter` MODIFY `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT; '.
|
||||
'ALTER TABLE `ignored` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; '.
|
||||
'ALTER TABLE `members` MODIFY `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT; '.
|
||||
'ALTER TABLE `messages` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; '.
|
||||
'ALTER TABLE `notes` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT; '.
|
||||
@ -1935,8 +2023,8 @@ function init_chat(){
|
||||
$suwrite=$I['susuccess'];
|
||||
}
|
||||
print_start();
|
||||
print "<center><h2>$I[init]</h2><br><h3>$I[sulogin]</h3>$suwrite<br><br><br>";
|
||||
print "<$H[form]>".hidden('action', 'setup').hidden('nick', $_REQUEST['sunick']).hidden('pass', $_REQUEST['supass']).submit($I['initgosetup']).'</form>';
|
||||
echo "<center><h2>$I[init]</h2><br><h3>$I[sulogin]</h3>$suwrite<br><br><br>";
|
||||
echo "<$H[form]>".hidden('action', 'setup').hidden('nick', $_REQUEST['sunick']).hidden('pass', $_REQUEST['supass']).submit($I['initgosetup']).'</form>';
|
||||
print_credits();
|
||||
print_end();
|
||||
}
|
||||
@ -1945,7 +2033,16 @@ function update_db(){
|
||||
global $C, $mysqli;
|
||||
$dbversion=get_setting('dbversion');
|
||||
if($dbversion<$C['dbversion']){
|
||||
if($dbversion<2){
|
||||
mysqli_query($mysqli, 'CREATE TABLE IF NOT EXISTS `ignored` (`id` int(10) unsigned NOT NULL, `ignored` tinytext NOT NULL, `by` tinytext NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8');
|
||||
mysqli_query($mysqli, 'ALTER TABLE `ignored` ADD PRIMARY KEY (`id`)');
|
||||
mysqli_query($mysqli, 'ALTER TABLE `ignored` MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT');
|
||||
}
|
||||
if($dbversion<3){
|
||||
mysqli_query($mysqli, 'INSERT INTO `settings` (`setting`, `value`) VALUES (\'rulestxt\', \'1. YOUR_RULS<br>2. YOUR_RULES\')');
|
||||
}
|
||||
update_setting('dbversion', $C['dbversion']);
|
||||
send_update();
|
||||
}
|
||||
}
|
||||
|
||||
@ -2020,7 +2117,7 @@ function check_db(){
|
||||
$mysqli=mysqli_connect($C['dbhost'], $C['dbuser'], $C['dbpass'], $C['dbname']);
|
||||
if(mysqli_connect_errno($mysqli)){
|
||||
if($_REQUEST['action']=='setup'){
|
||||
die($I['nosetupdb']);
|
||||
die($I['nodbsetup']);
|
||||
}else{
|
||||
die($I['nodb']);
|
||||
}
|
||||
@ -2046,9 +2143,9 @@ function load_lang(){
|
||||
function load_config(){
|
||||
global $C;
|
||||
$C=array(
|
||||
'version' =>'1.0', // Script version
|
||||
'dbversion' =>1, // Database version
|
||||
'showcredits' =>true, // Allow showing credits
|
||||
'version' =>'1.4', // Script version
|
||||
'dbversion' =>3, // Database version
|
||||
'showcredits' =>false, // Allow showing credits
|
||||
'colbg' =>'000000', // Background colour
|
||||
'coltxt' =>'FFFFFF', // Default text colour
|
||||
'collnk' =>'0000FF', // Link colour
|
||||
@ -2066,6 +2163,7 @@ function load_config(){
|
||||
'defaultrefresh'=>30, // Seconds to refresh the messages
|
||||
'maxmessage' =>2000, // Longest number of characters for a message
|
||||
'maxname' =>20, // Longest number of chatacters for a name
|
||||
'minpass' =>5, // Shortest number of chatacters for a password
|
||||
'boxwidth' =>40, // Default post box width
|
||||
'boxheight' =>3, // Default post box height
|
||||
'notesboxwidth' =>80, // Default notes box width
|
||||
@ -2075,23 +2173,24 @@ function load_config(){
|
||||
'dbpass' =>'YOUR_DB_PASS', // Database password
|
||||
'dbname' =>'public_chat', // Database
|
||||
'captchapass' =>'YOUR_PASS', // Password used for captcha encryption
|
||||
'captchachars' =>'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', // Characters used for captcha generation
|
||||
'enablecaptcha' =>true, // Enable captcha? ture/false
|
||||
'dismemcaptcha' =>true, // Disable captcha for members? ture/false
|
||||
'dismemcaptcha' =>false, // Disable captcha for members? ture/false
|
||||
'embed' =>true, // Default for displaying embedded imgs/vids or turn them into links true/false
|
||||
'imgembed' =>true, // Allow image embedding in chat using [img] tag? ture/false Warning: this might leak session data to the image hoster when cookies are disabled.
|
||||
'vidembed' =>true, // Allow video embedding in chat using [vid] tag? ture/false Warning: this might leak session data to the video hoster when cookies are disabled.
|
||||
'vidembed' =>false, // Allow video embedding in chat using [vid] tag? ture/false Warning: this might leak session data to the video hoster when cookies are disabled.
|
||||
'suguests' =>false, // Adds option to add applicants. They will have a reserved nick protected with a password, but don't count as member true/false
|
||||
'timestamps' =>true, // Display timestamps in front of the messages by default true/false
|
||||
'forceredirect' =>false, // Force redirect script or only use when no cookies available? ture/false
|
||||
'msglogout' =>false, // Add a message on member logout
|
||||
'msglogin' =>true, // Add a message on member login
|
||||
'msgkick' =>true, // Add a message when kicking someone
|
||||
'memkick' =>true, // Let a member kick guests if no mod is present
|
||||
'sendmail' =>false, // Send mail on new message - only activate on low traffic chat or your inbox will fill up very fast!
|
||||
'mailsender' =>'www-data <www-data@localhost>', // Send mail using this e-Mail address
|
||||
'mailreceiver' =>'Webmaster <webmaster@localhost>', // Send mail to this e-Mail address
|
||||
'redirect' =>"$_SERVER[SCRIPT_NAME]?action=redirect&url=", // Redirect script default: "$_SERVER[SCRIPT_NAME]?action=redirect&url="
|
||||
'lang' =>'en', // Default language
|
||||
'rulestxt' =>'1. YOUR_RULS<br>2. YOUR_RULES' // Rules - divide multiple rules by <br> to make them appear in a new line
|
||||
'lang' =>'en' // Default language
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
11
lang_de.php
11
lang_de.php
@ -20,12 +20,12 @@
|
||||
|
||||
$I=array(
|
||||
'nodb' => 'Keine Verbindung zur Datenbank!',
|
||||
'nodsetupb' => 'Keine Verbindung zur Datenbank, bitte erstelle eine Datenbank und bearbeite das Skript, um die korrekte Datenbank mit angegebenem Benutzernamen und Passwort zu benutzen.',
|
||||
'nodbsetup' => 'Keine Verbindung zur Datenbank, bitte erstelle eine Datenbank und bearbeite das Skript, um die korrekte Datenbank mit angegebenem Benutzernamen und Passwort zu benutzen.',
|
||||
'changelang' => 'Sprache ändern:',
|
||||
'expire' => 'Ungültige/abgelaufene Sitzung',
|
||||
'kicked' => 'Rausgeschmissen!',
|
||||
'invalnick' => 'Ungültiger Nickname (Maximal %d Zeichen, keine Sonderzeichen erlaubt)',
|
||||
'invalpass' => 'Falsches Passwort!',
|
||||
'invalpass' => 'Ungültiges Passwort (Mindestens %d Zeichen)',
|
||||
'noconfirm' => 'Passwordbestätigung stimmt nicht überein!',
|
||||
'incorregex' => 'Ungültiger regulärer Ausdruck!',
|
||||
'bottom' => 'Unten',
|
||||
@ -42,8 +42,7 @@ $I=array(
|
||||
'initdbexist' => 'Datenbanktabellen existieren bereits! Um vortzufahren, musst du diese Tabellen zuerst manuell löschen.',
|
||||
'initsuexist' => 'Ein Superadmin existiert bereits!',
|
||||
'initgosetup' => 'Zur Einrichtungsseite gehen',
|
||||
'dbupdate' => 'Datenbank aktualisieren',
|
||||
'update' => 'Aktualisieren',
|
||||
'dbupdate' => 'Datenbank erfolgreich aktualisiert!',
|
||||
'sysmessages' => 'Systemnachrichten',
|
||||
'msgenter' => 'Eintritt',
|
||||
'msgexit' => 'Verlassen',
|
||||
@ -131,6 +130,8 @@ $I=array(
|
||||
'helpmod' => 'Moderatoren: Achte auf den Admin-Knof unten. Er bringt eine Seite auf, auf der du Nachrichten löschen kannst, Teilnehmer rausschmeißen kannst, alle aktive Sitzungen anzeigen lassen kannst und den Gastzugriff deaktivieren kannst, falls dies nötig sein sollte.',
|
||||
'helpadm' => 'Admins: Du wirst zusätzlich in der Lage sein Gäste zu registrieren, Mitglieder zu verwalten und neue Nicknanem zu registrieren, ohne dass sie im Raum sind.',
|
||||
'profile' => 'Dein Profil',
|
||||
'ignore' => 'Ignorieren',
|
||||
'unignore' => 'Nicht mehr ignorieren',
|
||||
'refreshrate' => 'Aktualisierungsrate (20-150 Sekunden)',
|
||||
'fontcolour' => 'Schriftfarbe',
|
||||
'viewexample' => 'Beispiele anzeigen',
|
||||
@ -188,7 +189,7 @@ $I=array(
|
||||
'cantchgstat' => 'Der Status von %s kann nicht geändert werden.',
|
||||
'succdel' => '%s wurde erfolgriech aus der Datenbank gelöscht.',
|
||||
'succchg' => 'Status of %s successfully changed.',
|
||||
'wrongpass' => 'Passwort ist falsch.',
|
||||
'wrongpass' => 'Falsches Passwort!',
|
||||
'succprofile' => 'Dein Profil wurde erfolgreich gespeichert.',
|
||||
'backtologin' => 'Zurück zur Anmeldeseite.',
|
||||
'backtochat' => 'Zurück zum Chat.',
|
||||
|
11
lang_en.php
11
lang_en.php
@ -21,12 +21,12 @@
|
||||
//Language: English
|
||||
$I=array(
|
||||
'nodb' => 'No Connection to Database!',
|
||||
'nodsetupb' => 'No Connection to Database, please create a database and edit the script to use the correct database with given username and password!',
|
||||
'nodbsetup' => 'No Connection to Database, please create a database and edit the script to use the correct database with given username and password!',
|
||||
'changelang' => 'Change language:',
|
||||
'expire' => 'Invalid/expired session',
|
||||
'kicked' => 'Kicked!',
|
||||
'invalnick' => 'Invalid nickname (%d characters maximum, no special characters allowed)',
|
||||
'invalpass' => 'Invalid password!',
|
||||
'invalpass' => 'Invalid password (At least %d characters)',
|
||||
'noconfirm' => 'Password confirmation does not match!',
|
||||
'incorregex' => 'Incorrect regular expression!',
|
||||
'bottom' => 'Bottom',
|
||||
@ -46,8 +46,7 @@ $I=array(
|
||||
'nick' => 'Nickname:',
|
||||
'pass' => 'Password:',
|
||||
'login' => 'Login',
|
||||
'dbupdate' => 'Update database',
|
||||
'update' => 'Update',
|
||||
'dbupdate' => 'Database successfully updated!',
|
||||
'sysmessages' => 'System messages',
|
||||
'msgenter' => 'Entrance',
|
||||
'msgexit' => 'Leaving',
|
||||
@ -132,6 +131,8 @@ $I=array(
|
||||
'helpmod' => 'Moderators: Notice the Admin-button at the bottom. It\'ll bring up a page where you can clean the room, kick chatters, view all active sessions and disable guest access completely if needed.',
|
||||
'helpadm' => 'Admins: You\'ll be furthermore able to register guests, edit members and register new nicks without them beeing in the room.',
|
||||
'profile' => 'Your Profile',
|
||||
'ignore' => 'Ignore',
|
||||
'unignore' => 'Don\'t ignore anymore',
|
||||
'refreshrate' => 'Refresh rate (20-150 seconds)',
|
||||
'fontcolour' => 'Font colour',
|
||||
'viewexample' => 'View examples',
|
||||
@ -189,7 +190,7 @@ $I=array(
|
||||
'cantchgstat' => 'Can\'t change status of %s',
|
||||
'succdel' => '%s successfully deleted from database.',
|
||||
'succchg' => 'Status of %s successfully changed.',
|
||||
'wrongpass' => 'Password is wrong.',
|
||||
'wrongpass' => 'Wrong Password!',
|
||||
'succprofile' => 'Your profile has successfully been saved.',
|
||||
'backtologin' => 'Back to the login page.',
|
||||
'backtochat' => 'Back to the chat.',
|
||||
|
Reference in New Issue
Block a user