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

Reply
 
Thread Tools
[AJAX] vBShout v2 on your vBadvanced CMPS v2! Details »»
[AJAX] vBShout v2 on your vBadvanced CMPS v2!
Version: 1.1, by FleaBag FleaBag is offline
Developer Last Online: Jun 2020 Show Printable Version Email this Page

Version: 3.5.4 Rating:
Released: 10-03-2005 Last Update: Never Installs: 253
Uses Plugins Template Edits
 
No support by the author.

This is not essentially my hack, it's a group effort originating in the vBadvanced forums.

The following instructions will allow you to add vBShout v2.0 by Zero Tolerance as a fully collapsible module to your vBadvanced CMPS homepage v2.0.0, and remove it from your Forum Home [if you want]. Note, you must have both the vBShout product and CMPS installed with vBulletin 3.5.0 - it may work with Betas, but I really don't know.

This is a group effort from a few guys over at the vBadvanced forums, which includes Scotty2k and vbusers11 - I take no credit for this, I just spotted a problem with how the vBa forums was parsing postbits there. Plus the integration wasn't getting much attention over there and it would be a shame for users of vBShout and vBadvanced to miss out on this.

1) Create a new template based module called 'Shoutbox' in CMPS [ACP > vBa CMPS > Add Module > Template].

2) In 'Column', choose 'Center Column'.

3) Set 'Active' and 'Update All Pages' to Yes [assuming you want it to be active, and update all pages].

4 a) TO ADD AS A CENTRE MODULE - IF YOU DO THIS DO NOT FOLLOW STEPS B OR C!
In 'Template Content', paste the following code [this relies on you running your CMPS & vB in the same folder]. This will add a template to the selected Style called 'adv_portal_vbshout'.
Code:
<td class="alt1" align="left" width="100%">
	<form action="vbshout.php?{$session['sessionurl']}" method="post" name="vbshoutform" onsubmit="return postShout(this)">
		<input type='hidden' name='do' value='shout' />
		<input type='hidden' name='color' />
		<input type='hidden' name='fontFamily' />
		<input type='hidden' name='fontWeight' />
		<input type='hidden' name='textDecoration' />
		<input type='hidden' name='fontStyle' />

	<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%" 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>
					<div style="height: 2px"></div>
					</if>
				</if>
					<div id="vbshout" style="overflow:auto;height:{$vboptions['shout_box_height']}px;width:100%;">
						Loading...
					</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>
				</form>
				</td>

<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 getSelectionValue(eSelector)
{
	return eSelector.options[eSelector.options.selectedIndex].value == 'Default' ? '' : eSelector.options[eSelector.options.selectedIndex].value
}

function sb_PropChange(eSelector, sProperty)
{
	sb_Input_SC(sProperty, getSelectionValue(eSelector))
}

function sb_PropChange_Button_Value(sProperty)
{
	trueValue = ''
	switch (sProperty)
	{
		case 'fontWeight':
		falseValue = 'bold'
		break;

		case 'textDecoration':
		falseValue = 'underline'
		break;

		case 'fontStyle':
		falseValue = 'italic'
		break;
	}

	return (eval('document.forms["vbshoutform"].' + sProperty + '.value'))? trueValue : falseValue
}

function sb_PropChange_Button(cButton, sProperty)
{
	if (cButton.value.match(/\*/))
	{
		cButton.value = cButton.value.replace(/\s+\*/, '')
	}
	else
	{
		cButton.value = cButton.value + ' *'
	}

	sb_Input_SC(sProperty, sb_PropChange_Button_Value(sProperty))
}

function sb_Smilie(code)
{
	document.forms["vbshoutform"].shout.value += ' ' + code
	return false
}

function sb_Clear()
{
	document.forms["vbshoutform"].shout.value = ''
	return true;
}

function sb_Smilies(cButton)
{
	if (cButton.value.match(/\*/))
	{
		cButton.value = cButton.value.replace(/\s+\*/, '')
	}
	else
	{
		cButton.value = cButton.value + ' *'
	}
	
	document.getElementById('shout_emo').style.display   = (document.getElementById('shout_emo').style.display == 'none')? '' : 'none'
}

requestShouts()

-->
</script>
4 b) TO ADD AS A SIDE MODULE - ONLY FOLLOW THIS STEP IF YOU DID NOT PERFORM STEP A.
In 'Template Content', paste the following code [this relies on you running your CMPS & vB in the same folder]. This will add a template to the selected Style called 'adv_portal_vbshout'.

