Esempio n. 1
0
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());
}
 * 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.");
}
/* load template */
$plugins->add_hook("global_start", array(MyProfileVisitors::get_instance(), "global_start"));
$plugins->add_hook("member_profile_end", array(MyProfileVisitors::get_instance(), "member_profile_end"));
class MyProfileVisitors
{
    private static $instance = null;
    /* upgrade from 0.5 */
    public function upgrade_0_5()
    {
        global $lang, $db;
        MyProfileUtils::lang_load_config_myprofile();
        $gid = MyProfileUtils::get_settinggroup_gid("myprofilevisitors");
        $settings = array();
        $settings[] = array("name" => "mpprofileviewsenabled", "title" => $lang->mp_myprofile_views_enabled, "description" => $lang->mp_myprofile_views_enabled_desc, "optionscode" => "yesno", "value" => 1, "gid" => $gid);
        MyProfileUtils::insert_settings($settings);
        // Modify the users table
        if (!$db->field_exists("viewcount", "users")) {
            $db->add_column("users", "viewcount", "int unsigned DEFAULT 0");