1
hkats
Re: image manager - Could not get uploaded file 0
  • 2007/10/2 8:46

  • hkats

  • Just popping in

  • Posts: 5

  • Since: 2005/12/10


Quote:

superdave wrote:
Ok.... I'm facing the same problem now... getting "Could not get uploaded file 0" error messege when I try to upload an image in image manager.

I am running XOOPS 2.0.16, so I'm can't seem to find the PHP.INI file as mentioned... if it still exists in this version. Anyone else have any idea?

I have installed the same version of XOOPS several times elsewhere for other sites I have built, on the same type of servers, etc and have never come across this problem before. Strange. The Uploads directory is CHMOD to 777.

Thanks for any help in advance...



my server requires a file called "tmp" to process uploads, others i have worked with required "temp" (you can see it in your php set up what the upload path is set too)

just create it on the server and it should work.

now if i could just get the system avatars to work...



2
hkats
Re: System Avatars
  • 2006/12/2 7:44

  • hkats

  • Just popping in

  • Posts: 5

  • Since: 2005/12/10


this is also a problem on our site which is also using 2.24
users cannot change thier avatars though the process seems to go through when you select a system avatar.

i have gone over the edituser.php and the change avatar php looks ok to me but maybe there is something i am missing?
if ($op == 'avatarform') {
    include 
XOOPS_ROOT_PATH.'/header.php';
    echo 
'<a href="userinfo.php?uid='.$xoopsUser->getVar('uid').'">'_PROFILE_MA_PROFILE .'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'_PROFILE_MA_UPLOADMYAVATAR .'<br /><br />';
    
$oldavatar $xoopsUser->getVar('user_avatar');
    if (!empty(
$oldavatar) && $oldavatar != 'blank.gif') {
        echo 
'<div style="text-align:center;"><h4 style="color:#ff0000; font-weight:bold;">'._PROFILE_MA_OLDDELETED.'</h4>';
        echo 
'<img src="'.XOOPS_UPLOAD_URL.'/'.$oldavatar.'" alt="" /></div>';
    }
    if (
$xoopsModuleConfig['avatar_allow_upload'] == && $xoopsUser->getVar('posts') >= $xoopsModuleConfig['avatar_minposts']) {
        include_once 
XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
        
$form = new XoopsThemeForm(_PROFILE_MA_UPLOADMYAVATAR'uploadavatar''edituser.php''post'true);
        
$form->setExtra('enctype="multipart/form-data"');
        
$form->addElement(new XoopsFormLabel(_PROFILE_MA_MAXPIXEL$xoopsModuleConfig['avatar_width'].' x '.$xoopsModuleConfig['avatar_height']));
        
$form->addElement(new XoopsFormLabel(_PROFILE_MA_MAXIMGSZ$xoopsModuleConfig['avatar_maxsize']));
        
$form->addElement(new XoopsFormFile(_PROFILE_MA_SELFILE'avatarfile'$xoopsModuleConfig['avatar_maxsize']), true);
        
$form->addElement(new XoopsFormHidden('op''avatarupload'));
        
$form->addElement(new XoopsFormHidden('uid'$xoopsUser->getVar('uid')));
        
$form->addElement(new XoopsFormButton('''submit'_SUBMIT'submit'));
            
$form->display();
    }
    
$avatar_handler =& xoops_gethandler('avatar');
    
$form2 = new XoopsThemeForm(_PROFILE_MA_CHOOSEAVT'uploadavatar''edituser.php''post'true);
    
$avatar_select = new XoopsFormSelect('''user_avatar'$xoopsUser->getVar('user_avatar'));
    
$avatar_select->addOptionArray($avatar_handler->getList('S'));
    
$avatar_select->setExtra("onchange='showImgSelected("avatar", "user_avatar", "uploads", "", "".XOOPS_URL."")'");
    
$avatar_tray = new XoopsFormElementTray(_PROFILE_MA_AVATAR'&nbsp;');
    
$avatar_tray->addElement($avatar_select);
    
$avatar_tray->addElement(new XoopsFormLabel(''"<img src='".XOOPS_UPLOAD_URL."/".$xoopsUser->getVar("user_avatar""E")."' name='avatar' id='avatar' alt='' /> <a href="javascript:openWithSelfMain('".XOOPS_URL."/misc.php?action=showpopups&amp;type=avatars','avatars',600,400);">"._LIST."</a>"));
    
$form2->addElement($avatar_tray);
    
$form2->addElement(new XoopsFormHidden('uid'$xoopsUser->getVar('uid')));
    
$form2->addElement(new XoopsFormHidden('op''avatarchoose'));
    
$form2->addElement(new XoopsFormButton('''submit2'_SUBMIT'submit'));
    
$form2->display();
}

if (
$op == 'avatarupload') {
    if (!
$GLOBALS['xoopsSecurity']->check()) {
        
redirect_header('index.php',3,_PROFILE_MA_NOEDITRIGHT."<br />".implode('<br />'$GLOBALS['xoopsSecurity']->getErrors()));
        exit;
    }
    
$xoops_upload_file = array();
    
$uid 0;
    if (!empty(
$_POST['xoops_upload_file']) && is_array($_POST['xoops_upload_file'])){
        
$xoops_upload_file $_POST['xoops_upload_file'];
    }
    if (!empty(
$_POST['uid'])) {
        
$uid intval($_POST['uid']);
    }
    if (empty(
$uid) || $xoopsUser->getVar('uid') != $uid ) {
        
redirect_header('index.php',3,_PROFILE_MA_NOEDITRIGHT);
        exit();
    }
    if (
$xoopsModuleConfig['avatar_allow_upload'] == && $xoopsUser->getVar('posts') >= $xoopsModuleConfig['avatar_minposts']) {
        include_once 
XOOPS_ROOT_PATH.'/class/uploader.php';
        
$uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, array('image/gif''image/jpeg''image/pjpeg''image/x-png''image/png'), $xoopsModuleConfig['avatar_maxsize'], $xoopsModuleConfig['avatar_width'], $xoopsModuleConfig['avatar_height']);
        if (
$uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
            
$uploader->setPrefix('cavt');
            if (
$uploader->upload()) {
                
$avt_handler =& xoops_gethandler('avatar');
                
$avatar =& $avt_handler->create();
                
$avatar->setVar('avatar_file'$uploader->getSavedFileName());
                
$avatar->setVar('avatar_name'$xoopsUser->getVar('uname'));
                
$avatar->setVar('avatar_mimetype'$uploader->getMediaType());
                
$avatar->setVar('avatar_display'1);
                
$avatar->setVar('avatar_type''C');
                if (!
$avt_handler->insert($avatar)) {
                    @
unlink($uploader->getSavedDestination());
                } else {
                    
$oldavatar $xoopsUser->getVar('user_avatar');
                    if (!empty(
$oldavatar) && $oldavatar != 'blank.gif' && !preg_match("/^savt/"strtolower($oldavatar))) {
                        
$avatars =& $avt_handler->getObjects(new Criteria('avatar_file'$oldavatar));
                        
$avt_handler->delete($avatars[0]);
                        
$oldavatar_path str_replace("\""/"realpath(XOOPS_UPLOAD_PATH.'/'.$oldavatar));
                        if (
=== strpos($oldavatar_pathXOOPS_UPLOAD_PATH) && is_file($oldavatar_path)) {
                            
unlink($oldavatar_path);
                        }
                    }
                    
$sql sprintf("UPDATE %s SET user_avatar = %s WHERE uid = %u"$xoopsDB->prefix('users'), $xoopsDB->quoteString($uploader->getSavedFileName()), $xoopsUser->getVar('uid'));
                    
$xoopsDB->query($sql);
                    
$avt_handler->addUser($avatar->getVar('avatar_id'), $xoopsUser->getVar('uid'));



3
hkats
Re: REDIRECT PROBLEM
  • 2005/12/14 14:24

  • hkats

  • Just popping in

  • Posts: 5

  • Since: 2005/12/10


Quote:

komakino wrote:
first off - you need to go to your right file at modules(folder) /system (folder)/admin (folder)/templates (folder) /system_redirects.html (file)

--


i know what u mean.. i m not retarded :)


inside the modules folder
i go in the system folder
and then in admin folder
but i have no Template folder there...

as i wrote u before... the template folder in my XOOPS is located somewherele unfortunally


sorry, didn't mean to imply...

in the version 2.09 it is modules/sytem/templates/system_redirects.html

but i would suggest that wherever you have that file, you try the above, just save a copy of the original file in case it doesn't work.

if you do not have it there, and cannot find the file system_redirects.html, then i don't know what to tell ya- except that i'm wondering if you uploaded a full version of xoops- try windiff or winmerge against the files you uploaded from, to see if anything is missing from your site...



good luck



4
hkats
Re: REDIRECT PROBLEM
  • 2005/12/11 20:57

  • hkats

  • Just popping in

  • Posts: 5

  • Since: 2005/12/10


Quote:

komakino wrote:
well


it seems we re using different XOOPS here
because... my redirect template looks quite different.. something like this:

<div style="text-align:center; background-color: transparent; border-top: 0px solid #FFFFFF; border-left: 0px solid #FFFFFF; border-right: 0px solid #AAAAAA; border-bottom: 0px solid #AAAAAA; font-weight : bold;">
<h4><{$message}></h4>
<p><{$lang_ifnotreload}></p>
</div>

so i actually don t know how to change it..



and the file is located here:

modules/system/templates/

what can i do so?


i am using 2.2.3 - which i believe has it in the same place as 2.2 - so

first off - you need to go to your right file at modules(folder) /system (folder)/admin (folder)/templates (folder) /system_redirects.html (file)




and just add the body tags to the code


<<body onload="void(location.href='<{$url}>');"><code that is in file already > </body>



5
hkats
Re: REDIRECT PROBLEM
  • 2005/12/10 20:34

  • hkats

  • Just popping in

  • Posts: 5

  • Since: 2005/12/10


https://xoops.org/modules/newbb/viewtopic.php?topic_id=36791&forum=2&post_id=168304#forumpost168304

i also had problems with the redirects in 2.2.3 - this fixed it only in the version there is not a body tag in the modules/system/admin/templates/system_redirects.html

i added the body code that is supplied in that thread,and a closing tag, saved the file and updated the module all is fixed now.




TopTop



Login

Who's Online

251 user(s) are online (165 user(s) are browsing Support Forums)


Members: 0


Guests: 251


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits