The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Problem with "Resize picture code" of Forumotion?

2 posters

Go down

Problem with "Resize picture code" of Forumotion? Empty Problem with "Resize picture code" of Forumotion?

Post by exterminator November 27th 2009, 4:03 pm

Resize picture code of Forumtion doesn't work. I have checked the default code, it's shorter. What will i do?

This is code in my template :

Code:
<!-- BEGIN switch_image_resize -->
<script type="text/javascript">
//<![CDATA[
$(function(){
   $('.postbody img').not('.signature_div img').css('display','none');
});
$(window).load(function(){
   $('.postbody img').not('.signature_div img').each(function(){
      if ( ( $(this).width() > {switch_image_resize.IMG_RESIZE_WIDTH} && {switch_image_resize.IMG_RESIZE_WIDTH} != 0 ) || ( $(this).height() > {switch_image_resize.IMG_RESIZE_HEIGHT} && {switch_image_resize.IMG_RESIZE_HEIGHT} != 0 ) ) {
         $(this).before(document.createElement('div')).prev().click(function(){
            return false;
         }).addClass('resizebox gensmall clearfix').append(document.createElement('div')).children().addClass('resize_border clearfix').append(document.createElement('div')).children().addClass('resize_content clearfix').append(document.createElement('a')).children().addClass('enlarge').attr('href', '#').text('[Phóng To Ảnh]').click(function(){
            $(this).parent().parent().parent().next().css('display','none').attr('resizeWidth', $(this).parent().parent().parent().next().width()).width('');
            $(this).parent().parent().parent().next().width($(this).parent().parent().parent().next().width() > ($('html').attr('dir') != 'rtl' ? $(this).closest('td').width() - $(this).parent().parent().parent().offset().left + $(this).closest('td').offset().left : $(this).parent().parent().parent().width() + $(this).parent().parent().parent().offset().left - $(this).closest('td').offset().left) ? $('html').attr('dir') != 'rtl' ? $(this).closest('td').width() - $(this).parent().parent().parent().offset().left + $(this).closest('td').offset().left : $(this).parent().parent().parent().width() + $(this).parent().parent().parent().offset().left - $(this).closest('td').offset().left : '').css('display','inline');
            $(this).css('display','none').next('a.resize').css('display','inline-block');
            $(this).parent().parent().parent().width('').width($(this).parent().parent().parent().next().width());
            return false;
         }).parent().append(document.createElement('a')).children().next().addClass('resize').attr('href','#').text('[Thu Nhỏ Ảnh]').click(function(){
            $(this).parent().parent().parent().next().width(parseInt($(this).parent().parent().parent().next().attr('resizeWidth'))).removeAttr('resizeWidth');
            $(this).css('display','none').prev('a.enlarge').css('display','inline-block');
            $(this).parent().parent().parent().width('').width($(this).parent().parent().parent().next().width());
            return false;
         }).parent().append(document.createElement('div')).children('a.resize').next().addClass('resize_filler').text(' ').parent().append(document.createElement('a')).children('div.resize_filler').next().addClass('fullsize').attr('href','#').click(function(){
            window.open('/viewimage.forum?u=' + encodeURIComponent($(this).parent().parent().parent().next().attr('src')));
            return false;
         }).attr('target', '_blank').text('[Kích Thước Thật]');
         if ($(this).width() > ($('html').attr('dir') != 'rtl' ? $(this).closest('td').width() - $(this).prev().offset().left + $(this).closest('td').offset().left : $(this).prev().width() + $(this).prev().offset().left - $(this).closest('td').offset().left)){
            $(this).prev().find('a.fullsize').attr('href','/viewimage.forum?u=' + encodeURIComponent($(this).attr('src'))).css('display', 'inline-block');
         }
         $(this).width($(this).width() * ( ( {switch_image_resize.IMG_RESIZE_WIDTH} != 0 && ( {switch_image_resize.IMG_RESIZE_HEIGHT} == 0 || $(this).width() / $(this).height() > {switch_image_resize.IMG_RESIZE_WIDTH} / {switch_image_resize.IMG_RESIZE_HEIGHT} ) ) ? {switch_image_resize.IMG_RESIZE_WIDTH} / $(this).width() : {switch_image_resize.IMG_RESIZE_HEIGHT} / $(this).height() ) ).css('display','inline').prev().width($(this).width());
      }
   }).css('display','inline');
});
//]]>
</script>
<!-- END switch_image_resize -->

And this is the code that i see in default :

Code:
<!-- BEGIN switch_image_resize -->
<script type="text/javascript">
//<![CDATA[
$(resize_images({ 'selector' : '.postbody', 'max_width' : {switch_image_resize.IMG_RESIZE_WIDTH}, 'max_height' : {switch_image_resize.IMG_RESIZE_HEIGHT} }));
//]]>
</script>
<!-- END switch_image_resize -->

Will it work again?
exterminator
exterminator
Forumember

Male Posts : 106
Reputation : 4
Language : English, Japanese, Vietnamese, HTML, Javascript, C, C++, C#, VB.Net
Location : Hochiminh City - Vietnam

Back to top Go down

Problem with "Resize picture code" of Forumotion? Empty Re: Problem with "Resize picture code" of Forumotion?

Post by Double W November 28th 2009, 8:37 pm

can you tell where I can paste it in Admin cp?
avatar
Double W
New Member

Posts : 9
Reputation : 0
Language : English, Russian, Vietnamese

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum