41
TheFinni
Re:uploader.php and Notice: Undefined index:
  • 2004/10/10 12:37

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


Hi Kaotik,
Were you able to solve this issue? I am having a similar problem...



42
TheFinni
adding custom javascript to <head> in news admin
  • 2004/10/9 23:47

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


How would I go about this? I need to add my own javascript source into the <head></head> section of the index.php of the news module in administrator mode. I need this javascript for a custom feature.

Basically I want to add a line such as:


<script type='text/javascript' src='<?php echo XOOPS_URL."/modules/news/myjavascript.js";?>'></script>

I can't find a <head> section in the admin/index.php or admin/storyform.inc.php file. The only place I find it is in XOOPS_URL."/include/cp_functions.php...BUT I wouldn't want to have this javascript load for every admin module.

Thanks!



43
TheFinni
Re:uploading two files in one form using uploader.php xoops class
  • 2004/10/7 8:00

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


Actually,
Now that I further tested...It seems strange. Whichever image I assign: xoops_upload_file[0] will work. But if I assign xoops_upload_file[1] for the first image upload and then xoops_upload_file[2] none of them work. Does the [0] represent the same as in []?



44
TheFinni
Re:uploading two files in one form using uploader.php xoops class
  • 2004/10/7 7:48

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


Mithrandir,
Thank you for your suggestion. I tried it out but the second image (file) doesn't seem to want to upload...

I am getting a: "Filename is empty error" for the second file. However the first file does upload properly.

Do you think I have made an error elsewhere? or does the uploader class support uploading of two files in the same form?

Tack sa mycket!



45
TheFinni
Re:uploading two files in one form using uploader.php xoops class
  • 2004/10/6 8:53

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


anyone?



46
TheFinni
Re: uploading two files in one form using uploader.php xoops class
  • 2004/10/4 11:41

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


I put this issue on the shelf for a while...

Now I'm back trying to solve this.

I have come to some conclusions regarding this. Whichever image form upload I put ahead in the form is the image that will be uploaded properly. So...I looked at the source code before submitting the form. This is what I get:

Artimage:
<input type='hidden' name='MAX_FILE_SIZE' value='250000' />
<
input type='file' name='cimage' id='cimage' />
<
input type='hidden' name='xoops_upload_file[]' id='xoops_upload_file[]' value='cimage' />

and:

Actionimage:
<input type='hidden' name='MAX_FILE_SIZE' value='250000' />
<
input type='file' name='dimage' id='dimage' />
<
input type='hidden' name='xoops_upload_file[]' id='xoops_upload_file[]' value='dimage' />

Currently I am thinking that ther reason the second image won't upload properly is because of the xoops_upload_file[] being the same for both instances.

So I looked up the code and found it in XOOPS_ROOT/class/xoopsform/formfile.php. The code for outputting the hidden uppload field looks as follows:

function render(){
        return 
"<input type='hidden' name='MAX_FILE_SIZE' value='".$this->getMaxFileSize()."' /><input type='file' name='".$this->getName()."' id='".$this->getName()."'".$this->getExtra()." /><input type='hidden' name='xoops_upload_file[]' id='xoops_upload_file[]' value='".$this->getName()."' />";
    }


So I thought if I could change the 'xoops_upload_file[]' to a unique name the images would upload fine. Therefore I changed it to 'xoops_upload_file[".$this->getName()."]' and the hidden field became unique...AND SHOULD WORK...but with this setting none of the images will upload. Does this have to do with the uploader class only working when the name is exactly 'xoops_upload_file[]'?

As always, would appreciate some expert advice. :)

Thank you!



47
TheFinni
uploading two files in one form using uploader.php xoops class
  • 2004/9/26 13:19

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


Does anyone know if I can use the current XOOPS uploader file to upload two files in the same form?

I have modified Soapbox a little and would like to add an action picture as well. (i.e two pictures)

This is what I have done with my form:


// IMAGE
    // The article CAN have its own image :)
    // First, if the article's image doesn't exist, set its value to the blank file
    
if (!file_exists(XOOPS_ROOT_PATH "/" $xoopsModuleConfig['theteam_uploaddir'] . "/" $artimage) || !$artimage)
        {
        
$artimage "blank.png";
        } 
    
// Code to create the image selector
    
$graph_array = & XoopsLists :: getImgListAsArrayXOOPS_ROOT_PATH "/" $xoopsModuleConfig['theteam_uploaddir'] );
    
$artimage_select = new XoopsFormSelect'''artimage'$artimage );
    
$artimage_select -> addOptionArray$graph_array );
    
$artimage_select -> setExtra"onchange='showImgSelected("image5", "artimage", "" . $xoopsModuleConfig['theteam_uploaddir'] . "", "", "" . XOOPS_URL . "")'" );
    
$artimage_tray = new XoopsFormElementTray_AM_THETEAM_SELECT_IMG'&nbsp;' );
    
$artimage_tray -> addElement$artimage_select );
    
$artimage_tray -> addElement( new XoopsFormLabel''"<br /><br /><img src='" XOOPS_URL "/" $xoopsModuleConfig['theteam_uploaddir'] . "/" $artimage "' name='image5' id='image5' alt='' />" ) );
    
$sform -> addElement$artimage_tray );

    
// Code to call the file browser to select an image to upload
    
$sform -> addElement( new XoopsFormFile_AM_THETEAM_UPLOADIMAGE'cimage'$xoopsModuleConfig['maxfilesize'] ), false );

//TN adding action image:
    
if (!file_exists(XOOPS_ROOT_PATH "/" $xoopsModuleConfig['theteam_uploaddir'] . "/" $actionimage) || !$actionimage)
        {
        
$actionimage "blank.png";
        } 
    
// Code to create the image selector
    
$graph_array = & XoopsLists :: getImgListAsArrayXOOPS_ROOT_PATH "/" $xoopsModuleConfig['theteam_uploaddir'] );
    
$actionimage_select = new XoopsFormSelect'''actionimage'$actionimage );
    
$actionimage_select -> addOptionArray$graph_array );
    
$actionimage_select -> setExtra"onchange='showImgSelected("image6", "actionimage", "" . $xoopsModuleConfig['theteam_uploaddir'] . "", "", "" . XOOPS_URL . "")'" );
    
$actionimage_tray = new XoopsFormElementTray('Select action image''&nbsp;' );
    
$actionimage_tray -> addElement$actionimage_select );
    
$actionimage_tray -> addElement( new XoopsFormLabel''"<br /><br /><img src='" XOOPS_URL "/" $xoopsModuleConfig['theteam_uploaddir'] . "/" $actionimage "' name='image6' id='image6' alt='' />" ) );
    
$sform -> addElement$actionimage_tray );
    
// Code to call the file browser to select an image to upload
    
$sform -> addElement( new XoopsFormFile('Upload action image''dimage'$xoopsModuleConfig['maxfilesize'] ), false );
//TN EOF action image


and then I tried to modify the function to my action image:

// ARTICLE IMAGE
        // Define variables
        
$error 0;
        
$word null;
        
$uid $xoopsUser -> uid();
        
$submit 1;
        
$date time();

        if ( 
$HTTP_POST_FILES['cimage']['name'] != "" )
            {
            include_once 
XOOPS_ROOT_PATH '/class/uploader.php';

            if ( 
file_existsXOOPS_ROOT_PATH "/" $xoopsModuleConfig['theteam_uploaddir'] . "/" $HTTP_POST_FILES['cimage']['name'] ) )
                {
                
redirect_header"index.php"1_AM_THETEAM_FILEEXISTS );
                } 
            
$allowed_mimetypes = array( 'image/gif''image/jpeg''image/pjpeg''image/x-png' );

            
uploading($allowed_mimetypes$HTTP_POST_FILES['cimage']['name'], "index.php"0$xoopsModuleConfig['theteam_uploaddir']);
        
            
$artimage $HTTP_POST_FILES['cimage']['name'];
            }
        elseif (
$HTTP_POST_VARS["artimage"] != "blank.png")
            {
            
$artimage $myts -> addSlashes$HTTP_POST_VARS["artimage"] );
            } 
        else
            {
            
$artimage '';
            } 

//TN action image:
// ARTICLE IMAGE
        // Define variables
        
$error 0;
        
$word null;
        
$uid $xoopsUser -> uid();
        
$submit 1;
        
$date time();

        if ( 
$HTTP_POST_FILES['dimage']['name'] != "" )
            {
            include_once 
XOOPS_ROOT_PATH '/class/uploader.php';

            if ( 
file_existsXOOPS_ROOT_PATH "/" $xoopsModuleConfig['theteam_uploaddir'] . "/" $HTTP_POST_FILES['dimage']['name'] ) )
                {
                
redirect_header"index.php"1_AM_THETEAM_FILEEXISTS );
                } 
            
$allowed_mimetypes = array( 'image/gif''image/jpeg''image/pjpeg''image/x-png' );

            
uploading($allowed_mimetypes$HTTP_POST_FILES['dimage']['name'], "index.php"0$xoopsModuleConfig['theteam_uploaddir']);
        
            
$actionimage $HTTP_POST_FILES['dimage']['name'];
            }
        elseif (
$HTTP_POST_VARS["actionimage"] != "blank.png")
            {
            
$actionimage $myts -> addSlashes$HTTP_POST_VARS["actionimage"] );
            } 
        else
            {
            
$actionimage '';
            } 
//TN EOF action image


I have tried to remove the "$artimage" and then my action image uploads just fine. I am getting both filenames saved to the DB in any instance so I know I have set-up that part properly. I'm thinking maybe the uploader.php is not euipped to upload two files at a time. But I'm probably wrong...Just don't know how to proceed.

Any tips would be welcomed. :)

Thank you!



48
TheFinni
Both are great for their respective use!
  • 2004/9/14 9:44

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


Boy, I think I may have posted in the wrong thread. I never really wanted to argue which is better. I think both modules have their purpose. And they are both good. :)

I have been trying to use the Wiwi module to integrate the HTMLarea into Soapbox. I have made some progress but still can't get the HTML area to work. Spaw which is a configuration option work partially.

I probably should create a new thread on the forum, because I now really have one goal. Make HTML area work in Soapbox!



49
TheFinni
Re: http/https
  • 2004/9/14 9:27

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


Hi,
Yes, I did this in one site. But I don't know if it is the best way. Basically I made all images (and other src) in the template to load as ssl. (I manually put the full https:// url as src).

For some things that needed SSL support system-wide I added this in the mainfile.php:

define('XOOPS_URL_SSL', 'https://yourdomain.com');

A better way would probably be to specify a "home" link for the XOOPS_URL so that you don't have to worry about content not being downloaded as SSL. (you get that annoying pop-up in your browser; some items are not secure...yada,yada.)

I will have to face this again soon with a project coming up. Will let you know if I find a better solution. :)



50
TheFinni
I think HTML editor is the way to go :)
  • 2004/9/14 6:01

  • TheFinni

  • Just popping in

  • Posts: 75

  • Since: 2003/11/25


Horacio,
Thank you for your response. I understand your concern about module size. It's definitely something you need to take in consideration while developing a large community based web site. However I think an HTML editor is very important. Gone are the days were you can capture an audience on the internet with just text (not in all cases!). But it's nice to be able to provide the reader with images and such.

It's nice to see the integration of the HTML area. I have stumbled upon people with browsers who haven't been able to use the editor. It's sad but what can you tell them. Please exchange your $3000 Mac to a cheapo PC! Right!

As far as looks I really like Spaw. It's simply beautiful. ( in a computer sense). HTML editor is much more efficient in my opnion and so it's worth it.

Right now I am working on figuring out the XOOPS code and how the HTML editor was used in the Wiwi module. If I can get it integrated I will let you know.

Yourhelp,
Thanks for your friendly recommendation. Yes, I don't think I will let my parents touch my XOOPS sites. That would be a catastrophy! lol

It's just amazing though how many people in the young generation that don't know how to use computers. But, that's why XOOPS is such a great system. People can contribute online without much experience in HTML. The only problem I've learned is when you have a user who is already intimidate by the idea of "becoming" the web master. And they are initially the type of people who are afraid to push an electronics button and see what happens. lol

Anyhow, I am going to look more at the WF modules and certainly try them in action.

Thank you,

Thomas




TopTop
« 1 2 3 4 (5) 6 7 »



Login

Who's Online

221 user(s) are online (149 user(s) are browsing Support Forums)


Members: 0


Guests: 221


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