Here's a small & quick modification to the template for vBa CMPS users to help encourage your visitors to register!
What I've noticed on the sites that have installed the Smilie Creator is that they either leave the security settings wide open so that anybody can use it or they turn the page off for users not logged in. One of my goals with this (besides it being a learning experiment
) was to help encourage users to register but with security opened up to everybody visitors had no reason to register and even then they couldn't see what benefit registering would do for them. Plus for people who implemented this as a module, instead of page, they couldn't restrict access to it as easily as people who implemented it as a new page.
The solution is a quick change to the template to use a vBulletin conditional to restrict access to the "create" button to only users logged in. Simple but I think it does the job so far.
A screen shot of this modification showing the output to visitors not logged in is attached.
To make this change find the following code in your template:
Code:
<td align="center" valign="middle" colspan="2" class="alt1">
<br/><input type="button" name="Create_Smilie" value="Create my custom smilie!" onclick="createSmilie(get_radio_value(),document.smilie_form.text.value,document.smilie_form.col.value,document.smilie_form.shcol.value)"/>
</td>
And replace it with this code:
Code:
<td align="center" valign="middle" colspan="2" class="alt1">
<br/>
<if condition="$bbuserinfo[userid]">
<!-- CODE TO DISPLAY IF THE USER IS LOGGED IN -->
<input type="button" name="Create_Smilie" value="Create my custom smilie!" onclick="createSmilie(get_radio_value(),document.smilie_form.text.value,document.smilie_form.col.value,document.smilie_form.shcol.value)"/>
<else />
<!-- MESSAGE FOR GUESTS -->
<hr width="95%">
<strong>If you were logged in right now a button would be here so that you could create your new smilie! If you haven't registered yet just click <a href="$vboptions[bburl]/register.php?$session[sessionurl]">here</a>. <i>It's fast, easy and free!</i></strong>
<hr width="95%">
</if>
</td>
If you come up with any other modifications that you'd like to share with the community please feel free to post your ideas! To be emailed any major updates or changes click "Install" in the upper-right hand corner of this thread.
IMPORTANT: If you're running the original 1.0.0 version of the template the command line has changed in the 1.0.1 template! You'll need to make the following modificatins only if you're using the original 1.0.0 template otherwise if you're using the newer version of the template use the code above.
Only use the code below if you're using the original version of the template: Look for this code:
Code:
<td align="center" valign="middle" colspan="2" class="alt1">
Code:
<br/>
<input type="button" name="Create_Smilie" value="Create my custom smilie!" onclick="createSmilie(get_radio_value(),document.smilie_form.text.value,document.smilie_form.col.value,docume nt.smilie_form.shcol.value)"/>
</td>
And change it to:
Code:
<td align="center" valign="middle" colspan="2" class="alt1">
Code:
<br/>
<if condition="$bbuserinfo[userid]">
<!-- CODE TO DISPLAY IF THE USER IS LOGGED IN -->
<input type="button" name="Create_Smilie" value="Create my custom smilie!" onclick="createSmilie(get_radio_value(),document.smilie_form.text.value,document.smilie_form.col.value,document.smilie_form.shcol.value)"/>
<else />
<!-- MESSAGE FOR GUESTS -->
<hr width="95%">
<strong>If you were logged in right now a button would be here so that you could create your new smilie! If you haven't registered yet just click <a href="$vboptions[bburl]/register.php?$session[sessionurl]">here</a>. <i>It's fast, easy and free!</i></strong>
<hr width="95%">
</if>
</td>
For some reason there keeps getting extra spaces inserted into the word "form" and "document" in the revised input command above. I've tried modifying it several times now and for some reason vBulletin keeps putting the spaces back in. In the revised code you'll need to remove the extra spaces before saving your template otherwise your page won't work and will display a script error message. :ermm: