Welcome, Guest. Please Login or Register.
November 02, 2024, 07:31:45 AM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  German User Help  |  Hilfe zu YaBB SE  |  Statistikmaxima fett darstellen « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Statistikmaxima fett darstellen  (Read 617 times)
NATOR
Jr. Member
**
Posts: 91


I'm a llama!

Statistikmaxima fett darstellen
« on: September 23, 2003, 08:22:58 PM »
Reply with quote

ich würde die maxima in der statistik gerne fett dargestellt haben!

hier der codeausschnitt aus der stats.php:

$days_result = mysql_query("SELECT month, year, SUM(hits) as crap, SUM(registers) as sreg, SUM(topics) as stop, SUM(posts) as spos, MAX(mostOn) as mOn FROM {$db_prefix}log_activity GROUP BY year, month ORDER BY year DESC, month DESC LIMIT 25");
while($row_days = mysql_fetch_array($days_result))
{
$tempval=$row_days[month]-1;
$temp_month=$months[$tempval];
$track_hits2 = $modSettings['hitStats'] ? "<td class=\"windowbg2\">$row_days[crap]</td>" : "" ;
 echo "";
}

crap = s*it ... wer hat das gecodet ;)

wie bekomm ich da rein, dass die jeweiligen maxima fett dargestellt werden ...
« Last Edit: September 23, 2003, 08:23:27 PM by NATOR » Logged
chris
Guest
Re:Statistikmaxima fett darstellen
« Reply #1 on: September 23, 2003, 09:11:39 PM »
Reply with quote

2 möglichkeiten:

1) du liest einmal vor der schleife das maximum aus (stichwörter: ORDER BY crap und LIMIT 1) und vergleichst dann den aktuellen wert mit dem den du vorher ermittelt hast (bei gleichheit musst du den text entsprechend formatieren)

2) du änderst die schleisfe so ab, dass sie sich die werte in nem array merkt und suchst dir dabei das maximum raus... dann gibst du den ganzen kram in einer neuen schleife aus
Logged
NATOR
Jr. Member
**
Posts: 91


I'm a llama!

Re:Statistikmaxima fett darstellen
« Reply #2 on: September 24, 2003, 09:55:37 AM »
Reply with quote

Quote from: Christian Land on September 23, 2003, 09:11:39 PM
1) du liest einmal vor der schleife das maximum aus (stichwörter: ORDER BY crap und LIMIT 1) und vergleichst dann den aktuellen wert mit dem den du vorher ermittelt hast (bei gleichheit musst du den text entsprechend formatieren)

das hab ich versucht, aber es hat nich gefunzt. ich sezt mich jetzt aber nochmal dran! sollte ich probleme haben, poste ich meine idee mal hier!


[edit]
$daysmaxi_result = mysql_query("SELECT month, year, SUM(hits) as crap, SUM(registers) as sreg, SUM(topics) as stop, SUM(posts) as spos, MAX(mostOn) as mOn FROM {$db_prefix}log_activity ORDER BY crap DESC LIMIT 1");
while($row_daysmaxi = mysql_fetch_array($daysmaxi_result)){
$days_result = mysql_query("SELECT month, year, SUM(hits) as crap, SUM(registers) as sreg, SUM(topics) as stop, SUM(posts) as spos, MAX(mostOn) as mOn FROM {$db_prefix}log_activity GROUP BY year, month ORDER BY year DESC, month DESC LIMIT 30");
while($row_days = mysql_fetch_array($days_result))
{

if($row_daysmaxi = $row_days)
   {
$tempval=$row_days[month]-1;
$temp_month=$months[$tempval];
$track_hits2 = $modSettings['hitStats'] ? "<td class=\"windowbg2\"><b>$row_days[crap]</b></td>" : "" ;
 echo "";
   }
else
   {
$tempval=$row_days[month]-1;
$temp_month=$months[$tempval];
$track_hits2 = $modSettings['hitStats'] ? "<td class=\"windowbg2\">$row_days[crap]</td>" : "" ;
 echo "";
   }
}}

[/edit]
« Last Edit: September 24, 2003, 10:07:51 AM by NATOR » Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  German User Help  |  Hilfe zu YaBB SE  |  Statistikmaxima fett darstellen « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.080 seconds with 20 queries.