vBulletin Brasil

vB-Brasil

Comunidade vBulletin em Português

 

bbcode img no mod [AJAX] vBShout v2.0

Esta é a discussão em bbcode img no mod [AJAX] vBShout v2.0 parte do fórum vB: Como fazer que integra a categoria vBulletin Dúvidas. Participe sempre de nossos debates.


Voltar   vBulletin Brasil > vBulletin Dúvidas > vB: Como fazer

Registrar FAQ Membros Calendário Pesquisar Postados Hoje Marcar Fóruns Como Lidos Especiais!

Notícias

Resposta
 
LinkBack Ferramentas do Tópico Modos de Exibição

  #1 (permalink)  
Antigo 02-07-2008, 20:27
Avatar de serrano
Ocasional
 
Registrado em: Jan 2007
Localização: Reguengos de Monsaraz, PT
Idade: 25
Posts: 221
Agradecimentos: 122
Agradecido 52 vez em 24 Posts
Peso da Avaliação : 5
serrano está indo no caminho certo
Padrão bbcode img no mod [AJAX] vBShout v2.0

Existem algumas duvidas de como colocar imagen no mod [AJAX] vBShout v2.0 - vBulletin.org Forum..

eu senti necessidade de resolver esse problema, então depois de muita pesquisa encontrei um post no vb hacks eque explicava como resolver esse problema..muito simples..


opções do vbulletin > configurações do codigobb > colocar em "Sim" a opção Allow [IMG] Code in Non Forum Specific Areas

Muito simples e rapido

depois basta colocar na shout:

exemplo

[img]image.jpg[/img]

espero que seja util..

cumps
serrano
__________________
Bruno Serrano Web Site
Infodigital
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Responder com Quote
O seguinte Usuário agradeceu à serrano por essa útil mensagem:
killerofnet (02-07-2008)
  #2 (permalink)  
Antigo 02-07-2008, 22:59
Avatar de killerofnet
Super Moderador
 
Registrado em: Nov 2006
Localização: SP
Idade: 23
Posts: 1,953
Agradecimentos: 653
Agradecido 898 vez em 434 Posts
Peso da Avaliação : 24
killerofnet é uma pessoa muito querida
Padrão Re: bbcode img no mod [AJAX] vBShout v2.0

Obrigado amigo!
__________________
Sigamos todos pelo lema do VB-Brasil: "Hoje você aprende, amanhã você ensina"

"Aqui é uma escola. Todos somos aprendizes"
"Não se pode ensinar tudo a alguém, pode-se apenas ajudá-lo a encontrar por sí mesmo."
Galileu Galilei

É iniciante? Consulte nosso FAQ de Perguntas Frequentes [ AQUI ]
Antes de abrir um tópico, use o sistema de [busca]
Click the image to open in full size.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Responder com Quote
  #3 (permalink)  
Antigo 04-07-2008, 17:50
Avatar de serrano
Ocasional
 
Registrado em: Jan 2007
Localização: Reguengos de Monsaraz, PT
Idade: 25
Posts: 221
Agradecimentos: 122
Agradecido 52 vez em 24 Posts
Peso da Avaliação : 5
serrano está indo no caminho certo
Padrão Re: bbcode img no mod [AJAX] vBShout v2.0

vou aqui deixar um codigo, este codigo serve para adicionar um botão para colocar imagens na shoutbox.

instruções:

admincp > Estilos & Modelos > Pesquisar nos Modelos > escolha o style onde quer fazer a alteração e procure pelo template forumhome_vbshout

abra o template e substitua todo o codigo pelo seguinte codigo:

Código:
<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' />

<div id='shout_emo' style='display:none'>
        <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
        <tr>
            <td class="tcat" align="center">
                Emoticons
            </td>
        </tr>
        <tr>
            <td class='alt2' width='100%' height='100%' align='center' valign='top'>
                $Smilie_Build
            </td>
        </tr>
        </table>
    <br />
</div>
        <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
        <thead>
        <tr>
            <td class="tcat" align="center">
                <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_vbshout')"><img id="collapseimg_forumhome_vbshout" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_vbshout].gif" alt="" border="0" /></a>
                <a href='vbshout.php?{$session['sessionurl_q']}do=archive'>Shoutbox</a>
            </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" id="shout" 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()' />
                            <input type='button' class='button' value='Smilies' onclick='sb_Smilies(this)' />
                            <input type="button" class='button' onclick="bbcode_ins('shout', 'img')" value="IMG"/>
                            <input type='button' class='button' style='font-weight:bold' value='B' onclick='sb_PropChange_Button(this, "fontWeight")' />
                            <input type='button' class='button' style='text-decoration:underline' value='U' onclick='sb_PropChange_Button(this, "textDecoration")' />
                            <input type='button' class='button' style='font-style:italic' value='I' onclick='sb_PropChange_Button(this, "fontStyle")' />
                            <select name='font_color' onchange='sb_PropChange(this, "color")'>
                                {$DropDowns['color_selector']}
                            </select>
                            <select name='font_selector' onchange='sb_PropChange(this, "fontFamily")'>
                                {$DropDowns['font_selector']}
                            </select>
                            </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()' />
                            <input type='button' class='button' value='Smilies' onclick='sb_Smilies(this)' />
                            <input type='button' class='button' style='font-weight:bold' value='B' onclick='sb_PropChange_Button(this, "fontWeight")' />
                            <input type='button' class='button' style='text-decoration:underline' value='U' onclick='sb_PropChange_Button(this, "textDecoration")' />
                            <input type='button' class='button' style='font-style:italic' value='I' onclick='sb_PropChange_Button(this, "fontStyle")' />
                            <select name='font_color' onchange='sb_PropChange(this, "color")'>
                                {$DropDowns['color_selector']}
                            </select>
                            <select name='font_selector' onchange='sb_PropChange(this, "fontFamily")'>
                                {$DropDowns['font_selector']}
                            </select>
                            </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('Postagem em progresso..')
        return false
    }

    Shout = formObj.shout.value

    if (Shout.replace(/ /g, '') == '')
    {
        alert('Escreva alguma coisa!')
        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'
}

function bbcode_ins(fieldId, tag)

{

    field=document.getElementById(fieldId);

 if(tag == 'img')

    {

        var path = prompt('Coloca o link da imagem, tem atenção ao tamanho da imagem!', 'http://');

        if(!path)

        {

            return;

        }

        if (document.selection) 

        {

            field.focus();

            sel = document.selection.createRange();

            sel.text = '[' + tag + ']' + path + '[/' + tag+']';

        }

        //MOZILLA/NETSCAPE/SAFARI support

        else if (field.selectionStart || field.selectionStart == 0) 

        {

            var startPos = field.selectionStart;

            var endPos = field.selectionEnd;

            field.focus();

            field.value = field.value.substring(0, startPos)

            + '[' + tag + ']' + path + '[/' + tag+']'

            + field.value.substring(endPos, field.value.length);

        } 

    }
}

requestShouts()

-->
</script>
Clique então no botão salvar.


Concluido. espero ter ajudado

cumps
serrano
__________________
Bruno Serrano Web Site
Infodigital
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Responder com Quote
O seguinte Usuário agradeceu à serrano por essa útil mensagem:
killerofnet (04-07-2008)
  #4 (permalink)  
Antigo 04-07-2008, 23:10
Avatar de killerofnet
Super Moderador
 
Registrado em: Nov 2006
Localização: SP
Idade: 23
Posts: 1,953
Agradecimentos: 653
Agradecido 898 vez em 434 Posts
Peso da Avaliação : 24
killerofnet é uma pessoa muito querida
Padrão Re: bbcode img no mod [AJAX] vBShout v2.0

Obrigado mais uma vez!
__________________
Sigamos todos pelo lema do VB-Brasil: "Hoje você aprende, amanhã você ensina"

"Aqui é uma escola. Todos somos aprendizes"
"Não se pode ensinar tudo a alguém, pode-se apenas ajudá-lo a encontrar por sí mesmo."
Galileu Galilei

É iniciante? Consulte nosso FAQ de Perguntas Frequentes [ AQUI ]
Antes de abrir um tópico, use o sistema de [busca]
Click the image to open in full size.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Responder com Quote
Resposta

Favoritos

Tags
ajax vbshout, bbcode img


Usuários ativos no Tópico: 1 (0 Membros e 1 Visitantes)
 
Ferramentas do Tópico
Modos de Exibição

Regras para Posts
Você não pode postar novos tópicos
Você não pode postar respostas
Você não pode postar anexos
Você não pode editar seus posts

Código [IMG] Sim
Código HTML Não
Trackbacks are Sim
Pingbacks are Sim
Refbacks are Sim
Ir para...

Tópicos Similares
Tópico Tópico Iniciado Por Fórum Respostas Última Mensagem
vB 3.7.x Permissão de BBCode killerofnet vB: Recursos do vBulletin 2 06-07-2008 20:44
BBcode - Megarotic lordozzy3112 BBCodes 6 17-06-2008 00:07
novo bbcode - fieldset beduino BBCodes 3 01-03-2007 07:23


Horários baseados na GMT -3. Agora são 04:01.

Advertisement
Booyah
   


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 :: Translated by vB-Brasil
vB Brasil & Portugal : vBulletin em Português

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104