bonjour, suite à une idée lancé sur une autre discussion pour avoir un lien qui permettrait d'uploader directement une image depuis le forum
je suis tombé sur ce javascript qui est facilement implémentable sur le forum
// MOD Title: Simple Image Upload
// MOD Author: Sium < admin@postimage.org > (N/A) http://postimage.org/
// MOD Version: 1.4.0
var postimage_lang="french";
var postimage_add_text="Ajouter une image";
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 false;}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{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/i)){postimage_div=document.createElement('div');postimage_open=document.createElement('a');postimage_open.innerHTML=postimage_add_text;postimage_open.href="javascript:void(0)";postimage_open.setAttribute('onclick',"window.open('http://postimage.org/index.php?mode=fluxbb&areaid="+postimage_i+"&hash=1&lang="+postimage_lang+"&code=&content=&forumurl='+escape(document.location.href),'postimage','resizable=yes,width=500,height=400');return false;");postimage_span=document.createElement('span');postimage_span.setAttribute('style',"font-weight:bold");postimage_span.innerHTML=" • ";postimage_div.appendChild(document.createElement('br'));postimage_div.appendChild(postimage_span);postimage_div.appendChild(postimage_open);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);}}}}if(window.addEventListener){window.addEventListener('DOMContentLoaded',postimage_insert,false);}else if(window.attachEvent){window.attachEvent('onload',postimage_insert);}
le but étant de passer par
http://pix.tdct.org il suffit de modifier
http://postimage.org/index.php?mode=fluxbb&areaid=\"+postimage_i+\"&hash=1&lang=\"+postimage_lang+\"&code=&content=&forumurl='+escape(document.location.href),'postimage','resizable=yes,width=500,height=400
en
http://pix.tdct.org
mais bon le reste du code doit être simplifiable n'y connaissant rien en javascript je compte sur votre aide