close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Caption info

Thread began 3/02/2011 12:27 pm by farnumfoto279323 | Last modified 3/03/2011 6:58 pm by farnumfoto279323 | 1151 views | 9 replies

farnumfoto279323

mediarss.php

Here's the link:
choosegallery.php

Here's the php file:
<?php
//make sure connections file exists
//--
$rssdir = getcwd();
chdir(dirname(__FILE__));
require('Connections/powergallery.php');
require('webassist/framework/library.php');
chdir($rssdir);
mysql_select_db($database_powergallery);
if(empty($no_xml_header)) header('Content-type: text/xml');

$gallery_id = (isset($_GET['gallery']) && is_numeric($_GET['gallery'])) ? intval($_GET['gallery']) : false;
$thumb_size = isset($_GET['thumb']) ? $_GET['thumb'] : '62c';
$full_size = isset($_GET['full']) ? $_GET['full'] : '782p';
$super_size = isset($_GET['super']) ? $_GET['super'] : false;
$url_prefix = '';

$absLink = dirname(__FILE__);
$assumedRoot = (empty($_GET['local'])?$virtualdir:"") . "/".(abs2rel($absLink,$site_root)). "/";
$assumedRoot = str_replace("//", "/", $assumedRoot);
$WAGLOBAL_Root_URL = ((isset($_SERVER['SERVER_PROTOCOL']) && strpos($_SERVER['SERVER_PROTOCOL'], 'HTTPS') !== false) ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] .( (isset($_SERVER['SERVER_PORT'])&& $_SERVER['SERVER_PORT'] != 80)?":".$_SERVER['SERVER_PORT']:"") . $assumedRoot;

//global settings
$wa_settings = array();
$result = mysql_query('SELECT * FROM wa_settings');
while($row = mysql_fetch_assoc($result)) {
$wa_settings[$row['name']] = $row['value'];
}

//get first gallery id if none specified
if(!$gallery_id) {
$gallery_id = mysql_result(mysql_query('
SELECT COALESCE(id, 0) AS id
FROM pg1_gallery
ORDER BY id ASC LIMIT 0, 1'), 0, 'id');
}

//get url prefix if not set to local
if(empty($_GET['local'])) {
$url_prefix = $WAGLOBAL_Root_URL;
}

//gallery prefix
$gallery_prefix = 'images/' . $gallery_id . '/';
$url_prefix .= $gallery_prefix;
$gallery_prefix = realpath(dirname(__FILE__)) . '/' . $gallery_prefix;

if(!function_exists('xmlencode')) {
function xmlencode($s) {
return htmlspecialchars($s);
}
}

$result_gallery = mysql_query('
SELECT *
FROM pg1_gallery
WHERE id = ' . $gallery_id);

if(mysql_num_rows($result_gallery) == 1) {
$row_gallery = mysql_fetch_assoc($result_gallery);

echo '<?xml version="1.0" encoding="utf-8" standalone="yes"?>';
echo '<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom">';
echo '<channel><title>' . xmlencode($row_gallery['title']) . '</title><link></link><description></description><generator>PowerGallery by WebAssist</generator>';

$result = mysql_query('
SELECT *
FROM pg1_gallery_images
WHERE gallery_id = ' . $gallery_id . "
ORDER BY display_order ASC");

if(mysql_num_rows($result) > 0) {
while($row = mysql_fetch_assoc($result)) {
//get image info
$thumb_file = $row['file_prefix'] . '_' . $thumb_size . '.' . $row['file_ext'];
$thumb_imagesize = @getimagesize($gallery_prefix . $thumb_file);

$full_file = $row['file_prefix'] . '_' . $full_size . '.' . $row['file_ext'];
$full_imagesize = @getimagesize($gallery_prefix . $full_file);

if(!empty($super_size)) {
$super_size_file = $row['file_prefix'] . '_' . $super_size . '.' . $row['file_ext'];
$super_size_imagesize = @getimagesize($gallery_prefix . $super_size_file);
}

//create item
echo '<item>';
echo '<title>' . xmlencode($row['title']) . '</title><description>' . xmlencode($row['description']) . '</description><link></link>';
echo '<media:title>' . xmlencode($row['title']) . '</media:title><media:description>' . xmlencode($row['description']) . '</media:description>';
echo '<media:thumbnail url="' . $url_prefix . $thumb_file . '" type="' . $thumb_imagesize['mime'] . '" ' . $thumb_imagesize[3] . ' />';
echo '<media:content url="' . $url_prefix . $full_file . '" type="' . $full_imagesize['mime'] . '" ' . $full_imagesize[3] . ' />';
if(!empty($super_size)) {
echo '<media:supersize url="' . $url_prefix . $super_size_file . '" type="' . $super_size_imagesize['mime'] . '" ' . $super_size_imagesize[3] . ' />';
}
echo '</item>';
}
}

echo '</channel>';å
echo '</rss>';
}
?>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...