[Custom] How to incraise banner limit size

cajkan

Active Member
Hello ive noticed that banners are 100 kbs maximum

How can i incraise the limit lets say to 150kbs or 200 kbs

Thank you
 
I think it is in banners.php under sources/user_cp

Change max_size


switch ($FORM['mode']) {
case "1":
$max_size= "100"; //Regular Banner
$max_width = $CONF['max_banner_width'];
$max_height = $CONF['max_banner_height'];
$bannertype = "{$LNG['user_cp_banner_regular']}";
break;
case "2":
define ("MAX_SIZE","50"); //Big Banner
define ("WIDTH","468");
define ("HEIGHT","60");
define ("BANNERTYPE","Big");
break;
case "3":
$max_size= "100"; //Premium Banner
$max_width = $CONF['max_premium_banner_width'];
$max_height = $CONF['max_premium_banner_height'];
$bannertype = "{$LNG['premium']}";
break;
}
 

Basti

Administrator
Staff member
Yes, exactly. This is a hardcoded setting, and after some thoughts we decided not to make a admin setting out of it. 100kb is more than enoough for 88x30 button, even for a 160x600 image. Good designer will keep the kb low. This is also to help loading your site fast
 

Mark

Administrator
Staff member
Big banners = slow load time. Slow load time = bad user experience and bad modern SEO. Recommend lowering the limit from 100 down to 50 if your smart ;)
 

cajkan

Active Member
Yeah but most gaming websites use Banners wich are GIF and we do this and that

So i would like to raise up to 120kbs

but i`ll leave it 100kbs default size

Thanks for reply guys
 

Mark

Administrator
Staff member
Gif is the best choice for banners :) most professional designers know to keep animated gifs under 50KB because that is the typical maximum size ad networks allow, noob designers will only learn to keep them small if people tell them.
 

cajkan

Active Member
can i limit for Regular Banner just .jpg and .png (static) and for allow Premium .gif (animated) Banner ?
Yes that is possible, another option would be to allow JPG, PNG and GIF but then convert to JPG if user is normal, if premium then proceed with GIF.
So you will avoid errors etc... its better for user experience.

Anything that you can imagine is possible with PHP :)
 

Mark

Administrator
Staff member
can i limit for Regular Banner just .jpg and .png (static) and for allow Premium .gif (animated) Banner ?
This is not possible with the core Visiolist product, but you could write your own custom code to accomplish this.
 

Basti

Administrator
Staff member
It is possible via a new plugin hook introduced in VL 1.6

You need to make a plugin, and make file usercp_banner_upload_image_data.php
In there write
Code:
// Regular disallow gif
if ($upload_mode == 1 && $extension == "gif") {

  $TMPL['user_cp_upload_errors'] = "<h1 class=\"user_cp_upload_error\">Gif is disallowed for regular users</h1>";
  $errors = 1;
}
 
Top