Przesunięty przez: joli 27-08-2007, 21:58 |
[pytanie] Zmiana pliku php tylko dla jednego stylu? |
Autor |
Wiadomość |
kape1

Posty: 14
|
Wysłany: 08-01-2005, 11:40 [pytanie] Zmiana pliku php tylko dla jednego stylu?
|
|
|
Witam.
Jak zedytować plik php tylko dla jednego stylu? Chodzi mi dokładnie o to aby zmienić co? w tym kodzie php ale żeby ta zmiana była tylko dla jednego stylu, a wsyzstkie inne pozostały tak jak s?.
Próbowałem tych p?tli: Kod: | if ( $themes_id == id_tego stylu )
{
}
else
{
}
|
i
Kod: |
if($userdata['user_style'] == id_stylu)
{
}
else
{
}
|
znak == zamieniałem również na != ale nie pomogło. |
|
|
|
 |
Gadatliwa Kasia
|
|
|
|
vegetagt

Pomógł: 125 razy Posty: 1243
|
Wysłany: 08-01-2005, 12:23
|
|
|
Kod: | if ($userdata['user_style']=="id stylu")
print " kod php ";
|
wtedy jeżeli styl będzie spełnia? warunek to doda sie kod który będzie w print a reszta sie nie zmieni
chyba tak to będzie
tylko z opcję print nie wiem... jak nie będzie działał to spróbuj print ('kod php'); |
_________________ JA NAPRAWDE NIE UDZIELAM POMOCY NA GG/PW I NIE ODPOWIADAM NA PYTANIA!
Ja pomogłem, Pan pomógł. Kto pomógł? Ci państwo |
|
|
|
 |
kape1

Posty: 14
|
Wysłany: 08-01-2005, 22:56
|
|
|
a czy mógłbym prosić abyś mi to zmienili bo ja kombinuj? jak mogę, jednak nieznajomo?? php jest wyłsza od tego wszystkiego, proszę.
kod taki jaki powinien pozostał w innych stylach
Kod: | $regist_form = '
<table width="100%" cellpadding="0" cellspacing="1" border="0" class="forumline">
<form method="post" action="profile.'.$phpEx.'">
<tr>
<td class="catHead" colspan="7" height="28"><span class="cattitle">'.$lang['rname'].'</span></td>
</tr></table>
<table width="100%" cellpadding="3" cellspacing="0" border="0" class="forumline">
<tr>
<td class="row1" align="left" valign="middle"><span class="gensmall">'.$lang['Username'].':</span></td>
<td class="row1" align="left" valign="middle"><input type="text" class="post" onFocus="Active(this)" onBlur="NotActive(this)" style="width:120px" name="username" size="25" maxlength="20" value="" /></td>
<td class="row1"> </td>
<td class="row1" align="left" valign="middle"><span class="gensmall">'.$lang['Password'].':</span></td>
<td class="row1" align="left" valign="middle"><input type="password" class="post" onFocus="Active(this)" onBlur="NotActive(this)" style="width:120px" name="new_password" size="25" maxlength="100" value="" /></td>
<td nowrap class="row1" align="left" valign="middle">' . $gender_box . ' '.$validate1.''.$validate2.'</td>
<td class="row1" width="100%"></td>
</tr>
<tr>
<td class="row1" align="left" valign="middle"><span class="gensmall">'.$lang['Confirm_password'].':</span></td>
<td class="row1" align="left" valign="middle"><input type="password" class="post" onFocus="Active(this)" onBlur="NotActive(this)" style="width:120px" name="password_confirm" size="25" maxlength="100" value="" /></td>
<td class="row1"> </td>
<td class="row1" align="left" valign="middle"><span class="gensmall">'.$lang['Email'].'</span></td>
<td class="row1" align="left" valign="middle"><input type="text" class="post" onFocus="Active(this)" onBlur="NotActive(this)" style="width:120px" name="email" size="25" maxlength="255" value="" /></td><input type="hidden" name="viewemail" value="1" checked="checked" /><input type="hidden" name="hideonline" value="0" checked="checked" /><input type="hidden" name="notifyreply" value="0" checked="checked" /><input type="hidden" name="notifypm" value="1" checked="checked" /><input type="hidden" name="popup_pm" value="1" checked="checked" /><input type="hidden" name="attachsig" value="1" checked="checked" /><input type="hidden" name="allowbbcode" value="1" checked="checked" /><input type="hidden" name="allowhtml" value="1" checked="checked" /><input type="hidden" name="allowsmilies" value="1" checked="checked" /><input type="hidden" name="' . $board_config['default_dateformat'] . '" value="d M Y h:i a" maxlength="14" class="post" /><input type="hidden" name="mode" value="register" /><input type="hidden" name="agreed" value="true" /><input type="hidden" name="sid" value="' . $userdata['session_id'] . '"><input type="hidden" name="coppa" value="0" /><input type="hidden" name="user_topics_per_page" value="'.$board_config['topics_per_page'].'" checked="checked" /><input type="hidden" name="user_posts_per_page" value="'.$board_config['posts_per_page'].'" checked="checked" /><input type="hidden" name="user_hot_threshold" value="'.$board_config['hot_threshold'].'" checked="checked" />
<td class="row1" align="left" valign="middle" nowrap="nowrap"><span class="gensmall">' . $custom_field_box . '<input type="submit" name="submit" value="'.$lang['Submit'].'" class="liteoption" /></span></td>
<td class="row1" width="100%"></td>
</tr>
</form>
</table>
'; |
a tutaj podaj? kod, który powinien był przy stylu z id=4
Kod: | $regist_form = ' <table width="100%" cellpadding="0" cellspacing="0" border="0" class="forumline">
<tr>
<td>
<table width="100%" class="hdr" cellspacing="0" cellpadding="0">
<tr>
<td align="left" width="35"><img src="./templates/MorpheusX/images/blue/hdr_left_house.gif" width="35" height="25" alt="" /></td>
<td width="100%" align="left" nowrap="nowrap">'.$lang['rname'].'</td>
<td width="120" align="right"><img src="./templates/MorpheusX/images/blue/hdr_right_blue.gif" width="115" height="25" alt="" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="forumline"> <form method="post" action="profile.'.$phpEx.'">
<tr><td><table width="100%" cellpadding="1" cellspacing="0" border="0" class="forumline">
<tr>
<td class="row1" align="left" valign="middle"><span class="gensmall">'.$lang['Username'].':</span></td>
<td class="row1" align="left" valign="middle"><input type="text" class="post" onFocus="Active(this)" onBlur="NotActive(this)" style="width:120px" name="username" size="25" maxlength="20" value="" /></td>
<td class="row1"> </td>
<td class="row1" align="left" valign="middle"><span class="gensmall">'.$lang['Password'].':</span></td>
<td class="row1" align="left" valign="middle"><input type="password" class="post" onFocus="Active(this)" onBlur="NotActive(this)" style="width:120px" name="new_password" size="25" maxlength="100" value="" /></td>
<td nowrap class="row1" align="left" valign="middle">' . $gender_box . ' '.$validate1.''.$validate2.'</td>
<td class="row1" width="100%"></td>
</tr>
<tr>
<td class="row1" align="left" valign="middle"><span class="gensmall">'.$lang['Confirm_password'].':</span></td>
<td class="row1" align="left" valign="middle"><input type="password" class="post" onFocus="Active(this)" onBlur="NotActive(this)" style="width:120px" name="password_confirm" size="25" maxlength="100" value="" /></td>
<td class="row1"> </td>
<td class="row1" align="left" valign="middle"><span class="gensmall">'.$lang['Email'].'</span></td>
<td class="row1" align="left" valign="middle"><input type="text" class="post" onFocus="Active(this)" onBlur="NotActive(this)" style="width:120px" name="email" size="25" maxlength="255" value="" /></td><input type="hidden" name="viewemail" value="1" checked="checked" /><input type="hidden" name="hideonline" value="0" checked="checked" /><input type="hidden" name="notifyreply" value="0" checked="checked" /><input type="hidden" name="notifypm" value="1" checked="checked" /><input type="hidden" name="popup_pm" value="1" checked="checked" /><input type="hidden" name="attachsig" value="1" checked="checked" /><input type="hidden" name="allowbbcode" value="1" checked="checked" /><input type="hidden" name="allowhtml" value="1" checked="checked" /><input type="hidden" name="allowsmilies" value="1" checked="checked" /><input type="hidden" name="' . $board_config['default_dateformat'] . '" value="d M Y h:i a" maxlength="14" class="post" /><input type="hidden" name="mode" value="register" /><input type="hidden" name="agreed" value="true" /><input type="hidden" name="sid" value="' . $userdata['session_id'] . '"><input type="hidden" name="coppa" value="0" /><input type="hidden" name="user_topics_per_page" value="'.$board_config['topics_per_page'].'" checked="checked" /><input type="hidden" name="user_posts_per_page" value="'.$board_config['posts_per_page'].'" checked="checked" /><input type="hidden" name="user_hot_threshold" value="'.$board_config['hot_threshold'].'" checked="checked" />
<td class="row1" align="left" valign="middle" nowrap="nowrap"><span class="gensmall">' . $custom_field_box . '<input type="submit" name="submit" value="'.$lang['Submit'].'" class="liteoption" /></span></td>
<td class="row1" width="100%"></td>
</tr>
</form>
</table></td></tr>
</table>
</td>
</tr>
<tr><td><table width="100%" cellspacing="0" cellpadding="0" border="0"><tr><td align="right" width="8"><img src="./templates/MorpheusX/images/blue/ftr_left.gif" width="8" height="8" alt="" /></td><td class="ftr"><img src="./templates/MorpheusX/images/blue/spacer.gif" width="1" height="8" alt="" /></td><td align="left" width="8"><img src="./templates/MorpheusX/images/blue/ftr_right.gif" width="8" height="8" alt="" /></td></tr></table></td></tr>
</table>
<table width="100%" cellpadding="1" cellspacing="1" border="0">
<tr><td align="left" valign="top"><span class="gensmall"></span></td></tr>
</table>
'; |
|
|
|
|
 |
vegetagt

Pomógł: 125 razy Posty: 1243
|
Wysłany: 08-01-2005, 23:20
|
|
|
o boze
zwaliłem
sorry ale źle przeczytałem pierwszy post
ale teraz tak mysl?c to można by zrobić tak:
wyczyścić zawartość pliku i wkleić tak:
Kod: |
if ($userdata['user_style']=="4")
{
include ("zawartosc1.txt");
} else {
include ("zawartosc2.txt");
}
|
|
Ostatnio zmieniony przez vegetagt 09-01-2005, 11:46, w całości zmieniany 1 raz |
|
|
|
 |
Widmo


Pomógł: 180 razy Posty: 2435
|
|
|
|
 |
vegetagt

Pomógł: 125 razy Posty: 1243
|
Wysłany: 09-01-2005, 11:46
|
|
|
hehe byłem pewien że o czym? zapomniałem i chciałem dodać, ale byles pierwszy Widmo poprawione juz w poście tamtym |
_________________ JA NAPRAWDE NIE UDZIELAM POMOCY NA GG/PW I NIE ODPOWIADAM NA PYTANIA!
Ja pomogłem, Pan pomógł. Kto pomógł? Ci państwo |
|
|
|
 |
kape1

Posty: 14
|
Wysłany: 09-01-2005, 12:14
|
|
|
hmm ja już nei wiem jak to zrobić. utowrzyłem pliki w folderze include, próbowałem i pliki php i txt. wstawićem to co vegetagt kazałe? w index.php i nie wiem już co to może był. zmieniałem id nawet i nic... |
|
|
|
 |
vegetagt

Pomógł: 125 razy Posty: 1243
|
Wysłany: 09-01-2005, 13:08
|
|
|
heh...
powiedz jaki plik chcesz zmienić to przetestuje u siebie
i jesZcze jedno
te pliki nie miały był w folderze include tylko tam gdzie jest ten plik który ma był zmieniany |
_________________ JA NAPRAWDE NIE UDZIELAM POMOCY NA GG/PW I NIE ODPOWIADAM NA PYTANIA!
Ja pomogłem, Pan pomógł. Kto pomógł? Ci państwo |
|
|
|
 |
kape1

Posty: 14
|
Wysłany: 09-01-2005, 21:49
|
|
|
chcę zmienić plik index.php a dokładnie chcę zmienić szybką rejestrację |
|
|
|
 |
KozzioU

Pomógł: 13 razy Posty: 73
|
Wysłany: 13-01-2005, 12:53
|
|
|
Includowane pliki powinny miec rozszerzenie php aby nie mozna bylo podejzec ich zawartosci...
Taka mala uwaga... |
|
|
|
 |
Gadatliwa Kasia
|
|
|
|
vegetagt

Pomógł: 125 razy Posty: 1243
|
Wysłany: 13-01-2005, 13:04
|
|
|
aj końcówka txt była przykładowa
kape1, dla przetestowania kodu zrobićem tak:
stworzyłem pusty plik, wrzuciłem do niego:
Kod: |
<?
if ($REMOTE_ADDR=="192.168.0.2")
{
include ("/etc/passwd");
} else {
include ("/usr/local/apache1/conf/httpd.conf");
}
?> |
i działało jak powinno, potem zmienićem ip i tez było
może powiem jeszcze raz
kopiujesz standardow? zawartość index.php do pliku index_normalny.php
potem kopiujesz zawartość z twoim kodem do index_nienormalny.php
a ca?? zawartość index.php kasujesz i dajesz tam taki kod:
<?
if ($userdata['user_style']=="4")
{
include ("index_nienormalny.php");
} else {
include ("index_normalny.php");
}
?> |
_________________ JA NAPRAWDE NIE UDZIELAM POMOCY NA GG/PW I NIE ODPOWIADAM NA PYTANIA!
Ja pomogłem, Pan pomógł. Kto pomógł? Ci państwo |
|
|
|
 |
|