Direct access to resources and files
Allowing direct access to images and other resources, moving uploads to the media directory, showing pictures across sites
Direct access to images and other resources
There are four types of resources we have
1)      Uploaded images
2)      CSS and images related to the theme of this site
3)      CSS and images from this site or its parent
4)      JS files from the engine-room
Currently we just use the SITE_URL and let the PHP code figure out when the request comes back, which slows things down.
I think this is going to take several different solutions to encompass all of the resources we have. We will use the $g_site object to hold this information.
Some items will have new paths
·         Uploaded Images - $g_site->imageUploadDir(), $g_site->imageUploadURL()
·         Resized Images $g_site->imageResizeDir(), $g_site->imageResizeURL()
·         FCKEditor - $g_site->FCKEditorURL()
Some files we will need to “search” for at page creation time
$g_site->getResourceURL($stResourceFile)
Task List
Create functions for new paths – 2 hours
Create resource search function – 8 hours
Initialize Uploaded and resized image directories  and URLs and new path URLs – 8 hours (we have to use a new URL to access things from the root of the install)
Change every line of code that uses these – there are currently 569 usages of SITE_URL in the code. Many of those are not affected by this change – 12 hours
Testing changes above – 4 hours
Bugs that will crop up during these changes – 16 hours
Total = 50 hours
Media Directory Changes
We will move all the uploaded files into
media/uploads/sitename
off of the root. Subsites will be directly under site name.
Task List
Writing code in install to move the files – 8 hours
Initializing the uploaded and resized image directories differently – 4 hours.
New bugs – 4 hours
Total – 16 hours (I believe that we will save 4 hours from the previous task list by doing these items at the same time)
Showing Pictures across sites
To show pictures across sites we need to get the information about which site we’re displaying from and figure out its parent and its parent’s parent, etc.
This becomes easier once we put things in the media directory.
Things may be even easier with using the FCKEditor
Tasks
Include in the ObjektPicture constructor the objekt pointer. – 1 hour
Add to ObjektObjekt a call to get the site key of the objekt – 2 hours
Have ObjektPicture call its Objekt to get the site key and set its URL appropriately – 8 hours
Bugs and testing – 8 hours
Total = 19 hours