Thread: Chat Modifications - Cyb - ChatBox
View Single Post
  #357  
Old 07-19-2008, 03:15 PM
vip-q.com's Avatar
vip-q.com vip-q.com is offline
 
Join Date: Oct 2006
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Cybernetec
i have the same prob. that kotlt99 have it ..
Quote:
have set the minimum post requirement to see the chat box to 60.
But some of members with post lower than 60
plz look for that .


For up and down like:

i replace this template cyb_chatbox with the following
HTML Code:
capy the source of http://qtify.com/vb/misc/cyb_chatbox.txt
and i set :
Message listing area height (ChatBox) : 150
Message listing area height (ChatBox Full) : 450

and i replace this plugin Cyb - ChatBox - IL with the following
PHP Code:
if ($vbulletin->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_exc1iif($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->userinfosplit(','$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->userinfosplit(','$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_smilies0);
                    
$cybcb_i 0;
                    
$cybcb_smilie_bit = array();
                    while (
$cybcb_smilie $vbulletin->db->fetch_array($cybcb_get_smilies) AND ($cybcb_i++ < $cybcb_smilies_total))
                    {
                        
$cybcb_smilie_id += 1;
                        
exec_switch_bg();

                        if (
$cybcb_smilie_id==1)
                        {
                            
$cybcb_smilie_first $cybcb_smilie['smiliepath'];
                        }

                        
$cybcb_smilie_html '<a style="display:block;margin:2px;overflow:hidden;width:'.$vbulletin->options['cybchatbox_smiliesclip'].'px;height:'.$vbulletin->options['cybchatbox_smiliesclip'].'px;" href="javascript:void(0);" onclick="return Ccb_insertSmilie(\''.str_replace("'""\'"$cybcb_smilie['smilietext']).'\')"><img onmouseover="return Ccb_updateSmiliePreview(this.src);" src="'.$cybcb_smilie['smiliepath'].'" alt="'.$cybcb_smilie['title'].'" border="0" /></a>';
                        
$cybcb_smilie_bit[] = '<td class="'.$bgclass.'">'.$cybcb_smilie_html.'</td>';
                        if (
sizeof($cybcb_smilie_bit) == $vbulletin->options['cybchatbox_smiliesperrow'])
                        {
                            
$cybcb_smilie_cell implode(''$cybcb_smilie_bit);
                            
$cybcb_smilie_bits .= '<tr align="center">'.$cybcb_smilie_cell.'</tr>';
                            
$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[] = '<td colspan="'.$cybcb_smilies_colrem.'">&nbsp;</td>';
                        
$cybcb_smilie_cell implode(''$cybcb_smilie_bit);
                        
$cybcb_smilie_bits .= '<tr align="center" valign="bottom">'.$cybcb_smilie_cell.'</tr>';
                    }
                    
$db->show_errors();
                    unset(
$cybcb_get_smilies$cybcb_smilie);
                    
$cybcb_smilies_init '<table cellpadding="2" cellspacing="0" border="0" align="center">'.$cybcb_smilie_bits.'</table>';
                }

                if (
$_REQUEST['do']!='cchatbox')
                {
                    
$cybcb_height_messarea $vbulletin->options['cybchatbox_height'].'px';
                    
$cybcb_height_input = ($vbulletin->options['cybchatbox_height']-100).'px';
                    
$cybcb_height_smblock = ($cybcb_height_input-12).'px';
                }
                else
                {
                    
$cybcb_height_messarea $vbulletin->options['cybchatbox_height_full'].'px';
                    
$cybcb_height_input = ($vbulletin->options['cybchatbox_height_full']-400).'px';
                    
$cybcb_height_smblock = ($cybcb_height_input-12).'px';
                }
                
$cybcb_height_input_wstatus = ($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 .= '<option style="background-color:'.$cybcb_color.';color:'.$cybcb_color.';" value="'.$cybcb_color.'">&nbsp;</option>'."\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 .= " <option value=\"'.$cybcb_size.'\" " . iif($cybcb_textsize==$cybcb_size," selected=\"selected\"","").">'.$cybcb_size.'px</option> "."\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 <br />';
                    }
                    if ((
THIS_SCRIPT!='misc') AND ($vbulletin->options['cybchatbox_page_loc']==2))
                    {
                        
$vbulletin->templatecache['footer'] = '<br /> $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 "<a href=\"misc.php?do=cchatbox\">".$vbphrase['cybcb_chatbox_full']."</a>";

                if (
$vbulletin->options['cybchatbox_autoinsertlink'])
                {
                    
$vbulletin->templatecache['navbar'] = str_replace('vbphrase[faq]</a></td>','vbphrase[faq]</a></td><td class=\"vbmenu_control\">$cybcb_navbarlink</td>',$vbulletin->templatecache['navbar']);
                }
            }
        } 
this is what i do , not professional but it is done ..


Cybernetec ,
may you add this features in next version ,
Users with post count less than X can not post messages
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01239 seconds
  • Memory Usage 1,978KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete