// License information // modules/examplemodule.php // by Author N. // // This is a short description with the purpose and use of the module. Any extra information - such as it only being displayed on blog posts, for example, should be mentioned here as well. function examplemodule ( $pageownerid, $pageownername, $resourcetype, $resourceid ) { // Modules must *always* accept these parameters. require ( '../main/settings.php' ); // To make use of internal Bevey functions or settings, you must reference the files they are contained in. Note the "../main/" prefix. require_once ( '../main/inc/dbserver.php' ); require_once ( '../main/inc/sanitize.php' ); if ( $pageownerid ) { // This is a way of ensuring the module is only being used on user pages. $query = "SELECT {$tableprefix}_example.userid FROM {$tableprefix}_example WHERE {$tableprefix}_example.userid = $pageownerid ORDER BY {$tableprefix}_example.userid DESC"; // This is how a typical query string is formatted. // "Error code" identifiers are sent to all database references (connects and queries) as well as file system references. For modules, always prefix with M-, followed by the first letter of each word in the function name. In this case, Example - E. For server connections, we use the number 1xx, for queries, 2xx, for file errors, 3xx. The last two numbers must be unique. The first server connection will be M-E100, the second connection - M-E101 and so on. serverconnect ( 'M-E100' ); // This is how Bevey is set up to connect to the database. $exampleresults = serverquery ( $query, 'M-E200' ); // And this is how Bevey is set up to query the server, loading it's results into the variable defined. Variable names for raw results are generally suffixed with "results". // This bit of displays the required "remove module" link for the page owner. The ?removemodule= value must be the same as the function and filename (excluding file extension). if ( ( $_SESSION['userid'] ) && ( $pageownerid == $_SESSION['userid'] ) ) { // Take note of the white-space used - I'm OCD and like having pretty outputted XHTML, don't you? $modreturn[2] .= '
There are no examples
'; } $modreturn[2] .= '