Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]Podświetlenie pobranych pozycji
trebron
post 1.12.2021, 16:11:57
Post #1





Grupa: Zarejestrowani
Postów: 32
Pomógł: 0
Dołączył: 8.11.2020

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


Witam.
Bardzo proszę o pomoc w ułożeniu skryptu do podświetlania pozycji, które użytkownik pobrał z ogólnej listy torrentów. Czyli jeśli użytkownik pobierze pozycję pod nazwą np."xyu" to ta pozycja będzie podświetlona jakims kolorem.
Poniżej znajduje się kod który podświetla kolorem odpowiednie kategorie:

Kod
if($row['category'] == 35 || $row['category'] == 38) {
        print("<td class='tableBody1' style='text-align:left; background:#757575;'><div class='span_icon'>");
        }elseif($row['category'] == 23) {
        print("<td class='tableBody1' style='text-align:left; background:#969696;'><div class='span_icon'>");      
        }else{
        print("<td class='tableBody1' style='text-align:left;'><div class='span_icon'>");
        }


Natomiast poniższy kod jest do listy pozycji pobranych przez użytkownika czyli $numbcompleted i pytanie: jak dopisać w powyższym kodzie aby pozycje ktore pobrał uzytkownik były podświetlone jakims kolorem?

Kod
$r = $dbc_h->query("SELECT torrents.name as name, snatched.torrentid as id, torrents.category as category, snatched.uploaded, snatched.downloaded, snatched.complete_date, snatched.last_action, torrents.seeders, torrents.leechers FROM snatched JOIN torrents ON torrents.id = snatched.torrentid AND userid=$id WHERE snatched.finished='yes'") or sqlerr();
if (mysqli_num_rows($res) > 0)
  $completed = maketable($res);
  $numbcompleted = mysqli_num_rows($r);

if (get_user_class() >= UC_MODERATOR  || $user["class"] <= get_user_class()) {
print("<td><form action='torrentdetails2.php?id=$id&completed=1' method='post'><input type='submit' value='Pobrane (pełne) [ $numbcompleted ]' class='klawisz_glosowanie'></form></td>
</td></tr></table></td></tr>\n");
}
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: 28.03.2024 - 15:20