adulis
Narys
Kapitonas
Pranešimai: 618
Įstojęs: 2007 Bir. 19 20:06:43
Kodas:
$text = array("<center><a href='http://www.musis.xz.lt/news.php'><img src='http://www.musis.xz.lt/images/120x60_1.gif' border=0 alt='Musis.xz.lt Krepsinis' /></a> <center>","<center><a href='http://www.tinklalapis.net'><img src='http://www.tinklalapis.net/images/pro120x60.gif'><center>","<center><a href='http://www.musis.xz.lt/news.php'><img src='http://www.musis.xz.lt/images/120x60_1.gif' border=0 alt='Musis.xz.lt Krepsinis' /></a> <center>");
$cc = count($text) ;
$cl = $cc-1;
$rand = rand(0,$cl);
echo"$text[$rand]";
Kaip šį koda integruot i header.php kad kaskartus atidarius puslapį atverstų vis kita headerį?
Header.php
<?php
global $theme_width,$settings,$aidlink,$locale,$userdata,$db_prefix;
echo "<table width='$theme_width' border='0' align='center' cellpadding='0' cellspacing='0' background='".THEME."images/done.jpg' height='299' style='background-repeat: no-repeat;'>
<tr>
<td valign='bottom' style='padding-left:80px;' width='725'>
<a href='".BASEDIR."index.php'><img src='".THEME."images/hb1.png' border='0' alt='Pagrindinis'></a>
<a href='".BASEDIR."forum/index.php'><img src='".THEME."images/hb2.png' border='0' alt='Forumas'></a>
<a href='".BASEDIR."search.php'><img src='".THEME."images/hb3.png' border='0' alt='Paieðka'></a>
</td>
<td width='235' style='padding-right:90px; padding-top:20px;' valign='middle'>";
if (iMEMBER) {
$msg_count = dbcount("(message_id)", "messages", "message_to='".$userdata['user_id']."' AND message_read='0'AND message_folder='0'");
echo "<table width='235' border='0' cellspacing='2' cellpadding='2'>
<tr>
<td>\n";
if ($userdata['user_avatar'] != "") {
echo "<center><img src='".BASEDIR."images/avatars/".$userdata['user_avatar']."' width='100' height='100' style='border:1px'></center>\n";
} else {
echo "<center><img src='".THEME."images/noavatar.gif' width='100' height='100' border='0'></center>\n";
}
echo "</td>
<td valign='top'><img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."edit_profile.php' class='side'>Redaguoti profilá</a><br>
<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."profile.php?lookup=".$userdata['user_id']."' class='side'>Að ið ðalies</a><br>
<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."messages.php' class='side'>Þinutës [naujø: <b><span style='color:#990000'>".sprintf($msg_count)."</span></b>]</a><br>
<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."members.php' class='side'>Nariai</a><br>\n";
if (iADMIN && (iUSER_RIGHTS != "" || iUSER_RIGHTS != "C")) {
echo "<img src='".THEME."images/bullet.gif' alt=''> <a href='".ADMIN."index.php".$aidlink."' class='side'>Administracija</a><br>\n";
}
echo "<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."setuser.php?logout=yes' class='side'>".$locale['084']."</a><br><br>
<b><span class='ip'>IP: </span></b>";
$userip = $_SERVER['REMOTE_ADDR'];
$host = gethostbyaddr($userip);
echo "<span class='ip'>".$userip."</span><br /></td></tr></table>\n";
} else {
echo "<table width='170' border='0' cellspacing='0' cellpadding='0' align='center'><form name='loginform' method='post' action='".FUSION_SELF."'>
<tr>
<td align='right' class='ip'>Vardas: </td>
<td> <input type='text' name='user_name' class='textbox' style='width:100px;filter:alpha(opacity=70)'></td>
</tr>
<tr>
<td align='right' class='ip'>".$locale['062'].": </td>
<td> <input type='password' name='user_pass' class='textbox' style='width:100px;filter:alpha(opacity=70)'></td>
</tr>
<tr>
<td align='right'><input type='checkbox' name='remember_me' value='y'></td>
<td> <input type='submit' name='login' value='Prisijungti' class='button'></td>
</tr>
</form>\n";
if ($settings['enable_registration']) {
echo "<a href=".BASEDIR."register.php>Registracija</a> / <a href=".BASEDIR."lostpassword.php>Slaptaþodis</a>\n";
}
echo"</table>\n";
}
echo "</td>
</tr>
</table>\n";
echo"</td></tr><tr></tr><tr><td></td></tr></table>";
echo "<table width='100%' cellspacing='0' cellpadding='0' class='sub-header' style='border-right: solid #b5b5b5 1px; border-left: solid #b5b5b5 1px;' >\n<tr>";
echo "<td align='right'>Dabar narðo: ".dbcount("(*)","online","")." [".dbcount("(*)","online","online_user = '0'")."]";
echo ($i == 0 ? " " : "")."</td>";
echo "</td></tr></table>\n";
echo "<table width='100%' cellpadding='4' bgcolor='#F8F8F8' cellspacing='0' border='0'><tr>";
?>
WWW.DMG.LT - CS 1.6 Serverių Tinklas
WWW.L2.DMG.LT - Lineage2 PVP Server
Dandžu
Narys
Ekspertas
Pranešimai: 3265
Įstojęs: 2007 Lie. 23 13:07:47
Imk. Susirašyk adresus header'ių.
<?php
global $theme_width,$settings,$aidlink,$locale,$userdata,$db_prefix;
$text = array("<center><a href='http://www.musis.xz.lt/news.php'><img src='http://www.musis.xz.lt/images/120x60_1.gif' border=0 alt='Musis.xz.lt Krepsinis' /></a> <center>","<center><a href='http://www.tinklalapis.net'><img src='http://www.tinklalapis.net/images/pro120x60.gif'><center>","<center><a href='http://www.musis.xz.lt/news.php'><img src='http://www.musis.xz.lt/images/120x60_1.gif' border=0 alt='Musis.xz.lt Krepsinis' /></a> <center>");
$cc = count($text) ;
$cl = $cc-1;
$rand = rand(0,$cl);
echo"";
echo "<table width='$theme_width' border='0' align='center' cellpadding='0' cellspacing='0' background='$text[$rand]' height='299' style='background-repeat: no-repeat;'>
<tr>
<td valign='bottom' style='padding-left:80px;' width='725'>
<a href='".BASEDIR."index.php'><img src='".THEME."images/hb1.png' border='0' alt='Pagrindinis'></a>
<a href='".BASEDIR."forum/index.php'><img src='".THEME."images/hb2.png' border='0' alt='Forumas'></a>
<a href='".BASEDIR."search.php'><img src='".THEME."images/hb3.png' border='0' alt='Paieðka'></a>
</td>
<td width='235' style='padding-right:90px; padding-top:20px;' valign='middle'>";
if (iMEMBER) {
$msg_count = dbcount("(message_id)", "messages", "message_to='".$userdata['user_id']."' AND message_read='0'AND message_folder='0'");
echo "<table width='235' border='0' cellspacing='2' cellpadding='2'>
<tr>
<td>\n";
if ($userdata['user_avatar'] != "") {
echo "<center><img src='".BASEDIR."images/avatars/".$userdata['user_avatar']."' width='100' height='100' style='border:1px'></center>\n";
} else {
echo "<center><img src='".THEME."images/noavatar.gif' width='100' height='100' border='0'></center>\n";
}
echo "</td>
<td valign='top'><img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."edit_profile.php' class='side'>Redaguoti profilá</a><br>
<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."profile.php?lookup=".$userdata['user_id']."' class='side'>Að ið ðalies</a><br>
<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."messages.php' class='side'>Þinutës [naujø: <b><span style='color:#990000'>".sprintf($msg_count)."</span></b>]</a><br>
<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."members.php' class='side'>Nariai</a><br>\n";
if (iADMIN && (iUSER_RIGHTS != "" || iUSER_RIGHTS != "C")) {
echo "<img src='".THEME."images/bullet.gif' alt=''> <a href='".ADMIN."index.php".$aidlink."' class='side'>Administracija</a><br>\n";
}
echo "<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."setuser.php?logout=yes' class='side'>".$locale['084']."</a><br><br>
<b><span class='ip'>IP: </span></b>";
$userip = $_SERVER['REMOTE_ADDR'];
$host = gethostbyaddr($userip);
echo "<span class='ip'>".$userip."</span><br /></td></tr></table>\n";
} else {
echo "<table width='170' border='0' cellspacing='0' cellpadding='0' align='center'><form name='loginform' method='post' action='".FUSION_SELF."'>
<tr>
<td align='right' class='ip'>Vardas: </td>
<td> <input type='text' name='user_name' class='textbox' style='width:100px;filter:alpha(opacity=70)'></td>
</tr>
<tr>
<td align='right' class='ip'>".$locale['062'].": </td>
<td> <input type='password' name='user_pass' class='textbox' style='width:100px;filter:alpha(opacity=70)'></td>
</tr>
<tr>
<td align='right'><input type='checkbox' name='remember_me' value='y'></td>
<td> <input type='submit' name='login' value='Prisijungti' class='button'></td>
</tr>
</form>\n";
if ($settings['enable_registration']) {
echo "<a href=".BASEDIR."register.php>Registracija</a> / <a href=".BASEDIR."lostpassword.php>Slaptaþodis</a>\n";
}
echo"</table>\n";
}
echo "</td>
</tr>
</table>\n";
echo"</td></tr><tr></tr><tr><td></td></tr></table>";
echo "<table width='100%' cellspacing='0' cellpadding='0' class='sub-header' style='border-right: solid #b5b5b5 1px; border-left: solid #b5b5b5 1px;' >\n<tr>";
echo "<td align='right'>Dabar narðo: ".dbcount("(*)","online","")." [".dbcount("(*)","online","online_user = '0'")."]";
echo ($i == 0 ? " " : "")."</td>";
echo "</td></tr></table>\n";
echo "<table width='100%' cellpadding='4' bgcolor='#F8F8F8' cellspacing='0' border='0'><tr>";
?>
adulis
Narys
Kapitonas
Pranešimai: 618
Įstojęs: 2007 Bir. 19 20:06:43
Kažkur čia klaida:
<table width='$theme_width' border='0' align='center' cellpadding='0' cellspacing='0' background='$text[$rand]' height='299' style='background-repeat: no-repeat;'>
Vietoj headerio rodo :
' height='299' style='background-repeat: no-repeat;'>
WWW.DMG.LT - CS 1.6 Serverių Tinklas
WWW.L2.DMG.LT - Lineage2 PVP Server
Dandžu
Narys
Ekspertas
Pranešimai: 3265
Įstojęs: 2007 Lie. 23 13:07:47
O tai tų banner'ių adresus sudedi gerai? Beje Qrmiz yra forume parodęs kitu būdu.
MAnjack
Garbės narys
Legenda
Pranešimai: 11821
Įstojęs: 2006 Kov. 2 20:03:58
Va mano būdas:
<img src='".BASEDIR."images/headers/".rand(1,3)."'>
Headerio pavadinimas turi būti kažkoks skaičius telpantis į intervalą 1,3. Intervalą galima plėsti.
Peršokti į forumą:
Žaliems
Nebeegzistuojančios svetainės
Bendri PHP-F klausimai
WordPress
Kiti PHP, HTML, MySQL klausimai
Expert PHP, MySQL klausimai
Kitos TVS
C#, Python, Java, JS, C++ klausimai
Naujų modų pristatymai
Mods, Panels & Infusions
Themes
Dalinuosi, dovanoju!
Jūsų saitai
Klausimai apie domenus ir hostingus
VPS/DS serverių konfigūravimas ir valdymas
Viskas apie skaitliukus, top'us ir lankomumą
Dizaino konkursai
Parduodu - perku dizainą, banerį
Parduodu - perku - keičiuosi reklama
Parduodu - perku domeną, tinklapį
Siūlau - ieškau hostingo/VPS serverio
Parduodu - perku skriptą, modifikaciją, tvs
Socialiniai tinklai - Facebook ir kiti
Legalus verslas, teisiniai klausimai
Visa kita kas susiję su darbu ir pinigais
LTStartups.com - Lietuvos startuolių bendruomenė
Off-Topic diskusijos
IT naujienos
Portalo informacija
Narių pasiūlymai
Geležis ir programinė įranga
Grafika
Out Of Place
Su e-verslu nesusijęs darbas ir prekyba
Dalinuosi, dovanoju!