admin (no pm's please)
|
New template macrosFor logged in users, the following macros are now defined throughout:
{USER_ID}
{USERNAME}
{AVATAR}
So for example a welcome to a logged in user can be shown in overall_header.tpl.
|
admin (no pm's please)
|
A new switch:
<!-- BEGIN switch_private_message_new -->
<!-- END switch_private_message_new -->
which allows you to add stuff to a template if new private messages exist has been added.
|
admin (no pm's please)
|
I have also added:
<!-- BEGIN switch_private_message_unread -->
<!-- END switch_private_message_unread -->
and:
{PRIVATE_MESSAGE_UNREAD_FLAG} which contains the number of unread messages.
|
Symon
|
Have added a walkthough but for a welcome text message only
HOWTODOIT
|
admin (no pm's please)
|
When editing templates, you can now use code like:
| Code: |
<script language="JavaScript" type="text/javascript">
if ({USER_LEVEL_FLAG} != -1)
{
document.write("<a href=\"javascript:void(0)\" onclick=\"window.open('addcomment.php?userid={postrow.POSTER_ID}&component=COMMENT', '_addcomment', 'resizable=yes,width=500,height=360')\">Add Comment</a>");
}
</script>
|
{USER_LEVEL_FLAG} has the values:
-1 - Guest
0 User
1 Admin
2 Mod
Note in the example above that hides the Add Comment line from anyone who is not logged in, you will need to "escape" the " character with \" when it is used in document.write.
|
Roy
|
| Symon wrote: | Have added a walkthough but for a welcome text message only
HOWTODOIT |
Hey Symon when i moved my mouse over your banner it said click to activate your account? this was on your site above.
|
Symon
|
| Roy wrote: | | Symon wrote: | Have added a walkthough but for a welcome text message only
HOWTODOIT |
Hey Symon when i moved my mouse over your banner it said click to activate your account? this was on your site above.  |
Can you do a screen shot as i just logged out and run the mouse over the banner and see nothing.
|
Roy
|
Yup i can but i need to know how to take the screen shot and then how to upload it on here.
|
Roy
|
Ok cerrection its where it has all the forum controls ie, FAQ, Search, Members list etc. If i hover the mouse over it it say's click to activate and use this control.
|
Symon
|
| Roy wrote: | | Ok cerrection its where it has all the forum controls ie, FAQ, Search, Members list etc. If i hover the mouse over it it say's click to activate and use this control. |
You are using IE ???? i would think
Read here
http://www.runningrock.com/click_to_activate_and_use_this_control.html
|
Roy
|
Yup i am and after clicking on that link i can see its normal for some people, i have now started downloading the patch.
Thanks for your help Symon.
|
the_punisher_kid
|
Re: New template macros | admin (no pm's please) wrote: | For logged in users, the following macros are now defined throughout:
{USER_ID}
{USERNAME}
{AVATAR}
So for example a welcome to a logged in user can be shown in overall_header.tpl. |
Hold on, do we put those anywhere in the overall header? Or is it just a specific spot?
|
CodyT07
|
Where you want them to appear e.g. sub portals.
|
admin (no pm's please)
|
New one for memberlist.php
{memberrow.WWW_URL}
example use:
<!-- IF memberrow.WWW_URL != "" -->
{memberrow.WWW_URL}
<!-- ENDIF -->
|
admin (no pm's please)
|
Some for viewforum_body.tpl
topicrow.S_TOPIC_TYPE
which can be:
SUBFORUM -1
NORMAL 0
STICKY 1
ANNOUNCE 2
GLOBAL_ANNOUNCE 3
PORTAL_FRONTPAGE 4
PORTAL_TOP 5
PORTAL_ARCHIVE 6
PORTAL_EDITORSCHOICE 7
PORTAL_OPENTICKET 8
also
S_SUBFORUMS
S_ANNOUNCEMENTS
S_STICKIES
are macros set the total of those topic types. note announcements is all announcement types.
|
admin (no pm's please)
|
This is most places now, spot a place where it is not and I will put it in.
In all template looping blocks, you can now do:
<!-- IF memberrow.ROW_NUMBER is even -->
<li class="bg1">
<!-- ELSE -->
<li class="bg2">
<!-- ENDIF -->
e.g. a macro loopname.ROW_NUMBER is defined.
|
admin (no pm's please)
|
Some more macros in index_body.tpl
<!-- IF catrow.forumrow.POSTS >0 -->
<dd class="lastpost" >By {catrow.forumrow.LAST_POST_AUTHOR}{catrow.forumrow.LAST_POST_IMG} on {catrow.forumrow.LAST_POST_TIME}</dd>
<!-- ELSE -->
<dd class="lastpost" > {catrow.forumrow.LAST_POST}</dd>
<!-- ENDIF -->
prior to this :
{catrow.forumrow.LAST_POST_AUTHOR}{catrow.forumrow.LAST_POST_IMG} on {catrow.forumrow.LAST_POST_TIME}
were not defined, and all the formating was hardcoded into {catrow.forumrow.LAST_POST} now the template is allowed to decide how to format things
|
admin (no pm's please)
|
These will be in viewtopic_body.tpl:
postrow.S_MODERATED_POST
has the values:
0 - normal
1 - moderated, but post is by the user viewing.
2 - moderated
3 - moderated, but post is being viewed by mod/admin
The following will be 0 or 1 depending on the user.
postrow.S_USER_ACTIVE
postrow.S_USER_MODERATED
postrow.S_USER_BLOCKPOST
postrow.S_USER_BLOCKNEWTOPIC
postrow.S_USER_RESTRICTPM
Last but not least, postrow.MESSAGE contains the post, but it may now have been modified by moderation messages.
postrow.PLAIN_MESSAGE will contain blank or the unaltered message.
|
admin (no pm's please)
|
Plus generally available:
The following will be 0 or 1 depending on the user.
S_USER_ACTIVE
S_USER_MODERATED
S_USER_BLOCKPOST
S_USER_BLOCKNEWTOPIC
S_USER_RESTRICTPM
|
admin (no pm's please)
|
Now available in index_body.tpl
{U_NEWEST_USERNAME}
{NEWEST_USERNAME}
{S_TOTAL_USERS}
{S_TOTAL_POSTS}
Fairly self explanatory. This information was only available previously in preformatted strings. You can now do what you like with the values.
|
wills99
|
When I place {U_NEWEST_USERNAME} into index_body.tpl, it displays this- profile.php?mode=viewprofile&u=42
Can you have a look at this please when you have a minute.
Cheers,
Wills
http://all80suk.myfastforum.org
|
admin (no pm's please)
|
looks right to me, that is the raw address. You have to format it.
|
wills99
|
That's what I thought, just making sure, thanks for the sharp reply.
Cheers,
Wills
|
|
|