The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
||||
|
||||
According to the vB team, WYSIWYG will always parse, so it'll have to be a hack, apparently.
|
#12
|
|||
|
|||
Hey guys,
I'm a new kid on the block here. Long time user and supermoderator. First time I've been responsible for a whole server though. :banana: I've been having a blast for the last couple months learning about vbulletin, tweaking styles, testing tweaks, installing hacks into php files, upgrading from 2.3.4 to various 3.0 versions, transferring databases, transferring servers, etc...... mainly everything from scratch on my own (with the assistance of some fine readings available!!! YOU GUYS ROCK AROUND HERE!!!!). I've been wanting to tip my hat and say thanks and maybe nows the time as maybe I can help with this thread. :up: My guys didn't want outside links on the board so I made the 3 small mods to newreply, newthread, and private. All went well and it works beautiful for standard. So I was playing with that WYSIWYG Editor and like the thread here says, even if the checkmark is off, the links still parse. So I tried something and it works in WYSIWYG Editor:
So can a hack be made to force the WYSIWYG editor to look at the "auto pase links in text" and if no checkmark, when the user clicks "Submit Reply", have a script highlight the whole text and then call the "Remove Links" button?? .....like maybe in the includes/functions_wysiwyg.php file?? It makes sense to me that this is where the bug is, because only the WYSIWYG editor has this button so I'm guessing it has to do with some function that's calling the standard's way of removing parse. What I'm saying is if I could find a manual workaround, then can someone create code to automate that manual workaround??
https://vborg.vbsupport.ru/showthread.php?t=62254 Hey wow, sidenote..... Take a look, one link is parsed and the other isn't. hmmmmm, this would make my idea of highlighting whole messages and clicking the "Remove Links" quite a bit more challenging. This whole thing revolves around that next character after the link somehow guys. Who's got the brains to overcome it?? :squareeyed: |
#13
|
||||
|
||||
That's a damn good observation. So, can a conditional be used to first; specify a specific forum, then use the remove links command(or whatever you'd call it) to remove them as you post? In other words, can a conditional do something like this? I'm sure a hack can, if not.
If forumid=XX then remove links else normal operation This would probably be the ideal way to accomplish this. Or, use this hack, which disables parsing completely, but use an if statement with it to specify the forum. Found in this thread. In functions_newpost.php FIND PHP Code:
BELOW that ADD PHP Code:
|
#14
|
|||
|
|||
Thanks, but that code wouldn't work for my guys cause we do a lot of linking to things on our website.
Hmmmmm, now here's a thought outside the box..... A hack that allows for only onsite urls ????? That would rock!!! Seems if someone can figure out how to check forumid for SloppyGoat, then they could check a character string instead for me. But to solve my issue still requires a hack to fix how the WYSIWYG editor immediately parses urls to links when you hit a space or return. Maybe part of the flaw is that the WYSIWYG editor doesn't handle the "auto parse links in text" box in "realtime" (doesn't check it at start of post either, but hey, I'm just thinking out loud). In other words..... If the Auto Parse Links Box was turned into WYSIWYG realtime, then maybe it would fix the flaw by allowing for the conditional check at the moment you hit the space or return after typing in the link. |
#15
|
||||
|
||||
Well, if my thinking is correct, doesn't the above code remove all url tags when you click submit, or keep them from ever being posted? That's pretty much what needs to be done, I think. Even if you use the WYSIWYG editor, doesn't the resulting post still have to have url tags in order for it to show as a clickable link?
|
#16
|
|||
|
|||
I tried that edit and it does prevent all non-hypered links in standard editor no matter what the autoparse checkbox says, yes, but since the wysiwyg editor autoparses all non-hypered links long before it does the functions_newpost, the result is the newpost doesn't find any non-parsed links to even think about because the links are already parsed.
So it seems logical that it also needs to be put in some other php like maybe the "functions_wysiwyg.php"??? I haven't found exactly where to put it though. I'm still a newbie. There's a few goals going on here so let's recap...
SloppyGoat falls in the fourth catagory. There's a couple hacks available...
Code:
standard editor - manual typed link http://www.vbulletin.org standard editor - hyperlink http://www.vbulletin.org wysiwyg editor (manual or hyperlink) http://www.vbulletin.org While creating this reply, I made it in notepad and did a C&P to messagebox in wysiwyg editor. It did NOT parse the first 2 links in my code above but it DID parse the 3rd url. Now to add to that weirdness, and MAYBE a key all this, I don't know, but only a part of the "code" I cut n pasted became a link. I don't know how this is gonna look when I hit reply but what my editor has highlighted in white and underlined "as linked" is from the first quote to the last ] I corrected the above link by highlighting the link and clicking "Remove Link" and I'll bet you won't see it as a link. I'll post it now below as I saw it with the editor instead....... Notice how the editor ignores the endquote?? It also ignored the first ] that's right after that endquote. Instead, it went all the way to end of string ] Code:
wysiwyg editor (manual or hyperlink) http://www.vbulletin.org[/url">http://www.vbulletin.org"]http://www.vbulletin.org Possible Solutions to wysiwyg editor's url parsing:
I'm a good debugger. I'm not a good coder....... yet .....but I'm working on it |
#17
|
|||
|
|||
hmmmm, all those links got parsed even though the editor didn't show them to me as links.
Let's try posting it again but with the standard editor w/ extra controls. Code:
standard editor - manual typed link http://www.vbulletin.org standard editor - hyperlink http://www.vbulletin.org wysiwyg editor (manual or hyperlink) http://www.vbulletin.org Code:
standard editor - manual typed link url]xxx.vbulletin.org /url] standard editor - hyperlink url=xxx.vbulletin.org]xxx.vbulletin.org /url] wysiwyg editor (manual or hyperlink) url="xxx.vbulletin.org"]xxx.vbulletin.org /url] |
#18
|
|||
|
|||
I made hack to suit me.
I'm sure it could be done better by someone better. But here's the jist of it. Don't hold me responsible for any problems, lol. I'm just a newbie. This allows onsite url's to always parse as links in wysiwyg editor. This places control back into the hand of the auto parse checkmark for all other url's. Note this hack doesn't kick in until the user clicks "submit reply". The wysiwyg editor message window will still highlight links. And in fact if you want it to parse, I think it has to be highlighted before "submit reply". Don't worry, the submit reply will then remove the offsite links highlighted if autoparse box is NOT checked. Find part of 'function parse_wysiwyg_anchor' in 'functions_wysiwyg.php': Code:
if (substr($href, 0, 7) == 'mailto:') { $tag = 'email'; $href = substr($href, 7); } else { $tag = 'url'; } Code:
if (substr($href, 0, 7) == 'mailto:') { $tag = 'email'; $href = substr($href, 7); } else if (substr($href, 0, 16) == 'www.mydomain.com') { $tag = 'url'; } else if (substr($href, 0, 23) == 'http://www.mydomain.com') { $tag = 'url'; } else { return $text; } href, 0, 16.... href, 0, 23.... The 16 and the 23 are the number of characters in the domain quotes So obviously you must edit these numbers AND the "mydomain". ************************************************** **** On the other hand, if someone wanted to remove 100% of links with the wysiwyg editor, I tested this and it appeared to do the job ok, but again, I'm just a newbie so don't blame me if it screws up your board. In the same file, same place, instead of the above stuff, just find this: Code:
$tag = 'url'; Code:
return $text; |
#19
|
||||
|
||||
Bump!
|
#20
|
|||
|
|||
$checked[parseurl]
i searched for that...in all the templates and changed it too $unchecked[parseurl] and that worked too, tho i didnt find any thing the quick reply as of yet... |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|