Monkuar Posted May 15, 2009 Share Posted May 15, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/158330-if-function-cookie-value-lol/ Share on other sites More sharing options...
neogemima Posted May 15, 2009 Share Posted May 15, 2009 use the code tags when posting so we can read your stuff easier. Quote Link to comment https://forums.phpfreaks.com/topic/158330-if-function-cookie-value-lol/#findComment-835041 Share on other sites More sharing options...
Monkuar Posted May 15, 2009 Author Share Posted May 15, 2009 use the code tags when posting so we can read your stuff easier. Thanks for your help! Quote Link to comment https://forums.phpfreaks.com/topic/158330-if-function-cookie-value-lol/#findComment-835042 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.