Hi,
Da viele Sponsoren nicht mehr als 25 Banner pro Seite erlauben möchte ich gerne die Anzahl auf 25 Limitieren. Man soll also im Einstellungs Menü nicht mehr als 25 auswählen können. Wo kann man das machen?
LG Christopher
Druckbare Version
Hi,
Da viele Sponsoren nicht mehr als 25 Banner pro Seite erlauben möchte ich gerne die Anzahl auf 25 Limitieren. Man soll also im Einstellungs Menü nicht mehr als 25 auswählen können. Wo kann man das machen?
LG Christopher
content/konto/userprofil.php
z.b. abändenr inPHP-Code:
<tr>
<td>Max. anzeigbare Forcedbanner:</td>
<td>
<select name="max_forced">
<option value="3" <? if ($info['max_forced'] == 3) echo 'selected';?>>3</option>
<option value="5" <? if ($info['max_forced'] == 5) echo 'selected';?>>5</option>
<option value="10" <? if ($info['max_forced'] == 10) echo 'selected';?>>10</option>
<option value="20" <? if ($info['max_forced'] == 20) echo 'selected';?>>20</option>
<option value="30" <? if ($info['max_forced'] == 30) echo 'selected';?>>30</option>
<option value="40" <? if ($info['max_forced'] == 40) echo 'selected';?>>40</option>
<option value="50" <? if ($info['max_forced'] == 50) echo 'selected';?>>50</option>
</select>
</td>
</tr>
oder wie auch immer :)PHP-Code:
<tr>
<td>Max. anzeigbare Forcedbanner:</td>
<td>
<select name="max_forced">
<option value="3" <? if ($info['max_forced'] == 3) echo 'selected';?>>3</option>
<option value="5" <? if ($info['max_forced'] == 5) echo 'selected';?>>5</option>
<option value="10" <? if ($info['max_forced'] == 10) echo 'selected';?>>10</option>
<option value="20" <? if ($info['max_forced'] == 20) echo 'selected';?>>20</option>
<option value="25" <? if ($info['max_forced'] == 25) echo 'selected';?>>25</option>
</select>
</td>
</tr>
solltest natürlich nicht vergessen, denjenigen usern, die momentan >25 ausgewählt haben auf 25 zu setzen
z.b. so :D
Code:update vms_userdaten set max_forced = 25 where max_forced > 25
Und die Prüfung, ob man innerhalb der Box ausgewählt hat?
Los, los :knueppel::biggrin1:
OK das funzt. Noch was anderes: Ich habe mir das Impressums Addon mal installiert damit man da nicht immer die Files selber editieren muss und wenn ich jetzt auf Impressum klicke steht da: Warning: fread() [function.fread]: Length parameter must be greater than 0. in /var/www/web640/html/manialose/content/intern/impressum.php on line 7.
Der Code sieht so aus:
<?
// Variabeln
$filename = 'lib/texte/impressum.txt';
// Datei auslesen
$fp = fopen ($filename, "r");
$inhalt = fread ($fp, filesize ($filename));
fclose ($fp);
$inhalt = str_replace('\\', '', $inhalt);
?>
<?head("Impressum");?>
<?=nl2br($inhalt);?>
</table>
<!-- Copyright darf nicht verändert oder entfernt werden -->
<BR><BR>
<table>
<tr>
<td align="right">
<a href="http://www.snippis.de" target="_blank"><font size="1">Kostenlos bereitgestellt durch Snippis</font></a>
</td>
</tr></table>
<?foot();?>
die datei ist nicht zufällig leer? :)
Nein aber es funzt jetzt plötzlich. Da ist übrigens ein Fehler im Code was das Layout zerschiest: Da wird ein </table> geschlossen aber nicht geöffnet. Vlt kann das mal jemand korrigieren und hochladen.
das möcht ich sehen !!
ps.: wieso hast du es dann nicht als vorbild (MOD und so :D ) in deinem ersten post hier schon erledigt anstatt hier drauf rumzureiten? denn im endeffekt hilft ihm das nun noch weniger :)
aber du kannst es ja gleich an gremlin weiterleiten, dass ers im nächsten vms gleich mit reinbringt, dann sparen wir uns auch solche kindergarten-diskussionen :D
Firebug nutzen und select-Box ändern.
Ich wollte eigentlich dir die Chance geben, das war ein Fehler von mir, tut mir leid:rolleyes:
Also folgendes:
/content/konto/userprofil.php öffnen
Suche:
ersetzen durch:PHP-Code:
db_query("UPDATE ".$db_prefix."_userdaten SET max_forced = '".$_POST['max_forced']."' WHERE uid=".$_SESSION['uid']."");
PHP-Code:
if (in_array($_POST['max_forced'], array(3, 5, 10, 20, 25)) {
db_query("UPDATE ".$db_prefix."_userdaten SET max_forced = '".$_POST['max_forced']."' WHERE uid=".$_SESSION['uid']."");
}
Hmmm...
Danke, habs soeben in der Download-Version einbauen müssen, weil dieses Update offensichtlich fehlt :suspicious:
EDIT:
Funktioniert nicht im Script aus dem Download-Bereich
Erst kommt Fehlermeldung wegen eines "{", entferne ich den, kommt nächste:
Also, gehts nicht.....Zitat:
Parse error: syntax error, unexpected T_STRING in /homepages/38/d13348132/htdocs/manilose2/content/konto/userprofil.php on line 89
da hat doch glatt einer mit den klammern sparen wollen ^^
hier der code sollte funzen:
PHP-Code:
if (in_array($_POST['max_forced'], array(3, 5, 10, 20, 25))) {
db_query("UPDATE ".$db_prefix."_userdaten SET max_forced = '".$_POST['max_forced']."' WHERE uid=".$_SESSION['uid']."");
}
Danke, das hat nun funktioniert :thumb: