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

Krzysiu99995

Użytkownik
  • Postów

    118
  • Dołączył

  • Ostatnia wizyta

Odpowiedzi opublikowane przez Krzysiu99995

  1.  <?php
    class profile_char extends profile_plugin_parent
    {
    public function return_html_block( $member=array() )
     {
    
    
    $this->DB->build( array( 'select' => '*',
                           'from'       => '1chars',
                           'where'      => 'guid = "' . $this->request['id']. '"'));
    $this->DB->execute();
    while($zap = $db->fetch() )
    {
    
    
     $res = $this->DB->execute();
    
    
              if( ! $this->DB->getTotalRows( $res ) ) {
    
                             $content = '<h3 class="bar">Postacie gracza</h3><div class="friend_list clear" style="margin:0;padding:0">
         <p> 
         <em>'.$member['members_display_name'].' nie posiada postaci.</em> 
        </p> ';  
    }
    
    else
    
    {
    $zap['nick'] = str_replace("_"," ", $zap['nick']);
    
    $content = '<div id="tab_content" class="row1">
    
    
                                           <h3 class="bar">Postacie gracza</h3><div class="friend_list clear" style="margin:0;padding:0"><ul class="clearfix"><li style="height:170px;">
    
                                   <img src="http://h-rp.co/public/hrp/skins/Skin_'.$zap['skin'].'.gif"><br />
    
                    <span class="name">'.$zap['nick'].'</span><br /> 
                                   <span class="desc"><b>'.$zap['hours'].'h, '.$zap['minutes'].'m </b><br /> '.$zap['lastlogged'].'<br />
    
                           </div></div>';  
    
    } }
    
    return $content;
           }
    }
    ?>

    Zrobiłem pętle jak w tamtym pliku, lecz nadal nic. Bardzo proszę o pomoc. :Tip-Hat:

  2. Cześć, mam DB excute w zmiennej. Oto mój skrypt. :)

    ?php
    class profile_char extends profile_plugin_parent
    
    {
    public function return_html_block( $member=array() )
     {
    
    $results = array();
    $this->DB->build( array( 'select' => '*',
                           'from'       => '1chars',
                           'where'      => 'guid = "' . $this->request['id']. '"'));
    
    while ( $row = $this->DB->fetch() )
    {
           $zap[] = $row;
    }
    
     $res = $this->DB->execute();
    
     $content = '';
    
    
              if( ! $this->DB->getTotalRows( $res ) ) {
    
                             $content = '<h3 class="bar">Postacie gracza</h3><div class="friend_list clear" style="margin:0;padding:0">
         <p> 
         <em>'.$member['members_display_name'].' nie posiada postaci.</em> 
        </p> ';  
    }
    else
    {
    $zap = $this->DB->fetch();
    
    $zap['nick'] = str_replace("_"," ", $zap['nick']);
    
    $content = '<div id="tab_content" class="row1">
    
    
                                           <h3 class="bar">Postacie gracza</h3><div class="friend_list clear" style="margin:0;padding:0"><ul class="clearfix"><li style="height:170px;">
    
                                   <img src="http://h-rp.co/public/hrp/skins/Skin_'.$zap['skin'].'.gif"><br />
    
                    <span class="name">'.$zap['nick'].'</span><br /> 
                                   <span class="desc"><b>'.$zap['hours'].'h, '.$zap['minutes'].'m </b><br /> '.$zap['lastlogged'].'<br />
    
                           </div></div>';  
    }
    
    return $content;
           }
    }
    ?>

    Warunek na pewno spełnia więcej wierszy. ;)

    Z góry dzięki. :thumbsup:

  3. Okej, większość błędów zniwelowałem, został tylko jeden, otóż:

    Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, array given in /homepages/16/d349979453/htdocs/ips_kernel/classDbMysqliClient.php on line 407

    Czy ktoś wie co może on oznaczać? :>

    Z góry wielkie dzięki. ;)

  4. Teraz w stronie której ma pobrać mi dane, wywala to if które ma wywalić gdy zapytanie jest puste + te błędy:

    Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, array given in /homepages/16/d349979453/htdocs/ips_kernel/classDbMysqliClient.php on line 407
    
    Warning: Cannot modify header information - headers already sent by (output started at /homepages/16/d349979453/htdocs/ips_kernel/classDbMysqliClient.php:407) in /homepages/16/d349979453/htdocs/admin/sources/classes/output/formats/html/htmlOutput.php on line 109
    
    Warning: Cannot modify header information - headers already sent by (output started at /homepages/16/d349979453/htdocs/ips_kernel/classDbMysqliClient.php:407) in /homepages/16/d349979453/htdocs/admin/sources/classes/output/formats/html/htmlOutput.php on line 120
    
    Warning: Cannot modify header information - headers already sent by (output started at /homepages/16/d349979453/htdocs/ips_kernel/classDbMysqliClient.php:407) in /homepages/16/d349979453/htdocs/admin/sources/classes/output/formats/html/htmlOutput.php on line 129
    
    Warning: Cannot modify header information - headers already sent by (output started at /homepages/16/d349979453/htdocs/ips_kernel/classDbMysqliClient.php:407) in /homepages/16/d349979453/htdocs/admin/sources/classes/output/formats/html/htmlOutput.php on line 130
    
    Warning: Cannot modify header information - headers already sent by (output started at /homepages/16/d349979453/htdocs/ips_kernel/classDbMysqliClient.php:407) in /homepages/16/d349979453/htdocs/admin/sources/classes/output/formats/html/htmlOutput.php on line 134

  5. <?php
    
    class profile_char extends profile_plugin_parent
    {
           /**
           * Feturn HTML block
           *
           * @access       public
           * @param        array           Member information
           * @return       string          HTML block
           */
    
           public function return_html_block( $member=array() )
           {
                           $content = '';
    
    
                            $zap = $this->DB->buildAndFetch(array('select' => '*',
                           'from'       => '1chars',
                           'where'      => 'player_uid = "' . $this->request['id']. '"'));
    
    
    
    				 $content = '<div id="tab_content" class="row1">
    
    
    				<h3 class="bar">Postacie gracza</h3><div class="friend_list clear" style="margin:0;padding:0"><ul class="clearfix"><li style="height:170px;">
    
    			<img src="/public/skins/skin_'.$zap['skin'].'.gif"><br />
    
                    <span class="name">'.$zap['nick'].'</span><br />
    			<span class="desc"><b>'.$zap['hours'].'h, '.$zap['minutes'].'m </b><br /> '.$zap['lastlogged'].'<br />
    
    		</div></div>';
    
    
    	if( ! $this->DB->getTotalRows( $zap ) )
    {
    				 $content = 'Użytkownik nie posiada postaci.'
    }
    
    
    
                            return $content;
           }
    }
    ?>

    Coś mi nie tryka.

  6. A mógłbym stworzyć jedno zapytanie typu:

    &zap = $this->DB->buildAndFetch(array('from'       => '1chars',
    'where'      => 'player_uid = "' . $this->request['id']. '"'));

    i potem typko '.$zap['nick'].', itd?

  7. <?php
    
    class profile_char extends profile_plugin_parent
    {
           /**
           * Feturn HTML block
           *
           * @access       public
           * @param        array           Member information
           * @return       string          HTML block
           */
    
           public function return_html_block( $member=array() )
           {
                           $content = '';
    
    
                            $skin = $this->DB->buildAndFetch(array('select' => 'skin',
                           'from'       => '1chars',
                           'where'      => 'player_uid = "' . $this->request['id']. '"'));
    
    					$nick = $this->DB->buildAndFetch(array('select' => 'nick',
                           'from'       => '1chars',
                           'where'      => 'player_uid = "' . $this->request['id']. '"'));
    
    					$hours = $this->DB->buildAndFetch(array('select' => 'hours',
                           'from'       => '1chars',
                           'where'      => 'player_uid = "' . $this->request['id']. '"'));
    
    					$minutes = $this->DB->buildAndFetch(array('select' => 'minutes',
                           'from'       => '1chars',
                           'where'      => 'player_uid = "' . $this->request['id']. '"'));
    
    					$lastlogged = $this->DB->buildAndFetch(array('select' => 'lastlogged',
                           'from'       => '1chars',
                           'where'      => 'player_uid = "' . $this->request['id']. '"'));
    
    
                           $content = '<div id="tab_content" class="row1">
    
    
    				<h3 class="bar">Postacie gracza</h3><div class="friend_list clear"><ul class="clearfix"><li style="height:170px;">
    
    			<img src="/public/skins/skin_'.$skin.'.gif" alt="" style="" /><br />
    
    			<span class="name">'.$nick.'</span><br />
    
    			<span class="desc"><b>'.hours.'h '.$minutes.'m <br /> '.$lastlogged.'</b>h<br />
    		</div></div>';
    
                            return $content;
           }
    }
    ?>

  8. Witam, byłby ktoś na tyle miły aby przerobić mi zapytanie na takie ipb'owskie ? :> Próbuje, próbuje i mi nie wychodzi... :smile_cold:

    Ogólnie to normalnie chciałbym takie zapytanie:

    if(mysql_num_rows($wynik) > 0) {

    /* jeżeli wynik jest pozytywny, to wyświetlamy dane */

    while($r = mysql_fetch_array($wynik)) {

    .$r[cośtam].

    }}

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