Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Auto Parse Onsite URL's Details »
Auto Parse Onsite URL's
Mod Version: 1.00, by Mr Blunt (Member) Mr Blunt is offline
Developer Last Online: Sep 2006 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.5.0 Beta 3 Rating: (0 vote - 0 average) Installs: 5
Released: 30 Jun 2005 Last Update: Never Downloads: 9
Not Supported Code Changes  

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.

http://www.vbulletin.org/forum/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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Change to this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


In /private.php find this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Change to this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


ALSO In /private.php find this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Change to this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


In /profile.php find this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Change to this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


In /usernote.php find this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Change to this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


In /includes/class_dm.php find this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Change to this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
[pre-release Auto IP/OS/IE Parse Hack] ztsky vBulletin 2.x Full Releases 4 23 Jul 2001 05:02

Comments
  #2  
Old 13 Jul 2005, 20:06
Allan's Avatar
Allan Allan is offline
 
Join Date: Jun 2003
Real name: allan
screen please
__________________
-------------------------------------------------------------------------------------------
Administrator vBulletin-Ressources.com, French vBulletin Resources.
Reply With Quote
  #3  
Old 16 Jul 2005, 20:49
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
Screen shot of what, Allen?
There's nothing to take a picture of.
Reply With Quote
  #4  
Old 16 Jul 2005, 23:42
merk merk is offline
 
Join Date: Nov 2001
Real name: Tim
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.
Reply With Quote
  #5  
Old 04 Aug 2005, 23:32
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
A maybe easier, generalized and more failsafe approach:

In functions_newpost.php
FIND

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

ABOVE that ADD

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

FIND

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

REPLACE that with

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View 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.

Last edited by KirbyDE; 04 Aug 2005 at 23:38.
Reply With Quote
  #6  
Old 24 Aug 2005, 09:44
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
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.
Reply With Quote
  #7  
Old 24 Aug 2005, 10:02
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
Hmm, before I posted this snippet I tested it on localhost and it seemed to work just fine.
Reply With Quote
  #8  
Old 24 Aug 2005, 12:42
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
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:
Fatal error: Call to undefined function: stripos() in /home/testforum/includes/functions_newpost.php on line 137
So I searched, found, and added this vbulletin function above Kirby's new function to get the basic editor WORKING CORRECTLY!!

line 1922-1938 of class_bbcode.php

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The Full Editor still parses all links but I'm still playing.

I believe we need to play with the 'function parse_wysiwyg_anchor'.

Last edited by Mr Blunt; 24 Aug 2005 at 12:52.
Reply With Quote
  #9  
Old 24 Aug 2005, 12:53
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
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.
Reply With Quote
  #10  
Old 24 Aug 2005, 12:56
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
I have played with it and had some success ..... so let me continue.
I bet I can get this one, Kirby!!
Reply With Quote
  #11  
Old 24 Aug 2005, 15:37
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
OK, how bad is this going to screw up other things??

This works for me so far, but I haven't tested very much.

Here's the old vbulletin tag wrapper for wysiwyg url's

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Here's a proposed replacement:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I only showed the whole thing so y'all don't have to research to answer question.
Naturally, editing instructions would be much shorter if the code looks good.


And funny thing about this edit is I didn't need to define the stripos so either it's using the one I defined in functions_newpost.php or else for some reason it's able to use class_bbcode.php WHEN THE TOP OF THE SCRIPT CLEARLY REQUIRES class_bbcode_alt.php (notice the _alt and that file doesn't define stripos) because obviously I'm not using php5.
:scratcheshead:


Edited to say ....
... this whole post pertains to functions_wysiwyg.php

Last edited by Mr Blunt; 24 Aug 2005 at 15:40.
Reply With Quote
  #12  
Old 24 Aug 2005, 16:13
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
Hmm, for me WYSIWYG works without the additional modifications.

I just typed (in WYSIWYG, autoaprse was checked)

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and it did not parse it.

Did you paste a URL? AFAIK there is no way to stop this from "parsing" (at least not at server-side), as this already generates <a> Tags in the Text submitted by the User, eg. the Server does not even have to detect the Links.
Reply With Quote
  #13  
Old 24 Aug 2005, 16:24
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
Most people cut n paste links sooooo yes, that's what I was doing for many of my tests (not all, no).

My proposed modification removes the tags even if the link was C&P'ed, I believe. The link will "appear to be" a link in the edit window, but will unparse when you finally post the message .... and I also remove any text which a link might be trying to hide behind (that's why I return the $href without $text).

Last edited by Mr Blunt; 24 Aug 2005 at 16:27.
Reply With Quote
  #14  
Old 24 Aug 2005, 16:33
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
I applied your modification, but that completely stops me from being able to post URLs in WYSIWYG - at least using the Icons.
If I manually wrap it in [url] it does parse - but only one time.
If I preview or edit it, it won't work until I wrap it again.
Reply With Quote
  #15  
Old 24 Aug 2005, 16:49
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
The steps I have been told for the "insert link" icon are:

Type text in message window which you will want displayed.
Highlight text.
Click Icon.
Copy your link to the box including the http://
Click OK

When I do this .... if the link was onsite .... the text will display and link will be hidden inside of it.

If the link is not onsite ... then only the unparsed link is returned to the browser and the original highlighted text is gone forever.


hmmmm ...... LOL ..... so if the href was the only text ..... would the whole thing be nullified ... hence why you got nothing?? But if so, why did my test work??

Edited to say I tried the insert a link icon again and didn't highlight any text .... the link parsed and displayed again .... so I'll bet you didn't have http on the front because without that (or without a normal www.) vbulletin has no idea it's even a link.

Last edited by Mr Blunt; 24 Aug 2005 at 16:55.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 07:22.

Layout Options | Width: Wide Color: