admin (no pm's please) Site Admin

 Virtual Cash: 42920
Joined: 22 May 2005 Posts: 19349
Add Karma
 rated by 157 members
Add Comment
Show Comments
 |
Posted: Tue Dec 19, 2006 12:48 pm Post subject: phpbb2 template switches |
|
|
Group Management
switch_unsubscribe_group_input - Does unsubscribe need showing for a group?
switch_subscribe_group_input - Does subscribe need showing for a group?
member_row.switch_mod_option - Display for members that are mods. Note the way this is a nested switch.
switch_no_members - a group with no members
switch_hidden_group - is group a hidden group?
switch_pending_members - Are there pending members?
switch_mod_option - options visible if you are a group mod.
switch_add_member - options to add member. This switch is always set if the above switch is set and visa-versa.
switch_groups_joined -
switch_groups_joined.switch_groups_member -
switch_groups_joined.switch_groups_pending -
switch_groups_remaining -
MYFF Portal
switch_forum_view - viewing the forum
switch_portal_view - viewing the www portal
Posting
switch_signature_checkbox -
switch_html_checkbox -
switch_bbcode_checkbox -
switch_smilies_checkbox -
switch_username_select
switch_notify_checkbox
switch_delete_checkbox'
switch_type_toggle'
switch_not_privmsg
switch_poll_delete_toggle
switch_inline_mode'
switch_privmsg'
switch_html_checkbox
switch_bbcode_checkbox
switch_smilies_extra'
Private messages
switch_smilies_checkbox
switch_signature_checkbox
switch_box_size_notice
switch_no_messages
View Topics
switch_no_topics
Searching
switch_select_name - show search by user.
General
switch_user_logged_out
switch_allow_autologin
switch_user_logged_out.switch_allow_autologin - another example of the way switch nesting is done.
switch_user_logged_in
switch_enable_pm_popup
Registration/Profile
switch_edit_profile
switch_namechange_allowed
switch_namechange_disallowed
switch_confirm
switch_avatar_block
switch_avatar_block.switch_avatar_local_upload
switch_avatar_block.switch_avatar_remote_upload
switch_avatar_block.switch_avatar_remote_link'
switch_avatar_block.switch_avatar_local_gallery
I'll add more info over time. Remember portal components have their own switches not documented here.
_________________
Family Friendly Shareware | | Web Design/Services | Free Forums
forum.myfreeforum.org |
|
| Back to top |
|
 |
blakelives0312 Apprentice


Joined: 15 Dec 2006 Posts: 119 Location: Houston, Texas Add Karma
 rated by 0 members
Add Comment
Show Comments
 |
Posted: Wed Dec 20, 2006 5:34 pm Post subject: |
|
|
Thank you so much, admin, for all your hard work with the switches. But I, and I'm sure many others do as well, have yet another problem for you: I don't know, for the most part, how to use them!
I the basics, I think... You use the BEGIN and END switches before and after the code to be switched but what is this "Switch nesting"? I'm pretty sure I kind-of understand... but not really..
Is it just another way of doing:
| Code: |
<!-- BEGIN switch_user_logged_out -->
<!-- BEGIN switch_allow_auto_login -->
<!-- code n' stuff -->
<!-- END switch_allow_auto_login -->
<!-- END switch_user_logged_out --> |
or do you have to switch nest if you want this to work?
Is there any other special tasks that you can use these switches with?
Can we make our own switches?
Is there a tutorial on this stuff? (There is no tutorial about these kinds of switches on howtodoit...theres some on hubs and switches...but that hardly helps here...) _________________ -still only a n00b

|
|
| Back to top |
|
 |
admin (no pm's please) Site Admin

 Virtual Cash: 42920
Joined: 22 May 2005 Posts: 19349
Add Karma
 rated by 157 members
Add Comment
Show Comments
 |
Posted: Wed Dec 20, 2006 6:39 pm Post subject: |
|
|
Switch nesting needs someone to play with it and report back. I have reported above how it is done in the code, but have not explored what happens in the templates to the point where I can do a tutorial yet.
You cannot add switches, but you can ask. So for example the portal/forum view switches are not standard phpbb and were added by me. _________________
Family Friendly Shareware | | Web Design/Services | Free Forums
forum.myfreeforum.org |
|
| Back to top |
|
 |
blakelives0312 Apprentice


Joined: 15 Dec 2006 Posts: 119 Location: Houston, Texas Add Karma
 rated by 0 members
Add Comment
Show Comments
 |
Posted: Thu Dec 21, 2006 4:23 am Post subject: |
|
|
Oh cool. so if for some reason (and this is JUST an example that I was dreaming about (for when my forum gets to over A LOT of users, which I doubt it will...)) I wanted to request phone numbers and use a switch called "switch_allowed_txt_new_post" to send a message to a user on a new post(for their topic or watever) you could make one specifically for my forum?
i've got 17 users(Dec 20, 2006) and I will never EVER need this but, you could do that right? because that sounds like a fun idea.. though probably impractical...
also, can you do the same thing with template variables (for example: U_PHONE_NUMBER)? Or can they be done from our limited capabilities?
I'm getting a lot of info out of this, I'm glad I decided to make a forum. (I plan to go on to be a programmer or something like that... meybe a website builder or a free forum administrator/moderator, like say... admin?) _________________ -still only a n00b

|
|
| Back to top |
|
 |
admin (no pm's please) Site Admin

 Virtual Cash: 42920
Joined: 22 May 2005 Posts: 19349
Add Karma
 rated by 157 members
Add Comment
Show Comments
 |
|
| Back to top |
|
 |
blakelives0312 Apprentice


Joined: 15 Dec 2006 Posts: 119 Location: Houston, Texas Add Karma
 rated by 0 members
Add Comment
Show Comments
 |
Posted: Thu Dec 21, 2006 6:46 pm Post subject: |
|
|
HAHA, thanks admin.
Here's what I meant:
Say someone wants to have a text message sent to them every time a specific topic is posted on: they would go to that post and click to send a text message to them when that topic has a new reply (like for emails except with phones...?). On a new post, there would be a switch that checks to see if that little box is "checked" (to see if the user wants a text message) and if it is, it would send the message.
Also there could be a global variable for the user's phone number.
my question was: is it possible for this be done for just one forum or for all of them (if people would want it of course). And if we as an admin of a my fast/free forum could make said global variables.
This is totally hypothetical of course, because I am sure that no one would want this capability unless, for instance, there are hundreds of users to... well, use it.
and the switch hasn't been created.... thats the whole point of asking: could this be done? (is it possible?) Because I have seen websites that can do that: is i possible for this website to be able to do it? _________________ -still only a n00b

|
|
| Back to top |
|
 |
admin (no pm's please) Site Admin

 Virtual Cash: 42920
Joined: 22 May 2005 Posts: 19349
Add Karma
 rated by 157 members
Add Comment
Show Comments
 |
Posted: Thu Dec 21, 2006 8:50 pm Post subject: |
|
|
You are misinterpreting what a "switch" is.
What you are asking for, could of course be done and probably would need a switch, but is fundermentally a forum MOD adding extra abilities to a phpbb2 forum.
A switch on the other hand is a binary operator that can be used to change the look of things in a template. Say for example and this one might not be a bad idea we wanted to make it possible when viewing a topic to see whether each post was posted by a guest/mod/member/admin, we could have a set of switch for each post and perhaps in viewtopic_body.tpl replace:
<td colspan="2"><span class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
with
<td colspan="2">
<!-- BEGIN switch_poster_guest -->
<span class="postbody_guest">
<!-- END switch_poster_guest -->
<!-- BEGIN switch_poster_member -->
<span class="postbody_member">
<!-- END switch_poster_member -->
<!-- BEGIN switch_poster_mod -->
<span class="postbody_mod">
<!-- END switch_poster_mod -->
<!-- BEGIN switch_poster_admin -->
<span class="postbody_admin">
<!-- END switch_poster_admin -->
{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td> _________________
Family Friendly Shareware | | Web Design/Services | Free Forums
forum.myfreeforum.org |
|
| Back to top |
|
 |
blakelives0312 Apprentice


Joined: 15 Dec 2006 Posts: 119 Location: Houston, Texas Add Karma
 rated by 0 members
Add Comment
Show Comments
 |
Posted: Fri Dec 22, 2006 12:03 am Post subject: |
|
|
so it's like an "if" statement? (from java)
"if" this, do "that"
too bad theres no else switch...
though this post brings about another question: what is postrow, SIGNATURE, and MESSAGE?
| Quote: | <!-- END switch_poster_admin -->
{postrow.MESSAGE}{postrow.SIGNATURE} |
_________________ -still only a n00b

|
|
| Back to top |
|
 |
blakelives0312 Apprentice


Joined: 15 Dec 2006 Posts: 119 Location: Houston, Texas Add Karma
 rated by 0 members
Add Comment
Show Comments
 |
Posted: Fri Dec 22, 2006 12:09 am Post subject: |
|
|
Okay, a little searching brought me to the answer: postrow is a block...whatever that is... and MESSAGE and that other one are just global variables...
but what is a block? _________________ -still only a n00b

|
|
| Back to top |
|
 |
admin (no pm's please) Site Admin

 Virtual Cash: 42920
Joined: 22 May 2005 Posts: 19349
Add Karma
 rated by 157 members
Add Comment
Show Comments
 |
Posted: Fri Dec 22, 2006 1:18 am Post subject: |
|
|
blocks are loop constructs. e.g. a topic has many posts and hence the template needs a loop block to loop through each post.
Yes you are right about how good "else" would be. But it ain't available and we have to live with it. _________________
Family Friendly Shareware | | Web Design/Services | Free Forums
forum.myfreeforum.org |
|
| Back to top |
|
 |
blakelives0312 Apprentice


Joined: 15 Dec 2006 Posts: 119 Location: Houston, Texas Add Karma
 rated by 0 members
Add Comment
Show Comments
 |
Posted: Fri Dec 22, 2006 1:37 am Post subject: |
|
|
*sigh* html is so primative...but, combined with scripts it is so complicated! _________________ -still only a n00b

|
|
| Back to top |
|
 |
blakelives0312 Apprentice


Joined: 15 Dec 2006 Posts: 119 Location: Houston, Texas Add Karma
 rated by 0 members
Add Comment
Show Comments
 |
Posted: Fri Dec 22, 2006 1:48 am Post subject: |
|
|
--on re-examination of index_body.tpl code... --
hmm... so <!-- BEGIN catrow --> and <!-- BEGIN forumrow --> begin blocks? and catrow.forumrow.FORUM_NAME is a global variable inside said blocks that changes every time this loop iterates?
wow...lots of knowledge... do you feel like you are being quizzed? because I feel like I'm quizzing you... its fun though... _________________ -still only a n00b

|
|
| Back to top |
|
 |
admin (no pm's please) Site Admin

 Virtual Cash: 42920
Joined: 22 May 2005 Posts: 19349
Add Karma
 rated by 157 members
Add Comment
Show Comments
 |
Posted: Fri Dec 22, 2006 2:25 am Post subject: |
|
|
I think that if you are that interested you can easily create a test forum and edit templates and work it all out! and then post a tutorial to answer the questions!
I only know what has been needed to know to develop the portal components we have now, I didn't program phpbb2 myself! _________________
Family Friendly Shareware | | Web Design/Services | Free Forums
forum.myfreeforum.org |
|
| Back to top |
|
 |
blakelives0312 Apprentice


Joined: 15 Dec 2006 Posts: 119 Location: Houston, Texas Add Karma
 rated by 0 members
Add Comment
Show Comments
 |
Posted: Fri Dec 22, 2006 3:43 am Post subject: |
|
|
oh haha...
okay...will do
thanks for alll your help!!! _________________ -still only a n00b

|
|
| Back to top |
|
 |
Master Mathandal Craftsman

Joined: 13 Sep 2006 Posts: 277
Add Karma
 rated by 1 members
Add Comment
Show Comments
 |
Posted: Wed Dec 27, 2006 4:50 am Post subject: |
|
|
What switch would I use to make it where you cant see ANYTHING, but it isnt deleted. Just completely hidden. _________________ The Force United

|
|
| Back to top |
|
 |