Advertisement
diabliyo

sharing

Nov 29th, 2011
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.12 KB | None | 0 0
  1. <?php
  2. /*
  3. Script para Compartir Informacion (publicidad) en las diversas redes sociales y de bloggin
  4.  
  5. Autor M.S.I Angel Cantu Jauregui <angel.cantu@sie-group.net>
  6. Date 01 01 2006, 08:00:00 PM +GTM
  7. Blog http://lab.sie-group.net/
  8. */
  9.  
  10. /*
  11. MAILING DB's
  12.  
  13. # la base de datos MAILING_STATUS registra todos los envios realizados de e-marketing mediante el sistema web de e-marketing,
  14. # permitiendo dar una exclusividad a cada publicidad que se le inicia una campania de envios, en esta table solo y unicamente
  15. # existira un ID para cada campania e hira contabilizando los clicks y vistas totales.
  16. # cabe mencionar que la base de datos CONTROL_SPAM y MAILING_STATUS comparten un mismo ID referente a la publicidad o
  17. # campana emprendida.
  18. create table MAILING_STATUS
  19.             (
  20.             ID VARCHAR(20) UNIQUE PRIMARY KEY,
  21.             VISTAS VARCHAR(10) not NULL,
  22.             CLICKS VARCHAR(10) not NULL,
  23.             FECHA VARCHAR(50) not NULL
  24.             );
  25.  
  26. # la base de datos MAILING_LOG registra en tiempo real los clicks y vistas por IP, permitiendo dar un mejor control sobre la
  27. # hora, dia, anio, ip y tipo de accion (c= click, v= vista), tambien se guarda el ID de la campania registrada en MAILING_STATUS.
  28. create table MAILING_LOG
  29.             (
  30.             ID VARCHAR(10) not NULL PRIMARY KEY,
  31.             ID_PUB VARCHAR(20) not NULL,  
  32.             CAP VARCHAR(10) not NULL,
  33.             IP VARCHAR(20) not NULL,
  34.             GEO VARCHAR(30) not NULL,
  35.             FECHA VARCHAR(50) not NULL
  36.             );
  37.            
  38. create table MAILING_LOG(ID VARCHAR(10) not NULL PRIMARY KEY,ID_PUB VARCHAR(20) not NULL,CAP VARCHAR(10) not NULL,IP VARCHAR(20) not NULL,GEO VARCHAR(30) not NULL, FECHA VARCHAR(50) not NULL);
  39. create table MAILING_STATUS(ID VARCHAR(20) UNIQUE PRIMARY KEY,VISTAS VARCHAR(10) not NULL,CLICKS VARCHAR(10) not NULL,FECHA VARCHAR(50) not NULL);
  40.  
  41. */
  42.  
  43. include( "admin/config.php" );
  44. include( "admin/funciones.php" );
  45. include( "admin/base.php" );
  46. include( "admin/UsO__.php" );
  47. include( "modulos/modulos.php" );
  48. include( "admin/short_urls.php" );
  49.  
  50. if( isset( $_GET["id"] ) )
  51.     {
  52.     $id_pub= proteger_cadena($_GET["id"]); // protegermos cadena
  53.     $cons= consultar_con( "MAILING_STATUS", "ID='". $id_pub. "'" ); //consultamos valores segun el ID
  54.    
  55.     if( mysql_num_rows($cons) )
  56.         {
  57.         $cons_share= consultar_con( "PRE_CAMPANA", "ID_CAMPAIN='". $id_pub. "'" ); //consultamos anuncio completo
  58.         $buf= mysql_fetch_array($cons_share);
  59.         $net= proteger_cadena($_GET["net"]); //protegemos variable
  60.        
  61.         if( !strcmp($net, "digg") || !strcmp($net, "delicious") || !strcmp($net, "facebook") || !strcmp($net, "google_bookmarks") || !strcmp($net, "barrapunto") || !strcmp($net, "meneame") ||
  62.                 !strcmp($net, "technorati") || !strcmp($net, "twitter") || !strcmp($net, "yahoo_bookmarks") || !strcmp($net, "identica") || !strcmp($net, "live") || !strcmp($net, "bitacoras") )
  63.             {
  64.             # $contenido= is_gd($_SERVER['HTTP_HOST'].'/'.$buf["DATA"], null);
  65.             $categoria= consultar_datos_general( "CATEGORIAS", "ID='". proteger_cadena($buf["CATEGORIA"]). "'", "NOMBRE_URL" );
  66.             $subcat= consultar_datos_general( "CATEGORIAS", "ID='". proteger_cadena($buf["SUB_CATEGORIA"]). "'", "NOMBRE_URL" );
  67.             $tiny_cont= is_gd(url_amigable("?id_camp=". $buf["ID"]. "&subcat=". $subcat. "&cat=". $categoria, $buf["TITULO"], "contenido", 0), null);
  68.             $contenido= url_amigable("?id_camp=". $buf["ID"]. "&subcat=". $subcat. "&cat=". $categoria, $buf["TITULO"], "contenido", 0);
  69.             $titulo= strtolower(urlencode(url_cleaner_tinymsg(desproteger_cadena($buf["TITULO"]))));
  70.             $tags= '#'. strtolower(get_ubicacion($buf["ALCANCE"], "ciudad"));
  71.            
  72.             if( !strcmp($net, "digg") )
  73.                 $url= 'http://digg.com/submit?phase=2&url='. $contenido. '&bodytext='. $titulo;
  74.             else if( !strcmp($net, "delicious") )
  75.                 $url= 'http://delicious.com/post?url='. $contenido. '&title='. $titulo. '&notes='. $contenido;
  76.             else if( !strcmp($net, "facebook") )
  77.                 $url= 'http://www.facebook.com/share.php?u='. $contenido. '&title='. $titulo. '&annotation='. $contenido;
  78.             else if( !strcmp($net, "google_bookmarks") )
  79.                 $url= 'http://www.google.com/bookmarks/mark?op=edit&bkmk='. $tiny_cont. '&title='. $titulo. '&annotation='. $contenido;
  80.             else if( !strcmp($net, "barrapunto") )
  81.                 $url= 'http://barrapunto.com/submit.pl?subj='. $titulo. '&story='. $contenido;
  82.             else if( !strcmp($net, "meneame") )
  83.                 $url= 'http://meneame.net/submit.php?url='. $tiny_cont;
  84.             else if( !strcmp($net, "technorati") )
  85.                 $url= 'http://technorati.com/faves?add='. $contenido;
  86.             else if( !strcmp($net, "twitter") )
  87.                 $url= 'http://twitter.com/?status='. $titulo. ' '. $tiny_cont. ' '. $tags;
  88.             else if( !strcmp($net, "yahoo_bookmarks") )
  89.                 $url= 'http://bookmarks.yahoo.com/toolbar/savebm?u='. $contenido. '&t='. $titulo. '&opener=bm&ei=UTF-8&d='. $contenido;
  90.             else if( !strcmp($net, "identica") )
  91.                 $url= 'http://identi.ca/notice/new?status_textarea='. $contenido;
  92.             else if( !strcmp($net, "live") )
  93.                 $url= 'https://favorites.live.com/quickadd.aspx?marklet=1&url='. $tiny_cont. '&title='. $titulo;
  94.             else if( !strcmp($net, "bitacoras") )
  95.                 $url= 'http://bitacoras.com/anotaciones/'. $tiny_cont;
  96.             else if( !strcmp($net, "buzz") )
  97.                 $url= 'http://www.google.com/reader/link?url='. $tiny_cont. '&title='. $titulo;
  98.            
  99.             header( "Location: ". $url );
  100.            
  101.             unset($buf, $net);
  102.             }
  103.         else
  104.             echo 'La red social elejida no existe.';
  105.         }
  106.     else
  107.         echo "Este anuncio no esta regitrado en nuestra base de datos.";
  108.        
  109.     limpiar($cons);
  110.     limpiar($cons_share);
  111.     unset($id_pub);
  112.     }
  113. else
  114.     {
  115.     $msg='<h1>IMPORTANTE</h1><p>Nuestro sistema de Mailing es un sistema legal, funcional y 100% seguro.<p>Debido a que nuestros clientes y la informacion que los mismos comparten
  116.     con nosotros son de <b>caracter privado</b>, nos reservamos el derecho de capturar su <b>Direccion IP</b> por un lapso de <i>2 dias</i> por cuestiones de seguridad.
  117.     <p>La direccion IP que capturamos de su equipo nos servira para efectos de investigacion en caso que nuestro sistema de mailing e informacion de nuestros clientes se viesen comprometidos
  118.     por esta razon le aconsejamos <b>por favor</b> no intente buscar bugs o burlar nuestros sistemas.<p>Atentamente.<p><h2>SIE-Group
  119.     <br>servicios@sie-group.net<br>http://www.sie-group.net/';
  120.     echo $msg;
  121.     }
  122. ?>
  123.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement