vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Miscellaneous Hacks - NoMoreGifs (https://vborg.vbsupport.ru/showthread.php?t=141493)

Zachery 03-07-2007 10:00 PM

NoMoreGifs
 
I had been working on a style for my now defunt site, while developing it, since IE7 was final and PNG's are just too cool to pass up anymore. I found it a pain to re-write all of the vBulletin templates to use the .png extension on the images. Not to mention this would make upgrading a pain in the butt.

I had Matthew make me this snipet of code. I told him I would release it and he said its fine.

So to you I now give you the ability to not have to use gif's but png's in your image folders.

You're webserver must support custom error documents via htaccess.

Installation,
Edit htaccess file to give a full/proper url to your new 404.php document
Put both the htaccess file and the 404.php file in the base of you images folder.

I only offer support when I have time. This modification is otherwise unsupported, but working.


For style developers, if you wish to use this, please give credit where credit is due :), a link back to this mod would be great.

beduino 03-08-2007 03:37 PM

Tks Zachery!
All the best
Beduino

Skavenger 03-08-2007 03:41 PM

I don't understand very well, sorry... but, is this hack something like this?

http://homepage.ntlworld.com/bobosola/

Dan 03-08-2007 03:42 PM

Awesome idea Zak :D pngs ftw

Zachery 03-08-2007 03:43 PM

No, this allows you to use all png images without having to re-write vBulletin templates to do so.

Your browser will first look for a .gif file, if its not found, it sends a 404 error and thus a broken image. We use a custom 404 file to redirect to the same named image but .png and forward it to your browser.

So for example

https://vborg.vbsupport.ru/images/cs...ser_online.gif https://vborg.vbsupport.ru/external/2010/01/8.gif
Normal image, you remove https://vborg.vbsupport.ru/images/cs...ser_online.gif and add
https://vborg.vbsupport.ru/images/cs...ser_online.png the 404 file will redirect to this instead.

Ziki 03-08-2007 07:31 PM

No vB version?

Zachery 03-08-2007 07:32 PM

It'd work for every version of vBulletin from vB Lite to vB 2020, this could even be used on other software, websites, etc.

Hornstar 03-09-2007 01:08 PM

awesome work, thanks!

Ziki 03-09-2007 10:03 PM

How can I do that to not select vb version

Zachery 03-10-2007 01:28 AM

I'm just good.

kal-L 03-10-2007 05:48 AM

:up: Great share my friend.

Subah 03-10-2007 08:12 AM

Good job but my server does not support custom error documents via htaccess :(

Zachery 03-12-2007 02:32 PM

Sadly thats not something i can fix :(

Atakan KOC 03-25-2007 06:02 PM

Thanks........

Distance 07-21-2007 09:19 PM

thanks but wont this affect the time loading images?

alessai 07-22-2007 12:36 AM

Quote:

Originally Posted by Distance (Post 1297732)
thanks but wont this affect the time loading images?

:confused: yeah i was thinking about the same thing

Zachery 07-22-2007 07:11 PM

It shouldn't.

R1lover 07-27-2007 03:23 AM

Of course it will effect the loading times, maybe not by much but it all adds up.

It will be delayed the same as any typical redirection.

slyreptile 09-15-2007 01:16 PM

Saves me a ton of time! Thanks!

SuperD 11-16-2007 08:07 PM

Quote:

Originally Posted by Zachery (Post 1198858)
Installation,
Edit htaccess file to give a full/proper url to your new 404.php document
Put both the htaccess file and the 404.php file in the base of you images folder.

Thanks for the hack and cannot wait to see it work :up:
Could anybody explain to me how to put a full/proper url to my new 404.php? dose this mean the new url after moving the file to the Images folder??? :confused:
Also I want to mention that I use PHP5, in this case should I move the file named 500.php instead?

Audentio 11-16-2007 10:52 PM

Zachery, can I release this at MyBBoard.net? A link back to you and this thread as well as full credit to you, I just want to share it with them, this is fantastic!

Zachery 11-17-2007 04:49 PM

I'll go release it over there at some point in the future.

Zachery 11-17-2007 04:49 PM

Quote:

Originally Posted by SuperD (Post 1383957)
Thanks for the hack and cannot wait to see it work :up:
Could anybody explain to me how to put a full/proper url to my new 404.php? dose this mean the new url after moving the file to the Images folder??? :confused:
Also I want to mention that I use PHP5, in this case should I move the file named 500.php instead?

You need to put a path to the file, like
http://www.mywebsite.com/forums/images/404.php

Audentio 11-18-2007 08:48 PM

Quote:

Originally Posted by Zachery (Post 1384477)
I'll go release it over there at some point in the future.

Awwwesome, tell me when you do! :)

legionofangels 04-09-2008 03:37 AM

Will this work for all images of the entire forum?

Like lets say the reputation images?

Zachery 04-09-2008 05:51 AM

ALL images.

legionofangels 04-09-2008 02:26 PM

Thanks Z, I will check it out then.

Peace

legionofangels 04-19-2008 06:02 PM

Do you have a demo site with this installed so I can preview it before using?

I'm guessing there is no way to restrict it to certain parts or certain images, rather than ALL of them is there?

Zachery 04-19-2008 07:56 PM

If you dont want to use a png, dont delete the original gif.

feldon23 04-28-2008 11:57 AM

What this thread needs is all the vBulletin graphics re-saved as transparent PNG. :)

Zachery 04-28-2008 12:33 PM

I'm not that motovated feldon ;p

StGaensler 05-02-2008 07:03 PM

I have two things to remark:

As you send a Location: header the Content-type: header doesn't matter as the browser makes a second request for the png file.

This second request takes some time so I suggest doing the "decision" directly on the server without the need of a second request. This only needs the Apache module mod_rewrite:
Code:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*)\.gif$ $1.png [NC,L]

Every non-existing gif file so gets redirected to a png file. I don't check if the png file exists but I think this doesn't matter ;)

Stefan

harakiri 05-02-2008 07:36 PM

Thanks Stefan,

it feels "faster".

Regards,
Chris

Zachery 05-02-2008 08:15 PM

Quote:

Originally Posted by StGaensler (Post 1506051)
I have two things to remark:

As you send a Location: header the Content-type: header doesn't matter as the browser makes a second request for the png file.

This second request takes some time so I suggest doing the "decision" directly on the server without the need of a second request. This only needs the Apache module mod_rewrite:
Code:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*)\.gif$ $1.png [NC,L]

Every non-existing gif file so gets redirected to a png file. I don't check if the png file exists but I think this doesn't matter ;)

Stefan

I don't always replace all of the gif files, so I prefer my version.

StGaensler 05-02-2008 08:28 PM

Your version replaces all non existant gif files with png files - am I correct? Exactly the same does my code but without causing the second (unnecessary) request.

harakiri 05-03-2008 06:41 AM

Both versions doing the _same_ thing - but in different ways.

If you have mod_rewrite on your Apache, I think the solution by Stefan is better.. else Zacherys

dannykilla 05-22-2008 11:50 PM

will this work on 3.7.0?

StGaensler 05-24-2008 12:52 PM

Don't know why it shouldn't?

dannykilla 07-04-2008 07:47 AM

I am trying to get this to work on my board which is 3.7.2 and I have followed the instructions correctly and created a image called newthread.png and then uploaded it to the correct directory and then deleted the newthread.gif but when I refresh the page I just get text saying "post new thread" and no image?
I am running vB 3.7.2, PHP 5 and I have asked my host if I have the necessary setting that this hack/mod requires and then said YES?

Anyone help me out please?
Thanks
Danny

Prezadent 07-07-2008 02:41 AM

You can easily rename a .png to a .gif and have the .png display normally in all major browsers.

No need for this hack.


All times are GMT. The time now is 06:01 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01361 seconds
  • Memory Usage 1,792KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete