Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vba CMPS: Smilie Creator Details »»
vba CMPS: Smilie Creator
Version: 1.00, by KW802 KW802 is offline
Developer Last Online: Nov 2021 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 08-05-2004 Last Update: Never Installs: 62
 
No support by the author.

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.....
  • 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....REMINDER: To always be informed of updates & changes be sure to click the button. :classic:

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 08-11-2004, 06:45 PM
KW802's Avatar
KW802 KW802 is offline
 
Join Date: Jul 2003
Location: A galaxy far, far away...
Posts: 1,450
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ranger2kxlt
I'm confused on the VBT hack...how do users know about the other faces they can use? please explain how that works.

thanks
You'd have to ask Hoffi that one in the VBT.com thread; I can only assume you'd have to write up instructions for it somewhere. On my site I've only been playing around with the default one that he provided.
Reply With Quote
  #33  
Old 08-11-2004, 09:49 PM
YLP1 YLP1 is offline
 
Join Date: Aug 2004
Posts: 417
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KW802
YLP1,

Good morning. OK, first question.... did you implement it as a CMPS add-on or as a seperate VB item? Assuming that you did it through CMPS, how did you do it? Did you create a new module, did you create a new page, or some other method?

Thanks,
Kevin
Hi Kevin,

I created a CMPS module named adv_portal_fps_smilie_creator and chose the fps_smile_creator.php as the file include.

I also created a Custom template names adv_portal_fps_smilie_creator.

If I enable the module for the smilies, I get this error on my pages:

Warning: imagecopy(): supplied argument is not a valid Image resource in d:\myisp\web\lpsforum\modules\fps_smilie_creator.p hp on line 102

Warning: imagecopy(): supplied argument is not a valid Image resource in d:\myisp\web\lpsforum\modules\fps_smilie_creator.p hp on line 103

Warning: Cannot modify header information - headers already sent by (output started at d:\myisp\web\lpsforum\modules\fps_smilie_creator.p hp:102) in d:\myisp\web\lpsforum\modules\fps_smilie_creator.p hp on line 143
?PNG  IHDR?%?/?? PLTE???~Q?]tRNS7????IDATx???=?0 ?sI[r?T"?yHd???mJK??P?P\?q)?Ò?H3)'+? ?Zx????V?????;#] V?o??С??W?u?j=????;=IEND?B`?
Warning: imagedestroy(): supplied argument is not a valid Image resource in d:\myisp\web\lpsforum\modules\fps_smilie_creator.p hp on line 146
Reply With Quote
  #34  
Old 08-12-2004, 12:54 AM
KW802's Avatar
KW802 KW802 is offline
 
Join Date: Jul 2003
Location: A galaxy far, far away...
Posts: 1,450
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by YLP1
Hi Kevin,

I created a CMPS module named adv_portal_fps_smilie_creator and chose the fps_smile_creator.php as the file include.
Ah! Thank you for being specific, it made it much easier to figure out.

The problem is that you don't want to include the PHP file! In your module you only have to include the template, not the PHP file, since the template is what calls the PHP.

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).

Try that and let me know how it goes. :classic:
Reply With Quote
  #35  
Old 08-12-2004, 08:46 AM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sabret00the
can i use this on my forums or do i need to have vba CMPS installed?
bump, i had the vb2 version, not interested in the vb3 version but would like a straight answer (sorry for my abruptness)
Reply With Quote
  #36  
Old 08-12-2004, 01:02 PM
KW802's Avatar
KW802 KW802 is offline
 
Join Date: Jul 2003
Location: A galaxy far, far away...
Posts: 1,450
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sabret00the
bump, i had the vb2 version, not interested in the vb3 version but would like a straight answer (sorry for my abruptness)
Sabret00the, this issue has already been addressed in previous posts....

From post #1:
Quote:
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.....
From post #9:
Quote:
Snatch, you should be able to incorporate it into just about any page. There is a thread by Erwin I saw recently about using any HTML page from within VB -- To use this outside of CMPS you'd just have to reference the .html tempate and change your folder paths accordingly and then you should be good to go.

