ptmuldoon
02-21-2005, 03:44 PM
I went to submit my first article, and I'm being told that I have to include an image icon. I looked in the admin settings, and I have selected No for "Use Category Icons"
Is there a way to submit articles that don't have an image icon?
Also, not a big deal, but after not having an image icon, and if you hit the back button on your browser, you lose your article, and have to re-enter the entire thing. Not that big a deal, but a little annoying. That could be my brower though. I'm using mozilla.
I know enough about php to generally be able to find and understand the code a little bit, but at same time to do series damage. So looking at the code in the artcles.php file, I've found this
$path = $path.'/';
if (is_uploaded_file($icon['tmp_name']))
{
if (file_exists("$path" . $icon['name']))
{
eval(print_standard_error('vbart_filealreadyexists '));
}
$result = copy($icon['tmp_name'], "$path" . $icon['name']);
if (!$result)
{
$error = ob_get_contents();
eval(print_standard_error('vbart_errorwriting'));
}
$newpath = $vbart_options['vbartartimgpathab'].$artid."/";
$iconpath = $newpath.$icon['name'];
echo '<p>'.$vbphrase['vbart_imguploadsuccess'].'</p>';
$DB_site->query("UPDATE " . TABLE_PREFIX . "articles_article SET icon='$iconpath' WHERE articles_articleid='$artid'");
}
else
{
eval(print_standard_error('vbart_invalidfile'));
}
Now, what I'm thinking is to edit that code to first look if the user supplied an image for the article. If they did, then upload and use that image with the article. But if they did not provide an image, then the script would use a default image that on your server, likely in the default folder where your article images will go.
So is this possible? I think it may just be a matter of either altering the above code, or adding in another if/else command. I hope I'm on the right track at least.
Is there a way to submit articles that don't have an image icon?
Also, not a big deal, but after not having an image icon, and if you hit the back button on your browser, you lose your article, and have to re-enter the entire thing. Not that big a deal, but a little annoying. That could be my brower though. I'm using mozilla.
I know enough about php to generally be able to find and understand the code a little bit, but at same time to do series damage. So looking at the code in the artcles.php file, I've found this
$path = $path.'/';
if (is_uploaded_file($icon['tmp_name']))
{
if (file_exists("$path" . $icon['name']))
{
eval(print_standard_error('vbart_filealreadyexists '));
}
$result = copy($icon['tmp_name'], "$path" . $icon['name']);
if (!$result)
{
$error = ob_get_contents();
eval(print_standard_error('vbart_errorwriting'));
}
$newpath = $vbart_options['vbartartimgpathab'].$artid."/";
$iconpath = $newpath.$icon['name'];
echo '<p>'.$vbphrase['vbart_imguploadsuccess'].'</p>';
$DB_site->query("UPDATE " . TABLE_PREFIX . "articles_article SET icon='$iconpath' WHERE articles_articleid='$artid'");
}
else
{
eval(print_standard_error('vbart_invalidfile'));
}
Now, what I'm thinking is to edit that code to first look if the user supplied an image for the article. If they did, then upload and use that image with the article. But if they did not provide an image, then the script would use a default image that on your server, likely in the default folder where your article images will go.
So is this possible? I think it may just be a matter of either altering the above code, or adding in another if/else command. I hope I'm on the right track at least.