dpiearcy Posted December 28, 2012 Share Posted December 28, 2012 Back before Facebook came out with that stupid timeline feature I decided I wanted to build a Facebook like application in php just to see if I could. It came out more like twitter but at any rate... Now I'm moving on to something like Constant Contact. I love their content management system they use to create the HTML email. Something similar to a "Widget" in Wordpress. You drag a different element (text with image for example) on to the page then edit that container. (looking at the source code they are using tables which makes sense since it's an mass email program and inline CSS works best for those so tables are much easier). So basically these little code snippets are nothing more than a new <tr> etc. I am looking at a few different jquery drag and drop options. Plenty already put together to choose from. But here's where my thinking starts to get muddled. The drag (widget) area will be in a <div> floating left. Everything else will be placed in a different <div>. My question is, what would you think would be the best way for me to get the contents of that second <div> without making that entire <div> a variable and storing its contents in medium txt on mysql? Since I am using AJAX with those and the database will be updating on the fly.... I'm thinking each widget area should have variables for title, color etc. with default of these set when the include the widget. When they begin a new email template I can assign an ID to that row then can update the values of that row where id = $pid or whatever. But determining WHAT widget is placed on the page. I don't want to echo what's not there (default values previously discussed already stored in MySql). Obviously an "IF and ELSE IF" would work but haven't ever written an IF statement where I'm seeing if it's in a div. Nor would I know how to change an int from 0 to 1 just because I moved it to a different div (again the IF statement). So there's the loop. Now I'm back to thinking that entire <div> should be a variable. Thought I would throw it out here first but will probably be examining how Wordpress does it with their widgets after I'm done typing here. Obviously the header and footer <div>'s will be easy enough. It's the main content I'm having trouble trying to figure out how to organize. Anyone done something like this already? Or there may be a CMS out there I'm not familiar with that is already utilizing this function that's open source but I've been unable to locate one and would much rather write this myself as it's, as I said, just a matter of honing my skills (or lack thereof as is the case) ;-) Quote Link to comment https://forums.phpfreaks.com/topic/272432-just-for-kicks/ Share on other sites More sharing options...
Muddy_Funster Posted December 28, 2012 Share Posted December 28, 2012 I don't know this CMS your reffering to, so I'm not 100% on the process that your trying to replicate. It sounds to me like you're mixing up your display code with your function code though (given the refference of setting a div as a variable). Quote Link to comment https://forums.phpfreaks.com/topic/272432-just-for-kicks/#findComment-1401717 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.