Now many of you who have used phpbb2 may know of a mod where you allow you place a bbcode in your sig and it would display your online/offline status. This mod required a very extensive amount of editing the core code.
Now thanks to the custom profile fields and Sniper_E's tutorial on utilizing custom profile fields, this task is very easy to accomplish with editing only two template files file.
We will display the online text in bright green and the offline status in red.
First we will need to create two custom profile fields.
Let's call the first one "online_status" and let's make it a "Single text field"
Name your "Field name/title presented to the user:" to "online status"
Give short description (See screen shot)
Now let's create the 2nd profile field and let's call it "offline_status" and let's make it a "Single text field" also.
Name your "Field name/title presented to the user:" to "offline status"
Give short description (See screen shot)
Now for the fun part.
SUBSILVER2
Open up Viewtopic_body.html and find this code:
- Code: Select all
<!-- IF postrow.SIGNATURE -->
<span class="postbody"><br />_________________<br />{postrow.SIGNATURE}</span>
<!-- ENDIF -->
After add:
- Code: Select all
<br />
<!-- BEGIN custom_fields -->
<!-- IF postrow.custom_fields.PROFILE_FIELD_NAME eq "online status" and postrow.S_ONLINE -->
<table width="100%" cellspacing="1">
<td align="center">
<span style="color: #00FF00;"><i><strong>{postrow.custom_fields.PROFILE_FIELD_VALUE}</i></span></strong>
</td>
</tr>
</table>
<!-- END custom_fields -->
<!-- ENDIF -->
<!-- BEGIN custom_fields -->
<!-- IF postrow.custom_fields.PROFILE_FIELD_NAME eq "offline status" and not postrow.S_ONLINE -->
<table width="100%" cellspacing="1">
<td align="center">
<span style="color:red;"><i><strong>{postrow.custom_fields.PROFILE_FIELD_VALUE}</i></span></strong>
</td>
</tr>
</table>
<!-- ENDIF -->
<!-- END custom_fields -->
FIND:
- Code: Select all
<br /><b>{postrow.custom_fields.PROFILE_FIELD_NAME}:</b> {postrow.custom_fields.PROFILE_FIELD_VALUE}
BEFORE_ADD
- Code: Select all
<!-- IF not ( custom_fields.PROFILE_FIELD_NAME eq "online status" or custom_fields.PROFILE_FIELD_NAME eq "offline status" ) -->
ONCE AGAIN FIND:
- Code: Select all
<br /><b>{postrow.custom_fields.PROFILE_FIELD_NAME}:</b> {postrow.custom_fields.PROFILE_FIELD_VALUE}
AFTER_ADD:
- Code: Select all
<!-- ENDIF -->
Be sure to purge your templates cache
PROSILVER
OPEN VIEWTOPIC_BODY.HTML
FIND:
- Code: Select all
<!-- IF postrow.SIGNATURE --><div id="sig{postrow.POST_ID}" class="signature">{postrow.SIGNATURE}</div><!-- ENDIF -->
After add:
- Code: Select all
<br />
<!-- BEGIN custom_fields -->
<!-- IF postrow.custom_fields.PROFILE_FIELD_NAME eq "online status" and postrow.S_ONLINE -->
<table width="100%" cellspacing="1">
<td align="center">
<span style="color: #00FF00;"><i><strong>{postrow.custom_fields.PROFILE_FIELD_VALUE}</i></span></strong>
</td>
</tr>
</table>
<!-- END custom_fields -->
<!-- ENDIF -->
<!-- BEGIN custom_fields -->
<!-- IF postrow.custom_fields.PROFILE_FIELD_NAME eq "offline status" and not postrow.S_ONLINE -->
<table width="100%" cellspacing="1">
<td align="center">
<span style="color:red;"><i><strong>{postrow.custom_fields.PROFILE_FIELD_VALUE}</i></span></strong>
</td>
</tr>
</table>
<!-- ENDIF -->
<!-- END custom_fields -->
FIND:
- Code: Select all
<dd><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}:</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
BEFORE-ADD
- Code: Select all
<!-- IF not ( custom_fields.PROFILE_FIELD_NAME eq "online status" or custom_fields.PROFILE_FIELD_NAME eq "offline status" ) -->
ONCE AGAIN FIND:
- Code: Select all
<dd><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}:</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
AFTER-ADD:
- Code: Select all
<!-- ENDIF -->
Be sure to purge your templates cache
Now I just need to work on this for the private messages...Stay tuned
The idea behind this mod is to give the user total customization of an online/offline message.
Basically just a novelty but I have found that my members have a ball with it.
Now I just need to work on this for the private messages...Stay tuned
The idea behind this mod is to give the user total customization of an online/offline message.
Basically just a novelty.















