Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Prisijungimo panelė + kodas.

Parašė Kovalskis77· 2014 Lap. 12 23:11:36
#1

Laba diena,

Turiu prisijungimo panelę. Ją patalpinu tarkim svetainės viduryje ( Centre ) . Viskas veikia, rodo prisijungimo laukelį, tačiau prisijungus atsiranda viduryje ( Centre ) " Profilio/Vartotojo laukelis ", kaip padaryti, kad panelė būtų pritaikyta tik prisijungimui, o prisijungus nerodytų ir neatsirastu profilio laukelio ? Tiesiog prisijungi, dingsta prisijungimo laukas ir neatsiranda profilio laukelis.

Štai kodas, bandžiau žaistis su " if (iMEMBER) { " laukeliais, tačiau be klaidų išmėtimo nelabai pavyko priartėti prie tikslo


 
<?php
/*-------------------------------------------------------+
| <span style="border-bottom: 1px dotted black;">PHP</span>-Fusion Content Management System
| Copyright © 2002 - 2012 Nick Jones
| <a href='http://www.php-fusion.co.uk/' target='_blank'><span style='color:005C5B'>http://www.php-fusion.co.uk/</span></a>
+--------------------------------------------------------+
| Filename: lbdw_panel.php
| Version: 1.0
| Author: jikaka
| Site: <a href='http://www.rusfusion.ru' target='_blank'><span style='color:005C5B'>www.rusfusion.ru</span></a>
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at <a href='http://www.gnu.org/licenses/agpl.html.' target='_blank'><span style='color:005C5B'>www.gnu.org/licenses/agpl.html.</span></a> Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
 
if (file_exists(INFUSIONS."lbdw_panel/locale/".$settings['locale'].".php")) {
	include INFUSIONS."lbdw_panel/locale/".$settings['locale'].".php";
} else {
	include INFUSIONS."lbdw_panel/locale/English.php";
}
 
add_to_head("
<link type='text/css' href='".INFUSIONS."lbdw_panel/css/styles.css' media='screen' rel='stylesheet' />
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'></script>
<script src='".INFUSIONS."lbdw_panel/js/scripts.js' type='text/javascript'></script>
");
 
 
 
if (iMEMBER) {
	$msg_count = dbcount("(message_id)", DB_MESSAGES, "message_to='".$userdata['user_id']."' AND message_read='0' AND message_folder='0'");
 
	openside($userdata['user_name']);
	echo THEME_BULLET." <a href='".BASEDIR."edit_profile.php' class='side'>".$locale['global_120']."</a><br />\n";
	echo THEME_BULLET." <a href='".BASEDIR."messages.php' class='side'>".$locale['global_121']."</a><br />\n";
	echo THEME_BULLET." <a href='".BASEDIR."members.php' class='side'>".$locale['global_122']."</a><br />\n";
 
	if (iADMIN && (iUSER_RIGHTS != "" || iUSER_RIGHTS != "C")) {
		echo THEME_BULLET." <a href='".ADMIN."index.php".$aidlink."' class='side'>".$locale['global_123']."</a><br />\n";
	}
 
	echo THEME_BULLET." <a href='".BASEDIR."index.php?logout=yes' class='side'>".$locale['global_124']."</a>\n";
 
	if ($msg_count) {
		echo "<div style='text-align:center;margin-top:15px;'>\n";
		echo "<strong><a href='".BASEDIR."messages.php' class='side'>".sprintf($locale['global_125'], $msg_count);
		echo ($msg_count == 1 ? $locale['global_126'] : $locale['global_127'])."</a></strong>\n";
		echo "</div>\n";
	}
 
	if (iADMIN && checkrights("SU")) {
		$subm_count = dbcount("(submit_id)", DB_SUBMISSIONS);
 
		if ($subm_count) {
			echo "<div style='text-align:center;margin-top:15px;'>\n";
			echo "<strong><a href='".ADMIN."submissions.php".$aidlink."' class='side'>".sprintf($locale['global_125'], $subm_count);
			echo ($subm_count == 1 ? $locale['global_128'] : $locale['global_129'])."</a></strong>\n";
			echo "</div>\n";
		}
	}
	closeside();
 
} else {
	if (!preg_match('/login.php/i',FUSION_SELF)) {
		$action_url = FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : "");
		if (isset($_GET['redirect']) && strstr($_GET['redirect'], "/")) {
			$action_url = cleanurl(urldecode($_GET['redirect']));
		}
 
		openside($locale['lbdw001']);
		echo "<div class='btn-sign'><a href='#login-box' class='login-window'>".$locale['lbdw002']."</a></div>\n";
		echo "<div id='login-box' class='login-popup'>\n";
		echo "<a href='#' class='close'><img src='".INFUSIONS."lbdw_panel/images/close_pop.png' class='btn_close' title='".$locale['lbdw003']."' alt='".$locale['lbdw004']."' /></a>\n";
		echo "<form method='post' name='loginform' class='signin' action='".$action_url."'>\n";
		echo "<fieldset class='box'>\n";
		echo "<label class='username'>\n";
		echo "<span>".$locale['lbdw005']."</span>\n";
		echo "<input id='username' name='user_name' value='' type='text' autocomplete='on' placeholder='".$locale['lbdw005']."'>\n";
		echo "</label>\n";
		echo "<label class='password'>\n";
		echo "<span>".$locale['lbdw006']."</span>\n";
		echo "<input id='password' name='user_pass' value='' type='password' placeholder='".$locale['lbdw006']."'>\n";
		echo "</label>\n";
		echo "<button class='submit button-popup' name='login' type='submit'>".$locale['lbdw007']."</button>\n";
		echo "<p><a class='forgot' href='".BASEDIR."lostpassword.php'>".$locale['lbdw008']."</a></p>\n";
		echo "<p><a class='reg' href='".BASEDIR."register.php'>".$locale['lbdw009']."</a></p>\n";
		echo "</fieldset>\n";
		echo "</form>\n";
		echo "</div>\n";
		closeside();
	}
}
?>

Redagavo Kovalskis77· 2014 Lap. 13 00:11:50

Parašė WhiZz· 2014 Lap. 13 02:11:54
#2

Isidek ir gausi ko tau reikia

Rodoma prisijungus:


if(iMEMBER) {
echo "Si teksta mato narys";
}


Rodoma neprisijungus:


if(!iMEMBER) {
echo "Si teksta mato svecias arba atsijunges/neprisijunges narys";
}

Redagavo WhiZz· 2014 Lap. 13 02:11:03

Parašė Kovalskis77· 2014 Lap. 13 03:11:38
#3

Nelabai supratau, abu variantai tokie patys ( if(!iMEMBER) { ), tačiau kartu ir skirtingai turi rodyti ? Kaip tai padaryti su šiuo kodu ? Aš ta prasme suprantu, kad rodys " Šį tekstą mato tas ar tas " priklausant nuo prisijungęs ar ne, tačiau kaip padaryti su šiuo kodu, kad nerodytų profilio laukelio ? Ką ir kaip pašalinti reikėtų ? Pabandant pašalinti ar pakoreguoti lauką su kreivomis rankomis if(!iMEMBER) dažniausiai susigadina puslapis.


if (iMEMBER) {
 
	$msg_count = dbcount("(message_id)", DB_MESSAGES, "message_to='".$userdata['user_id']."' AND message_read='0' AND message_folder='0'");
 
 
 
	openside($userdata['user_name']);
 
	echo THEME_BULLET." <a href='".BASEDIR."edit_profile.php' class='side'>".$locale['global_120']."</a><br />\n";
 
	echo THEME_BULLET." <a href='".BASEDIR."messages.php' class='side'>".$locale['global_121']."</a><br />\n";
 
	echo THEME_BULLET." <a href='".BASEDIR."members.php' class='side'>".$locale['global_122']."</a><br />\n";
 
 
 
	if (iADMIN && (iUSER_RIGHTS != "" || iUSER_RIGHTS != "C")) {
 
		echo THEME_BULLET." <a href='".ADMIN."index.php".$aidlink."' class='side'>".$locale['global_123']."</a><br />\n";
 
	}
 
 
 
	echo THEME_BULLET." <a href='".BASEDIR."index.php?logout=yes' class='side'>".$locale['global_124']."</a>\n";
 
 
 
	if ($msg_count) {
 
		echo "<div style='text-align:center;margin-top:15px;'>\n";
 
		echo "<strong><a href='".BASEDIR."messages.php' class='side'>".sprintf($locale['global_125'], $msg_count);
 
		echo ($msg_count == 1 ? $locale['global_126'] : $locale['global_127'])."</a></strong>\n";
 
		echo "</div>\n";
 
	}
 
 
 
	if (iADMIN && checkrights("SU")) {
 
		$subm_count = dbcount("(submit_id)", DB_SUBMISSIONS);
 
 
 
		if ($subm_count) {
 
			echo "<div style='text-align:center;margin-top:15px;'>\n";
 
			echo "<strong><a href='".ADMIN."submissions.php".$aidlink."' class='side'>".sprintf($locale['global_125'], $subm_count);
 
			echo ($subm_count == 1 ? $locale['global_128'] : $locale['global_129'])."</a></strong>\n";
 
			echo "</div>\n";
 
		}
 
	}
 
	closeside();

Redagavo Kovalskis77· 2014 Lap. 13 03:11:17

Parašė Kovalskis77· 2014 Lap. 13 11:11:41
#4

Ačiū už pagalbą! Susitvarkiau :)

Parašė MindasTU· 2014 Lap. 13 18:11:28
#5

Kokiame čia faile rasti būtų galima ?