[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4586: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4588: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4589: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4590: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
Xataface Forums • View topic - Using IMM with existing Xataface install

Using IMM with existing Xataface install

Forum for support on the Internet Media Manager Application

Using IMM with existing Xataface install

Postby aidan » Thu Oct 16, 2008 9:15 pm

aidan
 
Posts: 11
Joined: Thu Oct 09, 2008 1:15 am
Location: New Zealand

Postby shannah » Fri Oct 17, 2008 8:39 am

shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby aidan » Sun Oct 19, 2008 3:53 pm

aidan
 
Posts: 11
Joined: Thu Oct 09, 2008 1:15 am
Location: New Zealand

Postby shannah » Sun Oct 19, 2008 11:13 pm

shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby aidan » Thu Jan 29, 2009 2:18 am

aidan
 
Posts: 11
Joined: Thu Oct 09, 2008 1:15 am
Location: New Zealand

Re: Using IMM with existing Xataface install

Postby neotrode » Wed Dec 22, 2010 9:28 am

This old thread helped me a lot. However, could you guide me to refining this a bit more?
It would be nice to have the following features:
- Uploaded image is saved to the folder in original size but the filename is appended with an aribtrary 10 digit number to avoid duplicate filenames overriding the previous file.
- An automatic copy of the image file is saved at a reduced size

When coded, maybe with a parameter in the fields.ini like this:
[image_file]
Type = container
widget:type = file
allowed_extensions = jpg,png,gif,jpeg
savepath=files/photos
url=files/photos
appendrandomname=10
makethumbnail=yes
thumbnailsize=200x200


Any chance you can offer some guidance on this?

Thanks in advance.

-Frank
neotrode
 
Posts: 26
Joined: Mon Dec 20, 2010 11:08 am

Re: Using IMM with existing Xataface install

Postby shannah » Wed Dec 22, 2010 9:54 am

Depending on your needs, this may not be necessary. Xataface already provides collision protection for file names. And doesn't delete files unless you manually do it. You can test it out... upload a file twice... you'll see that the second one has a number appended to the name and the first one will still exist on the file system.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Using IMM with existing Xataface install

Postby neotrode » Wed Dec 22, 2010 12:50 pm

Thanks Steve. I should have given it a go and see what happens rather than assume. I like it. It does the job as you said.
What about the thumbnail feature. Is there a way to make it a parameter call in the fields.ini. This way two copies are kept. One with the original filename (or extended name with the extra numbers), the other with a prefix to it like "thumb_". Or...Simply have the same filename and save it in a sub folder called "thumbs". Either way, it would be nice to simply have a call in the fields.ini.

How easy is it to create new parameters in the fields.ini and link a function to it? I guess that is my question.
neotrode
 
Posts: 26
Joined: Mon Dec 20, 2010 11:08 am

Re: Using IMM with existing Xataface install

Postby neotrode » Thu Dec 23, 2010 7:08 am

Ah! I found it. I could add the duplicate file and resize it code (to make thumbnails) by adding the code to the afterSave() function of the ImagesBaseClass.php in the "tables" folder. Brilliant!
neotrode
 
Posts: 26
Joined: Mon Dec 20, 2010 11:08 am

Re: Using IMM with existing Xataface install

Postby shannah » Thu Dec 23, 2010 8:30 pm

Glad you got it to work.

For the sake of others who may want to do the same thing, can you post the afterSave() method (or at least relevant portions).

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Using IMM with existing Xataface install

Postby neotrode » Wed Jan 05, 2011 10:28 am

neotrode
 
Posts: 26
Joined: Mon Dec 20, 2010 11:08 am


Return to Internet Media Manager Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved