The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
[AJAX] vBShout v2 on your vBadvanced CMPS v2! Details »» | |||||||||||||||||||||||||||
[AJAX] vBShout v2 on your vBadvanced CMPS v2!
Developer Last Online: Jun 2020
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> 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> 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> 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
|
Comments |
#192
|
|||
|
|||
I have this problem:
On the forum index it works fine, but on my portal (CMPS) it has an error: 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() --> What could be the problem? |
#193
|
|||
|
|||
Ok, got that fixed with just reinstalling the stuff.
Now, I don't have the text formation on my CMPS just like it is on the home page: (add smilies, font type and facem, bold, italic, ...). How can I add them, so that they are also on the CMPS shoutbox? Second problem is that it says now 'Viewing Shoutbox' indstead of the portal, how to fix that? Thanks, G. |
#194
|
||||
|
||||
Quote:
|
#195
|
|||
|
|||
no offense, but it took me a while to figure out the exact way to do this... your instructions are a tad unclear and disorderly.
thank you for a cool mod thou! |
#196
|
||||
|
||||
No use editing the post, I saw the original reply in my email!
It works just fine if you follow the instructions to the letter; as you have clearly found. |
#197
|
|||
|
|||
The instructions are clear.
Now, Flea, could you please help me over this problem? https://vborg.vbsupport.ru/showpost....&postcount=192 |
#198
|
|||
|
|||
I just installed this hack with vb3.6.1 and CMPS. Works well on my laptop [I host my website on my laptop]. But when I try to access the page from some other computer on netwrok, the chat hangs on the screen "Loading ....." I tried running http://<myip>/forum/vbshout.php?=doarchive from the other computer and it comes up just fine.
I tried changing vbshout.php path as per previous posts, but that doesnt seem to work [or change anything]. Could someone please give a step by step solution to this? Or atleast tell me where exactly I need to make the changes. Any help would be welcome. |
#199
|
|||
|
|||
Yeah - looking back, I admit my main confusion was my own fault - not noticing that I had not added "/forum/vbshout.php" because I use the CMPS in a different directory as the forum...
I guess i was also confused that under template module options, you have to input vbshout as the template to include. Your instructions only say it will add a template called this - it never specifies you should input this in that box. It's obvious, but can be confusing if your troubleshooting and you follow every step "to the letter". Thanks!! |
#200
|
|||
|
|||
I Figured it out! It was the problem with my forumhome. I had specified my forum home as "localhost" [AdminCP -> vBuleltin Options -> Sitename URL/Contact details], I just had to change it.
Works! but still has some problems I have seen that after like 50 posts, it tends to hang saying "Posting ...." and just stays there. I have to login as admin and prune it to make it work. Can anyone help me with that? |
#201
|
|||
|
|||
So how do we impose limits - such as the removal of the ability of [img] tags - or even better, limit how big they can be?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|