Skocz do zawartości
"Idzie nowe..." - o zmianach i nie tylko ×
Przeniesienie zakupów z IPS Marketplace / Moving bought items from IPS Marketplace ×

wilkolak11

Użytkownik
  • Postów

    113
  • Dołączył

  • Ostatnia wizyta

Odpowiedzi opublikowane przez wilkolak11

  1. Tutaj masz jedną cześć z bitu. Wiem, że nazywa się to "onlinePlayers" to tworzę taki bit o tej nazwie i podaje zmienne. >> Wklejam tam kod (zaznaczony na niebiesko) i patrzę czy template się wyświetla. >> Wywala mi błąd

    "
    Catchable fatal error: Object of class ipsRegistry could not be converted to string in /var/www/kopia/cache/skin_cache/cacheid_4/skin_hrp.php on line 137
    "

    To wtedy podmieniam całością kodu w cache/skin_cache/cacheid_4/skin_nazwa.php >> Wszystko się włącza ale są krzaki.

    Ja to tak wymodziłem lecz są krzaki.

    /* -- onlinePlayers --*/

    function onlinePlayers($onlineList,$onlineCount) {

    $IPBHTML = "";

    if( IPSLib::locationHasHooks( 'skin_hrp', $this->_funcHooks['onlinePlayers'], array( 'templateHooks', 'skinHooks' ) ) )

    {

    $count_748e2659c180232f8a081570037f85d6 = is_array($this->functionData['onlinePlayers']) ? count($this->functionData['onlinePlayers']) : 0;

    $this->functionData['onlinePlayers'][$count_748e2659c180232f8a081570037f85d6]['onlineList'] = func_get_arg( 0 );

    }

    $IPBHTML .= "<div class='clear block_wrap block_fixed'>

    <ul class='tab_bar no_title'>

    <li class=\"active\"><a href=\"" . $this->registry->getClass('output')->formatUrl( $this->registry->getClass('output')->buildUrl( "module=online", "publicWithApp",'' ), "", "" ) . "\">Gracze online</a></li>

    <li><a href=\"" . $this->registry->getClass('output')->formatUrl( $this->registry->getClass('output')->buildUrl( "module=services&section=list", "publicWithApp",'' ), "false", "hrp_services" ) . "\">Usługi płatne</a></li>

    <li><a href=\"" . $this->registry->getClass('output')->formatUrl( $this->registry->getClass('output')->buildUrl( "module=leader", "publicWithApp",'' ), "", "" ) . "\">Panele grupowe</a></li>

    </ul><br />

    <div class='general_box statistics clearfix'>

    <div class='stats_list hrp_online_list' id='active_users'>

    <h2>

    {$onlineCount} graczy online

    <br />

    <span class='desc'>W tym 0 ukrytych.</span>

    </h2>

    " . ((count($onlineList)) ? ("

    <p>

    ".$this->__f__484790c46a8f32a49fba21d9ab177297($onlineList,$onlineCount)." </p>

    ") : ("

    <br /><p class='message'>Obecnie nie ma graczy online na serwerze.</p><br />

    ")) . "

    </div>

    </div>

    </div>";

    return $IPBHTML;

    }

    function __f__484790c46a8f32a49fba21d9ab177297($onlineList,$onlineCount)

    {

    $_ips___x_retval = '';

    foreach( $onlineList as $player )

    {

    $_ips___x_retval .= "<span class='name" . (($player['_premium']) ? (" hPremium") : ("")) . "' title='{$player['members_display_name']}, zalogowany {$player['_time']}.'>{$player['nick']}" . $this->registry->getClass('output')->getTemplate('global')->user_popup($player['member_id'], $player['members_seo_name']) . "</span>,

    ";

    }

    $_ips___x_retval .= '';

    return $_ips___x_retval;

    }

  2. "Mo�liwo�� zakupu i prowadzenia zupe�nie nowych" - takie krzaki.

    A jak wprowadzę całość to wywala błąd:

    Catchable fatal error: Object of class ipsRegistry could not be converted to string in /var/www/kopia/cache/skin_cache/cacheid_4/skin_hrp.php on line 139

  3. Cześć! Czy jest możliwe dodanie zakładki u góry forum i uzupełnianie jej HTML ?

    Chodzi mi o te zakładki tak jak na tym forum (przykład) >> "Forum | Użytkownicy | Pliki | Galeria | Blogi | Czat | Shoutbox | Katalog | Mapa | Upload"

    I chodzi mi o dodane takiego czegoś i żebym mógł ją uzupełniać kodem HTML/CSS.

  4. Cześć, nie wiem czy pisze w dobrym dziale, jeżeli nie to proszę o przeniesienie.

    Chciałbym dodać wyświetlanie tzw. punktów przy wyświetlanym użytkowniku online. Dodałem w bazie kolumnę w "ipb_members" o nazwie "pkt" i tam zapisują mi się te punkty. W jaki sposób wyświetlić te punkty?

    Tu daje przykład jak to wygląda, tam gdzie te zera to chcę je wyświetlić.

    90252540661822791344.jpg

  5. Funkcja od zapisywania danych wygląda tak:

    public function saveGroupData()
    {
    	if(!$this->allowModifications)
    	{
    		$this->registry->output->showError('Nie masz uprawnień do wprowadzania modyfikacji.','10H6');
    	}
    
    	switch($this->dataType)
    	{
    		case 1:
    			$updateMember = array();
    			foreach($this->request['perm'] as $member=>$locglob)
    			{
    				if(is_array($locglob['local']) and is_array($locglob['global']))
    				{
    					$updateMember[$member] = $this->packMemberPermissions($locglob['global'], $locglob['local']);
    				}
    				else if(is_array($locglob['global']))
    				{
    					$updateMember[$member] = $this->packMemberPermissions($locglob['global']);
    				}
    			}
    
    
    			if(!count($updateMember)) return;
    			foreach($updateMember as $mid=>$member)
    			{
    				$this->DB->query(sprintf('UPDATE grp_members SET gperm=%d,lperm=%d WHERE player_uid=%d AND what=%d AND whatid=%d',
    					intval($member['gperm']),intval($member['lperm']),intval($mid),$this->groupType,$this->groupID
    				));
    				$this->DB->execute();
    			}
    		break;
    
    		default:
    
    			if(!isset($this->request['member']) || !count($this->request['member'])) return;
    
    			$sumMoney = 0;
    
    			foreach($this->request['member'] as $member=>$newData)
    			{
    				if($newData['cash']>300)
    				{
    					$this->request['member'][ $member ]['cash'] = 300;
    				}
    				$sumMoney += $newData['cash'];
    			}
    
    			if($sumMoney>$this->payoutLimit)
    			{
    				$this->registry->output->showError('Nie można przypisać pracownikom więcej niż wyznaczony na ten tydzień limit.<br />
    				Limit wynosi $'.$this->payoutLimit.', a ustawione przez Ciebie wypłaty wynoszą łącznie $'.$sumMoney.'.',0);
    				return;
    			}
    
    			foreach($this->request['member'] as $member=>$newData)
    			{
    				$this->DB->query(sprintf('UPDATE grp_members SET skin=%d,cash=%d,rank=\'%s\' WHERE player_uid=%d AND what=%d AND whatid=%d',
    					intval($newData['skin']),intval($newData['cash']),$this->DB->addSlashes($newData['rank']),intval($member),$this->groupType,$this->groupID
    				));
    				$this->DB->execute();
    			}
    		break;
    	}
    }
    

  6. Cześć, mam problem z wyświetleniem wyników z pętli foreach. Kumpel zostawił mi tą aplikację, a że jest on przez dłuższy czas nieobecny to muszę się poradzić was.

    Problem jest tego typu, że na stronie wyświatla mi tylko jeden wynik, a w bazie mam dodane więcej rekordów. Nie wiem dokładnie czy jest wina w wyświetlaniu czy w zapytaniu.

    Kod:

    protected function fetchGroupMembers($unpackPermissions = false)
    {
    	$this->DB->query(sprintf('SELECT * FROM grp_members m 
    	LEFT JOIN grp_players p ON (p.player_uid=m.player_uid) 
    	LEFT JOIN %smembers u ON (u.member_id=p.owner)
    	WHERE m.what=%d AND m.whatid=%d ORDER BY p.nick ASC',$this->DB->obj['sql_tbl_prefix'],$this->groupType,$this->groupID));
    	$this->DB->execute();
    
    	$this->members = array();
    
    	$requiredTime = IPS_UNIX_TIME_NOW - 172800;
    
    	if($unpackPermissions)
    	{
    		$this->loadPermissions();
    
    		while($row = $this->DB->fetch())
    		{
    			$row['_seenWarn'] = ($row['seen'] < $requiredTime) ? 1: 0;
    			$row['seen'] = $this->registry->getClass('class_localization')->getDate( $result['seen'], 'TINY' );
    			$row['nick'] = str_replace('_',' ',$row['nick']);
    			$row['_isOnline'] = (GRPLib::getIngameCharacterById($row['member_id'])==$char['player_uid']?1:0);
    
    			$this->members[] = $row;
    			$this->unpackMemberPermissions($row);
    		}
    	}
    	else
    	{
    		while($row = $this->DB->fetch())
    		{
    			$row['_seenWarn'] = ($row['seen'] < $requiredTime) ? 1: 0;
    			$row['seen'] = $this->registry->getClass('class_localization')->getDate( $row['seen'], 'TINY' );
    			$row['nick'] = str_replace('_',' ',$row['nick']);
    			$row['_isOnline'] = (GRPLib::getIngameCharacterById($row['member_id'])==$row['player_uid']?1:0);
    			$this->members[] = $row;
    		}
    	}
    }
    

    Templatka:

    <h3 class=\"maintitle\">Pracownicy</h3>
    					<table class=\"ipb_table\" summary=\"Pracownicy\">
    						<tr class=\"header\">
    							<th scope=\"col\" style=\"width: 150px\">Postać</th>
    							<th scope=\"col\">UĹĽytkownik</th>
    							<th scope=\"col\">Ostatnio w grze</th>
    							<th scope=\"col\" class=\"short\">Posada</th>
    							" . (($group->allowModifications) ? ("
    								<th scope=\"col\" class=\"short\">Ubranie robocze</th>
    								<th scope=\"col\" class=\"short\">Wypłata</th>
    							") : ("")) . "
    						</tr>
    													" . (($group->allowModifications) ? ("".$this->__f__e45756aaa7944feb9316b36d35a9cb10($group)."							") : ("".$this->__f__a62b8f55d011e63b1643496cdfa50620($group)."							")) . "
    					</table>
    
    
    
    
    function __f__e45756aaa7944feb9316b36d35a9cb10($group)
    {
    $_ips___x_retval = '';
    foreach( $group->members as $member )
    {
    
    	$_ips___x_retval .= "
    								<tr class=\"" .  IPSLib::next( $this->registry->templateStriping["members"] ) . "\" id=\"member{$member['player_uid']}\" class=\"memberListItem\">
    									<td>
    									{$member['nick']}
    									<ul class=\"right memberManagement\">
    										<li><a href=\"" . $this->registry->getClass('output')->formatUrl( $this->registry->getClass('output')->buildUrl( "module=ajax&section=leaderpanel&groupType={$group->groupTypeShortString}&character={$group->character}&do=removeMember&rmCharID={$member['player_uid']}", "publicWithApp",'' ), "", "" ) . "\" class=\"rmMember\" id=\"delmember{$member['player_uid']}\"><img src=\"{$this->settings['img_url']}/delete.png\" alt=\"Zwolnij pracownika\" /></a></li>
    									</ul>
    									</td>
    									<td>" . IPSLib::makeNameFormatted( $member['members_display_name'],$member['member_group_id'] ) . "" . $this->registry->getClass('output')->getTemplate('global')->user_popup($member['member_id'], $member['members_seo_name']) . "</td>
    									<td>{$member['seen']}</td>
    									<td class=\"short\"><input type=\"text\" class=\"input_text\" value=\"{$member['rank']}\" name=\"member[{$member['player_uid']}][rank]\" maxlength=\"15\" style=\"width:100px\" /></td>
    									<td class=\"short\"><input type=\"text\" class=\"input_text\" value=\"{$member['skin']}\" name=\"member[{$member['player_uid']}][skin]\" maxlength=\"3\" style=\"width:30px\" /></td>
    									<td class=\"short\">$<input type=\"text\" class=\"input_text\" value=\"{$member['cash']}\" name=\"member[{$member['player_uid']}][cash]\" maxlength=\"4\" style=\"width:40px\" /></td>
    								</tr>
    
    ";
    }
    $_ips___x_retval .= '';
    return $_ips___x_retval;
    }
    
    
    function __f__a62b8f55d011e63b1643496cdfa50620($group)
    {
    $_ips___x_retval = '';
    foreach( $group->members as $member )
    {
    
    	$_ips___x_retval .= "
    								<tr class=\"" .  IPSLib::next( $this->registry->templateStriping["members"] ) . "\" id=\"member{$member['player_uid']}\">
    									<td>{$member['nick']}</td>
    									<td>" . IPSLib::makeNameFormatted( $member['members_display_name'],$member['member_group_id'] ) . "" . $this->registry->getClass('output')->getTemplate('global')->user_popup($member['member_id'], $member['members_seo_name']) . "</td>
    									<td>{$member['seen']}</td>
    									<td class=\"short\">{$member['rank']}</td>
    								</tr>
    
    ";
    }
    $_ips___x_retval .= '';
    return $_ips___x_retval;
    }
    
    
    
    
    
    

  7. Jasiu z ojcem pojechał na basen. W pewnym momencie Jasiu się poślizgnął i upada na ziemie, ale w ostatnim momencie złapał ojca z członka.

    Ojciec patrzy w dół i mówi:

    - Widzisz synu! Jakbyś poszedł z matką to byś się wy.j.e.b.ał.

×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.