[Integrar Hack's Park Shoutbox] en tu Theme...

Started by Giancarlo, April 23, 2009, 12:12:18 PM

Previous topic - Next topic

fkz

podrian editarlo?, porque en SMF 2.0 RC2 cambia la cosa...

MÂØ

hooooooola
soy nuevo en el foro y nuevo en este mundo de los foros smf
la verdad es que trate de implementar todo lo del post y me resulto
el problema es
que SOLO EL WEBMASTER puede ver el chat  :P
los demas usuarios no lo ven
alguna ayuda por faa!!!!!
de ante mano gracias  :)

Core7

Quote from: Giancarlo on April 23, 2009, 12:12:18 PM
Hola amigos, acá les paso la manera de poder integrar Hack's Park Shoutbox 2.0 en vuestro Theme tal y como yo lo tengo en mi Foro, ya que el soporte de la página en español no está disponible temporalmente, y desde la página oficial (ingles) no hace mención de como realizar la modificación.

Bien, primeramente bajarse el mod. acá Hack's Park Shoutbox 2.0 e instalarlo, obviamente arranca perfectamente en el Theme Default, pero lo que queremos es integrarlo en nuestro Theme.

Luego esto, descompriman el archivo (mod) y extraigan la carpeta Themes, dentro de la carpeta Default encontraremos los archivos que deberemos subir (ftp) a nuestro Theme y que adjunto en el post.

En el archivo index.template.php de tu Theme...

Buscar:

// The main sub template above the content.
function template_main_above()


Agregar después: (de <?php añadiendo un par de saltos de linea)

