• 05-06-2010, 19:00:25
    #1
    Üyeliği durduruldu
    Merhabalar.

    Herhangi index.html sayfasında, wordpress tabanlı bir sitenin son konularını ve son yorumlarını, sadece linkleri olacak şekilde nasıl yayınlayabilirim ?

    Misal, wp in buna benzer bir eklentisi vardı. Sidebar da, herhangi bir sitenin son konularını gösterebiliyorsun... Ben bunu wp'den bağımsız html sayfasında yapmak istiyorum...

    İnternette bir süre araştırma yaptım, bazı kodlar buldum; fakat işe yaramadı.

    Umarım yardımcı olabilirsiniz.
  • 06-06-2010, 11:39:23
    #2
    Üyeliği durduruldu
    Kodlar buldum, fakat türkçe karakter hatası verdi.
    <html>
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>Feed</title>
    </head>
    
    <body>
    
    <?
    $val = file_get_contents("http://xx.net/feed");
    $val = explode("<item>",$val);
    $count = count($val);
    $count = $count - 1;
    
    for ($i=1; $i<=$count; $i++) {
                 preg_match("/<title>(.+)<\/title>/Uism", $val[$i], $title);
        preg_match("/<link>(.+)<\/link>/Uism", $val[$i], $link);
    
            if (eregi('CDATA',$desc[1])) {
            $desc[1] = str_replace('<![CDATA[','',$desc[1]);
            $desc[1] = str_replace(']]>','',$desc[1]);
            $desc[1] = strip_tags($desc[1]);
            }
    
    echo "<a href=\"$link[1]\" target=\"_blank\">$title[1]</a><br>$desc[1]";
    
    } 
    
    ?> 
    </body>
    
    </html>
  • 06-06-2010, 14:06:43
    #4
    Üyeliği durduruldu

    Hakan verdiğin kodları deneyeceğim, mailde de gereken cevabı göndermişsin. Teşekkürler.

    Edit:
    http://blog.bilgirehberi.net/wp2html.php

    Dediğinin aynısını yaptım, fakat boş bir sayfa çıktı. Sunucu kaynaklı problem olmasa gerek değil mi?
  • 06-06-2010, 14:16:06
    #5
    BilgiRehberi adlı üyeden alıntı: mesajı görüntüle
    Kodlar buldum, fakat türkçe karakter hatası verdi.
    <html>
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>Feed</title>
    </head>
    
    <body>
    
    <?
    $val = file_get_contents("http://xx.net/feed");
    $val = explode("<item>",$val);
    $count = count($val);
    $count = $count - 1;
    
    for ($i=1; $i<=$count; $i++) {
                 preg_match("/<title>(.+)<\/title>/Uism", $val[$i], $title);
        preg_match("/<link>(.+)<\/link>/Uism", $val[$i], $link);
    
            if (eregi('CDATA',$desc[1])) {
            $desc[1] = str_replace('<![CDATA[','',$desc[1]);
            $desc[1] = str_replace(']]>','',$desc[1]);
            $desc[1] = strip_tags($desc[1]);
            }
    
    echo "<a href=\"$link[1]\" target=\"_blank\">$title[1]</a><br>$desc[1]";
    
    } 
    
    ?> 
    </body>
    
    </html>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

    bunu

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

    bunla değiştir.
  • 06-06-2010, 14:20:52
    #6
    Üyeliği durduruldu
    anarschi adlı üyeden alıntı: mesajı görüntüle
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

    bunu

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

    bunla değiştir.

    Ben daha öncede bunu denemiştim, olmamıştı. Senin yazdığını kopyalarak denedim, sonuç mükemmel.

    Teşekkürler.

    Konu Sili(Kilitle)nebilir
  • 06-06-2010, 14:37:20
    #7
    Üyeliği durduruldu
    BilgiRehberi adlı üyeden alıntı: mesajı görüntüle
    Kodlar buldum, fakat türkçe karakter hatası verdi.
    <html>
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>Feed</title>
    </head>
    
    <body>
    
    <?
    $val = file_get_contents("http://xx.net/feed");
    $val = explode("<item>",$val);
    $count = count($val);
    $count = $count - 1;
    
    for ($i=1; $i<=$count; $i++) {
                 preg_match("/<title>(.+)<\/title>/Uism", $val[$i], $title);
        preg_match("/<link>(.+)<\/link>/Uism", $val[$i], $link);
    
            if (eregi('CDATA',$desc[1])) {
            $desc[1] = str_replace('<![CDATA[','',$desc[1]);
            $desc[1] = str_replace(']]>','',$desc[1]);
            $desc[1] = strip_tags($desc[1]);
            }
    
    echo "<a href=\"$link[1]\" target=\"_blank\">$title[1]</a><br>$desc[1]";
    
    } 
    
    ?> 
    </body>
    
    </html>
    Ben Bu kodlarla yapmaya calıstım yalnız beyaz sayfa çıktı olmadı :S
  • 06-06-2010, 14:45:21
    #8
    Üyeliği durduruldu
    SeBo adlı üyeden alıntı: mesajı görüntüle
    Ben Bu kodlarla yapmaya calıstım yalnız beyaz sayfa çıktı olmadı :S

    Bende hata vermiyor şuan.
    Buradan görüntüleyebilirsin. http://bilgirehberi.net/rss/index.php
    Dosyayı indir, kendine göre düzenle. Tıkla

    Şuan sadece stilini ayarlamak kaldı...
  • 07-06-2010, 17:52:27
    #9
    Üyeliği durduruldu
    Ben daha degişik birşey yaptım.Daha basit yapması daha kolay birşey.

    <?php
    /**
     * Loads the WordPress environment and template.
     *
     * @package WordPress
     */
    
    if ( !isset($wp_did_header) ) {
    
    	$wp_did_header = true;
    
    	require_once( dirname(__FILE__) . '/wp-load.php' );
    
    	wp();
    
    	require_once( ABSPATH . WPINC . '/template-loader.php' );
    
    }
    
    ?>
    
    
    <?php query_posts('orderby=rand&showposts=20'); if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a><br>
    
    <?php endwhile;endif; ?>
    Bunla şuanda okunanlar veya rastgele yazı oluyor.Sadece isimleri ama.