PHP Nuke style blocks system

  • /boot/liam
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jul 01, 2004
  • Posts: 7
  • Status: Offline

Post July 1st, 2004, 7:46 am

Hi all,

For my portal im trying to do a blocks system.

I have a table called blocks and inside there are these fields;
ID
Name
Used - If set to 1 then its being used if 0 then not used
Left - If set to 1 display on left if 0 then dont
Right - If set to 1 display on right if 0 then dont

Then i have a folder called blocks inside there are the block php files.

Im just wondering how i would grab them from a database and then include them where there supposed to be?

My current system is this;

Grabbing from database;
Code: [ Select ]
$blockleft=mysql_fetch_assoc(mysql_query("select * from blocks where `used` = '1' and `left` = '1'"));
$blockright=mysql_fetch_assoc(mysql_query("select * from blocks where `used` = '1' and `right` = '1'"));
  1. $blockleft=mysql_fetch_assoc(mysql_query("select * from blocks where `used` = '1' and `left` = '1'"));
  2. $blockright=mysql_fetch_assoc(mysql_query("select * from blocks where `used` = '1' and `right` = '1'"));


Displaying;
Code: [ Select ]
include("blocks/$blockleft[name].tpl.php");
include("blocks/$blockright[name].tpl.php");
  1. include("blocks/$blockleft[name].tpl.php");
  2. include("blocks/$blockright[name].tpl.php");


It works but it only includes one, how do i get it to include all of them :?:

Cheers! [/code]
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post July 1st, 2004, 7:46 am

  • /boot/liam
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jul 01, 2004
  • Posts: 7
  • Status: Offline

Post July 1st, 2004, 10:21 am

nvm fixed

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 252 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.