Jump to content

If function = cookie value? lol


Monkuar

Recommended Posts

function ForumRow($info, $subinfo="") {
global $ibforums;
$color_one = 'ce bc1'; 
   $color_two = 'ce'; 
   static $i = 0;
   $color = ($i % 2) ? $color_one : $color_two;
   $i++;
   
   
if ($info['name'] == "Board Announcements")
			{
				$test = 'hey';
				}
if ($info['name'] == "Donate to 24-7PK Realm") {
$image_icon = "<img src='donors/big_star.gif' />";
} elseif ($info['name'] == "Import Request/Support Section") {
$image_icon = "<img src='images/imports.png' />";
} elseif ($info['name'] == "How to Install 24-7PK") {
$image_icon = "<img src='images/connect_arrow.gif' />";
} elseif ($info['name'] == "Trading Grounds") {
	$image_icon = "<img src='gold.png' />";
} else {
$image_icon = $info['img_new_post'];
}





return <<<EOF
      <tr class="$color">
      <td>$image_icon</td>
      <td align="left"><b><a href="index.php?showforum={$info['id']}" title="{$info['description']}">{$info['name']}</b></a>{$subinfo} {$info['moderator']}</td>

      <td nowrap><span class="desc">Topics:</span> {$info['topics']}<br/><span class="desc">Posts:</span> {$info['posts']}</td>
      <td align="left" nowrap class="lc"><span class="desc">{$info['last_post']}</span><br/>» {$info['last_topic']}<br>By {$info['last_poster']}</td>
      </tr>
      
      <tr> 

  
EOF;
}


I want to put a if function so that it does, if user [ cookie value = 0 ] display that function but if the user cookie changes it does else function witch will be to show;



function ForumRow($info, $subinfo="") {
global $ibforums;
$color_one = 'ce bc1'; 
   $color_two = 'ce'; 
   static $i = 0;
   $color = ($i % 2) ? $color_one : $color_two;
   $i++;
   
   
if ($info['name'] == "Board Announcements")
			{
				$test = 'hey';
				}
if ($info['name'] == "Donate to 24-7PK Realm") {
$image_icon = "<img src='donors/big_star.gif' />";
} elseif ($info['name'] == "Import Request/Support Section") {
$image_icon = "<img src='images/imports.png' />";
} elseif ($info['name'] == "How to Install 24-7PK") {
$image_icon = "<img src='images/connect_arrow.gif' />";
} elseif ($info['name'] == "Trading Grounds") {
	$image_icon = "<img src='gold.png' />";
} else {
$image_icon = $info['img_new_post'];
}





return <<<EOF
      <tr class="$color">
      <td>$image_icon</td>
      <td align="left"><b><a href="index.php?showforum={$info['id']}" title="{$info['description']}">{$info['name']}</b></a> {$info['moderator']}</td>

      <td nowrap><span class="desc">Topics:</span> {$info['topics']}<br/><span class="desc">Posts:</span> {$info['posts']}</td>
      <td align="left" nowrap class="lc"><span class="desc">{$info['last_post']}</span><br/>» {$info['last_topic']}<br>By {$info['last_poster']}</td>
      </tr>
      
      <tr> 

  
EOF;
}

 

[HENCE I removed {$subinfo}] in second code so then they could hide subforums if they want :) and i can store data in a cookie ?  lol

Link to comment
https://forums.phpfreaks.com/topic/158330-if-function-cookie-value-lol/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.