vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Modifying the [url] function? (https://vborg.vbsupport.ru/showthread.php?t=107286)

Joshua5692 02-06-2006 12:28 PM

Modifying the [url] function?
 
Due to spam the owner of the board I help wants links to open in a new window through his own site in a frame. Similar to the way external links are viewed on about.com or the Google image search feature. But there is no way to edit the [ url] code from the admin panel. It is not listed with the vbcode, can anyone advise please how we add this domain to the link?

The new links would look similar to this:

http://www.hisdomain.com/link?out=http://www.submittedlink.com

Anyone please?

S@NL - BlackBik 02-06-2006 08:45 PM

You could check the class_bbcode.php in includes.
url's are parsed in there, i think.

Joshua5692 02-07-2006 01:13 PM

Thank you, it would seem we are half way there now. I found the lines. They look like this....
Code:

function handle_bbcode_url($text, $link)
        {
                $rightlink = trim($link);
                if (empty($rightlink))
                {
                        // no option -- use param
                        $rightlink = trim($text);
                }
                $rightlink = str_replace(array('`', '"', "'", '['), array('`', '"', ''', '['), $this->strip_smilies($rightlink));

                if (!preg_match('#^[a-z0-9]+(?<!about|javascript|vbscript):#si', $rightlink))
                {
                        $rightlink = "http://$rightlink";
                }

                if (!trim($link) OR $text == $rightlink)
                {
                        $tmp = unhtmlspecialchars($rightlink);
                        if (vbstrlen($tmp) > 55 AND $this->is_wysiwyg() == false)
                        {
                                $text = htmlspecialchars_uni(substr($tmp, 0, 36) . '...' . substr($tmp, -14));
                        }
                }

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

                // standard URL hyperlink
                return "<a href=\"$rightlink\" target=\"_blank\">$text</a>";
        }

So I see at the end the hyperlink return, that is where I assumed I would add the domain the way we need for the script to work. However, I have tried several different ways of adding it and can't seem to get the proper syntax, up to this point PHP seemed fairly easy the past year or so.

Can anyone give a suggestion? I keep getting the following error:
Code:

Parse error: parse error, unexpected T_STRING in /domainname/public_html/forum/includes/class_bbcode.php on line 1705
Line 1705 is the hyperlink return line.

Again what we need the rendered as is :

http://www.hisdomain.com/link?out=http://www.link.com
I assume too that $rightlink is the submitted link. Can anyone help out with the proper php format for adding the additional domain before the submitted?

Joshua5692 03-03-2006 11:42 AM

Seriously, nobody can help with that last sentence? :(

Iain M 03-03-2006 01:45 PM

you could use the redirection page from this hack

https://vborg.vbsupport.ru/showthrea...threadid=91021

and the options from this hack

https://vborg.vbsupport.ru/showthread.php?t=95753


All times are GMT. The time now is 07:29 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.01086 seconds
  • Memory Usage 1,724KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete