Previous Thread
Next Thread
Print Thread
Hop To
Joined: Jun 2007
Posts: 37
S
newbie
newbie
S Offline
Joined: Jun 2007
Posts: 37
OK I have been considering the gallery option for a range of my forums and I think it would be very popular however it will result in Gb's of images over the years and I think a more efficient way to store the images in the longer term is not on the local machine but rather in the cloud.

We already archive quite a bit of our old images (we run snow cams) onto Amazons S3 network and it is extremely economic.

So I am considering moving my gallery hosting to be cloud based.

I should be able to write a .htaccess mod_rewrite to redirect anything from /gallery/ or below to a cloud location so that shouldn't be an issue.

The issue is the file upload. I will have to hack in a few lines of code to change the file move from /tmp to /gallery to be a move to the cloud location.

I have gone through filemanager.inc.php and can follow it through to image.inc.php where the images are resized (but not saved to /gallery) and then returned and then the database command to update the filename into the db (around line 280) is all clear. However I can't find where the files are actually moved from /tmp to /gallery location.

This is the line of code I would need to edit but I can't seem to trace it. Is it in another include file? Can anyone give me a file reference and line number where this actually is written.

Thanks.


Australia skiing accommodation reports, cams, shop and community
Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
Code
[gremelin@thetimevortex forum]# grep -r "/gallery" *
cache_builders/gallery_island.php:      $is = getimagesize("{$config['FULL_PATH']}/gallery/{$posts['TOPIC_THUMBNAIL']}");
cache_builders/gallery_island.php:lock_and_write("{$config['FULL_PATH']}/cache/gallery_island_$portal_id.php",$island);
cache_builders/gallery_island.php:@chmod("{$config['FULL_PATH']}/cache/gallery_island_$portal_id.php",0666);
languages/english/admin/viewboard.php:$ubbt_lang['FORUM_GALLERY_DESC'] = "Forum will hold photos instead of topics.<br />Requires <a href=\"{$config['BASE_URL']}/admin/gallery.php\">Gallery Settings</a> to be configured.";
libs/ubbthreads.inc.php:                        include("{$config['FULL_PATH']}/cache_builders/gallery_island.php");
scripts/addpost.inc.php:                                rename("{$config['FULL_PATH']}/tmp/$filename.thumb","{$config['FULL_PATH']}/gallery/$filedir/thumbs/$filename");
scripts/addpost.inc.php:                                chmod("{$config['FULL_PATH']}/gallery/$filedir/thumbs/$filename",0666);
scripts/addpost.inc.php:                                rename("{$config['FULL_PATH']}/tmp/$filename.medium","{$config['FULL_PATH']}/gallery/$filedir/medium/$filename");
scripts/addpost.inc.php:                                chmod("{$config['FULL_PATH']}/gallery/$filedir/medium/$filename",0666);
scripts/addpost.inc.php:                                rename("{$config['FULL_PATH']}/tmp/$filename.full","{$config['FULL_PATH']}/gallery/$filedir/full/$filename");
scripts/addpost.inc.php:                                chmod("{$config['FULL_PATH']}/gallery/$filedir/full/$filename",0666);
scripts/showpic.inc.php:                "img" => "{$config['FULL_URL']}/gallery/$filedir/full/$id.$type",
scripts/deletepost.inc.php:                     unlink("{$config['FULL_PATH']}/gallery/$dir/full/$File");
scripts/deletepost.inc.php:                     unlink("{$config['FULL_PATH']}/gallery/$dir/medium/$File");
scripts/deletepost.inc.php:                     unlink("{$config['FULL_PATH']}/gallery/$dir/thumbs/$File");
scripts/doexpirethreads.inc.php:                                @unlink("{$config['FULL_PATH']}/gallery/$filedir/full/$filename");
scripts/doexpirethreads.inc.php:                                @unlink("{$config['FULL_PATH']}/gallery/$filedir/medium/$filename");
scripts/doexpirethreads.inc.php:                                @unlink("{$config['FULL_PATH']}/gallery/$filedir/thumbs/$filename");
scripts/getmediumpic.inc.php:   echo "<imgsrc>{$config['FULL_URL']}/gallery/$dir/medium/$id.$type</imgsrc>";
scripts/getmediumpic.inc.php:   echo "<thumb>[img]{$config['FULL_URL']}/gallery/{$dir}/thumbs/{$id}.{$type}[/img]</thumb>";
scripts/getmediumpic.inc.php:   echo "<medium>[img]{$config['FULL_URL']}/gallery/{$dir}/medium/{$id}.{$type}[/img]</medium>";
scripts/getmediumpic.inc.php:   echo "<full>[img]{$config['FULL_URL']}/gallery/{$dir}/full/{$id}.{$type}[/img]</full>";
scripts/filemanager.inc.php:                    @unlink("{$config['FULL_PATH']}/gallery/$filedir/thumbs/$name");
scripts/filemanager.inc.php:                    @unlink("{$config['FULL_PATH']}/gallery/$filedir/medium/$name");
scripts/filemanager.inc.php:                    @unlink("{$config['FULL_PATH']}/gallery/$filedir/full/$name");
scripts/modifypost.inc.php:                             @rename("{$config['FULL_PATH']}/tmp/$filename.thumb","{$config['FULL_PATH']}/gallery/$filedir/thumbs/$filename");
scripts/modifypost.inc.php:                             chmod("{$config['FULL_PATH']}/gallery/$filedir/thumbs/$filename",0666);
scripts/modifypost.inc.php:                             @rename("{$config['FULL_PATH']}/tmp/$filename.medium","{$config['FULL_PATH']}/gallery/$filedir/medium/$filename");
scripts/modifypost.inc.php:                             chmod("{$config['FULL_PATH']}/gallery/$filedir/medium/$filename",0666);
scripts/modifypost.inc.php:                             @rename("{$config['FULL_PATH']}/tmp/$filename.full","{$config['FULL_PATH']}/gallery/$filedir/full/$filename");
scripts/modifypost.inc.php:                             chmod("{$config['FULL_PATH']}/gallery/$filedir/full/$filename",0666);
scripts/showimage.inc.php:      readfile("{$config['FULL_PATH']}/gallery/$filedir/$type/$filename");
scripts/showflat.inc.php:                                       $postrow[$i]['gallery_pic'] = "<img id=\"mediumpic\" style=\"cursor: pointer;\" onclick=\"showFullSize($file_width,$file_height,$file_id)\" src=\"{$config['FULL_URL']}/gallery/$file_dir/medium/$file_id.$ext\" alt=\"{$img_link}\" title=\"{$ubbt_lang['SHOW_FULL']}\" />";
scripts/showflat.inc.php:                                       $postrow[$i]['thumb'] = "[img]{$config['FULL_URL']}/gallery/{$file_dir}/thumbs/{$file_id}.{$ext}[/img]";
scripts/showflat.inc.php:                                       $postrow[$i]['medium'] = "[img]{$config['FULL_URL']}/gallery/{$file_dir}/medium/{$file_id}.{$ext}[/img]";
scripts/showflat.inc.php:                                       $postrow[$i]['full'] = "[img]{$config['FULL_URL']}/gallery/{$file_dir}/full/{$file_id}.{$ext}[/img]";
scripts/showflat.inc.php:                                               "src" => "{$config['FULL_URL']}/gallery/$file_dir/thumbs/$file_id.$ext",
scripts/showflat.inc.php:                                               "url" => "{$config['FULL_URL']}/gallery/$file_dir/full/$file_id.ext",
scripts/inline_moderation.inc.php:                      @unlink("{$config['FULL_PATH']}/gallery/{$result['FILE_DIR']}/full/{$result['FILE_NAME']}");
scripts/inline_moderation.inc.php:                      @unlink("{$config['FULL_PATH']}/gallery/{$result['FILE_DIR']}/medium/{$result['FILE_NAME']}");
scripts/inline_moderation.inc.php:                      @unlink("{$config['FULL_PATH']}/gallery/{$result['FILE_DIR']}/thumbs/{$result['FILE_NAME']}");
templates/default/gallery_island.tpl:<a href="{ubb url="ubb=showgallery&Number=`$items[item].POST_ID`"}"><img alt="{$items[item].TOPIC_SUBJECT}" title="{$items[item].TOPIC_SUBJECT}" {$items[item].WIDTH_HEIGHT} src="{$config.BASE_URL}/gallery/{$items[item].TOPIC_THUMBNAIL}" /></a>
templates/default/showpic.tpl:<body class="ubb_popup_body" style="margin: 0px; padding: 0px;"><img src="{$config.FULL_URL}/gallery/{$dir}/full/{$id}.{$ext}" alt="" width="{$width}" height="{$height}" /></body>
templates/default/admin/admin_adminmenu.tmpl:<li><a {$current_menu[$ubbt_lang['GALLERY']]} href="{$config['BASE_URL']}/admin/gallery.php">{$ubbt_lang['GALLERY']}</a></li>
templates/default/admin/admin_adminmenu.tmpl:<li><a {$current_menu[$ubbt_lang['GALLERY_ISLANDS']]} href="{$config['BASE_URL']}/admin/galleryislands.php">{$ubbt_lang['GALLERY_ISLANDS']}</a></li>
templates/default/gallerylist.tpl:<a href="{ubb url="ubb=showgallery&Number=`$postrow[topic].Number`" title=$postrow[topic].SubjectClean}"><img src="{$config.BASE_URL}/gallery/{$postrow[topic].thumbnail}" alt="" /></a>


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jun 2007
Posts: 37
S
newbie
newbie
S Offline
Joined: Jun 2007
Posts: 37
addpost.inc.php - thanks smile

rename("{$config['FULL_PATH']}/tmp/$filename.thumb","{$config['FULL_PATH']}/gallery/$filedir/thumbs/$filename");

Provided I can get a mod_rewrite to work for any references it should be sweet.

Thank you.


Australia skiing accommodation reports, cams, shop and community
Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
I'd recommend making sure all of the scripts are changed (hence why i posted every reference to /gallery) and not just the ones you think need to be, you'll end up with some possible issues cropping up when the forum is assuming a file is local and it's no where to be located...


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jun 2007
Posts: 37
S
newbie
newbie
S Offline
Joined: Jun 2007
Posts: 37
Thanks, I'll investigate fairly completely before implementing and test on a closed forum.


Australia skiing accommodation reports, cams, shop and community
Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
Let us know how it goes!


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
1 members (1 invisible), 631 guests, and 152 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240501)