registrazione utente mentre inserisce un annuncio

Fabio90

Utente Attivo
29 Feb 2012
507
0
16
Buongiorno a tutti, per un sito di annunci che sto sviluppando ad un utente è consentito registrarsi mentre sta per pubblicare un annuncio per la prima volta oppure di autenticarsi.

Allo stato attuale (no.jpg) il tutto viene gestito con username e password e invece vorrei far in modo che il tutto venga gestito con email/password (si.jpg)

Questa è la parte del codice che gestisce il tutto (spero)



PHP:
<form action="<?php echo $target;?>" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data" onkeypress="return checkEnter(event)" onsubmit="return submitbutton(this)">
		<?php
		echo "<input type='hidden' name='category' value='$this->catid' />";
		?>
		<table border='0' id="adformtable">
		
		<?php
	  }
	  else
	  {
		?>
		</td></tr></table>
   		<form action="<?php echo $target;?>" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data" onsubmit="return submitbutton(this)">
   		<table border='0' id="adformtable">
   		<tr name='category'>
		<td colspan="2">
		<?php
		if (isset($this->content->catsid)) {
			$catids = $this->content->catsid;
		} else {
			$catids = array();
		}
		$nbcats = $this->conf->nbcats;
		if (function_exists("getMaxCats")) {
			$nbcats = getMaxCats($nbcats);
		}
		JHTMLAdsmanagerCategory::displayMultipleCategories("cats",$this->cats,$catids,array("root_allowed"=>$this->conf->root_allowed,"display_price"=>true),$nbcats);
		?>
		<?php 
	  	if (function_exists("displayPaidCat"))
	  	{
	  		displayPaidCat($this->conf->nbcats);
	  	}
	  	else
	  	{
	  		echo sprintf(JText::_('ADSMANAGER_NBCATS_LEGEND'),$this->conf->nbcats);
	  	}
	  	?></td></tr><?php 
	  }
	?>
	<!-- fields -->
	<?php
	if (($this->nbcats != 1) ||
		(($this->submit_allow == 1)&&( (!isset($this->catid))||($this->catid != 0) ) )
	   )
	{
		/* Submission_type == 0 -> Account Creation with ad posting */
		if ($this->account_creation == 1)
		{
			echo "<tr><td colspan='2'>".JText::_('ADSMANAGER_AUTOMATIC_ACCOUNT')."</td></tr>";
			echo "<tr><td>".JText::_('ADSMANAGER_UNAME')."</td>\n";
			if (isset($this->content->username))
			{
				$username = $this->content->username;
				$password = $this->content->password;
				$email = $this->content->email;
				$name = $this->content->name;
				$style = 'style="background-color:#ff0000"';
			}
			else
			{
				$username = "";
				$password = "";
				$email = "";
				$name =  "";
				$style = "";
			}
								
			if (isset($this->content->firstname))
				$firstname = $this->content->firstname;
			else
				$firstname = "";
			
			if (isset($this->content->middlename))
				$middlename = $this->content->middlename;
			else
				$middlename = "";
			
			if (COMMUNITY_BUILDER == 1)
			{
				include_once( JPATH_BASE .'/administrator/components/com_comprofiler/ue_config.php' );
				$namestyle = $ueConfig['name_style'];
			}
			else
				$namestyle = 1;
				
			echo "<td><input $style class='adsmanager_required' mosReq='1' id='username' type='text' mosLabel='".htmlspecialchars(JText::_('ADSMANAGER_UNAME'),ENT_QUOTES)."' name='username' size='20' maxlength='255' value='$username' /></td></tr>\n"; 
			
			echo "<tr><td>".JText::_('ADSMANAGER_PASSWORD')."</td>\n";
			echo "<td><input $style class='adsmanager_required' mosReq='1' id='password' type='password' mosLabel='".htmlspecialchars(JText::_('ADSMANAGER_PASS'),ENT_QUOTES)."' name='password' size='20' maxlength='255' value='$password' />\n</td></tr>"; 
			$emailField = false;
			$nameField = false;
			foreach($this->fields as $field) 
			{
				if (($field->name == "email")&&((strpos($field->catsid, ",$this->catid,") !== false)||(strpos($field->catsid, ",-1,") !== false)))
				{
					$emailField = true;
					// Force required 
					$field->required = 1;
				}
				else if (($field->name == "name")&&((strpos($field->catsid, ",$this->catid,") !== false)||(strpos($field->catsid, ",-1,") !== false)))
				{
					$nameField = true;
					// Force required 
					$field->required = 1;
				}
				else if (($namestyle >= 2)&&($field->name == "firstname")&&((strpos($field->catsid, ",$this->catid,") !== false)||(strpos($field->catsid, ",-1,") !== false)))
				{
					$firstnameField = true;
					// Force required 
					$field->required = 1;
				}
				else if( ($namestyle == 3)&&($field->name == "middlename")&&((strpos($field->catsid, ",$this->catid,") !== false)||(strpos($field->catsid, ",-1,") !== false)))
				{
					$middlenameField = true;
					// Force required 
					$field->required = 1;
				}			
			}
			if (($namestyle >= 2)&&($firstnameField == false))
			{
				echo "<tr><td>".JText::_('ADSMANAGER_FNAME')."</td>\n";
				echo "<td><input $style class='adsmanager_required' mosReq='1' id='firstname' type='text' mosLabel='".htmlspecialchars(JText::_('ADSMANAGER_FNAME'),ENT_QUOTES)."' name='firstname' size='20' maxlength='255' value='$firstname' /></td></tr>\n"; 
			}
			if ( ($namestyle == 3)&&($middlenameField == false))
			{
				echo "<tr><td>".JText::_('ADSMANAGER_MNAME')."</td>\n";
				echo "<td><input $style class='adsmanager_required' mosReq='1' id='middlename' type='text' mosLabel='".htmlspecialchars(JText::_('ADSMANAGER_MNAME'),ENT_QUOTES)."' name='middlename' size='20' maxlength='255' value='$middlename' /></td></tr>\n"; 
			}
			if ($nameField == false)
			{
				echo "<tr><td>".JText::_('ADSMANAGER_FORM_NAME')."</td>\n";
				echo "<td><input $style class='adsmanager_required' mosReq='1' id='name' type='text' mosLabel='".htmlspecialchars(JText::_('_NAME'),ENT_QUOTES)."' name='name' size='20' maxlength='255' value='$name' /></td></tr>\n"; 
			}
			if ($emailField == false)
			{
				echo "<tr><td>".JText::_('ADSMANAGER_FORM_EMAIL')."</td>\n";
				echo "<td><input $style class='adsmanager_required' mosReq='1' id='email' type='text' mosLabel='".htmlspecialchars(JText::_('_EMAIL'),ENT_QUOTES)."' name='email' size='20' maxlength='255' value='$email' /></td></tr>\n"; 
			}
		}
		
		/* Display Fields */
		foreach($this->fields as $field)
		{
			if (@$field->options->edit_admin_only == 0) {
				$fieldform = $this->field->showFieldForm($field,$this->content,$this->default);
				if ($fieldform != "") {
					echo "<tr id=\"tr_{$field->name}\"><td>".$this->field->showFieldLabel($field,$this->content,$this->default)."</td>\n";
					echo "<td>".$fieldform."</td></tr>\n";
				}
			} 
		}

Potreste aiutarmi su come poter modificare il codice?

Grazie!
 

Allegati

  • no.jpg
    no.jpg
    43,1 KB · Visite: 257
  • si.jpg
    si.jpg
    43,6 KB · Visite: 219
Discussioni simili
Autore Titolo Forum Risposte Data
R Plugin per Registrazione Utente e Pagamento prodotto WordPress 2
G Registrazione utente su pagina asp Classic ASP 14
R Obbligare all'utente un pagamento al momento della registrazione PHP 3
A [PHP] registrazione utente in un database sql con confronto PHP 1
A [PHP] Controllo nome utente form di registrazione PHP 4
X__WELBO__X [css] form registrazione utente HTML e CSS 9
M Creazione sito con autenticazione utente (registrazione) PHP 3
D Problema script registrazione utente php mysql PHP 14
C Cancellazione-Annulla Registrazione Dati appena Inseriti nel Form dall' Utente PHP 13
T La registrazione non mi segna un nuovo utente sul database PHP 2
M Registrazione Utente-Login Flash 1
G pagina registrazione utente Classic ASP 5
S Registrazione immediata utente Classic ASP 2
D Aiuto per registrazione utente PHP 0
zorro modulo di registrazione: funziona ma non sempre PHP 2
T Modificare ruolo utenti in fase di registrazione E-Commerce 0
F [PHP]Errore registrazione PHP 8
E Problemi in registrazione telecamere Dahua IP Cam e Videosorveglianza 6
Tommy03 Generare file PHP dopo registrazione PHP 2
G [PHP] Revisione codice per registrazione PHP 8
B Data Registrazione Dominio Domini 1
B [PHP] Mail di Avvenuta registrazione PHP 4
S registrazione video su dvr in caso di rilevamento di movimento IP Cam e Videosorveglianza 12
Laskot [Javascript] Registrazione e salvataggio utenti in LocalStorage Javascript 8
V Domande: registrazione sito fonti esterne SEO e Posizionamento 0
M registrazione in relazione ai commenti Programmazione 0
damiano.f [PHP] variabili su immagine e registrazione dati su db PHP 0
marino51 problema con registrazione al forum Supporto Mr.Webmaster 4
L [PHP] Registrazione/Logina la psw deve contenere.. PHP 3
G [WordPress] Redirect dopo registrazione WordPress 0
ANDREA20 [PHP] problema registrazione PHP 50
P [PHP] come criptare una password in un form di registrazione PHP 4
S Vecchio articolo registrazione utenti, errore MySQL PHP 2
M Sito "e-commerce", stampare dati di registrazione e dati dell'acquisto da pagine diverse PHP 7
S appinventor, aggiungere tasto registrazione Sviluppo app per Android 1
M problema registrazione nuovi utenti su pagine asp Classic ASP 1
S email di registrazione e Plugin WP Mail SMTP WordPress 0
F form registrazione PHP 3
F Codic e php visibile su form registrazione utenti PHP 2
matteoraggi Contratto per registrazione domini internet e servizio di hosting Domini 1
L errore mysql per form di registrazione PHP 3
D Form Registrazione con conferma via email - problema PHP 10
M problema mostrare data di registrazione formattata in italiano PHP 8
P Problema con file di registrazione in php, non funziona e dà continui errori PHP 0
M pagina registrazione con mail contenente link di attivazione profilo PHP 1
felino [Wordpress] Plugin iscrizione / registrazione WordPress 1
M Problema con modulo registrazione e inserimento dati in database PHP 8
I Registrazione con Ajax Ajax 1
L Form di registrazione e log in. PHP 2
I Parte di una registrazione con ajax Javascript 1

Discussioni simili