Twilkey
08-29-2010, 02:35 PM
I am adding the ability to upload an image to a product. I have looked around in the vB files and I am using some code I found, but it doesnt want to work.
This part works fine.
print_upload_row($vbphrase['filename'], 'upload');
This is the code I am not fully sure about.
$vbulletin->input->clean_array_gpc('f', array(
'upload' => TYPE_FILE,
));
$imagespath = "images/shop";
$upload = new vB_Upload_Image($vbulletin);
$upload->image =& vB_Image::fetch_library($vbulletin);
$upload->path = $imagespath;
$imgurl = $vbulletin->options['bburl'] . $imagespath . $vbulletin->GPC['upload']['name'] . ".jpg";
Then I have it set to add $imgurl to my database which works fine except the file name isn't there. That and I am not sure if I am missing any code cause the file doesnt actually get put into the folder. This code is in an admincp file, but the images should be save to the shop folder within the default vB images folder, so.
When I use this, it is just blank.
$vbulletin->GPC['upload']['name']
Also, I do not get any errors with this code. The entry gets added to the database just fine, just not all the info is there.
--------------- Added 1283173031 at 1283173031 ---------------
No help at all?
This part works fine.
print_upload_row($vbphrase['filename'], 'upload');
This is the code I am not fully sure about.
$vbulletin->input->clean_array_gpc('f', array(
'upload' => TYPE_FILE,
));
$imagespath = "images/shop";
$upload = new vB_Upload_Image($vbulletin);
$upload->image =& vB_Image::fetch_library($vbulletin);
$upload->path = $imagespath;
$imgurl = $vbulletin->options['bburl'] . $imagespath . $vbulletin->GPC['upload']['name'] . ".jpg";
Then I have it set to add $imgurl to my database which works fine except the file name isn't there. That and I am not sure if I am missing any code cause the file doesnt actually get put into the folder. This code is in an admincp file, but the images should be save to the shop folder within the default vB images folder, so.
When I use this, it is just blank.
$vbulletin->GPC['upload']['name']
Also, I do not get any errors with this code. The entry gets added to the database just fine, just not all the info is there.
--------------- Added 1283173031 at 1283173031 ---------------
No help at all?