Esempio n. 1
0
 function get_date($show_stars_on_review = true)
 {
     $visibility_class = '';
     if (td_util::get_option('tds_p_show_date') == 'hide') {
         $visibility_class = ' td-visibility-hidden';
     }
     $buffy = '';
     if (td_review::has_review($this->td_review) and $show_stars_on_review === true) {
         //if review show stars
         $buffy .= '<div class="entry-review-stars">';
         $buffy .= td_review::render_stars($this->td_review);
         $buffy .= '</div>';
     } else {
         $td_article_date_unix = get_the_time('U', $this->post->ID);
         $buffy .= '<time  itemprop="dateCreated" class="entry-date updated' . $visibility_class . '" datetime="' . date(DATE_W3C, $td_article_date_unix) . '" >' . get_the_time(get_option('date_format'), $this->post->ID) . '</time>';
         $buffy .= '<meta itemprop="interactionCount" content="UserComments:' . get_comments_number($this->post->ID) . '"/>';
     }
     return $buffy;
 }
 function get_review()
 {
     if (!$this->is_single) {
         return;
     }
     if (td_review::has_review($this->td_review)) {
         //print_r($this->td_review);
         $buffy = '';
         $buffy .= td_review::render_table($this->td_review);
         return $buffy;
     }
 }
Esempio n. 3
0
                    break;
            }
            $buffy .= '</td>';
            $buffy .= '</tr>';
            $buffy .= '</table>';
            return $buffy;
        }
    }
    static function hook_up()
    {
        add_filter('save_post', array(__CLASS__, 'save_post_hook'));
    }
    static function save_post_hook($post_id)
    {
        $td_review = get_post_meta($post_id, 'td_review', true);
        if (self::has_review($td_review)) {
            update_post_meta($post_id, self::$td_review_key, self::calculate_total_key_value($td_review));
            /*
                        $myFile = "d:/testFile.txt";
                        $fh = fopen($myFile, 'w') or die("can't open file");
                        $stringData = print_r($td_review, true);
                        $stringData .= self::calculate_total($td_review);
            
                        fwrite($fh, $stringData);
                        fclose($fh);
            */
        }
    }
}
td_review::hook_up();
Esempio n. 4
0
 function get_date($show_stars_on_review = true)
 {
     $visibility_class = '';
     if (td_util::get_option('tds_p_show_date') == 'hide') {
         $visibility_class = ' td-visibility-hidden';
     }
     $buffy = '';
     if ($this->is_review and $show_stars_on_review === true) {
         //if review show stars
         $buffy .= '<div class="entry-review-stars">';
         $buffy .= td_review::render_stars($this->td_review);
         $buffy .= '</div>';
     } else {
         if (td_util::get_option('tds_p_show_date') != 'hide') {
             $td_article_date_unix = get_the_time('U', $this->post->ID);
             $buffy .= '<div class="td-post-date">';
             $buffy .= '<time class="entry-date updated td-module-date' . $visibility_class . '" datetime="' . date(DATE_W3C, $td_article_date_unix) . '" >' . get_the_time(get_option('date_format'), $this->post->ID) . '</time>';
             $buffy .= '</div>';
         }
     }
     return $buffy;
 }