From 5c62bcef00f46c4073614950ee67df4bf1833c0b Mon Sep 17 00:00:00 2001 From: Daniel Winzen Date: Thu, 14 Apr 2016 18:49:25 +0200 Subject: [PATCH] Add CSS classes and move more css to the database --- CHANGELOG | 2 + chat.php | 302 ++++++++++++++++++++++++++++-------------------------- 2 files changed, 157 insertions(+), 147 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d18b207..08ce130 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +Add CSS classes and move more css to the database + Version 1.16.1 - Apr. 13, 2016 Fixed a typo diff --git a/chat.php b/chat.php index d8de941..3feb990 100644 --- a/chat.php +++ b/chat.php @@ -275,9 +275,14 @@ if(!isSet($_REQUEST['action'])){ // html output subs function print_stylesheet(){ + global $U; $css=get_setting('css'); - $colbg=get_setting('colbg'); $coltxt=get_setting('coltxt'); + if(!empty($U['bgcolour'])){ + $colbg=$U['bgcolour']; + }else{ + $colbg=get_setting('colbg'); + } echo ""; } @@ -309,7 +314,7 @@ function thr(){ } function print_start($class='', $ref=0, $url=''){ - global $H, $I, $U; + global $H, $I; if(!empty($url)){ header("Refresh: $ref; URL=$url"); } @@ -319,17 +324,12 @@ function print_start($class='', $ref=0, $url=''){ } if($class==='init'){ echo "$I[init]"; - echo ""; + echo ""; }else{ echo ''.get_setting('chatname').''; print_stylesheet(); } - if(!empty($U['bgcolour'])){ - $style=" style=\"background-color:#$U[bgcolour];\""; - }else{ - $style=''; - } - echo ""; + echo ""; } function send_redirect($url){ @@ -352,12 +352,12 @@ function send_access_denied(){ global $H, $I, $U; header('HTTP/1.1 401 Forbidden'); print_start('access_denied'); - echo "

$I[accessdenied]

".sprintf($I['loggedinas'], style_this($U['nickname'], $U['style'])); + echo "

$I[accessdenied]

".sprintf($I['loggedinas'], style_this($U['nickname'], $U['style'])); echo "
<$H[form]>$H[commonform]".hidden('action', 'logout'); if(!isSet($_REQUEST['session'])){ hidden('session', $U['session']); } - echo submit($I['logout'], 'id="exitbutton"')."
"; + echo submit($I['logout'], 'id="exitbutton"').""; print_end(); } @@ -381,7 +381,7 @@ function send_captcha(){ $stmt=$db->prepare('INSERT INTO ' . PREFIX . 'captcha (id, time, code) VALUES (?, ?, ?);'); $stmt->execute(array($randid, $time, $code)); } - echo "$I[copy]
"; + echo "$I[copy]
"; if($difficulty===1){ $im=imagecreatetruecolor(55, 24); $bg=imagecolorallocate($im, 0, 0, 0); @@ -461,20 +461,20 @@ function send_captcha(){ imagegif($im); imagedestroy($im); echo base64_encode(ob_get_clean()).'">'; - echo ''.hidden('challenge', $randid).''; + echo ''.hidden('challenge', $randid).''; } function send_setup(){ global $C, $H, $I, $U; print_start('setup'); - echo "

$I[setup]

<$H[form]>$H[commonform]".hidden('action', 'setup').hidden('do', 'save'); + echo "

$I[setup]

<$H[form]>$H[commonform]".hidden('action', 'setup').hidden('do', 'save'); if(!isSet($_REQUEST['session'])){ echo hidden('session', $U['session']); } - echo ''; + echo '
'; thr(); $ga=(int) get_setting('guestaccess'); - echo "
'; thr(); $englobal=(int) get_setting('englobalpass'); - echo "
$I[guestacc]"; + echo "
$I[guestacc]"; echo '
$I[globalloginpass]"; - echo ''; + echo "
'; thr(); $ga=(int) get_setting('guestreg'); - echo "
$I[globalloginpass]"; + echo ''; echo '
'; thr(); - echo "
$I[guestreg]"; + echo "
$I[guestreg]"; echo '
$I[sysmessages]"; - echo ''; + echo "'; foreach($C['text_settings'] as $setting){ thr(); - echo '
$I[sysmessages]"; + echo ''; foreach($C['msg_settings'] as $setting){ echo "'; } echo '
 $I[$setting] 
'; } foreach($C['colour_settings'] as $setting){ thr(); - echo '
'.$I[$setting].''; + echo '
'.$I[$setting].''; echo "'; echo '
'; } thr(); - echo "
'.$I[$setting].''; + echo '
'.$I[$setting].''; echo "'; echo '
$I[captcha]"; - echo ''; + echo "'; foreach($C['textarea_settings'] as $setting){ thr(); - echo '
$I[captcha]"; + echo ''; if(!extension_loaded('gd')){ echo ""; }else{ @@ -604,19 +604,19 @@ function send_setup(){ echo '
$I[gdextrequired]
'; } foreach($C['number_settings'] as $setting){ thr(); - echo '
'.$I[$setting].''; + echo '
'.$I[$setting].''; echo "'; echo '
'; } foreach($C['bool_settings'] as $setting){ thr(); - echo '
'.$I[$setting].''; + echo '
'.$I[$setting].''; echo "'; echo '
'.$I[$setting].''; + echo '
'.$I[$setting].''; echo "'.submit($I['apply']).'

'; if($U['status']==8){ - echo ''; + echo '
'; echo "'; } thr(); - echo ""; + echo ""; echo '
<$H[form]>$H[commonform]".hidden('action', 'setup').hidden('do', 'backup'); if(!isSet($_REQUEST['session'])){ hidden('session', $U['session']); @@ -654,7 +654,7 @@ function send_setup(){ if(!isSet($_REQUEST['session'])){ hidden('session', $U['session']); } - echo submit($I['logout'], 'id="exitbutton"')."$H[credit]"; + echo submit($I['logout'], 'id="exitbutton"')."$H[credit]"; print_end(); } @@ -754,31 +754,31 @@ function send_backup(){ $chknotes=''; } print_start('backup'); - echo "

