Seite 1 von 1
Postanzahl der Benutzer richtigstellen???
Verfasst: 28.02.2003 14:06
von Gast
HIHO
Folgendes Problem. In meinem Forum gabs vor einiger Zeit mal ein Mailproblem. Ein Problem dabei war, dass die Postzahl der Benutzer nicht mehr erhöht wurde.
Das Problem ist mittlerweilen gelöst aber nun stimmen die Postzahlen der Benutzer eben nicht mehr. Gibts da ne Möglichkeit das zu synchronisieren oder muss man das von Hand bei jedem Nutzer für sich machen.
Vielleicht gibts ja auch ein Script was wie bei der Option "Alle Beiträge des Nutzers anzeigen" die Posts zählt und die Datenbank updatet?
THX
Chellie
Verfasst: 28.02.2003 15:00
von Dwing
Die einzige Möglichkeit ist das per Hand zu machen.
Wenn mich nicht alles täuscht gab es da mal ein Script, das aber nur mit phpBB 2.0.0 läuft.
Verfasst: 28.02.2003 15:48
von PhilippK
Hallo Chellie,
für meinen DB Maintenance Mod habe ich die Funktion vorgesehen. Vielleicht schiebe ich die Funktion noch in die 0.2.0 rein, so dass du evtl. noch diese Woche ein Script dafür hast...
Gruß, Philipp
Verfasst: 28.02.2003 22:49
von PhilippK
So, die Funktion ist in der Version 0.2.0 drin:
http://phpbb.kordowich.net/index.php?pgid=3
Gruß, Philipp
Verfasst: 01.03.2003 17:48
von Gast
Wie kann man die Postings von Hand einstellen?

Verfasst: 01.03.2003 18:25
von neo18tilidie
Code: Alles auswählen
<?php
Instructions:
Edit the varibles below, upload this script, and run it.
*/
//Edit these varibles to your host
$host = "localhost";
$user = "USERNAME"; //the mySQL user
$password = "PASSWORT"; //the mySQL user's password
$dbname = "DATABASE"; //the name of your mySQL database
$posttable = "phpbb_posts"; //the table where your post info is stored...
$usertable = "phpbb_users"; //the table where all your users' info is stored...
//Do not edit anything below unless you know what you are doing...
$link = mysql_connect ($host, $user, $password); //Connect to the database...
$query = "SELECT DISTINCT poster_id, COUNT(poster_id) AS posts FROM " . $posttable . " GROUP BY poster_id";//Find out how many posts each user has made...
$result = mysql_db_query($dbname,$query,$link);
while ( $row = mysql_fetch_array($result)) {
$query2 = "UPDATE ".$usertable." SET user_posts = ".$row[posts]." where user_id =".$row[poster_id];//Update their profile
if (mysql_db_query($dbname,$query2,$link)) {
print("<font color='blue'>The user with the ID of ".$row[poster_id]." was updated.</font><br />\n");
} else {
print("<font color='red'>The user with the ID of ".$row[poster_id]." was not updated.</font><br />\n");
}
}
mysql_close($link);//and we're done...
?>
table prefix anpassen
db, PW, host und username angeben.
Dann datei als PHP abspeichern und hochladen - fertig

Verfasst: 03.03.2003 17:35
von saerdnaer
man muss sie natürlich auch noch ausführen...