Code: Selecteer alles
ALTER TABLE `hotrid_nl_-_db` ADD `user_wordcount` VARCHAR(255) DEFAULT '0' NOT NULL;
MySQL retourneerde:
#1146 - Table 'hotrid_nl_-_db.hotrid_nl_-_db' doesn't exist
Wat moet ik invoeren anders....
Code: Selecteer alles
ALTER TABLE `hotrid_nl_-_db` ADD `user_wordcount` VARCHAR(255) DEFAULT '0' NOT NULL;
MySQL retourneerde:
#1146 - Table 'hotrid_nl_-_db.hotrid_nl_-_db' doesn't exist
Dus even het originele graaghotrid schreef:ALTER TABLE `hotrid_nl_-_db` ADD `user_wordcount` VARCHAR(255) DEFAULT '0' NOT NULL
Code: Selecteer alles
// WORD COUNT START by NoahK
$sql = "SELECT user_wordcount FROM " . phpbb_users . " WHERE user_id='$profiledata[user_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.
if (strlen($wordcount) == "4") {
$rest = substr($wordcount, 1);
$rest2 = substr($wordcount, 0,1);
$rest3 = $rest2 . "," . $rest;
}
if (strlen($wordcount) == "5") {
$rest = substr($wordcount, 2);
$rest2 = substr($wordcount, 0,2);
$rest3 = $rest2 . "," . $rest;
}
if (strlen($wordcount) == "6") {
$rest = substr($wordcount, 3);
$rest2 = substr($wordcount, 0,3);
$rest3 = $rest2 . "," . $rest;
}
if (strlen($wordcount) == "7") {
$rest = substr($wordcount, 4);
$rest1 = substr($wordcount, 1,3);
$rest2 = substr($wordcount, 0,1);
$rest3 = $rest2 . "," . $rest1 . "," . $rest;
}
if (strlen($wordcount) == "8") {
$rest = substr($wordcount, 5);
$rest1 = substr($wordcount, 2,3);
$rest2 = substr($wordcount, 0,2);
$rest3 = $rest2 . "," . $rest1 . "," . $rest;
}
if ($wordcount == "0") { // Stop division by 0.
$avg_words = "N/A"; // If a user has no posts. You may safely change N/A to 0, et cetera.
} else {
$avg_words = round(($wordcount / $profiledata['user_posts']),2); // The 2 controls the numbers shown after the decimal. Use 0 if you want whole numbers.
}
// WORD COUNT END by NoahK
Wat bedoel je daar precies mee? telkens 0???...hotrid schreef:Heb het al klaar...Maar ik heb de alles geupload alleen bij de profielen van de users staat telkens 0, ik denk dat dat te maken heeft met de volgende code :