Code:
<td class="alt1" align="left">
	<form action="vbshout.php?{$session['sessionurl']}" method="post" name="vbshoutform" onsubmit="return postShout(this)">
		<input type='hidden' name='do' value='shout' />
		<input type='hidden' name='color' />
		<input type='hidden' name='fontFamily' />
		<input type='hidden' name='fontWeight' />
		<input type='hidden' name='textDecoration' />
		<input type='hidden' name='fontStyle' />

	<if condition="!$vboptions[shout_editor_position]">
		<if condition="$bbuserinfo[userid] > 0">
			<table border='0' cellpadding='0' cellspacing='0'>
				<tr>
					<td>
						<input type="text" name="shout" style="width: 100%" class="bginput" />
						</td>
						<td style='white-space:nowrap' width='1%'>
							<input type="submit" value="Shout" class="button" />
							</td>
					</tr>
					</table>
					<div style="height: 2px"></div>
					</if>
				</if>
					<div id="vbshout">
						Loading...
					</div>
				<if condition="$vboptions[shout_editor_position]">
					<if condition="$bbuserinfo[userid] > 0">
					<div style="height: 2px"></div>
					<table border='0' cellpadding='0' cellspacing='0'>
					<tr>
						<td>
							<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>
				</form>
				</td>

<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 getSelectionValue(eSelector)
{
	return eSelector.options[eSelector.options.selectedIndex].value == 'Default' ? '' : eSelector.options[eSelector.options.selectedIndex].value
}

function sb_PropChange(eSelector, sProperty)
{
	sb_Input_SC(sProperty, getSelectionValue(eSelector))
}

function sb_PropChange_Button_Value(sProperty)
{
	trueValue = ''
	switch (sProperty)
	{
		case 'fontWeight':
		falseValue = 'bold'
		break;

		case 'textDecoration':
		falseValue = 'underline'
		break;

		case 'fontStyle':
		falseValue = 'italic'
		break;
	}

	return (eval('document.forms["vbshoutform"].' + sProperty + '.value'))? trueValue : falseValue
}

function sb_PropChange_Button(cButton, sProperty)
{
	if (cButton.value.match(/\*/))
	{
		cButton.value = cButton.value.replace(/\s+\*/, '')
	}
	else
	{
		cButton.value = cButton.value + ' *'
	}

	sb_Input_SC(sProperty, sb_PropChange_Button_Value(sProperty))
}

function sb_Smilie(code)
{
	document.forms["vbshoutform"].shout.value += ' ' + code
	return false
}

function sb_Clear()
{
	document.forms["vbshoutform"].shout.value = ''
	return true;
}

function sb_Smilies(cButton)
{
	if (cButton.value.match(/\*/))
	{
		cButton.value = cButton.value.replace(/\s+\*/, '')
	}
	else
	{
		cButton.value = cButton.value + ' *'
	}
	
	document.getElementById('shout_emo').style.display   = (document.getElementById('shout_emo').style.display == 'none')? '' : 'none'
}

requestShouts()

-->
</script>
4 c) ONLY PERFORM THIS STEP IF YOU DID NOT PERFORM STEP A!
Edit your 'forumhome_vbshout_shout' template [ACP > Styles & Templates > Style Manager > YOUR DEFAULT STYLE > forumhome_vbshout_shout], and replace it's contents with the following.
Code:
<tr>
				<td align="left" valign="top">
<span class="smallfont">
<if condition="!$Shout[s_me]">
						<if condition="$Shout[s_by]">
							<a href='member.php?{$session['sessionurl_q']}u={$Shout['s_by']}'>
						</if>{$Shout['username']}<if condition="$Shout[s_by]"></a></if>:
					</if>
									<if condition="!$Shout[s_me]">
						{$Shout['s_shout']}
					<else />
						<span class='highlight'>
							*{$Shout['username']} {$Shout['s_shout']}*
						</span>
					</if>
</span>
				</td>
			</tr>
5) In the 'Module Shell Template Options' section when adding a template, add the following URL in 'Module Link'.

http://www.mysite.com/vbshout.php?do=archive

The above, again assumes you have CMPS & vBa running in the same folder. Replace www.mysite.com with the address of your website.

If your CMPS & vB are not installed in the same folder, you will need to replace all instances of 'vbshout.php' in the template and in 'Module Link' with the path to where you have vBShout installed in relation to your CMPS. For example if you have CMPS installed in the root folder, and vBshout within a folder called 'forum' you would need to replace all instances of 'vbshout.php' with '/forum/vbshout.php'.

