MyBB Community Forums

Full Version: Image in full size or thumbnail
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I want to give the option for my members to choose between full size or thumbnail for the attachments.
The thumbnail case is already set by the admin CP and I've duplicate the button to insert the attachment in the textarea :
[attachment=24640]
The code of the buttons are :
<input type="button" class="button" name="insert" value="{$lang->insert_attachment_post}" onclick="clickableEditor.insertAttachment({$attachment['aid']});" />
So i need to change the "onclick" data.
I know that image can be insert in full size when we put this code in the post :
[img]http://tonsite.com/attachment.php?aid=X[/img]
where X is the number of attachment, call from the database
But i don't know how to do for that my second button insert this in my textarea like for the thumbnail.

I think it's good, maybe it's not the good way but i will explain if somebody want to do this in his forum or correct me ^^ :
In the file editor.js, i've found the javascript for the first button, i duplicate it and change until it work for the real size. So in the end of the file, now, i've got :
insertAttachment: function(aid)
	{
		this.performInsert("[attachment="+aid+"]", "", true, false);
	},
	
	insertRealAttachment: function(aid)
	{
		this.performInsert("[img]http://www.mangas-arigatou.org/forum/attachment.php?aid="+aid+"[/img]");
	}

And my template "post_attachments_attachment_postinsert" is :
<input type="button" class="button" name="insert" value="{$lang->insert_attachment_miniature_post}" onclick="clickableEditor.insertAttachment({$attachment['aid']});" />
<input type="button" class="button" name="insert" value="{$lang->insert_attachment_taille_reelle_post}" onclick="clickableEditor.insertRealAttachment({$attachment['aid']});" />

a good idea

but compressed files zip, rar.. problem Smile