Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 08 Aug 2011, 02:48
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Real name: Brooks
PHP conditional for vBulletin version?

Is there one? Haven't exactly searched/looked through any files for this, but is there a PHP conditional for what version of vBulletin you're on?

For example:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
"Our greatest weakness lies in giving up. The most certain way to succeed is always to try just one more time!"
"It's important to only think about what you desire, not what you fear to achieve your ultimate goal!!
Reply With Quote
  #2  
Old 08 Aug 2011, 03:13
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
Paul M does that in a couple of his mods I think.
Reply With Quote
  #3  
Old 08 Aug 2011, 03:15
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Real name: Brooks
Hmm....never even noticed lol. I'll go have a look
__________________
"Our greatest weakness lies in giving up. The most certain way to succeed is always to try just one more time!"
"It's important to only think about what you desire, not what you fear to achieve your ultimate goal!!
Reply With Quote
  #4  
Old 08 Aug 2011, 03:39
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
There's a PHP function version_compare() for doing compares on version strings: http://us2.php.net/manual/en/functio...on-compare.php and the vbulletin version is in $vbulletin->versionnumber, so you could do something like


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


An example I found in the vb code had the '@' there, I'm not sure why, I guess it would suppress an error message if $vbulletin->versionnumber didn't exist but I don't know if or when that would happen.
Reply With Quote
  #5  
Old 08 Aug 2011, 03:41
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Real name: Brooks
Originally Posted by kh99 View Post
There's a PHP function version_compare() for doing compares on version strings: http://us2.php.net/manual/en/functio...on-compare.php and the vbulletin version is in $vbulletin->versionnumber, so you could do something like


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

An example I found in the vb code had the '@' there, I'm not sure why, I guess it would suppress an error message if $vbulletin->versionnumber didn't exist but I don't know if or when that would happen.
Thanks. I'll try that
__________________
"Our greatest weakness lies in giving up. The most certain way to succeed is always to try just one more time!"
"It's important to only think about what you desire, not what you fear to achieve your ultimate goal!!
Reply With Quote
  #6  
Old 08 Aug 2011, 04:58
Badshah93's Avatar
Badshah93 Badshah93 is offline
 
Join Date: Jun 2010
Real name: Aayush Agrawal
Try This


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 06:33.

Layout Options | Width: Wide Color: