Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: User_info

Parašė kLx· 2008 Geg. 17 12:05:52
#1

Sveiki.
Krč ,visiškai susibotinau. Negaliu sutvarkyt mažytės klaidelės. Gal jums pavyks, nes bandau tai sutvarkyt gal jau pusantros valandos. Tai va ,problema čia : neprisijungus vistiek rodo avatarą "Neturi avataro ,įsidėk". Va foto : http://www.part.lt/img/f056d5409...b53878.jpg
Theme.php :
<?php
if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }
require_once INCLUDES."theme_functions_include.php";

// theme settings
$body_text = "#C0B5B3";
$body_bg = "#F7F7EF";
$theme_width = "715";
$theme_width_l = "220";
$theme_width_r = "220";

function render_header($header_content) {

global $theme_width,$settings,$db_prefix,$locale,$data,$userdata,$user_data,$poll_id,$voteoption,$poll_option,$itemsubject,$aidlink;

echo "<table align='center' cellspacing='0' cellpadding='0' width='$theme_width'>
<tr>
<td>
<table cellpadding='0' cellspacing='0' width='100%' class='navigation'>
<tr><td class='header'><img src='".THEME."logo.png'></td></tr>
</table>
<table cellpadding='0' cellspacing='0' width='100%' class='navigation'>
<tr>
<td align='center'>".showsublinks("","white")."</td>
</tr>
</table>\n";

echo "<table cellpadding='0' cellspacing='0' width='330'>\n<tr>
<td class='line'><marquee scrollamount='1' scrolldelay='50' onmouseover='this.stop()' onmouseout='this.start()'>".stripslashes($settings['description'])."</marquee</td>
</tr>
</table>\n";

echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>
<td class='sub'></td>
</tr>
</table>\n";

echo "<table cellpadding='0' cellspacing='0' width='$theme_width' class='paneles'>\n<tr>
<td align='left' width='120'>";
include THEME."user_info_panel.php";
echo "</td>
<td align='center' width='97'><br><br>";
echo ($userdata['user_avatar'] ? "<img src='".IMAGES."avatars/".$userdata['user_avatar']."' width='70' height='70'></center><br>\n" : "<center><a href='".BASEDIR."edit_profile.php'><img src='".THEME."images/avatar.gif' border='0' width='70' height='70'></a></center>\n")."";
echo "</td>
<td align='center' width='306'>";
include THEME."forum_threads_panel.php";
echo "</td>
<td align='center' width='195'>";
include THEME."member_poll_panel.php";
echo "</td>
</tr>
</table><br>\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 align='center' cellpadding='0' cellspacing='0' width='$theme_width' class='footer'>
<tr>
<td width='92'><a href='news.php?readmore=".$info['news_id']."' style='color:#000;'>PHP-Fusion</a> </td>
<td width='530'> ".stripslashes($settings['footer'])."</td>
<td width='93'><img src='".THEME."images/made_by.png'>&nbsp;&nbsp;<a href='http://www.emotive.in/' target='_blank'><img src='".THEME."images/emotive.png' border='0'></a></td>
</tr>
</table>
</td>
</tr>
</table>\n";

}

function render_news($subject, $news, $info) {

global $aidlink,$item_type;
$res = "";

echo "<table align='center' cellpadding='0' cellspacing='0' width='485'>
<tr>
<td class='capmain'>$subject<br><span style='font-size : 10px;font-weight : normal;'>parašė: <a href='profile.php?lookup=".$info['user_id']."' style='color:#EBE2D1;'>".$info['user_name']."</a>, ".showdate("shortdate", $info['news_date'])."</span></td>
</tr>
<tr>
<td class='main-body'>$news</td>
</tr>
<tr>
<form name='editnews".$info['news_id']."' method='post' action='".ADMIN."news.php".$aidlink."&amp;news_id=".$info['news_id']."'>
<td align='right' class='news-footer'>komentarų: ".$info['news_comments']." - <a href='news.php?readmore=".$info['news_id']."' style='color:#E6DED1;'>žiūrėti</a> ";
    if (iADMIN && checkrights(N)) {
echo "- <input type='hidden' name='edit' value='edit'><a href='javascript:document.editnews".$info['news_id'].".submit();' style='color:#E6DED1;'>redaguoti</a>";
}
echo "</td>
</form>
</tr>
</table>\n";

}

function render_article($subject, $article, $info) {

global $aidlink,$item_type;
$res = "";
   
echo "<table align='center' cellpadding='0' cellspacing='0' width='485'>
<tr>
<td class='capmain'>$subject<br><span style='font-size : 10px;font-weight : normal;'>parašė: <a href='profile.php?lookup=".$info['user_id']."' style='color:#EBE2D1;'>".$info['user_name']."</a>, ".showdate("shortdate", $info['article_date'])."</span></td>
</tr>
<tr>
<td class='main-body'>
".($info['article_breaks'] == "y" ? nl2br($article) : $article)."
</td>
</tr>
<tr>
<form name='editarticle".$item_id."' method='post' action='".ADMIN."articles.php".$aidlink."&amp;article_id=".$item_id."'>
<td class='news-footer'>komentarų: ".$info['article_comments']." - <a href='print.php?type=A&amp;item_id=".$info['article_id']."' style='color:#E6DED1;'>spausdinti</a> ";
    if (iADMIN && checkrights(A)) {
echo "- <input type='hidden' name='edit' value='edit'><a href='javascript:document.editarticle".$info['articles_id'].".submit();' style='color:#E6DED1;'>redaguoti</a>";
}

echo "</td>
</form>
</tr>
</table>\n";

}

function opentable($title) {

echo "<table align='center' cellpadding='0' cellspacing='0' width='485'>
<tr>
<td class='capmain'>$title</td>
</tr>
<tr>
<td class='main-body'>\n";

}

function closetable() {

echo "</td>
</tr>
<td align='center' class='news-footer'></td>
</table>\n";

}

function openside($title) {
   
echo "<table align='center' cellpadding='0' cellspacing='0' width='220'>
<tr>
<td class='scapmain'>$title</td>
</tr>
<tr>
<td class='side-body'>\n";

}

function closeside() {

echo "</td>
</tr>
<tr><td><img src='".THEME."images/scapmain_bot.gif'></td></tr>
</table>\n";
tablebreak();

}

function openside_header($title) {
   
echo "<table align='center' cellpadding='0' cellspacing='0'>
<tr>
<td class='side-body-header'>\n";

}

function closeside_header() {

echo "</td>
</tr>
</table>\n";
tablebreak();

}

function opensidex($title,$state="on") {

$boxname = str_replace(" ", "", $title);
echo "<table align='center' cellpadding='0' cellspacing='0' width='220'>
<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>
<tr><td><img src='".THEME."images/scapmain_bot.gif'></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";

}
?>




Ir dar iš tos pačios temos user_info_panel.php.
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }

if (iMEMBER) {
   openside_header($userdata['user_name']);
   $msg_count = dbcount("(message_id)", "messages", "message_to='".$userdata['user_id']."' AND message_read='0'AND message_folder='0'");
echo "<br><br><br><img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."profile.php?lookup=".$userdata['user_id']."' class='side'>Profilis</a><br>
<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."edit_profile.php' class='side'>Aprašymas</a><br>
<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."messages.php' class='side'>Žinutės</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'>Atsijungti</a>\n";
   if ($msg_count) echo "<br><br><center><b><a href='".BASEDIR."messages.php' class='side'>Gavote $msg_count naują žinutę!</a></b></center>\n";
} else {
   openside($locale['060']);
   echo "<div align='center'>".(isset($loginerror) ? $loginerror : "")."
<form name='loginform' method='post' action='".FUSION_SELF."'>
Vardas: <input type='text' name='user_name' class='textbox' style='width:100px'><br>
Slaptažodis: <input type='password' name='user_pass' class='textbox' style='width:100px'><br>
<input type='checkbox' name='remember_me' value='y' title='Atsiminti slaptažodį?' style='vertical-align:middle;'> - prisiminti?<br>
<input type='submit' name='login' value='Jungtis' class='button'><br>
</form>
<br>\n";
   if ($settings['enable_registration']) {
      echo "<a href='".BASEDIR."register.php' class='side'><b>Registruokis!</b></a>\n";
   }
   echo "<a href='".BASEDIR."lostpassword.php' class='side'><br><b>Slaptažodis?</b></a>
</div>\n";
}
closeside_header();
?>



Parašė Dandžu· 2008 Geg. 17 12:05:43
#2

Tai čia sudėk kodą if iguest ir ką jam ten rašytų. O paskui else if imember ir tada jog nariui rodytų avatarą nesudėtinga.

Parašė kLx· 2008 Geg. 17 12:05:25
#3

Dėkui ,kažkaip iš pradžių nesusigaudžiau ,dariau su if (iMEMEBER) ,ir po avataro kodo iš karto su else ,bet kai padariau atskirai member ir guest viskas gerai ,dėkui Sharkman.