Ver Mensaje Individual
  #14 (permalink)  
Antiguo 08/09/2010, 18:11
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: ¿ Que codigo usar para FIR (sustitucion de NUMEROS por IMAGEN) ?

Lepe

como te indiqué la script original que te pasé la convertí en una función, podés verla aqui
http://foros.emprear.com/php/numeros/sust_img.php ó descargarla en
http://foros.emprear.com/php/numeros/sust_img.rar

Lo mismo, pero hecho con JavaScript quedaría así

Código HTML:
Ver original
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es" >
  5. <title>Sustituir números por gráficos - Versión Javascript</title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <meta name="description" content="x" />
  8. <meta name="keywords" content="x" />
  9. <meta http-equiv="Content-Language" content="ES" />
  10. <meta http-equiv="Content-Script-Type" content="text/javascript" />
  11. <meta http-equiv="imagetoolbar" content="no" />
  12. <meta name="copyright" content="&copy; 2006, Guillermo Gianello" xml:lang="es" lang="es" />
  13. <meta name="author" content="http://emprear.com"  xml:lang="es" lang="es" />
  14. <script type="text/javascript">
  15. //<![CDATA[
  16. function sust_img(numero){
  17. var img_url = 'http://foros.emprear.com/php/numeros/img/';
  18. var ext = 'gif';
  19. var lgt = numero.length;
  20.  
  21. for (i=0;i<lgt;i++){
  22. var s = numero.substr(i,1);
  23. if (s == '.'){
  24. s = "punto";
  25. }
  26. document.write("<img src='" + img_url + s + "." + ext + "' border='0' alt='' />");
  27. }
  28. document.write("<img src='" + img_url + "euro.gif' border='0' alt='' />");
  29. } //fin funcion
  30.  
  31. //]]>
  32. </head>
  33. <script type="text/javascript">
  34. //<![CDATA[
  35. sust_img('90788.3453');
  36. //]]>
  37. </body>
  38. </html>



pero seguimos con lo mismo, ¿dónde se genera tu número? y como integrarla en tu tpl

Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.