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 |
#32
|
||||
|
||||
Quote:
|
#33
|
|||
|
|||
Quote:
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 |
#34
|
||||
|
||||
Quote:
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: |
#35
|
||||
|
||||
Quote:
|
#36
|
||||
|
||||
Quote:
From post #1: Quote:
Quote:
Quote:
|
#37
|
|||
|
|||
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 |
#38
|
|||
|
|||
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... |
#39
|
|||
|
|||
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... |
#40
|
||||
|
||||
Quote:
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 |
#41
|
|||
|
|||
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 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|