function template_HP_shoutBoxMain()
{
    global $context, $settings, $scripturl, $txt, $HP_settings;

    if (empty($context['hp_shoutbox_show']))
        return;

    if ($HP_settings['shoutBox']['out_noban'])
        echo '
    <script language="javascript" type="text/javascript" src="', $settings['theme_url'], '/HP_colorPicker.js"></script>';
    echo '
    <script language="javascript" type="text/javascript" src="', $settings['theme_url'], '/HP_shoutBox.js"></script>
    <script language="javascript" type="text/javascript">';

    if ($HP_settings['shoutBox']['out_noban'])
        echo '
        HP_shoutBox["lng_emos"] = "' . $txt['hs_sb_10'] . '";
        HP_shoutBox["lng_sendingPost"] = "' . $txt['hs_sb_11'] . '";
        HP_shoutBox["lng_empty"] = "' . $txt['hs_sb_12'] . '";
        HP_shoutBox["lng_jstSending"] = "' . $txt['hs_sb_16'] . '";
        HP_shoutBox["lng_sent"] = "' . $txt['hs_sb_13'] . '";
        HP_shoutBox["refresh"] = ' . $HP_settings['shoutBox']['refreshShouts'] . ';
        HP_shoutBox["lng_no_empty"] = "' . $txt['hs_sb_20'] . '";
        HP_shoutBox["lng_empty_url"] = "' . $txt['hs_sb_21'] . '";
        HP_shoutBox["lng_insert_url"] = "' . $txt['hs_sb_22'] . '";
        HP_shoutBox["in_color"] = "' . $HP_settings['shoutBox']['textColor'] . '";
        HP_shoutBox["in_bgcolor"] = "' . $HP_settings['shoutBox']['backgroundColor'] . '";';

    echo '
        HP_shoutBox["is_ie"] = ' . ($context['browser']['is_ie'] ? 'true' : 'false') . ';
    </script>
    <div class="tborder" style="margin: 10px 0 10px 0;">
        <div class="catbg" style="padding: 5px 15px 5px 10px;margin:0 auto;text-align:center;">
            <a rel="nofollow" href="#" onclick="HP_shoutBox_sh(!HP_shoutBox[\'hd_msgs\'], \'msgs\'); return false;"><img id="hp_shoutbox_collapse" src="', $settings['theme_url'], '/images/collapse.gif" alt="*" style="margin-right: 2ex;" align="right" /></a>
            ' . $HP_settings['shoutBox']['boxTitle'] . '</div>
        <noscript>
        <div class="windowbg" style="padding: 5px 15px 5px 10px;">' . $txt['hs_sb_2'] . '</div></noscript>
        <div id="hp_shoutbox_div_msgs">
        <table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor" style="margin-top: 1px;">';

    if ($HP_settings['shoutBox']['out_noban'])
    {
        echo '
        <tr><td class="windowbg" width="100%" align="left" colspan="2">
        <form name="shoutbox" action="' . $scripturl . '" method="post" accept-charset="' . $context['character_set'] . '" onsubmit="HP_shoutBox_Post(\'' . $context['session_id'] . '\'); return false;">
            <table cellpadding="0" cellspacing="0" width="100%" style="margin: 4px;">
            <tr><td nowrap="nowrap" valign="middle" style="padding-right: 8px;">
                <input class="smalltext" type="text" id="hp_shoutbox_imsg" name="msg" tabindex="1" maxlength="120" value="" style="font-weight: normal;color: ' . $HP_settings['shoutBox']['textColor'] . ';font-style: normal;text-decoration: none;width: ' . $HP_settings['shoutBox']['widthInputMsg'] . ';padding: 3px;border-width: 1px;border-color: ' . $HP_settings['shoutBox']['textColor'] . ';background-color: ' . $HP_settings['shoutBox']['backgroundColor'] . ';" />
                <input class="smalltext" type="submit" value="' . $txt['hs_sb_13'] . '" name="send" style="padding: 2px;" /></td>
            <td style="padding: 0 0 0 8px; border-left: 1px solid #9c9c9c" valign="middle" width="100%">
                <div style="position: relative;padding-top: 4px;margin:0;">
                <a href="javascript:void(0);" onclick="HP_shoutBox_sURL()">
                <img onmouseover="bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src="' . $settings['images_url'] . '/bbc/url.gif" width="23" height="22" alt="' . $txt['hs_sb_48'] . '" title="' . $txt['hs_sb_48'] . '" style="background-image: url(\'' . $settings['images_url'] . '/bbc/bbc_bg.gif\');" /></a>
                <a href="javascript:void(0);" onclick="HP_shoutBox_sh(!HP_shoutBox[\'hd_emos\'], \'emos\')">
                <img onmouseover="bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src="' . $settings['images_url'] . '/bbc/caretos.gif" width="23" height="22" alt="' . $txt['hs_sb_10'] . '" title="' . $txt['hs_sb_10'] . '" style="background-image: url(\'' . $settings['images_url'] . '/bbc/bbc_bg.gif\');" /></a>
                <a href="javascript:void(0);" onclick="HP_shoutBox_Clear()">
                <img onmouseover="bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src="' . $settings['images_url'] . '/bbc/clean.gif" width="23" height="22" alt="' . $txt['hs_sb_50'] . '" title="' . $txt['hs_sb_50'] . '" style="background-image: url(\'' . $settings['images_url'] . '/bbc/bbc_bg.gif\');" /></a>
                <a href="javascript:void(0);" onclick="HP_shoutBox_setPro(\'n\', !HP_shoutBox[\'hd_n\']);">
                <img onmouseover="bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src="' . $settings['images_url'] . '/bbc/bold.gif" width="23" height="22" alt="' . $txt['hs_sb_52'] . '" title="' . $txt['hs_sb_52'] . '" style="background-image: url(\'' . $settings['images_url'] . '/bbc/bbc_bg.gif\');" /></a>
                <a href="javascript:void(0);" onclick="HP_shoutBox_setPro(\'k\', !HP_shoutBox[\'hd_k\']);">
                <img onmouseover="bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src="' . $settings['images_url'] . '/bbc/italicize.gif" width="23" height="22" alt="' . $txt['hs_sb_53'] . '" title="' . $txt['hs_sb_53'] . '" style="background-image: url(\'' . $settings['images_url'] . '/bbc/bbc_bg.gif\');" /></a>
                <a href="javascript:void(0);" onclick="HP_shoutBox_setPro(\'s\', !HP_shoutBox[\'hd_s\']);">
                <img onmouseover="bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src="' . $settings['images_url'] . '/bbc/underline.gif" width="23" height="22" alt="' . $txt['hs_sb_54'] . '" title="' . $txt['hs_sb_54'] . '" style="background-image: url(\'' . $settings['images_url'] . '/bbc/bbc_bg.gif\');" /></a>
                <a href="javascript:void(0);" onclick="HP_shoutBox_shFace()">
                <img onmouseover="bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src="' . $settings['images_url'] . '/bbc/face.gif" width="23" height="22" alt="' . $txt['hs_sb_55'] . '" title="' . $txt['hs_sb_55'] . '" style="background-image: url(\'' . $settings['images_url'] . '/bbc/bbc_bg.gif\');" /></a>
                <a href="javascript:void(0);" onclick="HP_colorPicker_sh(false)">
                <img onmouseover="bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src="' . $settings['images_url'] . '/bbc/fontcolor.gif" width="23" height="22" alt="' . $txt['hs_sb_56'] . '" title="' . $txt['hs_sb_56'] . '" style="background-image: url(\'' . $settings['images_url'] . '/bbc/bbc_bg.gif\');" /></a>
                <img id="hp_shoutbox_s_color" src="' . $settings['images_url'] . '/bbc/nocolor.gif" width="18" height="18" alt="" style="background-color: #FFFFFF;border: 1px solid #b2b2b2;" />
                <a href="javascript:void(0);" onclick="HP_colorPicker_sh(true)">
                <img onmouseover="bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src="' . $settings['images_url'] . '/bbc/bgcolor.gif" width="23" height="22" alt="' . $txt['hs_sb_57'] . '" title="' . $txt['hs_sb_57'] . '" style="background-image: url(\'' . $settings['images_url'] . '/bbc/bbc_bg.gif\');" /></a>
                <img id="hp_shoutbox_s_bgcolor" src="' . $settings['images_url'] . '/bbc/nocolor.gif" width="18" height="18" alt="" style="background-color: #FFFFFF;border: 1px solid #b2b2b2;" />
    <div style="display: none; z-index: 11; position: absolute; top: 28px; left: 45px;" id="hp_shoutbox_div_face">
    <table cellpadding="0" cellspacing="0" class="tborder" width="120">
    <tr class="windowbg2"><td width="100%">
        <a href="javascript:void(0);" onclick="HP_shoutBox_setFace(\'inherit\'); document.forms.shoutbox.msg.focus(); HP_shoutBox_shFace();" style="font-family: inherit; display: block; padding: 2px;" class="smalltext">' . $txt['hs_sb_49'] . '</a></td></tr>';

        foreach (explode(';', $HP_settings['shoutBox']['msgFaces']) as $face)
            echo '
    <tr class="windowbg2"><td width="100%">
        <a href="javascript:void(0);" onclick="HP_shoutBox_setFace(\'' . $face . '\'); document.forms.shoutbox.msg.focus(); HP_shoutBox_shFace();" style="font-family: ' . $face . ', sans-serif; display: block; padding: 2px;" class="smalltext">' . $face . '</a></td></tr>';

        echo '</table></div>
    <div style="display: none; z-index: 12; position: absolute; top: 28px; left: -34px;" id="hp_colorpicker_div">
        <table cellpadding="4" cellspacing="0" class="tborder">
        <tr class="windowbg2"><td>
        <script language="javascript" type="text/javascript">HP_colorPicker_PrintBox();</script>
        <img border="0" src="', $settings['images_url'], '/blank.gif" width="1" height="8" alt="" /><br />
        <div style="margin:0 auto;text-align:center;"><script language="javascript" type="text/javascript">HP_colorPicker_PrintBoxGrayScale();</script></div></td>
        <td align="left" valign="top" class="smalltext">
        <input type="text" value="#FFFFFF" style="padding: 3px; width: 120px;" id="hp_colorpicker_input_aply" class="smalltext" /><br />
        <input type="button" value="' . $txt['hs_sb_58'] . '" style="padding: 2px; margin-top: 4px" onclick="HP_shoutBox_setColor(true);" class="smalltext" /> <input type="button" value="' . $txt['hs_sb_64'] . '" style="padding: 2px; margin-top: 4px" onclick="HP_shoutBox_setColor(true, \'\');" class="smalltext" />
        <br />
        <br />
        ' . $txt['hs_sb_59'] . ':
        <table cellpadding="0" cellspacing="0" border="0" style="border: 1px solid #8d8d8d; margin: 2px 0 8px 0;">
        <tr><td id="hp_colorpicker_div_show" style="background-color: #FFFFFF;">
            <img border="0" src="', $settings['images_url'], '/blank.gif" width="80" height="18" alt="" /></td></tr></table>
        ' . $txt['hs_sb_60'] . ':
        <table cellpadding="0" cellspacing="0" border="0" style="border: 1px solid #8d8d8d; margin-top: 2px;">
        <tr><td id="hp_colorpicker_div_select" style="background-color: #FFFFFF;">
            <img border="0" src="', $settings['images_url'], '/blank.gif" width="80" height="18" alt="" /></td></tr></table></td>
        </tr><tr class="windowbg"><td colspan="2" align="right"><span class="smalltext"><a href="http://www.hackspark.com/scripts/smf-colorpicker_10.0.html" title="Hack&#39;s Park colorPicker" target="_blank">(cc) Hack&#39;s Park</a></span></td></tr></table>
    </div></div></td></tr></table>
            <input type="hidden" value="0" name="hdn" /><input type="hidden" value="0" name="hds" /><input type="hidden" value="0" name="hdk" /><input type="hidden" value="" name="hdcolor" /><input type="hidden" value="" name="hdbgcolor" /><input type="hidden" value="" name="hdface" />';

        // Smilies
        echo '
            <div id="hp_shoutbox_div_emos" style="display:none;margin-top:4px;text-align:center;">';

        if (!empty($HP_settings['shoutBox']['out_caritas']['postform']))
        {
            foreach ($HP_settings['shoutBox']['out_caritas']['postform'] as $smiley_row)
                foreach ($smiley_row['smileys'] as $smiley)
                    echo '
                <a href="javascript:void(0);" onclick="replaceText(\' ', $smiley['code'], '\', document.forms.shoutbox.msg); return false;"><img src="', $settings['smileys_url'], '/', $smiley['filename'], '" align="bottom" alt="', $smiley['description'], '" title="', $smiley['description'], '" /></a>';

            if (empty($smiley_row['last']))
                echo '<br />';
            if (!empty($HP_settings['shoutBox']['out_caritas']['popup']))
                echo '
                <a href="javascript:moreSmileys();">[', $txt['more_smileys'], ']</a>';
        }

        if (!empty($HP_settings['shoutBox']['out_caritas']['popup']))
        {
            echo '
            <script language="JavaScript" type="text/javascript"><!-- // -->
                var smileys = [';

            foreach ($HP_settings['shoutBox']['out_caritas']['popup'] as $smiley_row)
            {
                echo '
                    [';
                foreach ($smiley_row['smileys'] as $smiley)
                {
                    echo '
                        ["', $smiley['code'], '","', $smiley['filename'], '","', $smiley['js_description'], '"]';
                    if (empty($smiley['last']))
                        echo ',';
                }

                echo ']';
                if (empty($smiley_row['last']))
                    echo ',';
            }

            echo '];
                var smileyPopupWindow;

                function moreSmileys()
                {
                    var row, i;

                    if (smileyPopupWindow)
                        smileyPopupWindow.close();

                    smileyPopupWindow = window.open("", "add_smileys", "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=480,height=220,resizable=yes");
                    smileyPopupWindow.document.write(\'\n<html>\');
                    smileyPopupWindow.document.write(\'\n\t<head>\n\t\t<title>', $txt['more_smileys_title'], '</title>\n\t\t<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/style.css" />\n\t</head>\');
                    smileyPopupWindow.document.write(\'\n\t<body style="margin: 1ex;">\n\t\t<table width="100%" cellpadding="5" cellspacing="0" border="0" class="tborder">\n\t\t\t<tr class="titlebg"><td align="left">', $txt['more_smileys_pick'], '</td></tr>\n\t\t\t<tr class="windowbg"><td align="left">\');

                    for (row = 0; row < smileys.length; row++)
                    {
                        for (i = 0; i < smileys[row].length; i++)
                        {
                            smileys[row][i][2] = smileys[row][i][2].replace(/"/g, \'&quot;\');
                            smileyPopupWindow.document.write(\'<a href="javascript:void(0);" onclick="window.opener.replaceText(&quot; \' + smileys[row][i][0] + \'&quot;, window.opener.document.forms.shoutbox.msg); window.focus(); return false;"><img src="', $settings['smileys_url'], '/\' + smileys[row][i][1] + \'" alt="\' + smileys[row][i][2] + \'" title="\' + smileys[row][i][2] + \'" style="padding: 4px;" border="0" /></a> \');
                        }
                        smileyPopupWindow.document.write("<br />");
                    }

                    smileyPopupWindow.document.write(\'</td></tr>\n\t\t\t<tr><td style="margin:0 auto;text-align:center;" class="windowbg"><a href="javascript:window.close();\\">', $txt['more_smileys_close_window'], '</a></td></tr>\n\t\t</table>\n\t</body>\n</html>\');
                    smileyPopupWindow.document.close();
                }
            //    ]]></script>';
        }
        echo '</div>';
        // End - Smilies

        echo '
        </form></td></tr>';
    } elseif ($context['user']['is_logged'])
        echo '
        <tr><td class="windowbg" width="100%" align="left" colspan="2">
            <table cellpadding="0" cellspacing="0" width="100%" style="margin: 4px;">
            <tr><td nowrap="nowrap" valign="middle" style="padding-right: 8px;" class="smalltext">
            <b>' . $txt['hs_sb_85'] . ':</b> ' . $HP_settings['shoutBox']['out_banned']['reason'] . '<br />
            <b>' . $txt['hs_sb_86'] . ':</b> ' . $HP_settings['shoutBox']['out_banned']['end'] . '</td></tr></table>
        </td></tr>';

    echo '
        <tr><td class="windowbg2" width="100%" align="left" colspan="2">
            <table cellpadding="0" cellspacing="0" width="100%">
            <tr><td align="right" style="padding-right: 8px;">
            <span class="smalltext">' . ($HP_settings['shoutBox']['out_mod'] ? '<a href="' . $scripturl . '?action=shoutbox;sa=mod" onclick="reqWin(this.href, 750, 360); HP_shoutBox_sh(!HP_shoutBox[\'hd_msgs\'], \'msgs\'); return false;">' . $txt['hs_sb_61'] . '</a> | ' : '') . '<a href="javascript:void(0);" onclick="HP_shoutBox_getMsgs();">' . $txt['hs_sb_62'] . '</a>' . ($context['user']['is_logged'] ? '  |  <a href="' . $scripturl . '?action=shoutbox" onclick="reqWin(this.href, 750, 360); HP_shoutBox_sh(!HP_shoutBox[\'hd_msgs\'], \'msgs\'); return false;">' . $txt['hs_sb_63'] . '</a>' : '') . '</span></td>
            </tr></table>
            <div style="padding: 0;">
            <div id="hp_shoutbox_div_shouts" style="margin-top: 4px;overflow: auto;width: 99%;' . ($context['browser']['is_ie'] ? 'height: ' . $HP_settings['shoutBox']['divHeightMsgs'] . ';' : 'max-height: ' . $HP_settings['shoutBox']['divHeightMsgs'] . ';') . '">
                <script language="javascript" type="text/javascript">' . ($HP_settings['shoutBox']['out_noban'] ? '
                    HP_shoutBox_Clear();' : '') . '
                    HP_shoutBox[\'timeout\'] = setTimeout("HP_shoutBox_getMsgs();", 5000);
                </script>
            </div></div></td></tr>
        <tr class="windowbg"><td width="100%" align="left">
        <div id="hp_shoutbox_div_status">
        </div></td>
        <td align="right" nowrap="nowrap" valign="middle">
        <span class="smalltext"><a href="http://www.hackspark.com/scripts/smf-shoutbox_7.0.html" title="Hack&#39;s Park shoutBox" target="_blank">(cc) Hack&#39;s Park</a></span></td></tr></table>
        </div>
    </div>';
}


Buscar:

}

function template_main_below()
{


Añadir antes: (detrás de la llave de cierre })

// Hack's Park Shoutbox -->
if (function_exists('template_shoutbox')) template_shoutbox('main');
// <-- Hack's Park Shoutbox


Eso es todo, te debería de andar perfectamente, adjunto captura del ShoutBox de mi Foro. Añadir que desde mi Theme (BlackRainV2) tengo borrados los archivos BoardIndex.template.php y MessageIndex.template.php para que sea compatible con la mayoría de mods. que tengo instalados, y que son recogidos por el Theme Default.

Un saludo, y espero que les halla servido este Manual ;)


me pueden explicar esta parte???.........


Agregar después: (de <?php añadiendo un par de saltos de linea)
SMF 2.0.4 Obtén el mejor Hosting semi-primiun totalmente gratis. gratishttp://api.hostinger.com.ar/redir/1294621

Andrés Zc

www.radamantis.ws

Foro de soporte exclusivo a SMF, te ofrecemos el mejor soporte y te ayudamos a optimizar tu sitio al 100% Click aquí =>  www.smfpersonal.net

Advertisement: