View Single Post
  #603  
Old 10-04-2005, 09:16 PM
mtha's Avatar
mtha mtha is offline
 
Join Date: Jul 2002
Location: US
Posts: 775
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ZT,

The shoutbox is great, but I want to make it a seperate page rather than using forums for it (Hope you dont mind me posting here)

so, I just take the action part and put it into vbshout.php?do=chat

Standalone chat: (just add before

// ---------------------------------------------------
// Start Page Output
// ---------------------------------------------------


PHP Code:
// ---------------------------------------------------
// AJAX Standalone Chat
// ---------------------------------------------------

if ($_GET['do'] == 'chat')
{
    
$navbits     = array("vbshout.php?" $vbulletin->session->vars['sessionurl'] . "do=chat" => 'Chat');
    
$navbits[""] = 'Shoutbox - Chat Area';

$Used    0;
$UsedArr = array();
$smilies $db->query_read("
        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, smilie.displayorder
    "
);
$Smilie_Build  '';
$Total_Smilies $db->num_rows($smilies);

if (
$Total_Smilies 0)
{
    while (
$emo $db->fetch_array($smilies))
    {
        if (
$vbulletin->options['shout_smilies_show'] > 0)
        {
            
$Smilie_Cache[] = $emo;
        }
        else
        {
            
$Smilie_Build .= '<a href="#" onclick="return sb_Smilie(\''.$emo['smilietext'].'\')">[img]https://vborg.vbsupport.ru/[/img] ';
        }
    }

    if (
$vbulletin->options['shout_smilies_show'] > $Total_Smilies)
    {
        
$vbulletin->options['shout_smilies_show'] = $Total_Smilies;
    }

    if (
$vbulletin->options['shout_smilies_show'] > 0)
    {
        while (
$Used $vbulletin->options['shout_smilies_show'])
        {
            
$GetEmo $Total_Smilies;
            
$GetEmo rand(0$GetEmo);

            if (!
in_array($GetEmo$UsedArr) && $Smilie_Cache[$GetEmo])
            {
                
$Used++;
                
$GetEmo $Smilie_Cache[$GetEmo];
                
$Smilie_Build .= '<a href="#" onclick="return sb_Smilie(\''.$GetEmo['smilietext'].'\')">[img]https://vborg.vbsupport.ru/[/img] ';
            }
        }
    }
}
else
{
    
$Smilie_Build 'No Emoticons Available';
}

$Options_DropDown         = array(); // Items included will be parsed to create drop down menus
$DropDowns                = array(); // Completed constructed drop down menus

$Options_DropDown['font_selector']    = array('Default''Arial''Arial Black''Arial Narrow''Book Antiqua''Century Gothic''Comic Sans MS''Courier New''Fixedsys''Franklin Gothic Medium''Garamond''Georgia''Impact''Lucida Console''Lucida Sans Unicode''Microsoft Sans Serif''Palatino Linotype''System''Tahoma''Times New Roman''Trebuchet MS''Verdana');
$Options_DropDown['color_selector']   = array();
$Options_DropDown['color_selector'][] = 'Default';

$hex   = array();
$hex[] = '0';
$hex[] = '3';
$hex[] = '6';
$hex[] = '9';
$hex[] = 'C';
$hex[] = 'F';

for (
$a 0$a 6$a++)
{
    for (
$b 0$b 6$b++)
    {
        for (
$c 0$c 6$c++)
        {
            
$Options_DropDown['color_selector'][] = '#' $hex[$a].$hex[$a].$hex[$b].$hex[$b].$hex[$c].$hex[$c];
        }
    }
}

if (
is_array($Options_DropDown))
{
    foreach (
$Options_DropDown as $Menu => $Options)
    {
        
$DropDowns[$Menu] = '';
        if (
is_array($Options))
        {
            foreach (
$Options as $Selection)
            {
                if (
preg_match("#^\#([a-z0-9]+)$#i"$Selection))
                {
                    
$Extra ' style="color:'.$Selection.';"';
                }
                else
                {
                    
$Extra '';
                }

                if (
$Selection == 'Default')
                {
                    
$Text = (($Menu == 'color_selector') ? 'Color' 'Font Face') . ' [Default]';
                }
                else
                {
                    
$Text $Selection;
                }

                
$DropDowns[$Menu] .= '<option value="'.$Selection.'"'.$Extra.'>'.$Text.'' "\n";
            }
        }
    }
}

if (
$vbulletin->options['shout_banned_perms'] == && isBanned($vbulletin->userinfo))
{
    
print_no_permission();
}
else
{
    eval(
'$Shoutbox = "' fetch_template('forumhome_vbshout') . '";');
}

    
$pagenav construct_page_nav($page$perpage$TS_D'vbshout.php?' $vbulletin->session->vars['sessionurl'] . 'do=chat'''
        
. (!empty($vbulletin->GPC['perpage']) ? "&pp=$perpage"")
    );
    
$HTML $Shoutbox;
}
// ---------------------------------------------------
// AJAX Standalone Chat
// --------------------------------------------------- 

You may also want to add

'chat' => array('GENERIC_SHELL',
'forumhome_vbshout',
),

to the action templates if you use it
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01420 seconds
  • Memory Usage 1,867KB
  • 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_php
  • (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