• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Help in gesior acc

Felipe Monteiro

Webmaster
Joined
Feb 27, 2009
Messages
460
Reaction score
59
Location
Brasil
Well guys. i need to do somwthing like this..

PHP:
if($group_id = 6)
     $main_content .= '<tr class="ADMIN_CLASS"></tr>';
                          else
     $main_content .= '<tr class="PLAYER_CLASS></tr>';

Its just an example of the what i want to do, but i dont know how i do that..

I hope someone can help me ;D
 
You could do something like this. :p

PHP:
        $player = $ots->createObject('Player');
        $group = $player->getGroup();
        $class = '';
        if($group < 4)
            $class = 'PLAYER_CLASS';
        else if($group == 6)
            $class = 'ADMIN_CLASS';
        $main_content .= '<tr class="'.$class.'"></tr>';
 
it Doesnt work

Code:
Fatal error: Uncaught exception 'E_OTS_NotLoaded' in D:\xampp\htdocs\pot\OTS_Player.php:355 Stack trace: #0 D:\xampp\htdocs\forum.php(322): OTS_Player->getGroup() #1 D:\xampp\htdocs\index.php(230): include('D:\xampp\htdocs...') #2 {main} thrown in D:\xampp\htdocs\pot\OTS_Player.php on line 355

:X
 
It would be easier to help you if you could show a part of the forum.php you're using.
 
It would be easier to help you if you could show a part of the forum.php you're using.

but its here..
PHP:
        //OPEN|CLOSE FUNCTION
        if(isThreadOpen($thread_id)) {
        $main_content .= '
			<br />
				<br />
					<a href="?subtopic=forum&action=new_post&thread_id='.$thread_id.'">
						<img src="images/post.gif" border="0" /></a>
							<br />
								<br />Página: '.$links_to_pages.'<br />
									<table width="100%">
										<tr bgcolor="'.$config['site']['lightborder'].'" width="100%">
											<td colspan="2"><font size="4"><b>'.htmlspecialchars($thread_name['post_topic']).'</b></font><font size="1">
												<br />por <a href="?subtopic=characters&name='.urlencode($thread_name['name']).'">'.$thread_name['name'].'</a></font></td>
											</tr>
												<tr bgcolor="'.$config['site']['vdarkborder'].'">
													<td width="200"><font color="white" size="1"><b>Autor</b></font></td>
													<td>&nbsp;</td>
												</tr>';
												}
        else
        $main_content .= '
			<br />
				<br />
					<strong>Thread Closed!</strong>
						<br />
							<br />Página: '.$links_to_pages.'<br />
							<table width="100%">
								<tr bgcolor="'.$config['site']['lightborder'].'" width="100%">
									<td colspan="2"><font size="4"><b>'.htmlspecialchars($thread_name['post_topic']).'</b></font><font size="1"><br />by <a href="?subtopic=characters&name='.urlencode($thread_name['name']).'">'.$thread_name['name'].'</a></font></td>
								</tr>
									<tr bgcolor="'.$config['site']['vdarkborder'].'">
										<td width="200"><font color="white" size="1"><b>Author</b></font></td><td>&nbsp;</td>
									</tr>';
        
        foreach($threads as $thread)
        {
            if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
            $main_content .= '
				<tr bgcolor="'.$bgcolor.'">
					<td valign="top"><a href="?subtopic=characters&name='.urlencode($thread['name']).'">'.$thread['name'].'</a><br /><br /><font size="1">Vocação: '.$vocation_name[$thread['world_id']][$thread['promotion']][$thread['vocation']].'<br />Level: '.$thread['level'].'<br />';
            $rank = new OTS_GuildRank();
            $rank->load($thread['rank_id']);
            if($rank->isLoaded())
            {
                $guild = $rank->getGuild();
                if($guild->isLoaded())
                    $main_content .= $rank->getName().' of <a href="?subtopic=guilds&action=show&guild='.$guild->getId().'">'.$guild->getName().'</a><br />';
            }
            $posts = $SQL->query("SELECT COUNT(`id`) AS 'posts' FROM `z_forum` WHERE `author_aid`=".(int) $thread['account_id'])->fetch();
            $main_content .= '<br />Postagens: '.(int) $posts['posts'].'<br /></font></td><td valign="top">'.showPost($thread['?'], $thread['post_text'], $thread['post_smile']).'</td></tr>
            <tr bgcolor="'.$bgcolor.'"><td><font size="1">'.date('d.m.y H:i:s', $thread['post_date']);
            if($thread['edit_date'] > 0)
            {
                if($thread['last_edit_aid'] != $thread['author_aid'])
                    $main_content .= '<br />Editado pelo moderador';
                else
                    $main_content .= '<br />Editado por '.$thread['name'];
                $main_content .= '<br />em '.date('d.m.y H:i:s', $thread['edit_date']);
            }
            $main_content .= '</font></td><td>';
            if($logged && $group_id_of_acc_logged >= $group_not_blocked)
                if($thread['first_post'] != $thread['id'])
                    $main_content .= '<a href="?subtopic=forum&action=remove_post&id='.$thread['id'].'" onclick="return confirm(\'Are you sure you want remove post of '.$thread['name'].'?\')"><font color="red">REMOVE POST</font></a>';
                else
                    $main_content .= '<a href="?subtopic=forum&action=remove_post&id='.$thread['id'].'" onclick="return confirm(\'Are you sure you want remove thread > '.$thread['post_topic'].' <?\')"><font color="red">REMOVE THREAD</font></a>';
            if($logged && ($thread['account_id'] == $account_logged->getId() || $group_id_of_acc_logged >= $group_not_blocked))

            //OPEN|CLOSE FUNCTION
            if(isThreadOpen($thread_id)) {
                $main_content .= '<br/><a href="?subtopic=forum&action=edit_post&id='.$thread['id'].'">EDIT POST</a>';}
            else
                $main_content .= '';    
            if($logged)
                if(isThreadOpen($thread_id)) {
                    $main_content .= '<br/><a href="?subtopic=forum&action=new_post&thread_id='.$thread_id.'&quote='.$thread['id'].'">Quote</a>';}
            else
                $main_content .= '';
                    $main_content .= '</td></tr>';
        }
