Note: This is by no means a thorough or exhaustive list. As of now it is incomplete. If you would like to see something added to this, please reply to this topic.
Checking whether the user is logged inThis function will return true or false depending on whether the user is logged in.function loggedIn() {
return $('td.titlebg2 span b').not($("td.titlebg2 span b:contains(News)")).html() ? true : false;
}
Example:if( ! loggedIn() ) {
alert("Hey there, guest");
}
Checking whether the user is an adminThis function will return true or false depending on whether the user is logged in.function isAdmin() {
return ($("td.maintab_back:contains('Admin')").length == 1 || $("td.maintab_active_back:contains('Admin')").length == 1)
}
Example:if( isAdmin() ) {
alert("Hey there, admin");
}
Notice that fits in with the forum themeThis function will return a string containing HTML that is appropriate for displaying widgets.function widget(m) {
return ('<div class="tborder"><div class="windowbg" style="padding:8px">' + m + '</div></div>');
}
Example:document.write( widget( 'Hey there!' ) );