Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
0 + 3 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
   

Re: Upload locations
by X-Ception on 2006/9/18 8:44:27

Thank you TheRplima - most helpful
Re: Upload locations
by rplima2004 on 2006/9/18 2:06:37

Sorry, I forgot to speak about ranks. The idea is the same of the smile. Only open the file module/system/admin/userrank/main.php and make the changes in the upload code as you made with smiles.

Quote:

$uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH.'/ranks', array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png'), 100000, 120, 120);


Quote:

$rank_image = 'ranks/'.$uploader->getSavedFileName();



TheRplima
Re: Upload locations
by rplima2004 on 2006/9/18 1:55:05

Hi X-Ception,

Really this is very simple. First make a backup of the file module/system/admin/smilies/main.php

Open the file and look at line 64 or search for
case "SmilesAdd":

In the upload code, change the line:
Quote:

$uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png'), 100000, 120, 120);


for:
Quote:

$uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH.'/smile', array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png'), 100000, 120, 120);


and the line:
Quote:

$smile_url = $uploader->getSavedFileName();


for:
Quote:

$smile_url = 'smile/'.$uploader->getSavedFileName();


Now, on the line 106 (case "SmilesSave":)
Change the upload area again
Quote:

$uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png'), 100000, 120, 120);


for:
Quote:

$uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH.'/smile', array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png'), 100000, 120, 120);


and the line:
Quote:

$smile_url = $uploader->getSavedFileName();


for:
Quote:

$smile_url = 'smile/'.$uploader->getSavedFileName();


Save the file. Now, create the folder uploads/smile and change the write permissions. (chmod 777).
Move all smilies files to the new folder and change in the table prefix_smiles the field smile_url. Only add the smile/ before the name of the file for all the smilies.

Done. Now, all new smile will be saved in the new folder and normally shown in your site.

Hope it helps

TheRplima
Re: Upload locations
by X-Ception on 2006/9/17 23:55:55

I have an idea how to do this, but i dont wish to mod the core blindly, anyone got any ideas ? please
Re: Upload locations
by Peekay on 2006/9/10 0:00:27

Quote:

X-Ception wrote:
I wish to change the upload location for smilets, as well as ranks to stop the clutter in the main root of /uploads/

I agree with your observation. If module developers create folders in 'uploads' it makes it easy for administrators to add, edit or delete files using a file manager utility. However at present the uploads root is like a teenager's bedroom.

Xoops!... go tidy your room.

Who's Online

240 user(s) are online (179 user(s) are browsing Support Forums)


Members: 0


Guests: 240


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits