Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHPBB3] Pobranie avatara z bazy i wyświetlenie w Custom Page..
pa-jong
post 11.09.2011, 22:40:48
Post #1





Grupa: Zarejestrowani
Postów: 64
Pomógł: 1
Dołączył: 21.02.2008
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


Żarło żarło i zdechło..
Zgłupiałem :/

Tak pobieram ->

  1. $sql = 'SELECT count(chat.message) AS ile, users.username as nick, users.user_colour as colour, users.user_id as id, users.user_avatar as avatar
  2. FROM phpbb_users as users,phpbb_mchat as chat
  3. WHERE users.user_id = chat.user_id
  4. GROUP BY chat.user_id
  5. ORDER BY ile DESC';
  6.  
  7. $result = $db->sql_query($sql);
  8.  
  9. $nr = 0;
  10. while( $row = $db->sql_fetchrow($result) )
  11. {
  12. $nr = $nr+1;
  13. $template->assign_block_vars('pokerow', array(
  14. 'NR' => $nr,
  15. 'ID' => $row['id'],
  16. 'ILE' => $row['ile'],
  17. 'NICK' => $row['nick'],
  18. 'COLOUR' => $row['colour'],
  19. 'AVATAR' => $row['avatar'],
  20. ));
  21. }



A tak wyświetlam.

  1. <!-- BEGIN pokerow -->
  2.  
  3. <tr class="<!-- IF pokerow.S_ROW_COUNT is even -->row1<!-- ELSE -->row2<!-- ENDIF -->">
  4. <td class="cell2">{pokerow.NR}</td>
  5. <td class="cell"><img src="{ROOT_PATH}download/file.php?avatar={pokerow.AVATAR}"></td>
  6. <td class="cell"><b ><a href="{ROOT_PATH}memberlist.php?mode=viewprofile&u={pokerow.ID}" style="color: #{pokerow.COLOUR}">{pokerow.NICK}</a></b></td>
  7. <td class="cell">{pokerow.ILE}</td>
  8. </tr>
  9.  
  10. <!-- END pokerow -->


Wszystko poza avatarem działa.
Źrodło zwraca puste pole w miejscu gdzie daje {pokerow.AVATAR}



  1. <tr class="row1">
  2. <td class="cell2">3</td>
  3. <td class="cell"><img src="./download/file.php?avatar="></td>
  4. <td class="cell"><b><a href="./memberlist.php?mode=viewprofile&u=56" style="color: rgb(238, 134, 50);">NICK</a></b></td>
  5. <td class="cell">2656</td>
  6. </tr>


Niech mnie ktoś sprowadzi na ziemie... :/
Powód edycji: [erix]: przeniosłem
Go to the top of the page
+Quote Post
napus
post 18.09.2011, 18:30:48
Post #2





Grupa: Zarejestrowani
Postów: 20
Pomógł: 0
Dołączył: 16.02.2010

Ostrzeżenie: (0%)
-----


  1. include($phpbb_root_path . '/includes/functions_display.' . $phpEx);
  2.  
  3. $template->assign_vars(array(
  4. 'MY_AVATAR' => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']),
  5. ));
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 26.04.2024 - 08:36