ID:806477
 
Keywords: topic
(See the best response by Forum_account.)


Problem description:

I could use help with client/Topic(). An example would be a message as soon as you log in placed in the output saying something like:

mob/Login()
usr << "Check out our forums."


Like I said, this is just an example. There would be no need for outside forum sites since the hub supplies you with one.

How could I use client/Topic() to make the word "forums" clickable which would pop up the client's default browser and load the page automatically for them?


Thanks for the help.

"Check out our <a href=[FORUM URL]>forums</a>."
Ah, thanks.

What if I wanted to say

var/HTMLStuff={"<html>
<title>HTMLStuff</title><body>
<body bgcolor=white><font size=3><font color=red><b>
<font size=2>
</body><html>"}


How would I have the client view this in HTML format using client/Topic() by clicking it in the same way.

mob/Login()
usr << "Check out HTMLStuff."
Are you sure you're looking for Topic(), which is for server-to-server communication, and not link() which is for serving webpages or other BYOND worlds to the client?
Best response
If you want to show the HTML to the user when they login, just use browse:

mob/Login()
src << browse(HTMLStuff)

If you want to show them a link and only show the HTML stuff when they click the link, then you'd need to use Topic:

var/HTMLStuff={"<html>
<title>HTMLStuff</title><body>
<body bgcolor=white><font size=3><font color=red><b>hi
<font size=2>
</body><html>"}


mob
Login()
src << "Check out <a href=?html_stuff>this</a>."

client
Topic(href)
if(href == "html_stuff")
src << browse(HTMLStuff)

client/Topic() has two other parameters but you don't need them for this. The first parameter is the URL of the link that was clicked (not including the "?").
In response to Forum_account
Thanks F_a. You hit the nail on the head.

Thanks everyone!