vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Forum Home Enhancements - VSa - Sub-Forum Manager (https://vborg.vbsupport.ru/showthread.php?t=236960)

Breakpoint 03-29-2012 01:26 AM

It would be nice for Valter to make an update with this code. Thanks

BirdOPrey5 03-31-2012 05:23 PM

Quote:

Originally Posted by TiKu (Post 2310329)
To fix the problem, add this code to MN hook:
Code:

                        if (!function_exists('vsa_CompareVersions'))
                        {
                                function vsa_CompareVersions($verstr1, $verstr2)
                                {
                                        $ver1 = explode('.', $verstr1);
                                        $ver2 = explode('.', $verstr2);
                                        for($i = 0; $i < 3; $i++)
                                        {
                                                if(intval($ver1[$i]) > intval($ver2[$i]))
                                                        return -1;
                                                elseif(intval($ver1[$i]) < intval($ver2[$i]))
                                                        return 1;
                                        }
                                        return 0;
                                }
                        }

Then instead of
Code:

if ($vbulletin->options['templateversion'] >= '4.1.8')
use this code:
Code:

$templateVerIsOlderThan418 = (vsa_CompareVersions($vbulletin->options['templateversion'], '4.1.8') > 0);
if(!$templateVerIsOlderThan418)


That's cool you posted the fix but you sort of re-invented the wheel there. PHP has a built in function called "version_compare" that compares versions numbers like x.x.x to y.y.y

http://php.net/manual/en/function.version-compare.php

You just need to replace the old IF conditions with this:
Code:

if (version_compare($vbulletin->options['templateversion'], '4.1.8', 'ge'))
The "ge" means "Greater than or equal to"

Working good for me on 4.1.11 with this change. :up:

Valter 04-01-2012 11:56 AM

v3.1.4 - Apr 01. 2012.
-New Option: Exclude styles
-New Option: Exclude forums
-Fixed some style issues

To upgrade:
-Import XML, allow overwrite

1320Nation 04-01-2012 09:12 PM

What does CSS 1- Main suppose to control? It doesn't matter what I enter in this option nothing seems to change.

Breakpoint 04-01-2012 10:09 PM

Thanks for the update!

dhemitz 04-03-2012 06:30 AM

Thanks........

Dave_The_Don 04-03-2012 11:38 AM

Quote:

Originally Posted by Ricsca (Post 2314202)
How to disable in defoult mobile vbulletin?

Thanks


I want to disable the product ‘VSa – Sub-Forum Manager’ for styleid=14 so I created a new plugin like this:

goto your :-

http://www.yourdomain.com/admincp/plugin.php?do=add

Product: VSa - Sub-Forum-Manager
Hook: style_fetch
Title: Disable VSa – Sub-Forum Manager For DefaultMobileStyle
Order: 1
PHP Code:
if ($styleid == 14){
$vbulletin->options['vsasfm_enable'] = 0;
}
Active plugin: YES

you will need to place your default Mobile Style id where i put 14!

TiKu 04-03-2012 11:54 AM

Quote:

Originally Posted by BirdOPrey5 (Post 2315452)
That's cool you posted the fix but you sort of re-invented the wheel there. PHP has a built in function called "version_compare" that compares versions numbers like x.x.x to y.y.y

Thank you! I'm not that familar with PHP. I'm mainly doing C++.
Seems like Valter integrated this fix and the feature to disable the add-on on a per-forum basis into version 3.1.4. :up:

TiKu 04-03-2012 11:55 AM

Quote:

Originally Posted by Dave_The_Don (Post 2316329)
I want to disable the product ?VSa ? Sub-Forum Manager? for styleid=14 so I created a new plugin like this:

With version 3.1.4 this isn't required anymore, because now you can exclude styles from the add-on using the settings page.

Dave_The_Don 04-03-2012 12:21 PM

oh well never mind lol.


All times are GMT. The time now is 03:31 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01653 seconds
  • Memory Usage 1,744KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete