Salta al contenuto
  • CATEGORIES
  • La Community Connect.gt
  • Presentati alla Community
  • News Ufficiali da Connect.gt
  • Internet News
  • A Scuola Di
  • Digital Marketing
  • Intelligenza Artificiale
  • SEO & GEO
  • Web Marketing e Content
  • Google Analytics e Web Analytics
  • Google Ads & Advertising
  • YouTube
  • TikTok, Instagram e altri Social
  • Google Adsense, Affiliazioni e Guadagno
  • E-Commerce
  • Coding e Sistemistica
  • Help Center: consigli per il tuo progetto
  • Hosting e Cloud
  • Coding
  • CMS & Piattaforme Self-Hosted
  • Annunci e Collaborazioni
  • Annunci Vendita e Acquisto: Pubblicità, Domini, Link e altro
  • Collaborazioni WEB e Lavoro: offro e cerco
  • Impresa, Fisco e Leggi
  • Consulenza Legale e Professioni Web
  • Consulenza Fiscale, Imprese, Startup e P.Iva
  • Gli Off Topic
  • PC, Smartphone e altri Hardware
  • Tutti i Software
  • GT Fetish Cafè
  • Discussioni
  • 0 Non letti 0
  • Recenti
  • Hashtag
  • Popolare
  • Utenti
  • Privacy
  • Termini e condizioni
  • © 2026 Search On Media Group S.r.l.
Collassa
Connect.gt
Il network Search On
Connect.gt WMF AI Festival Accademia Advanced SEO Tool AgentCy Social Media Strategies Search Tech
Registrati Accedi
Connect.gt
Stream Interest Categorie Hashtag
G

gozilla

@gozilla
Non seguire Segui
Informazioni
Post
3
Discussioni
2
Condivisioni
0
Gruppi
0
Da chi è seguito
0
Chi segue
0

Post

