vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   vba CMPS: Smilie Creator (https://vborg.vbsupport.ru/showthread.php?t=68062)

KW802 08-11-2004 06:45 PM

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.

YLP1 08-11-2004 09:49 PM

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

KW802 08-12-2004 12:54 AM

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. :D

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:

sabret00the 08-12-2004 08:46 AM

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)

KW802 08-12-2004 01:02 PM

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.

ranger2kxlt 08-12-2004 02:38 PM

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

YLP1 08-12-2004 02:47 PM

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

YLP1 08-12-2004 02:54 PM

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

KW802 08-12-2004 04:06 PM

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.... :D

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...... :D

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

YLP1 08-12-2004 05:18 PM

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


All times are GMT. The time now is 06:10 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.01944 seconds
  • Memory Usage 1,790KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete