Navigation: Start Documentation Examples Download Troubleshooting Changelog FORUM

Coding Examples

This part of the website shall help you by giving you example codes to try out and to use within your own project. There is a great variety of examples. From one-liners to small/great projects.If you have a code example yourself, feel free to contact me, so I can put it into this very example site.
Code examples are grouped by topics (such as posts or users).

Examples: Miscellaneous

Following code examples do not belong to any specific topic.

dbEscape

Example 1:

$query $MyBBI->db->query('
    SELECT `subject`
    FROM '
.TABLE_PREFIX.'threads
    WHERE `subject` LIKE \'%'
.$MyBBI->dbEscape($just_a_variable).'%\'
'
); 
TABLE_PREFIX is a constant, defined by MyBB containing the table prefix of the tables used by the MyBB forum

getForumStaff

- No example yet

parseString

Example 1:

$string 'Wow, [b]this[/b] text [i]surely[/i] contains [u]some[/u] BBCodes!';
$options = array(
    
'allow_html' => 0,
    
'allow_mycode' => 1,
    
'allow_smilies' => 1,
    
'me_username' => 1,
    
'nl2br' => 1
);
$parsed_text $MyBBI->parseString($string$options);
echo 
$parsed_text// Wow, <b>this</b> text <i>surely</i> contains <u>some</u> BBCodes!