- Home
- Categorie
- Coding e Sistemistica
- CMS & Piattaforme Self-Hosted
- Problema Sobi2 e vista dettagliata scheda
-
Problema Sobi2 e vista dettagliata scheda
Salve! sono nuovo e per prima cosa buon giorno!
Il mio problema è questo : ho installato sobi2 con tutti i suoi moduli e plugin (ok).
Ho inserito le schede (OK), nascondendo il campo email e creando un form di contatto come è possibile inviare la richiesta al diretto interessato senza che venga inviata all'amministratore del sito ?
allego i 2 sorgenti che mi son stati suggeriti dal forum di sobi2:file : custom.functions.php (/com_sobi2/includes/inc)
defined( '_SOBI2_' ) || defined( '_VALID_MOS' ) || ( trigger_error("Restricted access", E_USER_ERROR) && exit() ); ?> <?php function InsertScript( $title, $listingemail, $adminemail, $sobiItemID, $sobiCatID ){ if ($_POST){ $session =& JFactory::getSession(); if ($_POST['security_code'] == $session->get('security_code')) { $error = '0';} else {$error = '1';} if ($_POST["name"] === "") { $errorname = '1';$error = '1'; } else {$errorname = '0';} if ($_POST["email"] === "") { $erroremail = '2';$error = '1'; } else {$erroremail = '0';} if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $_POST["email"])) { $erroremail = '2';$error = '1'; } else {$erroremail = '0';} if ($_POST["message"] === "") { $errormessage = '3';$error = '1'; } else {$errormessage = '0';} if ($error === '0') { $myMessage = 'Hai ricevuto un messaggio da : '. $_POST["email"] ."\n\n NOME : ". $_POST["name"] ."\n\n TELEFONO : ". $_POST["telephone"] ."\n\n MESSAGGIO :". $_POST["message"]; $emailsubject = ("Richiesta Informazioni per $title registrata su (Informazione Tecnica)"); //Change to a suitable value for your scenario... $mail =& JFactory::getMailer(); $mail->addRecipient( $adminemail ); $mail->addReplyTo(array( $_POST["email"], $_POST["name"] )); $mail->setSubject( $emailsubject ); $mail->setBody( $myMessage ); if ($mail->Send()) { echo "<h3>Mail inviata con successo, al più presto riceverà risposta.</h3>"; } else { echo "<h3>Si è verificato un errore, la Mail non è stata inviata. Riprova</h3>"; } } if ($error == '1'){ ?><form action="index.php?option=com_sobi2&sobi2Task=sobi2Details&catid=<?php echo $sobiCatID; ?>&sobi2Id=<?php echo $sobiItemID; ?>&Itemid=326" method="post" name="emailForm" target="_top" id="emailForm"> <?php if ($errorname == '1'){?> <p class="message">Si prega di fornire un Nome e Cognome</p><label><span style="color:#F00;"><b>name</b></span></label><br /> <?php }else{?> <label>Name</label><br /> <?php } ?> <input name="name" type="text" size="30" value="<?php echo $_POST["name"];?>" /><br /> <?php if ($erroremail == '2'){?> <p class="message">Si prega di fornire un indirizzo Email valido </p><label><span style="color:#F00;"><b>Email</b></span></label><br /> <?php }else{?> <label>Email</label><br /> <?php } ?> <input name="email" type="text" size="30" value="<?php echo $_POST["email"];?>" /><br /> <label>Telephone Number</label><br /> <input name="telephone" type="text" size="30" <?php echo $_POST["telephone"];?>/><br /> <?php if ($errormessage == '3'){?> <p class="message">Si prega di inserire il messaggio della richiesta.</p><label><span style="color:#F00;"><b>Message</b></span></label><br /> <?php }else{?> <label>Message</label><br /> <?php } ?> <textarea name="message" cols="50" rows="10" ><?php echo $_POST["message"];?></textarea><br /> <input type="submit" name="Submit" value="Submit" /> <input type="hidden" name="task" value="emailListing" /> </form> <?php } } } file : ** sobi2.details.tmpl.php (../components/com_sobi2/templates/standard_advanced2/)** defined( '_SOBI2_' ) || ( trigger_error("Restricted access", E_USER_ERROR) && exit() ); ?> <?php $recipient = $fieldsObjects['field_email']->data;?> <?php $sobiItemID = $mySobi->id;?> <?php $catid = JRequest::getCmd('catid');?> <?php InsertScript("$mySobi->title","$recipient","[email protected]","$sobiItemID","$catid");?> <?php HTML_SOBI::renewal( $config,$mySobi ); ?> <style type="text/css"> <!-- .Stile1 { font-size: 9px; color: #CCCCCC; } --> </style> <table width="100%" class="sobi2Details" <?php echo $style; ?> > <tr> <td><h1><?php echo $mySobi->title ?></h1> <table width="100%" border="0"> <tr> <td align="left" valign="middle"><div align="left"><?php echo HTML_SOBI::customFieldsData($fieldsFormatted);?></div></td> <td width="31%" align="center" valign="middle"><div align="center"><?php echo $img; ?></div></td> </tr> <tr> <td align="left" valign="middle"> </td> <td align="center" valign="middle"><div align="center"> <?php HTML_SOBI::waySearchUrl($waySearchLink,$config); ?> <?php HTML_SOBI::showGoogleMaps($mySobi, $config); ?> </div></td> </tr> <tr> <td colspan="2" align="center" valign="middle"><div align="center"><?php echo $plugins["gallery"]; ?></div></td> </tr> <tr class="sobi2DetailsFooter"> <td colspan="2"><?php $catid = JRequest::getCmd('catid');?> <?php if ($_POST){ echo '<!-- nothing -->'; } else {?> <h3>Contatta ""<?php echo $mySobi->title; ?>""</h3> <p class="sticky">Si prega di compilare il modulo in ogni sua parte <strong>(*)</strong> campi obbligatori</p> <form action="index.php?option=com_sobi2&sobi2Task=sobi2Details&sobi2Id=<?php echo $mySobi->id; ?>&catid=<?php echo $catid ?>&Itemid=326" method="post" name="emailForm" target="_top" id="emailForm2"> <table width="100%" border="0" align="center"> <tr> <td><label>Nome e Cognome <strong>(*)</strong></label> <input name="name" type="text" size="30" /></td> </tr> <tr> <td><label>E-mail </label> <strong>(*)</strong> <input name="email" type="text" size="30" /></td> </tr> <tr> <td><label>Numero di telefono <strong>(*)</strong></label> <input name="telephone" type="text" size="30" /></td> </tr> <tr> <td><label>Scrivi Messaggio </label> <strong>(*)</strong></td> </tr> <tr> <td><textarea name="message" cols="50" rows="10"></textarea></td> </tr> <tr> <td><input type="submit" name="Submit2" value="Invia" /> <input type="reset" name="Submit" value="Cancella" /> <input type="hidden" name="task2" value="emailListing" /></td> </tr> </table> <label></label> <p> </p> </form> <?php }?> <!-- end of the form --> </td> </tr> <tr> <td colspan="2"> </td> </tr> </table> </td> </tr> </table> <tr> </tr> <tr> <td><?php HTML_SOBI::renewal($config, $mySobi); ?></td> <td> </td> </tr> <tr> <td><?php HTML_SOBI::addedDate($config,$mySobi); ?> <?php HTML_SOBI::showHits($config,$mySobi); ?> </td> <td><?php HTML_SOBI::editButtons($config,$mySobi); ?></td> </tr> </table>
In attesa di una Vs risposta RI-saluto TUTTI!!!!