PDA

View Full Version : Mini Mods - vBShout v2.0 on CMPS v3.0 RC2


anzo
11-22-2007, 10:00 PM
This is our first hack.

I couldn't find a CMPS module to place a working vBShout v2 (https://vborg.vbsupport.ru/showthread.php?t=93097) on CMPS v3.0 RC2 (http://www.vbadvanced.com/products.php?do=productinfo&productid=4). When I used the original hack (https://vborg.vbsupport.ru/showthread.php?t=97497), all I got was the "Loading..." message. So I've asked my team (http://dzin.lv/en/) to take a look and they came up with a solution.

We hadn't had a chance to test it on other boards, but it works on ours (http://latforums.lv/), so I hope it'll also work for you. If not, post here and we'll try to figure it out.

For some reason I can't create a correct uploadable version of this module, so here's the manual installation:

INSTALLATION

1. Create a new template module: vBa CMPS > Add Module > [Template Module]

2. Fill in necessary fields, enter the following code into the Template Content field:



<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_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.displa y == 'none')? '' : 'none'
}

requestShouts()

-->
</script>



3. Press Save.

GrendelKhan{TSU
11-23-2007, 03:57 PM
does this work with 2.0 pro?

anzo
11-23-2007, 08:02 PM
it works with the latest vBShout version, yes.

Shazz
11-23-2007, 08:15 PM
A few are starting to move to inferno, this looks good for vBShout 2.0 though.

anzo
11-23-2007, 08:39 PM
I've tried inferno, but didn't like it. There were something wrong with it, only I don't remember what exactly...

Shazz
11-23-2007, 09:53 PM
I've tried inferno, but didn't like it. There were something wrong with it, only I don't remember what exactly...

Has to be the BBcodes :)

Skavenger
11-24-2007, 01:46 AM
the old one is working fine for me since i have vba 2.x, but i'll take a look at this anyway =P

cesar829
11-26-2007, 12:59 AM
I get a loading message. Not working for me...

Catziggy
11-27-2007, 10:57 AM
All I get is the loading message

anzo
11-27-2007, 11:06 AM
please post links to your boards so I could take a look

zeusdesign
11-27-2007, 11:40 AM
thanks for mod, the developer ;)

Catziggy
11-27-2007, 02:05 PM
<a href="http://www.timelessgaming.com" target="_blank">http://www.timelessgaming.com</a> if you click shout it white screens out.

anzo
11-27-2007, 02:34 PM
Catziggy, please replace all code in adv_portal_vbshout with this:



<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_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.displa y == 'none')? '' : 'none'
}

requestShouts()

-->
</script>



Please tell me if it worked.

Catziggy
11-27-2007, 02:46 PM
Yes tried original hack and it didnt work for me either

Loaded that script no joy

anzo
11-27-2007, 03:13 PM
where's your vbshout.php file located? can you make a copy of it in the forum root?

Catziggy
11-27-2007, 05:58 PM
tried :( still no joy. Thanks for persevering.

stud
12-03-2007, 10:46 PM
did you give a try to see if this worked with Inferno's ShoutBox?
Would it be hard to modify it to work with both?

SmEdD
12-04-2007, 06:25 AM
Actually to fix the loading issue most people will be having they need to put a copy of vbshout.php in their CMPS root dir (if different then the forums root). Then they need to change the first 2 instances of vbshout.php in that template to $vboption[bburl]/vbshout.php

The copy of vbshout.php in their root dir (not the forum dir) they need to find:
require_once('./global.php');
And add BEFORE
chdir('/PATH/TO/FORUM/ROOT');

I will see later what in the file causes it to get stuck loading. At least that fixed it for me.

m002.p
12-04-2007, 06:30 AM
For those wishing to get a module working on the inferno vbshout versions 1.1 and 2 onwards, please take a look at this thread ;)

https://vborg.vbsupport.ru/showthread.php?t=163395

Catziggy
12-04-2007, 01:04 PM
Catziggy, please replace all code in adv_portal_vbshout with this:



<td class="alt1" align="left" width="100%">
<form action="http://yoursite/forums/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('http://yoursite/forums/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('http://yoursite/forums/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_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.displa y == 'none')? '' : 'none'
}

requestShouts()

-->
</script>



Please tell me if it worked.


I finally got it to work and the answer is REALLY simple. If all you get is a loading message on your screen then edit the adv_portal_vbshout template and search for .php. It should throw up 3 instances of vbshout.php. Just enter your full website forum adrress like the red above (mine was http://www.timelessgaming.com/forums/ ) in front as shown.

Viola. Set it up again and it works perfectly.

thanks for the mod. Been waiting for this.

Oops i see SmedD has the same answer but a different route lol.

mri_mohammad
12-06-2007, 11:42 PM
if i have subdomain what can i do with vbshout.php ?

stud
12-07-2007, 01:27 PM
For those wishing to get a module working on the inferno vbshout versions 1.1 and 2 onwards, please take a look at this thread ;)

https://vborg.vbsupport.ru/showthread.php?t=163395


with some help from m002.p, this worked GREAT for the new Inferno branded versions!

digital_sc4rz
02-09-2008, 09:35 AM
Works Gr8 :up: Thankyou

xTerMn8R
05-12-2008, 10:22 PM
Tried all the suggestions but it still sits there "LOADING" on Home Page... As far as SmEdD's suggestion, I found that a bit unclear, Would you mind showing an example of the change in the TEMPLATE? And the change in the vbshout.php file , should that be the same whether iTs a Unix Box or a Windows Box?

BTW I'm running Apache on Windows, PHP5x, MySQL 5.x, using WAMP(Windows,Apache, MySQL, PHP package) vbulletin 3.70 and CMPS 3.0. Had these things working fine in 3.6.x

Thx for any and all help.

xTerMn8R
www.superskunkracing.org
:confused:

DJ29Joesph
05-21-2009, 12:35 AM
Got this to work on my site Vb 3.8.2

DEMO: http://spiralgaming.net/

Thanks Again

Just a suggestion... you know how there is a /me feature in it.
What about a /admin for shout just to admins.

Anyway....