I've only got a few minutes right now but if you can't get it working outside of CMPS then give this thread a bump in the next day or so and I'll see what I can do.
From post #16:
Quote:
ranger2kxlt: It's just a generic HTML template that calls the PHP file so you should have no problems getting it working from any page. If you use it on a non-vBulletin page then you'll have to change the template for your colors, etcetra. The reason why I geared it towards CMPS was because it would allow you to take advantage of CMPS features like security control.
As I've offered before, if anybody is trying to get this working on a non-CMPS page but is having problems just let me know how you're trying to use it (non-VB page, VB page but non-CMPS, etcetra) and I'll see what I can do to help out.
Reply With Quote
  #37  
Old 08-12-2004, 02:38 PM
ranger2kxlt ranger2kxlt is offline
 
Join Date: Jan 2003
Location: Plano, TX
Posts: 272
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

KW802, i'm using it now, on a vb-page but non-cmps, and works perfect :-D

http://www.thunderbirdnest.com/index...=smiliecreator

Thanks for the help :-D
Reply With Quote
  #38  
Old 08-12-2004, 02:47 PM
YLP1 YLP1 is offline
 
Join Date: Aug 2004
Posts: 417
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Kevin,

Ok that got rid of the error...now for the really hard part....how does one use this mod? LOL

I don't see how to use it....

Sorry for being a pain in the butt...
Reply With Quote
  #39  
Old 08-12-2004, 02:54 PM
YLP1 YLP1 is offline
 
Join Date: Aug 2004
Posts: 417
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Kevin, can you explain so that I can understand better why the include was not used and how the template thingie works?

I'm new at VB and I can't seem to grasp when to use an include versus a page template (or where the templates come from like do I create it and if so why).

Thanks in advance for any insight...

PS: If you click here http://www.yourlincolnpark.com/lpsforum/lpsforum.php I see the module now but it has an error see the red X...and this box is too wide for my page and when you click create nuthin happens.

Also, this module doesn't appear on any of the other forum pages like for instance http://www.yourlincolnpark.com/lpsfo...read.php?t=332 or http://www.yourlincolnpark.com/lpsfo...splay.php?f=21

I have the portal installed actually they installed it for me LOL...told ya I was a noobe...
Reply With Quote
  #40  
Old 08-12-2004, 04:06 PM
KW802's Avatar
KW802 KW802 is offline
 
Join Date: Jul 2003
Location: A galaxy far, far away...
Posts: 1,450
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by YLP1
Kevin, can you explain so that I can understand better why the include was not used and how the template thingie works?

I'm new at VB and I can't seem to grasp when to use an include versus a page template (or where the templates come from like do I create it and if so why).

Thanks in advance for any insight...

PS: If you click here http://www.yourlincolnpark.com/lpsforum/lpsforum.php I see the module now but it has an error see the red X...and this box is too wide for my page and when you click create nuthin happens.

Also, this module doesn't appear on any of the other forum pages like for instance http://www.yourlincolnpark.com/lpsfo...read.php?t=332 or http://www.yourlincolnpark.com/lpsfo...splay.php?f=21

I have the portal installed actually they installed it for me LOL...told ya I was a noobe...
No problem, hopefully I can explain some of the vBa CMPS stuff without confusing anybody....

With the vBa CMPS stuff the rule of thumb is that all modules need a template. The template is what produces the square box you see on the portal front page. A PHP file may or not be included based upon what the template is doing. A quick way of remembering which file is to be included is that you need to include whatever that which is doing the action. To clarify, let's take a look at a few example modules.

Example #1 -- A module that does nothing but says "Hello World!" in bold: For this we would create a new template named "adv_portal_hello_world" with nothing in it but "<strong>Hello World!</strong>" and then we would create a new module that includes the template (referenced by "hello_world"). We wouldn't include a PHP file because we aren't doing anything related to the PHP language, we just want to display a message in plain HTML. The "action" is taking place entirely in the template so we want to include just the template. Since we've already included the template we can leave the "Templates Used" value in the module blank. To summarize... the action is in the template so we'll include the template and leave the Templates Used value blank.

