Black Magister
Hi
Ich möchte, das jeder User bestimmen kann, ob die Top 5 angezeigt werden soll oder nicht.
Dieses sollte im Profil bei Einstellungen eingestellt werden können.
wie mach ich das?
thx
Steinadler
Dazu sind 4 Arbeitsschritte erforderlich.
1.
Datenbank
Ein neues Feld in der Tabelle users anlegen:
showtop5
php: |
1:
|
ALTER TABLE `bbx_users` ADD `showtop5` INT( 11 ) NOT NULL default '1'; |
|
Das x durch die Boardnummer ersetzen!
2.
index.php bearbeiten
suche:
php: |
1:
|
eval ("\$top5threadstats = \"" . $tpl->get("index_topfive") . "\";"); |
|
ersetze durch:
php: |
1:
|
if($wbbuserdata['showtop5'] == 1) eval ("\$top5threadstats = \"" . $tpl->get("index_topfive") . "\";"); |
|
3.
usercp.php
Alle 4 Änderungen sind im Abschnitt:
php: |
1:
|
if($action=="options_change") { |
|
durchzuführen!
suche in der usercp.php:
php: |
1:
|
if(isset($_POST['r_styleid'])) $r_styleid = trim($_POST['r_styleid']); |
|
füge
darunter ein:
php: |
1:
|
if(isset($_POST['r_showtop5'])) $r_showtop5 = trim($_POST['r_showtop5']); |
|
suche weiter:
php: |
1:
|
, nosessionhash='".intval($r_nosessionhash)."' |
|
füge
direkt dahinter ein:
php: |
1:
|
, showtop5='".intval($r_showtop5)."' |
|
suche weiter:
php: |
1:
|
$r_styleid = $wbbuserdata['styleid']; |
|
füge
darunter ein:
php: |
1:
|
$r_showtop5 = $wbbuserdata['showtop5']; |
|
suche weiter:
php: |
1:
|
if(isset($r_umaxposts)) $sumaxposts[$r_umaxposts]=" selected=\"selected\""; |
|
füge
darunter ein:
php: |
1:
|
if(isset($r_showtop5)) $showtop5[$r_showtop5]=" selected=\"selected\""; |
|
4.
usercp_options_change.tpl
suche im usercp_options_change.tpl:
code: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
|
<tr id="tableb" bgcolor="{tablecolorb}">
<td><normalfont><b>Persönliches Style wählen:</b></font><br><smallfont></font></td>
<td><select name="r_styleid">
<option value="0">Forumstandard</option>
$style_options
</select>
</td>
</tr>
|
|
füge
darunter ein:
code: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
|
<tr id="tablea" bgcolor="{tablecolora}">
<td><normalfont><b>TOP 5 benutzen?</b></font><br /><smallfont>Soll die TOP 5 auf der Startseite angezeigt werden?</font></td>
<td><select name="r_showtop5">
<option value="1"$showtop5[1]>Ja</option>
<option value="0"$showtop5[0]>Nein</option>
</select>
</td>
</tr>
|
|
Das wars......ungetestet, sollte aber so klappen.
Black Magister
besten dank steinadler, haut hin.