PHP Nuke style blocks system

  • /boot/liam
  • Newbie
  • Newbie
  • /boot/liam
  • Posts: 7

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • /boot/liam
  • Newbie
  • Newbie
  • /boot/liam
  • Posts: 7

Post 3+ Months Ago

nvm fixed

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 139 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.