Visualizzazione risultati 1 fino 3 di 3

Discussione: Problema includendo script in un altro [era: mi potete aiutare? ...]

  1. #1
    Guest

    Angry Problema includendo script in un altro [era: mi potete aiutare? ...]

    Il file da modificare è questo:

    Codice PHP:
    <?php
    session_start
    ();
    if (!
    $client['id'])
    {
    //sorgente in caso che il visitatore non è loggato
    echo '<html><head>loggati
    </head></html>'
    ;
    }
    else
    {
    //sorgente in caso che il visitatore sia loggato
    echo ' benvenuto ';
    }
    ?>

    Lo script funziona perfettamente ma volevo modificarlo mettendo un lungo script al posto di benvenuto... l'errore è
    Codice:
    Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /membri/bigbook/themes/facebook/page.tpl.php on line 85
    Lo script lungo è questo:
    Codice HTML:
    <style type="text/css" media="all">@import "http://temanku.net/files/common_css/style.css";</style> 
    <style type="text/css" media="all">@import "http://temanku.net/themes/blue/page.css";</style> 
    <link rel="shortcut icon" href="http://temanku.net/themes/blue/ico.gif" type="image/x-icon" /> 
    <script>
    $(document).ready(function($) {
    $("#form_message").bbedit({
    enableToolbar: true,
    highlight: true,	
    enableSmileybar: true,
    tags: "b,i,u,code,quote,url,img"
    });
    });
    $(document).ready( function(){
    $("input[class=button]").attr('disabled','');
    $("input[class=button]").click( function () {
    $(this).attr('disabled','disabled');
    $(this).attr('value','Submitting');
    $(this).after('<img src="http://temanku.net/files/loading.gif" />');
    $(this).parents("form").submit();
    return false;
    });
    $(".menu li.menugen").mouseover(function() {
    $(this).removeClass("menugen");
    $(this).addClass("menuhover");
    });
    $(".menu li.menugen").mouseout(function() {
    $(this).removeClass("menuhover");
    $(this).addClass("menugen");
    });
    $('a[rel*=lightbox]').lightBox() ;
    });
    </script> 
    <script type="text/javascript"> 
    $(function(){
    $(".tipTip").tipTip();
    });
    </script> 
    <script type="text/javascript"> 
    jQuery(document).ready(function($) {
    $('a[rel*=facebox]').facebox() 
    })
    </script> 
    <script type="text/javascript"> 
    // Copyright 2006-2007 javascript-array.com
    var timeout	= 500;
    var closetimer	= 0;
    var ddmenuitem	= 0;
    // open hidden layer
    function mopen(id)
    {	
    // cancel close timer
    mcancelclosetime();
    // close old layer
    if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
    // get new layer and show it
    ddmenuitem = document.getElementById(id);
    ddmenuitem.style.visibility = 'visible'; 
    }
    // close showed layer
    function mclose()
    {
    if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
    }
    // go close timer
    function mclosetime()
    {
    closetimer = window.setTimeout(mclose, timeout);
    } 
    // cancel close timer
    function mcancelclosetime()
    {
    if(closetimer)
    {
    window.clearTimeout(closetimer);
    closetimer = null;
    }
    } 
    // close layer when click-out
    document.onclick="mopen('m1')"; 
    </script>
    </head> 
    <body> 
    <div id="topbar_box"> 
    <div id="topbar"> 
    <table width="975px" height="33" cellpadding="0" cellspacing="0"><tr> 
    <td width="125" valign="bottom" > 
    <script type="text/javascript"> 
    setInterval(function() {
    $("#vbar").load(location.href+" #vbar>*","");
    }, 18000);
    </script> 
    <a href="http://temanku.net/dashboard"><imag src="http://temanku.net/themes/blue/logo.jpg"title="Untuk kembali ke halaman Beranda silahkan klik di sini..."class="tipTip" /></a> 
    <td  width="95" margin-top="25px" align="center" ><span id="vbar"><span> 
    <ul id="sddm1"> 
    <li><a href="http://temanku.net/friends"><imag src="http://temanku.net/themes/blue/friends.png" title="My Friends"class="tipTip"></a> </li> 
    <li><a href="http://temanku.net/message"><imag src="http://temanku.net/themes/blue/messages.png" title="Inbox / Pesan Masuk"class="tipTip"  /></a> </li> 
    &nbsp;
    <li><a href="http://temanku.net/notifications"><imag src="http://temanku.net/themes/blue/notify.png" title="Notification / Pemberitahuan"class="tipTip"  /></a></li></ul></span></span> 
    </td>  
    </td> 
    <td  valign="bottom" align="left" ><span style="float: left; margin-left:6px;margin-bottom:3px;"> 
    <form action="<?=url('search/listing')?>" method="post" name="search_form"> 
    <input type="text" id="search_box" name="title" value="Search" name="search_box" onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'Search':this.value;" /> 
    <input type="submit" value="find" id="search_button" style="display:none" /> 
    </form> 
    </span></td> 
    <td align="right"  ><span style="float: right;"> 
    <ul id="sddm"> 
    <li>  <a href="http://bigbook.altervista.org/dashboard">Home</a>  </li> 
    <li>  <a href="http://bigbook.altervista.org/u/prova">Profile</a>  </li> 
    <li><a href="javascript:void();"  
    onclick="mopen('m1')" 
    onmouseout="mclosetime()">Account▼</a>                 
    <div id="m1" 
    onmouseover="mcancelclosetime()" 
    onmouseout="mclosetime()"> 
    <a href="http://temanku.net/u/prova"> 
    <img src="'.uhome().'/uploads/avatars/s_'.$client['avatar'].'"class="avatar", WIDTH=35 HEIGHT=35 BORDER=0   /></a><span style="float: left;margin-left :10px;"> prova        </span> 
    <br /> 
    <hr color ="#e4ebe4" width = "199px" align ="center"/> 
    <a href="http://bigbook.altervista.org/mobile">Mobile View</a>            <a href="http://temanku.net/browse">Find Friends</a>            <a href="http://bigbook.altervista.org/index.php?p=account/avatar">Change Profile Picture</a>            <a href="http://bigbook.altervista.org/index.php?p=account">Account Settings</a>    
    <a href="http://bigbook.altervista.org/index.php?p=account/privacy">Privacy Settings</a>   
    <a href="http://bigbook.altervista.org/member/logout">Logout</a>           
    </div> 
    </li> 
    </a> 
    </li>     
    </ul> 
    <div style="clear:both"></div> 
    </span> 
    </td> 
    </tr> 
    </table> 
    <div class="topnav_box"> 
    <ul class="topnav"> 
    <li  class="menugen" ></li></ul>  
    </div> 
    </div> 
    </div>
    </div> </li></a> </li></ul> 
    <div id="topbar_box">
    <div id="topbar">
    </table></td>
    edit:

    vi ho scritto solo una parte della pagina quindi l'errore non si potrebbe identificare contando il numero delle righe
    Ultima modifica di dreadnaut : 29-05-2011 alle ore 00.29.09 Motivo: + tag [php] per il codice

  2. #2
    L'avatar di dreadnaut
    dreadnaut non è connesso Super Moderatore
    Data registrazione
    22-02-2004
    Messaggi
    6,252

    Predefinito

    Citazione Originalmente inviato da CHELAIFACHAT Visualizza messaggio
    vi ho scritto solo una parte della pagina quindi l'errore non si potrebbe identificare contando il numero delle righe
    Allora non ci serve a nulla. Ne ci hai detto come fai ad includere uno script nell'altro.

    Se stai provando a fare copia e incolla uno dentro l'altro, prova a separarli: metti lo "script lungo" in un file a parte, chiamato qualcosa.php. Al posto del benvenuto, invece di incollare il codice, scrivi:
    Codice PHP:
    include 'qualcosa.php';
    Altrimenti devi darci più dettagli - ma non pagine di codice senza riferimenti

    Ma domani eh, buonanotte
    Ultima modifica di dreadnaut : 29-05-2011 alle ore 14.59.54 Motivo: corretto tag [php]

  3. #3
    Guest

    Predefinito

    sto cercando di cambiare il menu di un social network (jcow) il file originale da modificare è questo :
    Codice PHP:
    <?php
    /* ############################################################ *\
    Copyright (C) 2009 - 2010 jcow.net. All Rights Reserved.
    ------------------------------------------------------------------------
    The Original Code is Jcow.
    The Original Developer is the Initial Developer. The Initial Developer of the
    Original Code is jcow.net.

    \* ############################################################ */
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

    <head>
    <base href="<?=uhome()?>/" />
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta name="Generator" content="Powered by Jcow" />
    <?=$auto_redirect?>
    <style type="text/css" media="all">@import "<?php echo $uhome;?>/files/common_css/style.css";</style>
    <style type="text/css" media="all">@import "<?php echo $uhome;?>/themes/facebook/page.css";</style>
    <link rel="shortcut icon" href="<?=$uhome;?>/themes/facebook/ico.gif" type="image/x-icon" />
    <?=$tpl_vars['javascripts'];?>
    <title><?=$title?> - <?=get_gvar('site_name')?></title>
    <?=$tpl_vars['custom_profile_css']?>
    <?php
    if (strlen(get_gvar('site_keywords'))) {
    echo
    '<meta name="keywords" content="'.get_gvar('site_keywords').'" />';
    }
    ?>
    <?=$header?>
    </head>

    <body>
    <div id="topbar_box">
    <div id="topbar">
    <table width="100%" height="50" cellpadding="0" cellspacing="0"><tr>
    <td width="150" valign="bottom">
    <?php
    if ($client['id']) {
    $home = url('dashboard');
    }
    else {
    $home = uhome();
    }
    echo
    '<a href="'.$home.'"><img src="'.uhome().'/themes/facebook/logo.png" /></a>';
    ?>

    </td>
    <td valign="bottom">
    <table cellpadding="0" cellspacing="0">
    <form action="<?=url('search/listing')?>" method="post" name="search_form">
    <tr>
    <td valign="top">
    <input type="text" id="search_box" name="title" value="" name="search_box" />
    </td>
    <td>
    <input type="submit" value="find" id="search_button" style="display:none" />
    </td>
    </tr>
    </form>
    </table>
    </td>
    <?php
    if (!$client['id']) {
    echo
    '
    <td>
    <div id="fblogin" align="right">
    <table cellpadding="2" cellspacing="0">
    <form method="post" name="loginform" id="form1" action="'
    .url('member/loginpost').'" >
    <tr><td>'
    .t('Username or Email').'</td><td>'.t('Password').'</td></tr>
    <tr><td><input type="text" size="10" name="username" style="width:120px" /></td><td>
    <input type="password" size="10" name="password" style="width:120px" />
    <input type="submit" value=" '
    .t('Login').' " /></td></tr>
    <tr><td><input type="checkbox" name="remember_me" value="1" /> <span style="color:#89A0D1">'
    .t('Remember me').'</span></td>
    <td>'
    .url('member/chpass',t('Forgot password?')).'</td></tr>
    </form>
    </table>
    </div>
    </td>'
    ;
    }
    else {
    echo
    '
    <td valign="bottom" align="right">'
    .url('u/'.$client['uname'],t('Profile')).' | '.$friendslink.' | '.url('message',t('Inbox').msg_unread() ).' | '.url('notifications',t('Notifications').note_unread()).' | '.url('account',t('Account')).' | <span class="sub">'.url('member/logout',t('Logout') ).'</span>
    </td>'
    ;
    }
    ?>
    </tr>
    </table>

    <div id="jcow_community_menu">
    <ul class="menu">
    <?php
    echo '<li '.check_menu_on('home/index').'>'.url(uhome(),t('Home')).'</li>';
    if (
    is_array($community_menu)) {
    foreach (
    $community_menu as $item) {
    echo
    '<li '.check_menu_on($item['path']).'>'.url($item['path'],t($item['name'])).'</li>';
    }
    }
    ?>
    </ul>
    </div>

    </div>
    </div>


    <!-- #################### structure ################## -->

    <div id="wallpaper" style="width:100%;height:100%;overflow:hidden">
    <div id="jcow_main_box">
    <div id="jcow_main">
    <table id="appframe" cellspacing="0"><tr>
    <?php
    if ($is_cover) {

    if(
    $client['id']) {
    echo
    '<td valign="top" id="menubar_td">
    <div id="menubar">'
    ;
    echo
    '<ul id="sidebarmenu">';
    if (
    is_array($personal_menu)) {
    foreach (
    $personal_menu as $item) {
    if (
    $item['path'] != 'account') {
    echo
    '<li '.check_menu_on($item['path']).' >'.url($item['path'],
    '<div style="padding:3px 0 3px 23px;background:url('.uhome().'/modules/'.$item['app'].'/icon.png) 0 1px no-repeat">'.t($item['name']).'</div>'
    ).'</li>';
    }
    }
    }
    echo
    '</ul>';
    echo
    get_gvar('theme_block_lsidebar');
    echo
    '</div>';
    echo
    '</td>';
    }

    }

    echo
    '<td valign="top">';
    if (
    count($nav) > 2) {
    echo
    '<div id="nav">'.gen_nav($nav).'</div>';
    }
    if (
    is_array($notices)) {
    foreach (
    $notices as $notice) {
    echo
    '<div class="notice">'.$notice.'</div>';
    }
    }
    if (
    $top_title) {
    echo
    '<div style="padding:3px 0 3px 30px;background:url('.uhome().'/modules/'.$application.'/icon.png) 9px 5px no-repeat;font-size:1.5em">'.$top_title.'</div>';
    }

    echo
    $app_header;
    if (
    is_array($tab_menu)) {
    echo
    '<div id="tabmenu">';
    echo
    '<ul>';
    echo
    '<li class="tm_begin"></li>';
    echo
    tabmenu_begin();
    foreach (
    $tab_menu as $item) {
    echo
    '<li '.check_tabmenu_on($item['path']).'>'.url($item['path'],t($item['name'])).'</li>';
    }
    echo
    '<li class="tm_end"> </li>';
    echo
    '</ul>
    </div>'
    ;
    }

    if (
    is_array($buttons)) {
    echo
    '<div style="padding-left:10px;"><ul class="buttons">';
    foreach (
    $buttons as $val) {
    echo
    '<li>'.$val.'</li>';
    }
    echo
    '</ul></div>';
    }

    /*
    The "display_application_content" is the output of applications.
    The default Width is 780px.
    You may not change the Width, otherwise some applications can not be displayed correctly
    */
    echo '<table border="0" width="100%">
    <tr><td valign="top">'
    ;
    if (
    $application != 'home') {
    display_application_content();
    }
    else {
    if (!
    $client['id']) {
    echo
    '
    <style>
    body {
    background: url("themes/facebook/home_bg.jpg") top repeat-x;
    }
    </style><table>
    <tr><td valign="top" width="60%">
    <a href="'
    .url('member/signup').'"><img src="'.uhome().'/themes/facebook/welcome.jpg" alt="welcome" /></a>
    </td>
    <td valign="top">
    <h2>'
    .t('Sign up').'</h2>
    <form method="post" action="'
    .url('member/signup').'" >
    <p>
    '
    .label(t('Email Address')).'
    <input type="text" size="20" name="email" class="fpost" style="width:180px" />
    <br /><span class="sub">('
    .$invite_msg.t("We won't display your Email Address.").')</span>
    </p>

    <p>
    '
    .label(t('Username')).'
    <input type="text" size="18" class="fpost" name="username" value="'
    .$_POST['username'].'" style="width:180px" /><br />
    <span class="sub">('
    .t('4 to 18 characters, made up of 0-9,a-z').')</span>
    </p>

    <p>
    '
    .label(t('Full Name')).'
    <input type="text" size="20" name="fullname" class="fpost" style="width:180px" />
    </p>
    <p>
    '
    .label(t('Come from')).'
    <select name="location" class="inputText">'
    ;
    $locations = explode("\r\n",get_text('locations'));
    foreach(
    $locations as $location) {
    if (
    $_GET['location'] == trim($location)) {
    $selected = 'selected';
    }
    else {
    $selected = '';
    }
    echo
    '<option value="'.$location.'" '.$selected.' >'.$location.'</option>';
    }
    echo
    '</select>
    </p>
    <p>
    <input type="hidden" name="g" value="'
    .$_REQUEST['g'].'" />
    <input type="submit" style="background:#5BA239;color:white;font-size:1.5em;font-weight:bold" value="'
    .t('Sign up').'" />
    </p>


    </div>
    </div>
    </form>
    </td>
    </tr>
    </table>
    <div style="height:150px"></div>'
    ;
    }
    else {
    echo
    '
    <script type="text/javascript" src="'
    .uhome().'/js/jquery.vtricker.js"></script>
    <script>
    jQuery(document).ready(function($) {
    $(\'#recent_activites\').vTicker({
    speed: 800,
    pause: 5000,
    showItems: 4,
    animation: \'fade\',
    mousePause: false,
    height: 350,
    direction: \'down\'
    });
    });
    </script>
    <style>
    #recent_activites li{
    margin:0;
    padding:0;
    }
    </style>
    <strong>'
    .t('Community activities').'</strong>
    <div id="recent_activites">
    <ul>
    '
    ;
    $res = sql_query("SELECT s.*,u.username,u.avatar from `".tb()."streams` as s left join ".tb()."accounts as u on u.id=s.uid where s.hide!=1 order by s.id desc limit 20");
    while (
    $stream = sql_fetch_array($res)) {
    $stream['attachment'] = unserialize($stream['attachment']);
    echo
    '<li>'.stream_display($stream,'simple').'</li>';
    }
    echo
    '</ul>
    <div style="position:absolute;left:0;bottom:0px;height:20px;width:100%;background:url('
    .uhome().'/files/common_css/fade.png) repeat-x"> </div></div>';
    }
    }
    echo
    '</td>';
    if (!
    $is_cover) {
    echo
    '<td valign="top"><div style="width:170px;float:right;">
    '
    .get_gvar('theme_block_adsbar').'</div></td>';
    }

    echo
    '
    </tr></table>
    </td>'
    ;
    ?>
    </table>
    </div><!-- end jcow_application -->
    </div><!-- end jcow_application_box -->
    </div><!-- end wallpaper -->
    <div id="footer">
    <div>
    <?=$tpl_vars['language_selection']?>
    </div>
    <?=$tpl_vars['footer']?>
    <br /><br /><DIV align="right">
    <!-- do NOT remove the Jcow Attribution Information -->
    <!-- You have 3 style options:jcow_attribution(1), jcow_attribution(2), and jcow_attribution(3) -->
    <?=jcow_attribution(1);?></div>
    </div>
    <?=$footer;?>
    </body>
    </html>
    quindi vorrei sostituire questo:

    Codice PHP:
    <td valign="bottom" align="right">'.url('u/'.$client['uname'],t('Profile')).' | '.$friendslink.' | '.url('message',t('Inbox').msg_unread() ).' | '.url('notifications',t('Notifications').note_unread()).' | '.url('account',t('Account')).' | <span class="sub">'.url('member/logout',t('Logout') ).'</span>
    </
    td>
    con quello che c'è quà:
    http://bigbook.altervista.org/themes/facebook/menu.txt
    Ultima modifica di dreadnaut : 29-05-2011 alle ore 15.00.44

Tags for this Thread

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •