Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 13

Discussione: parse error

  1. #1

    Help su parse error

    Ottengo parse error alla riga 35 ma non capisco cosa sia (presumo sintassi) perchè non sono espertissimo di php

    Codice PHP:
    <?php
    /**
     * Main index page. 
     * 
     * If we're on the homepage, then we enable all of the AJAX features. If 
     * displaying a single image, then we disable the info panel and previous/next 
     * links, instead displaying the shot info. However the EXIF panel will still
     * load. 
     *
     * If the user has clicked the 'Random' page, then we automatically redirect
     * to a random page. 
     *
     * @package TheWordIn35mm
     */
     
    // Code for grabbing a random post from the database if necessary; we then redirect to the page.
    if ($_GET['do'] == 'random') {
        
    $random_id $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_type = 'post' AND post_password = '' AND post_status = 'publish' ORDER BY RAND() LIMIT 1");
        
    wp_redirect(get_permalink($random_id));
    }

    //  header.
    get_header();

    // Begin post loop.
    if (have_posts()) : while (have_posts()) : the_post(); 

        if (
    is_home() || is_single()) :

            
    //thumbConfig
            
    $thumbConfig = array('w='.im_dim(),'q=100');

            
    // post/image variables
            
    $id         $post->ID;
            
    $next_post get_next_post(false)         ? get_next_post(false)->ID 0;
            
    $prev_post get_previous_post(false)     ? get_previous_post(false)->ID 0;
            
            
    $next_post_perm get_permalink($next_post);
            
    $prev_post_perm get_permalink($prev_post);

            if (!
    is_null($image YapbImage::getInstanceFromDb($id)))
            {
                
    $w $post->image->width;
                
    $h $post->image->height;

                
    $src         str_replace("&amp;""&"$image->getThumbnailHref($thumbConfig));
                
    $w_thumb     $image->getThumbnailWidth($thumbConfig);
                
    $h_thumb     $image->getThumbnailHeight($thumbConfig);
            }

        
    ?>

        <script type="text/javascript">
        function fadeCallback() {

            document.getElementById("image-border").style.backgroundImage = "none";

            if (<?php echo($prev_post);?> != 0) {
                document.getElementById("image-nav-prevlink").style.visibility = "visible";
                document.getElementById("image-nav-prevoverlay").style.display = "block";
            }
            if (<?php echo($next_post);?> != 0) {
                document.getElementById("image-nav-nextlink").style.visibility = "visible";
                document.getElementById("image-nav-nextoverlay").style.display = "block";
            }
        }

        window.onload = function() {
            var img = document.getElementById('photo');
            
            img.onload = function(evt) {
                // using custom fader since Effect.Appear() from scriptaculous
                // lacks a few things:
                // (1) callback function to do something when appear effect completes
                // (2) work with visibility style instead of display
                fade(img, 0.5, 10, fadeCallback);
            }
            
            // set img src
            img.src = '<?php echo($src); ?>';
        };

        // clears default value out of comment box
        function clearBox(box) {
            if(box.value == box.defaultValue) {
                box.value = "";
            }
        }
        </script>

    <div id="image-container">    
        
        <div id="image-nav-links">
            <div id="image-nav-prevlink" style="visibility: hidden;">
                [url="<? echo($prev_post_perm); ?>"]&larr; previous[/url]
            </div>
            <div id="image-nav-nextlink" style="visibility: hidden;">
                [url="<? echo($next_post_perm); ?>"]next &rarr;[/url]
            </div>
            <div class="clear"></div>
        </div>

        <table id="image-table" cellpadding="0" cellspacing="0" border="0" align="center">
            <tbody>
                <tr><td></td><td id="top-tr"></td><td></td></tr>
                <tr id="center-tr">
                <td id="left-td"></td>
                <td id="center-td">
                <div id="image-border">
                    [img]<?php bloginfo('template_directory'); ?>/images/blank.gif[/img]" title="<?php the_title() ?>" style="width:<?=$w_thumb?>px; height:<?=$h_thumb?>px; visibility: hidden;" />
                    <div id="image-nav-overlay" style="width:<?=$w_thumb?>px; height:<?=$h_thumb?>px;">
                        [url="<? echo($prev_post_perm); ?>"][/url]
                        [url="<? echo($next_post_perm); ?>"][/url]
                    </div>
                </div>
                </td>
                <td id="right-td"></td>
                </tr>
                <tr><td></td><td id="bottom-tr"></td><td></td></tr>
            </tbody>
        </table>    

        <div id="image-info">
            <div class="image-title"><?php the_title() ?></div>
            <div class="image-comment">[url="javascript:void(0);"]Info + Comments (<?php comments_number(__('No Comments'), __('1 Comment'), __('% Comments')); ?>)[/url]</div>
            <div class="clear"></div>
            <div class="image-date"><?php the_date('jS F Y');?></div>
            <div class="clear"></div>
        </div>
        
        <div id="comments-container" style="display: none;">
            <div id="image-notes">
                <div id="description">
                    <h3>Notes</h3>
                    <ul>
                        [*]<?php the_content(); ?>
                    [/list]
                </div>
                <div id="exif">
                    <h3>EXIF</h3>
                    <ul><?php yapb_exif('exiftag'':''[b]''[/b]''[i]''[/i]'?>[/list]
                </div>
                <div id="exif">
                <h3>TAG</h3>
                    <?php the_tags('<ul>[*]','[*]','[/list]');?>
                </div>    
            </div>
            <div id="image-comments">
                <div id="comments">
                     <?php comments_template(); ?>
                </div>
                <div id="thanks">
                    

    Thanks for visiting. I really appreciate your support and comments!</p>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </div>    
        <?php endif;
    //debug option
    /*
    echo("home - " . is_home() . "
    ");
    echo("single - " . is_single() . "
    ");
    echo("page - " . is_page() . "
    ");
    echo("id - " . $id . "
    ");
    echo("next - " . $next_post . "
    ");
    echo("prev - " . $prev_post . "
    ");
    echo("perm - " . $post_perm . "
    ");
    echo("next - " . $next_post_perm . "
    ");
    echo("prev - " . $prev_post_perm . "
    ");
    echo("im_dim - " . im_dim() . "
    ");
    echo("w - " . $w . "
    ");
    echo("h - " . $h . "
    ");
    echo("w-th - " . $w_thumb . "
    ");
    echo("h-th - " . $h_thumb . "
    ");
    */
    ?>
    <?php 
    break; endwhile; endif;

    get_footer(); ?>
    help

  2. #2

  3. #3
    parse error non significa nulla!

    Copia e incolla l'intero messaggio di errore e indica con un commento la riga 35
    PHP LEARN - Guide, tutorial e articoli sempre aggiornati
    NUOVO: standardLib; il potente framework PHP é ora disponibile
    *******************************************
    Scarica oggi la tua copia di MtxEventManager

  4. #4
    l'errore preciso che mi restituisce la pagina è questo:

    Parse error: parse error in /wp-content/themes/theworldin35mm/index.php on line 35

    mentre il codice postato è tutto il contenuto di index.php contenuto nella cartella e a cui fa riferimento l'errore

  5. #5
    Apri il file con il notepad di Windows, poi salvalo senza modificarlo ma selezionando Codifica ANSI nella finestra Salva con Nome.

  6. #6
    fatto, lo potete scaricare da qui

    http://www.proftelia.it/index.zip

  7. #7
    Notice: Undefined index: do in K:\work\projects\test\untitled13.php on line 17

    Fatal error: Call to undefined function get_header() in K:\work\projects\test\untitled13.php on line 23

    Non ottengo alcun Parse Error...

  8. #8
    prova ad andare sulla mia home dove ho installato il template

    http://www.proftelia.it/

    con gli altri template ho il sito funzionante, con questo template invece ottengo l'errore che potrai vedere anche da solo nella home

  9. #9
    Elimina l'index.php, copia il codice che hai postato, incollalo in un nuovo file, salvalo come index.php ed esegui l'upload tramite FTP.

  10. #10
    ok riprovo

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.