Jump to content

dynamic cms


Ninjakreborn

Recommended Posts

I have set up the framework almost for a program.  I know it's not a good idea to create new tables dynamically(database tables).  At this point though, I have a lot of information going throughpaypal, and coming back to paypal's IPN system.  The thing is if I am not careful this could be riddled with security issues, when they finally payout.  I am taking either template1.php or template2.php depending on which one they have chosen(more are getting added later), and I am opening it, reading the contents of it, and saving it in a variable.  Then I need to find a way to create a cms for it, I need to get the cms put within the file information somehow, as well as decide what table structure in the database I can use for something like this.  So they will be able to login to there administration area later on, and do what they need to do??
Link to comment
Share on other sites

I have set up the framework almost for a program.  I know it's not a good idea to create new tables dynamically(database tables).  At this point though, I have a lot of information going throughpaypal, and coming back to paypal's IPN system.  The thing is if I am not careful this could be riddled with security issues, when they finally payout.  I am taking either template1.php or template2.php depending on which one they have chosen(more are getting added later), and I am opening it, reading the contents of it, and saving it in a variable.  Then I need to find a way to create a cms for it, I need to get the cms put within the file information somehow, as well as decide what table structure in the database I can use for something like this.  So they will be able to login to there administration area later on, and do what they need to do??
Link to comment
Share on other sites

Cool.. so copy and paste works. Now... what part are you stuck with exactly? Surely in all your experience your able to think through a solution.

It sounds to me like your approuching this entirely the wrong way. Why are you making new files for different clients? Ive written frameworks that can run multiple websites at the same time. You just need to store each sites configuration and data in a normalized manor. They don't even need seperate databases or tables though at times this does make things more efficient.
Link to comment
Share on other sites

I am working on it.  EIther way this is more advanced file handling, I never did heavy file handling like this before.  I have to create a dynamic cms, for pages that are dynamically generated, and create dynamic folders with that info, and dynamically grant admin access.

I was wondering about the cms part, I have to allow them to edit the text within a content div, on the template page.  I have spent all day, learning and setting up a paypal account on the development center, and created 2 test email accounts, 1 for sender, and 1 for reciever.  So now I have setup the paypal form, I am preparing to be able to test it, I have some ideas how I am going to function this, but I still have a ways to go, any advice, or ideas on the cms part would be appreciated.
Link to comment
Share on other sites

yeah, I understand the problem. I just dont understand how to simply convey the solution. It just doesn't seem too difficult to me. I have entire sites all running as part of the same cms application. Its just a matter of database normalization.
Link to comment
Share on other sites

The way I do a standard text editing cms.  I have a table, for instance if they have control over the text in there privacy policy
I have a table in the db called privacy policy
it has id, header, text fields
then they can add/edit/delete them through there admin, rather smoothly
Here though, if I had a different table for each person who signed up, I don't know how well that turned out.
Link to comment
Share on other sites

You dont need different tables for each user. Youve got to look at the database differently. What does your id column do? You need to relate each record in your database to the client it belongs to.

Using your example, this would be as simple as adding a user_id field. However, there are better, more dynamic ways of going about this. What if you also wanted to add a footer field? You need to be able to do this without modifying the database structure. the answer is normalization. You would have two tables.

[code]
privacy_policy (
  id INT
  user_id INT
)
privacy_lolicy_data (
  id INT
  key TEXT
  val TEXT
)
[/code]

To add a record you would simply insert into privacy_policy your users_id, then, using the newly created id run a series of  inserts on privacy_policy_data that looked something like....

[code]
$id = mysql_insert_id();
$sql = "INSERT INTO privacy_policy_data (id,key,val) VALUES ('$id','header','this is the header')";
$sql = "INSERT INTO privacy_policy_data (id,key,val) VALUES ('$id','footer','this is the footer')";
[/code]

this enables you to add as many fileds as you need without ever modifying the database structure. This sort of organization can build dynamic structures quite easily.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.