Foros del Web » Programando para Internet » PHP »

Como insertar este codigo a un archivo php.

Estas en el tema de Como insertar este codigo a un archivo php. en el foro de PHP en Foros del Web. Hola. Me gustaria que alguien me pudiera ayudar, en como insertar el siguiente codigo en un archivo php y mas concretamente en un foro smf ...
  #1 (permalink)  
Antiguo 09/03/2010, 06:28
 
Fecha de Ingreso: marzo-2010
Mensajes: 16
Antigüedad: 14 años, 1 mes
Puntos: 0
Como insertar este codigo a un archivo php.

Hola. Me gustaria que alguien me pudiera ayudar, en como insertar el siguiente codigo en un archivo php y mas concretamente en un foro smf

Código HTML:
<script type="text/javascript">

    var wr_host    = "aimfar";

    var wr_site      = xxx;

    var wr_page      = xxxx;

    var wr_board     = xxxx;

    var wr_boardsize = "1x1";

    var wr_floating  = x;

    var wr_detail    = '';

    var wr_thema     = 0;

</script>

<script type="text/javascript" src="http://cstatic.weborama.fr/js/publisher/customers/aimfar.js"></script> 
Gracias
  #2 (permalink)  
Antiguo 09/03/2010, 06:41
 
Fecha de Ingreso: enero-2008
Ubicación: /España/Galicia
Mensajes: 928
Antigüedad: 16 años, 3 meses
Puntos: 21
Respuesta: Como insertar este codigo a un archivo php.

pues es facil

Cita:
<?php
echo '<script type="text/javascript">

var wr_host = "aimfar";

var wr_site = xxx;

var wr_page = xxxx;

var wr_board = xxxx;

var wr_boardsize = "1x1";

var wr_floating = x;

var wr_detail = '';

var wr_thema = 0;

</script>

<script type="text/javascript" src="http://cstatic.weborama.fr/js/publisher/customers/aimfar.js"></script>';
?>
los <?php ?> ya tendran que estar abiertos
__________________
Compra y Vender artículos en https://www.losredactores.com o una comunidad de webmasters ? https://webeamos.com
  #3 (permalink)  
Antiguo 09/03/2010, 07:31
 
Fecha de Ingreso: marzo-2010
Mensajes: 16
Antigüedad: 14 años, 1 mes
Puntos: 0
Respuesta: Como insertar este codigo a un archivo php.

Gracias SainT90 . Pero no entiendo lo que me dices.

Si yo coloco ese código en el foro SMF me da error. Y al igual que me paso con Google Analytics, que tuve que incluir unas \ para que dejase de dar error. He intentado reproducir los cambios aquí, pero sigue con el error.

No entiendo de lenguaje técnico, así que si se puede ser lo mas didáctico posible mejor.

Gracias
  #4 (permalink)  
Antiguo 09/03/2010, 09:04
Avatar de blogger  
Fecha de Ingreso: diciembre-2005
Ubicación: frente al monitor
Mensajes: 398
Antigüedad: 18 años, 4 meses
Puntos: 12
Respuesta: Como insertar este codigo a un archivo php.

AlexJB, no se puede ser más didáctico que lo que acaba de exponer SainT90, quizá tu deberías ser más especifico en que es lo que quieres hacer, y exponer que errores te da el codigo en cuestion.
__________________
http://exegesis-biblica.com/
  #5 (permalink)  
Antiguo 09/03/2010, 10:00
 
Fecha de Ingreso: marzo-2010
Mensajes: 16
Antigüedad: 14 años, 1 mes
Puntos: 0
Respuesta: Como insertar este codigo a un archivo php.

Nuevamente gracias por intentar ayudarme.

Bien, yo si copio y pego el siguiente codigo justo antes de [/body] y sustituyo las x por los numeso correctos..

Código HTML:
<?php
echo '<script type="text/javascript">

var wr_host = "aimfar";

var wr_site = xxx;

var wr_page = xxxx;

var wr_board = xxxx;

var wr_boardsize = "1x1";

var wr_floating = x;

var wr_detail = '';

var wr_thema = 0;

</script>

<script type="text/javascript" src="http://cstatic.weborama.fr/js/publisher/customers/aimfar.js"></script>';
?> 
Mozilla me dice

Cita:
Template Parse Error!
It seems something has gone sour on the forum with the template system. This problem should only be temporary, so please come back later and try again. If you continue to see this message, please contact the administrator.

You can also try refreshing this page.
Así que no se si estoy haciendo bien las cosas, o si deberia de ir algún otro lugar o otra cosa.

Gracias.
  #6 (permalink)  
Antiguo 09/03/2010, 10:03
Avatar de blogger  
Fecha de Ingreso: diciembre-2005
Ubicación: frente al monitor
Mensajes: 398
Antigüedad: 18 años, 4 meses
Puntos: 12
Respuesta: Como insertar este codigo a un archivo php.

Por partes, para que sirve ese codigo? en que archivo lo estas pegando (en un archivo PHP o en los archivos TPL de la plantilla)?
__________________
http://exegesis-biblica.com/
  #7 (permalink)  
Antiguo 09/03/2010, 10:22
 
Fecha de Ingreso: marzo-2010
Mensajes: 16
Antigüedad: 14 años, 1 mes
Puntos: 0
Respuesta: Como insertar este codigo a un archivo php.

Bien el archivo se llama index.template.php este lo saco directamente del servidor lo modifico y lo sustituyo.
El codigo sirbe para poner publicidad de Weborama, que son una pequeña ventana que se abre a la izquierda de la pantalla con el anuncio.
  #8 (permalink)  
Antiguo 09/03/2010, 10:34
Avatar de blogger  
Fecha de Ingreso: diciembre-2005
Ubicación: frente al monitor
Mensajes: 398
Antigüedad: 18 años, 4 meses
Puntos: 12
Respuesta: Como insertar este codigo a un archivo php.

Bien, lo que me extraña es que te marque un error, pregunta... podrías copiar y pegarnos el archivo en cuestión? si es muy extenso, solo una parte, las ultimas lineas que incluyen donde quieres colocarlo.

Pudiera ser un conflicto creado por mezclar php con html, o algo asi.
__________________
http://exegesis-biblica.com/
  #9 (permalink)  
Antiguo 09/03/2010, 10:47
 
Fecha de Ingreso: marzo-2010
Mensajes: 16
Antigüedad: 14 años, 1 mes
Puntos: 0
Respuesta: Como insertar este codigo a un archivo php.

Es extenso el index.templates.php

Pongo la mitad. Si necesitas mas np.

Código PHP:
                                </center>    
banner
</center>                                                                                
</
span>';

    }
    // Otherwise they'
re a guest this time ask them to either register or login lazy bums...
    else
    {
        echo 
'                </span>
                                <script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/sha1.js"></script>

                                <form action="'
$scripturl'?action=login2" method="post" accept-charset="'$context['character_set'], '" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' $context['session_id'] . '\');"' '''>
                                    <input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
                                    <select name="cookielength">
                                        <option value="60">'
$txt['smf53'], '</option>
                                        <option value="1440">'
$txt['smf47'], '</option>
                                        <option value="10080">'
$txt['smf48'], '</option>
                                        <option value="43200">'
$txt['smf49'], '</option>
                                        <option value="-1" selected="selected">'
$txt['smf50'], '</option>
                                    </select>
                                    <input type="submit" value="'
$txt[34], '" /><br />
                                    <span class="middletext">'
$txt['smf52'], '</span>
                                    <input type="hidden" name="hash_passwrd" value="" />
                                </form>'
;
    }

    echo 
'
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>'
;

    echo 
'
        <table id="upshrinkHeader2"'
, empty($options['collapse_header']) ? '' ' style="display: none;"'' width="100%" cellpadding="4" cellspacing="0" border="0">
            <tr>'
;

    
// Show a random news item? (or you could pick one from news_lines...)
    
if (!empty($settings['enable_news']))
        echo 
'
                <td width="90%" class="titlebg2">
                    <span class="smalltext"><b>'
$txt[102], '</b>: '$context['random_news_line'], '</span>
                </td>'
;
    echo 
'
                <td class="titlebg2" align="right" nowrap="nowrap" valign="top">
                    <form action="'
$scripturl'?action=search2" method="post" accept-charset="'$context['character_set'], '" style="margin: 0;">
                        <a href="'
$scripturl'?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
                        <input type="text" name="search" value="" style="width: 190px;" />&nbsp;
                        <input type="submit" name="submit" value="'
$txt[182], '" style="width: 11ex;" />
                        <input type="hidden" name="advanced" value="0" />'
;

    
// Search within current topic?
    
if (!empty($context['current_topic']))
        echo 
'
                        <input type="hidden" name="topic" value="'
$context['current_topic'], '" />';

        
// If we're on a certain board, limit it to this board ;).
    
elseif (!empty($context['current_board']))
        echo 
'
                        <input type="hidden" name="brd['
$context['current_board'], ']" value="'$context['current_board'], '" />';

    echo 
'
                    </form>
                </td>
            </tr>
        </table>
        <center>
banner
</center>
    </div>'
;



    
// Show the menu here, according to the menu sub template.
    
template_menu();


    
// The main content should go here.
    
echo '
    <div id="bodyarea" style="padding: 1ex 0px 2ex 0px;">'
;
}

function 
template_main_below()
{
    global 
$context$settings$options$scripturl$txt;

    echo 
'
<center>    
Banner
</center>
    </div>'
;

    
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
    
echo '

    <div id="footerarea" style="text-align: center; padding-bottom: 1ex;'
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' '''">
        <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
            function smfFooterHighlight(element, value)
            {
                element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
            }
        // ]]></script>
        <table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
            <tr>
                <td width="28%" valign="middle" align="'
, !$context['right_to_left'] ? 'right' 'left''">
                    <a href="http://climamas.com/index.htm" title=""><img src="http://www.climamas.com/regresar.jpg" border="0"></a>
                </td>
                <td valign="middle" align="center" style="white-space: nowrap;">
                    '
theme_copyright(), '
                </td>
                <td width="28%" valign="middle" align="'
, !$context['right_to_left'] ? 'left' 'right''">
                    <a href="http://climamas.com/index.htm" title=""><img src="http://www.climamas.com/regresar.jpg" border="0"></a>    
                </td>
                
                
            </tr>
            <a href="http://www.contadorgratis.es/">
<img src="http://www.contadorgratis.es/count.php?alexjbforo"
border="0" alt="Contadores Web"></a><br>
<a href="http://www.contadorgratis.es">Contador de visitas unicas (desde 28-1-10)</a>
        </table>'
;

        
// Show the load time?
    
if ($context['show_load_time'])
        echo 
'
        <span class="smalltext">'
$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

    
// This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
    
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'] || $context['browser']['is_firefox'])
    {
        
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
        
echo '
        <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA['
;

        
// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
        
if ($context['browser']['is_safari'])
            echo 
'
            window.addEventListener("load", smf_codeFix, false);

            function smf_codeFix()
            {
                var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

                for (var i = 0; i < codeFix.length; i++)
                {
                    if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
                        codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
                }
            }'
;
        elseif (
$context['browser']['is_firefox'])
            echo 
'
            window.addEventListener("load", smf_codeFix, false);
            function smf_codeFix()
            {
                var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

                for (var i = 0; i < codeFix.length; i++)
                {
                    if (codeFix[i].className == "code" && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
                        codeFix[i].style.overflow = "scroll";
                }
            }'
;            
        else
            echo 
'
            var window_oldOnload = window.onload;
            window.onload = smf_codeFix;

            function smf_codeFix()
            {
                var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

                for (var i = codeFix.length - 1; i > 0; i--)
                {
                    if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
                        codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
                }

                if (window_oldOnload)
                {
                    window_oldOnload();
                    window_oldOnload = null;
                }
            }'
;

        echo 
'
        // ]]></script>'
;
    }

    echo 
'
    </div>'
;

    
// The following will be used to let the user know that some AJAX process is running
    
echo '
    <div id="ajax_in_progress" style="display: none;'
$context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' '''">'$txt['ajax_in_progress'], '</div>
</body></html>'

Lo intento insertar justo antes de </body> que es lo que me pide el distrivuidor.

Gracias

Última edición por AlexJB; 09/03/2010 a las 12:29
  #10 (permalink)  
Antiguo 10/03/2010, 16:27
 
Fecha de Ingreso: marzo-2010
Mensajes: 16
Antigüedad: 14 años, 1 mes
Puntos: 0
Respuesta: Como insertar este codigo a un archivo php.

Vamos a ver si ahora alguien me lo puede solucionar.

Tengo que introducir el siguiente codigo

Cita:
<script type="text/javascript">

var wr_host = "aimfar";

var wr_site = xxx;

var wr_page = xxxx;

var wr_board = xxxx;

var wr_boardsize = "1x1";

var wr_floating = x;

var wr_detail = '';

var wr_thema = 0;

</script>

<script type="text/javascript" src="http://cstatic.weborama.fr/js/publisher/customers/aimfar.js"></script>
antes de </body> en el archivo index.template.php que muestro a continuación el final del mismo ya que es demasiado largo para un mensaje.

Código PHP:
         // Show the [home] button.
    
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
                <td valign="top" class="maintab_' 
$current_action == 'home' 'active_back' 'back' '">
                    <a href="'
$scripturl'">' $txt[103] , '</a>
                </td>' 
$current_action == 'home' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

    
// How about the [search] button?
    
if ($context['allow_search'])
        echo (
$current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
                <td valign="top" class="maintab_' 
$current_action == 'search' 'active_back' 'back' '">
                    <a href="'
$scripturl'?action=search">' $txt[182] , '</a>
                </td>' 
$current_action == 'search' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

    
// Is the user allowed to administrate at all? ([admin])
    
if ($context['allow_admin'])
        echo (
$current_action == 'admin' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
                <td valign="top" class="maintab_' 
$current_action == 'admin' 'active_back' 'back' '">
                    <a href="'
$scripturl'?action=admin">' $txt[2] , '</a>
                </td>' 
$current_action == 'admin' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

    
// Edit Profile... [profile]
    
if ($context['allow_edit_profile'])
        echo (
$current_action == 'profile' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
                <td valign="top" class="maintab_' 
$current_action == 'profile' 'active_back' 'back' '">
                    <a href="'
$scripturl'?action=profile">' $txt[79] , '</a>
                </td>' 
$current_action == 'profile' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

    
// Go to PM center... [pm]
    
if ($context['user']['is_logged'] && $context['allow_pm'])
        echo (
$current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
                <td valign="top" class="maintab_' 
$current_action == 'pm' 'active_back' 'back' '">
                    <a href="'
$scripturl'?action=pm">' MENSAJES ' '$context['user']['unread_messages'] > '[<strong>'$context['user']['unread_messages'] . '</strong>]' '' '</a>
                </td>' 
$current_action == 'pm' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

    
// The [calendar]!
    
if ($context['allow_calendar'])
        echo (
$current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
                <td valign="top" class="maintab_' 
$current_action == 'calendar' 'active_back' 'back' '">
                    <a href="'
$scripturl'?action=calendar">' $txt['calendar24'] , '</a>
                </td>' 
$current_action == 'calendar' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

    
// the [member] list button
    
if ($context['allow_memberlist'])
        echo (
$current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
                <td valign="top" class="maintab_' 
$current_action == 'mlist' 'active_back' 'back' '">
                    <a href="'
$scripturl'?action=mlist">' $txt[331] , '</a>
                </td>' 
$current_action == 'mlist' '<td class="maintab_active_' $last '">&nbsp;</td>' '';            

    
// If the user is a guest, show [login] button.
    
if ($context['user']['is_guest'])
        echo (
$current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
                <td valign="top" class="maintab_' 
$current_action == 'login' 'active_back' 'back' '">
                    <a href="'
$scripturl'?action=login">' $txt[34] , '</a>
                </td>' 
$current_action == 'login' '<td class="maintab_active_' $last '">&nbsp;</td>' '';


    
// If the user is a guest, also show [register] button.
    
if ($context['user']['is_guest'])
        echo (
$current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
                <td valign="top" class="maintab_' 
$current_action == 'register' 'active_back' 'back' '">
                    <a href="'
$scripturl'?action=register">' $txt[97] , '</a>
                </td>' 
$current_action == 'register' '<td class="maintab_active_' $last '">&nbsp;</td>' '';


    
// Otherwise, they might want to [logout]...
    
if ($context['user']['is_logged'])
        echo (
$current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
                <td valign="top" class="maintab_' 
$current_action == 'logout' 'active_back' 'back' '">
                    <a href="'
$scripturl'?action=logout;sesc='$context['session_id'], '">' $txt[108] , '</a>
                </td>' 
$current_action == 'logout' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

    
// The end of tab section.
    
echo '
                <td class="maintab_' 
$last '">&nbsp;</td>
            </tr>    
        </table>'
;

    
// Show the start of the tab section.
    
echo '        
                <table cellpadding="0" cellspacing="0" border="0" style="margin-left: 210px;">
                <tr>
                    <td class="maintab_' 
$first '">&nbsp;</td>';
  
  
// the [member] list button
    
if ($context['allow_memberlist'])
        echo (
$current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
                <td valign="top" class="maintab_' 
$current_action == 'mlist' 'active_back' 'back' '">
                    <a href="http://climamas.com/index.htm" title="">' 
CLIMAMAS '</a>
                </td>' 
$current_action == 'mlist' '<td class="maintab_active_' $last '">&nbsp;</td>' '';                

    
// Show the [home] button.
    
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
                <td valign="top" class="maintab_' 
$current_action == 'home' 'active_back' 'back' '">
                    <a href="http://climamas.com/webcams/index.htm" title="">' 
WEBCAMS '</a>
                </td>' 
$current_action == 'home' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

    
// How about the [search] button?
    
if ($context['allow_search'])
        echo (
$current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
                <td valign="top" class="maintab_' 
$current_action == 'search' 'active_back' 'back' '">
                    <a href="http://www.climamas.com/Unha/Current_Monitor.htm" title="">' 
UNHA '</a>
                </td>' 
$current_action == 'search' '<td class="maintab_active_' $last '">&nbsp;</td>' '';
                
        
// How about the [search] button?
    
if ($context['allow_search'])
        echo (
$current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
                <td valign="top" class="maintab_' 
$current_action == 'search' 'active_back' 'back' '">
                    <a href="http://www.climamas.com/Montgarri/Current_Monitor.htm" title="">' 
MONTGARRI '</a>
                </td>' 
$current_action == 'search' '<td class="maintab_active_' $last '">&nbsp;</td>' '';
                
        
// How about the [search] button?
    
if ($context['allow_search'])
        echo (
$current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
                <td valign="top" class="maintab_' 
$current_action == 'search' 'active_back' 'back' '">
                    <a href="http://www.climamas.com/Banhs/Current_Monitor.htm" title="">' 
BANHS '</a>
                </td>' 
$current_action == 'search' '<td class="maintab_active_' $last '">&nbsp;</td>' '';                        

    
// The end of tab section.
    
echo '
                <td class="maintab_' 
$last '">&nbsp;</td>
            </tr>    
        </table>'
;    
}

// Generate a strip of buttons.
function template_button_strip($button_strip$direction 'top'$force_reset false$custom_td '')
{
    global 
$settings$buttons$context$txt$scripturl;

    
// Create the buttons...
    
foreach ($button_strip as $key => $value)
    {
        if (isset(
$value['test']) && empty($context[$value['test']]))
        {
            unset(
$button_strip[$key]);
            continue;
        }
        elseif (!isset(
$buttons[$key]) || $force_reset)
            
$buttons[$key] = '<a href="' $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' $txt[$value['text']] . '</a>';

        
$button_strip[$key] = $buttons[$key];
    }

    if (empty(
$button_strip))
        return 
'<td>&nbsp;</td>';

    echo 
'
        <td class="'
$direction == 'top' 'main' 'mirror''tab_' $context['right_to_left'] ? 'last' 'first' '">&nbsp;</td>
        <td class="'
$direction == 'top' 'main' 'mirror''tab_back">'implode(' &nbsp;|&nbsp; '$button_strip) , '</td>
        <td class="'
$direction == 'top' 'main' 'mirror''tab_' $context['right_to_left'] ? 'first' 'last' '">&nbsp;</td>';
}

?> 
En el siguiente mensaje pongo la perte debody que falta

Gracias por el que lo intente
  #11 (permalink)  
Antiguo 10/03/2010, 16:28
 
Fecha de Ingreso: marzo-2010
Mensajes: 16
Antigüedad: 14 años, 1 mes
Puntos: 0
Respuesta: Como insertar este codigo a un archivo php.

lo anterior seria

Código PHP:
Ver original
  1. <body>';
  2.  
  3.     echo '
  4.     <div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' : '', '>
  5.         <table width="100%" cellpadding="0" cellspacing="0" border="0">
  6.             <tr>
  7.                 <td class="catbg" height="32">';
  8.  
  9.                 if (empty($settings['header_logo_url']))
  10.                 echo '
  11.                     <span style="font-family: Verdana, sans-serif; font-size: 140%; ">Climamas.com
  12.  </span>';
  13.                 else
  14.                 echo '
  15.                     <img src="', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $context['forum_name'], '" />';
  16.  
  17.               echo '
  18.                     </td>
  19.                 </td>
  20.             </tr>
  21.         </table>';
  22.        
  23.  
  24.  
  25.     // display user name
  26.     echo '
  27.         <table width="100%" cellpadding="0" cellspacing="0" border="0" >
  28.             <tr>';
  29.  
  30.     if($context['user']['is_logged'])
  31.         echo '
  32.                 <td class="titlebg2" height="32">
  33.                     <span style="font-size: 130%;"> ', $txt['hello_member_ndt'], ' <b>', $context['user']['name'] , '</b></span>
  34.                 </td>';
  35.  
  36.     // display the time
  37.     echo '
  38.                 <td class="titlebg2" height="32" align="right">
  39.                     <span class="smalltext">' , $context['current_time'], '</span>';
  40.  
  41.     // this is the upshrink button for the user info section
  42.     echo '
  43.                     <a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="', $settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="margin: 0 1ex;" /></a>
  44.                 </td>
  45.             </tr>
  46.             <tr id="upshrinkHeader"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
  47.                 <td valign="top" colspan="2">
  48.                     <table width="100%" class="bordercolor" cellpadding="8" cellspacing="1" border="0" style="margin-top: 1px;">
  49.                         <tr>';
  50.  
  51.     if (!empty($context['user']['avatar']))
  52.         echo '
  53.                             <td class="windowbg" valign="middle">', $context['user']['avatar']['image'], '</td>';
  54.  
  55.     echo '
  56.                             <td colspan="2" width="100%" valign="top" class="windowbg2"><span class="middletext">';
  57.                            
  58.  
  59.     // If the user is logged in, display stuff like their name, new messages, etc.
  60.     if ($context['user']['is_logged'])
  61.     {
  62.         echo '
  63.                                 <a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> <br />
  64.                                 <a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />';
  65.  
  66.     }
  67.     // Otherwise they're a guest - send them a lovely greeting...
  68.     else
  69.         echo $txt['welcome_guest'];
  70.  
  71.     // Now, onto our second set of info, are they logged in again?
  72.     if ($context['user']['is_logged'])
  73.     {
  74.         // Is the forum in maintenance mode?
  75.         if ($context['in_maintenance'] && $context['user']['is_admin'])
  76.             echo '
  77.                                 <b>', $txt[616], '</b><br />';
  78.  
  79.         // Are there any members waiting for approval?
  80.         if (!empty($context['unapproved_members']))
  81.             echo '
  82.                                 ', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '<br />';
  83.  
  84.         // Show the total time logged in?
  85.         if (!empty($context['user']['total_time_logged_in']))
  86.         {
  87.             echo '
  88.                                 ', $txt['totalTimeLogged1'];
  89.  
  90.             // If days is just zero, don't bother to show it.
  91.             if ($context['user']['total_time_logged_in']['days'] > 0)
  92.                 echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];
  93.  
  94.             // Same with hours - only show it if it's above zero.
  95.             if ($context['user']['total_time_logged_in']['hours'] > 0)
  96.                 echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];
  97.  
  98.             // But, let's always show minutes - Time wasted here: 0 minutes ;).
  99.             echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
  100.         }
  101.         echo '
  102.        
  103.                                 </center>  
  104. <script  language="javascript"  type="text/javascript">iwsrcplus="http://codenew.impresionesweb.com/r/banner_iw.php?idrotador=61508&tamano=728x90&lgid="+((new Date()).getTime() % 2147483648) + Math.random(); document.write("<scr"+"ipt language=javascript  type=text/javascript src="+iwsrcplus+"></scr"+"ipt>");</script><noscript><iframe src="http://alt.impresionesweb.com/noscript.php?tam=728x90&idp=61508&ref=61508&cod=101656" width="728" height="90" frameborder="0" marginheight="0" marginwidth="0" scrolling="no"></iframe></noscript>
  105. </center>                                                                              
  106. </span>';
  107.  
  108.     }
  109.     // Otherwise they're a guest - this time ask them to either register or login - lazy bums...
  110.     else
  111.     {
  112.         echo '              </span>
  113.                                 <script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/sha1.js"></script>
  114.  
  115.                                 <form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
  116.                                     <input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
  117.                                     <select name="cookielength">
  118.                                         <option value="60">', $txt['smf53'], '</option>
  119.                                         <option value="1440">', $txt['smf47'], '</option>
  120.                                         <option value="10080">', $txt['smf48'], '</option>
  121.                                         <option value="43200">', $txt['smf49'], '</option>
  122.                                         <option value="-1" selected="selected">', $txt['smf50'], '</option>
  123.                                     </select>
  124.                                     <input type="submit" value="', $txt[34], '" /><br />
  125.                                     <span class="middletext">', $txt['smf52'], '</span>
  126.                                     <input type="hidden" name="hash_passwrd" value="" />
  127.                                 </form>';
  128.     }
  129.  
  130.     echo '
  131.                             </td>
  132.                         </tr>
  133.                     </table>
  134.                 </td>
  135.             </tr>
  136.         </table>';
  137.  
  138.     echo '
  139.         <table id="upshrinkHeader2"', empty($options['collapse_header']) ? '' : ' style="display: none;"', ' width="100%" cellpadding="4" cellspacing="0" border="0">
  140.             <tr>';
  141.  
  142.  
  143.  
  144.  
  145. // Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
  146. function theme_linktree()
  147. {
  148.     global $context, $settings, $options;
  149.  
  150.     echo '<div class="nav" style="font-size: smaller; margin-bottom: 2ex; margin-top: 2ex;">';
  151.  
  152.     // Each tree item has a URL and name. Some may have extra_before and extra_after.
  153.     foreach ($context['linktree'] as $link_num => $tree)
  154.     {
  155.         // Show something before the link?
  156.         if (isset($tree['extra_before']))
  157.             echo $tree['extra_before'];
  158.  
  159.         // Show the link, including a URL if it should have one.
  160.         echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a>' : $tree['name'], '</b>';
  161.  
  162.         // Show something after the link...?
  163.         if (isset($tree['extra_after']))
  164.             echo $tree['extra_after'];
  165.  
  166.         // Don't show a separator for the last one.
  167.         if ($link_num != count($context['linktree']) - 1)
  168.             echo '&nbsp;>&nbsp;';
  169.     }
  170.  
  171.     echo '</div>';
  172. }
  173.  
  174. // Show the menu up top. Something like [home] [help] [profile] [logout]...
  175. function template_menu()
  176. {
  177.     global $context, $settings, $options, $scripturl, $txt;
  178.  
  179.     // Work out where we currently are.
  180.     $current_action = 'home';
  181.     if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
  182.         $current_action = 'admin';
  183.     if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
  184.         $current_action = $context['current_action'];
  185.     if ($context['current_action'] == 'search2')
  186.         $current_action = 'search';
  187.     if ($context['current_action'] == 'theme')
  188.         $current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';
  189.  
  190.     // Are we using right-to-left orientation?
  191.     if ($context['right_to_left'])
  192.     {
  193.         $first = 'last';
  194.         $last = 'first';
  195.     }
  196.     else
  197.     {
  198.         $first = 'first';
  199.         $last = 'last';
  200.     }
  201.  
  202.     // Show the start of the tab section.
  203.     echo '
  204.             <table cellpadding="0" cellspacing="0" border="0" style="margin-left: 200px;">
  205.                 <tr>
  206.                     <td class="maintab_' , $first , '">&nbsp;</td>';

Etiquetas: Ninguno
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 06:18.