Parašė Styw0W· 2010 Rugs. 14 19:09:40
#5
Na Zeck iki galo nepabaigė, tačiau labai daug.. Bet kaip parašai pamoką, ją rašo ir prie Žaidėjo ir prie Serverio pamokų..
Taigi kaip čia padaryt, kad viename rodytu Žaidėjo , o kitame Serverio pamokas?
Atrodo štai šitaip:
Gal kas žinot kaip padaryt, kad rodytu atskirai?
Theme.php:
<?php
if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }
require_once INCLUDES."theme_functions_include.php";
// theme settings
$body_text = "#555555";
$body_bg = "#242424";
$theme_width = "950";
$theme_width_l = "180";
$theme_width_r = "180";
function render_header($header_content) {
global $theme_width, $userdata, $aidlink, $settings, $db_prefix;
echo "<table align='center' cellspacing='0' cellpadding='0' width='$theme_width' >
<tr>
<td>";
echo "<table cellpadding='0' cellspacing='0' width='870' align='center' >
<tr>
<td class='full-header'>
<div id='plotas'>
<div id='straipsniai-naujausi'>\n"; include THEME."straipsniai-naujausi.php"; echo "</div>
<div id='straipsniai-pop'>\n"; include THEME."straipsniai-pop.php"; echo "</div>
</div>
</td>
</tr>
</table>\n";
echo"<table cellpadding='0' cellspacing='0' width='275'>
<tr>
<td style='padding-bottom:0px; padding-top:20px; padding-left:40px;' >";
echo"</td>
</tr>
</table>
</td>
</tr>
</table>\n";
/*echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>
<td class='sub-header' align='center'>".showsublinks("","white")."</td>
</tr>
</table>\n";*/
echo "<table cellpadding='0' cellspacing='0' width='100%' class='sub-header'>
<tr>
<td align='left'><img src='".THEME."images/lt_big.gif' > Vartotojų: ".number_format(dbcount("(user_id)", "users", "user_status<='1'"))." Portale naršo: ".dbcount("(*)","online","")."(".dbcount("(*)","online","online_user = '0'")." )</td>
<td align='right' >".showsubdate()."</td>
</tr>
</table>\n";
echo "<table cellpadding='0' cellspacing='0' width='100%' class='virs-header'>
<tr>
<td align='left'> ";
if (iMEMBER) {
$msg_count = dbcount("(message_id)", "messages", "message_to='".$userdata['user_id']."' AND message_read='0'AND message_folder='0'");
if (iADMIN && (iUSER_RIGHTS != "" || iUSER_RIGHTS != "C")) {
echo "<a href='".ADMIN."".$aidlink."'></a>";
}
} else {
echo "
<form name='loginform' method='post' action='".FUSION_SELF."'>
<input type='text' name='user_name' class='textbox' style='height:16px; width:100px;' value='Vardas' onFocus=\"if(this.value=='Vardas'){this.value='';}\" onBlur=\"if(this.value==''){this.value='Vardas';}\">
<input type='password' name='user_pass' class='textbox' style='height:16px; width:100px;' value='Slaptažodis' onFocus=\"if(this.value=='Slaptažodis'){this.value='';}\" onBlur=\"if(this.value==''){this.value='Slaptažodis';}\">
<input type='submit' name='login' value='Prisijungti' class='button'>
<input type='checkbox' name='remember_me' value='y' title='Prisiminti' style='vertical-align:middle;'>
Prisiminti
[<a href='".BASEDIR."register.php' ><b> Registruotis</b></a> ] [ <a href='".BASEDIR."lostpassword.php' class='on'>Priminti slaptažodį </a>]
</form> \n";
}
echo"</td>
</tr>
</table>\n";
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
}
function render_footer($license=false) {
global $theme_width,$settings;
echo "</tr>\n</table>\n";
echo "<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td align='center' class='footer'>".stripslashes($settings['footer'])."<br>\n";
echo"</td>
</tr>
</table>
</td>
</tr>
</table>\n";
}
function render_news($subject, $news, $info) {
echo "<table cellpadding='0' cellspacing='0' width='100%' class='border-news'>
<tr>
<td class='capmain-news'>$subject <br><img src='".THEME."images/new.gif' width='575' height='5'><br>
<div style='color: #555; font-weight:normal; font-size:10px;'>Parašė <a href='profile.php?lookup=".$info['user_id']."'>".$info['user_name']."</a></div></td>
</tr>
<tr>
<td class='main-body'>$news</td>
</tr>
<tr>
<td align='right' class='news-footer'>\n";
echo "".($info['news_ext'] == "y" ? "<a href='news.php?readmore=".$info['news_id']."'>Plačiau</a>\n" : "")."";
if ($info['news_allow_comments'])
echo " Komentarų <a href='news.php?readmore=".$info['news_id']."'>[".$info['news_comments']."]</a> ";
echo "Skaitė <a href='news.php?readmore=".$info['news_id']."'>[".$info['news_reads']."]</a> ";
echo "</td>
</tr>
</table>\n";
}
function render_article($subject, $article, $info) {
echo "<table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td class='capmain'>$subject</td>
</tr>
<tr>
<td class='main-body'>
".($info['article_breaks'] == "y" ? nl2br($article) : $article)."
</td>
</tr>
<tr>
<td align='center' class='news-footer'>\n";
echo openform("A",$info['article_id']).articleposter($info," ·").articleopts($info,"·").closeform("A",$info['article_id']);
echo "</td>
</tr>
</table>\n";
}
function opentable($title) {
echo "<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td class='capmain'>$title</td>
</tr></table>
<table width='100%' cellpadding='0' cellspacing='0'><tr>
<td class='main-body'>\n";
}
function closetable() {
echo "</td>
</tr>
</table>\n";
}
function openside($title) {
echo "<table cellpadding='0' cellspacing='0' width='100%' >
<tr>
<td class='scapmain'>$title</td>
</tr>
<tr>
<td class='side-body'>\n";
}
function closeside() {
echo "</td></tr><tr><td background='".THEME."images/panel.gif' height='4'>";
echo "</td></tr></table>";
tablebreak();
}
function opensidenavigacija($title) {
echo "<table cellpadding='0' cellspacing='0' width='100%' >
<tr>
<td class='scapmain'>$title</td>
</tr>
<tr>
<td class='side-body-navigacija'>\n";
}
function closesidenavigacija() {
echo "</td></tr><tr><td background='".THEME."images/panel.gif' height='4'>";
echo "</td></tr></table>";
tablebreak();
}
function opensiden($title) {
echo "<table cellpadding='0' cellspacing='0' width='100%' >
<tr>
<td class='cs'>$title</td>
</tr>
<tr>
<td class='side-body'>\n";
}
function closesiden() {
echo "</td></tr><tr><td background='".THEME."images/panel.gif' height='4'>";
echo "</td></tr></table>";
tablebreak();
}
function opensidex($title,$state="on") {
$boxname = str_replace(" ", "", $title);
echo "<table cellpadding='0' cellspacing='0' width='100%' >
<tr>
<td class='scapmain'>$title</td>
<td class='scapmain' align='right'>".panelbutton($state,$boxname)."</td>
</tr>
<tr>
<td colspan='2' class='side-body'>
<div id='box_$boxname'".($state=="off"?" style='display:none'":"").">\n";
}
function closesidex() {
echo "</div>
</td>
</tr>
</table>\n";
tablebreak();
}
function tablebreak() {
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n<td height='5'></td>\n</tr>\n</table>\n";
}
?>
Pamokos Žaidėjui:
<?php
echo "<table width='100%'>
<tr>
<td width='33%'>";
$result = dbquery(
"SELECT ta.*,tac.* FROM ".$db_prefix."articles ta
INNER JOIN ".$db_prefix."article_cats tac ON ta.article_cat=tac.article_cat_id
WHERE ".groupaccess('article_cat_access')." ORDER BY article_datestamp DESC LIMIT 0,5"
);
if (dbrows($result) != 0) {
while($data = dbarray($result)) {
$itemsubject = trimlink($data['article_subject'], 23);
echo "<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."readarticle.php?article_id=".$data['article_id']."' title='".$data['article_subject']."' class='side'>$itemsubject</a><br>\n";
}
} else {
echo "<center>".$locale['004']."</center>\n";
}
echo "</tr>
</table>";
?>
Pamokos Serveriui:
<?php
echo "<table width='100%'>
<tr>
<td width='33%'>";
echo "<table width='100%'>
<tr>
<td width='33%'>";
$result = dbquery("SELECT * FROM ".$db_prefix."articles ORDER BY article_reads DESC LIMIT 0,5");
while($data = dbarray($result)) {
$itemsubject = trimlink($data['article_subject'], 23);
echo "<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."readarticle.php?article_id=2".$data['article_id']."' title='".$data['article_subject']."' class='side'>$itemsubject</a><br>\n";
}
if (dbrows($result) != 0) {
while($data = dbarray($result)) {
$itemsubject = trimlink($data['article_subject'], 23);
echo "<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."readarticle.php?article_id=2".$data['article_id']."' title='".$data['article_subject']."' class='side'>$itemsubject</a><br>\n";
}
} else {
echo "<center>".$locale['004']."</center>\n";
}
echo "</td>
<td width='33%'>";
echo "</tr>
</table>";
?>
Pamokos Serveriui nuoroda:
articles.php?cat_id=3
Pamokos Žaidėjui nuoroda:
articles.php?cat_id=2
Redagavo Styw0W· 2010 Rugs. 15 16:09:04