Welcome Guest [Log In] [Register]
We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Multiquote (on) Multiquote (off)
Add Reply
Query nickname
Topic Started: May 6 2010, 10:42 AM (598 Views)
Sytrus-ZNS
Member
[ * ]
Greetings,

i was wondering if there is any chance to put something like Welcome text like Welcome [name] [sign out] to new web page on ZB.... i had some other forum software on which i type $name, it show who is watching the page (when is logged - guest if not)....


thanks.


ZB Board link: s1.zetaboards.com/EnigmaOZ
private forum.
as i read some text about this.... jquery "$" doesn't work on web pages... it converts automatically to html tag $, so it doesn't work...

maybe there is some chance?


or making a .php on new addon page on zetaboards using cgi..?

^o) ^o) ^o)
Edited by Sytrus-ZNS, May 6 2010, 02:47 PM.
Offline Profile Quote Post Goto Top
 
Sytrus-ZNS
Member
[ * ]
anyone?
Offline Profile Quote Post Goto Top
 
Reid-ZNS
Member Avatar
C'est un piège!
[ *  *  *  *  *  * ]
Currently, you cannot extend ZetaBoards to work with external websites. This will be changed using the API (you may find a working demo of the API here; notice that the front page is the website and then there is a separate forum).

As for the $ in web pages issue, this is an irritating issue. Also, the pipe ( | ) is escaped too.

A workaround for the $ issue is to use the variable jQuery instead.

For example, this code:
Code:
 
alert("Hello, " + $('#top_info strong').text());
would become:
Code:
 
alert("Hello, " + jQuery('#top_info strong').text());
Offline Profile Quote Post Goto Top
 
Sytrus-ZNS
Member
[ * ]
thanks :)
Offline Profile Quote Post Goto Top
 
Sytrus-ZNS
Member
[ * ]
by the way, i found a perfect match what i want...

Reid, have you ever view slayer766's RPG for ZB, and when you enter the Town Inn you have one elder speaking to you:

Quote:
 
Hello Sytrus, and welcome! My name is Warren and I am the Town Elder.

Greetings hero, in my old age it has been very
hard for me to hike up the hill side to
pick flesh flowers for my house. I miss the sweet
smell of flowers in my house, oh sorry I was
ranting on again. I would like you to go up
the hill side and pick me some flowers for me, yes
this is very easy but recently a Monster has been
wrecking havoc up there. So you'll need to defeat the
monster to get the flowers for me.

Would you be willing to help me? Accept


I bold it.. i fount in his js code script
Code:
 
+u_name+
, and that show your name on the page... that's what i want, i tried to take that part but it can't be done
Offline Profile Quote Post Goto Top
 
HolySavior
Member Avatar
if( holy + alcohol){ happycoding()}
[ *  *  *  *  *  *  * ]
thats become "+u_name+" is a variable set by slayer766.

which actually is like this
Code:
 

var u_name = $('#top_info strong').text();

alert(u_name)
Offline Profile Quote Post Goto Top
 
Beaumont-ZNS
Member
[ *  * ]
That's because someone else in his code he set that variable (u_name) equal to the name.

So... putting this above your code will set that variable equal to that:

Code:
 
var u_name = $("div#top_info strong a").text()


By the way... $ does work for me in the Website Maker, but | does not.

Oh wow, just a minute too slow on this one. Sorry Holy Savior.
Edited by Beaumont-ZNS, May 9 2010, 10:25 AM.
Offline Profile Quote Post Goto Top
 
Reid-ZNS
Member Avatar
C'est un piège!
[ *  *  *  *  *  * ]
Ah, I misread your post and I thought you were talking about using the name with another website. I apologize. :P

Yes, you can get a person's name through jQuery as illustrated above.
Offline Profile Quote Post Goto Top
 
Sytrus-ZNS
Member
[ * ]


@ HolySavior

yea, i figured it out a few minutes ago... slayer's variable... i saw on the beginning of the var and raw later.


@ Reid.

it's okay, maybe i did not say very well...
i've been lookin' to jQuery, and i cannot figured how it works... so can you make that code?
Offline Profile Quote Post Goto Top
 
Reid-ZNS
Member Avatar
C'est un piège!
[ *  *  *  *  *  * ]
On your web page, use this script:
Code:
 
<script type='text/javascript'>
var n = jQuery('#top_info strong').text(), j = n !== 'Guest' ? " <a href='" + main_url + "login/logout'>[Log Out]</a>" : "";
document.write("Welcome, " + n + j);
</script>
Use that where you want their name to appear and it should do the trick.
Edited by Reid-ZNS, May 9 2010, 11:02 PM.
Offline Profile Quote Post Goto Top
 
Sytrus-ZNS
Member
[ * ]
thanks...

i own you :D
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · ZetaBoards Support · Next Topic »
Add Reply