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

Discussione: richiamare news

  1. #1
    Utente di HTML.it
    Registrato dal
    Jun 2004
    Messaggi
    92

    richiamare news

    Ciao,

    vorrei richiamare in questa home page le ultime 3 news di questa pagina.

    Che codice devo usare per richiamare le news?


    Questo è il codice php:

    // Security stuff
    unset($authortext);
    unset($archive_content);
    unset($en_paths);
    unset($en_settings);

    // Paths
    $en_paths['script'] = '.'; // Path to the Script

    // The following paths shouldn't be modified unless you know, what you're doing
    $en_paths['data'] = $en_paths['script'] . '/data'; // Path to the data (without / at the end, can become closed by htaccess)
    $en_paths['img'] = $en_paths['script'] . '/img'; // Path to the images (without / at the end)
    $en_paths['templates'] = $en_paths['script'] . '/templates'; // Path for the templatefolder (without / at the end, can become closed by htaccess)
    $en_paths['newsfile'] = $en_paths['data'] . '/news.dat'; // Path to the newsfile

    require_once($en_paths['data'] . '/settings.php');
    require_once($en_paths['data'] . '/design.php');
    require_once($en_paths['script'] . '/functions.inc.php');

    if ($en_settings['archive_header']) eval ('echo "' . en_gettemplate('archive_header') . '";');

    // start
    if ($en_settings['archive']) {

    // read in newsfile
    $newsfile = file($en_paths['newsfile']);
    $newsfilesize = sizeof($newsfile);

    if (!$en_settings['byday']) eval ('$archive_content .= "' . en_gettemplate('archive_block_start') . '";');

    for($r = 0; $r < $newsfilesize; $r++) {
    $newscontent = en_getdata(chop($newsfile[$r]), $en_newsscheme);
    $newsdate = $newscontent['date'];
    $newstime = $newscontent['time'];
    // Note: &komma; is just a placeholder and not a valid HTML-Entity and AFAICS no browser supports it
    $headline = str_replace('&komma;', ',', $newscontent['title']);
    $postername = str_replace('&komma;', ',', $newscontent['author']);
    $posteremail = str_replace('&komma;', ',', trim($newscontent['email']));
    $commentid = $newscontent['commentid'];
    $newsid = ($newsfilesize - $r);

    if ($en_settings['byday']) {
    if (!$currentdate or $newsdate != $currentdate) {
    // display headline with date
    if ($currentdate) eval ('$archive_content .= "' . en_gettemplate('archive_block_end') . '";');
    eval ('$archive_content .= "' . en_gettemplate('archive_date') . '";');
    eval ('$archive_content .= "' . en_gettemplate('archive_block_start') . '";');
    $currentdate = $newsdate;
    }
    $dateortime = $newstime;
    } else {
    $dateortime = $newsdate;
    }
    if ($en_settings['author']) eval ('$authortext = "' . en_gettemplate('archive_author') . '";');
    eval ('$archive_content .= "' . en_gettemplate('archive_line') . '";');
    }

    // close tags and display link back
    eval ('$archive_content .= "' . en_gettemplate('archive_block_end') . '";');
    eval ('echo "' . en_gettemplate('archive_main') . '";');
    eval ('echo "' . en_gettemplate('archive_backhome') . '";');
    } else {
    eval ('echo "' . en_gettemplate('archive_notactive') . '";');
    }
    if ($en_settings['archive_header']) eval ('echo "' . en_gettemplate('archive_footer') . '";');

  2. #2
    Utente di HTML.it
    Registrato dal
    Jun 2004
    Messaggi
    92
    up

  3. #3
    Utente di HTML.it
    Registrato dal
    Jun 2004
    Messaggi
    92
    niente?

  4. #4
    Utente bannato
    Registrato dal
    Apr 2004
    Messaggi
    1,392
    Originariamente inviato da lcatty
    niente?
    L'hai scaricato questo script?
    A me pare di si... (anke perchè se no lo saresti usare...)
    Me lo posti il link?
    Vado a vedere un pò...

  5. #5
    Utente di HTML.it
    Registrato dal
    Jun 2004
    Messaggi
    92
    Originariamente inviato da PaTeR
    L'hai scaricato questo script?
    A me pare di si... (anke perchè se no lo saresti usare...)
    Me lo posti il link?
    Vado a vedere un pò...
    il codice l'ho messo più in alto

  6. #6
    Utente bannato
    Registrato dal
    Apr 2004
    Messaggi
    1,392
    Originariamente inviato da lcatty
    il codice l'ho messo più in alto
    solo quella pagina?
    me lo puoi postare il link del sito dove hai scaricato questo script?

  7. #7

  8. #8
    Utente di HTML.it
    Registrato dal
    Jun 2004
    Messaggi
    92
    Originariamente inviato da lcatty
    http://www.easyscripts.de/download.p...b4af1092b4c0b6
    è la vers in inglese. Spunta Ja poi download

  9. #9
    Utente di HTML.it
    Registrato dal
    May 2001
    Messaggi
    212
    prova:

    for($r = 0; $r < 3; $r++) {

  10. #10
    Utente di HTML.it
    Registrato dal
    Jun 2004
    Messaggi
    92
    Originariamente inviato da kuba
    prova:

    for($r = 0; $r < 3; $r++) {
    è il codice esatto da mettere nella 1a pagina?

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.