I coded the engine on my personal blog site except for this one part and I am having a problem trying to correct an error and I am asking for some help to possible resolve this.
On my site, I can (or other members) add stories from the friom the front page.
That stores the awaiting stories into an awaiting table which can be approved, edited, or deleted. This is the code for this approval script in the admin area:
<?php
// Address error handing.
ini_set('display_errors', 1);
error_reporting(E_ALL & ~ E_NOTICE);
//connect to the database
//include("../include/config.php");
//include("../include/opendb.php");
// Define the query.
$entry = mysql_fetch_object(mysql_query(
'SELECT cat_id, title, entry, date_entered, uid FROM blog_entries_notauthed WHERE blog_id=' .
$_GET['id']));
$entry->entry = addslashes($entry->entry);
$query = "INSERT INTO blog_entries (blog_id, cat_id, title, entry, date_entered, uid) VALUES (0,'{$entry->cat_id}', '{$entry->title}', '{$entry->entry}', '{$entry->date_entered}', '{$entry->uid}')";
echo mysql_error();
// Execute the query.
if (@mysql_query($query))
{
echo '<p>The blog entry has been Approved.</p>';
mysql_query('DELETE FROM blog_entries_notauthed WHERE blog_id=' . $_GET['id'] .
' LIMIT 1');
echo mysql_error();
}
else
{
echo "<p>Could add the entry because: <b>" . mysql_error() .
"</b>. The query was $query.</p>";
}
?>
The problem is that when I approve a story, it somehow does not store the URL or does not add the URL to the story for the "view full story" link.
Now if I edit this story in the awaiting news script and then approve it, it works
Does anyone see anything wrong with the code from above. I did not write this small piece, but at the sametime, cannot figure what is wrong with it
You can see the error that it is causing if you click on the latest story on my blog > http://www.mikesimonds.com
Thanks in advance,
Mike