How to use <if gids in .php
1master1 Offline
Member
***
Posts: 232
Joined: Oct 2010
Post: #1
How to use <if gids in .php
I would like to use <if gid> statements in .php files and i know its not possible and we can only use if(cond) { }

This is the code in .php file

Code:
1
2
3
4
5
6
$ontoday=<<<HERE
<td class="trow1"><a href="/forum/online.php?action=today" target="_blank"><img src="./images/oll.png" title="" class="statistics" style="float:left; height:38px; margin-right:5px; padding:8px; width:38px;"/></a>
<span class="smalltext">{$who_online}</span><br />$onToday
</td>
</tr>
HERE;


I want to hide <a href="/forum/online.php?action=today" target="_blank"> for certain gids, and i tried to use <if gid> as we see other tags are also the same mostly like <td class="">
But its showing error. Any help pls?

10-14-2010 07:04 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #2
RE: How to use <if gids in .php
I'm a bit lost - what template are you referring to? You want to hide the links to Whos online? Please try and be a bit clearer so we can try and help you.


[Image: leelink.gif]
MYBB1.6 & XThreads
10-14-2010 08:00 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #3
RE: How to use <if gids in .php
As you said yourself, you need to use an if(...) clause.

PHP Code:
if(whatever) {
  $ontoday="blah";
} else {
  $ontoday="bleh";
}


My Blog
10-14-2010 08:18 AM
Find all posts by this user Quote this message in a reply
1master1 Offline
Member
***
Posts: 232
Joined: Oct 2010
Post: #4
RE: How to use <if gids in .php
OMG, you are the saviour zinga. Thanks Smile

This made the work.

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
if(in_array($GLOBALS['mybb']->user['usergroup'], array(3,4,6))) 
        {
                $ontoday=<<<HERE
                <td class="trow1"><a href="/forum/online.php?action=today" target="_blank"><img src="./images/oll.png" title="" class="statistics" style="float:left; height:38px; margin-right:5px; padding:8px; width:38px;"/></a>
<span class="smalltext">{$who_online}</span><br />$onToday</td></tr>
HERE;
        } 
        else 
        {
                $ontoday=<<<HERE
                <td class="trow1"><img src="./images/oll.png" title="" class="statistics" style="float:left; height:38px; margin-right:5px; padding:8px; width:38px;"/>
<span class="smalltext">{$who_online}</span><br />$onToday</td></tr>
HERE;
        }


Topic Solved

(This post was last modified: 10-14-2010 03:48 PM by 1master1.)
10-14-2010 03:47 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: