Cómo agregar leyenda a imágenes de Google y aumentar visitas

  • Autor Autor kleber
  • Fecha de inicio Fecha de inicio
Es automatico, es decir al instante porque no me funciona sino, no hay que hacer nada en el htacess?

si es automatico, usa el modo incognito del navegador, sino estas viendo tu cache.
 
si es automatico, usa el modo incognito del navegador, sino estas viendo tu cache.

cicklow, noto que el script funciona perfectamente con imágenes .jpg, pero falla en .gif y .png.

Saludos
 
Última edición:
[MENTION=9679]cicklow[/MENTION] necesito tu ayuda, actualmente tengo esto en mi .htaccess:

Insertar CODE, HTML o PHP:
RewriteCond %{HTTP_HOST} ^www.thisburrito.com$ [OR]
RewriteCond %{HTTP_HOST} ^thisburrito.com$
RewriteRule ^post(.*)$ "http://thisburrito.com" [R=301,L]

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

La redireccion 301 influye en algo?

Si cambio todo eso por tu codigo del hack 1 y 2:

Insertar CODE, HTML o PHP:
Options +FollowSymLinks
Options -Indexes
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?thisburrito\.com/ [NC]
RewriteRule ^([^thumb].*\.[jJ].*)$ /save.php?img=$1 [L]
RewriteCond %{HTTP_USER_AGENT} !(googlebot-image|msnbot|psbot|yahoo-mmcrawler) [NC]
RewriteRule \.(bmp|gif|jpe?g|png)$ /go.php [L]

Cuando intento cargar cualquier sitio dentro de la web me salta un error 404:

Captura.PNG


Coloque este go.php con este codigo:

Insertar CODE, HTML o PHP:
<?php 
@set_time_limit(0);
	//Cargamos el archivo de WP
	require_once(dirname(__FILE__) . '/wp-config.php');

	//vemos que imagen quiere ver el usuario
	$IMG = $_SERVER['REQUEST_URI'];
	if($IMG=="") $IMG = $_SERVER['REDIRECT_URL'];
	//Sacamos lo que no necesitamos
	$IMG = str_replace('/wp-content/uploads/','',$IMG);

	//Creamos la cosnulta SQL
	$SQL = $wpdb->get_results("SELECT * FROM ".$wpdb->posts." WHERE `post_type`='attachment' AND `guid` LIKE '%".$IMG."%' LIMIT 0,1;");

	//Verificamos si el post_parent (id del padre) es vacio
	if($SQL[0]->post_parent==""){
		//Si es vacio redireccionamos al inicio del blog
		echo '&lt;meta http-equiv=&quot;refresh&quot; content=&quot;0; url=/&quot;&gt;Loading...';
	}else{
		//Sino es vacio visualizamos el post!
		wp_redirect(get_permalink($SQL[0]->post_parent));
	}
	die();
?>

y este save.php:

Insertar CODE, HTML o PHP:
<?php
	//Obtenemos la imagen
	$img = $_GET['img'];

	//Evitamos que se cachee la imagen
	header("Expires: Tue, 03 Jul 2001 06:00:00 GMT");
	header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
	header("Cache-Control: no-store, no-cache, must-revalidate");
	header("Cache-Control: post-check=0, pre-check=0", false);
	header("Pragma: no-cache");
	header('Content-type: image/jpeg');

	//obtenemos la extencion del archivo
	$filetype = substr($img,strlen($img)-4,4);

	//Vemos que tipo de archivo es
	$filetype = strtolower($filetype);
	if($filetype == ".gif") $image = imagecreatefromgif($img);
	if($filetype == ".jpg") $image = imagecreatefromjpeg($img);
	if($filetype == ".png") $image = imagecreatefrompng($img);
	if (!$image) die();
 
	//obtenemos el tamaño de la imagen
	$img_w = imagesx($image);
	$img_h = imagesy($image);

	//Si el tamaño de la imagen es menor a 150 no hacemos nada
	if ($img_w < "50") {
		imagejpeg($image, null, $q); die();
	}

	//Color negro transparente, el valor 30 es la transparencia
	$TT = imagecolorallocatealpha($image, 0, 0, 0, 30);
	//Color blanco
	$color = imagecolorallocate($image,255,255,255);
	//Creamos un rectangulo que tape toda la imagen
	imagefilledrectangle($image, 0, 0, imagesx($image), imagesy($image), $TT);
	//Agregamos el texto
	imageCenterString($image,5,'Click para Ver Imagen',$color);

	//Creamos la imagen en pantalla
	imagejpeg($image, null, 100);
	//Vaciamos la memoria
	imagedestroy($image);

	//Esta funcion esta encargada de centrar el texto en la imagen
	function imageCenterString(&$img, $font, $text, $color){
	    if($font < 0 || $font > 5){ $font = 0; }
	    $num = array(array(4.6, 6),
                 array(4.6, 6),
                 array(5.6, 12),
                 array(6.5, 12),
                 array(7.6, 16),
                 array(8.5, 16));
	    $width = ceil(strlen($text) * $num[$font][0]);
	    $x     = imagesx($img) - $width - 8;
	    $y     = Imagesy($img) - ($num[$font][1] + 2);
	    imagestring($img, $font, $x/2, $y/2, $text, $color);
	}
