I was studying the (very good by the way) Tutorial on Creating a Tag Board.
I created the piece to work before form to chose the right page. But It did not work, the method getPageByName did not exist.
So I found that there is a ff_getPageByName and even that I need to call
$this->execPieceByName('ff_InitLib');
to make it work. There were no more error messages, but it did not worked either... then I put some echos on the script:
echo "@1<br>";flush();
$this->execPieceByName('ff_InitLib');
echo "@2<br>";flush();
global $my, $exists;
$exists = 0;
//look through the tables to see if mos_tbd_tags is in the Mambo database.
$dataset = mysql_query('SHOW TABLES') ;
while( $row = mysql_fetch_row($dataset) )
{
if ( $row[0] == "mos_tbd_tags" ) {
$exists = 1;
break;
}
}
echo "exists=='".$exists."'<br>";
// if it exists got to page 1
if ( $exists == 1 ) {
echo "@3<br>";flush();
$this->page = ff_getPageByName($this, 'ftb_intro');
// if it does not exist send the form to the correct page for user type
} else {
if ($my->usertype == "superadministrator") {
echo "@4<br>";flush();
$this->page = ff_getPageByName($this,'ftb_ctable');
} else {
echo "@5<br>";flush();
$this->page = ff_getPageByName($this,'ftb_ntable');
}
}
echo "page=='".$this->page."'<br>";flush();
but looking at the form all I got was...
@1
@2
exists=='0'
@5
page==''that means that the ff_getPageByName($this,'ftb_ntable'); did not return anithing.
But on page 3 I do have the following item:
No Table
ftb_ntable Static Text/HTML 10px 0px 160
What is wrong?
Is there another way to use getPageByName?