$I[backuprestore]

"; + echo "

$I[backuprestore]

"; thr(); if(!extension_loaded('json')){ echo ""; }else{ echo "'; thr(); echo "
$I[jsonextrequired]
<$H[form]>$H[commonform]".hidden('action', 'setup').hidden('do', 'backup'); - echo ''; + echo '
'; + echo '
'; echo ""; echo ""; echo ""; echo ""; - echo ''.submit($I['backup']).'
'.submit($I['backup']).'
<$H[form]>$H[commonform]".hidden('action', 'setup').hidden('do', 'restore'); echo ''; echo "'; - echo "
"; + echo "
"; echo ""; echo ""; echo ""; - echo ''.submit($I['restore']).'
'; + echo '
'.submit($I['restore']).'
'; echo '
<$H[form]>$H[commonform]".hidden('action', 'setup').submit($I['initgosetup'], 'class="backbutton"')."
<$H[form]>$H[commonform]".hidden('action', 'setup').submit($I['initgosetup'], 'class="backbutton"')."
'; print_end(); } @@ -786,7 +786,7 @@ function send_backup(){ function send_destroy_chat(){ global $H, $I; print_start('destroy_chat'); - echo "
$I[confirm]
"; + echo "
$I[confirm]
"; echo "<$H[form] target=\"_parent\">$H[commonform]".hidden('action', 'setup').hidden('do', 'destroy').hidden('confirm', 'yes').submit($I['yes'], 'class="delbutton"').''; echo "<$H[form]>$H[commonform]".hidden('action', 'setup').submit($I['no'], 'class="backbutton"').'
'; print_end(); @@ -795,8 +795,8 @@ function send_destroy_chat(){ function send_init(){ global $H, $I, $L; print_start('init'); - echo "

$I[init]

"; - echo "<$H[form]>$H[commonform]".hidden('action', 'init')."

$I[sulogin]

"; + echo "

$I[init]

"; + echo "<$H[form]>$H[commonform]".hidden('action', 'init')."

$I[sulogin]

"; echo ""; echo ""; echo ""; @@ -805,30 +805,30 @@ function send_init(){ foreach($L as $lang=>$name){ echo " $name"; } - echo "

$H[credit]"; + echo "

$H[credit]"; print_end(); } function send_update(){ global $H, $I; print_start('update'); - echo "

$I[dbupdate]


<$H[form]>$H[commonform]".hidden('action', 'setup').submit($I['initgosetup'])."
$H[credit]
"; + echo "

$I[dbupdate]


<$H[form]>$H[commonform]".hidden('action', 'setup').submit($I['initgosetup'])."
$H[credit]"; print_end(); } function send_alogin(){ global $H, $I, $L; print_start('alogin'); - echo "
<$H[form]>$H[commonform]".hidden('action', 'setup').'
$I[sunick]
$I[supass]
$I[suconfirm]
'; + echo "<$H[form]>$H[commonform]".hidden('action', 'setup').'
'; echo ""; echo ""; send_captcha(); - echo '
$I[nick]
$I[pass]
'.submit($I['login']).'
'; + echo '
'.submit($I['login']).'
'; echo "