What i need is given to admin post other layout..

PHP:
if($group_id = 6)
$main_content .= 'layout admin'; 
                          else 
     $main_content .= 'NORMAL LAYOU FOR ALL PLAYERS';

will be somethin like this, but idk to do this..
 
This should work, tested something similar. If not, then change $thread['name'] to something else.

Code:
$player = $ots->createObject('Player');
$player->find([COLOR=#ff0000]$thread['name'][/COLOR]);
        $group = $player->getGroup();
        $class = '';
        if($group < 4)
            $class = '[COLOR=#ff0000]PLAYER_CLASS[/COLOR]';
        else if($group == 6)
            $class = '[COLOR=#ff0000]ADMIN_CLASS[/COLOR]';
        $main_content .= '<tr class="[COLOR=#ff0000]'.$class.'[/COLOR]"></tr>';
 
This should work, tested something similar. If not, then change $thread['name'] to something else.

Code:
$player = $ots->createObject('Player');
$player->find([COLOR=#ff0000]$thread['name'][/COLOR]);
        $group = $player->getGroup();
        $class = '';
        if($group < 4)
            $class = '[COLOR=#ff0000]PLAYER_CLASS[/COLOR]';
        else if($group == 6)
            $class = '[COLOR=#ff0000]ADMIN_CLASS[/COLOR]';
        $main_content .= '<tr class="[COLOR=#ff0000]'.$class.'[/COLOR]"></tr>';

the same error...

Code:
Fatal error: Uncaught exception 'E_OTS_NotLoaded' in D:\xampp\htdocs\pot\OTS_Player.php:355 Stack trace: #0 D:\xampp\htdocs\forum.php(323): OTS_Player->getGroup() #1 D:\xampp\htdocs\index.php(230): include('D:\xampp\htdocs...') #2 {main} thrown in D:\xampp\htdocs\pot\OTS_Player.php on line 355

- - - Updated - - -

I think that error comes of
Code:
$player = $ots->createObject('Player');
;x
 
Back
Top