unidox Posted July 19, 2007 Share Posted July 19, 2007 I have a cms, and I want it to be able to add custom modules and arrange their order on the sides, like php nuke does. I was just wondering if there was a tutorial on how to do this or not. Thanks Quote Link to comment Share on other sites More sharing options...
unidox Posted July 19, 2007 Author Share Posted July 19, 2007 Opps, not modules, blocks. Sorry, but is there a script someone can help with? Quote Link to comment Share on other sites More sharing options...
calabiyau Posted July 19, 2007 Share Posted July 19, 2007 Is this your own CMS? I've never done modules before but assuming you have the pages stored in a table somehow each with a unique id, you could create a second table to store module instances for when you create a new module to be used on a page. Each row in the instance table could have a unique_id, and a reference to the page you want to include it on...like the id from the pages table and perhaps a path to the script that would run the module. Then on each page, in the column where the modules would go do a select query to check for modules on that page, using the page id which you must've used somewhere earlier on the page to display your contents. Then while looping through the results just include the path to the script from the database. I dunno..something like that would work I think. Quote Link to comment Share on other sites More sharing options...
unidox Posted July 20, 2007 Author Share Posted July 20, 2007 Yes, it is my own cms... Well, I asked a friend and I was just wondering if this would work... I wrote it up right now, and its 2 in the morning, so if the code is bad, please help. Use a table and in the admin define a number 1 for left, 2 for right $block1 = "Block #1"; $block2 = "Block #2"; $block3 = "Block #3"; If { $block1 == "1"; print "$block1"; }ifelse{ $block2 == "2"; print "$block2"; }ifelse{ $block3 == "3"; print "$block3"; Not sure if I typed that in right. I wonder if that will work Quote Link to comment Share on other sites More sharing options...
unidox Posted July 20, 2007 Author Share Posted July 20, 2007 bump Quote Link to comment Share on other sites More sharing options...
MadTechie Posted July 20, 2007 Share Posted July 20, 2007 this is your system thus your standard.. without knowing the system as well as you do its very hard to say!! Quote Link to comment 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.