$I[changelang]"; foreach($L as $lang=>$name){ echo " $name"; } - echo "

$H[credit]"; + echo "

$H[credit]"; print_end(); } @@ -845,15 +845,15 @@ function send_admin($arg=''){ } } $chlist.=''; - echo "

$I[admfunc]

$arg"; + echo "

$I[admfunc]

$arg
"; if($U['status']>=7){ thr(); echo "'; } thr(); - echo "
<$H[form] target=\"view\">$H[commonform]".hidden('action', 'setup').submit($I['initgosetup']).'
$I[cleanmsgs]"; + echo "
'; thr(); - echo '
$I[cleanmsgs]"; frmadm('clean'); - echo '
'; + echo '
'; echo " "; echo " 
"; echo "'; echo submit($I['clean'], 'class="delbutton"').'
'.sprintf($I['kickchat'], get_setting('kickpenalty')).'
'; + echo '
'; thr(); - echo "
'.sprintf($I['kickchat'], get_setting('kickpenalty')).'
'; frmadm('kick'); - echo ""; - echo "
$I[kickreason] 
$chlist"; + echo ""; + echo "
$I[kickreason] 
$chlist"; echo submit($I['kick']).'
$I[logoutinact]"; + echo "
'; $views=array('sessions', 'filter', 'linkfilter'); foreach($views as $view){ thr(); - echo '
$I[logoutinact]"; frmadm('logout'); - echo "
$chlist"; + echo "
$chlist"; echo submit($I['logout']).'
'; } thr(); - echo "
'.$I[$view].''; + echo '
'.$I[$view].''; frmadm($view); echo submit($I['view']).'
$I[topic]"; + echo "
'; thr(); - echo "
$I[topic]"; frmadm('topic'); - echo '
'; + echo '
'; echo submit($I['change']).'
'; thr(); if(get_setting('suguests')){ - echo ""; + echo '
$I[guestacc]"; + echo "
$I[guestacc]"; frmadm('guestaccess'); - echo ''; + echo '
'; echo '
'.submit($I['change']).'
'; + echo "
$I[addsuguest]"; + echo "
$I[addsuguest]"; frmadm('superguest'); - echo "'; - echo "
'; } echo '"; echo ""; echo ""; - echo '
'; + echo "
$I[admmembers]"; + echo "
'; thr(); - echo "
$I[admmembers]"; frmadm('status'); - echo "
'.submit($I['change']).'
'; - echo "
$I[passreset]"; + echo "
'; thr(); - echo "'; } echo '"; echo ""; echo ""; - echo '
$I[passreset]"; frmadm('passreset'); - echo "
'.submit($I['change']).'
$I[regguest]"; + echo "
'; thr(); - echo "
$I[regguest]"; frmadm('register'); - echo "
'.submit($I['register']).'
'; thr(); } - echo "
$I[regmem]
"; + echo "
$I[regmem]
"; frmadm('regnew'); - echo ""; + echo "
$I[nick]  
"; echo "
$I[nick]  
$I[pass] "; echo submit($I['register']).'
$H[backtochat]"; + echo "
$H[backtochat]"; print_end(); } @@ -994,13 +994,13 @@ function send_sessions(){ global $H, $I, $U; $lines=parse_sessions(); print_start('sessions'); - echo "

$I[sessact]

"; - echo ""; + echo "

$I[sessact]

$I[sessnick]$I[sesstimeout]$I[sessua]
"; + echo ""; $trackip=(bool) get_setting('trackip'); $memexpire=(int) get_setting('memberexpire'); $guestexpire=(int) get_setting('guestexpire'); - if($trackip) echo ""; - echo ""; + if($trackip) echo ""; + echo ""; foreach($lines as $temp){ if($temp['status']!=0 && $temp['entry']!=0 && (!$temp['incognito'] || $temp['status']<$U['status'])){ if($temp['status']<=2){ @@ -1016,7 +1016,7 @@ function send_sessions(){ }elseif($temp['status']==8){ $s=' (SA)'; } - echo ''; if($U['status']>$temp['status'] || $U['session']===$temp['session']){ - echo ""; + echo ""; if($trackip){ - echo ""; + echo ""; } - echo ''; }else{ - echo ''; + echo ''; if($trackip){ - echo ''; + echo ''; } - echo ''; + echo ''; } } } - echo "
$I[sessnick]$I[sesstimeout]$I[sessua]$I[sesip]$I[actions]
$I[sesip]$I[actions]
'.style_this($temp['nickname'].$s, $temp['style']).''; + echo '
'.style_this($temp['nickname'].$s, $temp['style']).''; if($temp['status']>2){ get_timeout($temp['lastpost'], $memexpire); }else{ @@ -1024,23 +1024,23 @@ function send_sessions(){ } echo '$temp[useragent]$temp[useragent]$temp[ip]$temp[ip]'; + echo ''; frmadm('sessions'); echo hidden('nick', $temp['nickname']).submit($I['kick']).'
-----
-