Recenti Migliore Controverso

  • Errore cannot redeclare function su script per copiare i post da wordpress
    G gozilla
    Coding

    Si grazie, ce l'ho fatta, fuori dal while funziona, sia prima che dopo il ciclo.

    Grz.


  • Errore cannot redeclare function su script per copiare i post da wordpress
    G gozilla
    Coding

    Ciao a tutti, scartabellando qua e la in rete ho realizzato questo script per visualizzare su homepages esterne a wordpress una preview degli ultimi articoli.
    In realtà però funziona solo se effettui una query per un solo articolo altrimenti la parte di codice che tronca il testo (subito sotto il commento si chiama troncaTesto) crea un errore: Cannot redeclare function.
    Qualcuno sa come risolvere questo problema?
    Di seguito il codice:

    <div class="news"  >  
    <?php          
    // query al database          
    $db= @mysql_connect('xxxxxxxx','xxxxxx','xxxxxx');          
    mysql_select_db('xxxxxxx' , $db);          
    $con = mysql_connect("xxxxxxxxxxx","xxxxxxx","xxxxxxxxx");          
    $sel_db = mysql_select_db("xxxxxxxxx", $con);          
    $result = mysql_query("select * FROM wp_posts WHERE post_type ='post' and post_status ='publish' ORDER BY id desc limit 1 " ,$db);          
    while ($records = mysql_fetch_assoc($result)) {                   
    
    // sostituzone caratteri speciali          
    $titolone = $records['post_title'];                           
    $titolone = str_replace("è", "&egrave;", $titolone);                  
    $titolone = str_replace("à", "&agrave;", $titolone);                  
    $titolone = str_replace("à", "&ograve;", $titolone);                  
    $titolone = str_replace("ì", "&igrave;", $titolone);                  
    $titolone = str_replace("ù", "&ugrave;", $titolone);          
    
    //stampa titolo          
    echo "<h4><a href='xxxxxxxxxx.com./index.php?p=". $records['ID'] ."' target='_blank'> ". $titolone ."</a></h4>";          
    $calend = $records['post_date'];                   
    
    //taglia corregge e stampa data          
    $calend = str_replace("-", ".", $calend);         echo substr("<span class='data-post'>".$calend,0,34);         echo "</span>";           
    
    // funzione che divide la stringa a tot caratteri senza tagliare le parole  
    //e aggiungendo in fondo (se continua) ...            
    
    function troncaTesto($testo, $caratteri=500)           
    { if (strlen($testo) <= $caratteri) return $testo;  
    $nuovo = wordwrap($testo, $caratteri, "|");           
    $nuovotesto=explode("|",$nuovo); return $nuovotesto[0]."...";          }                                                        
    
    // stampa testo e img post          
    $testo = $records['post_content'];           
    $nuovoTesto = troncaTesto($testo, 500);                   
    
    // sostituzone caratteri speciali post                           
    $nuovoTesto = str_replace("è", "&egrave;", $nuovoTesto);                  
    $nuovoTesto = str_replace("à", "&agrave;", $nuovoTesto);                  
    $nuovoTesto = str_replace("à", "&ograve;", $nuovoTesto);                  
    $nuovoTesto = str_replace("ì", "&igrave;", $nuovoTesto);                  
    $nuovoTesto = str_replace("ù", "&ugrave;", $nuovoTesto);                  
    $nuovoTesto = str_replace('target="_blank"', 'onclick="window.open(this.href);return false;" onkeypress="window.open(this.href);return false;"', $nuovoTesto);  
    
    echo "<div class='post'>".$nuovoTesto;         }         ?>               
    </div>
    

  • Incredibile malfunzionamento su slider ajax
    G gozilla
    Coding

    Ciao a tutti,credo di avere un problema di javascript: se andate su newsliguria[punto]com potete notare che lo slider in home ha un caption che presenta un titolo e un excerpt (un riassunto del post) di wordpress. La cosa strana, è che se lo fate girare un pò di volte (le immagini che ruotano sono solo 4 ) i riassunti progressivamente spariscono, prima da uno solo, poi da due e infine vedete ruotare solo le immagini dei titoli.
    A me non è mai capitato di vedere una malfunzionamento "progressivo", di solito le cose o vanno o non vanno!
    Non so che pesci prendere, di seguito vi passo il codice .js che ho leggerissimamamente modificato dall' originale, per far ruotare le immagini e i captions, e il codiche php che genera la lista di immagini.

    $(document).ready(function() {        
        
        //Execute the slideShow, set 4 seconds for each images
        slideShow(5000);
    
    });
    
    function slideShow(speed) {
    
    
        //append a LI item to the UL list for displaying caption
        $('ul.slideshow').append('<li id="slideshow-caption" class="caption"><div class="slideshow-caption-container"><h3></h3><p></p></div></li>');
    
        //Set the opacity of all images to 0
        $('ul.slideshow li').css({opacity: 0.0});
        
        //Get the first image and display it (set it to full opacity)
        $('ul.slideshow li:first').css({opacity: 1.0});
        
        //Get the caption of the first image from REL attribute and display it .attr('alt')
        $('#slideshow-caption h3').html($('ul.slideshow li:first').find('a').attr('title'));
        $('#slideshow-caption p').html($('ul.slideshow li:first').find('span.descrip'));
            
        //Display the caption
        $('#slideshow-caption').css({opacity: 0.7, bottom:0});
        
        //Call the gallery function to run the slideshow    
        var timer = setInterval('gallery()',speed);
        
        //pause the slideshow on mouse over
        $('ul.slideshow').hover(
            function () {
                clearInterval(timer);    
            },     
            function () {
                timer = setInterval('gallery()',speed);            
            }
        );
        
    }
    
    function gallery() {
    
    
        //if no IMGs have the show class, grab the first image
        var current = ($('ul.slideshow li.show')?  $('ul.slideshow li.show') : $('#ul.slideshow li:first'));
    
        //Get next image, if it reached the end of the slideshow, rotate it back to the first image
        var next = ((current.next().length) ? ((current.next().attr('id') == 'slideshow-caption')? $('ul.slideshow li:first') :current.next()) : $('ul.slideshow li:first'));
            
        //Get next image caption .attr('alt')
        var title = next.find('a').attr('title');    
        var desc = next.find('span.descrip');    
            
        //Set the fade in effect for the next image, show class has higher z-index
        next.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, 1000);
        
        //Hide the caption first, and then set and display the caption
        $('#slideshow-caption').animate({left:580}, 300, function () {
                //Display the content
                $('#slideshow-caption h3').html(title);
                $('#slideshow-caption p').html(desc);                
                $('#slideshow-caption').animate({left:405}, 500);    
        });        
    
        //Hide the current image
        current.animate({opacity: 0.0}, 1000).removeClass('show');
    
    }
    
    <ul class="slideshow" >
     <?php
     $my_query = new WP_Query('showposts=4');
     while ($my_query->have_posts()) : $my_query->the_post();
     $belin = catch_that_image();
     ?>
     
    
     <li <?php if($count == 0){ echo"class='show'";} else{ echo"";} $count++; ?>  > 
     <a href="<?php the_permalink(); ?>" title="<a href='<?php the_permalink(); ?>'><?php the_title(); ?></a>">
     <img src="vuvuvu[punto]newsliguria[punto]com/resize.php?url=<?php echo $belin ?>&size=585x250c50" alt="" /></a>
     <span class="descrip">
     <?php the_advanced_excerpt('length=160&use_words=0&no_custom=1&ellipsis=%26hellip;&exclude_tags=img');
    ?></span>
     </li>
    
     <?php endwhile; ?> </ul>
    

    Un aiutino please!

  • Accedi

  • Non hai un account? Registrati

  • Accedi o registrati per effettuare la ricerca.
  • Primo post
    Ultimo post
Home Accedi Registrati
Menu
  • CATEGORIES
  • La Community Connect.gt
  • Presentati alla Community
  • News Ufficiali da Connect.gt
  • Internet News
  • A Scuola Di
  • Digital Marketing
  • Intelligenza Artificiale
  • SEO & GEO
  • Web Marketing e Content
  • Google Analytics e Web Analytics
  • Google Ads & Advertising
  • YouTube
  • TikTok, Instagram e altri Social
  • Google Adsense, Affiliazioni e Guadagno
  • E-Commerce
  • Coding e Sistemistica
  • Help Center: consigli per il tuo progetto
  • Hosting e Cloud
  • Coding
  • CMS & Piattaforme Self-Hosted
  • Annunci e Collaborazioni
  • Annunci Vendita e Acquisto: Pubblicità, Domini, Link e altro
  • Collaborazioni WEB e Lavoro: offro e cerco
  • Impresa, Fisco e Leggi
  • Consulenza Legale e Professioni Web
  • Consulenza Fiscale, Imprese, Startup e P.Iva
  • Gli Off Topic
  • PC, Smartphone e altri Hardware
  • Tutti i Software
  • GT Fetish Cafè
  • Discussioni
  • Non letti 0
  • Recenti
  • Hashtag
  • Popolare
  • Utenti
  • Privacy
  • Termini e condizioni
  • © 2026 Search On Media Group S.r.l.