counter für ein profilfeld 20. Januar 2010, 18:43 Hallo ich brauche eure hilfe und zwar ich wollt gern ein counter haben wer z.B. alles im profil klasse 9 a eingetragen hat wo dann auf einer seite steht 4 Mitglieder von uns sind in der Klasse 9a wisst ihr den code
20. Januar 2010, 20:21 Die Auswahl als Profilfeld, und dann in ner *.pm mit einer foreach einfach eine Variable $counter++; und dann irgendwo ausgeben, fertig
20. Januar 2010, 22:33 PHP-Quellcode my $counter=0; /////////////Couner my $users = $main->getAllUsers(); //////////Alle User durchgehen for (my $i = 0; $i <= $#$users; $i++) { my($nickname,$username) = split(/\|/,$users->[$i]); my $user = $main->loadUser($username); if($user->{profilfeld} eq 2) /////Wenn Profilfeld auf 2, dann +1 Zählen { $counter++; } } $main->{template_vars}{ERGEBNIS}=$counter; ////////////// Ergebnis in {GET|$ERGEBNIS} ausgeben (wenn danach $main->printTemplate(....); folgt