Solved install issues, support for predefined preview picture in page info function

This pull request solves some problems that occur with the new database function. 

Additionally there are the following fixes and enhancements:

* In the API there as a cut&paste error that resulted in a wrong variable name
* BBCode: the code for the "share" element was rearranged in a single function
* BBCode: the "attachement" code can now contain a "preview" parameter
* the function "add_page_info" can now be called with a link to an image that replaces the image that this function is trying to fetch. This is used in the appnet extension and will be used in twitter and statusnet as well (when importing the timeline)