bekomm diese fehlermeldung:
Code: Alles auswählen
Warning: Division by zero in /forum/viewtopic.php on line 1614
Warning: Division by zero in /forum/viewtopic.php on line 1614
Warning: Division by zero in /forum/viewtopic.php on line 1614Code: Alles auswählen
// WORD COUNT START by NoahK
$sql = "SELECT user_wordcount FROM " . USERS_TABLE . " WHERE user_id='$poster_id'";
$result = $db->sql_query($sql);
$words = $db->sql_fetchrow($result);
$wordcount = $words['user_wordcount'];
$rest3 = $wordcount;
// This next set of commands adds commas in the proper places for larger numbers. Up to 99,999,999.
$new_wordcount = strlen($wordcount);
if ($new_wordcount == "4" || $new_wordcount == "5" || $new_wordcount == "6")
{
$rest4 = $new_wordcount - 3;
$rest = substr($wordcount, $rest4);
$rest2 = substr($wordcount, 0, $rest4);
$rest3 = $rest2 . "," . $rest;
}
elseif (strlen($wordcount) == "7")
{
$rest = substr($wordcount, 4);
$rest1 = substr($wordcount, 1,3);
$rest2 = substr($wordcount, 0,1);
$rest3 = $rest2 . "," . $rest1 . "," . $rest;
}
elseif (strlen($wordcount) == "8")
{
$rest = substr($wordcount, 5);
$rest1 = substr($wordcount, 2,3);
$rest2 = substr($wordcount, 0,2);
$rest3 = $rest2 . "," . $rest1 . "," . $rest;
}
// The code below is not utilized in this mod for viewtopic, however the .TPL could easily be changed to include the word average by using WORD_AVG.
if ($wordcount == "0") { // Stop division by 0.
$avg_words = $lang['Word_NA']; // If a user has no posts. You may safely change N/A to 0 or any other text in the language file.
} else {
$avg_words = round(($wordcount / $postrow[$i]['user_posts']),2); // The 2 controls the numbers shown after the decimal. Use 0 if you want whole numbers.
}
// WORD COUNT END by NoahK
Das lustige dran ist, wenn ich die Seite umplättere... ist der fehlermeldung auf seite 1. wenn ich aber umblätter, ist auf seite 2 keine fehlermeldung mehr... *hm*
kann mir vielleicht einer sagen, warum dann eine fehlermeldung auftaucht.
MfG Pato