Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Button Maker


humaneasy

Recommended Posts

Hi,

 

Many had already asked my by PM on several issues regarding Button Maker. I will try to answer here some of the questions.

 

Others that make it work can also post, of course.

 

Thanks for your support and interest.

 

1,

 

B) Lopo

If I helped you, you can help others too.

Search Affero Network. Thanks :)

--

moving mentalities >> fast forward

Link to comment
Share on other sites

  • 1 month later...

Hello Humaneasy,

 

I have downloaded and installed accoring to details in button_image.php

Added button_image.sql tables to mysql and I can see the Button Maker menu in the admin CP. I provided valid path to fints in admin CP.

 

When I run index4test.php I am getting

fnt --> The font filename without path. Unable to setup it here

in --> Text to be used in Dest image.must set.

 

Rest all are potional in green colour.

 

I tried changing paths for font in index4test.php, I don't know what to do next,

I am using Win2000 (local) with PHP4.3.4 and with GD support and Apache 2.0.

 

Thanks

Kiran

Link to comment
Share on other sites

After adding $ttfpath or $ttfpath = "W:/www/fonts/"; "/" at end I can see no image, but browser shows no images with "ats" tag, below is what I got.

 

<img src="imageGenerator.php?ttfont=Generic.ttf&d=W%3A%2Fwww%2Ffonts%2F&color=&trans=&size=&h=&w=&cw=&co=&style=Red&o=png&text=%20Button Maker. Hi there!%20" alt="Generic.ttf @ W:/www/fonts/" vspace=5 hspace=3 border=0>

 

I changed my images (style path) to bm_images same in imageGenerate.php

$stylePath = "bm_images/";

 

Why not images seen and how to use, please let me know.

 

Thanks

Kiran

Link to comment
Share on other sites

After adding $ttfpath or $ttfpath = "W:/www/fonts/"; "/" at end I can see no image, but browser shows no images with "ats" tag, below is what I got.

 

<img src="imageGenerator.php?ttfont=Generic.ttf&d=W%3A%2Fwww%2Ffonts%2F&color=&trans=&size=&h=&w=&cw=&co=&style=Red&o=png&text=%20Button Maker. Hi there!%20" alt="Generic.ttf @ W:/www/fonts/" vspace=5 hspace=3 border=0>

 

I changed my images (style path) to bm_images same in imageGenerate.php

$stylePath = "bm_images/";

 

Why not images seen and how to use, please let me know.

 

Thanks

Kiran

I only test it with Linux so I don't know of any imcompatibility. In Linux you must have TTF compiled in PHP and also GD. Path to where fonts are must be full path (ex. /home/youruser/fonts/). Fonts don't need to be installed under 'webroot' path. If your GD version doesn't have 'GIF Write' possibility (some versions don't) choose 'png' as the image format.

 

Put

http://yourdomain/path_where_is/imageGenerator.php?ttfont=Generic.ttf&d=W%3A%2Fwww%2Ffonts%2F&color=&trans=&size=&h=&w=&cw=&co=&style=Red&o=png&text=%20Hi%20there!%20]http://yourdomain/path_where_is/imageGener...20there!%20

 

That's the way to see the errors. hence it is clear that it is not returning an image. See what it reports.

 

And sorry for the dealy in replying :)

 

B) Lopo

Edited by humaneasy

If I helped you, you can help others too.

Search Affero Network. Thanks :)

--

moving mentalities >> fast forward

Link to comment
Share on other sites

I meant...

http://yourdomain/path_where_is_catalog/imageGenerator.php?ttfont=arial.ttf&d=/home/youruser/fonts/&style=Red&p=/home/youruser/public_html/path_where_is_catalog/path/to/bm_images/&o=png&text=Comments

 

Sorry!

 

B) Lopo

If I helped you, you can help others too.

Search Affero Network. Thanks :)

--

moving mentalities >> fast forward

Link to comment
Share on other sites

A foreword: BACKUP BACKUP BACKUP :D :lol:

 

***************************************************************

 

Just explaining some values in Button Maker Admin

  • Generation is Active
    - no need to explain
  • Bypass Sign
    - you must add a bypass sign to all button images that you don't want to be generated, for instance; the 'search' and the 'mail' buttons.
    - this sign is a mark (ex. #$#) that you will had to the tags of those buttons, for instance; '#$#Search' in the define() function.
  • Button Style
    - buttons are made of three parts. This text in the middle part (case sensisitive). See the samples included.
  • Resulting Buttons Height
    - your 'Style' buttons Height
  • Center Image File Width
    - the 'Style' center image width
  • Cap Images File Width
    - the 'Style' left/right images width (must be the same in this version)
  • Text Overlap
    - the value in pixels that text will overlap caps (left and right 'Style' images)
  • Image HUE Rotation
    - keep it 0 (zero) for the time being
  • Image Type
    - Could be 'jpg', 'png' or 'gif', but since some GD versions don't have GIF Write set it to 'png' that works
  • Path to TTF Font
    - full path from starting from / (must test the specifics for other systems diferent from *nix, but I think you can use your MS Windows regular FONT path)
  • TTF Font Filename
    - the file to use. Must be in the FONTS path indicated previously.
  • Font Size
    - need no explanation
  • Font Color
    - in hexadecimal value
  • Transparent color
    - the image color that will be used as transparent color. In hexadecimal. Only for 'gif' and 'png'.

The system uses "DIR_FS_CATALOG . DIR_WS_IMAGES" to define where is 'bm_images' directory so you need to create the 'bm_images' directory (with all image 'Style' files on it) UNDER your current CATALOG IMAGES directory ;)

 