$H[backtochat]
"; + echo "

$H[backtochat]"; print_end(); } @@ -1131,7 +1131,7 @@ function manage_linkfilter(){ function send_filter($arg=''){ global $H, $I, $U, $db, $memcached; print_start('filter'); - echo "

$I[filter]

$arg"; + echo "

$I[filter]

$arg
"; thr(); echo "'; + echo '
"; echo ""; @@ -1179,7 +1179,7 @@ function send_filter($arg=''){ echo ""; echo ""; echo ""; - echo '
$I[fid]$I[match]'.submit($I['change']).'
'.submit($I['change']).'
'; frmadm('filter'); @@ -1190,15 +1190,15 @@ function send_filter($arg=''){ echo "'.submit($I['add']).'

$H[backtochat]"; + echo '
'.submit($I['add']).'

$H[backtochat]"; print_end(); } function send_linkfilter($arg=''){ global $H, $I, $U, $db, $memcached; print_start('linkfilter'); - echo "

$I[linkfilter]

$arg"; + echo "

$I[linkfilter]

$arg
"; thr(); echo "'; + echo '
"; echo ""; @@ -1232,7 +1232,7 @@ function send_linkfilter($arg=''){ echo ""; echo '"; echo ""; - echo '
$I[fid]$I[match]'.submit($I['change']).'
'.submit($I['change']).'
'; frmadm('linkfilter'); @@ -1241,8 +1241,8 @@ function send_linkfilter($arg=''){ echo "'.submit($I['add']).'

$H[backtochat]"; + echo '
'.submit($I['add']).'

$H[backtochat]"; print_end(); } @@ -1276,10 +1276,11 @@ function send_messages($js){ }else{ print_start('messages'); } + echo '
'; echo ''; echo '
'; echo get_setting('topic'); - echo '
'; + echo '
'; print_chatters(); echo "
$I[bottom]
"; print_messages(); @@ -1288,15 +1289,15 @@ function send_messages($js){ echo ""; } echo "$I[top]"; + echo '
'; print_end(); } function send_notes($type){ global $H, $I, $U, $db; print_start('notes'); - echo '
'; if($U['status']>=6){ - echo "'; + echo "
<$H[form] target=\"view\">$H[commonform]".hidden('action', 'notes').hidden('do', 'admin').submit($I['admnotes']).'
'; echo "
<$H[form] target=\"view\">$H[commonform]".hidden('action', 'notes').hidden('do', 'admin').submit($I['admnotes']).'<$H[form] target=\"view\">$H[commonform]".hidden('action', 'notes').submit($I['notes']).'
'; } if($type==='staff'){ @@ -1352,7 +1353,7 @@ function send_notes($type){ echo hidden('action', 'notes')."
'; echo submit($I['savenotes']).'
'; if($num[0]>1){ - echo "
"; + echo "
$I[revisions]
"; if($revision<$num[0]-1){ echo "
$I[revisions]<$H[form]>$H[commonform]".hidden('action', 'notes').hidden('revision', $revision+1); if($type==='admin'){ @@ -1369,31 +1370,30 @@ function send_notes($type){ } echo '
'; } - echo '
'; print_end(); } function send_approve_waiting(){ global $H, $I, $db; print_start('approve_waiting'); - echo "

$I[waitingroom]

"; + echo "

$I[waitingroom]

"; $result=$db->query('SELECT * FROM ' . PREFIX . 'sessions WHERE entry=0 AND status=1 ORDER BY id;'); if($tmp=$result->fetchAll(PDO::FETCH_ASSOC)){ frmadm('approve'); - echo ''; - echo ""; + echo '
$I[sessnick]$I[sessua]
'; + echo ""; foreach($tmp as $temp){ - echo ''.hidden('alls[]', $temp['nickname']).""; + echo ''.hidden('alls[]', $temp['nickname']).""; } - echo "
$I[sessnick]$I[sessua]
$temp[useragent]
$temp[useragent]

"; + echo "

"; echo ""; echo ""; - echo ""; - echo '
$I[denymessage]
'.submit($I['butallowdeny']).'
'; + echo "
$I[denymessage]
'.submit($I['butallowdeny']).'
'; }else{ echo "$I[waitempty]
"; } - echo "
$H[backtochat]"; + echo "
$H[backtochat]"; print_end(); } @@ -1431,7 +1431,7 @@ function send_waiting_room(){ header("Refresh: $refresh; URL=$_SERVER[SCRIPT_NAME]?action=wait&session=$U[session]"); print_start('waitingroom', $refresh, "$_SERVER[SCRIPT_NAME]?action=wait&session=$U[session]&lang=$language"); } - echo "

$I[waitingroom]

"; + echo "

$I[waitingroom]

"; if($wait){ printf($I['waittext'], style_this($U['nickname'], $U['style']), $timeleft); }else{ @@ -1454,7 +1454,6 @@ function send_waiting_room(){ if(!empty($rulestxt)){ echo "

$I[rules]

$rulestxt"; } - echo '
'; print_end(); } } @@ -1462,17 +1461,19 @@ function send_waiting_room(){ function send_choose_messages(){ global $H, $I, $U; print_start('choose_messages'); + echo '
'; frmadm('clean'); echo hidden('what', 'selected').submit($I['delselmes'], 'class="delbutton"').'

'; print_messages($U['status']); echo "
$H[backtochat]"; + echo '
'; print_end(); } function send_del_confirm(){ global $I; print_start('del_confirm'); - echo "
$I[confirm]
"; + echo "
$I[confirm]
"; frmpst('delete'); if(isSet($_REQUEST['multi'])){ echo hidden('multi', 'on'); @@ -1488,7 +1489,7 @@ function send_del_confirm(){ if(isSet($_REQUEST['sendto'])){ echo hidden('sendto', $_REQUEST['sendto']); } - echo submit($I['no'], 'class="backbutton"').'
'; + echo submit($I['no'], 'class="backbutton"').'
'; print_end(); } @@ -1499,7 +1500,7 @@ function send_post(){ if(!isSet($_REQUEST['sendto'])){ $_REQUEST['sendto']=''; } - echo '
'; + echo '
'; frmpst('post'); echo hidden('postid', $U['postid']); if(isSet($_REQUEST['multi'])){ @@ -1566,7 +1567,7 @@ function send_post(){ echo ""; echo ""; } - echo '
'; + echo '
'; - echo '
'; frmpst('delete'); if(isSet($_REQUEST['multi'])){ echo hidden('multi', 'on'); @@ -1586,13 +1587,14 @@ function send_post(){ echo hidden('multi', 'on').submit($I['switchmulti']); } echo hidden('sendto', $_REQUEST['sendto']).'
'; + echo '
'; print_end(); } function send_help(){ global $H, $I, $U; print_start('help'); + echo '
'; $rulestxt=get_setting('rulestxt'); if(!empty($rulestxt)){ echo "

$I[rules]

$rulestxt


"; @@ -1610,14 +1612,15 @@ function send_help(){ } } } - echo "

$H[backtochat]$H[credit]
"; + echo "

$H[backtochat]$H[credit]
"; + echo '
'; print_end(); } function send_profile($arg=''){ global $F, $H, $I, $L, $P, $U, $db, $language; print_start('profile'); - echo "
<$H[form]>$H[commonform]".hidden('action', 'profile').hidden('do', 'save')."

$I[profile]

$arg"; + echo "<$H[form]>$H[commonform]".hidden('action', 'profile').hidden('do', 'save')."

$I[profile]

$arg
"; thr(); array_multisort(array_map('strtolower', array_keys($P)), SORT_ASC, SORT_STRING, $P); $ignored=array(); @@ -1628,7 +1631,7 @@ function send_profile($arg=''){ } } if(count($ignored)>0){ - echo "
$I[unignore]"; + echo "
$I[unignore]"; echo "
'; thr(); } - echo "
$I[ignore]"; + echo "
$I[ignore]"; echo "
"; thr(); if(!isSet($_COOKIE[COOKIENAME])){ @@ -1667,14 +1670,14 @@ function send_profile($arg=''){ $param=''; } preg_match('/#([0-9a-f]{6})/i', $U['style'], $matches); - echo "
$I[refreshrate]"; + echo "
$I[refreshrate]"; echo "
"; thr(); - echo "
$I[fontcolour] ($I[viewexample])"; + echo "
$I[fontcolour] ($I[viewexample])"; echo "
"; thr(); if($U['status']>=3){ - echo "
$I[bgcolour] ($I[viewexample])"; + echo "
$I[bgcolour] ($I[viewexample])"; echo "
$I[fontface]"; + echo "
$I[fontface]"; echo "'; thr(); - echo "
 '.style_this("$U[nickname] : $I[fontexample]", $U['style']).'
