• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

******* - XenForo Resource Prefixes [Paid] [Deleted]

Status
Not open for further replies.

Brivium

Well-known member
#1
******* submitted a new resource:

Xenforo Resource Prefixes - This product will allow you to apply pre-defined text to individual resources.

INFORMATION:
This product will allow you to apply pre-defined text to individual resources which is placed at the beginning of the Resources title.

FEATURES:
- Admin can manage (add/edit/delete) resource prefix and prefix group.
- Admin can setting which prefixes can be used in which resource categories can be done via the Applicable categories configuration page.
- Admin can setting which prefixes can be used by usergroups.\
- Admin can set style and custom style for prefix...
Read more about this resource...
 

santamo

Active member
#8
I have a problem with upgrading RM. But I cannot remove the addon. How do I do this?


ErrorException:Fatal Error: Call to undefined method *******_XenResourcePrefix_Installer::_getDb() -library/*******/XenResourcePrefix/Installer.php:52
Сгенерирована пользователем:админ,только что
Трассировка стэка
#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}
Содержимое запроса
array(3) {
["url"] => string(75) "http://forum.xxx.su/admin.php?add-ons/*******_XenResourcePrefix/delete"
["_GET"] => array(1) {
["add-ons/*******_XenResourcePrefix/delete"] => string(0) ""
}
["_POST"] => array(2) {
["_xfConfirm"] => string(1) "1"
["_xfToken"] => string(8) "********"
}
}
 

Brivium

Well-known member
#9
@santamo Replace all content at library/*******/XenResourcePrefix/Installer.php by following content and Uninstall Xen Resource Prefix
Code:
<?php
class *******_XenResourcePrefix_Installer
{
    public static function addColumn($table, $field, $attr)
    {
        if (!self::checkIfExist($table, $field)) {
            $db = XenForo_Application::get('db');
            return $db->query("ALTER TABLE `" . $table . "` ADD `" . $field . "` " . $attr);
        }
    }

    public static function checkIfExist($table, $field)
    {
        $db = XenForo_Application::get('db');
        if ($db->fetchRow('SHOW columns FROM `' . $table . '` WHERE Field = ?', $field)) {
            return true;
        }
        else {
            return false;
        }
    }
    public static function install()
    {
        $creditsAddon = XenForo_Model::create('XenForo_Model_AddOn')->getAddOnVersion('XenResource');
        if (!$creditsAddon) {
            throw new XenForo_Exception('XenForo Resource Manager Addon required', true);
        }
       
        $db = XenForo_Application::getDb();
        $db->query("
            CREATE TABLE IF NOT EXISTS `xf_resource_category_prefix` (
              `resource_category_id` int(10) unsigned NOT NULL,
              `prefix_id` int(10) unsigned NOT NULL,
              PRIMARY KEY (`resource_category_id`,`prefix_id`),
              KEY `prefix_id` (`prefix_id`)
            ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
        ");
        if (!self::checkIfExist('xf_resource', 'prefix_id')) {
            self::addColumn('xf_resource', 'prefix_id', " int(10) unsigned NOT NULL DEFAULT '0'");
        }
        if (!self::checkIfExist('xf_thread_prefix', 'is_resource')) {
            self::addColumn('xf_thread_prefix', 'is_resource', " tinyint(3) unsigned NOT NULL DEFAULT '0'");
        }
        return true;
    }
   
    /**
    * So sad. Delete all the data used by this addon
    */
    public static function uninstall()
    {
        $db = XenForo_Application::getDb();
        if (self::checkIfExist('xf_thread_prefix', 'is_resource')) {
            $db->query("ALTER TABLE `xf_thread_prefix` DROP `is_resource`");
        }
        $db->query("DROP TABLE IF EXISTS  `xf_resource_category_prefix`");
        return true;
    }
}

?>
 
#10
@*******

This add-on is doing some wonky stuff. Installed, but returned an error. Deactivated the add-on, but now it works! Very weird.

I'm on the latest version of Xenforo, using the UI.X theme.
 

Brivium

Well-known member
#11
@*******

This add-on is doing some wonky stuff. Installed, but returned an error. Deactivated the add-on, but now it works! Very weird.

I'm on the latest version of Xenforo, using the UI.X theme.
Because XFRM 1.1.x support this feature, therefore you don't need to install it.
 
Status
Not open for further replies.