The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Auto Parse Onsite URL's Details »» | |||||||||||||||||||||||||
This post is basically the same as lone text file in the zip.
Download is merely available for convenience. Here goes....... If anyone can improve upon this and/or find a way to make this a plugin, SPEAK UP!! Personally I think something like this should be standard, but hey, can't have it all. By default, vbulletin autoparses all links so most won't need a hack like this. However, I don't like offsite links so I made a plugin to clear the checkbox. https://vborg.vbsupport.ru/showthread.php?t=91390 But I love onsite links like to other threads and files which reside on my subdomain, so I put together a few file edits that will automatically call the url parser if the subdomain name is found anywhere in the text message. It's no surprise your just adding a bit more code to any/all lines which check if the parse url's box is checked, because the line that follows these is what calls the parser. The only quirk that people find odd is that it's an "all or nothing" type thing. If the message has a mixture of onsite AND offsite url's, all links will parse. Meaning it checks the message in "one lump". Please note you can pick and choose from these file modifications!! Each one works independantly and the file names should clue you as to what's what. This is by no means complete!! It merely works.... Call it a "works in progress", LOL. In /editpost.php find this: Code:
$checked['parseurl'] = 'checked="checked"'; Code:
$checked['parseurl'] = ($postinfo['parseurl']) ? 'checked="checked"' : ''; In /private.php find this: Code:
if ($vbulletin->GPC['parseurl']) Code:
if ($vbulletin->GPC['parseurl'] OR stristr($vbulletin->GPC['message'], $_SERVER['HTTP_HOST'])) ALSO In /private.php find this: Code:
'parseurl' => true, Code:
'parseurl' => false, In /profile.php find this: Code:
$signature = convert_url_to_bbcode($signature); Code:
if (stristr($signature, $_SERVER['HTTP_HOST'])) { $signature = convert_url_to_bbcode($signature); } In /usernote.php find this: Code:
if ($vbulletin->GPC['parseurl']) Code:
if ($vbulletin->GPC['parseurl'] OR stristr($vbulletin->GPC['message'], $_SERVER['HTTP_HOST'])) In /includes/class_dm.php find this: Code:
if ($this->info['parseurl']) Code:
if ($this->info['parseurl'] OR stristr($pagetext, $_SERVER['HTTP_HOST'])) Show Your Support
|
Comments |
#2
|
||||
|
||||
screen please
|
#3
|
|||
|
|||
Screen shot of what, Allen?
There's nothing to take a picture of. |
#4
|
|||
|
|||
Be careful, it looks like you're only changing some HTML in a signature when its an internal link. That might be okay for what you want to do, but it means the HTML is still there if it isnt for a subdomain.
Could open up some awful security problems if im reading it right. |
#5
|
||||
|
||||
A maybe easier, generalized and more failsafe approach:
In functions_newpost.php FIND PHP Code:
PHP Code:
PHP Code:
PHP Code:
This should take care of only autoparsing "onsite" URLs everywhere - no need to mess with Checkbox settings. Please not that it, if for xample the Board is running on http://forum.yourdomain.com and a User posts http://www.yourdomain.com, this will not be autoparsed. Also, if a User posts http://forum.yourdomain.com.mydomain...esntmatter.php or http://www.foo.bar.forum.yourdomain....esntmatter.php it will be autoparsed. @Merk There are no security issues with these Modifications. convert_url_to_bbcode() just wraps [url] around URLs - that's it. |
#6
|
|||
|
|||
Thank You KirbyDE for stepping in!!
It was very rude of me to neglect this thread and I DO apologize. I've been in a pretty deep learning mode for a couple months because I've needed a greater understanding of vbulletin for a long long time and I'm happy to say I'm coming along nicely. Back when Kirby posted this, I DID attempt his edit one time and it didn't work for my site ... and rather than question him ... I thought best to just sit back and stay inside my learning environment for a bit longer. It's not a good excuse, but it's the only one I have. Give me some time and I'll play with this again. |
#7
|
||||
|
||||
Hmm, before I posted this snippet I tested it on localhost and it seemed to work just fine.
|
#8
|
|||
|
|||
OK, first try, no workie.
All links parse with Full WYSIWYG Editing, no matter what checkbox says. I switched to Basic editor and got this error: Quote:
line 1922-1938 of class_bbcode.php PHP Code:
I believe we need to play with the 'function parse_wysiwyg_anchor'. |
#9
|
||||
|
||||
Uuh, yeah - stripos() is only available on PHP 5, haven't thought of that
Not sure about the WYSIWYG Editor, never tried that as I do not use it. |
#10
|
|||
|
|||
I have played with it and had some success ..... so let me continue.
I bet I can get this one, Kirby!! |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|