Example #2 -- A module that displays a random quote from table: Now for this module we need to get a little bit more complicated because we need to extract the results of a database query. To do the database query we'll write a small PHP file named "get_results.php" and put it in the /modules folder. The PHP file will grab the quote and create a variable called "$quote" that contains the value it grabbed from the database. OK, the PHP file file will get our random quote but we need to display it on the page yet. Going by our rule of thumb we need to create a template so we'll create one called "adv_portal_random_quote" and inside of the template will be nothing but "$quote" (the variable name from the PHP file). OK, we've got a PHP file and and a template so it's time for the module. Where is the "action" taking place? Inside of the PHP file so this time we'll include the PHP file instead of the template. But the PHP file uses a template for it's results so this time we'll fill in the "Templates Used" value in the module with the name of the template that's being used ("adv_portal_random_quote"). To summarize... the action is in the PHP file which is using a template so we'll include the PHP and insert the template name in the Templates Used value.

Example #3 -- This smilie creator: This vBa CMPS module is a little different from most vBa CMPS modules in that I had wanted to make it is as generic as possible so that people could use it on non-vBa pages. Even though I called it a "vba CMPS module" it is in fact a generic chunk of code that could be used just about anywhere with just some minor tweaking. Because I wanted to make it generic the action is taking place inside of the template; the template calls the PHP file which is exactly opposite of Example #2 above. Because the action is taking place inside of the template we'll create the module like we did in Example #1 by including the template & leaving the Templates Used value blank. To summarize... the action is in the template which is using a PHP file so we'll include the template and leave the Templates Used value blank.

So in a simplified nutshell... all modules need a template to be displayed on the portal page and the module should include the file that is doing the action. If the action is in the PHP file then include the PHP and fill in the Templates Used value but if the action is in the template then include the template and leave the Templates Used value blank.


OK, on to some of the other issues......

The red X... are you sure that your server has GD enabled? "GD" is a function of the PHP language installed on server that allows images to be worked with. For example, the PHP file in this case uses GD to create the new smilie on the fly. If you're not sure a quick check would be to go into your Administrators Control Panel (ACP) then choose "Import & Maintenance" at the buttom of the left hand menu area and then choose "View PHP info". If you then scroll down the window you should see a section entitled "gd" and it will list whether it is enabled and also what version. You want to make sure that it is enabled with "PNG Support" enabled as well.

The box is too wide... Yeah, it's definitely too wide to be in a left or right column! :nervous: If you really want it displayed all of the time I'd recommend then moving it the bottom of your center column. You can do this by going into ACP --> vBa CMPS --> Edit Module --> (what ever module name you chose) and then use the "Move To" arrows to move the module to the center column & then changing the index number (the little box to the right of the module name) to a number that is higher than anything else in the center column.

The box doesn't appear anywhere else... Because it was added as a vBa CMPS module it will only appear on vBa CMPS pages. Your front-page is in vBa CMPS but once you switch to the forums, for example, then you're no longer in vBa CMPS. Now you can do some mojo to have your vBa CMPS modules appear in your forum but for now let's just concentrate on getting it working.

When you have a few minutes I'd ask that you check out your PHP info page to verify the GD settings and then also move the column from the right to the center at the bottom so that until we get it working it doesn't make your right column bigger than it needs to be. After we get it working (assuming that your GD is enabled & working, etc.) then I'd recommend you changing it from being on your home page to be on it's own seperate page (don't worry, it's easy.... when the time comes we can walk you through it).

Kevin
Reply With Quote
  #41  
Old 08-12-2004, 05:18 PM
YLP1 YLP1 is offline
 
Join Date: Aug 2004
Posts: 417
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Kevin,

WOW thanks for the explanation...I think I understand it!!

Here is what my gd says in PHP Info

gd
GD Support enabled
GD Version bundled (2.0 compatible)
FreeType Support enabled
FreeType Linkage with freetype
JPG Support enabled
PNG Support enabled
WBMP Support enabled
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:43 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04892 seconds
  • Memory Usage 2,338KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (9)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete