Jump to content

PHP in Pages


Ken Johnson

Recommended Posts

Posted

I'm having quite a few issues finding good documentation on how to create fully functioning custom pages in Pages.

My overall goal is to create a full application built in the forum wrapper, but there is VERY little information out there about how to build your own Application, so I figured I'd just build the app through a Pages page. I can't figure out how to use php in the general page, but I did figure out that I can just create a custom block and build my php through that.

My question is, how do I access IPB's database? I found some useful information, but it's for ipb 3 (here) and if I could figure out how to query the database I'd be well on my way. Is building a full application through a block a bad idea? Is there anywhere with a sufficient amount of info about how IPB Applications work?

I really do appreciate any and all help. Thank you.

Posted

To query the DB, look at /system/Db/Db.php.  

\IPS\Db::i()->select('*', $from, $where, $order, ... );

Alternatively, if you're looking for something that's a contentItem, use getItemWithPermission.

$databaseId = 6;
$recordClass = '\IPS\cms\Records' . $databaseId;
$records = $recordClass::getItemsWithPermission( array( array( 'field_29<?', 3 )) , 'field_29 ASC', 5 );

 

If you need help building an app, post here... We're here to help.  

https://invisionpower.com/forums/forum/238-development-assistance/

 

Posted
23 minutes ago, Aiwa said:

To query the DB, look at /system/Db/Db.php.  


\IPS\Db::i()->select('*', $from, $where, $order, ... );

Alternatively, if you're looking for something that's a contentItem, use getItemWithPermission.


$databaseId = 6;
$recordClass = '\IPS\cms\Records' . $databaseId;
$records = $recordClass::getItemsWithPermission( array( array( 'field_29<?', 3 )) , 'field_29 ASC', 5 );

 

If you need help building an app, post here... We're here to help.  

https://invisionpower.com/forums/forum/238-development-assistance/

 

You're awesome, thank you.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...