mark0 Posted September 26, 2013 Report Posted September 26, 2013 Acesta este codul(tot) din fisierul PHP <?phpif (isset($_POST['highscore'])) { $level = $_POST['highscore']; $user = mysql_query("select * from users order by level desc limit $level");} else { $user = mysql_query("select * from users order by level desc limit 50");}if (mysql_num_rows($user) == 0) { echo '<div class="title_box"><div class="title_inner">No players. </div></div>';} else { echo '<div id="highscore_range"><form action="highscore.php" method="POST" accept-charset="utf-8"> <select class="input" name="highscore" size="1" onchange="submit()" ><option value="50" selected="selected">1-50 <option value="1000">All </select></form></div><div class="title_box" style="margin:0px;"><div class="title_inner" style="padding: 0px;"><div id="highscore_table"><table cellpadding="0" cellspacing="0"><tr><th>Position</th><th>Name</th><th>Alliance</th><th>Level</th><th>Honour</th><th>Fame</th><th>Wins</th><th>Losses</th><th>Gold</th></tr>'; $i = 0; while ($g = mysql_fetch_array($user)) { $numero5 = $g['gold']; $colour = '#8fff'; if ($g['username'] == $user['username']) { $colour = 'blue'; } if ($user['guild'] == 1) { if ($g['guild'] == 1) { if ($g['guild_name'] == $name['guild_name'] && $g['username'] != $name['username']) { $colour = 'green'; } elseif ($g['guild_name'] != $name['guild_name'] && $g['username'] != $name['username']) { $colour = '#8fff'; } } } echo "<tr class='alt'><th>" . ++$i . "</th><td><div><a href='playerprofile.php?id=" . $g['username'] . "' style='color:" . $colour . ";'>" . $g['username'] . "</a>"; if ($g['rank'] == 2) { echo " <img src='img/vips.png' onMouseOver=\"return escape('<table cellspacing=2 cellpadding=2 valign=middle class=\'tooltipBox\'><tr><td style=\'color:white; font-weight: bold; font-size:9pt\' colspan=\'2\' nowrap=\'nowrap\'>VIP</td></tr></table>')\"> </div></td>"; } elseif ($g['rank'] > 2) { echo " <img src='img/admin.png' onMouseOver=\"return escape('<table cellspacing=2 cellpadding=2 valign=middle class=\'tooltipBox\'><tr><td style=\'color:white; font-weight: bold; font-size:9pt\' colspan=\'2\' nowrap=\'nowrap\'>Admin</td></tr></table>')\"> </div></td>"; } echo "<td><a href='guildprofile.php?id=" . $g['guild_name'] . "' style='color:#8fff;'>" . $g['guild_name'] . "</a></td><td>" . number_format($g['level'], 0, ".", ".") . "</td><td>" . number_format($g['honour'], 0, ".", ".") . "</td><td>" . number_format($g['fame'], 0, ".", ".") . "</td><td>" . number_format($g['wins'], 0, ".", ".") . "</td><td>" . number_format($g['loses'], 0, ".", ".") . "</td><td>" . number_format($numero5, 0, ".", ".") . "</td> </tr>"; } echo "</table> </div></div></div>";}?> Linia pe care vreau s-o modific:<td><div><a href='playerprofile.php?id=".$g['username']."' style='color:".$colour.";'>".$g['username']."</a>" ;M-am gandit la ceva de genul: onMouseOver="return escape('<table cellspacing=2 cellpadding=2 valign=middle class=\'tooltipBox\'><tr><td style=\'color:white; font-weight: bold; font-size:9pt\' colspan=\'2\' nowrap=\'nowrap\'>". $g['title'] ."</td></tr></table>')\"> </div></td>"; doar ca n-am idee cum sa o pun peste <td><div><a href='playerprofile.php?id=" . $g['username'] . "' style='color:" . $colour . ";'>" . $g['username'] . "</a>"; Am mai postat la ajutor aprox acum o saptamana ,n-am primit nici un raspuns care sa ma ajute asa ca am decis sa postez la webdeveloping ,poate am noroc.Scopul meu e sa fac un sistem de achievements(titluri) care sa apara cand cursorul trece peste numele unuia care este afisat in highscore. Quote
GarryOne Posted September 26, 2013 Report Posted September 26, 2013 (edited) Am mai postat la ajutor aprox acum o saptamana ,n-am primit nici un raspuns care sa ma ajute asa ca am decis sa postez la webdeveloping ,poate am noroc.N-are nicio relevanta in ce categorie postezi pentru ca, majoritatea, Vizualizaeaza topic-urile de la "New Posts", iar eu nici o data nu atrag atentie in ce categorie a fost postat topicul.Problema ta poate fi rezolvata foarte usor cu ceva de genulPoti si cu javascript: document.getElementById(\'to_display_'.$row['id'].'\').style.display = \'block\'Dar mai elegant incluzi jquery si faci asa.while($row = mysql_fetch_assoc($query)) { echo '<a href="#" onmouseover="$(\'#to_display_'.$row['id'].'\').show();">'.$row['username'].'</a>'; echo '<div id="to_display_'.$row['id'].'" style="display: none;">Informatia de care ai nevoie sa apara la onmouseover</div>';} Edited September 26, 2013 by GarryOne Quote
mark0 Posted September 26, 2013 Author Report Posted September 26, 2013 multumesc mult de raspuns...revin cu un rezultat maine. Quote
mark0 Posted September 29, 2013 Author Report Posted September 29, 2013 (edited) N-am reusit sa adaptez liniile lui garry ,putin ajutor va rog?///LE: Le-am incurcat numele...scuze. Edited September 29, 2013 by mark0 Quote
alezu2000 Posted September 29, 2013 Report Posted September 29, 2013 incerca cu metoda lui garry Quote
mark0 Posted November 5, 2013 Author Report Posted November 5, 2013 Inca nimic...cineva cu vreo sugestie? Quote
EAdrian Posted November 5, 2013 Report Posted November 5, 2013 Inca nimic...cineva cu vreo sugestie?Dac? nu e?ti capabil s? adaptezi ce a spus Garry, pl?te?te pe cineva.. Quote
SticKyWoX Posted November 5, 2013 Report Posted November 5, 2013 Ideea lui Garry e simpla.Scoti deja valoarea din row, dar ii dai sa nu fie vizibila (display: none). Apoi faci o functie javascript gen:document.getElementById("id").onmouseover = document.getElementById("id").style.display = "block";document.getElementById("id").onmouseout = document.getElementById("id").style.display = "none";unde id reprezinta id-ul div-ului sau al span-ului unde ai valoarea.Daca nu te descurci, te pot ajuta contra-cost. Quote