Can anybody tell me briefly and in details the procedure to create a system where a logged in user can create multiple photo albums and can upload images in ecah of them.just like we do in any social networking sites.

preferably:-if an user is logged in then he will be provided with a link called "create new album" then inside that he can name the album and lastly he can upload multiple photos at a time.thanks in advance

Simple CMS logic design.

  1. Create page for public viewing with links.
  2. Create registration page, login page, members only page.
  3. Create page for latest album, top rated album, most commented albums ...etc.
  4. Create database
  5. Create administration page for the site owner.

user table

+---------+-------------+-------------+----------+
+ user_id +  user_name  +  password   +   email  +
+---------+-------------+-------------+----------+

user_setting table . This table will be the user's privacy control.

+------+----------+----------+----+-------+
+ user +  private +  comment + pm + share +
+------+----------+----------+----+-------+

albums

+----------+----------+-------------+-----------+------------+
+ album_id + owner_id +  link_url   + img_count + disk_space +
+----------+----------+-------------+-----------+------------+

photos this is for the photos for the albums.

+----------+----------+------------+-----------+--------------+
+ image_id + album_id + image_name + thumb_loc + size_on_disc +
+----------+----------+------------+-----------+--------------+

comments this will record comments posted by other members

+--------+-----------+-----------+-----------+
+ cmt_id + member_id +  cmt_date + album_id  +
+--------+-----------+-----------+-----------+

rating

+----------+--------+--------+----------+
+ album_id + rating +  votes + voter_id +
+----------+--------+--------+----------+

favorites

+----------+----------+--------+----------+-----------+
+ album_id + owner_id + fav_by + fav_date + fav_count +
+----------+----------+--------+----------+-----------+

shared

+----------+----------+------------+-----------------+-------------+
+ album_id + owner_id +  shared_by + destination_url + share_count +
+----------+----------+------------+-----------------+-------------+

Make sure to change some of the column names to unique names to prevent colision and confusion. There are columns in the database that needs to be incremented based on the members activity e.g. favorites, shared, and photos.

Write your PHP codes based on the database skeleton design.. For administrative control, make sure to add columns on the albums table e.g. suspended, tobe_remove, or violation.

change private column to privacy_setting. "private is a reserved word and MUST not be use.. sorry about that.. that really slipped away :).

thank you so much veedeoo for that kind concern,i have already prepared the login,registration,but now i am struck at the point where after logging in an user gets a link "create album" after clicking on it,he can name the album and save it.and it can be viewed on the same page.When the same user clicks on the new named album,he gets an "upload photos/photo" and it gets saved in the album and can be viewed there. good news is i have successfully create the upload photos and viewing part.but i want to access it by go through an album.my questions to you are:-
1)what should be the table structure for album(user clicking on a link)and the album gets created.
2)should i use different database structure for login,register,albums etc or same database but different table.

please reply as soon as you view my post..thanks in advance :)

Member Avatar for diafol

An alternative here would make the image available to multiple albums.

+----------+------------+-----------+--------------+
+ image_id + image_name + thumb_loc + size_on_disc +
+----------+------------+-----------+--------------+

And then (optional PK)

+------------+----------+----------+------------+----------------+
+ img_alb_id + image_id + album_id + date_added + unique_comment +
+------------+----------+----------+------------+----------------+

1)what should be the table structure for album(user clicking on a link)and the album gets created.

I think veedeoo answered your first question:

+----------+----------+-------------+-----------+------------+
+ album_id + owner_id +  link_url   + img_count + disk_space +
+----------+----------+-------------+-----------+------------+

2)should i use different database structure for login,register,albums etc or same database but different table.

login and register just make use of the user table. Again I believe you have already been given a comprehensive list of structures for the various tables.

please reply as soon as you view my post..thanks in advance :)

Please be patient - don't prompt contributors to help. We do have lives outside DW :)

thanks very much Diafol for the clarification.

@m1k3.mca, Diafol is correct we are trying to live just like everybody else.

Back to your question, what you need to look for is a stable login/registration script. You can then extend the script for the CMS function of the script.

There is one in my forked github repositories , but I never have the chance to upload my modified version.

If you will be looking at the login script, this file right here can create a user table automatically.

Somewhere between lines 765 and 774, we can find these codes

 $qry = "Create Table $this->tablename (".
            "id_user INT NOT NULL AUTO_INCREMENT ,".
            "name VARCHAR( 128 ) NOT NULL ,".
            "email VARCHAR( 64 ) NOT NULL ,".
            "phone_number VARCHAR( 16 ) NOT NULL ,".
            "username VARCHAR( 16 ) NOT NULL ,".
            "password VARCHAR( 32 ) NOT NULL ,".
            "confirmcode VARCHAR(32) ,".
            "PRIMARY KEY ( id_user )".
            ")";

I remember writing the PDO CRUD , the CMS extension , the multi-upload extension with thumbnail generator for this script.

I also made a twig, TBS, and Smarty version of this script. Just don't have the time to put it up on gitHub.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.