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 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 12:37 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.01366 seconds
  • Memory Usage 1,734KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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