Author | Message |
---|
Vektor Joined: 18 Jan 2007 Posts: 103
| Posted: Sat Nov 17, 2007 7:58 am Post subject: Nemesis | | | Web support in HeXHub was improved, and will be improved even more. A new website hosted with HeXHub: http://nemesis.te-home.net. Support for RSS and user comments (on Nemesis users will be allowed to self register and post comments) will be added in the next days so keep checking it. First release of HeXHub 5.00 will be only after anti-spam detection for comments will be added.
|
|
Back to top
| |
The Architect Joined: 23 Dec 2006 Posts: 183
| Posted: Tue Nov 27, 2007 6:37 am Post subject: | | | Was wondering how you managed to have it revolve around index.html like: index.html?hub or index.html?news, etc. I was kind of curious while browsing your pages and tried to figure it out myself but no avail lol :P _________________ Kazakhstan is the greatest country in the world! All other country are run by little girl! |
|
Back to top
| |
Vektor Joined: 18 Jan 2007 Posts: 103
| Posted: Wed Nov 28, 2007 7:36 am Post subject: | | | For index.html?hub i have this code in index.html:
Code: | %[var hub=] <P><H1><CENTER>Hub information</CENTER></H1> <P><CENTER> <TABLE border="0" width="75%"> <TR><TD> <UL> <LI><B>Hub name:</B> %[hname]</LI> <LI><B>Address:</B> <A class="link2" href="dchub://%[addr]">%[addr]</A></LI> <LI><B>Description:</B> %[hdesc]</LI> <LI><B>Current topic:</B> %[topic]</LI> <LI><B>Minimum share required:</B> %[minshare]</LI> <LI><B>Uptime:</B> %[uptime] (%[uptimesec] seconds)</LI> <LI><B>Hub-security:</B> %[nick 0]</LI> <LI><B>Online users:</B> %[users 0]</LI> <LI><B>Users browsing this website:</B> %[webusers]</LI> <LI><B>Online Operators:</B> <UL> %[oplist]<LI>%[nick n]</LI>%[/oplist]</UL></LI> <LI><B>Message Of The Day:</B> <DIV style="letter-spacing:0px;"><FONT face="Microsoft Sans Serif"><SMALL>%[motd]</SMALL></FONT></DIV></LI> </UL> </TD></TR> </TABLE></CENTER> %[/var]
|
That ?hub becomes %[var] like all other parameters from URL or from HTTP POST.
|
|
Back to top
| |
The Architect Joined: 23 Dec 2006 Posts: 183
| Posted: Wed Nov 28, 2007 11:27 am Post subject: | | | Interestingly enough, i used javascript to get that done, but i personally would not use javascript for this kind of ability because things like oplist or any other array sequence can yield a value with an unescaped character that will cause the script to stop working. the following is a piece of my javascript code:
Code: | else if(document.URL.indexOf("?stats") != -1) { document.write("\ <h1><center>DE RO Alliance - Stats - Unfinished</center><br></h1>\ <p> <h6>Hub name: %[hname] <br>\ Hub Topic: %[topic] <br>\ Uptime: %[uptime] <br>\ In Seconds: %[uptimesec] <br>\ Number of users: %[users]<br>\ Number of viewers right now: %[webusers] <br><br><br><br></h6>\ <h4>Current Motd:</h4><h6></b> <br><br><br>\ <font color=\"#666633\"> %[motd] </font> <br><br><br></h6>\ <h4><center>Online Operators:</center></h4><h6></b><br>\ <table width=\"30%\" align=\"center\">\ <tr><th width=\"10%\" bgcolor=\"#666633\"><font color=\"#999966\" style=\"font-size:small\">Nick</font></th>\ <th width=\"10%\" bgcolor=\"#666633\"><font color=\"#999966\" style=\"font-size:small\">Country</font></th></tr>\ %[oplist]\ <tr valign=\"top\"><td><font style=\"font-size:x-small\">%[nick n]</font></td>\ <td><font style=\"font-size:x-small\">%[usercountry n]</font></td></tr>\ %[/oplist]\ </tr></center></table><br><br>\ More stats will be added sooner or later :P\ </h6></p>") } |
With that piece, %[nick n] can have something like john's_workplace_client and that apostrophe will throw the script away. I will make the index page use the %[var] implementation instead of an unsafe script workaround, as you have used. Thanks for the explanation. _________________ Kazakhstan is the greatest country in the world! All other country are run by little girl! |
|
Back to top
| |