Author Topic: MOTD Generator and Hyperlinks  (Read 6107 times)

0 Members and 2 Guests are viewing this topic.

Offline Alloc

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
MOTD Generator and Hyperlinks
« on: January 22, 2017, 07:04:43 AM »
Hi all,

have been looking around a lot and could not find any answer to this question ...
I want to use the MOTD Generator and want to have clickably hyperlinks to custom URLs in a text section. Of course I could use a MOTD URL and design my own MOTD page, but then I couldn't use the other nice features of the generator like the User List for Admins or the list of installed addons.

I tried a few different markups in the text but none of these worked:
Code: [Select]
<a href="myurl">text</a>
<a>myurl</a>
[url=myurl]text[/url]
[url]myurl[/url]

So is there any way to get hyperlinks working in text sections or is that simply impossible to achieve?

Kind regards and thanks for this really great admin tool :)
Chris


My ULib/ULX versions (run "ulx version" in console):
ULib v.2.61
ULX v.3.71

Game mode(s) I am having this problem on: TTT

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: MOTD Generator and Hyperlinks
« Reply #1 on: January 22, 2017, 11:40:41 AM »
The text section is probably stripping any markup. I'm not 101% sure, but I don't think it's possible.

Offline Alloc

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: MOTD Generator and Hyperlinks
« Reply #2 on: January 22, 2017, 04:43:48 PM »
Hmm ... as this is an admin thing anyway, why would there be a need for stripping markup?

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: MOTD Generator and Hyperlinks
« Reply #3 on: January 22, 2017, 05:47:34 PM »
I'm still not quite sure what you are asking.

Are you using the MOTD generator in the ULX menu (XGUI)?
The text fields escape entry so that whatever you type into them is displayed exactly as you type it.

If you want to do fancy custom stuff, you'll need to design your own page.

Offline Alloc

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: MOTD Generator and Hyperlinks
« Reply #4 on: January 22, 2017, 05:50:58 PM »
Adding a hyperlink isn't fancy in my books ;)
As I said I could do my own page but then I wouldn't be able to use the user list and addon list from ULX's MOTD generator so that's not really an option either.
I just want to be able to have a section in the MOTD Generator where I can put something like "Uses Workshop content from <a href="workshop url">this collection[/url]" and a few more links. Currently users have to copy+paste that text, simply being able to click on that link would be way nicer obviously.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: MOTD Generator and Hyperlinks
« Reply #5 on: January 22, 2017, 05:55:17 PM »
I'll be honest. I've never used the generator. Let me fire it up and see what you're talking about. :)

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: MOTD Generator and Hyperlinks
« Reply #6 on: January 22, 2017, 06:00:35 PM »
Okay, yes I see what you're talking about now.

It appears that the MOTD (if using the generator) just reads raw text for text sections.

It might be a neat idea to add an HTML section in addition to a Text Section so that it'll correctly parse HTML, but that's something Stickly will have to look into as he is the developer of XGUI (the Menu used to edit) I also believe he designed the MOTD Generator.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: MOTD Generator and Hyperlinks
« Reply #7 on: January 22, 2017, 06:17:40 PM »
As it turns out, we intentionally strip HTML tags for security reasons. Once you generate an MOTD with the generator, its saved as a data file in your data folder.

A malicious script could easily come in and inject some hidden HTML into your MOTD and you might never know.

We're discussing adding some whitelisted html tags for links and images.

Offline Alloc

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: MOTD Generator and Hyperlinks
« Reply #8 on: January 23, 2017, 05:22:02 AM »
A malicious script could easily come in and inject some hidden HTML into your MOTD and you might never know.
Ah yeah, that makes perfect sense as the file would still be owned by the game process ... :(

We're discussing adding some whitelisted html tags for links and images.
That would be really awesome  8)