query($sql); $num_rows = $site_db->get_numrows($result); $format="Y-m-d\TH:i:s+00:00"; //the time format for rss date while($image_row = $site_db->fetch_array($result)){ if (!check_media_type($image_row['image_media_file'])) { $file_src = ICON_PATH."/404.gif"; } else { if (!get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 0)) { $file_src = ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif"; } else { $file_src = get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 1); } } $image_info = @getimagesize($file_src); $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : ""; $file_src = SCRIPT_URL."/".str_replace(ROOT_PATH, "", $file_src); $thumb = "\"".$image_row['image_name']."\""; $site_template->register_vars(array( "thumbnail" => $thumb, "title" => $image_row["image_name"], "description" => $image_row["image_description"], "category_domain" => SCRIPT_URL."/categories.php?cat_id=".$image_row["cat_id"], "category" => $image_row["cat_name"], "link" => SCRIPT_URL."/details.php?image_id=".$image_row["image_id"], "date" => format_date($format,$image_row["image_date"]), )); $new_images.=$site_template->parse_template("rssitem"); } //----------------------------------------------------- //--- Print Out --------------------------------------- //----------------------------------------------------- $site_template->register_vars( array( "ctitle" => $config['site_name'], "clink" => SCRIPT_URL, "cdescription" => $config['site_name']." RSS Feed", "language" =>LANGUAGE, "ititle" =>"", "iurl" => SCRIPT_URL."/".TEMPLATE_PATH."/images/logo-rss.png", "ilink" => SCRIPT_URL, "items" => $new_images, ) ); header("Content-type: text/xml"); $site_template->print_template($site_template->parse_template($main_template)); ?>