• 07-06-2014, 15:35:18
    #1
    Üyeliği durduruldu
    Merhaba arkadaşlar Yandex new için Rss oluşturmam gerekiyor Bu konuda bana yardımcı olabilecek varmı acaba

    <?php
       
       // çıktıyı xml olarak ayarlıyoruz
       header("Content-type: text/xml; charset=utf8");
       
       // db bağlantı dosyan
       require_once "config.php";
       
       // başlayalım
       echo '<?xml version="1.0" encoding="utf-8"?>
       <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
       <channel>
          <title>İmctv.org</title>
          <link>http://www.imctv.org/</link>
          <language>tr</language>
          <description>İmctv.org Tarafsız haber merkezi</description>
          <generator>baran</generator>';
       
          // son eklenen 10 konuyu üye ismi ile birlikte çekelim
          $query = mysql_query("SELECT konu_id, konu_baslik, konu_link, konu_aciklama, konu_tarih, uye_kadi FROM konular
          INNER JOIN uyeler ON uyeler.uye_id = konular.konu_uid
          WHERE konu_onay = 1
          ORDER BY konu_id
          DESC LIMIT 10");
          
          // eğer vara
          if ( mysql_affected_rows() ) {
             
             // döngüye sokup işlemimizi tamamlayalım
             while ( $row = mysql_fetch_object($query) )
             {
                echo '<item>
                   <title>'.$row->konu_baslik.'</title>
                   <guid isPermaLink="true">KISALİNK VARSA</guid>
                   <link>'.url.'/'.$row->konu_link.'</link>
                   <description><![CDATA['.strip_tags($row->konu_aciklama).']]></description>
                   <dc:creator><![CDATA['.$row->uye_kadi.']]></dc:creator>
                   <pubDate>'.$row->konu_tarih.' +0300</pubDate>
                </item>';
             }
          }
       echo '<footer>Copyright © 2013 İmctv.org Tüm hakkı saklıdır. İzinsiz ve kaynak gösterilmeden kullanılması yasaktır.</footer>
       </channel>
       </rss>';

    Böyle bir kod bulup yaptım ama olmadı bilgisi olan arkadaşlar Yardımcı olursanız sevinirim..
  • 07-06-2014, 15:55:49
    #2
    Ana dizininizde yandex.php isminde bir sosya oluşturunuz. Bu dosyaya aşağıdaki verdiğim kodları kendinize göre düzenleyerek ekleyiniz:

    (Sadece wordpress içindir)

    <?php 
    if (! isset($wp_did_header)):
    if ( !file_exists( dirname(__FILE__) . '/wp-config.php') ) {
        if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $path = '';
        else $path = 'wp-admin/';
    require_once( dirname(__FILE__) . '/wp-includes/classes.php');
    require_once( dirname(__FILE__) . '/wp-includes/functions.php');
    require_once( dirname(__FILE__) . '/wp-includes/plugin.php');
    wp_die("wp-config.php dosyasinin olup olmadigini kontrol ediniz.");
    }
    $wp_did_header = true;
    require_once( dirname(__FILE__) . '/wp-config.php');
    wp();
    gzip_compression();
    require_once(ABSPATH . WPINC . '/template-loader.php');
    endif;
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    		<title>Markafem Yandex Rss</title>
    		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    		<meta http-equiv="Content-Language" content="tr" />
    </head>
    
    <body>
    <?php
    $data = '<?xml version="1.0" encoding="utf-8"?>';
    $data .= "\n".'<rss version="2.0" xmlns="http://backend.userland.com/rss2" xmlns:yandex="http://haber.yandex.com.tr"';
    $data .= "\n".'xmlns:media="http://search.yahoo.com/mrss/">';
    $data .= "\n<channel>";
    $data .= "\n<title>Markafem</title> ";
    $data .= "\n<link>http://www.markafem.com</link> ";
    $data .= "\n<description>Markafem, haber, spor, magazin, teknoloji gibi alanlarda internetin hızlı ve etkileyici değişimini uluslararası boyutta takip eden bir medya ekibidir. Markafem Türkiye ve dünya ile ilgili gündem başlıklarını ziyaretçilerine ileten başlıca haber kaynağıdır. Markafem kollektif, bağımsız ve açık sözlü tarzıyla, Sosyal Medya ekibini oluşturmuştur. Ticari faaliyetlerinin tamamını kendi bünyesinde sürdürmektedir.</description> ";
    $data .= "\n<image> ";
    $data .= "\n<url>http://www.markafem.com/wp-content/uploads/2014/01/markafemlogo1.png</url>";
    $data .= "\n<title>Markafem</title> ";
    $data .= "\n<link>http://www.markafem.com</link>";
    $data .= "\n</image> ";
    
    function filter_where($where = '') {
         $where .= " AND post_date > '" . date('Y-m-d', strtotime('-7 days')) . "'";
         return $where;
         }
    add_filter('posts_where', 'filter_where');
    
    query_posts( 'posts_per_page=1000&cat=5,13,6,8,9221,7,422,9,1491,10,1338,12&orderby=date' );
    
    if (have_posts()) : while (have_posts()) : the_post();
    $category = get_the_category();
    $content = get_the_content_feed('rss2');
    $title = get_the_title($post->post_parent);
    if ( $parent_title != the_title(' ', ' ', false) ) {
    }
    $page_id = get_post( $id );
    $link = get_permalink( $page_id );
    $desc = substr(esc_textarea( strip_tags( $content ) ),0,150)."...";
    $data .= "\n<item>
    <title>".$title."</title>
    <link>".$link."</link>
    <description>".esc_textarea( strip_tags( $desc ) )."</description>
    <author>".the_author()."</author>
    <category>".$category[0]->cat_name."</category>
    <enclosure url=\"".wp_get_attachment_url( get_post_thumbnail_id($post->ID) )."\" type=\"image/jpeg\"/>
    <pubDate>".mysql2date('D, d M Y H:i:s +0300', get_post_time('Y-m-d H:i:s', true), false)."</pubDate>
    <yandex:genre>message</yandex:genre>
    <yandex:full-text>".esc_textarea( strip_tags( $content ) )."</yandex:full-text>
    </item>";
    
    endwhile;else : endif;
    
    $data .= "\n</channel>
    </rss>";
    
    $file = 'yandex.xml';
    $fp = fopen($file, "w");
            if($fp){
                fwrite($fp, $data);
                fclose($fp);
            }  
    ?>
    </body>
    </html>
    Yandex'e ise rss feed bağlantınızı http://www.imctv.org/yandex.xml şeklinde veriniz.

    Her yeni haber girildiğinde http://www.imctv.org/yandex.php sayfasını 1 defa ziyaret edinizki gönderileri yandex.xml dosyasına, oradanda yandex haberlere yollasın sistem.
  • 07-06-2014, 16:58:34
    #3
    Üyeliği durduruldu
    Markafem adlı üyeden alıntı: mesajı görüntüle
    Ana dizininizde yandex.php isminde bir sosya oluşturunuz. Bu dosyaya aşağıdaki verdiğim kodları kendinize göre düzenleyerek ekleyiniz:

    (Sadece wordpress içindir)

    <?php 
    if (! isset($wp_did_header)):
    if ( !file_exists( dirname(__FILE__) . '/wp-config.php') ) {
        if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $path = '';
        else $path = 'wp-admin/';
    require_once( dirname(__FILE__) . '/wp-includes/classes.php');
    require_once( dirname(__FILE__) . '/wp-includes/functions.php');
    require_once( dirname(__FILE__) . '/wp-includes/plugin.php');
    wp_die("wp-config.php dosyasinin olup olmadigini kontrol ediniz.");
    }
    $wp_did_header = true;
    require_once( dirname(__FILE__) . '/wp-config.php');
    wp();
    gzip_compression();
    require_once(ABSPATH . WPINC . '/template-loader.php');
    endif;
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    		<title>Markafem Yandex Rss</title>
    		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    		<meta http-equiv="Content-Language" content="tr" />
    </head>
    
    <body>
    <?php
    $data = '<?xml version="1.0" encoding="utf-8"?>';
    $data .= "\n".'<rss version="2.0" xmlns="http://backend.userland.com/rss2" xmlns:yandex="http://haber.yandex.com.tr"';
    $data .= "\n".'xmlns:media="http://search.yahoo.com/mrss/">';
    $data .= "\n<channel>";
    $data .= "\n<title>Markafem</title> ";
    $data .= "\n<link>http://www.markafem.com</link> ";
    $data .= "\n<description>Markafem, haber, spor, magazin, teknoloji gibi alanlarda internetin hızlı ve etkileyici değişimini uluslararası boyutta takip eden bir medya ekibidir. Markafem Türkiye ve dünya ile ilgili gündem başlıklarını ziyaretçilerine ileten başlıca haber kaynağıdır. Markafem kollektif, bağımsız ve açık sözlü tarzıyla, Sosyal Medya ekibini oluşturmuştur. Ticari faaliyetlerinin tamamını kendi bünyesinde sürdürmektedir.</description> ";
    $data .= "\n<image> ";
    $data .= "\n<url>http://www.markafem.com/wp-content/uploads/2014/01/markafemlogo1.png</url>";
    $data .= "\n<title>Markafem</title> ";
    $data .= "\n<link>http://www.markafem.com</link>";
    $data .= "\n</image> ";
    
    function filter_where($where = '') {
         $where .= " AND post_date > '" . date('Y-m-d', strtotime('-7 days')) . "'";
         return $where;
         }
    add_filter('posts_where', 'filter_where');
    
    query_posts( 'posts_per_page=1000&cat=5,13,6,8,9221,7,422,9,1491,10,1338,12&orderby=date' );
    
    if (have_posts()) : while (have_posts()) : the_post();
    $category = get_the_category();
    $content = get_the_content_feed('rss2');
    $title = get_the_title($post->post_parent);
    if ( $parent_title != the_title(' ', ' ', false) ) {
    }
    $page_id = get_post( $id );
    $link = get_permalink( $page_id );
    $desc = substr(esc_textarea( strip_tags( $content ) ),0,150)."...";
    $data .= "\n<item>
    <title>".$title."</title>
    <link>".$link."</link>
    <description>".esc_textarea( strip_tags( $desc ) )."</description>
    <author>".the_author()."</author>
    <category>".$category[0]->cat_name."</category>
    <enclosure url=\"".wp_get_attachment_url( get_post_thumbnail_id($post->ID) )."\" type=\"image/jpeg\"/>
    <pubDate>".mysql2date('D, d M Y H:i:s +0300', get_post_time('Y-m-d H:i:s', true), false)."</pubDate>
    <yandex:genre>message</yandex:genre>
    <yandex:full-text>".esc_textarea( strip_tags( $content ) )."</yandex:full-text>
    </item>";
    
    endwhile;else : endif;
    
    $data .= "\n</channel>
    </rss>";
    
    $file = 'yandex.xml';
    $fp = fopen($file, "w");
            if($fp){
                fwrite($fp, $data);
                fclose($fp);
            }  
    ?>
    </body>
    </html>
    Yandex'e ise rss feed bağlantınızı http://www.imctv.org/yandex.xml şeklinde veriniz.

    Her yeni haber girildiğinde http://www.imctv.org/yandex.php sayfasını 1 defa ziyaret edinizki gönderileri yandex.xml dosyasına, oradanda yandex haberlere yollasın sistem.

    <?php 
    if (! isset($wp_did_header)):
    if ( !file_exists( dirname(__FILE__) . '/wp-config.php') ) {
    ****if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $path = '';
    ****else $path = 'wp-admin/';
    require_once( dirname(__FILE__) . '/wp-includes/classes.php');
    require_once( dirname(__FILE__) . '/wp-includes/functions.php');
    require_once( dirname(__FILE__) . '/wp-includes/plugin.php');
    wp_die("wp-config.php dosyasinin olup olmadigini kontrol ediniz.");
    }
    $wp_did_header = true;
    require_once( dirname(__FILE__) . '/wp-config.php');
    wp();
    gzip_compression();
    require_once(ABSPATH . WPINC . '/template-loader.php');
    endif;
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    ******<title>İmc Tv Yandex Rss</title>
    ******<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    ******<meta http-equiv="Content-Language" content="tr" />
    </head>
    *
    <body>
    <?php
    $data = '<?xml version="1.0" encoding="utf-8"?>';
    $data .= "\n".'<rss version="2.0" xmlns="http://backend.userland.com/rss2" xmlns:yandex="http://haber.yandex.com.tr"';
    $data .= "\n".'xmlns:media="http://search.yahoo.com/mrss/">';
    $data .= "\n<channel>";
    $data .= "\n<title>İmctv</title> ";
    $data .= "\n<link>http://www.imctv.org</link> ";
    $data .= "\n<description>imctv, haber, spor, magazin, teknoloji gibi alanlarda internetin hızlı ve etkileyici değişimini uluslararası boyutta takip eden bir medya ekibidir. İmctv Türkiye ve dünya ile ilgili gündem başlıklarını ziyaretçilerine ileten başlıca haber kaynağıdır. İmctv kollektif, bağımsız ve açık sözlü tarzıyla, Sosyal Medya ekibini oluşturmuştur. Ticari faaliyetlerinin tamamını kendi bünyesinde sürdürmektedir.</description> ";
    $data .= "\n<image> ";
    $data .= "\n<url>http://www.imctv.org/wp-content/themes/wpmedyahaber/images/logo.png</url>";
    $data .= "\n<title>İmcTv</title> ";
    $data .= "\n<link>http://www.imctv.org</link>";
    $data .= "\n</image> ";
    *
    function filter_where($where = '') {
    *****$where .= " AND post_date > '" . date('Y-m-d', strtotime('-7 days')) . "'";
    *****return $where;
    *****}
    add_filter('posts_where', 'filter_where');
    *
    query_posts( 'posts_per_page=1000&cat=5,13,6,8,9221,7,422,9,1491,10,1338,12&orderby=date' );
    *
    if (have_posts()) : while (have_posts()) : the_post();
    $category = get_the_category();
    $content = get_the_content_feed('rss2');
    $title = get_the_title($post->post_parent);
    if ( $parent_title != the_title(' ', ' ', false) ) {
    }
    $page_id = get_post( $id );
    $link = get_permalink( $page_id );
    $desc = substr(esc_textarea( strip_tags( $content ) ),0,150)."...";
    $data .= "\n<item>
    <title>".$title."</title>
    <link>".$link."</link>
    <description>".esc_textarea( strip_tags( $desc ) )."</description>
    <author>".the_author()."</author>
    <category>".$category[0]->cat_name."</category>
    <enclosure url=\"".wp_get_attachment_url( get_post_thumbnail_id($post->ID) )."\" type=\"image/jpeg\"/>
    <pubDate>".mysql2date('D, d M Y H:i:s +0300', get_post_time('Y-m-d H:i:s', true), false)."</pubDate>
    <yandex:genre>message</yandex:genre>
    <yandex:full-text>".esc_textarea( strip_tags( $content ) )."</yandex:full-text>
    </item>";
    *
    endwhile;else : endif;
    *
    $data .= "\n</channel>
    </rss>";
    *
    $file = 'yandex.xml';
    $fp = fopen($file, "w");
    ********if($fp){
    ************fwrite($fp, $data);
    ************fclose($fp);
    ********}* 
    ?>
    </body>
    </html>
    hocam deşiklikleride yaptım ama yine olmadı bir bakarmısın nerede yanlışlık yaptım acaba.
  • 07-06-2014, 17:07:10
    #4
    BaRoLi adlı üyeden alıntı: mesajı görüntüle
    <?php 
    if (! isset($wp_did_header)):
    if ( !file_exists( dirname(__FILE__) . '/wp-config.php') ) {
    ****if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $path = '';
    ****else $path = 'wp-admin/';
    require_once( dirname(__FILE__) . '/wp-includes/classes.php');
    require_once( dirname(__FILE__) . '/wp-includes/functions.php');
    require_once( dirname(__FILE__) . '/wp-includes/plugin.php');
    wp_die("wp-config.php dosyasinin olup olmadigini kontrol ediniz.");
    }
    $wp_did_header = true;
    require_once( dirname(__FILE__) . '/wp-config.php');
    wp();
    gzip_compression();
    require_once(ABSPATH . WPINC . '/template-loader.php');
    endif;
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    ******<title>İmc Tv Yandex Rss</title>
    ******<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    ******<meta http-equiv="Content-Language" content="tr" />
    </head>
    *
    <body>
    <?php
    $data = '<?xml version="1.0" encoding="utf-8"?>';
    $data .= "\n".'<rss version="2.0" xmlns="http://backend.userland.com/rss2" xmlns:yandex="http://haber.yandex.com.tr"';
    $data .= "\n".'xmlns:media="http://search.yahoo.com/mrss/">';
    $data .= "\n<channel>";
    $data .= "\n<title>İmctv</title> ";
    $data .= "\n<link>http://www.imctv.org</link> ";
    $data .= "\n<description>imctv, haber, spor, magazin, teknoloji gibi alanlarda internetin hızlı ve etkileyici değişimini uluslararası boyutta takip eden bir medya ekibidir. İmctv Türkiye ve dünya ile ilgili gündem başlıklarını ziyaretçilerine ileten başlıca haber kaynağıdır. İmctv kollektif, bağımsız ve açık sözlü tarzıyla, Sosyal Medya ekibini oluşturmuştur. Ticari faaliyetlerinin tamamını kendi bünyesinde sürdürmektedir.</description> ";
    $data .= "\n<image> ";
    $data .= "\n<url>http://www.imctv.org/wp-content/themes/wpmedyahaber/images/logo.png</url>";
    $data .= "\n<title>İmcTv</title> ";
    $data .= "\n<link>http://www.imctv.org</link>";
    $data .= "\n</image> ";
    *
    function filter_where($where = '') {
    *****$where .= " AND post_date > '" . date('Y-m-d', strtotime('-7 days')) . "'";
    *****return $where;
    *****}
    add_filter('posts_where', 'filter_where');
    *
    query_posts( 'posts_per_page=1000&cat=5,13,6,8,9221,7,422,9,1491,10,1338,12&orderby=date' );
    *
    if (have_posts()) : while (have_posts()) : the_post();
    $category = get_the_category();
    $content = get_the_content_feed('rss2');
    $title = get_the_title($post->post_parent);
    if ( $parent_title != the_title(' ', ' ', false) ) {
    }
    $page_id = get_post( $id );
    $link = get_permalink( $page_id );
    $desc = substr(esc_textarea( strip_tags( $content ) ),0,150)."...";
    $data .= "\n<item>
    <title>".$title."</title>
    <link>".$link."</link>
    <description>".esc_textarea( strip_tags( $desc ) )."</description>
    <author>".the_author()."</author>
    <category>".$category[0]->cat_name."</category>
    <enclosure url=\"".wp_get_attachment_url( get_post_thumbnail_id($post->ID) )."\" type=\"image/jpeg\"/>
    <pubDate>".mysql2date('D, d M Y H:i:s +0300', get_post_time('Y-m-d H:i:s', true), false)."</pubDate>
    <yandex:genre>message</yandex:genre>
    <yandex:full-text>".esc_textarea( strip_tags( $content ) )."</yandex:full-text>
    </item>";
    *
    endwhile;else : endif;
    *
    $data .= "\n</channel>
    </rss>";
    *
    $file = 'yandex.xml';
    $fp = fopen($file, "w");
    ********if($fp){
    ************fwrite($fp, $data);
    ************fclose($fp);
    ********}* 
    ?>
    </body>
    </html>
    hocam deşiklikleride yaptım ama yine olmadı bir bakarmısın nerede yanlışlık yaptım acaba.
    pc'nizi bi tarayın. virüs bulaşmış. skype ekleyin halledeiyim.

    skype: markafem
  • 10-06-2014, 16:48:08
    #5
    Üyeliği durduruldu
    ...