PHP Web Host - Quality Web Hosting For All PHP Applications $35/month $250/year (Unlimited) - $25/month - 200,000 impressions - Your Ad Could be Here - Click For Details
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
Darrell3831
Worker
Worker


Joined: Feb 18, 2004
Posts: 244

PostPosted: Tue Jan 31, 2006 5:08 am Reply with quote Back to top

Within the code of a module it's necessary to know what patched version you have so that you can make conditional tests.

For instance:

Code:
define('INDEX_FILE', true);  // 3.1 or later - show right hand blocks
$index = 0; // 3.0 or earlier - show right hand blocks


Is there a test I can run in php that will tell me what patched version my code is running under?

Thanks,
Darrell
View user's profile Send private message Visit poster's website
montego
Site Admin


Joined: Aug 29, 2004
Posts: 7216
Location: Arizona

PostPosted: Tue Jan 31, 2006 6:38 am Reply with quote Back to top

Darrell3831, unfortunately not. What I have done recently is within my index file I simple define both. In my opinion, it really isn't introducing any security risk because if you are 3.0 and under, it requires $index be set anyways, and if you are running 3.1, nothing looks at $index variable anyways.
View user's profile Send private message Visit poster's website
Darrell3831
Worker
Worker


Joined: Feb 18, 2004
Posts: 244

PostPosted: Tue Jan 31, 2006 9:14 am Reply with quote Back to top

huh,

Well that's a simple solution I had'nt thought of.

Thanks again Montego!
View user's profile Send private message Visit poster's website
evaders99
Moderator


Joined: Apr 30, 2004
Posts: 2744

PostPosted: Tue Jan 31, 2006 11:18 am Reply with quote Back to top

Simple enough - mainfile.php has the 3.1 version number on it.
If it doesn't, then you know its 3.0 or earlier
View user's profile Send private message Visit poster's website
Darrell3831
Worker
Worker


Joined: Feb 18, 2004
Posts: 244

PostPosted: Tue Jan 31, 2006 11:29 am Reply with quote Back to top

Sorry Evaders,

I don't think I understand what your saying... Could you fix this thing you called a simple test for me, please?

Code:
if (mainfile.php => 3.1) {  // Simple test

define('INDEX_FILE', true); 

}

else {

$index = 0;

}


Thanks,
Darrell
View user's profile Send private message Visit poster's website
evaders99
Moderator


Joined: Apr 30, 2004
Posts: 2744

PostPosted: Tue Jan 31, 2006 11:32 am Reply with quote Back to top

Ah - you wanted a code way to determine their patched level. Sorry.

montego is correct. You can define both, it won't hurt you
View user's profile Send private message Visit poster's website
Darrell3831
Worker
Worker


Joined: Feb 18, 2004
Posts: 244

PostPosted: Tue Jan 31, 2006 11:35 am Reply with quote Back to top

thanks
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2008 by Raven
Proud to be listed at Lobo Links Web Directory

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::

:: fisubice Theme Recoded To 100% W3C CSS & HTML 4.01 Transitional Compliance by Raven and 64bitguy ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum