Common Howtos
How do I create a new blog?
boastMachine has the ability to run multiple blogs from one database.
To add a new blog, login to the admin page. On the main screen itself, you will see a form 'Create a new blog'. You will be asked for the blog name and the static file. In the blog name field, enter a name for your blog, something like 'My personal blog' or something.
The static file is a php script which is automatically created in the parent directory of boastMachine installation. A new static file is created each time you create a new blog. The purpose of this file is to load the new blog created. For example, if you create a blog named 'My personal blog', you would enter the static file name as 'personal' or something. This will create personal.php in the parent directory and your new blog will be accessible here yoursite.com/blog/personal.php
While entering the blog name, keep in mind that you should enter a short filename with NO extension and NO special characters including spaces. for example, if you enter 'personal', the file created would be 'personal.php' . So there's no need for you to enter the extension '.php' in filename field.
How do I use the built in shoutbox?
boastMachine (3.0+) has a nifty built in shoutbox which doesn't use a MySQL db. You can display this shoutbox on any of the boastMachine pages. The function you should use to load the shoubox is bmc_ShoutBox(); For example, in a template, it would look something like this. <?php bmc_ShoutBox(); ?>
How do I keep my posts safe?
boastMachine has a built in backup / restore feature which comes handy in a lot of situations. Goto Admin - > Backup/Restore . Select the data which you want to be backed up and hit the backup button. The script will automatically create mySQL dump files for the selected tables. That is stored in the ./backup directory. You can view/delete all your backups on the backup page itself, under 'Previous backups'. If you want, you can restore the data directly from there, without downloading and re-uploading the backup file later.
How do I create my own language pack?
All the boastMachine's language files can be found in the ./bmc/inc/lang directory. First, take a copy of the default English language file, i.e, en.php Then rename the file to a name of your choice, eg: de.php . Open the file, you will see a million vairables, each holding an English string :) Start translating each sentence and when you finish you will habe made your own laguage pack. While editing, take care of the Slashes, and the quotes " being used in the variables. For eg: to use a " in the string, you should put a slash in front of the quote \" otherwise, you will end up with an error.
How do I manage my uploaded files?
boastMachine enables each user to upload and manage files which they can attach with their posts. Each file you upload will be renamed to something like this, username_file.ext To manage your files, you need to goto the 'New Post' page and near the 'File attachments' click File manager.
What are smilie packs?
What ever image file you put in the ./smilies directory will be treated as a smilie by boastMachine which will be available on the post/edit pages. You will find a file named smiles.pak in the ./smilies directory. If you open it, you'll see a number of lines, each line with a string something like this smile.gif=:) You can add your own custom smilies in the file in the format filename=symbol . boastMachine will automatically recognize your custom symbols in the posts and substitute them with the appropriate smilie.
I'm writing custom pages. So how do I get a logged in user's info?
Its pretty simple. $bmc_vars is boastMachine's global array which holds all the necessary variables. If a user is logged in, a new array is automatically added to it. For example if the user 'abcd' is logged in, the array $bmc_vars['logged_in_user'] will hold his necessary details.
$bmc_vars['logged_in_user']['id'] - The user's numerical ID
$bmc_vars['logged_in_user']['level'] - User Level
$bmc_vars['logged_in_user']['name'] - Fullname
$bmc_vars['logged_in_user']['nick'] - Nick name
$bmc_vars['logged_in_user']['show_id'] - Display Id (nick,fullname or username)
How do I display the 'Recent Posts' list on external pages?
Its pretty simple. This piece of code will list x number of posts on any page
<?php
include_once "PATH_TO_BOASTMACHINE_DIRECTORY/config.php";
include_once "PATH_TO_BOASTMACHINE_DIRECTORY/$bmc_dir/main.php";
bmc_show_list('posts','','<br />',BLOG,4);
?>
where the format is this
bmc_show_list('posts','START_TAG','END_TAG',BLOG_ID,TOTAL_POSTS);
START_TAG is the html tag which should appear in front of each line being printed.
END_TAG is the same, but appears at the end of each lines being printed.
BLOG_ID is the numeric id of the blog from which you want to display the posts
TOTAL_POSTS is the number of recent posts that are to be listed.
PLEASE NOTE that you should use this code ONLY on external pages! If you want to list
the recent posts in any of the pages inside boastMachine itself, just use
bmc_show_list('posts','','<br />',BLOG,4);
no need of the include_once directives.How do I change the user profile image's dimensions
Open ./bmc/main.php
Goto line 67, you will find the necessary variables. Change their values to suit your needs. ( Image width/height/filesize)
