Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Register.php

Parašė Altarietis· 2012 Kov. 13 15:03:02
#1

Gal galetumete padeti su registracija puslapyje? Problema:"
Dabar kai paspaudi registruotis puslapyje, praso pirmiausia ivesti passworda, paskui nicka ir email ir t.t.
As noreciau padaryti taip kad pirmiausia prasytu nicko, email pasw, ir t.t.
Koki faila reiktu redaguoti?

Parašė MDSidabras· 2012 Kov. 13 15:03:45
#2

Register.php įkelk čia.

Parašė Altarietis· 2012 Kov. 13 15:03:43
#3


?php
/*-------------------------------------------------------+
| <span style="border-bottom: 1px dotted black;">PHP</span>-Fusion Content Management System
| Copyright (C) 2002 - 2011 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: register.php
| Author: Hans Kristian Flaatten {Starefossen}
+--------------------------------------------------------+
| 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).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
require_once CLASSES."UserFields.class.php";
require_once CLASSES."UserFieldsInput.class.php";
include LOCALE.LOCALESET."user_fields.php";
 
if (iMEMBER || !$settings['enable_registration']) { redirect("index.php"); }
 
$errors = array();
if (isset($_GET['email']) && isset($_GET['code'])) {
	if (!preg_check("/^[-0-9A-Z_\.]{1,50}@([-0-9A-Z_\.]+\.){1,50}([0-9A-Z]){2,4}$/i", $_GET['email'])) {
		redirect("register.php?error=activate");
	}
	if (!preg_check("/^[0-9a-z]{40}$/", $_GET['code'])) { redirect("register.php?error=activate"); }
	$result = dbquery(
		"SELECT user_info FROM ".DB_NEW_USERS."
		WHERE user_code='".$_GET['code']."' AND user_email='".$_GET['email']."'
		LIMIT 1"
	);
	if (dbrows($result)) {
		add_to_title($locale['global_200'].$locale['u155']);
 
		// getmequick at gmail dot com
		// <a href='http://www.php.net/manual/en/function.unserialize.php#71270' target='_blank'><span style='color:005C5B'>http://www.php.net/manual/en/fun....php#71270</span></a>
		function unserializeFix($var) {
			$var = preg_replace('!s:(\d+):"(.*?)";!e', "'s:'.strlen('$2').':\"$2\";'", $var);
			return unserialize($var);
		}
 
		$data = dbarray($result);
		$user_info = unserializeFix(stripslashes($data['user_info']));
		$result = dbquery("INSERT INTO ".DB_USERS." (".$user_info['user_field_fields'].") VALUES (".$user_info['user_field_inputs'].")");
		$result = dbquery("DELETE FROM ".DB_NEW_USERS." WHERE user_code='".$_GET['code']."' LIMIT 1");
 
		opentable($locale['u155']);
		if ($settings['admin_activation'] == "1") {
			echo "<div style='text-align:center'><br />\n".$locale['u171']."<br /><br />\n".$locale['u162']."<br /><br />\n</div>\n";
		} else {
			echo "<div style='text-align:center'><br />\n".$locale['u171']."<br /><br />\n".$locale['u161']."<br /><br />\n</div>\n";
		}
		closetable();
	} else {
		redirect("index.php");
	}
} elseif (isset($_POST['register'])) {
	$userInput = new UserFieldsInput();
	$userInput->validation 				= $settings['display_validation'];
	$userInput->emailVerification 		= $settings['email_verification'];
	$userInput->adminActivation 		= $settings['admin_activation'];
	$userInput->skipCurrentPass 		= true;
	$userInput->registration			= true;
	$userInput->saveInsert();
	$userInput->displayMessages();
	$errors 							= $userInput->getErrorsArray();
	unset($userInput);
}
 
if ((!isset($_POST['register']) && !isset($_GET['code'])) || (isset($_POST['register']) && count($errors) > 0)) {
	opentable($locale['u101']);
	$userFields 						= new UserFields();
	$userFields->postName 				= "register";
	$userFields->postValue 				= $locale['u101'];
	$userFields->displayValidation 		= $settings['display_validation'];
	$userFields->displayTerms 			= $settings['enable_terms'];
	$userFields->showAdminPass 			= false;
	$userFields->showAvatarInput 		= false;
	$userFields->skipCurrentPass 		= true;
	$userFields->registration			= true;
	$userFields->errorsArray 			= $errors;
	$userFields->displayInput();
	closetable();
}
 
require_once THEMES."templates/footer.php";
?>

Redagavo MaFetas· 2012 Kov. 13 15:03:28

Parašė kyprum· 2012 Kov. 13 16:03:53
#4


<?php
/*-------------------------------------------------------+
| <span style="border-bottom: 1px dotted black;">PHP</span>-Fusion Content Management System
| Copyright (C) 2002 - 2011 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: register.php
| Author: Hans Kristian Flaatten {Starefossen}
+--------------------------------------------------------+
| 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).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
require_once CLASSES."UserFields.class.php";
require_once CLASSES."UserFieldsInput.class.php";
include LOCALE.LOCALESET."user_fields.php";
 
if (iMEMBER || !$settings['enable_registration']) { redirect("index.php"); }
 
$errors = array();
if (isset($_GET['email']) && isset($_GET['code'])) {
	if (!preg_check("/^[-0-9A-Z_\.]{1,50}@([-0-9A-Z_\.]+\.){1,50}([0-9A-Z]){2,4}$/i", $_GET['email'])) {
		redirect("register.php?error=activate");
	}
	if (!preg_check("/^[0-9a-z]{40}$/", $_GET['code'])) { redirect("register.php?error=activate"); }
	$result = dbquery(
		"SELECT user_info FROM ".DB_NEW_USERS."
		WHERE user_code='".$_GET['code']."' AND user_email='".$_GET['email']."'
		LIMIT 1"
	);
	if (dbrows($result)) {
		add_to_title($locale['global_200'].$locale['u155']);
 
		// getmequick at gmail dot com
		// <a href='http://www.php.net/manual/en/function.unserialize.php#71270' target='_blank'><span style='color:005C5B'>http://www.php.net/manual/en/fun....php#71270</span></a>
		function unserializeFix($var) {
			$var = preg_replace('!s:(\d+):"(.*?)";!e', "'s:'.strlen('$2').':\"$2\";'", $var);
			return unserialize($var);
		}
 
		$data = dbarray($result);
		$user_info = unserializeFix(stripslashes($data['user_info']));
		$result = dbquery("INSERT INTO ".DB_USERS." (".$user_info['user_field_fields'].") VALUES (".$user_info['user_field_inputs'].")");
		$result = dbquery("DELETE FROM ".DB_NEW_USERS." WHERE user_code='".$_GET['code']."' LIMIT 1");
 
		opentable($locale['u155']);
		if ($settings['admin_activation'] == "1") {
			echo "<div style='text-align:center'><br />\n".$locale['u171']."<br /><br />\n".$locale['u162']."<br /><br />\n</div>\n";
		} else {
			echo "<div style='text-align:center'><br />\n".$locale['u171']."<br /><br />\n".$locale['u161']."<br /><br />\n</div>\n";
		}
		closetable();
	} else {
		redirect("index.php");
	}
} elseif (isset($_POST['register'])) {
	$userInput = new UserFieldsInput();
	$userInput->validation 				= $settings['display_validation'];
	$userInput->emailVerification 		= $settings['email_verification'];
	$userInput->adminActivation 		= $settings['admin_activation'];
	$userInput->skipCurrentPass 		= true;
	$userInput->registration			= true;
	$userInput->saveInsert();
	$userInput->displayMessages();
	$errors 							= $userInput->getErrorsArray();
	unset($userInput);
}
 
if ((!isset($_POST['register']) && !isset($_GET['code'])) || (isset($_POST['register']) && count($errors) > 0)) {
	opentable($locale['u101']);
	$userFields 						= new UserFields();
	$userFields->postName 				= "register";
	$userFields->postValue 				= $locale['u101'];
	$userFields->displayValidation 		= $settings['display_validation'];
	$userFields->displayTerms 			= $settings['enable_terms'];
	$userFields->showAdminPass 			= false;
	$userFields->showAvatarInput 		= false;
	$userFields->skipCurrentPass 		= true;
	$userFields->registration			= true;
	$userFields->errorsArray 			= $errors;
	$userFields->displayInput();
	closetable();
}
 
require_once THEMES."templates/footer.php";
?>


va tau ir kodas registracijos geras.

Parašė Altarietis· 2012 Kov. 13 19:03:52
#5

Tai jis man ir anksciau buvo geras, ziurek ka as noriu padaryti:


Redagavo Altarietis· 2012 Kov. 13 19:03:33

Parašė Altarietis· 2012 Kov. 15 08:03:44
#6

tai ar galit padeti gi bl...

Parašė kyprum· 2012 Kov. 15 13:03:14
#7

Nesikeik. Ir šiaip kam toks dalykas? Kas iš to jei pirma reikės nustatyti paskyros nustatymus o poto prisijungimo. Nelabai matau čia kažką gražesnio ir geresnio.

Parašė Altarietis· 2012 Kov. 15 14:03:24
#8

Principo reikalas :D nu juk neturetu buti sunku :)...

Parašė kyprum· 2012 Kov. 15 14:03:44
#9

Viskas code yra bandyk pats keist vietomis eilutes.

Parašė Altarietis· 2012 Kov. 15 14:03:05
#10

Sunku pasakyt? Apkeiciu eilute su betkokia kita ir isvis tada nebeieinu i register, errora meta, jau atsibodo keitineti :/ :D

Parašė Altarietis· 2012 Kov. 15 19:03:26
#11

Jei gali paziurek gal suredaguotu rasi google parsisiusti tu register.php, as radau viena, bet ten register atidaro kaip visiskai nauja puslapi, kuris yra visiskai nugrybaves nuo puslapio temos, ir kai bandziau registruotis, meta visokius errorus, tai todel netiko :)