?>

ambos en el directorio raiz del blog, junto al .htaccess.

Que estoy haciendo mal? Empeze tratando de hacer los primeros hack y luego pensaba probar el 4 y 5 pero como no anduvieron estos no continue..
 
[MENTION=9679]cicklow[/MENTION] necesito tu ayuda, actualmente tengo esto en mi .htaccess:

Insertar CODE, HTML o PHP:
RewriteCond %{HTTP_HOST} ^www.thisburrito.com$ [OR]
RewriteCond %{HTTP_HOST} ^thisburrito.com$
RewriteRule ^post(.*)$ "http://thisburrito.com" [R=301,L]

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

La redireccion 301 influye en algo?

Si cambio todo eso por tu codigo del hack 1 y 2:

Insertar CODE, HTML o PHP:
Options +FollowSymLinks
Options -Indexes
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?thisburrito\.com/ [NC]
RewriteRule ^([^thumb].*\.[jJ].*)$ /save.php?img=$1 [L]
RewriteCond %{HTTP_USER_AGENT} !(googlebot-image|msnbot|psbot|yahoo-mmcrawler) [NC]
RewriteRule \.(bmp|gif|jpe?g|png)$ /go.php [L]

Cuando intento cargar cualquier sitio dentro de la web me salta un error 404:

Captura.PNG


Coloque este go.php con este codigo:

Insertar CODE, HTML o PHP:
<?php 
@set_time_limit(0);
	//Cargamos el archivo de WP
	require_once(dirname(__FILE__) . '/wp-config.php');

	//vemos que imagen quiere ver el usuario
	$IMG = $_SERVER['REQUEST_URI'];
	if($IMG=="") $IMG = $_SERVER['REDIRECT_URL'];
	//Sacamos lo que no necesitamos
	$IMG = str_replace('/wp-content/uploads/','',$IMG);

	//Creamos la cosnulta SQL
	$SQL = $wpdb->get_results("SELECT * FROM ".$wpdb->posts." WHERE `post_type`='attachment' AND `guid` LIKE '%".$IMG."%' LIMIT 0,1;");

	//Verificamos si el post_parent (id del padre) es vacio
	if($SQL[0]->post_parent==""){
		//Si es vacio redireccionamos al inicio del blog
		echo '<meta http-equiv="refresh" content="0; url=/">Loading...';
	}else{
		//Sino es vacio visualizamos el post!
		wp_redirect(get_permalink($SQL[0]->post_parent));
	}
	die();
?>

y este save.php:

Insertar CODE, HTML o PHP:
<?php
	//Obtenemos la imagen
	$img = $_GET['img'];

	//Evitamos que se cachee la imagen
	header("Expires: Tue, 03 Jul 2001 06:00:00 GMT");
	header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
	header("Cache-Control: no-store, no-cache, must-revalidate");
	header("Cache-Control: post-check=0, pre-check=0", false);
	header("Pragma: no-cache");
	header('Content-type: image/jpeg');

	//obtenemos la extencion del archivo
	$filetype = substr($img,strlen($img)-4,4);

	//Vemos que tipo de archivo es
	$filetype = strtolower($filetype);
	if($filetype == ".gif") $image = imagecreatefromgif($img);
	if($filetype == ".jpg") $image = imagecreatefromjpeg($img);
	if($filetype == ".png") $image = imagecreatefrompng($img);
	if (!$image) die();
 
	//obtenemos el tamaño de la imagen
	$img_w = imagesx($image);
	$img_h = imagesy($image);

	//Si el tamaño de la imagen es menor a 150 no hacemos nada
	if ($img_w < "50") {
		imagejpeg($image, null, $q); die();
	}

	//Color negro transparente, el valor 30 es la transparencia
	$TT = imagecolorallocatealpha($image, 0, 0, 0, 30);
	//Color blanco
	$color = imagecolorallocate($image,255,255,255);
	//Creamos un rectangulo que tape toda la imagen
	imagefilledrectangle($image, 0, 0, imagesx($image), imagesy($image), $TT);
	//Agregamos el texto
	imageCenterString($image,5,'Click para Ver Imagen',$color);

	//Creamos la imagen en pantalla
	imagejpeg($image, null, 100);
	//Vaciamos la memoria
	imagedestroy($image);

	//Esta funcion esta encargada de centrar el texto en la imagen
	function imageCenterString(&$img, $font, $text, $color){
	    if($font < 0 || $font > 5){ $font = 0; }
	    $num = array(array(4.6, 6),
                 array(4.6, 6),
                 array(5.6, 12),
                 array(6.5, 12),
                 array(7.6, 16),
                 array(8.5, 16));
	    $width = ceil(strlen($text) * $num[$font][0]);
	    $x     = imagesx($img) - $width - 8;
	    $y     = Imagesy($img) - ($num[$font][1] + 2);
	    imagestring($img, $font, $x/2, $y/2, $text, $color);
	}
