We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Photo Plugin - Separate Directories for Each User - NEW INSTALL ONLY | Forum

Shawn M
Shawn M Jul 18 '13
I have an existing social networking site - custom coded - that I am working on converting to Oxwall 1.56. The current site that I run has over 500,000 images uploaded - each user has their own folder because Linux has serious issues when you start getting above a certain number of files in a folder.

It blows my mind that this feature isn't in the current photo plugin because it literally took me 5 minutes after I figured out where to make the changes.

I only had to modify 2 files that are located in /ow_plugins/photo/bol/

photo_dao.php
photo_temporary_service.php

I suspect that it wouldn't be that hard to make an update for existing users as well but I don't need that functionality so I didn't add it. Basically, they would just need to create code to loop through the existing photos for each member, create a folder for the user (user id) and move the photos into the newly created folder.

I have attached the changed files. If you have 1.53 you can use a program like windiff to see the changes. (http://support.microsoft.com/kb/159214)

Use at your own risk.

The Forum post is edited by Shawn M Jul 20 '13
Attachments:
  files.zip (6.18Kb)
Sebastian
Sebastian Sep 3 '13
Hi Shawn!


Great fix, thanx for sharing :-) 


Confirmed working for 1.53


I totally agree with you on loads of files in one folder... Just noticed there is already S3 integration, so mogilefs should be possible too.


Btw. on Linx clients I use "meld" instead of "windiff"

S. Bourdon
S. Bourdon Dec 7 '13
Thanks for this fix!


Only problem I have found is that photos and albums do not get removed from server when deleted...  Any chance someone would be kind enough to provide the code changes necessary to achieve that?


Thank you very much!

S. Bourdon
S. Bourdon Dec 12 '13
Any suggestions?  ;)
Jeffery
Jeffery Dec 14 '13
Works great! Thanks!

Only thing that should be mentioned is if you add this on an already established network it will break the links to the photos.  You would need to add the directories for all the photos and move the photos to their respective folders.  It's a bit of work, but doable.


Best to add this on a new network.  Thanks for the hard work!

Swapnil Wagh
Swapnil Wagh Dec 26 '13
Worthy changes..

Thanks ..

Wilson
Wilson Jan 1 '14
Got it working too! Great fix! Thanks for the work Shawn!

Wilson
Dave S
Dave S Jan 2 '14
Shawn, you are a genius! I cannot believe that i didn't think about this so far. I will have to work again on my photo_dao.php file, because i added stuff like hash instead of photo_preview. Thank you for sharing!
Dave S
Dave S Jan 3 '14
I just tested it, and it's good, but it affects the Avatar plugin. Photos from Avatar are sitting in the wrong directory. You need to work on the Avatar plugin too. 
Wilson
Wilson Feb 14 '14

Hey Shawn,

Been doing some testing and I found a few bugs with your modification.

1st. As reported by S. Bourdon, the photos and albums from each user does NOT get deleted when the user attempts to delete them when using this modification.

2nd. Also as reported by Dave S, your modification affects the “Avatar” plugin. Photos from Avatar are sitting in the wrong directory. Its saying when you hover over the “Profile Pictures “ album yourdomain.com/Oxwall/photo/useralbum/Admin/12 ( it’s seeing the “Separate Directories”  (12) but it’s really setting in ow_userfiles/plugins/uavatars/avatar_big_1_1392441093.jpg and does not say (12)

So have you fixed these bugs yet? If not do you plan on fixing it soon? I may have to move on if this dose not get fixed because its showing the “Profile Pictures “ album but its all dead links and when you go to the “Profile Pictures “ album page, it’s not showing anything. Just “Delete” and edit buttons. See attached pics.

Wilson

Attachments:
  avatar-2.jpg (30.58Kb)
  avatar-1.jpg (14.67Kb)