"; thr(); if(get_setting('imgembed')){ - echo "
$I[timestamps]"; + echo "
$I[timestamps]"; echo '
$I[embed]"; + echo "
$I[embed]"; echo '=5 && get_setting('incognito')){ - echo "
"; thr(); } - echo "
$I[incognito]"; + echo "
$I[incognito]"; echo '
$I[pbsize]"; + echo "'; thr(); if($U['status']>=5){ - echo "
$I[pbsize]"; echo ""; echo ""; echo '
 $I[width] $I[height]
$I[nbsize]"; + echo "'; thr(); } if($U['status']>=2){ - echo "
$I[nbsize]"; echo ""; echo ""; echo '
 $I[width] $I[height]
"; - echo '
$I[changepass]
'; + echo "'; thr(); - echo "
"; + echo '
$I[changepass]
'; echo ""; echo ""; echo ""; echo '
 $I[oldpass]
 $I[newpass]
 $I[confirmpass]
"; - echo '
$I[changenickname]
'; + echo "'; @@ -1754,14 +1757,14 @@ function send_profile($arg=''){ echo " $name"; } echo '

'; - echo "
$H[backtochat]"; + echo "
$H[backtochat]"; print_end(); } function send_controls(){ global $H, $I, $U; print_start('controls'); - echo '
"; + echo '
$I[changenickname]
'; echo ""; echo ""; echo '
 $I[newnickname]
 $I[newpass]
'; + echo '
'; echo "'; echo "'; echo "'; @@ -1781,14 +1784,14 @@ function send_controls(){ function send_logout(){ global $H, $I, $U; print_start('logout'); - echo '

'.sprintf($I['bye'], style_this($U['nickname'], $U['style']))."

$H[backtologin]
"; + echo '

'.sprintf($I['bye'], style_this($U['nickname'], $U['style']))."

$H[backtologin]"; print_end(); } function send_colours(){ global $H, $I; print_start('colours'); - echo "

$I[colourtable]

"; + echo "

$I[colourtable]

"; for($red=0x00;$red<=0xFF;$red+=0x33){ for($green=0x00;$green<=0xFF;$green+=0x33){ for($blue=0x00;$blue<=0xFF;$blue+=0x33){ @@ -1799,7 +1802,7 @@ function send_colours(){ } echo '
'; } - echo "
<$H[form]>$H[commonform]".hidden('action', 'profile').submit($I['backtoprofile'], ' class="backbutton"').'
'; + echo "<$H[form]>$H[commonform]".hidden('action', 'profile').submit($I['backtoprofile'], ' class="backbutton"').''; print_end(); } @@ -1809,24 +1812,24 @@ function send_login(){ print_start('login'); $ga=(int) get_setting('guestaccess'); $englobal=(int) get_setting('englobalpass'); - echo '

'.get_setting('chatname').'

'; + echo '

'.get_setting('chatname').'

