PDA

View Full Version : RSS - Why no XML page?


biggest_apple
01-23-2005, 09:53 PM
I just finished getting my photoblog site designed but I noticed that for some reason this new version of Pixelpost isn't linking to an RSS XML plage ( in the footer), but instead is offering up a file to be downloaded. Can anyone tell me how I can get it to direct to an XML page please?

Thanks!

blinking8s
01-24-2005, 05:18 AM
I am interested in an XML rss page too

Anonymous
01-24-2005, 08:08 AM
I seem to remember that Pixelpost 1.0 did produce an XML page so it should be easily possible.

biggest_apple
01-27-2005, 03:08 PM
That's what I recall as well, but if anyone can offer a solution - I'd really appreciate it.

biggest_apple
01-28-2005, 07:08 PM
BUMP

jus
02-04-2005, 06:57 AM
does anyone have a copy of the v1.0 index.php page that might give clues as to how to code this? I'd be very interested!

Thanks.

biggest_apple
02-04-2005, 09:14 AM
I've still got a copy. For what it's worth - this is the index.php code from 1.0. If this lends clues please let us know:

<?php

// ################################################## ########################################//
// PIXELPOST VERSION 1.0 - admin script | PHOTOBLOG PUNK SOFTWARE BY PUNK@PIXELPUNK.SE
// ################################################## ########################################//

// admin.php version 1.2

require("pixelpost_cfg");
/* start up mysql */
mysql_connect($pixelpost_db_host, $pixelpost_db_user, $pixelpost_db_pass) || die("Error: ". mysql_error());
mysql_select_db($pixelpost_db_pixelpost) || die("Error: ". mysql_error());

// check to see if it's installed
$check = mysql_query("select * from pixelpost limit 0,1");
if(!$check) {
header("Location: install.php");
exit();
}

$cfgquery = mysql_query("select * from pixelpost_config");
$cfgrow = mysql_fetch_array($cfgquery);
$upload_dir = $cfgrow['imagepath'];

if($_GET['x'] == "login") {
$cfgrow_password = base64_decode($cfgrow['password']);
if(($cfgrow['admin'] == $_POST['user']) AND ($cfgrow_password == $_POST['password'])) {
// login is valid, set cookie
$set_admin = base64_encode($_POST['user']);
setcookie("pixelpost_admin",$set_admin,time() +60*60*60*60);
header("Location:index.php");
unset($login);
}
} // if (login = yes) end

if($_GET['x'] == "logout") {
setcookie("pixelpost_admin","nope",time() -60);
header("Location:index.php");
}
if(!isset($_COOKIE['pixelpost_admin'])) {
// cookie is not set, send them to a form
$login = "true";
} else {
// cookie exists, check for validity
$cookie = base64_decode($_COOKIE['pixelpost_admin']);
if($cfgrow['admin'] != $cookie) { $login = "true"; }
}


?>
<html><head><title>PIXELPOST ADMIN</title>
<style type='text/css'>
body {
background:#fff;
margin:0px;
padding:0px;
text-align:center;
font-family:Verdana, Helvetica, sans-serif;
font-size:12px;
color:#333;
}
#wrapper {
margin:0px auto;
padding-top:0px;
padding-left:0px;
padding-right:0px;
padding-bottom:0px;
width:600px;
text-align:left;
background:#f5f5f5;
border-top:0px;
border-left:0px;
border-right:0px;
border-bottom:1px solid #333;
}
#header {
border-top:0px dotted #444;
border-bottom:1px solid #444;
border-right:0px;
border-left:0px;
margin:0px 0px;
padding-top:15px;
padding-bottom:15px;
padding-left:10px;
padding-right:0px;
background:#444;
font-family:Helvetica, verdana, sans-serif;
font-size:14px;
font-weight:bold;
color:orange;
}
#header a {
color:orange;
text-decoration:none;
}
#header a:hover {
color:#fff;
text-decoration:none;
}
#caption {
border-top:0px dotted #444;
border-bottom:1px solid #444;
border-right:0px;
border-left:0px;
margin:0px 0px;
padding-top:5px;
padding-bottom:5px;
padding-left:10px;
padding-right:0px;
background:orange;
font-family:Helvetica, verdana, sans-serif;
font-size:14px;
font-weight:bold;
color:#fff;
}
#jcaption {
border-top:1px dotted #444;
border-bottom:1px dotted #444;
border-right:0px;
border-left:0px;
margin:0px 0px;
padding-top:3px;
padding-bottom:3px;
padding-left:10px;
padding-right:0px;
font-family:Helvetica, verdana, sans-serif;
font-size:10px;
font-weight:bold;
color:#000;
background:#999;
}
#caption a {
color:#fff;
text-decoration:none;
}
#caption a:hover {
color:#444;
text-decoration:none;
}
#navigation {
margin:0px;
padding-top:5px;
padding-bottom:5px;
padding-left:0px;
padding-right:0px;
background:#f5f5f5;
color:#444;
font-size:9px;
font-family:Verdana, Helvetica, sans-serif;
border-top:0px dotted #444;
border-bottom:1px solid #444;
border-right:0px;
border-left:0px;
}
#navigation a {
color:#444;
text-decoration:none;
padding:5px;
}
#navigation a:hover {
background:orange;
padding:5px;
border-top:0px;
border-bottom:0px;
border-left:1px solid #444;
border-right:1px solid #444;
}
#content {
border:0px solid #000;
margin:0px 0px;
padding-top:10px;
padding-bottom:0px;
padding-left:10px;
padding-right:0px;
font-size:10px;
}
#logo {
position:relative;
float:left;
border:0px;
margin:0px 18px;
padding:0px;
}
#footer {
color:#666;
font-size:10px;
}
#content ul {
list-style:square;
display:block;
}
#content ul b {
color:orange;
}
#content ul a {
text-decoration:none;
color:#444;
padding:5px;
}
#content ul a:hover {
text-decoration:underline;
color:#000;
}
</style>
<script language='javascript'>
<!-- BEGIN
function flip(rid)
{
current=(document.getElementById(rid).style.displa y == 'none') ? 'block' : 'none';
document.getElementById(rid).style.display = current;
}
// End -->
</script>
</head><body>
<div id="wrapper">

<?php
if($login == "true") {
?>
<div id="caption">
Welcome to Pixelpost Admin - You need to login.
</div>
<div id='jcaption'>
Login sets a cookie
</div>
<div id="content">
<form method="post" action="<?php echo $PHP_SELF; ?>?x=login">
Username<br>
<input type="text" name="user" class="input"><p>
Password<br>
<input type="password" name="password" class="input"><p>
<input type="submit" value="Login">
</form>
</div>
<?php
exit();
}
?>

<div id="header">
<a href="index.php">Administration</a> for <a href="../"><?php echo $cfgrow['sitetitle']; ?></a>
</div>

<div id="navigation">
<a href="<?php echo $PHP_SELF; ?>?">NEW IMAGE</a>
<a href="<?php echo $PHP_SELF; ?>?view=images">IMAGES</a>
<a href="<?php echo $PHP_SELF; ?>?view=categories">CATEGORIES</a>
<a href="<?php echo $PHP_SELF; ?>?view=comments">COMMENTS</a>
<a href="<?php echo $PHP_SELF; ?>?view=options">OPTIONS</a>
<a href="<?php echo $PHP_SELF; ?>?view=info">GENERAL INFO</a>
<a href="<?php echo $PHP_SELF; ?>?x=logout">LOGOUT</a>
</div>
<!-- end navigation -->

