1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

XenPorta v1.4.5 BETA TEST!

Discussion in 'Resource Discussions [Archive]' started by Jaxel, Sep 25, 2011.

  1. Jaxel

    Jaxel Well-Known Member

    This release is absolute ****ing beta! If it ****s up your forums... not my problem! YOU HAVE BEEN WARNED.

    Okay, first things first... This is the single biggest update to a mod I have ever done. Because of this, I have completely deprecated previous versions of this mod. If you currently have a previous version of XenPorta, you MUST uninstall it before installing this one. As well, don't forget to remove the appropriate files from the /js and /library folders before uploading the new files. IN ADDITION, check your database and make sure all EWRporta tables have been dropped.

    XENPORTA CHANGES

    The entire administration of XenPorta has been moved out of the public controller and into the admin controller. The new sections for modifying your XenPorta settings can be found in your adminCP for any administrators with the "option" and "node" permissions. If you are running your forums in debug mode, you may also edit blocks and their options directly if you have the "addOn" permission.

    Untitled-3.jpg

    Everything in this new version has changed... custom module blocks create by OTHER people will not be compatible with this new version. Its very easy to update the old custom blocks to match the new formatting, but you should ask the original custom block authors to do that. Since the new version of XenPorta uses a built in "block creation system" that works pretty much exactly the same as the "addOn creation system" of XenForo, I will not be writing a guide on how to construct the XML. You don't need to do it anymore, XenPorta will construct the XML for you. Just make your blocks in XenPorta, and then export the block as XML when you are done.

    Untitled-4.jpg

    In addition to being able to define each and every block individually in the portal, you can also define each option individually. You will notice in both the block and option screens, you can define callbacks for installation, uninstallation, format parameters and even validation. With this, you can have it so that blocks install their own tables, to use for their own reasons and stuff.

    XENPORTA OPTIONS

    After installing this new version, you will see a new option in XenPorta...

    Untitled-1.jpg

    Globalized Custom Layouts defines the abilities of your portal. Generally you only want to check the options you need, as enabling each settings will add some queries to those sections. Those queries are VERY SMALL... but I'm a performance whore; so I give you the ability to turn them off if you're not needing them.

    This new system works through the content id system with multiple fallbacks. For instance, if you enable the "Thread" layout system... when you visit a thread, it will look for a custom layout called "thread-(thread_id)". This lets you create a custom layout for that SPECIFIC thread_id. If it can't find the layout, it will trigger the first fallback and instead look for a layout called "thread-forum-(forum_id)". This will let you create a custom layout for all threads within a SPECIFIC forum_id (node). And finally, if it can't find that, it will hit a final fallback called "thread", which would be a custom layout for ALL threads.

    Naturally, none of this is required. If it finds none of them, then it won't have a custom layout. You could use "thread-(thread_id)" and choose not to use "thread-forum-(forum_id)" or even "thread". This system works for threads, forums, the forum index, and articles (any thread within forums set in the RecentNews block, or promoted to the block). Enabling the "Article" layout will also enable the custom article view.

    Untitled-2.jpg
    Creating custom layouts is actually very easy. You simply type the name of the layout into the box on the "List Layouts" page and submit. Then it will bring you to a page where you can construct a new layout. When you save it, it will be entered into the system. Naturally, you can name the layout whatever the hell you want... but realistically, only layouts the fit the naming structure defined in the "Globalize Custom Layouts" section will have any use for now. (for now!)

    Customizing layouts is pretty much the same as before... except its in the AdminCP instead. You can also download your layout grids to an XML file, should you want to backup your settings.

    BLOCK CHANGES

    A new block called "EventsStream" has been added. This block lets you embed live streams on your portal.
    A new block called "Amazon" has been added. This block lets you display amazon affiliate products.

    Untitled-5.jpg

    Thread promotion in the RecentNew block has also completely changed. Now when you promote a thread, you can specifically select what to display as the "promotion icon" for the article on your portal.
     

    Attached Files:

    eod, mcnecter, dieketzer and 8 others like this.
  2. Jaxel

    Jaxel Well-Known Member

    I forgot to mention... this mod needs two template hooks that don't exist yet. You will need to add them manually...

    At the absolute bottom of "thread_view"
    Code:
    <xen:hook name="thread_view_share_after" params="{xen:array 'thread={$thread}'}" />
    At the absolute bottom of "forum_view"
    Code:
    <xen:hook name="forum_view_pagenav_after" params="{xen:array 'forum={$forum}'}" />
     
    eod and Brandon Sheley like this.
  3. Igor Ljesevic

    Igor Ljesevic Member

    So here it is :D first msg and first error

    Code:
    Server Error
    
    Mysqli prepare error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mediumtblock NOT NULL, PRIMARY KEY (`layout_id`) ) ENGINE = InnoDB CHAR' at line 3
    
    Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
    Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
    Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
    Zend_Db_Adapter_Abstract->query() in EWRporta/Install.php at line 45
    EWRporta_Install::installCode()
    call_user_func() in XenForo/Model/AddOn.php at line 214
    XenForo_Model_AddOn->installAddOnXml() in XenForo/Model/AddOn.php at line 169
    XenForo_Model_AddOn->installAddOnXmlFromFile() in XenForo/ControllerAdmin/AddOn.php at line 189
    XenForo_ControllerAdmin_AddOn->actionInstall() in XenForo/FrontController.php at line 310
    XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
    XenForo_FrontController->run() in /home/bgdonlin/public_html/admin.php at line 13
    Any clue how to fix this?
     
  4. Jaxel

    Jaxel Well-Known Member

    Replace the contents of install.php with the following:

    Code:
    <?php
    
    class EWRporta_Install
    {
        public static function installCode()
        {
            $db = XenForo_Application::get('db');
    
            $db->query("
                CREATE TABLE IF NOT EXISTS `EWRporta_blocks` (
                    `block_id`                        varchar(25) NOT NULL,
                    `title`                            varchar(75) NOT NULL,
                    `version_string`                varchar(30) NOT NULL,
                    `version_id`                    int(10) unsigned NOT NULL DEFAULT '0',
                    `url`                            varchar(100) NOT NULL,
                    `install_callback_class`        varchar(75) NOT NULL,
                    `install_callback_method`        varchar(75) NOT NULL,
                    `uninstall_callback_class`        varchar(75) NOT NULL,
                    `uninstall_callback_method`        varchar(75) NOT NULL,
                    `cache`                            varchar(255) NOT NULL DEFAULT '+10 minutes',
                    `display`                        enum('show','hide') NOT NULL,
                    `groups`                        varchar(255) NOT NULL,
                    `locked`                        tinyint(3) unsigned NOT NULL DEFAULT '0',
                    `active`                        tinyint(3) unsigned NOT NULL DEFAULT '1',
                    PRIMARY KEY (`block_id`),
                    KEY `title` (`title`)
                ) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
            ");
    
            $db->query("
                CREATE TABLE IF NOT EXISTS `EWRporta_caches` (
                    `block_id`                varchar(25) NOT NULL,
                    `date`                    int(10) unsigned NOT NULL,
                    `results`                mediumtext NOT NULL,
                    PRIMARY KEY (`block_id`)
                ) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
            ");
    
            $db->query("
                CREATE TABLE IF NOT EXISTS `EWRporta_layouts` (
                    `layout_id`                varchar(25) NOT NULL,
                    `blocks`                mediumblob NOT NULL,
                    PRIMARY KEY (`layout_id`)
                ) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
            ");
    
            $db->query("
                CREATE TABLE IF NOT EXISTS `EWRporta_options` (
                    `option_id`                varchar(50) NOT NULL,
                    `title`                    varchar(100) NOT NULL,
                    `explain`                mediumtext NOT NULL,
                    `option_value`            mediumblob NOT NULL,
                    `edit_format`            enum('textbox','spinbox','onoff','radio','select','checkbox','template','callback') NOT NULL,
                    `edit_format_params`    mediumtext NOT NULL,
                    `data_type`                enum('string','integer','numeric','array','boolean','positive_integer','unsigned_integer','unsigned_numeric') NOT NULL,
                    `sub_options`            mediumtext NOT NULL,
                    `validation_class`        varchar(75) NOT NULL,
                    `validation_method`        varchar(50) NOT NULL,
                    `display_order`            int(10) unsigned NOT NULL DEFAULT '0',
                    `block_id`                varchar(25) NOT NULL,
                    PRIMARY KEY (`option_id`)
                ) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
            ");
    
            $db->query("
                CREATE TABLE IF NOT EXISTS `EWRporta_promotes` (
                    `thread_id`                int(10) unsigned NOT NULL,
                    `promote_date`            int(10) unsigned NOT NULL,
                    `promote_icon`            enum('default','avatar','attach','image','medio','disabled') NOT NULL DEFAULT 'default',
                    `promote_data`            varchar(1024) NOT NULL DEFAULT '0',
                    PRIMARY KEY (`thread_id`)
                ) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
            ");
    
            $blocksModel = XenForo_Model::create('EWRporta_Model_Blocks');
    
            if ($handle = opendir($xmlDir = XenForo_Application::getInstance()->getRootDir().'/library/EWRporta/XML'))
            {
                while (false !== ($file = readdir($handle)))
                {
                    if (stristr($file,'xml'))
                    {
                        $blocksModel->installBlockXmlFromFile($xmlDir.'/'.$file);
                    }
                }
                opendir($xmlDir);
            }
    
            if ($handle = opendir($xmlDir = XenForo_Application::getInstance()->getRootDir().'/library/EWRporta/XML_Addons'))
            {
                while (false !== ($file = readdir($handle)))
                {
                    if (stristr($file,'xml'))
                    {
                        $blockId = str_ireplace('.xml', '', $file);
    
                        if ($blocksModel->getBlockById($blockId))
                        {
                            $blocksModel->installBlockXmlFromFile($xmlDir.'/'.$file);
                        }
                    }
                }
                opendir($xmlDir);
            }
    
            return true;
        }
    
        public static function uninstallCode()
        {
            $db = XenForo_Application::get('db');
    
            $blocks = XenForo_Model::create('EWRporta_Model_Blocks')->getAllBlocks();
    
            foreach ($blocks AS $block)
            {
                XenForo_Model::create('EWRporta_Model_Blocks')->uninstallBlock($block);
            }
    
            $db->query("
                DROP TABLE IF EXISTS
                    `EWRporta_blocks`,
                    `EWRporta_caches`,
                    `EWRporta_layouts`,
                    `EWRporta_options`,
                    `EWRporta_promotes`
            ");
    
            return true;
        }
    
        public static function addColumnIfNotExist($db, $table, $field, $attr)
        {
            if ($db->fetchRow('SHOW columns FROM `'.$table.'` WHERE Field = ?', $field))
            {
                return false;
            }
    
            return $db->query("ALTER TABLE `".$table."` ADD `".$field."` ".$attr);
        }
    }
     
  5. Igor Ljesevic

    Igor Ljesevic Member

    Next one :)
    Code:
    Fatal error: Call to undefined method EWRporta_Model_Blocks::importBlock() in /home/bgdonlin/public_html/library/EWRporta/Install.php on line 83
    Fixed with replacement on line 83... "importBlock" with "installBlockXmlFromFile"
     
  6. Jaxel

    Jaxel Well-Known Member

    Okay... I uploaded a new version of the zip file at the location emailed you...
     
  7. Igor Ljesevic

    Igor Ljesevic Member

    Yeah install and settings are ok now, next problem is blank portal page i set permissions and everything like block place and similar stuff but portal is still empty :(

    Fixed: problem was in old EWRporta style templates so i used PhpMyAdmin to remove it...
     
  8. Itworx4me

    Itworx4me Well-Known Member

    I get this error when trying to ad the news module to the portal page.
    Code:
    An exception occurred: Mysqli prepare error: Unknown column 'EWRporta_promotes.promote_icon' in 'field list' in /home/**********/public_html/library/Zend/Db/Statement/Mysqli.php on line 77
    
    Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
    Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
    Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
    Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 734
    Zend_Db_Adapter_Abstract->fetchAll() in EWRporta/Block/RecentNews.php at line 24
    EWRporta_Block_RecentNews->getModule() in EWRporta/Model/Blocks.php at line 105
    EWRporta_Model_Blocks->getBlockParams() in EWRporta/ViewPublic/Portal.php at line 50
    EWRporta_ViewPublic_Portal->renderHtml() in XenForo/ViewRenderer/Abstract.php at line 222
    XenForo_ViewRenderer_Abstract->renderViewObject() in XenForo/ViewRenderer/HtmlPublic.php at line 67
    XenForo_ViewRenderer_HtmlPublic->renderView() in XenForo/FrontController.php at line 533
    XenForo_FrontController->renderView() in XenForo/FrontController.php at line 156
    XenForo_FrontController->run() in /home/********/public_html/index.php at line 13
     
  9. Itworx4me

    Itworx4me Well-Known Member

    When using recent threads module no threads appear.
    recent threads.PNG
     
  10. DaveL

    DaveL Well-Known Member

    When I enable the "Recent News" module, when I refresh my homepage it comes back with "An unexpected database error occurred. Please try again later."

    ________________________________________________

    When I click "promote thread" it comes back with the following error:

    Solved my changing the install.php file and re-installing the xml.
     
  11. DaveL

    DaveL Well-Known Member

    Try changing your install.php file as per post 4 and re-installing the xml. Worked for me :)
     
  12. DaveL

    DaveL Well-Known Member

    Has anyone worked out how to use the layout system?

    Im trying to get it so I can have the "Recent News" taking up two blocks, rather then the one - but not having much joy! Dosent quite work when its only taking up the one block.

    news.png

    If its not currently possible - IS it possible to users can choose which empty blocks they want to use before filling them?

    EG

    You have the three columns still

    1........2........3

    But users could choose:

    Large Large Small (The large block covers both 1+2)
    Small Small Small
    Small Large Large (The large box covers both 2+3)

    Hope that makes sense!
     
  13. Itworx4me

    Itworx4me Well-Known Member

    Fixed with Post #4
     
    DaveL likes this.
  14. Jaxel

    Jaxel Well-Known Member

    Sorry, it was an error in the v1.4.4 install file... I forgot to tell the uninstall code to drop all the EWRporta tables when uninstalled.

    Any blocks in the "RIGHT" (column 2) sections automatically become full blocks if the LEFT (column 1) section is blank.
     
  15. DaveL

    DaveL Well-Known Member

    Jaxel,

    I deleted all the files from /library an /js and also uninstalled the the previous version via the ACP.

    I made a backup of the files first so I can tell you what I uninstalled

    /js/8wayrun/
    All files starting EWRporta

    /library
    Entire EWRporta folder.

    Is there anything in particular ive missed as they were what you said to delete in your first post.
     
  16. Jaxel

    Jaxel Well-Known Member

    Naw, it was my fault... an old uninstall bug from v1.4.4. When you uninstalled that version, it didn't "fully" uninstall.
     
  17. DaveL

    DaveL Well-Known Member

    Works a treat, thank you. I didnt see this mentioned anywhere thats why I posted whether it was possible.
     
  18. Itworx4me

    Itworx4me Well-Known Member

    Still having issues with this module.
     
  19. Jaxel

    Jaxel Well-Known Member

    Screenshot me your settings for this block plz.
     
  20. Itworx4me

    Itworx4me Well-Known Member

    recent threads2.PNG
     

Share This Page