Página 2 de 2

Re: Consulta subir imágenes a Postimage.org

Publicado: 11 Mar 2015, 14:03
por Coyote64
micontre escribió:puedes probar con la extencion TinyPic que que si añade solamente el bbcode "img" https://www.phpbb.com/community/viewtop ... &t=2297946

Le tengo micontre. Lo tengo como alternativa, lo único es que con esa extensión no permite subir desde una URL (al menos que yo sepa) y con postimage si y va genial.

El problema no es otro que ese rediccionamiento te anula el efecto lightbox y si pinchas sobre la imagen te lleva a la página de psotimage.

Muchas gracias

Re: Consulta subir imágenes a Postimage.org

Publicado: 19 Abr 2015, 18:32
por antispam2022
andares escribió: Viendo el javascript que proporcionan los de "postimage.org" para acceder a su servicio mediante una ventana emergente, creo que no es posible eliminar ese direccionamento...

A ver si algun experto en javascript opina lo contrario...

Acceso al javascript:
http://mod.postimage.org/phpbb3-spanish-hotlink.js

Lo he intentado y no hay manera, y eso que el codigo no es nada extenso y consta solo de unas pocas estructuras de control if... else y par de bucles for.

Tengo que volver a intentarlo en otro momento más calmado y refrescado.

La clave está en los valores que va tomando la variable postimage_area
que luego son escritos en el area de texto textarea:

Código: Seleccionar todo

var postimage_area=opener.document.getElementsByTagName('textarea');
Por otra parte ya he encontrado dos extensiones no oficiales que ponen el enlace • Add image to post
sin necesidad de usar la extensión "Custom Code", (a la que se le puede sacar muchisimo partido).

Esta extension para poner el enlace de postimage me ha gustado especialmente, no interfiere en la extension cBB chat, porque solo llama al jquery de postimage.org en las plantillas del editor y en respuesta rapida:
postimg-hifikabin.zip
(17.78 KiB) Descargado 136 veces

Re: Consulta subir imágenes a Postimage.org

Publicado: 19 Abr 2015, 19:44
por andares
@antispam2022:

Para solicitar soporte es necesario segun las Normas proporcionar tus datos: http://www.phpbb-es.com/foro/viewtopic.php?f=4&t=10547


Re: Consulta subir imágenes a Postimage.org

Publicado: 20 Abr 2015, 00:12
por antispam2022
Ya lo se, andares, pongo entonces ya los datos de mi foro provisional hasta que se hayan propagado las DNS del dominio que voy a usar.

Gracias y disculpas.

POSDATA: El anteponer el signo de @ a mi Nick, ¿se supone que me haria llegar una notificacion? porque no me estan funcionando bien las notificaciones de algunos temas a los que estoy subscrito.

Re: Consulta subir imágenes a Postimage.org

Publicado: 21 Abr 2015, 03:15
por antispam2022
Di con la solución, el archivo .js no tiene saltos de lína, así que lo primero que hice fué separar las lineas para que se entienda mejor (no me di cuenta que @andares ya lo tenía descomprimido), este sería el achivo final modificado:
Spoiler

Código: Seleccionar todo

// MOD Title: Simple Image Upload
// MOD Author: Sium < admin@postimage.org > (N/A) http://postimage.org/
// MOD Version: 1.5.0

if(typeof postimage_lang==='undefined')
{
	var postimage_lang="spanish";
	var postimage_add_text="Insertar una imagen";

function postimage_query_string(postimage_search_name){
	if(window.location.hash){
		postimage_query=window.location.hash.substring(1).split("&");
		for(postimage_i=0;postimage_i<postimage_query.length;postimage_i++){
			postimage_string_data=postimage_query[postimage_i].split("=");
			if(postimage_string_data[0]==postimage_search_name){
				postimage_string_data.shift();
				return unescape(postimage_string_data.join("="));
			}
		}
	}
	return void(0);
}

if(opener){
	var postimage_text=postimage_query_string("postimage_text");
	if(postimage_text){
		var postimage_id=postimage_query_string("postimage_id");
		var postimage_area=opener.document.getElementsByTagName('textarea');
		for(var postimage_i=0;postimage_i<postimage_area.length;postimage_i++){
			if(postimage_i==postimage_id){
				break;
			}
		}
		if(opener.editorHandlemessage && opener.editorHandlemessage.bRichTextEnabled){
			opener.editorHandlemessage.insertText(postimage_text+"<br /><br />",false);
		}else{
			//Añadir estas líneas
			postimage_text=postimage_text.replace('[url=','');
			postimage_text=postimage_text.replace('[/url]','');
			postimage_text = postimage_text.substring(postimage_text.indexOf('['),postimage_text.length);			postimage_area[postimage_i].value=postimage_area[postimage_i].value+postimage_text;
		}
	opener.focus();
	window.close();
	}
}


function postimage_insert(){
	var postimage_area=document.getElementsByTagName('textarea');
	for(var postimage_i=0;postimage_i<postimage_area.length;postimage_i++){
		if(!postimage_area[postimage_i].name.match(/username_list|search|recipients|coppa_mail|board_email_sig/i)){
			postimage_div=document.createElement('div');
			postimage_open=document.createElement('a');
			postimage_open.innerHTML=postimage_add_text;
			postimage_open.href="javascript:postimage_upload("+postimage_i+");";
			postimage_span=document.createElement('span');
			postimage_span.innerHTML="&#160;&#8226;&#160;";
			postimage_div.appendChild(document.createElement('br'));
			postimage_div.appendChild(postimage_span);
			postimage_div.appendChild(postimage_open);
			postimage_div.appendChild(document.createElement('br'));
			postimage_div.appendChild(document.createElement('br'));
			if(postimage_area[postimage_i].nextSibling){
				postimage_area[postimage_i].parentNode.insertBefore(postimage_div,postimage_area[postimage_i].nextSibling);
			}else{
				postimage_area[postimage_i].parentNode.appendChild(postimage_div);
			}
		}
	}
}

function postimage_upload(areaid){
	window.open("http://postimage.org/index.php?mode=phpbb3&areaid="+areaid+"&hash=1&lang="+postimage_lang+"&code=&content=family&forumurl="+escape(document.location.href),"postimage","resizable=yes,width=500,height=400");
	return void(0);
	}
	if(typeof postimage_text==='undefined'){
		if(window.addEventListener){window.addEventListener('DOMContentLoaded',postimage_insert,false);
		}else if(window.attachEvent){
			window.attachEvent('onload',postimage_insert);
		}
	}
}
Justo delante de

Código: Seleccionar todo

postimage_area[postimage_i].value=postimage_area[postimage_i].value+postimage_text;
He añadido estas líneas:

Código: Seleccionar todo

	postimage_text=postimage_text.replace('[url=','');
	postimage_text=postimage_text.replace('[/url]','');
	postimage_text = postimage_text.substring(postimage_text.indexOf('['),postimage_text.length);

Re: Consulta subir imágenes a Postimage.org

Publicado: 06 May 2015, 19:05
por thomybra
Borrado

Re: Consulta subir imágenes a Postimage.org

Publicado: 06 May 2015, 19:07
por thomybra
antispam2022 escribió:Di con la solución, el archivo .js no tiene saltos de lína, así que lo primero que hice fué separar las lineas para que se entienda mejor (no me di cuenta que @andares ya lo tenía descomprimido), este sería el achivo final modificado:
Spoiler

Código: Seleccionar todo

// MOD Title: Simple Image Upload
// MOD Author: Sium < admin@postimage.org > (N/A) http://postimage.org/
// MOD Version: 1.5.0

if(typeof postimage_lang==='undefined')
{
	var postimage_lang="spanish";
	var postimage_add_text="Insertar una imagen";

function postimage_query_string(postimage_search_name){
	if(window.location.hash){
		postimage_query=window.location.hash.substring(1).split("&");
		for(postimage_i=0;postimage_i<postimage_query.length;postimage_i++){
			postimage_string_data=postimage_query[postimage_i].split("=");
			if(postimage_string_data[0]==postimage_search_name){
				postimage_string_data.shift();
				return unescape(postimage_string_data.join("="));
			}
		}
	}
	return void(0);
}

if(opener){
	var postimage_text=postimage_query_string("postimage_text");
	if(postimage_text){
		var postimage_id=postimage_query_string("postimage_id");
		var postimage_area=opener.document.getElementsByTagName('textarea');
		for(var postimage_i=0;postimage_i<postimage_area.length;postimage_i++){
			if(postimage_i==postimage_id){
				break;
			}
		}
		if(opener.editorHandlemessage && opener.editorHandlemessage.bRichTextEnabled){
			opener.editorHandlemessage.insertText(postimage_text+"<br /><br />",false);
		}else{
			//Añadir estas líneas
			postimage_text=postimage_text.replace('[url=','');
			postimage_text=postimage_text.replace('[/url]','');
			postimage_text = postimage_text.substring(postimage_text.indexOf('['),postimage_text.length);			postimage_area[postimage_i].value=postimage_area[postimage_i].value+postimage_text;
		}
	opener.focus();
	window.close();
	}
}


function postimage_insert(){
	var postimage_area=document.getElementsByTagName('textarea');
	for(var postimage_i=0;postimage_i<postimage_area.length;postimage_i++){
		if(!postimage_area[postimage_i].name.match(/username_list|search|recipients|coppa_mail|board_email_sig/i)){
			postimage_div=document.createElement('div');
			postimage_open=document.createElement('a');
			postimage_open.innerHTML=postimage_add_text;
			postimage_open.href="javascript:postimage_upload("+postimage_i+");";
			postimage_span=document.createElement('span');
			postimage_span.innerHTML="&#160;&#8226;&#160;";
			postimage_div.appendChild(document.createElement('br'));
			postimage_div.appendChild(postimage_span);
			postimage_div.appendChild(postimage_open);
			postimage_div.appendChild(document.createElement('br'));
			postimage_div.appendChild(document.createElement('br'));
			if(postimage_area[postimage_i].nextSibling){
				postimage_area[postimage_i].parentNode.insertBefore(postimage_div,postimage_area[postimage_i].nextSibling);
			}else{
				postimage_area[postimage_i].parentNode.appendChild(postimage_div);
			}
		}
	}
}

function postimage_upload(areaid){
	window.open("http://postimage.org/index.php?mode=phpbb3&areaid="+areaid+"&hash=1&lang="+postimage_lang+"&code=&content=family&forumurl="+escape(document.location.href),"postimage","resizable=yes,width=500,height=400");
	return void(0);
	}
	if(typeof postimage_text==='undefined'){
		if(window.addEventListener){window.addEventListener('DOMContentLoaded',postimage_insert,false);
		}else if(window.attachEvent){
			window.attachEvent('onload',postimage_insert);
		}
	}
}
Justo delante de

Código: Seleccionar todo

postimage_area[postimage_i].value=postimage_area[postimage_i].value+postimage_text;
He añadido estas líneas:

Código: Seleccionar todo

	postimage_text=postimage_text.replace('[url=','');
	postimage_text=postimage_text.replace('[/url]','');
	postimage_text = postimage_text.substring(postimage_text.indexOf('['),postimage_text.length);
Hola antispam2022, tengo la misma duda que Coyote64 pero al insertar tu codigo modificado sigue exactamente igual

PD: lo guarde en mi servidor y edite los archivos para que busquen el javascript a esa direccion y tengo SMF pero creo que mas o menos lo mismo, saludos!

Re: Consulta subir imágenes a Postimage.org

Publicado: 06 May 2015, 19:47
por antispam2022
Ademas de introducir la modificacion en el archivo .js hay que indicarle que lea ese archivo de forma local, pero este sitio es para soporte de los que tienen foro phpBB, nos van a llamar la atencion, abre un hilo en la zona de charla y lo hablamos, si te apetece.

Re: Consulta subir imágenes a Postimage.org

Publicado: 06 May 2015, 19:48
por andares
@thomybra

Para solicitar soporte es necesario segun las Normas proporcionar tus datos: http://www.phpbb-es.com/foro/viewtopic.php?f=4&t=10547

El codigo de antispam2022 funciona perfecto, algo estas haciendo mal :?:

Re: Consulta subir imágenes a Postimage.org

Publicado: 06 May 2015, 22:25
por thomybra
Mil perdon les dejo el link para que lo puedan seguir y poder continuar donde deberia haber hecho el post Saludos y disculpas

http://www.phpbb-es.com/foro/viewtopic.php?f=41&t=40624