The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
vba CMPS: Smilie Creator Details »» | |||||||||||||||||||||||||
vBa CMPS: Smilie Creator v1.0.1
OVERVIEW: This is a conversion of an old VB2 hack (https://vborg.vbsupport.ru/showthread.php?t=50450) by Kars10 to create new smilie faces on the fly. The original version acted as a pop-up box from within a BB code so that the new smilie would be inserted into your forum message posting. A BB code trick posted over at vbulletintemplates.com (http://www.vbulletintemplates.com/mo...ead.php?t=6671) really eliminates the need of having to do this hack anymore since you can accomplish nearly the same thing without having to do any code changes. I was still interested in this old hack though because there are times I'd like to be able to create a new smilie on the fly either for my own personal usage or for my site. So looking at it as a learning experience my goals were to change the hack to be a more generic approach and make it easy to integrate into a site so making it into a vBadvanced CMPS (http://www.vbadvanced.com) module seemed the obvious answer. The other added benefit of making it into a vBadvanced CMPS module is the fact that it could then be added to a web site without doing any code modifications at all but still being able to, for instance, block access to it from non-registered users. I emphasis.... the PHP code is by Kars10, my only change to it was to remove the file name from being hard-coded and instead I'm passing it in from the template in order to make it easier to add new smilies in the future. REQUIREMENTS: Since the template and PHP are really generic you should be able to easily get it working with just about configuration. For my purposes thought it was intended for.....
UPDATES: Updates & changes....
Show Your Support
|
Comments |
#52
|
||||
|
||||
Working nice at our website, as a center module, thanks for this cool addon!
|
#53
|
||||
|
||||
Quote:
Today's learning lesson for me will be to find out why parsing an array in PHP works fine on the Unix/Linux boxes but not on a Windows box. Man, I guess I am a geek.... I love doing this kind of stuff. I think the time has also come for me to visit my local Barnes & Noble up for some PHP books. |
#54
|
||||
|
||||
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> 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> 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: |
#55
|
|||
|
|||
Quote:
|
#56
|
||||
|
||||
Quote:
|
#57
|
|||
|
|||
Thank so you much....I will patient....
|
#58
|
||||
|
||||
Hey what is smilies.psd in the zip?
|
#59
|
||||
|
||||
Quote:
It is a template smilie face so that new smilies can be created from it. It was part of the original VB2.x hack that this conversion was based upon. To create additional/new smilie faces use the PSD to make your smilie to how ever you'd like it and then when you upload it to your server just change the template to include it. As long as the new smilie is the same dimensions as the template then it'll work fine. Kevin |
#60
|
|||
|
|||
I get it to work, but when you save image as, it saves it as .php
help |
#61
|
||||
|
||||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|