Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vBShout On All Pages Details »»
vBShout On All Pages
Version: 1.00, by Dhitch Dhitch is offline
Developer Last Online: Aug 2013 Show Printable Version Email this Page

Version: 3.5.4 Rating:
Released: 03-27-2006 Last Update: Never Installs: 10
 
No support by the author.

Didn't really know where to put this..
Requirements:
vBShout
Description:
This is pretty much an extension of the arcade shout mod. I was trying to figure out how to get the shoutbox on all pages, and so decided to use the ArcadeShout code to do it. This is a very simple hack.

Visit: http://dnlister.com to view a live version of it.
To install, first open the plugin manager, and find the vBShout [Template Alteration] hook. Open it for editing. Replace all of the code inside with:
Code:
function htmlProof($text){
  $text = stripslashes($_POST['message']);
  $text = htmlspecialchars($text);
  $text = preg_replace('?<(/?(b|i|font|font color=.*?))>?ie', 'html_entity_decode(\'$0\')', $text);
  return $text;
};//EoFn htmlProof

$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";
			}
		}
	}
}
Then open up the Header template, and go to the very bottom, and add this:
Code:
<!-- ArcadeShout -->
$thread[title]
<form action="vbshout.php?{$session['sessionurl']}" method="post" name="vbshoutform" onsubmit="return postShout(this)">
<input type='hidden' name='do' value='shout' />
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="80%" align="center">
<thead>
<tr>
<td class="thead"><a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_vbshout')"><img id="collapseimg_forumhome_vbshout" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_gamepanel].gif" alt="" border="0" /></a>
<center><a href='vbshout.php?{$session['sessionurl_q']}do=archive'>ShoutBoxX</a></center>
</td>
</tr>
</thead>
<tbody id="collapseobj_forumhome_vbshout" style="$vbcollapse[collapseobj_forumhome_vbshout]">
<tr>
<td class="alt1" align="left" width="100%">
<if condition="!$vboptions[shout_editor_position]">
<if condition="$bbuserinfo[userid] > 0">
<table width='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td width='100%'>
<input type="text" name="shout" style="width: 90%"id="input_box" class="bginput" />
</td>
<td style='white-space:nowrap' width='1%'>
<input type="submit" value="Shout" class="button" />
<if condition="$vboptions[shout_extra_options]">
<input type='button' class='button' value='Clear' onclick='sb_Clear()' />
</if>
</td>
</tr>
</table>
</if>
</if>
<div id="vbshout" style="overflow:auto;height:84px;width:100%;">
Don't Wait For Me To Load... Get Posting!
</div>
<if condition="$vboptions[shout_editor_position]">
<if condition="$bbuserinfo[userid] > 0">
<div style="height: 2px"></div>
<table width='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td width='100%'>
<input type="text" name="shout" style="width: 90%" class="bginput" />
</td>
<td style='white-space:nowrap' width='1%'>
<input type="submit" value="Shout" class="button" />
<if condition="$vboptions[shout_extra_options]">
<input type='button' class='button' value='Clear' onclick='sb_Clear()' />
</if>
</td>
</tr>
</table>
</if>
</if>
</td>
</tr>
</tbody>
</table>
</form>
<br />
<script type='text/javascript'>
<!--
postingShout = false
function requestShouts()
{
if (!postingShout)
{
ShoutRequest = new vB_AJAX_Handler(true)
ShoutRequest.onreadystatechange(showShouts)
ShoutRequest.send('vbshout.php', 'nocache=' + (5 * Math.random() * 1.33) )
}
}
function showShouts()
{
if (ShoutRequest)
{
if (ShoutRequest.handler.readyState == 4 && ShoutRequest.handler.status == 200 && ShoutRequest.handler.responseText)
{
Shouts = fetch_object('vbshout')
Shouts.innerHTML = '<table cellpadding="1" cellspacing="3" border="0" width="95%" align="left">' + ShoutRequest.handler.responseText + '</table>'
setTimeout('requestShouts()', 10000)
<if condition="$vboptions[shout_messages_order]">
document.getElementById('vbshout').scrollTop = 99999;
</if>
}
}
}
function sb_CollectHV(sbForm)
{
rString = ''
inputObjs = sbForm.getElementsByTagName('input')
for (i = 0; i < inputObjs.length; i++)
{
if (inputObjs[i].type == 'hidden' && inputObjs[i].value != '')
{
rString += '&' + inputObjs[i].name + '=' + PHP.urlencode(inputObjs[i].value)
}
}
return rString
}
function postShout(formObj)
{
doShout = new vB_AJAX_Handler(true)
doShout.onreadystatechange(postedShout)
if (postingShout)
{
alert('Posting in progress..')
return false
}
Shout = formObj.shout.value
if (Shout.replace(/ /g, '') == '')
{
alert('You must enter a shout!')
return false
}
doShout.send('vbshout.php', 'do=shout&shout=' + PHP.urlencode(Shout) + sb_CollectHV(document.forms['vbshoutform']))
sb_Clear()
postingShout = true
return false
}
function postedShout()
{
if (doShout.handler.readyState == 4 && doShout.handler.status == 200)
{
postingShout = false
requestShouts()
}
}
function sb_Input_SC(sProperty, setting)
{
eval('document.forms["vbshoutform"].shout.style.' + sProperty + ' = "' + setting + '"')
eval('document.forms["vbshoutform"].' + sProperty + '.value = "' + setting + '"')
}
function sb_Clear()
{
document.forms["vbshoutform"].shout.value = ''
return true;
}
requestShouts()
-->
</script>
<!-- /ArcadeShout -->
After that is done, you will have a shoutbox on all pages! It works fully, aswell. To change the name,
Find in the above code:
Code:
<center><a href='vbshout.php?{$session['sessionurl_q']}do=archive'>ShoutBoxX</a></center>
And change the text saying ShoutBoxX.
To change the size, find:
Code:
<div id="vbshout" style="overflow:auto;height:84px;width:100%;">
And change the hieght value.


