vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Link Anonymizer (https://vborg.vbsupport.ru/showthread.php?t=95753)

bigmonay2k 10-22-2005 01:04 AM

Quote:

Originally Posted by MarcoH64
Sorry huys, i have been real busy the last week. I will try to have a look at the issues and the suggestions next week.

thanks dude

Moosehunter 10-25-2005 03:29 AM

Thanks Computer Angel. Works great.

Quote:

Originally Posted by Computer_Angel
This is my solution for ver 1.04:

PHP Code:

if ($post['pagetext'])
{
    if (
preg_match_all("/(\[URL=\")(.[^\"\]]*)/i"$post['pagetext'], $matches))
    {
        
$localdomains = ($vbulletin->options['mh_anolink_localaddresses'] ? explode(" "$vbulletin->options['mh_anolink_localaddresses']) : ($vbulletin->options['cookiedomain'] ? array($vbulletin->options['cookiedomain']) : array($_SERVER['SERVER_NAME'])));
        
$preg_search = array();
        
$preg_replace = array();
        
        foreach (
$matches[2] AS $key=>$serverurl)
        {
            
// Do we have a local url?
            
$parsed_url parse_url($serverurl);
            
$servername $parsed_url['host'];
            foreach (
$localdomains AS $localdomain)
            {
                if (
substr($localdomain01) == ".")
                {
                    if (
preg_match("/$localdomain$/i"$servername))
                    {
                        continue 
2;
                    }
                }
                else
                {
                    if (
$localdomain == $servername)
                    {
                        continue 
2;
                    }
                }
            }
            
$anonymurl $vbulletin->options['mh_anolink_anonymizer'] . $serverurl;            
            
//$preg_search["$servername"] = "[URL=\"$serverurl";
            
$preg_search["$servername"] = $matches[0]["$key"];
            
//$preg_replace["$servername"] = "[URL=\"" . $anonymurl;
            
$preg_replace["$servername"] = $matches[1]["$key"].$anonymurl;            
            if (
$preg_search)
            {
                
$post['pagetext'] = str_replace($preg_search$preg_replace$post['pagetext']);            
            }
        }        
    }
    
//[URL]link[/URL]
    
if (preg_match_all("/(\[URL)(])(.[^\]]*)/i"$post['pagetext'], $matches))
    {
        
$localdomains = ($vbulletin->options['mh_anolink_localaddresses'] ? explode(" "$vbulletin->options['mh_anolink_localaddresses']) : ($vbulletin->options['cookiedomain'] ? array($vbulletin->options['cookiedomain']) : array($_SERVER['SERVER_NAME'])));
        
$preg_search = array();
        
$preg_replace = array();
        
        foreach (
$matches[3] AS $key=>$serverurl)
        {
            
// Do we have a local url?
            
$parsed_url parse_url($serverurl);
            
$servername $parsed_url['host'];
            foreach (
$localdomains AS $localdomain)
            {
                if (
substr($localdomain01) == ".")
                {
                    if (
preg_match("/$localdomain$/i"$servername))
                    {
                        continue 
2;
                    }
                }
                else
                {
                    if (
$localdomain == $servername)
                    {
                        continue 
2;
                    }
                }
            }
            
$anonymurl $vbulletin->options['mh_anolink_anonymizer'] . substr($serverurl,0,strlen($serverurl)-5);
            
$preg_search["$servername"] = $matches[0]["$key"];
            
$preg_replace["$servername"] = $matches[1]["$key"]."=\"".$anonymurl."\"".$matches[2]["$key"].$serverurl;                        
            if (
$preg_search)
            {
                
$post['pagetext'] = str_replace($preg_search$preg_replace$post['pagetext']);
            }
        }        
    }




Catlover 10-25-2005 08:33 AM

How to anonimyze links in Private Messages and in signatures? Thanks for solution it works fine in posts.

dasdingansich 10-26-2005 07:06 AM

Quote:

Originally Posted by Computer_Angel
This is my solution for ver 1.04:

PHP Code:

if ($post['pagetext'])
{
    if (
preg_match_all("/(\[URL=\")(.[^\"\]]*)/i"$post['pagetext'], $matches))
    {
        
$localdomains = ($vbulletin->options['mh_anolink_localaddresses'] ? explode(" "$vbulletin->options['mh_anolink_localaddresses']) : ($vbulletin->options['cookiedomain'] ? array($vbulletin->options['cookiedomain']) : array($_SERVER['SERVER_NAME'])));
        
$preg_search = array();
        
$preg_replace = array();
        
        foreach (
$matches[2] AS $key=>$serverurl)
        {
            
// Do we have a local url?
            
$parsed_url parse_url($serverurl);
            
$servername $parsed_url['host'];
            foreach (
$localdomains AS $localdomain)
            {
                if (
substr($localdomain01) == ".")
                {
                    if (
preg_match("/$localdomain$/i"$servername))
                    {
                        continue 
2;
                    }
                }
                else
                {
                    if (
$localdomain == $servername)
                    {
                        continue 
2;
                    }
                }
            }
            
$anonymurl $vbulletin->options['mh_anolink_anonymizer'] . $serverurl;            
            
//$preg_search["$servername"] = "[URL=\"$serverurl";
            
$preg_search["$servername"] = $matches[0]["$key"];
            
//$preg_replace["$servername"] = "[URL=\"" . $anonymurl;
            
$preg_replace["$servername"] = $matches[1]["$key"].$anonymurl;            
            if (
$preg_search)
            {
                
$post['pagetext'] = str_replace($preg_search$preg_replace$post['pagetext']);            
            }
        }        
    }
    
//[URL]link[/URL]
    
if (preg_match_all("/(\[URL)(])(.[^\]]*)/i"$post['pagetext'], $matches))
    {
        
$localdomains = ($vbulletin->options['mh_anolink_localaddresses'] ? explode(" "$vbulletin->options['mh_anolink_localaddresses']) : ($vbulletin->options['cookiedomain'] ? array($vbulletin->options['cookiedomain']) : array($_SERVER['SERVER_NAME'])));
        
$preg_search = array();
        
$preg_replace = array();
        
        foreach (
$matches[3] AS $key=>$serverurl)
        {
            
// Do we have a local url?
            
$parsed_url parse_url($serverurl);
            
$servername $parsed_url['host'];
            foreach (
$localdomains AS $localdomain)
            {
                if (
substr($localdomain01) == ".")
                {
                    if (
preg_match("/$localdomain$/i"$servername))
                    {
                        continue 
2;
                    }
                }
                else
                {
                    if (
$localdomain == $servername)
                    {
                        continue 
2;
                    }
                }
            }
            
$anonymurl $vbulletin->options['mh_anolink_anonymizer'] . substr($serverurl,0,strlen($serverurl)-5);
            
$preg_search["$servername"] = $matches[0]["$key"];
            
$preg_replace["$servername"] = $matches[1]["$key"]."=\"".$anonymurl."\"".$matches[2]["$key"].$serverurl;                        
            if (
$preg_search)
            {
                
$post['pagetext'] = str_replace($preg_search$preg_replace$post['pagetext']);
            }
        }        
    }



perfect, works fine, with all kinds of links.
@Marco: maybe make this the official one, until youu find more time.

thanks guys!

take care
Flint Stelter
http://www.ddas.de

Lord Brar 10-26-2005 03:58 PM

Quote:

Originally Posted by MarcoH64
New version v1.04, should fix the reported bugs.

Will wait to see if this is working good for everyone (did some more extensive testing this time). If all is ok, i will have a look at the feature suggestions.

@dasdingansich
You can configure what anonymizer you want to use, but maybe i should change the default if that one is too much limited.

I installed it but nothing seems to happen. :( Could someone tell me where I could have gone wrong?

tokenyank 10-26-2005 07:21 PM

Marco, this seems much more robust than this one but I do not wish to use an external anon server like safeurl or whatever... Would/could this hack work using the links.php in the other hack for non-anon parsed url's?

Marco van Herwaarden 10-26-2005 09:01 PM

@tokenyank, i don't know, never looked at the other hack.

@Lord Brar
PM me MSN contact info and i will try to get in contact tomorrow.

tokenyank 10-26-2005 10:38 PM

In principal, it should work yeah? As safeurl works with a ?domain switch as does the other hack...

Hmm... I may play with it and find out for myself... Thanks anyway

Computer_Angel 10-28-2005 05:43 PM

Quote:

Marco, this seems much more robust than this one but I do not wish to use an external anon server like safeurl or whatever... Would/could this hack work using the links.php in the other hack for non-anon parsed url's?
1.You can use links.php, just config your anonymous site to your site.
Ex: http://www.xxx.com/links.php?url=
2. The hack you said is which I don't like because It modified the class_bbcode.php code, so when you upgrade to new version --> need to hack again.

tokenyank 10-30-2005 10:20 PM

Quote:

Originally Posted by Computer_Angel
1.You can use links.php, just config your anonymous site to your site.
Ex: http://www.xxx.com/links.php?url=
2. The hack you said is which I don't like because It modified the class_bbcode.php code, so when you upgrade to new version --> need to hack again.

Just to confirm, it does work, though using the settings in the AdminCP did not do anything... Almost as if they weren't saving...

I modified the xml to reflect what anon service I wanted to use though and reinstalled and it works fine!

Thanks... Installed


All times are GMT. The time now is 11:03 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.01573 seconds
  • Memory Usage 1,838KB
  • 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_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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