Removing vBShout from your Forum Home - IF YOU FOLLOWED STEP 4 b) YOU HAVE TO DO STEP 5 - YOUR VBSHOUT WILL NOT RENDER CORRECTLY ON YOUR FORUM HOME! IF YOU HAVE YOUR SHOUTBOX AS A CENTRE MODULE ON THE CMPS, AND WANT TO ALSO HAVE IT RUNNING ON THE FORUM HOME, DO NOT PERFORM THIS STEP!

6) In your ACP go to [ACP > Plugin System > Plugin Manager] - find on that page 'vBShout [Template Alteration]' and uncheck the box which will deactivate it.

That's all there is to it folks, a very simple fix to the problem.

Supporters / CoAuthors

Show Your Support

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

Comments
  #52  
Old 10-10-2005, 01:53 AM
rb290's Avatar
rb290 rb290 is offline
 
Join Date: Oct 2005
Posts: 333
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

someone tell me how to remove the underlines from our name in the shoutbox, thread titles, or anywhere, like completely remove underlines from threads, names, where ever else has it.
some help on that please.
Reply With Quote
  #53  
Old 10-10-2005, 03:21 AM
PennylessZ28 PennylessZ28 is offline
 
Join Date: Mar 2002
Location: North America
Posts: 737
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by rb290
someone tell me how to remove the underlines from our name in the shoutbox, thread titles, or anywhere, like completely remove underlines from threads, names, where ever else has it.
some help on that please.
Wrong place to ask, but to answer your question, in each style you need to put "none" in the decoration field for text items.
Reply With Quote
  #54  
Old 10-10-2005, 03:30 AM
rb290's Avatar
rb290 rb290 is offline
 
Join Date: Oct 2005
Posts: 333
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by HR3rdGen
Wrong place to ask, but to answer your question, in each style you need to put "none" in the decoration field for text items.
decoration field ?
text items ?

wheres that
thanks if you can help
Reply With Quote
  #55  
Old 10-10-2005, 04:17 AM
ozmazdaclub's Avatar
ozmazdaclub ozmazdaclub is offline
 
Join Date: Oct 2003
Posts: 136
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

AdminCP > Styles > All Style Options
Reply With Quote
  #56  
Old 10-10-2005, 02:33 PM
hotrod1 hotrod1 is offline
 
Join Date: Apr 2005
Posts: 112
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks!
Reply With Quote
  #57  
Old 10-10-2005, 07:27 PM
Gandolfe Gandolfe is offline
 
Join Date: Jan 2005
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm having a bit of a problem with the shoutbox on my site, it displays correctly, but no text will come up, like it's not refreshing. Contantly shows 'Loading...'
If I look at vBShout in forumhome the text I have entered from within vBAdvanced show's up.

My site is set out as such

www.flipsy.net -> vBAdvanced CMPS
forums.flipsy.net -> vB with vBShout in root folder.

Code has been changed in the template to direct to http://forums.flipsy.net/vbshout.php

Any ideas would be welcome.
Reply With Quote
  #58  
Old 10-14-2005, 02:30 AM
rookiyong rookiyong is offline
 
Join Date: Apr 2005
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Booth
How could we make the text size '1' in the VBA cms hack? The text is so big it's pushing shouts to one side. I'd really appreciate if someone could find how to make the text size smaller
I am looking for something like this also, any luck?

The horizontal scroll bars are also taking up space, and ends up only showing 3 lines of shout.
Reply With Quote
  #59  
Old 10-14-2005, 02:54 AM
rrokdoka rrokdoka is offline
 
Join Date: Jan 2003
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any luck putting the smilies up scotty2k??
Reply With Quote
  #60  
Old 10-14-2005, 03:35 AM
Alexander-13 Alexander-13 is offline
 
Join Date: Mar 2002
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Didn't know people were having problems with this, I had my vbShout on my CMPS for a long time, though it looks nothing like this :O
Reply With Quote
  #61  
Old 10-14-2005, 06:39 AM
majorj0nny majorj0nny is offline
 
Join Date: May 2005
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks - this is great ... i love ZT's original vbshout - a very versatile shoutbox, and now with your hack we can easily have this on our VBA homepages...

Ive altered things around a little - Ive moved the timestamp to the end of the shout rather than infront of the username and this seems to free up some much needed horizontal room...

how would I go about adding back the textcolour button and perhaps changing the default font size/colour of the timestamp ?

for the testcolour button - how would I make it a neater 'colour swatch' style thing rather than the current wide list of colour codes.... ?

thanks in advance
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 05:28 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.04550 seconds
  • Memory Usage 2,341KB
  • Queries Executed 26 (?)
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
  • (3)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
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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