ID:263019
 
Code:
client/Topic(href)
if(href=="Pages")
usr<<browse({"<META HTTP-EQUIV="Refresh" CONTENT="4;URL=http://games.byond.com/people/[usr.ckey]">"})
else ..()

/obj/player
Click()
for (var/mob/M in world)
if (M.name == name)
usr << browse("<b><font size = 4><body bgcolor=black><font color = yellow><title>[src] Desc</title>\
<br>\
<center>Name:
[M.name] Key:<a href='?src=\ref[src];action=Pages'>[M.key]</a> Rank:[M.rank]\
<br>\
Race:
[M.Race] Class:[M.Class]: Level [M.Level]\
<br>\
Gender:
[M.genders]\
<br>\
Wins:
[M.Wins] Losses: [M.Losses]\
<br>\
Status:
[M.onlinestatus]\
<br>\
Guild:
[M.Guild_Name]\
<br>\
<font color = green>
[M.desc]","window=popup;size=524x344")


Problem description:For some reason it will not open the Topic in the browser why might it be doing this?

You're using it wrong.

client
Topic (href, href_list [])
switch (href_list["action"])
if ("Pages")
var/page = href_list ["page"]
usr << browse ("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"4;URL=http://games.byond.com/people/[page]\">")

mob
player //I don't think you mean obj?
Click()
usr << browse ("<b><font size=4><body bgcolor=black><font color=yellow><title>[src] Desc</title>\
<br>\
<center>Name:
[M.name] Key:<a href='?page=[key];action=Pages'>[key]</a> Rank:[rank]\
<br>\
Race:
[Race] Class: [Class]: Level [Level]\
<br>\
Gender:
[M.genders]\
<br>\
Wins:
[Wins] Losses: [Losses]\
<br>\
Status:
[onlinestatus]\
<br>\
Guild:
[Guild_Name]\
<br>\
<font color=green>
[desc]","window=popup;size=524x344")


First, there is no need to loop and check for a "name" connection. Don't put spaces inbetween the tag and it's value, and I would go through it and revamp the page layout to use CSS but I feel that is more so your job.


EDIT: Wow, these forums do screw up a guy's indentation...
National Guardsmen wrote:
Problem description: For some reason it will not open the Topic in the browser why might it be doing this?

Because href is not just "Pages", it is the entire URL after the initial ?, or "src=\ref[src];action=Pages". You want to use the parameters list passed to topic to see if action is "Pages".

I also assume you want to view the clicked players page instead of the page of the clicker. In that case, you need to locate the mob using the passed src string. Change "src=\ref[src];action=Pages" to "src=\ref[M];action=Pages" (to tell the Topic() proc which mob to look up) and change Topic to the following:
client/Topic(href, hlist[])
if(hlist["action"] == "Pages")
var/mob/target = locate(hlist["src"])
if(istype(target)) usr<<browse({"<META HTTP-EQUIV="Refresh" CONTENT="4;URL=http://games.byond.com/people/[target.ckey]">"})
else ..()

In response to Papoose
Thank you