Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 06-29-2006, 05:32 AM
SiriusBlack22 SiriusBlack22 is offline
 
Join Date: Jun 2006
Location: Florida
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default vB Shout in one forum

I asked a guy on a forum that has it working in one forum and he said:

Quote:
For the shoutbox, all you need to do is add the html code to the forumdisplay template and wrap the code with a template conditional that will only display the shoutbox in forumid=xx
Although I'm greatful for his reply it makes little sense to me. Could someone dumb it down for me?

Thanks!

:banana:

bump
Reply With Quote
  #2  
Old 06-30-2006, 07:22 AM
SiriusBlack22 SiriusBlack22 is offline
 
Join Date: Jun 2006
Location: Florida
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump
Reply With Quote
  #3  
Old 06-30-2006, 11:53 AM
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Location: Manchester, UK
Posts: 6,504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
<if condition="$forum[forumid]=='x'">vb shout code</if>
Replace the x with the forumid number for the forum in which you wish it to show.
Reply With Quote
  #4  
Old 07-02-2006, 06:44 AM
SiriusBlack22 SiriusBlack22 is offline
 
Join Date: Jun 2006
Location: Florida
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by peterska2
Code:
<if condition="$forum[forumid]=='x'">vb shout code</if>
Replace the x with the forumid number for the forum in which you wish it to show.
Where should I place this code?

Thanks for the reply by the way.
Reply With Quote
  #5  
Old 07-02-2006, 08:42 AM
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Location: Manchester, UK
Posts: 6,504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Place it in the forumdisplay template, but that way will probably need changes to the shoutbox plugins and code,

-or-

Install the vBShout on all pages add on which makes changes to the code to make it available for global useage, then instead of putting the code in the navbar template as instructed by those instructions, place in the forumdisplay template under
Code:
$navbar
Reply With Quote
  #6  
Old 07-02-2006, 11:29 PM
SiriusBlack22 SiriusBlack22 is offline
 
Join Date: Jun 2006
Location: Florida
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

which code do I put in the forumdisplay template? How much do I follow their steps and then branch off into my own?
Reply With Quote
  #7  
Old 07-02-2006, 11:32 PM
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Location: Manchester, UK
Posts: 6,504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

follow until it gets to the template edit, then what it says to put in the navbar put into forumdisplay and put your conditional around it.
Reply With Quote
  #8  
Old 07-03-2006, 12:24 AM
utw-Mephisto utw-Mephisto is offline
 
Join Date: Jan 2005
Posts: 648
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I asked the same a while back on vb.com

The only difference though, I also installed the hack to display it on all forums, but then this ;

http://www.vbulletin.com/forum/showthread.php?t=185031
Reply With Quote
  #9  
Old 07-03-2006, 12:03 PM
SiriusBlack22 SiriusBlack22 is offline
 
Join Date: Jun 2006
Location: Florida
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I put this code in the forumdisplay template:

PHP Code:
<if condition="$forum[forumid]=='4'">$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 src="'.$emo['smiliepath'].'" alt="'.$emo['title'].'" border="0" /></a> ';
        }
    }

    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 src="'.$GetEmo['smiliepath'].'" alt="'.$GetEmo['title'].'" border="0" /></a> ';
            }
        }
    }
}
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.'</option>' "\n";
            }
        }
    }
}



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

    switch (
$vbulletin->options['shout_position'])
    {
        case 
1:
            
$Position '<!-- what\'s going on box -->';
        break;

        case 
2:
            
$Position '<!-- end what\'s going on box -->';
        break;

        case 
4:
            
$Position '<!-- main -->';
        break;

        default:
            
$Position '$navbar';
        break;
    }

$Position '<!-- / nav buttons bar -->';
$vbulletin->templatecache['navbar'] = str_replace($Position$Position '<br /> $Shoutbox'$vbulletin->templatecache['navbar']);</if> 
But I get this error:

Quote:
The following error occurred when attempting to evaluate this template:

Parse error: parse error, unexpected ']', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/hpinacti/public_html/includes/adminfunctions_template.php(3537) : eval()'d code on line 34

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
Reply With Quote
  #10  
Old 07-03-2006, 10:07 PM
wilhelm32 wilhelm32 is offline
 
Join Date: Nov 2005
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
$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 src="'.$emo['smiliepath'].'" alt="'.$emo['title'].'" border="0" /></a> ';
        }
    }

    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 src="'.$GetEmo['smiliepath'].'" alt="'.$GetEmo['title'].'" border="0" /></a> ';
            }
        }
    }
}
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.'</option>' . "\n";
            }
        }
    }
}



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

    switch ($vbulletin->options['shout_position'])
    {
        case 1:
            $Position = '<!-- what\'s going on box -->';
        break;

        case 2:
            $Position = '<!-- end what\'s going on box -->';
        break;

        case 4:
            $Position = '<!-- main -->';
        break;

        default:
            $Position = '$navbar';
        break;
    }

$Position = '<!-- / nav buttons bar -->';
$vbulletin->templatecache['navbar'] = str_replace($Position, $Position . '<br /> $Shoutbox', $vbulletin->templatecache['navbar']);
is this code you would put in a template??
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:09 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09970 seconds
  • Memory Usage 2,320KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (1)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete