Jump to content

Archived

This topic is now archived and is closed to further replies.

Ninjakreborn

dynamic cms

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??

Share this post


Link to post
Share on other sites
well, one idea is simply to use the idea that many forum systems use and store all your major colors in the database and allow your users to update them through a form.

Share this post


Link to post
Share on other sites
What exactly is your question?

Share this post


Link to post
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??

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
A simple cms to display data within a div is simply a matter of storing that data in a database. Maybe a tutorial on a [i]blog system[/i] or something simular would help?

Share this post


Link to post
Share on other sites
I build cms's all the time

In this situation however, I have to be able to build them dynamically, everytime someone creates a sub-domain, and the page get's moved there, it has to have a seperate area for that cms???

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
actually that's a good idea, I used that idea for a few things, for instance when I have a messaging system, I store all the messages in one table, and use the userid of the fromsender and to sender.  So yes, thanks for the advice, that will get me past that part, thanks again.

Share this post


Link to post
Share on other sites

×

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.