• 14-10-2008, 16:32:40
    #1
    Arkadaşlar konu altı ajax tab çalışmam var fakat tam kodları tutturamıyor yardımcı olursanız sevinirim

    şimdi ilk tab selected yani seçilmişi yorumlar yapacam
    ikincisi yorum yaz
    üçüncüsü Geri izlemeler

    Yorumlar Listesini yorum yaz b irde geri izlemeleri eklemek için ne yapmam gerekli fikri olan varmı

    bunları yaparken aşagıdaki koddan faydalanıyorum



    <?php
    require( dirname(__FILE__) . '/wp-config.php' );
    /*
    by dmRy
    http://www.dmry.net
    */
    function SonYazilar() {
        global $wpdb;
        $kac_tane_yazi_gosterilsin = 10;
        $yazilar = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status ='publish' ORDER BY ID DESC LIMIT 0,$kac_tane_yazi_gosterilsin");
        $cikti = wp2html_header();
        $cikti .= '<ul id="wp2html_ul">';
        foreach($yazilar as $yazi){
            $yazi_url=get_permalink($yazi->ID);
            $cikti .='<li><a href="'.$yazi_url.'" target="_blank" rel="nofollow">'.iconv(get_settings('blog_charset'), "UTF-8",$yazi->post_title).'</a></li>';
        }
        $cikti .= '</ul>';
        $cikti .= wp2html_footer();
        echo $cikti;
        die();
    }
    
    function src_simple_recent_comments($src_count=7, $src_length=60, $pre_HTML='', $post_HTML='') {
        global $wpdb;
        
        $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type, 
                SUBSTRING(comment_content,1,$src_length) AS com_excerpt 
            FROM $wpdb->comments 
            LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) 
            WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' 
            ORDER BY comment_date_gmt DESC 
            LIMIT $src_count";
        $comments = $wpdb->get_results($sql);
    
        $output = $pre_HTML;
        $output .= "\n<ul>";
        foreach ($comments as $comment) {
            $output .= "\n\t<strong><a href=\"" . get_permalink($comment->ID) . "#comment-" . $comment->comment_ID  . "\" title=\"on " . $comment->post_title . "\">" . $comment->comment_author . "</a></strong>: " . strip_tags($comment->com_excerpt) . "...";
        }
        $output .= "\n</ul>";
        $output .= $post_HTML;
        
        echo $output;
    
    }
    
    function wp2html_header() {
        $cikti = '<html>';
        $cikti .= '<head>';
        $cikti .= '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
        $cikti .= '<title>Wp2Html</title>';
        $cikti .= '</head>';
        $cikti .= '<body>';
        return $cikti;
    }
    function wp2html_footer() {
        $cikti = '</body>';
        $cikti .= '</html>';
        return $cikti;
    }
    switch ($_GET['git']) {
        case 'sonyazilar':
        SonYazilar();
        break;
    }
    
    switch ($_GET['git']) {
        case 'sonyorumlar':
    wp_list_categories('use_desc_for_title=0&orderby=name&hierarchical=0&title_li=');
        break;
    }
    ?>
    Temaya Ekledim kod ise

    <h3>Testing ajax comment tab menus : p </h3>
    
    
    <ul id="countrytabs" class="shadetabs">
    <li><a href="#" rel="#default" class="selected">Yorum Ekle</a></li>
    <li><a href="http://localhost/wordpress/bul.php?git=sonyorumlar" rel="countrycontainer">Geri İzleme</a></li>
    <li><a href="http://localhost/wordpress/bul.php?git=1" rel="countrycontainer">Yorumlar</a></li>
    <li><a href="http://localhost/wordpress/bul.php?git=sonyazilar" rel="countrycontainer">Son </a></li>
    </ul>
    
    <div id="countrydivcontainer" style="border:1px solid gray; width:595px; margin-bottom: 1em; padding: 10px">
    
    <p>Seçili tab </p>
    </div>
    
    <script type="text/javascript">
    
    var countries=new ddajaxtabs("countrytabs", "countrydivcontainer")
    countries.setpersist(true)
    countries.setselectedClassTarget("link") //"link" or "linkparent"
    countries.init()
    
    </script>
    Resim

  • 15-10-2008, 18:34:48
    #2
    sorunu hallettim arkadaşlar gerek kalmadı
  • 15-10-2008, 18:37:45
    #3
    Düzenli bir şekilde bizle de paylaşsan
  • 15-10-2008, 21:49:21
    #4
    basitmiş aslında benim kullandıgım ajax tab content script de olmuyormuş degişik her koda uyan ajax tab bulunca çok güzel oturdu tema ayarlamarım bitsin açıklayacam