Teya Salat


Unique

picture today

((___))
(+ +)'-.-.-.-.,
(._.) mbeee
® '-:_:-:_:'
free counters
||




Website
Gambar
local
Mobile Web(beta)


Cyb - ChatBoxCyb - ChatBox2.3http://www.vbulletin.org/forum/showthread.php?t=177552hide_errors(); $vbulletin->db->query_write(" CREATE TABLE IF NOT EXISTS `". TABLE_PREFIX ."cyb_chatbox` ( `id` INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, `userid` INT(10) NOT NULL, `userip` VARCHAR(20) NOT NULL, `dateline` INT(10) NOT NULL, `message` TEXT NOT NULL, `textprop` TEXT NOT NULL) "); $db->show_errors();]]>hide_errors(); $vbulletin->db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "cyb_chatbox` "); $db->show_errors();]]> template_groups cache_templates options['cybchatbox_script_locs']!='') { eval('$cybcb_locs = in_array(THIS_SCRIPT, array(misc,' . $vbulletin->options['cybchatbox_script_locs'] . '));'); } else { eval('$cybcb_locs = !in_array(THIS_SCRIPT, array(cybchatbox));'); } $cybcb_hasenoughposts = true; if (($vbulletin->userinfo['posts'] < $vbulletin-> options['cybchatbox_excluded_pc']) AND !can_moderate()) { $cybcb_hasenoughposts = false; } if ($vbulletin->options['cybchatbox_enable_product'] AND in_array(THIS_SCRIPT, array($cybcb_locs)) AND $cybcb_hasenoughposts) { $globaltemplates = array_merge($globaltemplates, array('cyb_chatbox', 'cyb_chatbox_bit', 'cyb_chatbox_archive_bit', 'cyb_chatbox_topchatters_bit')); }]]> parse_templates options['cybchatbox_enable_product']) { if ($vbulletin->options['cybchatbox_script_locs']!='') { eval('$cybcb_locs = in_array(THIS_SCRIPT, array(misc,' . $vbulletin->options['cybchatbox_script_locs'] . '));'); } else { eval('$cybcb_locs = !in_array(THIS_SCRIPT, array(cybchatbox));'); } function Ccb_userExcluded($cybcb_user) { return (Ccb_checkExcluded($cybcb_user['userid'], 'cybchatbox_excluded_users') || Ccb_checkExcluded($cybcb_user['usergroupid'], 'cybchatbox_excluded_groups')); } function Ccb_checkExcluded($cybcb_exc1, $cybcb_exc2) { global $vbulletin; return in_array($cybcb_exc1, iif($vbulletin->options[$cybcb_exc2], explode(',', $vbulletin->options[$cybcb_exc2]), array())); } $cybcb_hasenoughposts = true; if (($vbulletin->userinfo['posts'] < $vbulletin-> options['cybchatbox_excluded_pc']) AND !can_moderate()) { $cybcb_hasenoughposts = false; } if (in_array(THIS_SCRIPT, array($cybcb_locs)) AND !Ccb_userExcluded($vbulletin->userinfo) AND empty($vbulletin->userinfo['infractiongroupids']) AND $cybcb_hasenoughposts) { $cybcb_canmod = false; if (is_member_of($vbulletin->userinfo, split(',', $vbulletin->options['cybchatbox_can_mod']))) { $cybcb_canmod = true; } if ($vbulletin->options['cybchatbox_canviewonly']!='') { $cybchatbox_cantpost = '1,'.$vbulletin->options['cybchatbox_canviewonly']; } else { $cybchatbox_cantpost = '1'; } $cybcb_cantpost = false; if (is_member_of($vbulletin->userinfo, split(',', $cybchatbox_cantpost))) { $cybcb_cantpost = true; } if ($vbulletin->options['cybchatbox_smiliestotal']!=0) { $db->hide_errors(); $cybcb_get_smilies = $vbulletin->db->query_read_slave(" SELECT smilieid, smilietext, smiliepath, smilie.title, imagecategory.title AS category FROM " . TABLE_PREFIX . "smilie AS smilie LEFT JOIN " . TABLE_PREFIX . "imagecategory AS imagecategory USING(imagecategoryid) ORDER BY imagecategory.displayorder, imagecategory.title, smilie.displayorder LIMIT 0, ".$vbulletin->options['cybchatbox_smiliesinit']." "); $cybcb_smilies_total = $vbulletin->db->num_rows($cybcb_get_smilies); $vbulletin->db->data_seek($cybcb_get_smilies, 0); $cybcb_i = 0; $cybcb_smilie_bit = array(); while ($cybcb_smilie = $vbulletin->db->fetch_array($cybcb_get_smilies) AND ($cybcb_i++ '.$cybcb_smilie['title'].' '; $cybcb_smilie_bit[] = ' '; if (sizeof($cybcb_smilie_bit) == $vbulletin->options['cybchatbox_smiliesperrow']) { $cybcb_smilie_cell = implode('', $cybcb_smilie_bit); $cybcb_smilie_bits .= ' '.$cybcb_smilie_cell.' '; $cybcb_smilie_bit = array(); } } $cybcb_smilies_remaining = sizeof($cybcb_smilie_bit); if ($cybcb_smilies_remaining > 0) { $cybcb_smilies_colrem = $vbulletin->options['cybchatbox_smiliesperrow'] - $cybcb_smilies_remaining; $cybcb_smilie_bit[] = ' '; $cybcb_smilie_cell = implode('', $cybcb_smilie_bit); $cybcb_smilie_bits .= ' '.$cybcb_smilie_cell.' '; } $db->show_errors(); unset($cybcb_get_smilies, $cybcb_smilie); $cybcb_smilies_init = '
'.$cybcb_smilie_html.'
 
'.$cybcb_smilie_bits.'
'; } if ($_REQUEST['do']!='cchatbox') { $cybcb_height_messarea = $vbulletin->options['cybchatbox_height'].'px'; $cybcb_height_input = ($vbulletin->options['cybchatbox_height']-25).'px'; } else { $cybcb_height_messarea = $vbulletin->options['cybchatbox_height_full'].'px'; $cybcb_height_input = ($vbulletin->options['cybchatbox_height_full']-25).'px'; } $cybcb_height_input_wstatus = (str_replace("px","",$cybcb_height_input) - 20).'px'; $db->hide_errors(); $cybcb_get_newstat = $vbulletin->db->query_read(" SELECT id FROM " . TABLE_PREFIX . "cyb_chatbox AS cyb_chatbox WHERE dateline > '".$vbulletin->userinfo['lastvisit']."' "); $db->show_errors(); if ($db->num_rows($cybcb_get_newstat)>0) { $cybcb_newstat = construct_phrase($vbphrase['cybcb_x_new_messages'], $db->num_rows($cybcb_get_newstat)); } else { $cybcb_newstat = $vbphrase['cybcb_no_new_messages']; } $cybcb_colorlist = explode(',',str_replace(' ', '', $vbulletin->options['cybchatbox_textcolors'])); foreach ($cybcb_colorlist AS $cybcb_color) { $cybcb_colors .= ' '."\n"; } $vbulletin->input->clean_gpc('c', 'ccb_m_size', TYPE_UINT); $cybcb_textsize = $vbulletin->GPC['ccb_m_size']; if (!$cybcb_textsize) { $cybcb_textsize = 11; } $cybcb_sizelist = explode(',',str_replace(' ', '', $vbulletin->options['cybchatbox_textsizes'])); foreach ($cybcb_sizelist AS $cybcb_size) { eval('$cybcb_sizes .= " "."\n";'); } $cybcb_textsize .= 'px'; $cybcb_sectok = $vbulletin->userinfo['securitytoken']; if (!$cybcb_sectok) { $cybcb_sectok = 'none'; } eval('$cybchatbox = "' . $vbulletin->templatecache['cyb_chatbox'] . '";'); if ($vbulletin->options['cybchatbox_page_loc']>0) { if ((THIS_SCRIPT!='misc') AND ($vbulletin->options['cybchatbox_page_loc']==1)) { $vbulletin->templatecache['navbar'] = $vbulletin->templatecache['navbar'].'$cybchatbox
'; } if ((THIS_SCRIPT!='misc') AND ($vbulletin->options['cybchatbox_page_loc']==2)) { $vbulletin->templatecache['footer'] = '
$cybchatbox'.$vbulletin->templatecache['footer']; } if ((THIS_SCRIPT!='misc') AND ($vbulletin->options['cybchatbox_page_loc']==3)) { $vbulletin->templatecache['FORUMHOME'] = str_replace('$ad_location[ad_forumhome_afterforums]', '$ad_location[ad_forumhome_afterforums] $cybchatbox', $vbulletin->templatecache['FORUMHOME']); } } if (($vbulletin->options['cybchatbox_auto_prune']>0) AND $vbulletin->userinfo['userid']) { $cybcb_prunetime = TIMENOW - ($vbulletin->options['cybchatbox_auto_prune'] * 3600); $db->hide_errors(); $vbulletin->db->query_write(" DELETE FROM " . TABLE_PREFIX . "cyb_chatbox WHERE dateline < '".$cybcb_prunetime."' "); $db-> show_errors(); } } if (!Ccb_userExcluded($vbulletin->userinfo) AND empty($vbulletin->userinfo['infractiongroupids']) AND !$cybcb_cantpost) { $cybcb_navbarlink = " ".$vbphrase['cybcb_chatbox_full']." "; if ($vbulletin->options['cybchatbox_autoinsertlink']) { $vbulletin->templatecache['navbar'] = str_replace('vbphrase[faq] ','vbphrase[faq] $cybcb_navbarlink ',$vbulletin->templatecache['navbar']); } } }]]> misc_start options['cybchatbox_enable_product'] AND !Ccb_userExcluded($vbulletin->userinfo) AND empty($vbulletin->userinfo['infractiongroupids']) AND $cybcb_hasenoughposts) { function Ccb_buildTime($ccb_reqtime = TIMENOW) { global $vbulletin; $ccb_time = ''; if ($vbulletin->options['cybchatbox_dateformat']!='') { $ccb_time = vbdate($vbulletin->options['cybchatbox_dateformat'], $ccb_reqtime); $ccb_time .= ', '; } $ccb_time .= vbdate($vbulletin->options['cybchatbox_timeformat'], $ccb_reqtime); return $ccb_time; } function Ccb_clickableLinks($ccb_text) { $ccb_text = preg_replace("/(\r\n|\n|\r)/", "\n", $ccb_text); $ccb_lines = explode("\n", $ccb_text); for ($x = 0, $y = count($ccb_lines); $x < $y; $x++) { $ccb_line = $ccb_lines[$x]; $ccb_words = explode(' ', $ccb_line); for ($ccb_i = 0, $j = count($ccb_words); $ccb_i < $j; $ccb_i++) { $ccb_word = $ccb_words[$ccb_i]; $ccb_punctuation = '.,\'")(<> ;:'; if (substr($ccb_word, 0, 7) == 'http://' || substr($ccb_word, 0, 4) == 'www.') { $trailing = ''; $ccb_last = substr($ccb_word, -1); while (strpos($ccb_punctuation, $ccb_last) !== false) { $trailing .= $ccb_last; $ccb_word = substr($ccb_word, 0, -1); $ccb_last = substr($ccb_word, -1); } $ccb_link = $ccb_word; if (substr($ccb_link, 0, 4) == 'www.') { $ccb_link = 'http://'.$ccb_link; } $ccb_word = '[url="'.$ccb_link.'"]'.$ccb_word.'[/url]'.$trailing; } $ccb_words[$ccb_i] = $ccb_word; } $ccb_lines[$x] = implode(' ', $ccb_words); } return implode("\n", $ccb_lines); } require_once(DIR . '/includes/class_bbcode.php'); $cybcb_bbparser =& new vB_BbCodeParser($vbulletin, fetch_tag_list()); $cybcb_smilies_onoff = $vbulletin->options['cybchatbox_smilies_parse']; $cybcb_candelall = false; if (is_member_of($vbulletin->userinfo,6)) { $cybcb_candelall = true; } if (($_REQUEST['do']=='cchatbox') OR ($_REQUEST['do']=='ccarc')) { $db->hide_errors(); $cybcb_xhours = TIMENOW - ($vbulletin->options['cybchatbox_stats_lastxhours'] * 60 * 60); $cybcb_mymessage = 0; $cybcb_xhoursmessage = 0; $cybcb_get_stats = $vbulletin->db->query_read("SELECT id, userid, dateline FROM " . TABLE_PREFIX . "cyb_chatbox "); while ($cybcb_stats = $db->fetch_array($cybcb_get_stats)) { if ($cybcb_stats[userid] == $vbulletin->userinfo['userid']) { $cybcb_mymessage += 1; } if ($cybcb_stats[dateline] > $cybcb_xhours) { $cybcb_xhoursmessage += 1; } } $cybcb_totalentries = $db->num_rows($cybcb_get_stats); $cybcb_totalmessages = vb_number_format($cybcb_totalentries); $cybcb_mymessages = vb_number_format($cybcb_mymessage); $cybcb_xhoursmessages = vb_number_format($cybcb_xhoursmessage); unset($cybcb_get_stats, $cybcb_stats); $cybcb_get_topx = $vbulletin->db->query(" SELECT COUNT(id) AS ccb_msgs, cyb_chatbox.userid, user.username, user.usergroupid FROM " . TABLE_PREFIX . "cyb_chatbox AS cyb_chatbox LEFT JOIN " . TABLE_PREFIX . "user AS user ON (cyb_chatbox.userid = user.userid) WHERE cyb_chatbox.userid > 0 GROUP BY cyb_chatbox.userid ORDER BY ccb_msgs DESC LIMIT 0, ".$vbulletin->options['cybchatbox_topx_results']." "); $cybcb_topx_total = $db->num_rows($cybcb_get_topx); if ($cybcb_topx_total < $vbulletin-> options['cybchatbox_topx_results']) { $cybcb_topx_res = $cybcb_topx_total; } else { $cybcb_topx_res = $vbulletin->options['cybchatbox_topx_results']; } while ($cybcb_topposter = $db->fetch_array($cybcb_get_topx)) { $cybcb_topposternr += 1; eval('$cybcb_topchatters .= "' . fetch_template('cyb_chatbox_topchatters_bit') . '";'); } unset($cybcb_get_topx, $cybcb_topposter); if ($vbulletin->options['cybchatbox_excluded_users']!='') { $cybcb_banlist_get = explode(',',$vbulletin->options['cybchatbox_excluded_users']); foreach ($cybcb_banlist_get AS $cybcb_banlist_item) { $cybcb_banlist_userinfo = fetch_userinfo($cybcb_banlist_item); if ($cybcb_canmod) { $cybcb_banlist_usercell[] = ' '.$vbphrase['cybcb_unban'].' '.$cybcb_banlist_userinfo['musername'].' '; } else { $cybcb_banlist_usercell[] = ' '.$vbphrase['view_profile'].' '.$cybcb_banlist_userinfo['musername'].' '; } } sort($cybcb_banlist_usercell); foreach ($cybcb_banlist_usercell AS $cybcb_banlist_user) { exec_switch_bg(); $cybcb_banlist .= ' '.$cybcb_banlist_user.' '."\n"; } unset($cybcb_banlist_get, $cybcb_banlist_item, $cybcb_banlist_user); } $db->show_errors(); } if ($_REQUEST['do']=='cchatbox') { require_once('./global.php'); construct_forum_jump(); eval('$navbar = "' . fetch_template('navbar') . '";'); $db->hide_errors(); $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "session SET lastactivity = '".TIMENOW."', location = 'cchatbox' WHERE userid = " . $vbulletin->userinfo['userid']); $db->show_errors(); eval('print_output("' . fetch_template('cyb_chatbox') . '");'); } if ($_REQUEST['ccbloc']!='') { $db->hide_errors(); $cybcb_locmessid = $vbulletin->input->clean_gpc('r', 'ccbloc', TYPE_UINT); if ($cybcb_locmessid) { $cybcb_getlocpos = $vbulletin->db->query_read(" SELECT id FROM " . TABLE_PREFIX . "cyb_chatbox WHERE id >= '".$cybcb_locmessid."' "); $cybcb_findlocpos = $db->num_rows($cybcb_getlocpos); $cybcb_loctargetpage = ceil($cybcb_findlocpos / $vbulletin->options['cybchatbox_archive_perpage']); $cybcb_locredirect = 'misc.php?do=ccarc&page='.$cybcb_loctargetpage.'&cm='.$cybcb_locmessid.'#'.$cybcb_locmessid; } else { $cybcb_locredirect = 'misc.php?do=ccarc&ccbnomess=true'; } $db->show_errors(); exec_header_redirect($cybcb_locredirect); } if ($_REQUEST['ccbfind']!='') { $db->hide_errors(); if ($_REQUEST['ccbfind']=='unread') { $cybcb_lastmess_unread = $vbulletin->db->query_first(" SELECT id FROM " . TABLE_PREFIX . "cyb_chatbox WHERE dateline > '".$vbulletin->userinfo['lastvisit']."' ORDER BY dateline ASC "); $cybcb_reqmid = $cybcb_lastmess_unread['id']; } else { $cybcb_lastmessuser = $vbulletin->input->clean_gpc('r', 'ccbfind', TYPE_UINT); $cybcb_lastmess_user = $vbulletin->db->query_first(" SELECT MAX(id) AS id FROM " . TABLE_PREFIX . "cyb_chatbox WHERE userid = '".$cybcb_lastmessuser."' "); $cybcb_reqmid = $cybcb_lastmess_user['id']; } if ($cybcb_reqmid) { $cybcb_getfindpos = $vbulletin->db->query_read(" SELECT id FROM " . TABLE_PREFIX . "cyb_chatbox WHERE id >= '".$cybcb_reqmid."' "); $cybcb_findpos = $db->num_rows($cybcb_getfindpos); $cybcb_targetpage = ceil($cybcb_findpos / $vbulletin->options['cybchatbox_archive_perpage']); $cybcb_findredirect = 'misc.php?do=ccarc&page='.$cybcb_targetpage.'&cm='.$cybcb_reqmid.'#'.$cybcb_reqmid; } else { $cybcb_findredirect = 'misc.php?do=ccarc&ccbnomess=true'; } $db->show_errors(); exec_header_redirect($cybcb_findredirect); } if ($_REQUEST['do']=='ccarc') { $db->hide_errors(); $cybcb_globals = array( 'cbt' => TYPE_STR, 'cbu' => TYPE_UINT ); $vbulletin->input->clean_array_gpc('r', $cybcb_globals); $cybcb_search_value = $vbphrase['cybcb_search_chatbox']; $cybcb_targettext = htmlspecialchars($vbulletin->GPC['cbt']); if ($cybcb_targettext) { $cybcb_onlytext = "AND cyb_chatbox.message LIKE '%".$db->escape_string($cybcb_targettext)."%' "; $cybcb_search_value = $cybcb_targettext; } $cybcb_targetuser = $vbulletin->GPC['cbu']; if ($cybcb_targetuser) { $cybcb_onlyuser = "AND cyb_chatbox.userid = '".$cybcb_targetuser."' "; } $cybcb_get_msg_nav = $vbulletin->db->query_read(" SELECT cyb_chatbox.id, cyb_chatbox.message FROM ".TABLE_PREFIX."cyb_chatbox AS cyb_chatbox WHERE cyb_chatbox.message !='' $cybcb_onlytext $cybcb_onlyuser "); $cybcb_totalnav = $db->num_rows($cybcb_get_msg_nav); $navbits = array('misc.php?do=ccarc' . $vbulletin->session->vars['sessionurl_q'] => $vbphrase['cybcb_chatbox']); $perpage = $vbulletin->input->clean_gpc('r', 'perpage', TYPE_UINT); $pagenumber = $vbulletin->input->clean_gpc('r', 'pagenumber', TYPE_UINT); sanitize_pageresults($cybcb_totalnav, $pagenumber, $perpage, 40, $vbulletin->options['cybchatbox_archive_perpage']); $limitlower = ($pagenumber - 1) * $perpage + 1; if ($limitlower <= 0) { $limitlower = 1; } $cybcb_get_msg_arc = $vbulletin-> db->query_read(" SELECT cyb_chatbox.id, cyb_chatbox.userid, cyb_chatbox.userip, cyb_chatbox.message, cyb_chatbox.dateline, cyb_chatbox.textprop, user.username, user.usergroupid, user.displaygroupid FROM ".TABLE_PREFIX."cyb_chatbox AS cyb_chatbox LEFT JOIN ".TABLE_PREFIX."user AS user ON (user.userid = cyb_chatbox.userid) WHERE cyb_chatbox.message !='' $cybcb_onlytext $cybcb_onlyuser $cybcb_onlymessage ORDER BY cyb_chatbox.dateline DESC LIMIT " . ($limitlower - 1) . "," . $perpage . " "); while ($cybcb_msg_arc = $db->fetch_array($cybcb_get_msg_arc)) { exec_switch_bg(); $cybcb_msg_arc_staff = false; if (is_member_of($cybcb_msg_arc, split(',', '5,6,7'))) { $cybcb_msg_arc_staff = true; } $cybcb_msg_arc_id = $cybcb_msg_arc['id']; $cybcb_msg_arc['message'] = htmlspecialchars_uni($cybcb_msg_arc['message']); $cybcb_msg_arc['musername'] = fetch_musername($cybcb_msg_arc); $cybcb_msg_arc_banned = false; eval('$cybcb_bannedusers = in_array($cybcb_msg_arc[userid], array(' . $vbulletin->options['cybchatbox_excluded_users'] . '));'); if (in_array($cybcb_msg_arc[userid], array($cybcb_bannedusers))) { $cybcb_msg_arc_banned = true; } $cybcb_msg_arc['time'] = Ccb_buildTime($cybcb_msg_arc['dateline']); if ($cybcb_msg_arc['dateline']>$vbulletin->userinfo['lastvisit']) { $cybcb_msg_arc_icon = ' options['cybchatbox_icon_new'].'" alt="'.$vbphrase['new'].'" border="0" /> '; } else { $cybcb_msg_arc_icon = ' options['cybchatbox_icon_old'].'" border="0" /> '; } $cybcb_arc_coloropen = ''; $cybcb_arc_colorclose = ''; $cybcb_arc_boldopen = ''; $cybcb_arc_boldclose = ''; $cybcb_arc_italicopen = ''; $cybcb_arc_italicclose = ''; $cybcb_arc_underlineopen = ''; $cybcb_arc_underlineclose = ''; $cybcb_msg_arc['textprop'] = unserialize($cybcb_msg_arc['textprop']); if ($cybcb_msg_arc['textprop']['color']) { $cybcb_arc_coloropen = '[color='.$cybcb_msg_arc['textprop']['color'].']'; $cybcb_arc_colorclose = '[/color]'; } if ($cybcb_msg_arc['textprop']['bold']) { $cybcb_arc_boldopen = '[b]'; $cybcb_arc_boldclose = '[/b]'; } if ($cybcb_msg_arc['textprop']['italic']) { $cybcb_arc_italicopen = '[i]'; $cybcb_arc_italicclose = '[/i]'; } if ($cybcb_msg_arc['textprop']['underline']) { $cybcb_arc_underlineopen = '[u]'; $cybcb_arc_underlineclose = '[/u]'; } if ($vbulletin->options['cybchatbox_clickable_links']) { $cybcb_msg_arc_tow = Ccb_clickableLinks($cybcb_msg_arc['message']); } else { $cybcb_msg_arc_tow = $cybcb_msg_arc['message']; } $cybcb_msg_arc_styled = $cybcb_arc_coloropen.$cybcb_arc_boldopen.$cybcb_arc_italicopen.$cybcb_arc_underlineopen.$cybcb_msg_arc_tow.$cybcb_arc_underlineclose.$cybcb_arc_italicclose.$cybcb_arc_boldclose.$cybcb_arc_colorclose; $cybcb_msg_arc_parsed = str_replace('\'', ''', $cybcb_bbparser->do_parse($cybcb_msg_arc_styled,1,$cybcb_smilies_onoff,1,1,1)); eval('$cybcb_msgs_arc .= "' . fetch_template('cyb_chatbox_archive_bit') . '";'); } unset($cybcb_get_msg_arc, $cybcb_msg_arc); $pagenav = construct_page_nav($pagenumber, $perpage, $cybcb_totalnav, 'misc.php?' . $vbulletin->session->vars['sessionurl'] . 'do=ccarc' . (!empty($vbulletin->GPC['perpage']) ? "&pp=$perpage" : "") . (!empty($cybcb_targetuser) ? "&cbu=$cybcb_targetuser" : "") . (!empty($cybcb_targettext) ? "&cbt=$cybcb_targettext" : "") ); if ($cybcb_canmod) { $cybcb_archivecolspan = 'colspan="5"'; } else { $cybcb_archivecolspan = 'colspan="4"'; } construct_forum_jump(); $navbits = construct_navbits($navbits); eval('$navbar = "' . fetch_template('navbar') . '";'); $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "session SET lastactivity = '".TIMENOW."', location = 'ccarc' WHERE userid = " . $vbulletin->userinfo['userid']); $db->show_errors(); eval('print_output("' . fetch_template('cyb_chatbox') . '");'); } if (($_REQUEST['show']=='ccbusers') AND (THIS_SCRIPT=='misc')) { $db->hide_errors(); $cybcb_viewers_timecut = TIMENOW - ($vbulletin->options['cybchatbox_viewers_timecut'] * 60); $cybcb_viewers_reg = 0; $cybcb_viewers_unreg = 0; $cybcb_getviewers = $vbulletin->db->query_read(" SELECT session.lastactivity, session.userid, session.location, session.host, user.username, user.usergroupid, user.displaygroupid, IF(user.options & " . $vbulletin->bf_misc_useroptions['invisible'] . ", 1, 0) AS invisible FROM " . TABLE_PREFIX . "session AS session LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = session.userid) WHERE session.lastactivity > $cybcb_viewers_timecut AND session.location LIKE '%cchatbox%' OR session.location LIKE '%ccarc%' GROUP BY session.userid ORDER BY user.username ASC "); $db->show_errors(); while ($cybcb_viewer = $db->fetch_array($cybcb_getviewers)) { $cybcb_markinv = ''; $cybcb_viewer_visible = true; if ($cybcb_viewer[invisible]) { $cybcb_viewer_visible = false; if (($vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canseehidden']) OR $cybcb_viewer['userid'] == $vbulletin->userinfo['userid']) { $cybcb_markinv = '*'; $cybcb_viewer_visible = true; } } if ($cybcb_viewer[userid]!=0) { $cybcb_viewers_reg += 1; $cybcb_viewer_username = fetch_musername($cybcb_viewer); $cybcb_viewer_lastact = vbdate('d-m, H:i', $cybcb_viewer[lastactivity]); if ($cybcb_viewer_visible) { $cybcb_viewer_item .= ', '.$cybcb_viewer_username.' '.$cybcb_markinv; } else { $cybcb_viewer_item .= ', '.$vbphrase['cybcb_invisible']; } } else { $cybcb_viewers_unreg += 1; } } $cybcb_viewers_total = $cybcb_viewers_reg + $cybcb_viewers_unreg; $cybcb_viewers_list = substr($cybcb_viewer_item, 2); unset($cybcb_getviewers, $cybcb_viewer); echo (' '.construct_phrase($vbphrase['cybcb_active_users_x'], $vbulletin->options['cybchatbox_viewers_timecut'], $cybcb_viewers_total, $cybcb_viewers_reg, $cybcb_viewers_unreg).' ' . iif($cybcb_viewers_list,' '.$cybcb_viewers_list.' ','')); exit; } if ($_REQUEST['show']=='ccbmessages') { $stylevar[codeblockwidth] = $vbulletin->options['cybchatbox_code_maxwidth'].'px'; $db->hide_errors(); $cybcb_get_msg_box = $vbulletin->db->query_read(" SELECT cyb_chatbox.id, cyb_chatbox.userid, cyb_chatbox.message, cyb_chatbox.dateline, cyb_chatbox.textprop, user.username, user.usergroupid, user.displaygroupid FROM ".TABLE_PREFIX."cyb_chatbox AS cyb_chatbox LEFT JOIN ".TABLE_PREFIX."user AS user ON (user.userid = cyb_chatbox.userid) ORDER BY cyb_chatbox.dateline DESC LIMIT 0, " . $vbulletin->options['cybchatbox_messages_main'] . " "); $db->show_errors(); $cybcb_box_totalmessages = $db->num_rows($cybcb_get_msg_box); while ($cybcb_msg_box = $db->fetch_array($cybcb_get_msg_box)) { $cybcb_msg_box_id = $cybcb_msg_box['id']; $cybcb_msg_box['message'] = htmlspecialchars_uni($cybcb_msg_box['message']); if ($vbulletin->options['cybchatbox_clickable_links']) { $cybcb_msg_box['message'] = Ccb_clickableLinks($cybcb_msg_box['message']); } $cybcb_msg_box['musername'] = fetch_musername($cybcb_msg_box); $cybcb_msg_box_banned = false; eval('$cybcb_bannedusers = in_array($cybcb_msg_box[userid], array(' . $vbulletin->options['cybchatbox_excluded_users'] . '));'); if (in_array($cybcb_msg_box[userid], array($cybcb_bannedusers))) { $cybcb_msg_box_banned = true; } $cybcb_msg_box['time'] = Ccb_buildTime($cybcb_msg_box['dateline']); if ($cybcb_msg_box['dateline']>$vbulletin->userinfo['lastvisit']) { $cybcb_msg_box_icon = ' options['cybchatbox_icon_new'].'" alt="'.$vbphrase['new'].'" border="0" /> '; } else { $cybcb_msg_box_icon = ' options['cybchatbox_icon_old'].'" border="0" /> '; } $cybcb_box_coloropen = ''; $cybcb_box_colorclose = ''; $cybcb_box_boldopen = ''; $cybcb_box_boldclose = ''; $cybcb_box_italicopen = ''; $cybcb_box_italicclose = ''; $cybcb_box_underlineopen = ''; $cybcb_box_underlineclose = ''; $cybcb_msg_box['textprop'] = unserialize($cybcb_msg_box['textprop']); if ($cybcb_msg_box['textprop']['color']) { $cybcb_box_coloropen = '[color='.$cybcb_msg_box['textprop']['color'].']'; $cybcb_box_colorclose = '[/color]'; } if ($cybcb_msg_box['textprop']['bold']) { $cybcb_box_boldopen = '[b]'; $cybcb_box_boldclose = '[/b]'; } if ($cybcb_msg_box['textprop']['italic']) { $cybcb_box_italicopen = '[i]'; $cybcb_box_italicclose = '[/i]'; } if ($cybcb_msg_box['textprop']['underline']) { $cybcb_box_underlineopen = '[u]'; $cybcb_box_underlineclose = '[/u]'; } $cybcb_msg_box_styled = $cybcb_box_coloropen.$cybcb_box_boldopen.$cybcb_box_italicopen.$cybcb_box_underlineopen.$cybcb_msg_box['message'].$cybcb_box_underlineclose.$cybcb_box_italicclose.$cybcb_box_boldclose.$cybcb_box_colorclose; $cybcb_msg_box_parsed = str_replace('\'', ''', $cybcb_bbparser->do_parse($cybcb_msg_box_styled,1,$cybcb_smilies_onoff,1,1,1)); if ($vbulletin->options['cybchatbox_reverse_messages']) { eval('$cybcb_msgs_box[] .= "' . fetch_template('cyb_chatbox_bit') . '";'); } else { eval('$cybcb_msgs_box .= "' . fetch_template('cyb_chatbox_bit') . '";'); } } if ($vbulletin->options['cybchatbox_reverse_messages']) { if (!empty($cybcb_msgs_box)) { $cybcb_msgs_box_rev = array_reverse($cybcb_msgs_box); foreach ($cybcb_msgs_box_rev as $cybcb_msg_box_rev) { $cybcb_msgs_box_final .= $cybcb_msg_box_rev; } } else { $cybcb_msgs_box_final = ''; } } else { $cybcb_msgs_box_final = $cybcb_msgs_box; } unset($cybcb_get_msg_box, $cybcb_msg_box); if ($cybcb_box_totalmessages>0) { echo ($cybcb_msgs_box_final); } else { echo (' '.$vbphrase['cybcb_no_messages'].' '); } exit; } if ($_REQUEST['show']=='ccbsmilies') { if ($vbulletin->options['cybchatbox_smiliestotal']>1) { $cybcb_fsmilies_limit = "LIMIT 0, ".$vbulletin->options['cybchatbox_smiliestotal'].""; } $db->hide_errors(); $cybcb_get_fsmilies = $vbulletin->db->query_read_slave(" SELECT smilieid, smilietext, smiliepath, smilie.title, imagecategory.title AS category FROM " . TABLE_PREFIX . "smilie AS smilie LEFT JOIN " . TABLE_PREFIX . "imagecategory AS imagecategory USING(imagecategoryid) ORDER BY imagecategory.displayorder, imagecategory.title, smilie.displayorder $cybcb_fsmilies_limit "); $cybcb_fsmilies_total = $vbulletin->db->num_rows($cybcb_get_fsmilies); $vbulletin->db->data_seek($cybcb_get_fsmilies, 0); $cybcb_i = 0; $cybcb_fsmilie_bit = array(); while ($cybcb_fsmilie = $vbulletin->db->fetch_array($cybcb_get_fsmilies) AND ($cybcb_i++ < $cybcb_fsmilies_total)) { $cybcb_fsid += 1; if ($cybcb_fsid > $vbulletin->options['cybchatbox_smiliesinit']) { $cybcb_fsmilie_id += 1; exec_switch_bg(); $cybcb_fsmilie_html = ' '.$cybcb_fsmilie['title'].' '; $cybcb_fsmilie_bit[] = ' '.$cybcb_fsmilie_html.' '; if (sizeof($cybcb_fsmilie_bit) == $vbulletin->options['cybchatbox_smiliesperrow']) { $cybcb_fsmilie_cell = implode('', $cybcb_fsmilie_bit); $cybcb_fsmilie_bits .= ' '.$cybcb_fsmilie_cell.' '; $cybcb_fsmilie_bit = array(); } } } $cybcb_fsmilies_remaining = sizeof($cybcb_fsmilie_bit); if ($cybcb_fsmilies_remaining > 0) { $cybcb_fsmilies_colrem = $vbulletin->options['cybchatbox_smiliesperrow'] - $cybcb_fsmilies_remaining; $cybcb_fsmilie_bit[] = '   '; $cybcb_fsmilie_cell = implode('', $cybcb_fsmilie_bit); $cybcb_fsmilie_bits .= ' '.$cybcb_fsmilie_cell.' '; } $db->show_errors(); $cybcb_fsmilies = ' '.$cybcb_fsmilie_bits.'
'; unset($cybcb_get_fsmilies, $cybcb_fsmilie); echo ($cybcb_fsmilies); exit; } if ($_POST['do'] == 'cb_postnew') { $vbulletin->input->clean_array_gpc('p', array( 'ccb_newmessage' => TYPE_STR, 'color' => TYPE_NOHTML, 'fontWeight' => TYPE_NOHTML, 'fontStyle' => TYPE_NOHTML, 'textDecoration' => TYPE_NOHTML) ); if (!empty($vbulletin->GPC['ccb_newmessage']) && $vbulletin->userinfo['userid'] > 0 && !Ccb_userExcluded($vbulletin->userinfo) AND empty($vbulletin->userinfo['infractiongroupids'])) { $cybcb_messageinfo = addslashes(serialize(array( 'color' => addslashes(convert_urlencoded_unicode($vbulletin->GPC['color'])), 'bold' => addslashes(convert_urlencoded_unicode($vbulletin->GPC['fontWeight'])), 'italic' => addslashes(convert_urlencoded_unicode($vbulletin->GPC['fontStyle'])), 'underline' => addslashes(convert_urlencoded_unicode($vbulletin->GPC['textDecoration'])) ))); $vbulletin->GPC['ccb_newmessage'] = convert_urlencoded_unicode($vbulletin->GPC['ccb_newmessage']); $cybcb_checkme = strpos($vbulletin->GPC['ccb_newmessage'], '/me '); if ($cybcb_checkme !== false) { $vbulletin->GPC['ccb_newmessage'] = str_replace('/me ', $vbulletin->userinfo['username'].' ', $vbulletin->GPC['ccb_newmessage']); $vbulletin->GPC['ccb_newmessage'] = '[color='.$vbulletin->options['cybchatbox_mecolor'].']* '.$vbulletin->GPC['ccb_newmessage'].'[/color]'; } if ($vbulletin->options['cybchatbox_banned_tags']!='') { $cybchatbox_banned_tags = str_replace(" ","",$vbulletin->options['cybchatbox_banned_tags']); $cybcb_banned_tags = explode(',',$cybchatbox_banned_tags); foreach ($cybcb_banned_tags AS $cybcb_banned_tag) { $cybcb_bannedtags .= ',['.$cybcb_banned_tag.']'; $cybcb_bannedtags .= ',[/'.$cybcb_banned_tag.']'; } $cybcb_bannedtagsu = strtoupper($cybcb_bannedtags); $cybcb_bannedtagspf = substr($cybcb_bannedtags.$cybcb_bannedtagsu, 1); $cybcb_bannedtagsf = explode(',',$cybcb_bannedtagspf); $vbulletin->GPC['ccb_newmessage'] = str_replace($cybcb_bannedtagsf, '', $vbulletin->GPC['ccb_newmessage']); } $db->hide_errors(); $vbulletin->db->query_write(" INSERT INTO ".TABLE_PREFIX."cyb_chatbox (userid, userip, message, dateline, textprop) VALUES ('".$vbulletin->userinfo['userid']."', '".$_SERVER['REMOTE_ADDR']."', '".addslashes($vbulletin->GPC['ccb_newmessage'])."', ".TIMENOW.", '".$cybcb_messageinfo."') "); $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "session SET lastactivity = '".TIMENOW."', location = 'cchatbox' WHERE userid = " . $vbulletin->userinfo['userid']); $db->show_errors(); } exit; } if ($_POST['do'] == 'cybcb_editmessage') { $vbulletin->input->clean_array_gpc('p', array( 'id' => TYPE_UINT, 'ccb_editmessage' => TYPE_STR) ); $db->hide_errors(); $cybcb_getmessageinfo = $vbulletin->db->query_first("SELECT id, userid from " . TABLE_PREFIX . "cyb_chatbox WHERE id = '".$vbulletin->GPC['id']."' "); if ($cybcb_getmessageinfo['userid'] != $vbulletin->userinfo['userid'] && !$cybcb_canmod) { echo $vbulletin->GPC['ccb_editmessage']; exit; } $vbulletin->GPC['ccb_editmessage'] = convert_urlencoded_unicode($vbulletin->GPC['ccb_editmessage']); if ($vbulletin->options['cybchatbox_banned_tags']!='') { $cybchatbox_banned_tags = str_replace(" ","",$vbulletin->options['cybchatbox_banned_tags']); $cybcb_banned_tags = explode(',',$cybchatbox_banned_tags); foreach ($cybcb_banned_tags AS $cybcb_banned_tag) { $cybcb_bannedtags .= ',['.$cybcb_banned_tag.']'; $cybcb_bannedtags .= ',[/'.$cybcb_banned_tag.']'; } $cybcb_bannedtagsu = strtoupper($cybcb_bannedtags); $cybcb_bannedtagspf = substr($cybcb_bannedtags.$cybcb_bannedtagsu, 1); $cybcb_bannedtagsf = explode(',',$cybcb_bannedtagspf); $vbulletin->GPC['ccb_editmessage'] = str_replace($cybcb_bannedtagsf, '', $vbulletin->GPC['ccb_editmessage']); } $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "cyb_chatbox SET message = '".addslashes($vbulletin->GPC['ccb_editmessage'])."' WHERE id = '".$cybcb_getmessageinfo['id']."' "); $cybcb_edit_coloropen = ''; $cybcb_edit_colorclose = ''; $cybcb_edit_boldopen = ''; $cybcb_edit_boldclose = ''; $cybcb_edit_italicopen = ''; $cybcb_edit_italicclose = ''; $cybcb_edit_underlineopen = ''; $cybcb_edit_underlineclose = ''; $cybcb_msg_edit = $vbulletin->db->query_first("SELECT id, message, textprop FROM " . TABLE_PREFIX . "cyb_chatbox WHERE id = '".$vbulletin->GPC['id']."' "); $db->show_errors(); $cybcb_msg_edit['message'] = htmlspecialchars_uni($cybcb_msg_edit['message']); $cybcb_msg_edit['textprop'] = unserialize($cybcb_msg_edit['textprop']); if ($cybcb_msg_edit['textprop']['color']) { $cybcb_edit_coloropen = '[color='.$cybcb_msg_edit['textprop']['color'].']'; $cybcb_edit_colorclose = '[/color]'; } if ($cybcb_msg_edit['textprop']['bold']) { $cybcb_edit_boldopen = '[b]'; $cybcb_edit_boldclose = '[/b]'; } if ($cybcb_msg_edit['textprop']['italic']) { $cybcb_edit_italicopen = '[i]'; $cybcb_edit_italicclose = '[/i]'; } if ($cybcb_msg_edit['textprop']['underline']) { $cybcb_edit_underlineopen = '[u]'; $cybcb_edit_underlineclose = '[/u]'; } if ($vbulletin->options['cybchatbox_clickable_links']) { $cybcb_msg_edit_tow = Ccb_clickableLinks($cybcb_msg_edit['message']); } else { $cybcb_msg_edit_tow = $cybcb_msg_edit['message']; } $cybcb_msg_edit_styled = $cybcb_edit_coloropen.$cybcb_edit_boldopen.$cybcb_edit_italicopen.$cybcb_edit_underlineopen.$cybcb_msg_edit_tow.$cybcb_edit_underlineclose.$cybcb_edit_italicclose.$cybcb_edit_boldclose.$cybcb_edit_colorclose; $cybcb_msg_edit_parsed = str_replace('\'', ''', $cybcb_bbparser->do_parse($cybcb_msg_edit_styled,1,$cybcb_smilies_onoff,1,1,1)); unset($cybcb_msg_edit); echo $cybcb_msg_edit_parsed; exit; } if (($_REQUEST['do'] == 'cybcb_multidel') AND $cybcb_canmod) { $db->hide_errors(); $vbulletin->input->clean_gpc('r', 'cbdel', TYPE_ARRAY); if ($vbulletin->GPC['cbdel']!='') { $cybcb_delids = implode(',', $vbulletin->GPC['cbdel']); if ($cybcb_delids) { $vbulletin->db->query_write(" DELETE FROM " . TABLE_PREFIX . "cyb_chatbox WHERE id IN($cybcb_delids) "); } } $db->show_errors(); exec_header_redirect('misc.php?do=ccarc'); } if (($_REQUEST['do']=='cybcb_delall') AND $cybcb_candelall) { $db->hide_errors(); $vbulletin->db->query_write("TRUNCATE TABLE " . TABLE_PREFIX . "cyb_chatbox"); $db->show_errors(); if ($_SERVER['HTTP_REFERER']) { $cybcb_redto = $_SERVER['HTTP_REFERER']; } else { $cybcb_redto = 'misc.php?do=cchatbox'; } exec_header_redirect($cybcb_redto); } if (($_REQUEST['do']=='ccb_banuser') AND $cybcb_canmod) { $db->hide_errors(); $cybcb_usertoban = $vbulletin->input->clean_gpc('r', 'u', TYPE_UINT); $cybcb_banuser = $vbulletin->options['cybchatbox_excluded_users'].','.$cybcb_usertoban; $cybcb_banuser = str_replace(',,',',',$cybcb_banuser); $cybcb_banuser = trim($cybcb_banuser, ','); $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "setting SET value = '".$cybcb_banuser."' WHERE varname = 'cybchatbox_excluded_users' "); $db->show_errors(); require_once(DIR . '/includes/adminfunctions.php'); build_options(); exec_header_redirect('misc.php?do=ccarc'); } if (($_REQUEST['do']=='ccb_unbanuser') AND $cybcb_canmod) { $db->hide_errors(); $cybcb_usertounban = $vbulletin->input->clean_gpc('r', 'u', TYPE_UINT); $cybcb_unbanuser = str_replace($cybcb_usertounban,'',$vbulletin->options['cybchatbox_excluded_users']); $cybcb_unbanuser = str_replace(',,',',',$cybcb_unbanuser); $cybcb_unbanuser = trim($cybcb_unbanuser, ','); $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "setting SET value = '".$cybcb_unbanuser."' WHERE varname = 'cybchatbox_excluded_users' "); $db->show_errors(); require_once(DIR . '/includes/adminfunctions.php'); build_options(); exec_header_redirect('misc.php?do=ccarc'); } if (($_REQUEST['do']=='ccb_deluser') AND $cybcb_canmod) { $db->hide_errors(); $cybcb_usertodel = $vbulletin->input->clean_gpc('r', 'u', TYPE_UINT); $vbulletin->db->query_write(" DELETE FROM " . TABLE_PREFIX . "cyb_chatbox WHERE userid = '".$cybcb_usertodel."' "); $db->show_errors(); exec_header_redirect('misc.php?do=ccarc'); } if ($_REQUEST['do']=='ccb_delmess') { $db->hide_errors(); $cybcb_messtodel = $vbulletin->input->clean_gpc('r', 'm', TYPE_UINT); $cybcb_getmessinfo = $vbulletin->db->query_first("SELECT id, userid from " . TABLE_PREFIX . "cyb_chatbox WHERE id = '".$cybcb_messtodel."' "); if ((($cybcb_getmessinfo['userid']==$vbulletin->userinfo['userid']) AND $vbulletin->options['cybchatbox_users_candelete']) OR $cybcb_canmod) { $vbulletin->db->query_write(" DELETE FROM " . TABLE_PREFIX . "cyb_chatbox WHERE id = '".$cybcb_messtodel."' "); } $db->show_errors(); exec_header_redirect('misc.php?do=ccarc'); } }]]>
online_location_unknown options['bburl'].'/misc.php?'.$vbulletin->session->vars['sessionurl'].'do=cchatbox">'.$vbphrase['cybcb_chatbox'].' '; } if ($cybcb_checkactarc !== false) { $handled = true; $userinfo['action'] = $vbphrase['cybcb_viewing_archive']; $userinfo['where'] = ' options['bburl'].'/misc.php?'.$vbulletin->session->vars['sessionurl'].'do=ccarc">'.$vbphrase['cybcb_archive'].' '; }]]> Click here to view all messages]]>
Note: Don’t set this value too low because of server load / default 10]]>

Note: Don’t set this value too low because of server load / default 30]]>

Blank to show on all pages (not recommended because of server load)]]>
ChatBox note bellow main box]]>

Note: When user is banned via menu in ChatBox Archive this field will be automatically updated]]>
boolean yesno 1 free 1 number 30 number 25 boolean yesno 0 number 10 boolean yesno 0 number 255 number 10 number 30 free index free 1 number 100 number 400 number 450 free free number yesno 0 free free free Red free number yesno 1 number 1 number 10 free 5 number 30 boolean yesno 1 boolean yesno 1 textarea free 8 free 1,8 textarea number 0 free 5,6,7 boolean yesno 1 free number 5 number 12 number 10 free boolean yesno 0 boolean yesno 1