View Full Version : PHP help?
Team_RCRR
07-02-2008, 04:11 PM
Okay I have been reading over W3 schools.com for about 1day 1/2. I have developed a script (I think it will work) and I wonder how would you "export" it to use for VB?
Here's the script:
<?php
$m=month("M");
if ($m=="January")
echo "MacWorld 2009 is going to be BIG!";
else
echo "MacWorld 2009 here we come!";
?>
Now this is a stupid useless code I know that but it would be my first line I have ever done.
noppid
07-02-2008, 04:24 PM
Put this in a hook that is called before the template you want this to display in is eval'd.
if(month("M") == "January")
$templatevar = "MacWorld 2009 is going to be BIG!";
else
$templatevar = "MacWorld 2009 here we come!";
Put $templatevar in the template where you want the words to display.
Good work. Nice to see people apply themselves instead of just asking for a gimmie.
Oh yeah, set your editor to 4 space tab too. ;)
Team_RCRR
07-02-2008, 04:35 PM
Ohh that makes a lot of sense! Thanks for the help!
noppid
07-02-2008, 05:42 PM
Glad to help. Take a look at existing hacks to get clues on how to make it a product. Or make a product in the acp and add hooks to it and export it.
Dismounted
07-03-2008, 06:42 AM
Nice, clean code is also good (since you're learning). One thing to do is to avoid using too generic variables, as other modifications may "take over" your variable.
if (month('M') == 'January')
{
$macworld = 'MacWorld 2009 is going to be BIG!';
}
else
{
$macworld = 'MacWorld 2009 here we come!';
}
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.