-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
392 lines (295 loc) · 19.6 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
<?PHP
function caracter_aleatorio() {
mt_srand((double)microtime()*1000000);
$valor_aleatorio = mt_rand(1,3);
switch ($valor_aleatorio) {
case 1:
$valor_aleatorio = mt_rand(97, 122);
break;
case 2:
$valor_aleatorio = mt_rand(48, 57);
break;
case 3:
$valor_aleatorio = mt_rand(65, 90);
break;
}
return chr($valor_aleatorio);
}
function mostrar_producto(){
global $tof_productos,$tof_productosxidioma,$tof_secciones,$tof_seccionesxidioma,$tof_comentariosxproductos,$tof_comentariosxproductosxidioma,$tof_imagenesxproductos,$id_producto,$id_seccion,$id_subseccion,$idioma,$tof_moneda,$tof_tipoproducto;
$captcha_texto = "";
for ($i = 1; $i <= 6; $i++) {
$captcha_texto .= caracter_aleatorio();
}
$name_tpl="producto.htm";
$t = new Template("modulos/productos/templates", "remove");
$t->set_file("pl", $name_tpl);
$t->set_var("SID",$SID);
$t->set_var("captcha_texto_session",$captcha_texto);
$url = $_SERVER['REQUEST_URI'];
if (isset($id_subsubseccion)){
$id_secc=$id_subsubseccion;
$t->set_var("id_subseccion",$id_secc);
$result=mysql_query("select si.*,s.id_seccion from ".$tof_productos." s join ".$tof_productosxidioma." si on (s.id=si.id) where si.id=".$id_producto." and si.idioma='".$idioma."'");
$row=mysql_fetch_array($result);
$result2=mysql_query("select si.*,s.id_padre from ".$tof_secciones." s join ".$tof_seccionesxidioma." si on (s.id=si.id) where si.id=".$id_secc." and si.idioma='".$idioma."'");
$row2=mysql_fetch_array($result2);
$result1=mysql_query("select si.*,s.id_padre from ".$tof_secciones." s join ".$tof_seccionesxidioma." si on (s.id=si.id) where si.id=".$row1[id_padre]." and si.idioma='".$idioma."'");
$row1=mysql_fetch_array($result1);
$t->set_var("breadcrum", '>> <a href="/'.$idioma.'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row2[nombre]))).'-'.$row2[id].'.htm" title="'.$row2[nombre].'">'.$row2[nombre].'</a> >> <a href="/'.$idioma.'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row2[nombre]))).'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row1[nombre]))).'-'.$row2[id].'-'.$row1[id].'.htm" title="'.$row1[nombre].'">'.$row1[nombre].'</a> >> '.$row[nombre]);
$url_real='/'.$idioma.'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row2[nombre]))).'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row1[nombre]))).'-'.$row2['id'].'-'.$row1['id'].'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row[nombre]))).'_'.$row['id'].'.htm';
if ($url!=$url_real){
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: /".$url_real);
}
$separadora = separadorA($idioma,$id_secc);
if (preg_match("/".$separadora."/i",$row[nombre])){
$inicio = strpos($row[nombre],$separadora)+strlen($separadora);
$destino = substr($row[nombre],$inicio);
}
$resultenlace2=mysql_query("select si.*,s.id_padre from ".$tof_productos." s join ".$tof_productosxidioma." si on (s.id=si.id) where s.id<>".$id_secc." and si.nombre like '%".$destino."%' and si.idioma='".$idioma."' order by rand() limit 12");
$entro=0;
$t->set_block("pl","b_productos","_b_productos");
while($rowenlace2=mysql_fetch_array($productos2)){
$entro=1;
$resultenlace1=mysql_query("select si.*,s.id_padre,s.video from ".$tof_productos." s join ".$tof_productosxidioma." si on (s.id=si.id) where s.id=".$rowenlace2[id_padre]." and si.idioma='".$idioma."'");
$rowenlace1=mysql_fetch_array($resultenlace1);
if(isset($rowenlace1[id_padre]) && $rowenlace1[id_padre]!=""){
$resultenlace=mysql_query("select si.*,s.id_padre from ".$tof_productos." s join ".$tof_productosxidioma." si on (s.id=si.id) where s.id=".$rowenlace1[id_padre]." and si.idioma='".$idioma."'");
$rowenlace=mysql_fetch_array($resultenlace);
if (isset($rowenlace) and ($rowenlace!="")){
$t->set_var("categoria", strtolower(sacar_acentos(str_replace(" ","-" ,$rowenlace[nombre]))));
$t->set_var("id_categoria", "-".$rowenlace[id]);
$t->set_var("subcategoria", strtolower(sacar_acentos(str_replace(" ","-" ,$rowenlace1[nombre]))));
$t->set_var("id_subcategoria", "-".$rowenlace1[id]);
$t->set_var("subsubcategoria", "/".strtolower(sacar_acentos(str_replace(" ","-" ,$rowenlace2[nombre]))));
$t->set_var("id_subsubcategoria", "-".$rowenlace2[id]);
$t->set_var("anchor", $rowenlace2[nombre]);
$t->parse("_b_productos","b_productos",true);
}else{
$t->set_var("categoria", strtolower(sacar_acentos(str_replace(" ","-" ,$rowenlace1[nombre]))));
$t->set_var("id_categoria", "-".$rowenlace1[id]);
$t->set_var("subcategoria", strtolower(sacar_acentos(str_replace(" ","-" ,$rowenlace2[nombre]))));
$t->set_var("id_subcategoria", "-".$rowenlace2[id]);
$t->set_var("subsubcategoria", "");
$t->set_var("id_subsubcategoria", "");
$t->set_var("anchor", $rowenlace2[nombre]);
$t->parse("_b_productos","b_productos",true);
}
}
}
}elseif (isset($id_subseccion)){
$id_secc=$id_subseccion;
$t->set_var("id_subseccion",$id_secc);
$result=mysql_query("select si.*,s.id_seccion,s.video from ".$tof_productos." s join ".$tof_productosxidioma." si on (s.id=si.id) where si.id=".$id_producto." and si.idioma='".$idioma."'");
$row=mysql_fetch_array($result);
$result2=mysql_query("select si.*,s.id_padre from ".$tof_secciones." s join ".$tof_seccionesxidioma." si on (s.id=si.id) where si.id=".$id_secc." and si.idioma='".$idioma."'");
$row2=mysql_fetch_array($result2);
$result1=mysql_query("select si.*,s.id_padre from ".$tof_secciones." s join ".$tof_seccionesxidioma." si on (s.id=si.id) where si.id=".$row2[id_padre]." and si.idioma='".$idioma."'");
$row1=mysql_fetch_array($result1);
$t->set_var("breadcrum", '>> <a href="/'.$idioma.'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row1[nombre]))).'-'.$row1[id].'.htm" title="'.$row1[nombre].'">'.$row1[nombre].'</a> >> <a href="/'.$idioma.'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row1[nombre]))).'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row2[nombre]))).'-'.$row1[id].'-'.$row2[id].'.htm" title="'.$row2[nombre].'">'.$row2[nombre].'</a> >> '.$row[nombre]);
$url_real='/'.$idioma.'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row1[nombre]))).'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row2[nombre]))).'-'.$row1['id'].'-'.$row2['id'].'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row[nombre]))).'_'.$row['id'].'.htm';
if ($url!=$url_real){
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: /".$url_real);
}
$result2=mysql_query("select si.* from ".$tof_productos." s join ".$tof_productosxidioma." si on (s.id=si.id) where s.id_padre=".$id_subproducto." and si.idioma='".$idioma."' order by nombre limit 180");
$t->set_block("pl","b_productos","_b_productos");
while($row2=mysql_fetch_array($result2)){
$entro=1;
$t->set_var("categoria", strtolower(sacar_acentos(str_replace(" ","-" ,$row1[nombre]))));
$t->set_var("id_categoria", "-".$row1[id]);
$t->set_var("subcategoria", strtolower(sacar_acentos(str_replace(" ","-" ,$row[nombre]))));
$t->set_var("id_subcategoria", "-".$row[id]);
$t->set_var("subsubcategoria", "/".strtolower(sacar_acentos(str_replace(" ","-" ,$row2[nombre]))));
$t->set_var("id_subsubcategoria", "-".$row2[id]);
$t->set_var("anchor", $row2[nombre]);
$t->parse("_b_productos","b_productos",true);
}
}else{
$id_secc=$id_seccion;
$t->set_var("id_producto",$id_secc);
$result=mysql_query("select si.*,s.id_seccion,s.id_usuario,s.video,s.precio,m.simbolo as simbolo_moneda,tp.nombre as tipoproducto from ".$tof_productos." s join ".$tof_productosxidioma." si on (s.id=si.id) right join ".$tof_moneda." m on (m.id=s.id_moneda) right join ".$tof_tipoproducto." tp on (tp.id=s.id_tipoproducto) where si.id=".$id_producto." and si.idioma='".$idioma."'");
$row=mysql_fetch_array($result);
$result1=mysql_query("select si.*,s.id_padre,s.video from ".$tof_secciones." s join ".$tof_seccionesxidioma." si on (s.id=si.id) where si.id=".$id_secc." and si.idioma='".$idioma."'");
$row1=mysql_fetch_array($result1);
$t->set_var("breadcrum", ' >> <a href="/'.$idioma.'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row1[nombre]))).'-'.$row1[id].'.htm" title="'.$row1[nombre].'">'.$row1[nombre].'</a> >>'.$row[nombre]);
$url_real='/'.$idioma.'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row1[nombre]))).'-'.$row1['id'].'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row[nombre]))).'_'.$row['id'].'.htm';
if ($url!=$url_real){
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: /".$url_real);
}
$resultOtrosproductos=mysql_query("select si.*,s.video,s.precio from ".$tof_productos." s join ".$tof_productosxidioma." si on (s.id=si.id) where (s.id_seccion=".$id_seccion." or s.id_usuario=".$row['id_usuario'].") and s.id <> ".$id_producto." and si.idioma='".$idioma."'");
$t->set_block("pl","b_productos","_b_productos");
while($rowOtrosproductos=mysql_fetch_array($resultOtrosproductos)){
$entro=1;
$t->set_var("path", strtolower(sacar_acentos(str_replace(" ","-" ,$row1[nombre])))."-".$row1[id]);
$t->set_var("producto", strtolower(sacar_acentos(str_replace(" ","-" ,$rowOtrosproductos[nombre])))."_".$rowOtrosproductos[id]);
$t->set_var("anchor", $rowOtrosproductos[nombre]);
$t->set_var("contenido_producto", substr(strip_tags($rowOtrosproductos[contenido]),0,150)."...");
//select la imagen
$result=mysql_query("select id,path,nombre,principio from ".$tof_imagenesxproductos." where (id_producto=".$rowOtrosproductos[id]." or id_producto=".$row1[id].") and publicado=1 limit 1");
if(mysql_num_rows($result)){
$rowimagen=mysql_fetch_array($result);
$t->set_var("imagen_producto", '<a href="/'.$idioma.'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row1[nombre])))."-".$row1[id].'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row[nombre])))."-".$row[id].'.htm" ><img src="'.$rowimagen[path].'" alt="'.$rowimagen[nombre].'" width="90" height="90"/></a>');
}
$t->parse("_b_productos","b_productos",true);
}
}
if ($entro==0){
$t->set_var("enlacesubcategoriasvisibles", "display:none");
}
$separadora = separadorA($idioma,$row[id]);
if (preg_match("/".$separadora."/i",$row[nombre])){
$inicio = strpos($row[nombre],$separadora)+strlen($separadora);
$destino = substr($row[nombre],$inicio);
if (strstr($row[nombre],separadorDE($idioma))){
$inicio = strpos($row[nombre],separadorDE($idioma))+strlen(separadorDE($idioma));
$fin=strpos($row[nombre],$separadora)-(strpos($row[nombre],separadorDE($idioma))+strlen(separadorDE($idioma)));
$origen = substr($row[nombre],$inicio,$fin);
$t->set_var("onload","onload=\"initialize('$origen','$destino');\"");
$t->set_var("mapa",'<div class="mapa"><form action="#" onsubmit="showAddress(this.address.value); return false">
<div id="map_canvas" style="width:640px; height: 350px"></div>
<p>
<input type="text" size="38" name="address" value="form: '.$origen.' to: '.$destino.'" />
<input type="submit" value="{traduccion_buscar}" id="boton" />
</p>
</form>
</div>');
}else{
$t->set_var("onload","onload=\"initialize('','$destino');\"");
$t->set_var("mapa",'<div class="mapa"><form action="#" onsubmit="showAddress(this.address.value); return false">
<div id="map_canvas" style="width: 640px; height: 350px"></div>
<p>
<input type="text" size="38" name="address" value="'.$destino.'" />
<input type="submit" value="{traduccion_buscar}" id="boton" />
</p>
</form>
</div>');
}
}else{
$t->set_var("destino", "");
$t->set_var("onload","");
$t->set_var("mapa","");
}
$t->set_var("id_producto", $id_producto);
$t->set_var("titulo", $row[nombre]);
$t->set_var("contenido", $row[contenido]);
if (isset($row[precio]) && ($row[precio]!=0))
$t->set_var("precio", "Precio: ".$row[simbolo_moneda]." ".$row[precio]);
$t->set_var("tipoproducto", $row[tipoproducto]);
//$t->set_var("imagen_producto", '<p style="width:30%;float:left"><a href="/'.$idioma.'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row[nombre]))).'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row1[nombre])))."-".$row[id]."-".$row1[id].'.htm" ><img src="/images/productos/_P1030880.JPG" alt="'.$rowimagen[nombre].'" width="150" height="150"/></a></p>');
if (isset($row[video]) and ($row[video]!=NULL))
$t->set_var("video",
'<!-- Video 1-->
<p class="meta"> </p>
<p class="meta">Videos Hacienda</p>
<div class="entry">
<iframe width="480" height="390" frameborder="0" allowfullscreen="" src="http://www.youtube.com/embed/'.$row[video].'"></iframe></div>
<!-- Fin video-->');
else
$t->set_var("video", "");
$t->set_var("description", $row[description]);
if (isset($row[title]) and ($row[title]!=""))
$t->set_var("title", $row[title]);
else
$t->set_var("title", $row[nombre]);
$t->set_var("keywords", $row[keywords]);
$t->set_var("idioma", $row[idioma]);
//cambie la consulta
//$result=mysql_query("select id,path,nombre,principio from ".$tof_imagenesxproductos." where (id_producto=".$id_secc." or id_producto=".$row[id_padre].") and publicado=1");
$result=mysql_query("select id,path,nombre,principio from ".$tof_imagenesxproductos." where (id_producto=".$id_producto.") and publicado=1");
if(mysql_num_rows($result)){
$t->set_block("pl","block_imagen_prod1","_block_imagen_prod1");
$t->set_block("pl","block_imagen_prod2","_block_imagen_prod2");
while($row=mysql_fetch_array($result)){
//$t->set_var("imagen_producto", '<p style="width:30%;float:left"><a href="'.$rowimagen[path].'" rel="opendialog"><img src="'.$rowimagen[path].'" alt="'.$rowimagen[nombre].'" alt="'.$rowimagen[nombre].'" width="100" height="100" /></a></p>');
$t->set_var("imagen_src", $row[path]);
$t->set_var("imagen_nombre",$row[nombre]);
$t->parse("_block_imagen_prod1","block_imagen_prod1",true);
$t->parse("_block_imagen_prod2","block_imagen_prod2",true);
}
}
$result=mysql_query("select si.*,s.fecha_publicacion from ".$tof_comentariosxproductos." s join ".$tof_comentariosxproductosxidioma." si on (s.id=si.id) where s.id_producto=".$id_producto." and publicado=1 and si.idioma='".$idioma."' order by fecha_publicacion desc");
if(mysql_num_rows($result)){
$t->set_var("comentariosvisibles", "");
$t->set_block("pl","block_comentarios","_block_comentarios");
while($row=mysql_fetch_array($result)){
$t->set_var("nombre", $row[nombre]);
$t->set_var("comentario", $row[comentario]);
$t->set_var("respuesta", $row[respuesta]);
$t->set_var("fecha_publicacion", $row[fecha_publicacion]);
$t->parse("_block_comentarios","block_comentarios",true);
}
}else{
$t->set_var("comentariosvisibles", "display:none;");
}
setearMenu(&$t,$id_secc);
setearVariablesComunes(&$t);
setearBanners(&$t,$id_secc);
$t->set_var("float", '');
$t->parse("MAIN", "pl");
$t->p("MAIN");
}
function insertar_comentario(){
global $tof_productos,$tof_productosxidioma,$tof_comentariosxproductos,$tof_comentariosxproductosxidioma,$id_producto,$id_subsubproducto,$id_subproducto,$nombre, $email, $comentario,$idioma,$tof_usuarios_sistema,$urlSite;
$name_tpl="gracias-comentario.htm";
$t = new Template("modulos/productos/templates", "remove");
$t->set_file("pl", $name_tpl);
setearMenu(&$t);
setearVariablesComunes(&$t);
if (isset($id_subsubproducto) && ($id_subsubproducto!="")){
$id_secc=$id_subsubproducto;
$result=mysql_query("select si.* from ".$tof_productos." s join ".$tof_productosxidioma." si on (s.id=si.id) where si.id=".$id_subsubproducto." and si.idioma='".$idioma."'");
$row=mysql_fetch_array($result);
$result1=mysql_query("select si.* from ".$tof_productos." s join ".$tof_productosxidioma." si on (s.id=si.id) where si.id=".$id_subproducto." and si.idioma='".$idioma."'");
$row1=mysql_fetch_array($result1);
$result2=mysql_query("select si.* from ".$tof_productos." s join ".$tof_productosxidioma." si on (s.id=si.id) where si.id=".$id_producto." and si.idioma='".$idioma."'");
$row2=mysql_fetch_array($result2);
$t->set_var("breadcrum", '>> <a href="/'.$idioma.'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row2[nombre]))).'-'.$row2[id].'.htm" title="'.$row2[nombre].'">'.$row2[nombre].'</a> >> <a href="/'.$idioma.'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row2[nombre]))).'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row1[nombre]))).'-'.$row2[id].'-'.$row1[id].'.htm" title="'.$row1[nombre].'">'.$row1[nombre].'</a> >> <a href="/'.$idioma.'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row2[nombre]))).'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row1[nombre]))).'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row[nombre]))).'-'.$row2[id].'-'.$row1[id].'-'.$row[id].' title="'.$row[nombre].'">'.$row[nombre].'</a> >> Gracias');
}elseif (isset($id_subproducto) && ($id_subsubproducto!="")){
$id_secc=$id_subproducto;
$result=mysql_query("select si.* from ".$tof_productos." s join ".$tof_productosxidioma." si on (s.id=si.id) where si.id=".$id_subproducto." and si.idioma='".$idioma."'");
$row=mysql_fetch_array($result);
$result1=mysql_query("select si.* from ".$tof_productos." s join ".$tof_productosxidioma." si on (s.id=si.id) where si.id=".$id_producto." and si.idioma='".$idioma."'");
$row1=mysql_fetch_array($result1);
$t->set_var("breadcrum", ' >> <a href="/'.$idioma.'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row1[nombre]))).'-'.$row1[id].'.htm" title="'.$row1[nombre].'">'.$row1[nombre].'</a> >> <a href="/'.$idioma.'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row[nombre]))).'-'.$row[id].'.htm" title="'.$row[nombre].'">'.$row[nombre].'</a> Gracias');
}else{
$id_secc=$id_producto;
$result=mysql_query("select si.*,s.id_usuario from ".$tof_productos." s join ".$tof_productosxidioma." si on (s.id=si.id) where si.id=".$id_producto." and si.idioma='".$idioma."'");
$row=mysql_fetch_array($result);
$t->set_var("breadcrum", ' >> <a href="/'.$idioma.'/'.strtolower(sacar_acentos(str_replace(" ","-" ,$row[nombre]))).'-'.$row[id].'.htm" title="'.$row[nombre].'">'.$row[nombre].'</a> >> Gracias');
}
mysql_query("insert into ".$tof_comentariosxproductos." values('NULL','".date("Y-m-d")."',0,".$id_secc.")");
$last_id = mysql_insert_id();
mysql_query("insert into ".$tof_comentariosxproductosxidioma." values(".$last_id.",'".$idioma."','".$nombre."','".$email."','".$comentario."','')");
$t->set_var("titulo", "Gracias por su comentario");
$t->set_var("contenido", "Gracias por su comentario, el mismo será publicado cuando sea validado por nuestro equipo.");
$t->set_var("description", "Gracias por su comentario, el mismo será publicado cuando sea validado por nuestro equipo.");
$t->set_var("title", "Gracias por su comentario");
$t->set_var("keywords", "");
$t->set_var("idioma", $idioma);
//Enviar email
include_once("include/mail.php");
$resultUsuario=mysql_query("select * from ".$tof_usuarios_sistema." s where s.id=".$row[id_usuario]);
$rowUsuario=mysql_fetch_array($resultUsuario);
$From=$email;
$FromName=$nombre;
$To=$rowUsuario[email];
$emailto=$rowUsuario[email];
$body='<p>'.$comentario.' puede ver el comentario en <a href="'.$urlSite.'/'.$idioma.'/editarpregunta_productoxusuario/'.$last_id.'">Ver comentario</a></p>';
$subject="Comentario desde campo-vende.com.ar";
$resultado=enviar_email($From,$FromName,$To,$body,$subject,$emailto);
if($resultado==0){
?>
<script language="JavaScript" type="text/javascript">
alert("Error: no se pede enviar email.");
history.back(1);
</script>
<?
}else{
$t->parse("MAIN", "pl");
$t->p("MAIN");
}
}
?>