vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Mini Mods - vBShout v2.0 on CMPS v3.0 RC2 (https://vborg.vbsupport.ru/showthread.php?t=163418)

anzo 11-22-2007 10:00 PM

vBShout v2.0 on CMPS v3.0 RC2
 
This is our first hack.

I couldn't find a CMPS module to place a working vBShout v2 on CMPS v3.0 RC2. When I used the original hack, all I got was the "Loading..." message. So I've asked my team 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, 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:

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_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>

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

Quote:

Originally Posted by anzo (Post 1388295)
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


All times are GMT. The time now is 11:46 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.01358 seconds
  • Memory Usage 1,773KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete