The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
I need help making something like this.
so for example Code:
if ($number == NULL) {
echo 'there is a $number';
}
else {
echo 'There is no value';
}
|
|
#2
|
|||
|
|||
|
If the variable is set to null when there is no value, then I think you could check it by using $number === null (three '='). If the variable is not set at all when there's no number then it won't be equal to null so you'd have to use isset($number) to see if it's set.
|
|
#3
|
|||
|
|||
|
i think i got it
i think i figured it out Is this correct? Code:
if (isset($number))
{
echo "Variable is set";
}
else
{
echo "its not set";
}
|
|
#5
|
|||
|
|||
|
Quote:
--------------- Added [DATE]1347032342[/DATE] at [TIME]1347032342[/TIME] --------------- one more question... how would i go about adding the if/else in this Code:
$template_hook['forumhome_above_forums'] .= "". --------------- Added [DATE]1347034575[/DATE] at [TIME]1347034575[/TIME] --------------- nope i tried this ty u guys for you patience with me.. Code:
$template_hook['forumhome_above_forums'] .= "".if (isset($shirtid)) {
echo $itemshirt;
}
else
{
echo "put a shirt on";
}."
</div>"; }
okay so i give up here is my plugin Whats wrong here???? Code:
$shirtid = "". $decode[items][shirt][id] ."";
$itemshirt = "<a href=\"http://www.wowhead.com/item=".$shirtid."\" rel=\"item=".$shirtid."\"><img class=\"wowequipimg\" src=\"".$bliziconurl."/".$shirticon.".jpg\"></a>";
if (isset($shirtid)) {
$template_hook['forumhome_above_forums'] .= "". $itemshirt ."";
}
else
{
$template_hook['forumhome_above_forums'] .= "put a shirt on";
}
Getting Close i can feel it... im not getting any errors but This works! I tested Code:
if (isset($shirtid)) {
$template_hook['forumhome_above_forums'] .= "". $itemshirt ."";
}
Code:
else
{
$template_hook['forumhome_above_forums'] .= "put a shirt on";
}
--------------- Added [DATE]1347036765[/DATE] at [TIME]1347036765[/TIME] --------------- End Result Which works!!!! Code:
if ($shirtid == NULL) {
$template_hook['forumhome_above_forums'] .= "". $missingshirt ."";
}
else
{
$template_hook['forumhome_above_forums'] .= "". $itemshirt ."";
}
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|