Foros del Web » Creando para Internet » Sistemas de gestión de contenidos »

(Ayuda) Sacar partes del codigo para..

Estas en el tema de (Ayuda) Sacar partes del codigo para.. en el foro de Sistemas de gestión de contenidos en Foros del Web. hola! quisiera que alguien me guie o ayude para dejar solo los campos: *Nombre*Mail*Boton Suscribir*Eleccion HTML solamente*boton de opcion de seleccion de newsletters. para q ...
  #1 (permalink)  
Antiguo 08/04/2008, 12:04
 
Fecha de Ingreso: marzo-2008
Mensajes: 1.020
Antigüedad: 16 años, 8 meses
Puntos: 21
(Ayuda) Sacar partes del codigo para..

hola! quisiera que alguien me guie o ayude para dejar solo los campos:
*Nombre*Mail*Boton Suscribir*Eleccion HTML solamente*boton de opcion de seleccion de newsletters.

para q hacer esto?...pq quiero ponerlo en el index de mi sitio ya que sino es muy grande y ocupa gran parte en la pagina principal:

les dejo el codigo:

<?php
include('config.php');
IF (!isset($_REQUEST['lang']))
$_REQUEST['lang'] = $langdefault;
include("language/".$_REQUEST['lang'].".php");
include('header.php');
IF (!isset($_GET['caseid']) || $_GET['caseid'] == '' || $_GET['caseid'] != 'home' && $_GET['caseid'] != 'archive' && $_GET['caseid'] != 'unregister')
$_GET['caseid'] = 'home';
SWITCH ($_GET['caseid'])
{
CASE 'home':
IF (isset($_POST['form']) && isset($_POST['newsletter']))
{
echo " <TABLE Width=$maintablewidth Align=$maintablealign Border=0 Cellspacing=0 Cellpadding=2 Class=boxborder>
<TR>
<TD><BR>
<TABLE Border=0 Width=300 Cellspacing=0 Cellpadding=2 Align=Center Bgcolor=$background>
<TR>
<TD Class=boxborder><P>$text_name:</TD>
<TD Class=boxborder><P>";
IF ($_POST['name'] != '')
echo stripslashes($_POST['name'])."<BR></TD></TR>";
ELSE
{
echo "<FONT Color=Red>$text_errorname<BR></TD></TR>";
$error = true;
}
echo " <TR>
<TD Class=boxborder><P>$text_email:</TD>
<TD Class=boxborder><P>";

IF (ereg("^.+@.+\\..+$", $_POST['email']))
echo $_POST['email']."<BR></TD></TR>";
ELSE
{
echo "<FONT Color=Red>$text_erroremail<BR></TD></TR>";
$error = true;
}

echo ' </TABLE>

</TD>
</TR>
<TR>
<TD Height=10></TD>
</TR>
</TABLE>';

IF (!isset($error))
{
PageTitle("Newsletters Chosen.");
echo " <TABLE Align=$maintablealign Width=$maintablewidth Border=1 cellspacing=0 cellpadding=2 Bordercolor=#000000 Class=boxborder>
<TR Bgcolor=$background>
<TD><P>$text_newslettertitle</TD>
<TD><P>$text_newsletterdesc</TD>
<TD><P>$text_status</TD>
</TR>";
$numrows = count($_POST['newsletter']);
FOR ($i = 0; $i < $numrows; $i++)
{
$query = " SELECT tipnl_title, tipnl_description
FROM newsletters
WHERE tipnl_id = '".$_POST['newsletter'][$i]."'
AND tipnl_status = '1'";

$result = @mysql_query($query);
$row = @mysql_fetch_array($result);
extract($row);
echo " <TR>
<TD Valign=Top><P>".stripslashes($tipnl_title)."</TD>
<TD><P>".stripslashes($tipnl_description)."</TD>
<TD><P>";
$query1 = " SELECT tipnm_newsid, tipnm_email
FROM newslettermembers
WHERE tipnm_newsid = '".$_POST['newsletter'][$i]."'
AND tipnm_email = '".$_POST['email']."'";
$result1 = @mysql_query($query1);
IF (@mysql_num_rows($result1) > 0)
echo $text_statusmsgnosub;
ELSE
{
echo $text_statusmsgsub;

$query = " INSERT INTO newslettermembers (tipnm_id, tipnm_name, tipnm_email, tipnm_newsid, tipnm_mailpref)
VALUES ('', '".$_POST['name']."', '".$_POST['email']."', '".$_POST['newsletter'][$i]."', '".$_POST['mailpref']."')";

$result = @mysql_query($query);

$mail = "true";
}

echo " </TD>
</TR>";
}
IF (isset($mail) == 'true')
{
$ip = $_SERVER['REMOTE_ADDR'];

include ('class.phpmailer.php');
$mail = new phpmailer();
$mail->IsSMTP();
$mail->Host = $sockethost;

IF ($smtpauth == 'TRUE')
{
$mail->SMTPAuth = true;
$mail->Username = $smtpauthuser;
$mail->Password = $smtpauthpass;
}
$mail->From = $socketfrom;
$mail->FromName = $socketfromname;
$mail->AddReplyTo($socketreply, $socketreplyname);

$mail->IsHTML(False);
$mail->Subject = "Signup For $sitename Newsletters";

$mail->AddAddress($_POST['email'], stripslashes($_POST['name']));

$mail->Body = "
Signup Details\n
The details are as follows:\n
NAME: ".stripslashes($_POST['name'])."
EMAIL: ".$_POST['email']."\n
Gracias por subscribirte al boletin mensual de $sitename.
Si usted no se subscribio o no quiere recibir este boletin,
por favor valla a $siteurl to unsubscribe\n";

$mail->Send();
$mail->ClearAddresses();

IF ($adminmail == 'TRUE')
{
$mail->AddAddress($siteemail, $sitename);
$mail->Send();
}

$mail->ClearAddresses();
}
echo '</TABLE>';
}
ELSE
{
echo " <TABLE Align=$maintablealign Width=$maintablewidth Border=1 cellspacing=0 cellpadding=2 Bordercolor=black Class=boxborder>
<TR>
<TD Align=Center><BR>
<P>$text_errormsg.<BR>
<INPUT Type=Button Value=$textai_back onClick=history.back()><BR><BR>
</TD>
</TR>
</TABLE>";
}

echo ' </TD>
</TR>
</TABLE>';
}
ELSE
{
echo " <TABLE Align=$maintablealign Width=$maintablewidth Border=0 cellspacing=0 cellpadding=2 Class=boxborder>
<FORM Action=".$_SERVER['PHP_SELF']." Method=POST>
<TR>
<TD><BLOCKQUOTE>
<LI>$text_joinmessage<BR>
<LI>$text_unregistermessage<BR><BR>
</TD>
</TR>
</TABLE>";
echo " <TABLE Align=$maintablealign Width=$maintablewidth Border=0 cellspacing=0 cellpadding=2 Class=boxborder>
<TR>
<TD><BLOCKQUOTE><P>$text_name:</TD>
<TD><P><INPUT Name=name Size=30></TD>
<TD><P>$text_mailpref:</TD>
<TD Align=Right><P>$text_html:</TD>
<TD Align=Right><P><INPUT CHECKED Type=Radio Name=mailpref Value=html></TD>
</TR>
<TR>
<TD><BLOCKQUOTE><P>$text_email:</TD>
<TD Colspan=2><P><INPUT Name=email Size=30></TD>
<TD Align=Right><P>$text_plain:</TD>
<TD Align=Right><P><INPUT Type=Radio Name=mailpref Value=plain></TD>
</TR>
<TR>
<TD Height=10></TD>
</TR>
</TABLE>";
  #2 (permalink)  
Antiguo 08/04/2008, 12:05
 
Fecha de Ingreso: marzo-2008
Mensajes: 1.020
Antigüedad: 16 años, 8 meses
Puntos: 21
Re: (Ayuda) Sacar partes del codigo para..

la otra parte del codigo:

echo " <TABLE Align=$maintablealign Width=$maintablewidth Border=1 cellspacing=0 cellpadding=2 Bordercolor=black Class=boxborder>
<TR Bgcolor=$background>
<TD><P>$text_newslettertitle</TD>
<TD><P>$text_newsletterdesc</TD>
<TD><P>$text_newsletterselect</TD>
</TR>";
$query = " SELECT tipnl_id, tipnl_title, tipnl_description
FROM newsletters
WHERE tipnl_status = '1'
ORDER BY tipnl_id ASC";
$result = @mysql_query($query);
WHILE($row = @mysql_fetch_array($result))
{
extract($row);
echo " <TR>
<TD Valign=Top><P>".stripslashes($tipnl_title)."</TD>
<TD><P>".stripslashes($tipnl_description)."</TD>
<TD Valign=Top Align=Right><INPUT Type=checkbox Name=newsletter[] Value=$tipnl_id></TD>
</TR>";
}
echo " </TABLE>
<TABLE Align=$maintablealign Width=$maintablewidth Border=0 cellspacing=0 cellpadding=0>
<TR>
<TD Height=10></TD>
</TR>
<TR>
<TD Align=Right>
<INPUT Type=Hidden Name=form Value=new>
<INPUT Type=Submit Value=$text_subbutton>
</TD>
</TR>
</FORM>
</TABLE>";
}
BREAK;
CASE "archive";

PageTitle($texta_title);

$query = " SELECT tipna_id, tipna_subject, tipna_body, tipna_timestamp
FROM newsletterarchive";

IF (isset($_GET['newsid']))
$query .= " WHERE tipna_id = '".$_GET['newsid']."'
LIMIT 0,1";
ELSE
$query .= " ORDER BY tipna_timestamp DESC";
$result = @mysql_query($query);
IF (@mysql_num_rows($result) > 0)
{
echo " <TABLE Width=$maintablewidth Align=$maintablealign Border=1 Bordercolor=BLACK Cellspacing=0 Cellpadding=2 Class=boxborder>";
IF (isset($_GET['newsid']))
{
$row = @mysql_fetch_array($result);
extract($row);
$tipna_timestamp = date("d/m/y",$row["tipna_timestamp"]);
echo " <TR>
<TD Width=100><P><B>$textai_volume:</TD>
<TD><P>$tipna_id</TD>
</TR>
<TR>
<TD><P><B>$textai_date:</TD>
<TD><P>$tipna_timestamp</TD>
</TR>
<TR>
<TD><P><B>$textai_subject:</TD>
<TD><P>".stripslashes($tipna_subject)."</TD>
</TR>
<TR>
<TD Valign=Top><P><B>$textai_body:</TD>
<TD><P>".stripslashes(nl2br($tipna_body))."</TD>
</TR>
<TR>
<TD Colspan=2 Align=Center><BR><P><INPUT Type=Button Value=$textai_back onClick=history.back()><BR><BR></TD>
</TR>";
}
ELSE
{
echo " <TR Valign=Top>
<TD><P><B>$texta_volume</TD>
<TD><P><B>$texta_date</TD>
<TD><P><B>$texta_subject</TD>
<TD><P><B>$texta_select</TD>
</TR>";
WHILE ($row = @mysql_fetch_array($result))
{
$trcolor = usecolor();
extract($row);
$tipna_timestamp = date("d/m/y",$row["tipna_timestamp"]);

echo " <TR BGcolor=$trcolor Valign=Top>
<TD><P>&nbsp;$tipna_id</TD>
<TD><P>$tipna_timestamp</TD>
<TD><P>".stripslashes($tipna_subject)."</TD>
<TD><P><BUTTON onClick=location='".$_SERVER['PHP_SELF']."?caseid=archive&newsid=$tipna_id'>Select</BUTTON>
</TR>";
}
}
}
ELSE
echo " <TABLE Width=$maintablewidth Align=$maintablealign Border=0 Cellspacing=0 Cellpadding=2 Class=boxborder>
<TR>
<TD><P>$texta_noarchive</TD>
</TR>";

echo " </TABLE>";
BREAK;
CASE "unregister";
PageTitle($textu_title);
IF (isset($_POST['form']) == "new" && isset($_POST['newsletter']))
{
echo " <TABLE Width=$maintablewidth Align=$maintablealign Border=0 Cellspacing=0 Cellpadding=2 Class=boxborder>
<TR>
<TD><P>&nbsp;$textnsubmessage</TD>
</TR>
</TABLE>";

$numrows = count($_POST['newsletter']);

FOR ($i = 0; $i < $numrows; $i++)
{
$query = " DELETE FROM newslettermembers
WHERE tipnm_newsid = '".$_POST['newsletter'][$i]."'
AND tipnm_email = '".$_POST['email']."'";

$result = @mysql_query($query);
}
}
echo " <TABLE Align=$maintablealign Width=$maintablewidth Border=0 cellspacing=0 cellpadding=2 Class=boxborder>
<TR>
<TD><BLOCKQUOTE>
<LI>$textu_instruction1
<LI>$textu_instruction2
<BR><BR></TD>
</TR>
</TABLE>";
echo " <TABLE Align=$maintablealign Width=$maintablewidth Border=0 cellspacing=0 cellpadding=2 Class=boxborder>
<FORM Action=".$_SERVER['PHP_SELF']."?caseid=unregister Method=POST>
<TR>
<TD><BLOCKQUOTE><P>$textu_email:</TD>
<TD><P>
<INPUT Name=email Value='";
IF (isset($_POST['email']))
echo $_POST['email'];
echo "' Size=30>
<INPUT Type=submit Value='$textu_list'>
</TD>
</TR>
</FORM>
</TABLE>";
IF (!isset($_POST['email']) OR !ereg("^.+@.+\\..+$", $_POST['email']))
echo " <TABLE Align=$maintablealign Width=$maintablewidth Border=0 cellspacing=0 cellpadding=2 Class=boxborder>
<TR>
<TD><BLOCKQUOTE><LI>$textu_valid</TD>
</TR>
</TABLE>";
ELSE
{
$query = " SELECT tipnl_id, tipnl_title, tipnl_description
FROM newsletters a, newslettermembers b
WHERE b.tipnm_email = '".$_POST['email']."'
AND b.tipnm_newsid = a.tipnl_id
ORDER BY a.tipnl_id ASC";
$result = @mysql_query($query);
IF (@mysql_num_rows($result) <= 0)
echo " <TABLE Align=$maintablealign Width=$maintablewidth Border=0 cellspacing=0 cellpadding=2 Class=boxborder>
<TR>
<TD><BLOCKQUOTE><LI>$textu_nomember <A HREF=index.php>$textu_subscribe</TD>
</TR>
</TABLE>";
ELSE
{
PageTitle($textu_subscribed);

echo " <TABLE Align=$maintablealign Width=$maintablewidth Border=1 Bordercolor=#000000 cellspacing=0 cellpadding=2 Class=boxborder>
<FORM Action=".$_SERVER['PHP_SELF']."?caseid=unregister Method=POST>
<TR Bgcolor=#f4f7fd>
<TD><P>$text_newslettertitle</TD>
<TD><P>$text_newsletterdesc</TD>
<TD Align=Right><P>$textu_title</TD>
</TR>";
WHILE ($row = @mysql_fetch_array($result))
{
extract($row);

echo " <TR>
<TD Valign=Top><P>".stripslashes($tipnl_title)."</TD>
<TD><P>".stripslashes($tipnl_description)."</TD>
<TD Align=Right><INPUT Type=checkbox Name=newsletter[] Value=$tipnl_id></TD>
</TR>";
}
echo " </TABLE>
<TABLE Align=$maintablealign Width=$maintablewidth Border=0 cellspacing=0 cellpadding=0>
<TR>
<TD Height=10></TD>
</TR>
<TR>
<TD><DIV Align=Right>
<INPUT Type=Hidden Name=email Value=".$_POST['email'].">
<INPUT Type=Hidden Name=form Value=new>
<INPUT Type=submit Name=Submit Value=$textnsubbutton>
</TD>
</TR>
</FORM>
</TABLE>";
}
}
BREAK;
}
IF ($footeron == 'TRUE')
require("footer.php");
?>


gracias saludos
  #3 (permalink)  
Antiguo 08/04/2008, 12:10
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años, 6 meses
Puntos: 2135
Re: (Ayuda) Sacar partes del codigo para..

Tema trasladado a Aplicaciones Prefabricadas.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:10.