'; echo "<$H[form] target=\"_parent\">$H[commonform]".hidden('action', 'login'); if($englobal===1 && isSet($_POST['globalpass'])){ echo hidden('globalpass', $_POST['globalpass']); } - echo '
<$H[form] target=\"post\">$H[commonform]".hidden('action', 'post').submit($I['reloadpb']).'<$H[form] target=\"view\">$H[commonform]".hidden('action', 'view').submit($I['reloadmsgs']).'<$H[form] target=\"view\">$H[commonform]".hidden('action', 'profile').submit($I['chgprofile']).'
'; + echo '
'; if($englobal!==1 || (isSet($_POST['globalpass']) && $_POST['globalpass']==get_setting('globalpass'))){ - echo ""; - echo ""; + echo ""; + echo ""; send_captcha(); if($ga!==0){ if(get_setting('guestreg')!=0){ - echo ""; + echo ""; } if($englobal===2){ - echo ""; + echo ""; } - echo "'; }else{ @@ -1842,7 +1845,7 @@ function send_login(){ echo "

$I[rules]

$rulestxt
"; } }else{ - echo ""; + echo ""; if($ga===0){ echo ""; } @@ -1852,14 +1855,14 @@ function send_login(){ foreach($L as $lang=>$name){ echo " $name"; } - echo "

$H[credit]"; + echo "

$H[credit]"; print_end(); } function send_error($err){ global $H, $I; print_start('error'); - echo "

$I[error]: $err

$H[backtologin]"; + echo "

$I[error]: $err

$H[backtologin]
"; print_end(); } @@ -3100,8 +3103,8 @@ function destroy_chat(){ $memcached->delete(DBNAME . '-' . PREFIX . 'settings-dbversion'); $memcached->delete(DBNAME . '-' . PREFIX . 'settings-msgencrypted'); } - echo "

$I[destroyed]




"; - echo "<$H[form]>".hidden('lang', $language).hidden('action', 'setup').submit($I['init'])."$H[credit]
"; + echo "

$I[destroyed]




"; + echo "<$H[form]>".hidden('lang', $language).hidden('action', 'setup').submit($I['init'])."$H[credit]"; print_end(); } @@ -3168,7 +3171,7 @@ function init_chat(){ $db->exec('CREATE INDEX IF NOT EXISTS lastpost ON ' . PREFIX . 'sessions (lastpost);'); $db->exec('CREATE TABLE IF NOT EXISTS ' . PREFIX . "settings (setting TEXT NOT NULL PRIMARY KEY, value TEXT NOT NULL);"); } - $settings=array(array('guestaccess', '0'), array('globalpass', ''), array('englobalpass', '0'), array('captcha', '0'), array('dateformat', 'm-d H:i:s'), array('rulestxt', ''), array('msgencrypted', '0'), array('dbversion', DBVERSION), array('css', 'a:visited{color:#B33CB4;} a:active{color:#FF0033;} a:link{color:#0000FF;} input,select,textarea{color:#FFFFFF;background-color:#000000;} a img{width:15%} a:hover img{width:35%} .error{color:#FF0033;} .delbutton{background-color:#660000;} .backbutton{background-color:#004400;} #exitbutton{background-color:#AA0000;}'), array('memberexpire', '60'), array('guestexpire', '15'), array('kickpenalty', '10'), array('entrywait', '120'), array('messageexpire', '14400'), array('messagelimit', '150'), array('maxmessage', 2000), array('captchatime', '600'), array('colbg', '000000'), array('coltxt', 'FFFFFF'), array('maxname', '20'), array('minpass', '5'), array('defaultrefresh', '20'), array('dismemcaptcha', '0'), array('suguests', '0'), array('imgembed', '1'), array('timestamps', '1'), array('trackip', '0'), array('captchachars', '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), array('memkick', '1'), array('forceredirect', '0'), array('redirect', ''), array('incognito', '1'), array('enablejs', '0'), array('chatname', 'My Chat'), array('topic', ''), array('msgsendall', $I['sendallmsg']), array('msgsendmem', $I['sendmemmsg']), array('msgsendmod', $I['sendmodmsg']), array('msgsendadm', $I['sendadmmsg']), array('msgsendprv', $I['sendprvmsg']), array('msgenter', $I['entermsg']), array('msgexit', $I['exitmsg']), array('msgmemreg', $I['memregmsg']), array('msgsureg', $I['suregmsg']), array('msgkick', $I['kickmsg']), array('msgmultikick', $I['multikickmsg']), array('msgallkick', $I['allkickmsg']), array('msgclean', $I['cleanmsg']), array('numnotes', '3'), array('keeplimit', '3'), array('mailsender', 'www-data '), array('mailreceiver', 'Webmaster '), array('sendmail', '0'), array('modfallback', '1'), array('guestreg', '0')); + $settings=array(array('guestaccess', '0'), array('globalpass', ''), array('englobalpass', '0'), array('captcha', '0'), array('dateformat', 'm-d H:i:s'), array('rulestxt', ''), array('msgencrypted', '0'), array('dbversion', DBVERSION), array('css', 'a:visited{color:#B33CB4;} a:active{color:#FF0033;} a:link{color:#0000FF;} input,select,textarea{color:#FFFFFF;background-color:#000000;} a img{width:15%} a:hover img{width:35%} .error{color:#FF0033;} .delbutton{background-color:#660000;} .backbutton{background-color:#004400;} #exitbutton{background-color:#AA0000;} .center-table{margin-left:auto;margin-right:auto;} body{text-align:center;} .left-table{width:100%;text-align:left;} .right{text-align:right;} .left{text-align:left;} .right-table{border-spacing:0px;margin-left:auto;} .padded{padding:5px;} #chatters{max-height:100px;overflow-y:auto;} .center{text-align:center;}'), array('memberexpire', '60'), array('guestexpire', '15'), array('kickpenalty', '10'), array('entrywait', '120'), array('messageexpire', '14400'), array('messagelimit', '150'), array('maxmessage', 2000), array('captchatime', '600'), array('colbg', '000000'), array('coltxt', 'FFFFFF'), array('maxname', '20'), array('minpass', '5'), array('defaultrefresh', '20'), array('dismemcaptcha', '0'), array('suguests', '0'), array('imgembed', '1'), array('timestamps', '1'), array('trackip', '0'), array('captchachars', '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), array('memkick', '1'), array('forceredirect', '0'), array('redirect', ''), array('incognito', '1'), array('enablejs', '0'), array('chatname', 'My Chat'), array('topic', ''), array('msgsendall', $I['sendallmsg']), array('msgsendmem', $I['sendmemmsg']), array('msgsendmod', $I['sendmodmsg']), array('msgsendadm', $I['sendadmmsg']), array('msgsendprv', $I['sendprvmsg']), array('msgenter', $I['entermsg']), array('msgexit', $I['exitmsg']), array('msgmemreg', $I['memregmsg']), array('msgsureg', $I['suregmsg']), array('msgkick', $I['kickmsg']), array('msgmultikick', $I['multikickmsg']), array('msgallkick', $I['allkickmsg']), array('msgclean', $I['cleanmsg']), array('numnotes', '3'), array('keeplimit', '3'), array('mailsender', 'www-data '), array('mailreceiver', 'Webmaster '), array('sendmail', '0'), array('modfallback', '1'), array('guestreg', '0')); $stmt=$db->prepare('INSERT INTO ' . PREFIX . 'settings (setting, value) VALUES (?, ?);'); foreach($settings as $pair){ $stmt->execute($pair); @@ -3190,8 +3193,8 @@ function init_chat(){ $suwrite=$I['susuccess']; } print_start('init'); - echo "

$I[init]


$I[sulogin]

$suwrite


"; - echo "<$H[form]>$H[commonform]".hidden('action', 'setup').submit($I['initgosetup'])."$H[credit]
"; + echo "

$I[init]


$I[sulogin]

$suwrite


"; + echo "<$H[form]>$H[commonform]".hidden('action', 'setup').submit($I['initgosetup'])."$H[credit]"; print_end(); } @@ -3298,6 +3301,11 @@ function update_db(){ if($dbversion<15){ $db->exec('INSERT INTO ' . PREFIX . "settings (setting, value) VALUES ('keeplimit', '3'), ('mailsender', 'www-data '), ('mailreceiver', 'Webmaster '), ('sendmail', '0'), ('modfallback', '1'), ('guestreg', '0');"); } + if($dbversion<16){ + $css=get_setting('css'); + $css.=' .center-table{margin-left:auto;margin-right:auto;} body{text-align:center;} .left-table{width:100%;text-align:left;} .right{text-align:right;} .left{text-align:left;} .right-table{border-spacing:0px;margin-left:auto;} .padded{padding:5px;} #chatters{max-height:100px;overflow-y:auto;} .center{text-align:center;}'; + update_setting('css', $css); + } update_setting('dbversion', DBVERSION); if(get_setting('msgencrypted')!=MSGENCRYPTED){ if(!extension_loaded('openssl')){ @@ -3448,7 +3456,7 @@ function load_html(){ } function load_lang(){ - global $I, $L, $U, $language; + global $I, $L, $language; $L=array( 'de' =>'Deutsch', 'en' =>'English', @@ -3477,7 +3485,7 @@ function load_lang(){ function load_config(){ define('VERSION', '1.16.1'); // Script version - define('DBVERSION', 15); // Database version + define('DBVERSION', 16); // Database version define('MSGENCRYPTED', false); // Store messages encrypted in the database to prevent other database users from reading them - true/false - visit the setup page after editing! define('ENCRYPTKEY', 'MY_KEY'); // Encryption key for messages define('DBHOST', 'localhost'); // Database host
$I[nick]
$I[pass]
$I[nick]
$I[pass]
$I[regpass]
$I[regpass]
$I[globalloginpass]
$I[globalloginpass]
$I[choosecol]
$I[choosecol]
$I[globalloginpass]
$I[globalloginpass]
$I[noguests]