Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #11  
Old 03-25-2004, 12:10 AM
SloppyGoat's Avatar
SloppyGoat SloppyGoat is offline
 
Join Date: Feb 2002
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

According to the vB team, WYSIWYG will always parse, so it'll have to be a hack, apparently.
Reply With Quote
  #12  
Old 03-26-2004, 07:40 AM
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
  • Find a thread and Click Reply
  • Uncheck automatically parse links in text.
  • Type or paste your link in window.
  • Type a space and one character.
  • (...and a smilie doesn't count as a character apparently)
  • Go back and Highlight just the link.
  • Click Remove Link Button.
  • Now click mouse after that extra character.
  • Continue typing your reply.
  • Post reply and it works!!!!
https://vborg.vbsupport.ru/index.php

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??

  • Last thing, sorry to waste your time guys, lol.
I think the editpost.php needs to be edited along with newreply, newthread, and private.php if you really want no autoparsing by default. I posted to the other thread about it

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:
Reply With Quote
  #13  
Old 03-26-2004, 12:23 PM
SloppyGoat's Avatar
SloppyGoat SloppyGoat is offline
 
Join Date: Feb 2002
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
function convert_url_to_bbcode($messagetext
// the auto parser - adds [url] tags around neccessary things 

BELOW that ADD

PHP Code:
return $messagetext
This will disable autoparsing of URLs everywhere.
Reply With Quote
  #14  
Old 03-27-2004, 02:13 PM
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #15  
Old 03-27-2004, 02:25 PM
SloppyGoat's Avatar
SloppyGoat SloppyGoat is offline
 
Join Date: Feb 2002
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #16  
Old 03-28-2004, 12:07 PM
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
  • Some admin's would want to remove 100% of ability to autoparse links in text no matter what the check value is (hack works for standard but not wysiwyg).
  • Some admin's would want to remove the "default on" for autoparse checkmark, but still allow the checkmark to be turned on by user (hack works for standard but not wysiwyg).
  • Some admin's would want to keep the "default on" for autoparse checkmark, but still allow the checkmark to be turned off by user (default way for standard, but checkmark value is called too late for wysiwyg).
  • Some admin's would like a conditional check of what forumid the user is in and probably one of the other options above.
I happen to fall in the second catagory, not the first.
SloppyGoat falls in the fourth catagory.

There's a couple hacks available...
  • Can turn off autoparse links checkmark default in 4 php files (newreply, newthread, editpost, & private).
  • Can disable autoparsing links in standard editor completely by editing "functions_newpost.php" file.
So now we all seek the following...
  • Find where in wysiwyg to add current "return $messagetext;" hack to disable autoparse value check.
  • Add a hack for wysiwyg to check if autoparse value is off, then don't autoparse when messagebox opens AND while messagebox is in use.
  • Add a hack to check forumid when deciding to autoparse.
Interesting Facts about vb3 Gold
  • wysiwyg editor uses quotes in hyperlinks while standard editor and standard with extra controls editor doesn't.
  • wysiwyg editor automatically adds the quotes to standard hyperlinks if you edit a post with wysiwyg editor.
  • wysiwyg editor automatically turns simple links into full hyperlinks.
  • since everything becomes a hyperlink, the autoparse value check at post time is moot in the wysiwyg editor.
  • there's 4 known php edits to turn off autoparse box by default which still allows the box to function.
  • wysiwyg editor's "Remove Link" button functions but hitting space or return at end of link reprompts the autoparse.
Examples of the 3 ways links are currently presented:
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
***SIDENOTE***
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 ]

*** /SIDENOTE***


Possible Solutions to wysiwyg editor's url parsing:
  • WHEN editpost opens, search for string "[url*" THEN DO wysiwyg repair IF "[url=*" ELSE ignore and continue string search.
  • WHEN space or return is pressed in wysiwyg messagebox, IF is a text link, CHECK for value of autoparse, IF autoparse=true THEN parse, IF autoparse=false THEN excute character print.
  • Add that "return $messagetext;" to an additional php file somewhere.
Someday I'll figure out how to turn english into code but in the mean time a little assistance would be real cool if someone thinks of a thing or three to help. Sorry if I'm wasting y'alls time with the lengthy disertation.

I'm a good debugger.
I'm not a good coder....... yet
.....but I'm working on it
Reply With Quote
  #17  
Old 03-28-2004, 12:15 PM
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Darn it, I still can't show you them so I'll show you a different way

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]
Now add the front bracket [ to those 6 url or /url's and THAT's what the 3 methods of creating url's with vbulletin look like in text.
Reply With Quote
  #18  
Old 03-30-2004, 07:09 PM
Mr Blunt Mr Blunt is offline
 
Join Date: Jan 2004
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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';
	}
Replaced with this:
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;
	}
But notice.....
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';
Replace with this:
Code:
		return $text;
Can someone knowledgable verify and/or test this??
Reply With Quote
  #19  
Old 04-10-2004, 05:16 PM
SloppyGoat's Avatar
SloppyGoat SloppyGoat is offline
 
Join Date: Feb 2002
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump!
Reply With Quote
  #20  
Old 04-27-2004, 11:01 PM
Sooner95 Sooner95 is offline
 
Join Date: Apr 2003
Location: I don't know
Posts: 535
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

$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...
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 04:12 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04399 seconds
  • Memory Usage 2,276KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (8)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete