Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.