<?php
// if no page is specified return a new post / image upload thing
if($_GET['view'] == "") {
?>
<div id='jcaption'>
Post a New Image to the Blog
</div>
<div id="content">
<form method="post" action="<?php echo $PHP_SELF; ?>?x=save" enctype="multipart/form-data">
Title<br />
<input type="text" name="headline" style="width:300px;" /><p />
Text<br />
<textarea name="body" style="width:300px;height:100px;"></textarea><p />
Category<br />
<select name="category">
<?php
$query = mysql_query("select * from pixelpost_categories order by name");
while(list($id,$name) = mysql_fetch_row($query)) {
$name = pullout($name);
echo "<option value='$id'>$name</option>\n";
}
?>
</select><p />
Image<p />
<input name="userfile" type="file" /><p />
<hr />
<p />
<input type="submit" value="Upload" />
</form>
</div>

<?php
// save new post
if($_GET['x'] == "save") {
$headline = addslashes($_POST['headline']);
$body = addslashes($_POST['body']);
$datetime = date("Y-m-d H:i:s");
if($headline == "") {
echo "<div id='jcaption'>Missing data</div><div id='content'>
You need at least a title for your image, and an image.</div><p />";
exit;
}

$category = $_POST['category'];
// prepare the file
if($_FILES['userfile'] != "") {
$uploadfile = $upload_dir. $_FILES['userfile']['name'];
if(move_uploaded_file($_FILES['userfile']['tmp_nam e'], $uploadfile)) {
chmod($uploadfile, 0644);
$result = check_upload($_FILES['userfile']['error']);
$filnamn = $_FILES['userfile']['name'];
$filtyp = $_FILES['userfile']['type'];
$filstorlek = $_FILES['userfile']['size'];
$status = "ok";
} else {
// something went wrong, try to describe what
echo "Error";
$result = check_upload($_FILES['userfile']['error']);
echo "<br>$result<hr>";
$status = "no";
} // end move
} // end prepare of file
// insert post in mysql
$image = $filnamn;
if($status == "ok") {
$query = "insert into pixelpost(id,datetime,headline,body,image, category)
VALUES('NULL','$datetime','$headline','$body','$im age','$category')";
$result = mysql_query($query) || die("Error: ".mysql_error());
// done
echo "
<div id='caption'>
POSTED: $headline
</div>
<div id='content'>
$body<br>
$datetime<p>
<img src='../images/$filnamn' />
</div>
";
//create thumbnail
if($gd_info = gd_info()) {
$thumbnail = "$filnamn";
$thumbnail = createthumbnail(array("file" => $thumbnail, "max_width" => "100", "max_height" => "75"));
}
} // end status ok
} // end save
} // end view=null

// view = options
if($_GET['view'] == "options") {
// update admin user and password
if($_GET['optaction'] == "updateadmin") {
$new_pass = base64_encode($_POST['new_admin_pass']);
$upquery = mysql_query("update pixelpost_config set admin='".$_POST['new_admin_user']."', password='$new_pass' where admin='".$cfgrow['admin']."'");
$result = mysql_query($upquery) ||("Error: ".mysql_error());
echo "<div id='jcaption'>Admin updated</div><div id='content'>You might have to login again.</div><p />";
}
// update imagepath
if($_GET['optaction'] == "updateimagepath") {
$upquery = mysql_query("update pixelpost_config set imagepath='".$_POST['new_image_path']."' where admin='".$cfgrow['admin']."'");
$result = mysql_query($upquery) ||("Error: ".mysql_error());
echo "<div id='jcaption'>Imagepath updated</div><div id='content'>Has set a new path to images-folder.</div><p />";
}
// update templatefile
if($_GET['optaction'] == "updatetemplate") {
$upquery = mysql_query("update pixelpost_config set template='".$_POST['new_template']."' where admin='".$cfgrow['admin']."'");
$result = mysql_query($upquery) ||("Error: ".mysql_error());
echo "<div id='jcaption'>Template updated</div><div id='content'>Updated template choice.</div><p />";
}
// update site title
if($_GET['optaction'] == "updatetitle") {
$upquery = mysql_query("update pixelpost_config set sitetitle='".$_POST['new_site_title']."' where admin='".$cfgrow['admin']."'");
$result = mysql_query($upquery) ||("Error: ".mysql_error());
echo "<div id='jcaption'>Site Title updated</div><div id='content'>Title of your site updated.</div><p />";
}
// update calendar
if($_GET['optaction'] == "updatecalendar") {
$upquery = mysql_query("update pixelpost_config set calendar='".$_POST['cal']."'");
$result = mysql_query($upquery) ||("Error: ".mysql_error());
echo "<div id='jcaption'>Calendar choice updated</div><div id='content'>Updated choice of calendar.</div><p />";
}
// update thumbnails
if($_GET['optaction'] == "updatethumbnails") {
if($gd_info = gd_info()) {
$thumbnail_counter = 0;
$max_width = $_POST['new_dimension_x'];
$max_height = $_POST['new_dimension_y'];
$dir = "../images"; // images folder
if($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if($file != "." && $file != "..") {
$thumbnail = createthumbnail(array("file" => $file, "max_width" => $max_width, "max_height" => $max_height));
}
}
closedir($handle);
echo "<div id='jcaption'>Thumbnails updated</div><div id='content'>$thumbnail_counter thumbnails updated.</div><p />";
}
}
} // end update thumbnails

