Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons

Reply
 
Thread Tools
vBShout Customization Details »»
vBShout Customization
Version: 1.00, by jamesk jamesk is offline
Developer Last Online: Jul 2009 Show Printable Version Email this Page

Category: Integration with vBulletin - Version: 3.6.4 Rating:
Released: 11-22-2006 Last Update: Never Installs: 3
 
No support by the author.

I wanted to have vBShout on just certain "community" pages, namely: index.php (aka FORUMHOME), forumdisplay.php, showthread.php and showpost.php while not displaying on the remaining pages.

In order to do this I modified the code in vBShout [Template Alteration] to:

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";
			}
		}
	}
}

#function isBanned($user)
#{
#	return (isBanned_Check($user['userid'], 'shout_banned_users') || isBanned_Check($user['usergroupid'], 'shout_banned_usergroups'));	
#}

#function isBanned_Check($bash, $against)
#{
#	global $vbulletin;
#	return in_array($bash, iif($vbulletin->options[$against], explode(',', $vbulletin->options[$against]), array()));
#}

#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;
	}

if (THIS_SCRIPT == "index") {
	$vbulletin->templatecache['FORUMHOME'] = str_replace($Position, $Position . ' $Shoutbox', $vbulletin->templatecache['FORUMHOME']);
}
if (THIS_SCRIPT == "forumdisplay") {
	$vbulletin->templatecache['FORUMDISPLAY'] = str_replace('$navbar', '$navbar' . ' $Shoutbox', $vbulletin->templatecache['FORUMDISPLAY']);
}
if (THIS_SCRIPT == "showthread") {
	$vbulletin->templatecache['SHOWTHREAD'] = str_replace('$navbar', '$navbar' . ' $Shoutbox', $vbulletin->templatecache['SHOWTHREAD']);
}
if (THIS_SCRIPT == "showpost") {
	$vbulletin->templatecache['SHOWTHREAD_SHOWPOST'] = str_replace('$navbar', '$navbar' . ' $Shoutbox', $vbulletin->templatecache['SHOWTHREAD_SHOWPOST']);
}
I removed the "banned user" support (you can leave it in if you wish).

Assumption: for pages other than FORUMHOME it will display under the navbar (no options coded into this code). you can still "move" the index page's positioning. Needs a better method of determining where to insert the vBShout template into the vbulletin page templates.

modified the code in vBShout [Template Cache] to:

Code:
if (THIS_SCRIPT == "index" | THIS_SCRIPT == "forumdisplay" | THIS_SCRIPT == "showthread" | THIS_SCRIPT == "showpost")
{
	global $globaltemplates;

	$globaltemplates  = array_merge($globaltemplates, array('forumhome_vbshout'));
}
Added 3 "New Plug In"s as:

vBShout [forumdisplay alteration] with hook being forumdisplay_complete
vBShout [showpost alteration] with hook being showpost_complete
vBShout [showthread alteration] with hook being showthread_complete

the code for each being the first code pasted exactly the same into each.

now the vBShout shoutbox displays on any page of these 4 types and nowhere else.

I am certain this could be "hacked" further and better. so, please, easy with the flame posts.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 11-24-2006, 12:51 AM
Ronak's Avatar
Ronak Ronak is offline
 
Join Date: Sep 2006
Posts: 109
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

gud hack but this shud been posted in Template Modifications
Reply With Quote
  #3  
Old 11-24-2006, 09:38 AM
JamieLee2k's Avatar
JamieLee2k JamieLee2k is offline
 
Join Date: Sep 2006
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I really think you need to explain this better, I wouldn't know where to start, what to edit?, where to edit?

This hack is very useful to me.

Thanks
JamieLee2k
Reply With Quote
  #4  
Old 11-24-2006, 12:21 PM
Calibre_k Calibre_k is offline
 
Join Date: Feb 2006
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would I be able to have this on a forums & sub forums?
Reply With Quote
  #5  
Old 11-25-2006, 06:11 AM
bollyzone.net bollyzone.net is offline
 
Join Date: Oct 2006
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can i see demo plz?
Reply With Quote
  #6  
Old 11-25-2006, 06:46 AM
Shazz's Avatar
Shazz Shazz is offline
 
Join Date: Jun 2006
Location: Utah
Posts: 4,758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A screen shot of a demo would be nice
Reply With Quote
  #7  
Old 11-25-2006, 01:26 PM
JamieLee2k's Avatar
JamieLee2k JamieLee2k is offline
 
Join Date: Sep 2006
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how to install would be nice
Reply With Quote
  #8  
Old 11-27-2006, 06:56 AM
Terminatoronly's Avatar
Terminatoronly Terminatoronly is offline
 
Join Date: Mar 2006
Posts: 313
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks alot working fine with me
Reply With Quote
  #9  
Old 12-03-2006, 04:44 AM
emmanuel132 emmanuel132 is offline
 
Join Date: Nov 2006
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i dont see install man
Reply With Quote
  #10  
Old 12-03-2006, 05:29 PM
wolfyman's Avatar
wolfyman wolfyman is offline
 
Join Date: Apr 2005
Posts: 719
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can anybody tell me how I could use this, but make the shoutbox automatically close at certain hours? Like from 8-midnight?
Reply With Quote
Reply

Thread Tools

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 08:43 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04445 seconds
  • Memory Usage 2,292KB
  • Queries Executed 23 (?)
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
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)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
  • (9)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