All done! Everything should be working, and you will have a shoutbox on all pages!

Show Your Support

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

Comments
  #12  
Old 04-11-2006, 04:02 AM
hotwheels hotwheels is offline
 
Join Date: May 2005
Location: Cheyenne, wy
Posts: 1,380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quick question...........I followed the step's and it does work as shown, but when you log out, it leave's you with an error;
Quote:
ShoutBoxX

Warning: Invalid argument supplied for foreach() in /vbshout.php on line 288
Reply With Quote
  #13  
Old 04-15-2006, 01:44 AM
cat4m cat4m is offline
 
Join Date: Mar 2006
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can anyone answer the above question please ??
Reply With Quote
  #14  
Old 04-22-2006, 03:24 PM
Feckie (Roger)'s Avatar
Feckie (Roger) Feckie (Roger) is offline
 
Join Date: May 2005
Location: Dublin Eire
Posts: 392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you put the code for the ArcadeShout Script @ the bottom of the Navbar template. instead of the header it looks better under the navbar than above it...
Reply With Quote
  #15  
Old 08-05-2006, 05:55 PM
kofoid kofoid is offline
 
Join Date: Dec 2005
Location: Colorado
Posts: 291
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dhitch
You can re-add them manually, I will at a later time update the code to include them, but just use HTML to add the formatting.
Code:
<b> = bold
</b> = end bold
<i> = Italic
</i> = end italic
<u> = underline
</u> = end underline
<font color="#000000"> = Colors in hex, replace the 000000 with the color you want.
<font size="any # here"> = Put a number
<img src="http://putthishttplinkheretogetanimage"> = Makes an image appear
This rocks!!! Can you please let me know exactly where to add this?
Reply With Quote
  #16  
Old 08-05-2006, 06:53 PM
LadyHoney LadyHoney is offline
 
Join Date: Jul 2006
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kofoid
This rocks!!! Can you please let me know exactly where to add this?
that tells u what to type in your shout box to make those choices.

I put this at the bottom of my navbar and love it there.. but then it shows on the adv cmps.. and it doesnt work there... just blank any advice on how i can exclude it from there?
Reply With Quote
  #17  
Old 02-28-2007, 03:00 PM
MTVSlick MTVSlick is offline
 
Join Date: Jan 2007
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how can i add the shout box to just the forum pages and the arcade pages, when i add to all pages I get a loading issue everytime, so i just want it on the active forums/arcade pages???

Mark,
Reply With Quote
  #18  
Old 04-22-2007, 10:42 AM
ABeautifulBrown's Avatar
ABeautifulBrown ABeautifulBrown is offline
 
Join Date: Oct 2006
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how do I get the color options ans everything back?
Reply With Quote
  #19  
Old 04-22-2007, 11:08 AM
ABeautifulBrown's Avatar
ABeautifulBrown ABeautifulBrown is offline
 
Join Date: Oct 2006
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I got the fields there but they're not pulling the font names and colors like before... help!
Reply With Quote
  #20  
Old 09-16-2007, 04:51 AM
Gameaholic Gameaholic is offline
 
Join Date: Jul 2007
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey how do you make the similies button reappear and also how do you change the img of the buttons (shout, clear).

Also is it possible to put a notice
Reply With Quote
  #21  
Old 09-16-2007, 05:20 AM
Gameaholic Gameaholic is offline
 
Join Date: Jul 2007
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oops sorry for the double post my comp is laggy
Reply With Quote
Reply


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 07:48 AM.


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.04879 seconds
  • Memory Usage 2,323KB
  • Queries Executed 25 (?)
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
  • (5)bbcode_code
  • (3)bbcode_quote
  • (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
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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