Esempio n. 1
0
function build_new_items_feed($URL, $datemask)
{
    $rssout = '';
    $last_items_list_conf_r = get_opendb_config_var('feeds.new_items');
    $list_item_rs = get_last_num_items_rs($last_items_list_conf_r['total_num_items'], NULL, NULL, NULL, NULL, NULL, 'feeds');
    if (is_not_empty_array($list_item_rs)) {
        reset($list_item_rs);
        while (list(, $list_item_r) = @each($list_item_rs)) {
            $rssout .= "\n\t<item>" . "\n\t\t<title>" . rss_encoded($list_item_r['title']) . "</title>" . "\n\t\t<link>" . rss_encoded($URL . $list_item_r['item_display_url']) . "</link>" . "\n\t\t<pubDate>" . $list_item_r['update_on'] . " " . date('T') . "</pubDate>" . "\n\t\t<guid>" . rss_encoded($URL . $list_item_r['item_display_url']) . "</guid>" . "\n\t\t<description>";
            $results = fetch_item_attribute_type_rs($list_item_r['s_item_type'], 'rss_ind');
            if ($results) {
                $attribute_block = '';
                while ($item_attribute_type_r = db_fetch_assoc($results)) {
                    if (has_role_permission($item_attribute_type_r['view_perm'])) {
                        if (strlen($attribute_block) > 0) {
                            $attribute_block .= "\n";
                        }
                        $attributes_r = fetch_attribute_val_r($list_item_r['item_id'], $list_item_r['instance_no'], $item_attribute_type_r['s_attribute_type'], $item_attribute_type_r['order_no']);
                        if (is_array($attributes_r)) {
                            $attribute = "";
                            while (list(, $value) = each($attributes_r)) {
                                if (strlen($attribute) > 0) {
                                    $attribute .= ", ";
                                }
                                $attribute .= rss_encoded($value);
                            }
                            $attribute_block .= $attribute;
                        }
                    }
                }
                //while
                db_free_result($results);
                $rssout .= $attribute_block;
            }
            $rssout .= "\n\t\t</description>" . "\n\t</item>";
        }
    }
    return $rssout;
}
Esempio n. 2
0
 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') {
                 // We allow the get_display_field to handle hidden variable, in case at some stage
                 // we might want to change the functionality of 'hidden' to something other than ignore.
                 $display_type = 'hidden';
             }
             if ($item_attribute_type_r['s_field_type'] == 'ITEM_ID') {
                 $value = $item_r['item_id'];
             } else {
                 if ($item_attribute_type_r['s_field_type'] == 'UPDATE_ON') {
                     $value = $item_r['update_on'];
                 } else {
                     if (is_multivalue_attribute_type($item_attribute_type_r['s_attribute_type'])) {
                         $value = fetch_attribute_val_r($item_r['item_id'], $item_r['instance_no'], $item_attribute_type_r['s_attribute_type'], $item_attribute_type_r['order_no']);
                     } else {