View Full Version : Smilie Creator
KW802
08-06-2004, 10:43 AM
vBa CMPS: Smilie Creator v1.0.1
OVERVIEW: This is a conversion of an old VB2 hack (http://www.vbulletin.org/forum/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/mods/showthread.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.
REQUIREMENTS: You'll need vBulletin 3.x, vBadvanced CMPS, and a server running GD. If you server is not running GD then it will not be able to create the new image. Since the template and PHP are really generic you should be able to easily port it over to non-VB3 sites but no matter what your server has to support GD.
INSTALLATION: Installation is really easy.....
Upload the fps_smilie_creator.php file to your /forums/modules directory (the folder where you keep your CMPS modules). 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. 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). 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.
Have fun!
DEMO: Even saved as a PNG-8 the screen shots are too big to be attached (What kind of demo shot can be shown with a resolution of 280?!) so to see it in action....
Up & running @ Farpoint Station (http://www.farpointstation.org/index.php?page=smilie_creator&styleid=10) | Pic #1 (http://www.farpointstation.org/images/fps/smilie_creator/fps_smilie_creator1.gif) | Pic #2 (http://www.farpointstation.org/images/fps/smilie_creator/fps_smilie_creator2.gif)
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.
REMINDER: To always be informed of updates & changes be sure to click the "Install" button over at the VB.org thread. :cool:
http://www.vbulletin.org/forum/showthread.php?t=68062
mholtum
08-06-2004, 12:15 PM
ok, now that is cool. Thanks
da prez
08-06-2004, 06:09 PM
thanx,
pretty cool.
i was messin around with it , i have IE 6, and if you add extention (i.e. smilie1.png or smilie1.gif)
it will use that extention and save pic.
nice little program.
Snowy
08-06-2004, 10:34 PM
hhhmm strange thing. I added it as a page. In the Page Template:i added adv_portal_smilie_creator I have enabled ALL usergroups to see it BUT as an admin i can see the page and it all works BUT none of my members can at all
Any ideas?
mholtum
08-06-2004, 11:10 PM
link?
Fiber
08-06-2004, 11:31 PM
Just a little thing I found, one cannot use "quotes" in the smiles either.
No biggy here, just a heads up.
Fiber
Snowy
08-07-2004, 12:00 AM
link?
OOPS sorry i thought i gave a link :(
http://www.synergyforums.com/index.php?page=smilie
I see this BUT others cant see anything but the navbar, all usergroups are ticked, even the banned usergroup is ticked.
tomshawk
08-07-2004, 12:08 AM
OOPS sorry i thought i gave a link :(
http://www.synergyforums.com/index.php?page=smilie
I see this BUT others cant see anything but the navbar, all usergroups are ticked, even the banned usergroup is ticked.
Well, Thats strange, I see it fine.
Looks wicked on a dark theme ;)
Snowy
08-07-2004, 12:11 AM
now that is strange....they are using IE6 same as me...hhmmm
DarknessDivine
08-07-2004, 12:20 AM
wow COOL !
mholtum
08-07-2004, 01:26 AM
Looks ok to me as well.
here's mine http://www.ravensrealm.net/index.php?page=smilies
Fiber
08-07-2004, 01:31 AM
Works here to, double check the link you provided for you users would be my guess.
Who knows, I just got this off of VB.org before it was posted here.
Very nice!
Fiber
cogimo
08-07-2004, 09:11 PM
Hi Great hack
I got it installed on two of my sites however I am getting a red X when I click on get smile
I do have GD installed it is working on another site on the same server
No problem fixed it
KW802
08-07-2004, 09:51 PM
Snowy: I've responded over at VB.org but the cliff notes is that it works for me both unregistered and registered ("KW802" account created tonight; nice looking site by the way). You've answered already here what my question over there was... what browser are they using. I'll experiment to see if I can cause IE to break but for testing I've been using IE 6 and Mozilla .91.
da prez: Cool, I'll have to experiment to see what I get. One of the issues I'm finding with IE is that it would save the PNG file but it wasn't saving the transparency settings of the PNG. I'll hammer away at that one until I figure out a solution or go nuts.
Fiber: The quotes thing is by design of the PHP code; it removes quotes. If it's an issue for you I'll try to mess around the PHP code a bit to see why the original author would've purposely been removing them.
Cogimo: Cool to see that you got it working.
martyjp
08-08-2004, 11:02 AM
ISSUES: IE is having some weird fit with doing a right-mouse "Save Picture As..." for some reason, it keeps trying to save it on my machine as a bitmap instead of a PNG. Mozilla Firefox, on the other hand, works perfectly. Weird, very weird.... I'll see what I can do.
Normaly due to internet cache being too big, clear it and it should be ok
*goes to install*
martyjp
08-08-2004, 11:29 AM
Warning: imagecopy(): supplied argument is not a valid Image resource in /home/***/public_html/vb/modules/fps_smilie_creator.php on line 102
Warning: imagecopy(): supplied argument is not a valid Image resource in /home/***/public_html/vb/modules/fps_smilie_creator.php on line 103
Warning: Cannot modify header information - headers already sent by (output started at /home/***/public_html/vb/modules/fps_smilie_creator.php:102) in /home/***/public_html/vb/modules/fps_smilie_creator.php on line 143
PNG IHDR%/ PLTE~Q]tRNS@fIDATx=0 sI[rT"yHdmJKPP\q)ÒH3)'+ ZxV;#] VoСWuj=;=IENDB`
Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/***/public_html/vb/modules/fps_smilie_creator.php on line 146
Any ideas?
KW802
08-10-2004, 12:17 AM
I am really starting to HATE Microsoft Internet Explorer! :mad:
The problem with the right-mouse "save picture as..." option in IE only occured if the text had spaces in it; if there was no text then it worked fine. Mozilla Firefox worked perfectly, it's only IE that was acting up.
To fix the problem find this code (line #23 in the original template).... var command = '$vboptions[bburl]/modules/fps_smilie_creator.php?text=%20'+text+'%20&typ='+smilie_type+'&col='+font_text_color+'&shcol='+font_background_color;
... and change "+text+" to "+text.replace(/ /g,"%20")+".
I've also tweaked the code a bit so that the <div> tags are no longer required. I'll be repackaging the zip shortly with the above fix and the tweaks (the tweaks won't affect nothing, it's just to reduce some HTML code in the template).
KW802
08-10-2004, 12:18 AM
Any ideas?
Martyjp,
Please post a copy of your template that you created.
Thanks,
Kevin
mholtum
08-10-2004, 01:17 AM
I am really starting to HATE Microsoft Internet Explorer! :mad:
The problem with the right-mouse "save picture as..." option in IE only occured if the text had spaces in it; if there was no text then it worked fine. Mozilla Firefox worked perfectly, it's only IE that was acting up.
To fix the problem find this code (line #23 in the original template).... var command = '$vboptions[bburl]/modules/fps_smilie_creator.php?text=%20'+text+'%20&typ='+smilie_type+'&col='+font_text_color+'&shcol='+font_background_color;
... and change "+text+" to "+text.replace(/ /g,"%20")+".
I've also tweaked the code a bit so that the <div> tags are no longer required. I'll be repackaging the zip shortly with the above fix and the tweaks (the tweaks won't affect nothing, it's just to reduce some HTML code in the template).Worked fine for me in IE 6, Mozilla & Firefox.
KW802
08-10-2004, 09:19 AM
Worked fine for me in IE 6, Mozilla & Firefox.It worked fine for me also as long as I didn't put any spaces in the smilie message. ;)
The problem was when you went to right-click "Save Picture As..." in IE it would try to save the new smilie as a bitmap image instead of a PNG image but only when there were spaces in the text. A smilie of "Cool" would work fine, IE would save it as a PNG, but a smilie of "This is cool" would result in IE trying to save it as a bitmap. You could still use the file just fine but the image didn't retain the transparency of the original PNG (it ended up with a white background). Firefox, on the other, always worked perfectly by always saving the image as a PNG. Some of the guys/gals from over at VB.org were hounding me on the issue so I was resolved to fix it.
It's one of these deals where it worked but it didn't work. :D
martyjp
08-10-2004, 03:32 PM
<!-- START: Module table -->
<table align="center" border="0" class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" width="100%">
<!-- START: Generic Module Heading -->
<tr>
<td class="tcat">
<span class="smallfont"><strong>$vba_options[portal_blockbullet] FPS Smilie Creator</strong></span>
</td>
</tr>
<!-- END: Generic Module Heading -->
<!-- START: Create the table cell to hold our contents -->
<tr>
<td class="$getbgrow" width="100%">
<center>
<!-- ************************* -->
<!-- START: FPS Smilie Creator -->
<!-- ************************* -->
<script type="text/javascript">
<!-- Script to call the PHP file to create the new image
function createSmilie(div_id,smilie_type,text,font_text_color,font_background_color) {
var command = '$vboptions[bburl]/modules/fps_smilie_creator.php?text=%20'+text+'%20&typ='+smilie_type+'&col='+font_text_color+'&shcol='+font_background_color;
var display = document.getElementById(div_id);
display.innerHTML = '<br/><img src="'+command+'"/><br/> <br/>';
}
//-->
</script>
<script type="text/javascript">
<!-- Script to find out which radio button was selected
function get_radio_value() {
for (var i=0; i < document.smilie_form.typ.length; i++) {
if (document.smilie_form.typ[i].checked) {
var rad_val = document.smilie_form.typ[i].value;
}
}
return rad_val
}
//-->
</SCRIPT>
<form name="smilie_form">
<table width="100%" border="0" cellpadding="5" cellspacing="0">
<!-- START: Default smilies -->
<tr>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage1.png" checked >
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage1.png" alt="" width="29" height="22" border="0">
</td>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage6.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage6.png" alt="" width="29" height="22" border="0">
</td>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage11.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage11.png" alt="" width="29" height="22" border="0">
</td>
</tr>
<tr>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage2.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage2.png" alt="" width="29" height="22" border="0">
</td>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage7.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage7.png" alt="" width="29" height="22" border="0">
</td>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage12.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage12.png" alt="" width="29" height="22" border="0">
</td>
</tr>
<tr>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage3.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage3.png" alt="" width="29" height="22" border="0">
</td>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage8.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage8.png" alt="" width="29" height="22" border="0">
</td>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage13.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage13.png" alt="" width="29" height="22" border="0">
</td>
</tr>
<tr>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage4.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage4.png" alt="" width="29" height="22" border="0">
</td>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage9.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage9.png" alt="" width="29" height="22" border="0">
</td>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage14.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage14.png" alt="" width="29" height="22" border="0">
</td>
</tr>
<tr>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage5.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage5.png" alt="" width="29" height="22" border="0">
</td>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage10.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage10.png" alt="" width="29" height="22" border="0">
</td>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage15.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage15.png" alt="" width="29" height="22" border="0">
</td>
</tr>
</table>
<!-- END: Default Smilies -->
<!-- START: Options -->
<table width="100%" border="0" cellpadding="5" cellspacing="0">
<!-- START: Enter text message -->
<tr>
<td align="left" valign="top" class="alt1">
<strong>Enter the sign's message: </strong>
</td>
<td align="left" class="alt1">
<textarea name="text" rows="3" cols="25" onFocus="this.value='';">(click here to enter your message)</textarea>
</td>
</tr>
<!-- END: Enter text message -->
<!-- START: Text color -->
<tr>
<td align="left" valign="top" class="alt1">
<smallfont><strong>Choose the sign's text color: </strong></smallfont>
</td>
<td align="left" class="alt1">
<select name="col">
<option value="0,0,0" selected style="background-color:#000000; color:#FFFFFF">Black</option>
<option value="0,0,255" style="background-color:#0000FF">Blue</option>
<option value="185,207,232" style="background-color:#B9CFE8">Softblue</option>
<option value="255,153,0" style="background-color:#FF9900">Orange</option>
<option value="255,210,0" style="background-color:#FFD200">Yellow</option>
<option value="0,255,0" style="background-color:#00FF00">Green</option>
<option value="197,248,163" style="background-color:#C5F8A3">Softgreen</option>
<option value="13,105,3" style="background-color:#0D6900; color:#FFFFFF">Darkgreen</option>
<option value="147,81,3" style="background-color:#935103; color:#FFFFFF">Brown</option>
<option value="255,255,255">White</option>
</select>
</td>
</tr>
<!-- END: Text color -->
<!-- START: Text background -->
<tr>
<td align="left" valign="top" class="alt1">
<smallfont><strong>Choose the sign's background color: </strong></smallfont>
</td>
<td align="left" class="alt1">
<select name="shcol">
<option value="255,255,255" selected>White</option>
<option value="0,0,255" style="background-color:#0000FF">Blue</option>
<option value="185,207,232" style="background-color:#B9CFE8">Softblue</option>
<option value="255,153,0" style="background-color:#FF9900">Orange</option>
<option value="248,241,163" style="background-color:#F8F1A3">Yellow</option>
<option value="0,255,0" style="background-color:#00FF00">Green</option>
<option value="197,248,163" style="background-color:#C5F8A3">Softgreen</option>
<option value="248,203,251" style="background-color:#F8CBFB">Pink</option>
<option value="228,195,164" style="background-color:#E4C3A4">Brown</option>
<option value="0,0,0" style="background-color:#000000; color=#FFFFFF">Black</option>
</select>
</td>
</tr>
<tr>
<td align="center" valign="middle" colspan="2" class="alt1">
<br/><input type="button" name="Create_Smilie" value="Create my custom smilie!" onclick="createSmilie('smilie_output',get_radio_value(),document.smilie_form.text.value,d ocument.smilie_form.col.value,document.smilie_form.shcol.value)"/>
</td>
</tr>
<tr>
<td align="center" valign="middle" colspan="2" class="alt1">
<div id="smilie_output" class="output"><br/>[Your new smilie will appear here!]<br/> <br/></div>
</td>
</tr>
<!-- END: Text background -->
</table>
<!-- END: Options -->
<!-- START: Buttons, Smilie Output, Instructions -->
<table width="100%" border="0" cellpadding="5" cellspacing="0">
<tr>
<td align="left" valign="middle" colspan="3" class="alt2">
<strong>INSTRUCTIONS:</strong> To create your own custom smilie first choose which smilie face you want to use. Enter what you want your smilie's sign to say by entering a message. Then choose what color you want the text wording of your message to be and also what color you want the sign's background to be. Then press the button at the bottom of the screen and your smilie will be created!<br/><br/>
<strong>SAVING YOUR SMILIE:</strong> With your right mouse button click on the new smilie and choose the "Save Picture As..." option if you're using Microsoft Internet Explorer or the "Save Image As..." option if you're using Mozilla. For best results we highly recommend using the <a href="http://www.mozilla.org/" target="_blank">Mozilla Firefox</a> browser.<br/><br/>
<strong>IMPORTANT:</strong> Please do <i><strong>NOT</strong></i> link directly to the new smilie.
</td>
</tr>
<td align="center" valign="middle" colspan="3" class="alt2">
<br/><br/>If you have any questions or problems please feel free to <a href="$vboptions[contactuslink]">contact us</a>.
</td>
</table>
<!-- END: Buttons, Smilie Output, Instructions -->
</form>
<!-- END: FPS Smilie Creator -->
<!-- END: Create the table cell to hold our contents -->
</center></td></tr>
<!-- END: Module table -->
</table>
<br />
Just cut and paste, all paths are correct
bluesteel
08-11-2004, 09:45 AM
Hi,
I have the same problem as martyjp. Any help would be appreciated.
Running vB v 3.0.3
KW802
08-11-2004, 11:03 AM
Martyjp & Bluesteel:
That error is related to the smilies folder. What folder did each of you guys puy the folder that contains all of the smilies into?
Martyjp: In your case the smilies should be in "/home/***/public_html/vb/images/smilies/fps_smilie_creator"; if they're not then you would've need to change your template.
martyjp
08-11-2004, 01:39 PM
http://www.f4g.net/vb/images/smilies/fps_smilie_creator/vorlage1.png path to the smilies is fine :/
KW802
08-11-2004, 09:56 PM
http://www.f4g.net/vb/images/smilies/fps_smilie_creator/vorlage1.png path to the smilies is fine :/
By any chance did you guys create this as a module instead of adding a new page and using the Custom Template option? And if you did add it by creating a new module then did you tell the module to include the php file? Because if you did..... :p
Change the "File to Include" value to "None" and then change the "Or Template to Include" value to be the name of the template (minus the "adv_portal_" part of course).
kvtech
08-19-2004, 04:52 AM
Change the "File to Include" value to "None" and then change the "Or Template to Include" value to be the name of the template (minus the "adv_portal_" part of course).
Thanks, work great!
Click Installed
KW802
08-19-2004, 08:51 AM
Thanks, work great!
Click Installed
:cool:
If anybody else is still having any issues please let me know.
KW802
08-30-2004, 09:38 PM
Here's a small & quick modification to the template for vBa CMPS 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 :p ) 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. :)
To see this code in action visit: http://www.farpointstation.org/index.php?page=smilie_creator
To make this change find the following code in your template:<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_f orm.col.value,document.smilie_form.shcol.value)"/>
</td>
And replace it with this 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_f orm.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 vbulletin.org (http://www.vbulletin.org/forum/showthread.php?t=68062) thread.
mholtum
08-30-2004, 11:11 PM
Cant find that text with either Dreamweaver 2004 or notepad.. DAMN!
KW802
08-30-2004, 11:20 PM
Cant find that text with either Dreamweaver 2004 or notepad.. DAMN!
OK, I just checked it out.... When I incremented the version from 1.0.0 to 1.0.1 the template got changed also. The 1.0.1 template got rid of the need for the <div> tags (which means a slightly different Javascript code also).
Just in case try this on your test board first. Or at the very least keep a copy of the 'before' template somewhere. ;) If you have problems with it give me a holler.
Look for this code: <td align="center" valign="middle" colspan="2" class="alt1">
<br/>
<!-- 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_f orm.col.value,docume nt.smilie_form.shcol.value)"/>
</td>
And change it to:<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_f orm.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>
Edit: 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.
mholtum
08-30-2004, 11:22 PM
I altered my search and found it.. Sweet thanks.. Great addin
KW802
08-30-2004, 11:39 PM
I altered my search and found it.. Sweet thanks.. Great addin
No problem. Sorry 'bout the confusion there, I completely forgot about the fact that I changed that command line in between versions. I'm updating the vb.org thread also. :D
KW802
08-30-2004, 11:45 PM
I altered my search and found it.. Sweet thanks.. Great addin
Any chance you may have hit a key anywhere doing the change? I'm getting a script error now when viewing the page.
Edit: OK, looks like it may have been a cut & paste error on my behalf... look for:<!-- 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_for m.text.value,document.smilie_form.col.value,docume nt.smilie_form.shcol.value)"/>
... and remove the extra spaces in the word "form" and "document".
:o
mholtum
08-31-2004, 12:06 AM
Done, now how does it look?
KW802
08-31-2004, 12:43 AM
Done, now how does it look?
Strange, I keep getting an error that "tP" is not defined. From looking at the source it looks like it has something to do with the clock. I'm scratching my head on this one. The code for "tP" is no where even near the Smilie stuff.
Edit: Well, the good news is that it looks like the smilie code may be OK. The bad news is that I get a script error off the main page also, not just the smilie page, which means that there is some JavaScript in one of your modules, most likely the clock, that it doesn't like. I'm getting the same results with both IE & Mozilla.
mholtum
08-31-2004, 01:10 AM
weird. I dont get any code errors. hmmmmm
KW802
08-31-2004, 01:20 AM
weird. I dont get any code errors. hmmmmm
I'll try again in the morning from a machine at the office. Here at the house I'm getting the yellow icon in IE and in Mozilla I'm getting errors in the JavaScript console. Maybe I've finally just hosed my machine up once too many. :)
fuse3k
09-17-2004, 04:22 PM
I set it up as a center module and made a custom page for it: I'm getting a few SQL errors. any ideas?
LINK: Here (http://server3.woolnet.net/~fuse3k/?page=smilecreator)
Warning: imagecopy(): supplied argument is not a valid Image resource in /home2/fuse3k/public_html/forum/modules/fps_smilie_creator.php on line 102
Warning: imagecopy(): supplied argument is not a valid Image resource in /home2/fuse3k/public_html/forum/modules/fps_smilie_creator.php on line 103
Warning: Cannot modify header information - headers already sent by (output started at /home2/fuse3k/public_html/forum/modules/fps_smilie_creator.php:102) in /home2/fuse3k/public_html/forum/modules/fps_smilie_creator.php on line 143
PNG IHDR%/ PLTE~Q]tRNS@fIDATx=0 sI[rT"yHdmJKPP\q)ÒH3)'+ ZxV;#] VoСWuj=;=IENDB`
Warning: imagedestroy(): supplied argument is not a valid Image resource in /home2/fuse3k/public_html/forum/modules/fps_smilie_creator.php on line 146
KW802
09-17-2004, 04:55 PM
I set it up as a center module and made a custom page for it: I'm getting a few SQL errors. any ideas?
LINK: Here (http://server3.woolnet.net/~fuse3k/?page=smilecreator)
Fuse3k,
Would you mind posting the template so I could take a look at it?
Thanks,
fuse3k
09-17-2004, 05:15 PM
Same code from the HTML file in the ZIP:
<!-- START: Module table -->
<table align="center" border="0" class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" width="100%">
<!-- START: Generic Module Heading -->
<tr>
<td class="tcat">
<span class="smallfont"><strong>$vba_options[portal_blockbullet] FPS Smilie Creator</strong></span>
</td>
</tr>
<!-- END: Generic Module Heading -->
<!-- START: Create the table cell to hold our contents -->
<tr>
<td class="$getbgrow" width="100%">
<center>
<!-- ************************* -->
<!-- START: FPS Smilie Creator -->
<!-- ************************* -->
<script type="text/javascript">
<!-- Script to call the PHP file to create the new image
function createSmilie(smilie_type,text,font_text_color,font_background_color) {
var command = '$vboptions[bburl]/modules/fps_smilie_creator.php?text=%20'+text.replace(/ /g,"%20")+'%20&typ='+smilie_type+'&col='+font_text_color+'&shcol='+font_background_color;
document.images.image_preview.src=command;
}
//-->
</script>
<script type="text/javascript">
<!-- Script to find out which radio button was selected
function get_radio_value() {
for (var i=0; i < document.smilie_form.typ.length; i++) {
if (document.smilie_form.typ[i].checked) {
var rad_val = document.smilie_form.typ[i].value;
}
}
return rad_val
}
//-->
</SCRIPT>
<form name="smilie_form">
<table width="100%" border="0" cellpadding="5" cellspacing="0">
<!-- START: Default smilies -->
<tr>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage1.png" checked >
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage1.png" alt="" width="29" height="22" border="0">
</td>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage6.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage6.png" alt="" width="29" height="22" border="0">
</td>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage11.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage11.png" alt="" width="29" height="22" border="0">
</td>
</tr>
<tr>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage2.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage2.png" alt="" width="29" height="22" border="0">
</td>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage7.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage7.png" alt="" width="29" height="22" border="0">
</td>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage12.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage12.png" alt="" width="29" height="22" border="0">
</td>
</tr>
<tr>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage3.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage3.png" alt="" width="29" height="22" border="0">
</td>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage8.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage8.png" alt="" width="29" height="22" border="0">
</td>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage13.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage13.png" alt="" width="29" height="22" border="0">
</td>
</tr>
<tr>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage4.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage4.png" alt="" width="29" height="22" border="0">
</td>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage9.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage9.png" alt="" width="29" height="22" border="0">
</td>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage14.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage14.png" alt="" width="29" height="22" border="0">
</td>
</tr>
<tr>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage5.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage5.png" alt="" width="29" height="22" border="0">
</td>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage10.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage10.png" alt="" width="29" height="22" border="0">
</td>
<td class="alt1">
<input type="radio" name="typ" value="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage15.png">
<img src="$vboptions[bburl]/images/smilies/fps_smilie_creator/vorlage15.png" alt="" width="29" height="22" border="0">
</td>
</tr>
</table>
<!-- END: Default Smilies -->
<!-- START: Options -->
<table width="100%" border="0" cellpadding="5" cellspacing="0">
<!-- START: Enter text message -->
<tr>
<td align="left" valign="top" class="alt1">
<strong>Enter the sign's message: </strong>
</td>
<td align="left" class="alt1">
<textarea name="text" rows="3" cols="25" onFocus="this.value='';">(click here to enter your message)</textarea>
</td>
</tr>
<!-- END: Enter text message -->
<!-- START: Text color -->
<tr>
<td align="left" valign="top" class="alt1">
<smallfont><strong>Choose the sign's text color: </strong></smallfont>
</td>
<td align="left" class="alt1">
<select name="col">
<option value="0,0,0" selected style="background-color:#000000; color:#FFFFFF">Black</option>
<option value="0,0,255" style="background-color:#0000FF">Blue</option>
<option value="185,207,232" style="background-color:#B9CFE8">Softblue</option>
<option value="255,153,0" style="background-color:#FF9900">Orange</option>
<option value="255,210,0" style="background-color:#FFD200">Yellow</option>
<option value="0,255,0" style="background-color:#00FF00">Green</option>
<option value="197,248,163" style="background-color:#C5F8A3">Softgreen</option>
<option value="13,105,3" style="background-color:#0D6900; color:#FFFFFF">Darkgreen</option>
<option value="147,81,3" style="background-color:#935103; color:#FFFFFF">Brown</option>
<option value="255,255,255">White</option>
</select>
</td>
</tr>
<!-- END: Text color -->
<!-- START: Text background -->
<tr>
<td align="left" valign="top" class="alt1">
<smallfont><strong>Choose the sign's background color: </strong></smallfont>
</td>
<td align="left" class="alt1">
<select name="shcol">
<option value="255,255,255" selected>White</option>
<option value="0,0,255" style="background-color:#0000FF">Blue</option>
<option value="185,207,232" style="background-color:#B9CFE8">Softblue</option>
<option value="255,153,0" style="background-color:#FF9900">Orange</option>
<option value="248,241,163" style="background-color:#F8F1A3">Yellow</option>
<option value="0,255,0" style="background-color:#00FF00">Green</option>
<option value="197,248,163" style="background-color:#C5F8A3">Softgreen</option>
<option value="248,203,251" style="background-color:#F8CBFB">Pink</option>
<option value="228,195,164" style="background-color:#E4C3A4">Brown</option>
<option value="0,0,0" style="background-color:#000000; color=#FFFFFF">Black</option>
</select>
</td>
</tr>
<tr>
<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_f orm.col.value,document.smilie_form.shcol.value)"/>
</td>
</tr>
<tr>
<td align="center" valign="middle" colspan="2" class="alt1">
<img src="" name="image_preview" border="0" id="preview" alt=""/>
</tr>
<!-- END: Text background -->
</table>
<!-- END: Options -->
<!-- START: Buttons, Smilie Output, Instructions -->
<table width="100%" border="0" cellpadding="5" cellspacing="0">
<tr>
<td align="left" valign="middle" colspan="3" class="alt2">
<strong>INSTRUCTIONS:</strong> To create your own custom smilie first choose which smilie face you want to use. Enter what you want your smilie's sign to say by entering a message. Then choose what color you want the text wording of your message to be and also what color you want the sign's background to be. Then press the button at the bottom of the screen and your smilie will be created!<br/><br/>
<strong>SAVING YOUR SMILIE:</strong> With your right mouse button click on the new smilie and choose the "Save Picture As..." option if you're using Microsoft Internet Explorer or the "Save Image As..." option if you're using Mozilla. For best results we highly recommend using the <a href="http://www.mozilla.org/" target="_blank">Mozilla Firefox</a> browser.<br/><br/>
<strong>IMPORTANT:</strong> Please do <i><strong>NOT</strong></i> link directly to the new smilie.
</td>
</tr>
<td align="center" valign="middle" colspan="3" class="alt2">
<br/><br/>If you have any questions or problems please feel free to <a href="$vboptions[contactuslink]">contact us</a>.
</td>
</table>
<!-- END: Buttons, Smilie Output, Instructions -->
</form>
<!-- END: FPS Smilie Creator -->
<!-- END: Create the table cell to hold our contents -->
</center></td></tr>
<!-- END: Module table -->
</table>
<br />
<script type="text/javascript">
<!-- Default the output image when the page loads
createSmilie(get_radio_value(),'Your new smilie will appear here!',document.smilie_form.col.value,document.smilie_form.shcol.value);
//-->
</script>
KW802
09-17-2004, 05:24 PM
Same code from the HTML file in the ZIP:
By any chance, when you created the module did you include the PHP file or the template?
fuse3k
09-17-2004, 05:35 PM
Um I have the module set as follows:
File to Include: fps_smile-creator.php
Templates Used: fps_smile_creator (which is the template adv_portal_fps_smile_creator)
KW802
09-17-2004, 05:41 PM
Um I have the module set as follows:
File to Include: fps_smile-creator.php
Templates Used: fps_smile_creator (which is the template adv_portal_fps_smile_creator)
OK, the trick here is that template is calling the PHP file so the module doesn't have to.
In your module properties change the "File to include:" option to be "None", change the "OR Template to Include" option to be "fps_smile_creator" (are you sure it's not "fps_smilie_creator"?), and then change the "Templates Used" option to be blank.
Let me know if that works for 'ya.
fuse3k
09-17-2004, 06:02 PM
You're the man! Thanks for the help. Please excuse my ignorance.
KW802
09-17-2004, 06:11 PM
You're the man! Thanks for the help. Please excuse my ignorance.No problem! Good to see you got it working. :cool:
Ras Masta
09-19-2004, 03:55 PM
Simply awesome!
dieselpowered
10-06-2004, 12:21 PM
KW802, everything is working fine, however, I seem to be getting a "Done, but with errors on page."
The details are:
Line: 872
Char: 83
Error: Expected ")"
Code: 0
URL: http://www.bignutsracing.com/index.php?page=smilie_creator
The strange thing is if I reload the page...there is no errors?
What do you think?
mholtum
10-06-2004, 12:48 PM
I didnt see any error messages..
KW802
10-06-2004, 11:58 PM
What do you think?
Did you fix something? :p I get no errors with either IE 6 or Firefox 1PR.
Fiber
10-24-2004, 05:43 AM
How would one adjust the "sign settings" so the dementions would easily fit within the restrictions of the avatar pixel limit?
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.