function myprofile_bundles() { /* if you create a new bundle, register it in here, so it receives the plugin's routines */ return array("essence" => MyProfileEssence::get_instance(), "comments" => MyProfileComments::get_instance(), "buddylist" => MyProfileBuddyList::get_instance(), "referredby" => MyProfileReferredBy::get_instance(), "visitors" => MyProfileVisitors::get_instance(), "permissions" => MyProfilePermissions::get_instance()); }
* The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ // Disallow direct access to this file for security reasons if (!defined("IN_MYBB")) { die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined."); } $plugins->add_hook("global_start", array(MyProfileEssence::get_instance(), "global_start")); $plugins->add_hook("global_intermediate", array(MyProfileEssence::get_instance(), "global_intermediate")); class MyProfileEssence { private static $instance = null; public function activate() { global $db, $lang, $cache; require_once MYBB_ROOT . "inc/adminfunctions_templates.php"; $templates = array(); $myprofile_cache = $cache->read("myprofile"); $ver = str_replace(".", "_", trim($myprofile_cache["version"])); /* we're allowed to hard write the version inside the template, it will be updated every time there's a new version */ $templates["myprofile_member_headerinclude"] = '<script type="text/javascript" src="{$mybb->asset_url}/jscripts/myprofile.js?ver=' . $ver . '"></script>'; MyProfileUtils::insert_templates($templates); find_replace_templatesets("headerinclude", "/\$/", '{$stylesheets}{$myprofile_headerinclude}'); }