0){ $plantilla=mysql_fetch_assoc($sel); $id_plantilla=$plantilla['id_plantilla']; }else{ $sel=mysql_query("SELECT * FROM tb_historic WHERE id_historic=".check_input($_REQUEST['id'])); $plantilla=mysql_fetch_assoc($sel); $id_plantilla=$plantilla['id_historic']; } //$sel_modulos=mysql_query("SELECT * FROM tb_modulos WHERE id_plantilla='{$plantilla[id_plantilla]}' ORDER BY orden ASC"); $mensaje=""; $sel_modulos=mysql_query("SELECT * FROM tb_modulos_plantillas WHERE id_plantilla='{$id_plantilla}' AND activo=1 ORDER BY orden ASC"); if(mysql_num_rows($sel_modulos)>0){ $total=mysql_num_rows($sel_modulos); $index=0; while($m=mysql_fetch_assoc($sel_modulos)){ $mensaje.=montar_modul($config['servidor'],$m); } } $vincle_news=$config['servidor']."mailing/newsletter.php?id=".$id_plantilla; $ruta_servidor=$config['servidor']."mailing/".$plantilla['template']."/"; $ruta_top=$plantilla['template']."/".$plantilla['template']."_top_".$plantilla['idioma_news'].".html"; //$ruta_footer=$plantilla['template']."/".$plantilla['template']."_footer.html"; $cap=file_get_contents($ruta_top); //$peu=file_get_contents($ruta_footer); $cap=str_replace("##root_servidor##",$config['servidor'],$cap); $cap=str_replace("##servidor##",$ruta_servidor,$cap); $cap=str_replace("##mensaje##",$mensaje,$cap); $cap=str_replace("##vincle_newsletter##",$vincle_news,$cap); $cap=str_replace("##titulo##",mostra_text($plantilla['nom']),$cap); $cap=str_replace("##color_vinculo##",$plantilla['color_vinculo'],$cap); $cap=str_replace("##email_user##","",$cap); $cap=str_replace("##id_news##",$id_plantilla,$cap); //$peu=str_replace("##servidor##",$ruta_servidor,$peu); echo $cap; ?>