Author Topic: URL in messages not showing up  (Read 2810 times)

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
URL in messages not showing up
« on: August 08, 2012, 03:20:01 PM »
I don't recall disabling this option, but when I try to send a message in etano and include a URL with it, the URL does not show up in the message that the recipient receives.

Which files should I look at to review this?
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2943
  • Karma: +210/-7
    • Maverick Webworks
Re: URL in messages not showing up
« Reply #1 on: August 08, 2012, 05:02:15 PM »
Are you using the BBcode hyperlink button to include URL's in your messages? This is the only way URL's will appear as clickable hyperlinks in messages.

If there are no BBcode buttons showing then you might have it turned off in the admin >> "Site Features and Options" section.

This must be checked ...
Allow BBCode in member to member messages?

If it's not checked it means you're only allowing basic text to be inputted in messages.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
Re: URL in messages not showing up
« Reply #2 on: August 08, 2012, 10:24:51 PM »
Yes, I'm using the BBcode hyperlink button.
that option is checked for allowing bbcode in the features and options.

the other bbcode buttons work. bold, underline, quotes and smiley's. But not hyperlinks.
hyperlinks also don't show up in profile comments.
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2943
  • Karma: +210/-7
    • Maverick Webworks
Re: URL in messages not showing up
« Reply #3 on: August 09, 2012, 01:24:25 AM »
I don't know what else to suggest, the URL bbcode has always worked fine for me.

Also keep in mind that The URL must start with http, I don't think sites that start with https will work.

The only other thing that that I can think of is if something was being changed or altered in the includes/general_functions.inc.php file, especially in the following section ...
Code: [Select]
// This function does NOT convert html to text.
// Make sure that the string is clean before calling this function
function bbcode2html($str) {
$from=array('~\[url=(http://[^<">\[\]]*?)\](.*?)\[/url\]~','~\[b\](.*?)\[/b\]~s','~\[u\](.*?)\[/u\]~s','~\[quote\](.*?)\[/quote\]~s','~\[img=(http://[^<">\[\]]*?)\]~');
$to=array('<a class="content-link simple" rel="external" href="$1">$2</a>','<strong>$1</strong>','<span class="underline">$1</span>','<blockquote>$1</blockquote>','<img src="$1" />');
$str=preg_replace($from,$to,$str);
// leftovers
$from=array('~\[url=(http://.*?)\]~','~\[/url\]~','~\[b\]~','~\[/b\]~','~\[u\]~','~\[/u\]~','~\[quote\]~','~\[/quote\]~','~\[img=(http://.*?)\]~');
return preg_replace($from,'',$str);
}

And if something in the js/bbcode.js file got messed up.

These are the only two files that I know of that are related to the bbcode functioning.

As long as you haven't done any custom modifications to these files, you can maybe try uploading them from the Etano default source files and see if it fixes the problem.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
Re: URL in messages not showing up
« Reply #4 on: August 09, 2012, 01:58:08 AM »
Ohhh!!! I'm such an idiot! I saw what I didn't do in the message box. Just a simple human error. :roll:
I didn't highlight the text in the message before selecting the hyperlink button.   :-[

Punch me now :D
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
Re: URL in messages not showing up
« Reply #5 on: October 24, 2012, 11:32:32 PM »
I tried to send an https link to someone using bbcode and I'm wondering, why does it only work with http and not https?
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2943
  • Karma: +210/-7
    • Maverick Webworks
Re: URL in messages not showing up
« Reply #6 on: October 25, 2012, 02:52:08 PM »
This is because the BBcode was coded to only accept URLs with the HTTP Protocol. BBcode has it's pros and cons and was used in the script as it's considered more secure as it can prevent users from adding javascript XSS type injections.

If you want to also allow the HTTPS Protocol, here's what you can do ... open your includes/general_functions.inc.php file and locate the following code starting around line #119:
Code: [Select]
function bbcode2html($str) {
$from=array('~\[url=(http://[^<">\[\]]*?)\](.*?)\[/url\]~','~\[b\](.*?)\[/b\]~s','~\[u\](.*?)\[/u\]~s','~\[quote\](.*?)\[/quote\]~s','~\[img=(http://[^<">\[\]]*?)\]~');
$to=array('<a class="content-link simple" rel="external" href="$1">$2</a>','<strong>$1</strong>','<span class="underline">$1</span>','<blockquote>$1</blockquote>','<img src="$1" />');
$str=preg_replace($from,$to,$str);
// leftovers
$from=array('~\[url=(http://.*?)\]~','~\[/url\]~','~\[b\]~','~\[/b\]~','~\[u\]~','~\[/u\]~','~\[quote\]~','~\[/quote\]~','~\[img=(http://.*?)\]~');
return preg_replace($from,'',$str);
}


and replace it with this:
Code: [Select]
function bbcode2html($str) {
$from=array('~\[url=((http|https)://[^<">\[\]]*?)\](.*?)\[/url\]~','~\[b\](.*?)\[/b\]~s','~\[u\](.*?)\[/u\]~s','~\[quote\](.*?)\[/quote\]~s','~\[img=(http://[^<">\[\]]*?)\]~','~\[imga=(http://[^<">\[\]]*?)\]~');
$to=array('<a class="content-link simple" rel="external" href="$1">$1</a>','<strong>$1</strong>','<span class="underline">$1</span>','<blockquote>$1</blockquote>','<img src="$1" />','<img src="$1" align="left" style="margin: 0 10px 0 0;" /> ');
$str=preg_replace($from,$to,$str);
// leftovers
$from=array('~\[url=((http|https)://.*?)\]~','~\[/url\]~','~\[b\]~','~\[/b\]~','~\[u\]~','~\[/u\]~','~\[quote\]~','~\[/quote\]~','~\[img=(http://.*?)\]~');
return preg_replace($from,'',$str);
}


Then open your js/bbcode.js file and locate the following around line #85:
Code: [Select]
url=prompt('Please enter the URL','http://');
and replace it with this:
Code: [Select]
url=prompt('Please enter the full URL - including http:// or https://','');
Note - using this method the hyperlink will always display the actual full URL. For example if you try adding a URL hyperlink to text such as "Click Here", it will convert it to display the actual URL instead, which technically isn't a bad thing because for security reasons I'd prefer to know upfront where the link is going to take me.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1004
  • Karma: +56/-7
Re: URL in messages not showing up
« Reply #7 on: October 25, 2012, 03:44:55 PM »
Thanks. I agree about placing the actual hyperlinks in the message. however, someone can simply insert a shortened URL which can mask the destination. By the way, I saw something in the bbcode.js file in reference to "img". does this allow images to somehow show up in messages? If there is a topic in the forum about this, let me know.
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2943
  • Karma: +210/-7
    • Maverick Webworks
Re: URL in messages not showing up
« Reply #8 on: October 26, 2012, 11:11:33 AM »
The image code technically already works by manually adding the link to the image something like this: [img=http://www.imagehostsite.com/12265.jpg]

However adding a bbcode button to the list of buttons to make it easy for members to add the link to the image is more complex.

First you'd need to do a bit of custom coding to the following files in order for the image buuton to get added, plus you'd also need to create the button icon for it.

js/bbcode.js
skins_site/def/styles/bbcode.css

There's a few potential issues by allowing user's to add images, first of all it will add the image button site wide which means users will be able to add an image in other places as well, including profile comments, blogs, etc. If you just wanted to allow images to be added to blogs only, this will require more advanced coding. Also, if a user includes a link to a real large photo that's larger than the width of the blog comments area it can mess things up, to prevent this you'd need to try and come up with some code to try and deal with this as well.

I've never implemented the image button to allow users to include links to images in comments because of the potential issues with size as well as I didn't want to have to monitor what images people were linking to. Just felt there was too much potential for abuse.

Therefore, about all I can offer is pointing you in the right direction, the rest will be up to you, depending on your needs you may have to find a programmer to implement it for you as a custom job, it's not a one size fits all solution that will meet everyone's needs which is why it wasn't implemented by default.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

Etenity63

  • Prime Member
  • ****
  • Posts: 119
  • Karma: +0/-0
Re: URL in messages not showing up
« Reply #9 on: January 27, 2017, 10:19:11 AM »
I wake the post^^
Modifications of https, are made with the template of Maverick, however the BBcodes do not appear neither in the messages nor in the comments ???
An idea ?

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2943
  • Karma: +210/-7
    • Maverick Webworks
Re: URL in messages not showing up
« Reply #10 on: January 27, 2017, 11:26:10 AM »
Go to the Admin >> "Site Features and Options" section.
 
And make sure that the following options are checked ...
Use BBcode in comments?
Allow BBCode in member to member messages?




Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

Etenity63

  • Prime Member
  • ****
  • Posts: 119
  • Karma: +0/-0
Re: URL in messages not showing up
« Reply #11 on: January 27, 2017, 11:41:40 AM »
Hi, Maverick

Everything is already checked

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2943
  • Karma: +210/-7
    • Maverick Webworks
Re: URL in messages not showing up
« Reply #12 on: January 27, 2017, 12:06:00 PM »
Well that's the only thing that will prevent the bbcodes from showing up in the site's messages or comments.

In the "Site Features and Options" section you can try clicking the "SAVE" button and maybe it will reset the correct options in the database.

The only other possibility I can think of would be when you installed the "blog_images_mod", if you made a mistake somewhere in the instructions it may cause a problem. Go through the instructions gain CAREFULLY to make certain you did everything correctly.

Even a slight typo when adding CSS code can cause problems.

For example: missing a closing tag such as:

.bb_tools a.image {
    background-image: url('../images/bbcode_image.gif');
}

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

Etenity63

  • Prime Member
  • ****
  • Posts: 119
  • Karma: +0/-0
Re: URL in messages not showing up
« Reply #13 on: January 27, 2017, 02:14:42 PM »
I watched and I did not see error. However the BBcode in the messages, although I had activated them, never displayed.
I had a display worry for the reCaptcha Google, an activation concern url "Enable allow_url_fopen" on my server, which was off. Then I put aside the worries of the BBcode until now.

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 2943
  • Karma: +210/-7
    • Maverick Webworks
Re: URL in messages not showing up
« Reply #14 on: January 27, 2017, 06:37:31 PM »
I think I may have misunderstood your post, I thought you meant that the BBcodes (set of icons) weren't displaying.

Since this thread is about URL hyperlinks not showing up in posts, I'm assuming that's what you meant. If so, it's most likely caused by not entering them correctly. It functions differently than adding images, it functions more like the bbcodes for adding bold or italic text.

In other words if you wanted to add a URL hyperlink to Google for example, you would first enter the URL as text in the message or comment field (box) ... https://www.google.com/ ... and then highlight the text (just as you would when wanting to make text bold) and then click the "Hyperlink" bbcode Icon and enter the URL link again ... https://www.google.com/

Note: the hyperlink will always display the actual full URL. For example if you try adding a URL hyperlink to text such as "Click Here", it will automatically convert it to display the actual URL instead, this is for security reasons so that people know upfront where the link is actually going to, and isn't a link to some suspicious or scrupulous looking site. 

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.