?>

ambos en el directorio raiz del blog, junto al .htaccess.

Que estoy haciendo mal? Empeze tratando de hacer los primeros hack y luego pensaba probar el 4 y 5 pero como no anduvieron estos no continue..

es que no tienes que cambiar TODO por mi code... solo tienes que agregar mi code...
PHP:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.thisburrito.com$ [OR]
RewriteCond %{HTTP_HOST} ^thisburrito.com$
RewriteRule ^post(.*)$ "http://thisburrito.com" [R=301,L]

RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?thisburrito\.com/ [NC]
RewriteRule ^([^thumb].*\.[jJ].*)$ /save.php?img=$1 [L]
RewriteCond %{HTTP_USER_AGENT} !(googlebot-image|msnbot|psbot|yahoo-mmcrawler) [NC]
RewriteRule \.(bmp|gif|jpe?g|png)$ /go.php [L]

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress


---------- Post added 05-mar-2013 at 12:39 ----------

cicklow, noto que el script funciona perfectamente con imágenes .jpg, pero falla en .gif y .png.

Saludos

sisis es que quedo en mi test y dsp no lo edite... XD
PHP:
\.(bmp|gif|jpe?g|png)$
 
Bien ya corregi el tema del error 404 pero no veo funcionando el script, el que me anda bien es el de la redireccion con go.php, pero el otro no, ahora estoy probando el hack4 con el fondo.png pero no lo veo sobre ninguna imagen...
 
sisis es que quedo en mi test y dsp no lo edite... XD
PHP:
\.(bmp|gif|jpe?g|png)$

Y donde añado esto, en save.php supongo. Pero antes o después de qué.. 😱
 
Es raro pero no lo veo en Chrome ni Firefox pero si anda en Internet Explorer, alguien sabe porque puede ser? [MENTION=9679]cicklow[/MENTION] [MENTION=20584]pazquito[/MENTION] [MENTION=4380]DoctorPC[/MENTION]
 

Ok, Gracias de nuevo :encouragement:

---------- Post agregado el 06-mar-2013 hora: 23:13 ----------

Me da fallo en el servidor si añado esa linea, algo hago mal... :grumpy:

Lo he puesto de esta manera:
Insertar CODE, HTML o PHP:
Options +FollowSymLinks
    Options -Indexes
    RewriteEngine on

    RewriteCond %{HTTP_REFERER} ^(.*)blank\.html [NC]
    RewriteRule ^([^thumb].*\.[jJ].*)$ /save.php?img=$1 [L]
    RewriteRule \.(bmp|gif|jpe?g|png)$ /go.php [L]
Y el resultado es el mismo, solo en las .jpg me sale el cartel, en gif, png no me sale.

Que tengo mal? Gracias y saludos
 
Última edición:
[MENTION=9679]cicklow[/MENTION]
Che, hago eso del hack 4... Subo los archivos a las capetas raiz, pero no funciona.. Y he entrado en modo incorgnito en los 3 exploradores....
y los archivos los descargue tal cual de aca:
Hack 4 – Google Imagenes | Cicklow
 
Última edición:
gran trabajo pero algún fallo tengo en .htaccess, si coloco el código tal cual no veo las imágenes en chrome :ambivalence:
 
Lo que no entiendo de esos sitios que explican como hacerlo es el por qué no lo tienen implementado... Deja poco para fiar en buenos resultados...
 
Atrás
Arriba