vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Mini Mods - IMG Cacher - SSL Keeper - Mixed Content Block Solution (https://vborg.vbsupport.ru/showthread.php?t=288060)

LifesGreatestGift 01-19-2013 02:48 AM

This is AWESOME! :)

hakkuo23 01-19-2013 04:00 AM

Here is a version that just displays the image, and doesn't save it, to save server space :)

PHP Code:

<?php

function curlHeaderCallback($query$header){
    global 
$mime;
    if(
stripos($header"content-type")!==false){
        
header(trim($header));
    }
    return 
strlen($header); 
}

$image $_GET['img'];

$query curl_init($image);
curl_setopt($queryCURLOPT_USERAGENT"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9");
curl_setopt($queryCURLOPT_CONNECTTIMEOUT ,0);
curl_setopt($queryCURLOPT_TIMEOUT10);
curl_setopt($queryCURLOPT_HEADERFUNCTION'curlHeaderCallback'); 
curl_setopt($queryCURLOPT_RETURNTRANSFER1);
$ret curl_exec($query);
echo 
$ret;


Fluke667 03-22-2013 03:08 PM

works on vb3.8 too with this:

https://vborg.vbsupport.ru/showthrea...75#post2411575


THX to kh99

bibbaman 03-26-2013 10:20 PM

Hiya, I installed the MOD. It's not working for me at the moment, the images are not saving in the cache directory do I need to CHMOD the folders to anything different from 755?

Regards Steve

bibbaman 03-27-2013 10:34 PM

I made a silly error with the uploading the whole folder instead of the contents of the folder. Now working very well cheers.

Quote:

Originally Posted by bibbaman (Post 2412468)
Hiya, I installed the MOD. It's not working for me at the moment, the images are not saving in the cache directory do I need to CHMOD the folders to anything different from 755?

Regards Steve


MegaManSec 04-08-2013 11:15 PM

I'm bumping this topic, as Mozilla is now blocking all webpages that isn't pure HTTPS. ( https://developer.mozilla.org/en-US/...ked_by_default )

skol 04-10-2013 10:24 AM

Quote:

Originally Posted by MegaManSec (Post 2415217)
I'm bumping this topic, as Mozilla is now blocking all webpages that isn't pure HTTPS. ( https://developer.mozilla.org/en-US/...ked_by_default )


It will not block "display content" like images, videos or audio.

MegaManSec 10-30-2013 09:11 PM

Quote:

Originally Posted by skol (Post 2415501)
It will not block "display content" like images, videos or audio.

It does now!

thetechgenius 08-20-2014 11:49 PM

I can't find the hook location "bbcode_img_match", its not listed in the Hook Locations. My vB version is 4.1.4.

However, when I open "class_bbcode.php" in Notepad++, I see this:

Code:


/**
        * Handles a match of the [img] tag that will be displayed as an actual image.
        *
        * @param        string        The URL to the image.
        *
        * @return        string        HTML representation of the tag.
        */
        function handle_bbcode_img_match($link, $fullsize = false)
        {
                $link = $this->strip_smilies(str_replace('\\"', '"', $link));

                // remove double spaces -- fixes issues with wordwrap
                $link = str_replace(array('  ', '"'), '', $link);

                return  ($fullsize ? '<div class="size_fullsize">' : '')  . '<img src="' .  $link . '" border="0" alt="" />'
                        . ($fullsize ? '</div>' : '');
        }

        /**

The "handle_bbcode_match" function, what is that? Should the "bbcode_match" hook location be in vB? Or am I missing something?


Edit:
I got it working by using this method: https://vborg.vbsupport.ru/showthrea...75#post2411575 (Thanks to Kh99), and I am on 4.1.4, it works great. *INSTALLED

Cadellin 09-06-2014 01:35 PM

Has anyone worked out how to expand this mod to cover custom bbcode which embeds images?


All times are GMT. The time now is 05:40 AM.

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.01370 seconds
  • Memory Usage 1,749KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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