Пример #1
0
function build_review_stats()
{
    $avgrate = fetch_review_rating();
    if ($avgrate > 0) {
        echo "<h3>" . get_opendb_lang_var('review_stats') . "</h3>";
        echo "<dl class=\"reviewStats\">";
        $num_review = fetch_review_cnt();
        echo "<dt>" . get_opendb_lang_var('review(s)') . "</dt>";
        echo "<dd>" . $num_review . "</dd>";
        echo "<dt>" . get_opendb_lang_var('average_rating') . "</dt>";
        $attribute_type_r = fetch_attribute_type_r("S_RATING");
        echo "<dd>" . get_display_field($attribute_type_r['s_attribute_type'], NULL, 'review()', $avgrate, FALSE) . "</dd>";
        echo "</dl>";
    }
}
 function start_item($item_id, $s_item_type, $title)
 {
     $this->attribute_rs = array();
     $this->itemBuffer = "\n\t<Item>";
     $this->itemBuffer .= "\n\t\t<MovieID>{$item_id}</MovieID>";
     $this->itemBuffer .= "\n\t\t<Title>" . $this->encode($title) . "</Title>";
     $review = fetch_review_rating($item_id);
     if ($review != FALSE) {
         $this->itemBuffer .= "\n\t\t<PersonalRating>{$review}</PersonalRating>";
         //			$this->itemBuffer .= "\n\t\t<Rating>$review</Rating>";
     }
     if (isset($this->item_type_map[$s_item_type])) {
         $mediaType = $this->item_type_map[$s_item_type];
     } else {
         $mediaType = 'DVD';
         // XMM default
     }
     $this->itemBuffer .= "\n\t\t<Media>\n\t\t\t<Medium>{$mediaType}</Medium>\n\t\t</Media>";
     $this->itemBuffer .= "\n\t\t<Location>Default</Location>";
     return NULL;
 }
Пример #3
0
     }
     if ($attribute_val !== FALSE && $attribute_val !== NULL) {
         $listingObject->addAttrDisplayColumn($item_r, fetch_cached_attribute_type_r($v_column_display_config_rs[$i]['s_attribute_type']), $attribute_val);
     } else {
         $listingObject->addColumn();
     }
 } else {
     if ($v_column_display_config_rs[$i]['column_type'] == 's_field_type') {
         if ($v_column_display_config_rs[$i]['s_field_type'] == 'RATING') {
             $rating = fetch_review_rating($item_r['item_id']);
             if ($rating !== FALSE) {
                 $attribute_type_r = fetch_cached_attribute_type_r($v_column_display_config_rs[$i]['s_attribute_type']);
                 if (strlen($attribute_type_r['display_type']) == 0 || $attribute_type_r['display_type'] == 'hidden') {
                     $attribute_type_r['display_type'] = 'review';
                 }
                 $listingObject->addAttrDisplayColumn($item_r, $attribute_type_r, fetch_review_rating($item_r['item_id']));
             } else {
                 $listingObject->addColumn();
             }
         } else {
             if ($v_column_display_config_rs[$i]['s_field_type'] == 'ITEM_ID') {
                 $attribute_type_r = fetch_cached_attribute_type_r($v_column_display_config_rs[$i]['s_attribute_type']);
                 if (strlen($attribute_type_r['display_type']) == 0 || $attribute_type_r['display_type'] == 'hidden') {
                     $attribute_type_r['display_type'] = 'display';
                     $attribute_type_r['display_type_arg1'] = '%value%';
                 }
                 $listingObject->addAttrDisplayColumn($item_r, $attribute_type_r, $item_r['item_id']);
             } else {
                 if ($v_column_display_config_rs[$i]['s_field_type'] == 'CATEGORY') {
                     $listingObject->addAttrDisplayColumn($item_r, fetch_cached_attribute_type_r($item_r['catia_s_attribute_type']), fetch_attribute_val_r($item_r['item_id'], $item_r['instance_no'], $item_r['catia_s_attribute_type'], $item_r['catia_order_no']));
                 } else {
Пример #4
0
         echo "</ul>";
     }
 }
 $otherTabsClass = "tabContentHidden";
 echo "<div class=\"tabContainer\">";
 echo "<ul class=\"tabMenu\" id=\"tab-menu\">";
 echo "<li id=\"menu-details\" class=\"first activeTab\" onclick=\"return activateTab('details')\">" . get_opendb_lang_var('details') . "</li>";
 echo "<li id=\"menu-instance_info\" onclick=\"return activateTab('instance_info')\">" . get_opendb_lang_var('instance_info') . "</li>";
 if (get_opendb_config_var('item_review', 'enable') !== FALSE) {
     echo "<li id=\"menu-reviews\" onclick=\"return activateTab('reviews')\">" . get_opendb_lang_var('review(s)') . "</li>";
 }
 echo "</ul>";
 echo "<div id=\"tab-content\">";
 echo "<div class=\"tabContent\" id=\"details\">";
 if (get_opendb_config_var('item_review', 'enable') !== FALSE) {
     $average = fetch_review_rating($item_r['item_id']);
     if ($average !== FALSE) {
         echo "<p class=\"rating\">";
         echo get_opendb_lang_var('rating') . ": ";
         $attribute_type_r = fetch_attribute_type_r('S_RATING');
         echo get_display_field($attribute_type_r['s_attribute_type'], NULL, 'review()', $average, FALSE);
         echo "</p>";
     }
 }
 $results = fetch_item_attribute_type_rs($item_r['s_item_type'], 'not_instance_field_types');
 if ($results) {
     echo "<table>";
     while ($item_attribute_type_r = db_fetch_assoc($results)) {
         if (has_role_permission($item_attribute_type_r['view_perm'])) {
             $display_type = trim($item_attribute_type_r['display_type']);
             if ($HTTP_VARS['mode'] == 'printable' && $item_attribute_type_r['printable_ind'] != 'Y' || strlen($display_type) == 0 && $item_attribute_type_r['input_type'] == 'hidden') {