Next version will be much better and will avoid some of this bad coding standards :D

 

Don't forget to modify your general 'html_output.php' and your template 'extra_html_output.php' accordingly to my instructions.

 

Sorry, but this version still requires some PHP knowledge to make it work. See the code in the button_maker.php (under 'functions' dir) and the two previous mentioned files (also included). I've tryed to extensively explain what I was doing step-by-step.

 

Best and thanks for using it.

 

B) Lopo

If I helped you, you can help others too.

Search Affero Network. Thanks :)

--

moving mentalities >> fast forward

Link to comment
Share on other sites

Thanks for your replies.

Button maker worked on Linux server.

I uploaded imageGenerator.php, index4tests.php, bm_images and fonts changed path of fonts ($ttfpath ) to physical Linux path of server and I can see the beautiful buttons on my browser.

 

Please let me know next steps,

adding extra_html_output.php code to /catalog/includes/funcions/html_output.php

(Added modification code at the end of html_output.php)

Run sql to add new Button Maker Config tables (Tables included in sql, I can see Button Maker Menu in admin)

 

Please let me know whats' next to get dynamic images on OSC pages?

 

Thanks

Kiran

Link to comment
Share on other sites

  • 1 month later...

I'm truly sorry, but I don't understand anuthing of this contribution.

 

No explenation whatsoever what it wil do and where.

 

Could't there be a more specifik manual where to put what, and what to edit where.

 

I understand so far that it makes buttons in the catalog section, what if you don't us ecatalog but root dir?

Link to comment
Share on other sites

  • 1 year later...

I have tried everything and read all these posts, there is nothing to do, IT IS NOT WORKING!

 

Please be more precise and redo your your guide !

osCommerce 2.2 MS2 in 6 languages

TVA Intracomm

Numbers of visitors online

Who's online Enhancement

....

Link to comment
Share on other sites

IMPORTANT NOTICE:

This contribution was made for the CRE Loaded osCommerce's flavour and was only tested with it. If you use any other flavour of osCommerce you must see how it outputs buttons with the *_image_submit() and *_image_button() functions.

 

So, after this preamble, I will explain how to change the necessary files.

 

In your CATALOG directory open html_output.php and seek for the following functions and make sure they look like the following corresponding code:

 

function tep_image_submit

 

////
// The HTML form submit button wrapper function
// Outputs a button in the selected language
?function tep_image_submit($image, $alt = '', $parameters = '') {
? ?global $language;

? ?// ADDED BY HUMANEASY.COM - LOPO	
? ?if ( tep_check_button_maker ( $alt ) ) ?$image = tep_create_button($image, $alt); 

? ?$image_submit = '<input type="image" border=0 src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';

? ?if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';

? ?if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;

? ?$image_submit .= '>';

? ?return $image_submit;
?}

 

 

function tep_image_button

 

////
// Output a function button in the selected language
?function tep_image_button($image, $alt = '', $parameters = '') {
? ?global $language;

? ?// ADDED BY HUMANEASY.COM - LOPO
? ?if ( tep_check_button_maker ( $alt ) ) $image = tep_create_button($image, $alt);

? ?return tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image, $alt, '', '', $parameters);
?}

 

 

In your TEMPLATE directory open extra_html_output.php and seek for the following functions and make sure they look like the following corresponding code:

 

function tep_template_image_submit

 

////
// The HTML form submit button wrapper function
// Outputs a button in the selected language
?function tep_template_image_submit($image, $alt = '', $parameters = '') {
? ?global $language;

? ?// ADDED or MODIFIED BY HUMANEASY.COM - LOPO
? ?if ( tep_check_button_maker ( $alt ) ) 
? ? ? $image = tep_create_button($image, $alt, true);
? ?if (strstr(strtolower($image),'imagegenerator.php')) 
? ? ? $imageOut = tep_output_string($image);
? ?else 
? ? ? $imageOut = tep_output_string(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' . ?$image);
? ?$image_submit = '<input type="image" src="' . $imageOut . '" border="0" alt="' . tep_output_string($alt) . '"';
? ?// ADDED or MODIFIED BY HUMANEASY.COM - LOPO

? ?if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';

? ?if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;

? ?$image_submit .= '>';

? ?return $image_submit;
?}

 

function tep_template_image_button

 

////
// Output a function button in the selected language
?function tep_template_image_button($image, $alt = '', $parameters = '') {
? ?global $language;

? ?// ADDED or MODIFIED BY HUMANEASY.COM - LOPO
? ?if ( tep_check_button_maker ( $alt ) ) 
? ? ? $image = tep_create_button($image, $alt);
? ?if (strstr(strtolower($image),'imagegenerator.php'))
return tep_image($image, $alt, '', '', $parameters);
? ?else
return tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' . ?$image, $alt, '', '', $parameters);
? ?// ADDED or MODIFIED BY HUMANEASY.COM - LOPO

?}

 

 

Hope now everyone can make it work :rolleyes: :-"

 

Best,

 

B) Lopo

Edited by humaneasy

If I helped you, you can help others too.

Search Affero Network. Thanks :)

--

moving mentalities >> fast forward

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...