jfb-skinning-board-wrappers-advanced [Jcink.com Wiki]

Board Wrapper - Global Variables

The board wrappers section of JFH is the primary place you can customize the HTML, and add custom codes to the board. This is expanded upon with the ability to use variables that can be called from the source code. With variables, you can easily write custom codes for your board.

Wrapper Variables

(boolean) indicates that the setting either returns 0 for false, or 1 for true.

Member Vars

Variable Information contained
 <!-- |name| --> 
Stores logged-in member name.
 <!-- |id| --> 
Stores logged-in member id number.
 <!-- |avatar| --> 
Stores logged-in member avatar.
 <!-- |posts| --> 
Stores logged-in member post number.
 <!-- |email| --> 
Stores logged-in member email address.
 <!-- |view_sigs| --> 
Stores logged-in member view signatures setting (boolean).
 <!-- |view_avs| --> 
Stores logged-in member view avatars setting. (boolean)
 <!-- |new_msg| --> 
Total number of new messages, if any.
 <!-- |msg_total| --> 
Total number of new messages overall.
 <!-- |input_IP_ADDRESS| --> 
Member's IP address

Skin-data Vars

Variable Information contained
 <!-- |skin_name| --> 
Stores logged-in member skin name choice.
 <!-- |skin_id| --> 
Stores logged-in member skin id number.
 <!-- |skin_hidden| --> 
Stores logged-in member skin setting: hidden or not? (boolean)
 <!-- |skin_default| --> 
The default skin id for the forum
 <!-- |server_load| -->> 
Shows server load text

Date-based Vars

Variable Information contained
 <!-- |joined| --> 
Stores logged-in member join date.
 <!-- |last_post| --> 
Stores logged-in member last post date.
 <!-- |last_visit| --> 
Stores logged-in member last visit.
 <!-- |last_activity| --> 
Stores logged-in member last activity.
 <!-- |time_offset| --> 
Member's date/time offset in numbers.

Group Vars

Variable Information contained
 <!-- |g_id| --> 
Stores logged-in member group id number.
 <!-- |prefix| --> 
Stores logged-in member group prefix.
 <!-- |suffix| --> 
Stores logged-in member group suffix
 <!-- |g_title| --> 
Stores logged-in member group title.
 <!-- |g_icon| --> 
Stores logged-in member group icon.
 <!-- |g_view_board| --> 
Stores logged-in member group setting to view the board or not (boolean).
 <!-- |g_edit_profile| --> 
Stores logged-in member group setting to edit profile (boolean)

Group Posting Permissions (Mainly boolean)

These are a few permissions that can be set via the ACP for the groups. You can use these to make custom permission based codes but please be advised that since it's only javascript, you can't count on these for serious group permission settings. However, they are good for basic use.

Variable Information contained
 <!-- |g_post_new_topics| --> 
Can post new topics?
 <!-- |g_reply_own_topics| --> 
Can reply to own topics?
 <!-- |g_reply_other_topics| --> 
Can reply to others topics?
 <!-- |g_delete_own_posts| --> 
Can delete own posts
 <!-- |g_open_close_posts| --> 
Can open/close posts?
 <!-- |g_edit_posts| --> 
Can edit their posts?
 <!-- |g_vote_polls| --> 
Can vote in polls?
 <!-- |g_use_pm| --> 
Can send PMs?
 <!-- |g_is_supmod| --> 
Is supermod?
 <!-- |g_access_cp| --> 
Can access the AdminCP?
 <!-- |g_access_offline| -->
Can view offline board?
 <!-- |g_avoid_q| --> 
Can avoid moderation queue?
 <!-- |g_avoid_flood| --> 
Can avoid flood control?
 <!-- |g_avatar_upload| --> 
Can upload avatars?
 <!-- |g_calendar_post| --> 
Can post to the calendar?
 <!-- |g_max_messages| --> 
Max no. of messages in PM inbox
 <!-- |g_max_mass_pm| --> 
Max no. of members to be mass PMed
 <!-- |g_hide_from_list| --> 
Hidden from member list?
 <!-- |g_dohtml| --> 
Can use [doHTML] tags where allowed?

Input Wrapper Variables

One feature of the wrapper variables is the ability to call input information on the fly. This means that POST and GET content can be called. Here is an example. Pretend you want to make a custom message appear, but only if the person visits a link called…

http://forum.jcink.com/?act=idx&display=contest

How would you use this? See this javascript example below:

<script>
if('<!-- |input_display| -->' == 'contest') {
document.write("<b>Hey!</b> Welcome to our contest information text! You have found the hidden contest!");
}
</script>

If they visited the link, they would see that text. For even more example use of all the variables, see the sections below.

Please remember however that since you are using javascript, never trust it for anything serious. A member could, for example, easily view source of the page and find the contest text. Had you been storing something that you didn't want anyone else to see unless they knew the link, that would be insecure. Just keep that in mind when you write codes using this.

Example Use

Basic name display
Hi, <!-- |name| -->! Welcome to our forums.
Custom alert for a specific name(s)
<script>
if('<!-- |name| -->'=='Jcink') { 
alert('<!-- |name| -->! Please check the forums!');
}
</script>
Postcount Checker
<script>
if('<!-- |posts| -->' > '500') { document.write("Nice! You're a super poster. You have <!-- |posts| --> posts!");}
</script>
 
jfb-skinning-board-wrappers-advanced.txt · Last modified: 2012/06/21 13:27 by viruszero