CodeIgniter Forums
DB design and file uploading - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: DB design and file uploading (/showthread.php?tid=10026)



DB design and file uploading - El Forum - 07-16-2008

[eluser]meigwilym[/eluser]
Hi,

I'm midway through building an app which needs a simple CMS to handle text and images.

First of all the text. The website promotes a series of music gigs for a festival. I want a system that can

- give a time and place
- add as many number of bands as needed

I want the markup to be

Code:
<li class="rss-item">
  <h4 class="pryd">Saturday 04/08, 9pm</h4>
  <h4 class="ble">Solus/Bar Solus</h4>
                                
  <ul class="artists">
    <li>Cate Le Bon</li>
    <li>Gwyneth Glyn</li>
    <li>The Gentle Good</li>
    <li>Georgia Ruth Williams</li>
  </ul>
</li>

The problem I have is how to put this info in a table. Do I need a Artists table like this?
[code]
gig_id | artist_name
[code]

or is there an easier/better way? It also needs to be bilingual.

I'll also need a way to upload images and display them - I'm fairly confident about this but any advice on librares, helpers etc is welcome.

The website is http://www.maesb.com/

Thanks for your help,

Mei


DB design and file uploading - El Forum - 07-17-2008

[eluser]meigwilym[/eluser]
Ok...let's be more specific.

I want to upload images and store the data in a db.

Specifically:

-upload the image.
-check if it's portrait or landscape
-resize it to 315*420 / 420*315, if not already that size. This may need a crop as well, in case the proprtions are incorrect.
-create a thumbnail, 47*47, so this also needs a crop either before or after resizing (after, i should think, less CPU cycles?)
-put these two images in their directories, root/gallrey and root/gallery/thumbs
-put the data (name, portrait/landscape, location) in a db table.

The code in this thread looks like a good place to start, http://ellislab.com/forums/viewthread/79394/

Is the above sequence the best one? Any tips?

Thanks,

Mei