How to change image size

Discussion forum for MOD Writers regarding MOD Development.
SexProffesor
Registered User
Posts: 67
Joined: Tue Sep 21, 2010 8:47 am

How to change image size

Postby SexProffesor » Fri Oct 01, 2010 9:22 am

How to change image size because some of posts showing monster size

thanks in advance :D

Kyza
Registered User
Posts: 90
Joined: Fri Jun 25, 2010 12:18 pm
Contact:

Re: How to change image size

Postby Kyza » Fri Oct 01, 2010 11:29 am

Image size of?
Image

SexProffesor
Registered User
Posts: 67
Joined: Tue Sep 21, 2010 8:47 am

Re: How to change image size

Postby SexProffesor » Fri Oct 01, 2010 11:38 am

size of forum posts image

Kyza
Registered User
Posts: 90
Joined: Fri Jun 25, 2010 12:18 pm
Contact:

Re: How to change image size

Postby Kyza » Fri Oct 01, 2010 11:40 am

Well, what theme are you using?
Image

SexProffesor
Registered User
Posts: 67
Joined: Tue Sep 21, 2010 8:47 am

Re: How to change image size

Postby SexProffesor » Fri Oct 01, 2010 11:43 am

X-Treme blue

Pit$Bull
Former Team Member
Posts: 23099
Joined: Sat Dec 02, 2006 4:08 pm
Name: Can't Remember

Re: How to change image size

Postby Pit$Bull » Fri Oct 01, 2010 11:56 am


SexProffesor
Registered User
Posts: 67
Joined: Tue Sep 21, 2010 8:47 am

Re: How to change image size

Postby SexProffesor » Sat Oct 02, 2010 6:55 am

Brother can you explain me steps which i should to follow

pelase help me am new here

Kyza
Registered User
Posts: 90
Joined: Fri Jun 25, 2010 12:18 pm
Contact:

Re: How to change image size

Postby Kyza » Sat Oct 02, 2010 7:02 am

Create them again (smaller), then save as a .zip (with different names) then upload to
root/styles/yourstyle/imageset
Extract them, then go to:
ACP-->Styles-->Image sets-->yourtheme (click edit)

Click on the drop down menu, and change them by that.
Image

User avatar
seoforfunny
Registered User
Posts: 22
Joined: Thu Sep 30, 2010 9:20 am
Location: India

Re: How to change image size

Postby seoforfunny » Sat Oct 02, 2010 12:04 pm

Open template overall_header.html, find this:

Code: Select all

// ]]>
</script>


and add before it this simple javascript:

Code: Select all

onload_functions[onload_functions.length] = 'ca_resize_images();';
// resize images
function ca_resize_images()
{
    var ca_item, i, limit;
    limit = 600;
    ca_item = document.getElementById('page-body');
    if(ca_item && ca_item.clientWidth)
    {
        limit = ca_item.clientWidth - 250;
    }
    if(limit < 500)
    {
        limit = 500;
    }
    if(ca_item)
    {
        ca_list = ca_item.getElementsByTagName('img');
    }
    else
    {
        ca_list = document.getElementsByTagName('img');
    }
    for(i=0; i<ca_list.length; i++)
    {
        ca_item = ca_list[i];
        if(ca_item.width > limit)
        {
            if(document.all)
            {
                ca_item.style.cursor = 'hand';
            }
            else
            {
                ca_item.style.cursor = 'pointer';
            }
            ca_item.style.width = (limit - 50) + 'px';
            ca_item.onclick = function() {
                ca_item = window.open(this.src, 'image', 'width=700,height=500,resizable=1,scrollbars=1');
            }
        }
    }
}

srinu5
Registered User
Posts: 9
Joined: Fri May 23, 2014 3:03 am

Re: How to change image size

Postby srinu5 » Tue May 27, 2014 12:53 pm

seoforfunny wrote:Open template overall_header.html, find this:

Code: Select all

// ]]>
</script>


and add before it this simple javascript:

Code: Select all

onload_functions[onload_functions.length] = 'ca_resize_images();';
// resize images
function ca_resize_images()
{
    var ca_item, i, limit;
    limit = 600;
    ca_item = document.getElementById('page-body');
    if(ca_item && ca_item.clientWidth)
    {
        limit = ca_item.clientWidth - 250;
    }
    if(limit < 500)
    {
        limit = 500;
    }
    if(ca_item)
    {
        ca_list = ca_item.getElementsByTagName('img');
    }
    else
    {
        ca_list = document.getElementsByTagName('img');
    }
    for(i=0; i<ca_list.length; i++)
    {
        ca_item = ca_list[i];
        if(ca_item.width > limit)
        {
            if(document.all)
            {
                ca_item.style.cursor = 'hand';
            }
            else
            {
                ca_item.style.cursor = 'pointer';
            }
            ca_item.style.width = (limit - 50) + 'px';
            ca_item.onclick = function() {
                ca_item = window.open(this.src, 'image', 'width=700,height=500,resizable=1,scrollbars=1');
            }
        }
    }
}


Didn't work for me.. And I am using Redsilver3 style at present

WWu777
Registered User
Posts: 345
Joined: Tue Aug 14, 2007 12:40 pm
Contact:

Re: How to change image size

Postby WWu777 » Sat Oct 11, 2014 7:27 pm

seoforfunny wrote:Open template overall_header.html, find this:

Code: Select all

// ]]>
</script>


and add before it this simple javascript:

Code: Select all

onload_functions[onload_functions.length] = 'ca_resize_images();';
// resize images
function ca_resize_images()
{
    var ca_item, i, limit;
    limit = 600;
    ca_item = document.getElementById('page-body');
    if(ca_item && ca_item.clientWidth)
    {
        limit = ca_item.clientWidth - 250;
    }
    if(limit < 500)
    {
        limit = 500;
    }
    if(ca_item)
    {
        ca_list = ca_item.getElementsByTagName('img');
    }
    else
    {
        ca_list = document.getElementsByTagName('img');
    }
    for(i=0; i<ca_list.length; i++)
    {
        ca_item = ca_list[i];
        if(ca_item.width > limit)
        {
            if(document.all)
            {
                ca_item.style.cursor = 'hand';
            }
            else
            {
                ca_item.style.cursor = 'pointer';
            }
            ca_item.style.width = (limit - 50) + 'px';
            ca_item.onclick = function() {
                ca_item = window.open(this.src, 'image', 'width=700,height=500,resizable=1,scrollbars=1');
            }
        }
    }
}


WARNING:

I used to use the above script to resize images. But after I updated to the latest version of phpbb, the script above caused the Quick Reply button in the forum to not show. The phpbb support staff helped me find the cause and traced it to the script above. Details here:

viewtopic.php?f=46&t=2264781&p=13752816#p13752816

Here is a much better and simpler way to resize images. It involves adding one line of code to a CSS file.

viewtopic.php?p=13013284#p13013284


Return to “[3.0.x] MOD Writers Discussion”

Who is online

Users browsing this forum: TheTechGame and 12 guests