FAP CUSTOMIZATION - [MOD] FAP Copy »  Show posts from    to     

Icy Phoenix


Archived phpBB Topics (Styles, Mods, Support) - FAP CUSTOMIZATION - [MOD] FAP Copy



Artie [ Fri 09 Mar, 2007 23:17 ]
Post subject: FAP CUSTOMIZATION - [MOD] FAP Copy
Gives users the ability to place a copy of pics from their own Personal Gallery into other Public Categories.


lefty74 [ Sat 10 Mar, 2007 12:45 ]
Post subject: Re: [MOD] FAP Copy
very nice artie.
will install this on my board


KugeLSichA [ Sat 10 Mar, 2007 23:45 ]
Post subject: Re: [MOD] FAP Copy
thx artie :mrblue:


Mighty Gorgon [ Sun 11 Mar, 2007 14:14 ]
Post subject: Re: [MOD] FAP Copy
Greaaaaaaaaaat! :mri:

I told you that becoming a developer would have been the next step! :icy_lol_flag:

I've modified a couple of things, fixed a bug and added this to FAP! :mri:

About the bug...

Code: [Hide] [Select]
for ($i = 0; $i <count($picrow); $i++)
{
// Though each cat entry would work off of the same pic_filename
// we need an actual copy of the pic with a different filename in case of deletetions
$pic_filename = $picrow[$i]['pic_filename'];
$file_split = explode('.', $pic_filename);
$pic_extension = $file_split[sizeof($file_split) - 1];
$pic_filename = substr($pic_filename, 0, strlen($pic_filename) - strlen($pic_extension) -1);
$pic_thumbnail = ($album_config['gd_version'] == 0) ? $pic_filename . '.' . $pic_extension : '';

while (file_exists(ALBUM_UPLOAD_PATH . $pic_filename . '.' . $pic_extension))
{
$pic_filename = $pic_filename . '_' . time() . '_' . mt_rand(100000, 999999);
}

if (!copy(ALBUM_UPLOAD_PATH . $picrow[$i]['pic_filename'], ALBUM_UPLOAD_PATH . $pic_filename . '.' . $pic_extension))
{
message_die(GENERAL_ERROR, 'Could not copy image');
}

$pic_title = addslashes($picrow[$i]['pic_title']);
$pic_desc = addslashes($picrow[$i]['pic_title']);
$pic_time = time() + $i; // Gives each pic a different timestamp

$sql = "INSERT INTO " . ALBUM_TABLE . " (pic_filename, pic_thumbnail, pic_title, pic_desc, pic_user_id, pic_user_ip, pic_username, pic_time, pic_cat_id, pic_approval)
VALUES ('" . $pic_filename . '.' . $pic_extension . "', '$pic_thumbnail', '$pic_title', '$pic_desc', '".$picrow[$i]['pic_user_id']."', '".$picrow[$i]['pic_user_ip']."', '".$picrow[$i]['pic_username']."', '$pic_time', '".intval($_POST['target'])."', '".$picrow[$i]['pic_approval']."')";

if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update album information', '', __LINE__, __FILE__, $sql);
}
}



Thanks for your job once again. :mri:


Artie [ Sun 11 Mar, 2007 17:22 ]
Post subject: Re: [MOD] FAP Copy
Mighty Gorgon wrote: [View Post]
...
I've modified a couple of things, fixed a bug and added this to FAP! :mri:

About the bug...



The bug, I don't understand, though I am suprised that there wasn't more of 'em. :oops:


Mighty Gorgon [ Wed 14 Mar, 2007 02:10 ]
Post subject: Re: [MOD] FAP Copy
Artie wrote: [View Post]
Mighty Gorgon wrote: [View Post]
...
I've modified a couple of things, fixed a bug and added this to FAP! :mri:

About the bug...



The bug, I don't understand, though I am suprised that there wasn't more of 'em. :oops:

The bug is related to image renaming... you weren't considering that you cannot add the random generated digits after the file extension... :wink:


Artie [ Wed 14 Mar, 2007 02:32 ]
Post subject: Re: [MOD] FAP Copy
Mighty Gorgon wrote: [View Post]

The bug is related to image renaming... you weren't considering that you cannot add the random generated digits after the file extension... :wink:


:oops: Oooops, did I do that? I didn't notice, but I am aware this is true.


will_hough [ Thu 15 Mar, 2007 15:23 ]
Post subject: Re: [MOD] FAP Copy
Mighty Gorgon wrote: [View Post]
Greaaaaaaaaaat! :mri:

I told you that becoming a developer would have been the next step! :icy_lol_flag:

I've modified a couple of things, fixed a bug and added this to FAP! :mri:

About the bug...

code ~


Thanks for your job once again. :mri:


I'm guessing this fix has already been added to the download?


Artie [ Fri 16 Mar, 2007 00:26 ]
Post subject: Re: [MOD] FAP Copy
will_hough wrote: [View Post]

I'm guessing this fix has already been added to the download?

Actually no ........ but it has now. :wink:


Mighty Gorgon [ Thu 22 Mar, 2007 01:42 ]
Post subject: Re: [MOD] FAP Copy
will_hough wrote: [View Post]
I'm guessing this fix has already been added to the download?

I didn't add it because this mod is property of Artie. :lol:

Anyway this mod will be part of next FAP... :wink:


will_hough [ Thu 22 Mar, 2007 07:29 ]
Post subject: Re: [MOD] FAP Copy
Mighty Gorgon wrote: [View Post]
will_hough wrote: [View Post]
I'm guessing this fix has already been added to the download?

I didn't add it because this mod is property of Artie. :lol:

Anyway this mod will be part of next FAP... :wink:
I meant the download in this thread :P


Artie [ Thu 22 Mar, 2007 22:50 ]
Post subject: Re: [MOD] FAP Copy
Yes, this is what MG meant as well.
He was just explaining that he did not add the fix because it was not his mod to correct.....it was mine. :wink:


shane [ Sun 25 Mar, 2007 21:20 ]
Post subject: Re: [MOD] FAP Copy
I realize that this is probably a very stupid question, but I am learning on the job. This mod seems to be something that will be very useful on my site. I have downloaded the .rar file, but I have no idea how to install the mod. I've never used a .rar file before.

Guidance?

Site: www.philmontforum.com/forum
phpbb 2.0.22
mods: attachment, FAP, Upload from post, topic calendar

Thanks! You guys are great and I'm learning a lot just reading your messages.
Shane


Artie [ Sun 25 Mar, 2007 23:36 ]
Post subject: Re: [MOD] FAP Copy
There are no stupid questions, only stupid answers :mricy:

Treat the .rar file like you would a .zip file....it's just a different format for file compression/archiving.

WinRar is a good tool to use.


dilirum [ Tue 03 Apr, 2007 18:41 ]
Post subject: Re: [MOD] FAP Copy
Thanks Artie for a beautiful mod!

I think I know the answer to this but just trying to verify. I'm curious if this mod duplicates the actual pic file (creating multiple instances of the same file), or if it ties the original pic to multiple categories in the db. I'd prefer the latter, so as to save disk space.

Thanks!


Artie [ Tue 03 Apr, 2007 19:25 ]
Post subject: Re: [MOD] FAP Copy
It creates another pic/file in your uploads.

If it worked like you prefer, here is what could happen ( for example):

You have pic_1 in cat_1
You copy pic_1 to cat_2
Now if you decide you no longer need the pic in cat_1 and delete it, there will be no pic to display in cat_2


dilirum [ Tue 03 Apr, 2007 19:41 ]
Post subject: Re: [MOD] FAP Copy
Well I guess I just answered my own question by installing it then checking the URL of copied pics.

This makes a duplicate of the actual file.

While this is a sweet mod and I give props to Artie (and Gorgon) for putting it together, the only way this could get any sweeter is as I described before. To make a pic tied to multiple categories within the db, which would allow you to save disk space by not having duplicated files, but rather still appearing in multiple categories. I supposed that would be bordering on the requested "tags" mod.

Still very useful though and I appreciate it! Thanks guys!


Artie [ Tue 03 Apr, 2007 20:42 ]
Post subject: Re: [MOD] FAP Copy
It should be possible to make it work as you want by removing the code that renames the file.




Powered by Icy Phoenix