Version: , by ptmuldoon
Developer Last Online: Jun 2014
Version: Unknown
Rating:
Released: 02-21-2005
Last Update: Never
Installs: 0
No support by the author.
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
PHP Code:
$path = $path.'/';
if (is_uploaded_file($icon['tmp_name']))
{
if (file_exists("$path" . $icon['name']))
{
eval(print_standard_error('vbart_filealreadyexists'));
}
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.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Yep you're right, you remove the else clause in the code above. But I will not offer support if anything goes wrong.
I intended all articles to have icons to make the layout uniform.
Well, I'm not thinking of removing the else clause, but to expand upon it. If I understand everything, images are placed in an images/articles/5/ folder, with a new folder number being added for each article submitted.
So I'm thinking you place a default.gif in your images/articles folder.
Then you add in an additional elseif above the else clause. Now, when a user submits an article, first it will look for the user submitted image. If thats not there, it will look for the default.gif to use. And if it can't find either, to give you the error message of no image found.
Again, I know just enough about php to be dangerous and mess something up. But I'm going to give this a shot tonight when I get back to my home pc, and take a look at my php intro books that I have.
Also, Just as an FYI, that I noticed that although if you didn't include an image, that the article is still actually being submitted, as I see it waiting for approval in the admin panel. I'll see if I can understand any of the code enough to add elseif command for a default pic, but I think I'm going to really mess it up. Somebody with better coding skills may want to do it as well.
Also, Just as an FYI, that I noticed that although ifyou didn't include an image, that the article is still actually beingsubmitted, as I see it waiting for approval in the admin panel. I'llsee if I can understand any of the code enough to add elseif commandfor a default pic, but I think I'm going to really mess it up. Somebodywith better coding skills may want to do it as well.
Yes,yesterday a user submits 9 Times the same Article, he didn?t know whatmissing and what is wrong. I turn this mod offline, I hope there will be a fix.
i crashed and bombed at trying to understand how to add in the code. Perhaps Cinq can take a look at it when he gets a chance, or add this into the future requests.