Back to vBulletin 3.0 Add-Ons

vba CMPS: Smilie Creator
Mod Version: 1.00, by KW802

This modification is in the archives.
vB Version: 3.0.3 Rating: (2 votes - 4.50 average) Installs: 62
Released: 06 Aug 2004 Last Update: Never Downloads: 27
Not Supported  

vBa CMPS: Smilie Creator v1.0.1

OVERVIEW: This is a conversion of an old VB2 hack (index.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/mods/index.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.....
  • vBulletin 3.x.x
  • vBadvanced CMPS
  • A server that supports GD -- If you server is not running GD then it will not be able to create the new image.
INSTALLATION: Installation is really easy.....
  1. Upload the fps_smilie_creator.php file to your /forums/modules directory (the folder where you keep your CMPS modules).
  2. Upload the fps_smilie_creator folder to your /forums/images/smilies folder (the folder where you keep your VB smilies). The resulting path should then be /forums/images/smilies/fps_smilie_creator.
  3. Copy & paste the contents of fps_smilie_creator_template.html into a new custom template named adv_portal_fps_smilie_creator (or whatever your prefer).
  4. Create a new VBA CMPS page or module. This is really your choice. For my site I liked it better being a seperate page so when I created my page I used the Page Template option. If you add it as a module instead of a new page then do not include the PHP file in the new module, only include the template!
That's it, you're done! If you upload the PHP file to a folder other than your modules directory or if you upload the images to a folder other than ../images/smilies then you'll have to update the template path names.


UPDATES: Updates & changes....
  • 2004-08-09: The problem with the right-mouse "Save Picture As..." in Microsoft Internet Explorer, where it would want to save it as a bitmap instead of a PNG, has been fixed. I also tweaked the template a little to no longer need the <div> tags.
TIPS & TRICKS: Some ways increase the functionality of your Smilie Creator....
  • Encourage your visitors to register

    Spoiler (click to open)


    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:
    Attached Images
    File Type: png FPS_Smilie_Mod_1.png (68.4 KB, 116 views)

    Close
REMINDER: To always be informed of updates & changes be sure to click the button. :classic:

Download

This modification is archived and cannot be downloaded.

Screenshots

   

Similar Mods

Smilie Info: Smilie Usage in Posts vBulletin 3.6 Add-ons

vblts.ru supports vBulletin®, 2022-2024