$decoded_pass = base64_decode($cfgrow['password']);
echo "
<div id='caption'>
OPTIONS
</div>
<div id='jcaption'>
ADMIN USER & PASSWORD
</div>
<div id='content'>
<form method='post' action='$PHP_SELF?view=options&optaction=updat eadmin'>
User:
<input type='text' name='new_admin_user' value='".$cfgrow['admin']."' />
Password:
<input type='text' name='new_admin_pass' value='$decoded_pass' />
<input type='submit' value='Update' />
</form>
</div>
<div id='jcaption'>
SITE TITLE
</div>

<div id='content'>
<form method='post' action='$PHP_SELF?view=options&optaction=updat etitle'>
<input type='text' name='new_site_title' value='".$cfgrow['sitetitle']."' class='input' style='width:300px;' />
<input type='submit' value='Update' />
</form>
</div>

<div id='jcaption'>
IMAGES PATH
</div>
<div id='content'>
<form method='post' action='$PHP_SELF?view=options&optaction=updat eimagepath'>
<input type='text' name='new_image_path' value='".$cfgrow['imagepath']."' style='width:300px;' />
<input type='submit' value='Update' />
</form>
</div>

<div id='jcaption'>
SWITCH TEMPLATE
</div>
<div id='content'>
<form method='post' action='$PHP_SELF?view=options&optaction=updat etemplate'>
<select name='new_template'>
<option value='".$cfgrow['template']."'>".$cfgrow['template']."</option>
";
// go through template folder
$dir = "../templates";
if($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if($file != "." && $file != "..") {
echo "<option value='$file'>$file</option>";
}
}
closedir($handle);
}
echo "
</select>
<input type='submit' value='Update' />
</form>
</div>

<div id='jcaption'>
THUMBNAILS - UPDATE ALL THUMBNAILS WITH NEW DIMENSIONS
</div>
<div id='content'>
<form method='post' action='$PHP_SELF?view=options&optaction=updat ethumbnails'>
Set Max dimension below. Width x Height.<br />
<input type='text' name='new_dimension_x' value='100' /> x
<input type='text' name='new_dimension_y' value='75' />
<p />
<input type='submit' value='Update' />
</form>
</div>

<div id='jcaption'>
CALENDAR TYPE
</div>
<div id='content'>
<form method='post' action='$PHP_SELF?view=options&optaction=updat ecalendar'>
<select name='cal'>
";
if($cfgrow['calendar'] == "") { $nice_calendar = "No Calendar"; } else { $nice_calendar = $cfgrow['calendar']; }
echo "
<option value='".$cfgrow['calendar']."'>$nice_calendar</option>
<option value'Horizontal'>Horizontal</option>
<option value='Normal'>Normal</option>
<option value='No Calendar'>Don't Use a Calendar</option>
</select>
<input type='submit' value='Update' />
</form>
</div>
<p />
";
}

// view=images
if($_GET['view'] == "images") {
// x=update
if($_GET['x'] == "update") {
$headline = clean($_POST['headline']);
$body = clean($_POST['body']);
$getid = $_GET['imageid'];
$category = clean($_POST['category']);
$query = "update pixelpost set headline='$headline', body='$body', category='$category' where id='$getid'";
$result = mysql_query($query) ||("Error: ".mysql_error());
echo "<div id='jcaption'>Image update</div>
<div id='content'>Updated image #$getid.</div><p />";
}
// x=delete
if($_GET['x'] == "delete") {
$getid = $_GET['imageid'];
$images = mysql_query("SELECT image FROM pixelpost where id='$getid'");
$imagerow = mysql_fetch_array($images);
$image = $imagerow['image'];
$file_to_del = "$upload_dir".$imagerow['image'];

echo "<div id='jcaption'>Post removal / Image deletion / thumbnail deletion</div>
<div id='content'>";

$query = "delete from pixelpost where id='$getid'";
$result = mysql_query($query) ||("Error: ".mysql_error());
echo "Post deleted.<p />";

if(unlink($file_to_del)) {
$image_message = "Image deleted.<p />";
} else { $image_message = "Could not delete imagefile. You have to do that some other way, with your ftp software perhaps.<p />"; }

echo $image_message;

$file_to_del = "../thumbnails/thumb_".$imagerow['image'];
if(unlink($file_to_del)) {
$image_message = "Thumbnail deleted.<p />";
} else { $image_message = "Could not delete thumbnail. You have to do that some other way, with your ftp software perhaps.<p />"; }

echo $image_message."</div>";
}
// print out a list over images/posts
if($_GET['id'] == "") {
echo "<div id='jcaption'>Images / Posts - Edit or Delete an image</div>
<div id='content'><ul>";
$images = mysql_query("SELECT * FROM pixelpost ORDER BY datetime DESC");
while(list($id,$datetime,$headline,$body,$image) = mysql_fetch_row($images)) {
echo "<li>$headline   <a href=\"$PHP_SELF?view=images&id=$id\">[edit]</a>
<a href=\"$PHP_SELF?view=images&x=delete&imageid=$id\">[delete]</a></li>
";
}
echo "</ul></div><p />";
} else {
// an id is specified, edit the image, pull it out and put it in a form
$getid = $_GET['id'];
$images = mysql_query("SELECT * FROM pixelpost where id='$getid'");
$imagerow = mysql_fetch_array($images);
$headline = pullout($imagerow['headline']);
$body = pullout($imagerow['body']);
$image = $imagerow['image'];
$category = $imagerow['category'];
echo "
<div id='jcaption'>
Edit Image
</div>
<div id='content'>
<form method='post' action='$PHP_SELF?view=images&x=update&ima geid=$getid'>
Title<br />
<input type='text' name='headline' value='$headline' style='width:300px;' /><p />
Text<br />
<textarea name='body' style='width:300px;height:100px;'>$body</textarea><p />
Category<br />
<select name='category'>
";
$query = mysql_query("select name from pixelpost_categories where id='$category'");
$query = mysql_fetch_array($query);
$nice_category = pullout($query['name']);
echo "
<option value='$category'>$nice_category</option>
<option value=''> - Set New Category - </option>
";
$query = mysql_query("select * from pixelpost_categories order by name");
while(list($id,$name) = mysql_fetch_row($query)) {
$name = pullout($name);
echo "<option value='$id'>$name</option>\n";
}
echo "
</select><p />
Image<br />
<img src='../thumbnails/thumb_$image' /><br />
$image (not changeable)<p />
<input type='submit' value='Update' />
</form>
</div><p />
";
}
} // end view=images

// view=comments
if($_GET['view'] == "comments") {
// delete a comment
if($_GET['action'] == "delete") {
$delid = $_GET['delid'];
$query = "DELETE FROM pixelpost_comments WHERE id='$delid'";
$result = mysql_query($query) or die("Error: ".mysql_error());
echo "<div id='jcaption'>Deleted a comment.</div>";
}
// list of comments
if($_GET['id'] == "") {
echo "<div id='jcaption'>List of Comments - delete at will</div><div id='content'><ul>";
$images = mysql_query("SELECT * FROM pixelpost_comments ORDER BY id DESC");
while(list($id,$parent_id,$datetime,$ip,$message,$ name,$url) = mysql_fetch_row($images)) {
$message = pullout($message);
$name = pullout($name);
$url = pullout($url);
echo "<li>$name - <b>$message</b> <i>Comment made: $datetime. From ip: $ip. Action: <a href=\"$PHP_SELF?view=comments&action=delete&delid=$id\">[delete]</a></i></li>
";
}
echo "</ul></div><p />";
} // end list
}
// view info
if($_GET['view'] == "info") {
if($_GET['version'] == "check") {
$pixelpost_latest_version = file_get_contents("http://www.pixelpunk.se/software/service/version.txt");
} else {
$pixelpost_latest_version = "<a href='$PHP_SELF?view=info&version=check'>Check</a>";
}
if($cfgrow['version'] == "") { $version = "Unknown"; } else { $version = $cfgrow['version']; }
$mysql_version = mysql_get_server_info();
if($gd_info = gd_info()) {
$gd_info = $gd_info['GD Version'];
} else {
$gd_info = "Not installed";
}
echo "<div id='jcaption'>Pixelpost Version</div>
<div id='content'>
You're running version <b>$version</b> of pixelpost. Released to 6 october 2004.<br />
Latest pixelpost version: <b>$pixelpost_latest_version</b><p />
Looking for help or want to give feedback, please step into pixelpost forum.<br />
<a href='http://www.pixelpunk.se/software/forum'>www.pixelpunk.se/software/forum/</a>
</div>
<p />
<div id='jcaption'>Host information</div>
<div id='content'>
<b>PHP-version</b> ".phpversion()." <p />
<b>MySQL version</b> $mysql_version<p />
<b>GD-lib</b> $gd_info<p />
<b>Server software</b> ".$_SERVER['SERVER_SOFTWARE']."<p />
";

if(extension_loaded(exif)) {
echo "<b>EXIF</b> Your php was compiled with exif-enabled. This means you can add additional exif-information to your images such as camera model, aperture, exposure time and more. <br />
There are certain tags to add to your templates for this. Check pixelpost homepage to learn more.
";
}

echo "
</div>
<div id='jcaption'>Permissions</div>
<div id='content'>
";
if(!is_writable("../images/")) {
$chmod_message = "<b>Images folder not writable!</b><br />You must set correct permissions on this folder or you will not be able to upload any images.<br /> Set the folder to chmod 777 (read, write and execute permissions for owner, group and world).<p />";
} else {
$chmod_message = "Images folder is writable, which is a good thing.<p />";
}

if(!is_writable("../thumbnails/")) {
$chmod_message2 = "<b>Thumbnails folder is not writable!</b><br />You must set correct permissions on this folder or thumbnails will not work.<br /> Set the folder to chmod 777 (read, write and execute permissions for owner, group and world).<p />";
} else {
$chmod_message2 = "Thumbnails folder is writable.<p />";
}
echo "
<b>Images folder</b><br />
$chmod_message<p />

<b>Thumbnails folder</b><br />
$chmod_message2<p />
</div>
<p />
";
}

// categories
if($_GET['view'] == "categories") {
if($_GET['action'] == "delete") {
$query = "delete from pixelpost_categories where id='".$_POST['id']."'";
$result = mysql_query($query) || die("Error: ".mysql_error());
echo "<div id='jcaption'>Deletion</div><div id='content'>Category deleted.
You may have to reload to view the changes.</div><p />";
}
if($_GET['action'] == "add") {
$category = clean($_POST['category']);
$query = "insert into pixelpost_categories(id,name)
VALUES('NULL','$category')";
$result = mysql_query($query) || die("Error: ".mysql_error());
echo "<div id='jcaption'>Add Category</div>
<div id='content'>Category <b>\"".$_POST['category']."\"</b> added.</div><p />
";
}
if($_GET['action'] == "edit") {
$query = mysql_query("select * from pixelpost_categories where id='".$_POST['id']."'");
$query = mysql_fetch_array($query);
$name = pullout($query['name']);
echo "<div id='jcaption'>Edit Category</div>
<div id='content'>Edit the name of the following category.<br />
All images belonging to the old name will belong to the new name you enter.<p />
<form method='post' action='$PHP_SELF?view=categories&action=updat e&id=".$query['id']."'>
<input type='text' name='category' value='$name' style='width:300px;'/>
<input type='submit' value='Update Category' />
</form>
</div>
";
}
if($_GET['action'] == "update") {
$category = clean($_POST['category']);
$getid = $_GET['id'];
$upquery = mysql_query("update pixelpost_categories set name='$category' where id='$getid'");
$result = mysql_query($upquery) ||("Error: ".mysql_error());
echo "<div id='jcaption'>Update</div><div id='content'>
Updated category to new name <b>\"$category\".</b></div><p />";
}
echo "<div id='jcaption'>Delete Categories</div>
<div id='content'>
<form method='post' action='$PHP_SELF?view=categories&action=delet e'>
<select name='id'>
<option value=''>Delete a category</option>
<option value=''>----------</option>
";
$query = mysql_query("select * from pixelpost_categories order by name");
while(list($id,$name) = mysql_fetch_row($query)) {
$name = pullout($name);
echo "<option value='$id'>$name</option>\n";
}
echo "
</select><p />
<input type='submit' value='Delete Category' />
</form>
</div>
<div id='jcaption'>Edit Categories</div>
<div id='content'>
<form method='post' action='$PHP_SELF?view=categories&action=edit'>
<select name='id'>
<option value=''>Edit a category</option>
<option value=''>----------</option>
";
$query = mysql_query("select * from pixelpost_categories order by name");
while(list($id,$name) = mysql_fetch_row($query)) {
$name = pullout($name);
echo "<option value='$id'>$name</option>\n";
}
echo "
</select><p />
<input type='submit' value='Edit Category' />
</form>
</div>
<div id='jcaption'>Add Category</div>
<div id='content'>Add a category which you can assign to images.<p />
<form method='post' action='$PHP_SELF?view=categories&action=add'>
<input type='text' name='category' style='width:300px;' /><p />
<input type='submit' value='Add Category' />
</form>
</div>
";
}

// ################################################## ########################################//
// FUNCTIONS
// ################################################## ########################################//
// translate file upload errors to something human understandable
function check_upload($string) {
$error_explained = array(
"0" => "Upload went without error.",
"1" => "Exceeded maximum filesize for webserver to handle.",
"2" => "Exceeded maximum filesize.",
"3" => "File was not fully uploaded.",
"4" => "No file was uploaded."
);
$result = $error_explained[$string];
return($result);
}
function clean($string) {
$string = addslashes($string);
return $string;
}
function pullout($string) {
$string = stripslashes($string);
$string = htmlentities($string);
$string = nl2br($string);
return $string;
}
function createthumbnail($args) {
// credit to codewalkers.com - this is 99% a tutorial there
$file = $args['file'];
$max_width = $args['max_width'];
$max_height = $args['max_height'];
define(IMAGE_BASE, "../images");
$image_path = IMAGE_BASE . "/$file";
$img = null;
$ext = strtolower(end(explode('.', $image_path)));
if ($ext == 'jpg' || $ext == 'jpeg') {
$img = @imagecreatefromjpeg($image_path);
} else if ($ext == 'png') {
$img = @imagecreatefrompng($image_path);
} else if ($ext == 'gif') {
$img = @imagecreatefrompng($image_path);
}
if($img) {
$width = imagesx($img);
$height = imagesy($img);
$scale = min($max_width/$width, $max_height/$height);
if($scale < 1) {
$new_width = floor($scale*$width);
$new_height = floor($scale*$height);
$tmp_img = imagecreatetruecolor($new_width,$new_height);
imagecopyresized($tmp_img, $img, 0,0,0,0,$new_width,$new_height,$width,$height);
imagedestroy($img);
$img = $tmp_img;
}
}
imagejpeg($img, "../thumbnails/thumb_$file");
}
?>
</div>
</body></html>

Anonymous
02-04-2005, 10:13 AM
If you mean you want to add the small rss down right logo on mozilla browser you have to add a thing like this on your image template file.

<!-- BEGIN
function flip(rid)
{
current=(document.getElementById(rid).style.displa y == 'none') ? 'block' : 'none';
document.getElementById(rid).style.display = current;
}
// End -->
</script>
<link rel="alternate" type="application/rss+xml" title="RSS" href="http:YOUR_PATH7index.php?x=rss">
<link rel="alternate" type="application/rss+xml" title="YOUR_TITLE" href="index.php?x=rss" />
<!--
body {
background-color: #ddd;
}
-->

Hope this help.

Anonymous
02-04-2005, 02:14 PM
No, we're not actually looking to add a logo (at least I'm not) we're trying to get an RSS XML page to happen with the latest version of Pixelpost.

biggest_apple
02-11-2005, 01:00 AM
Still looking for an answer to this one. If anyone has a suggestion I'd appreciate it

rich
02-11-2005, 01:08 PM
This will give you XML output without having to download a file. On line 444 of index.php

header("Content-type:application/rss+xml");

Just remove “rss+”. So the line should now be:
header("Content-type:application/xml");

Now when you click on the link “index.php?x=rss” XML will be seen in the browser. I’m not sure if this is what you’re looking for, but it does eliminate the file download.

biggest_apple
02-11-2005, 01:45 PM
Thanks for that - exactly what i was after :D

blinking8s
02-13-2005, 01:56 AM
humm...

XML Parsing Error: undefined entity
Location: http://blog.blinking8s.com/?x=rss
Line Number 263, Column 250:
http://blog.blinking8s.com/?x=rss

abel
03-31-2005, 06:32 PM
just came across this thread... i changed the line item like mentioned above

The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.

--------------------------------------------------------------------------------

Reference to undefined entity 'Acirc'. Error processing resource 'http://www.lifeatf8.com/index.php?x=rss'. Line 936, Position 56

<br />bet that would have made for a nice photo. <br>
-------------------------------------------------------^




can anyone shed some light on this one... i get this in the browser once i click my RSS link button on my website...

http://www.lifeatf8.com

blinking8s
03-31-2005, 09:05 PM
check out pp v1.4 beta ;)