Child pages
  • cPanel API 1 Functions - Branding::image
Skip to end of metadata
Go to start of metadata

 

Description

This function displays a branding image's URL.

Warning:

cPanel API 1 is deprecated. Do not use this function. Instead, we strongly recommend that you use the following newer functions:

Examples


 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$branding_image = $cpanel->api1('Branding', 'image', array('image', '0', 'package1', '1', '0', '0', '1', '0) ); // Call the function.


Note:

For more information, read our Guide to the LiveAPI System.

 

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $branding_image = $cpliveapi->api1('Branding', 'image', ['image', '0', 'package1', '1', '0', '0', '1', '0] ); # Call the function.


Note:

For more information, read our Guide to the LiveAPI System.

 

 cPanel Tag System (deprecated)


Warning:

In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. We provide this example to help developers move from the old cPanel tag system to our LiveAPI system. We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.

<cpanel Module="Branding::image( $FORM('imagefile','isvar','pkg','needfile','nomagic','needboth','reqext','skip_logo_check'))">
 Command Line
cpapi1 --user=username Branding image image 0 package1 1 0 0 1 0


Notes:

  • You must URI-encode these values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to cPanel API 1 documentation or run the cpapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the cpapi1 command:

    /usr/local/cpanel/bin/cpapi1

 Output (URL)
/cPanel_magic_revision_1161741169/frontend/paper_lantern/branding/image.jpg

 

Parameters

ParameterTypeDescriptionPossible valuesExample
imagefilestring

Required

The image filename.

A valid image name, without the file's path or extension.image
isvarBoolean

Whether to return the full URL.

Important:

Only use this parameter when you call the function from a Perl script.

This value defaults to 0.

  • 1 — Return the URL value as a variable.
  • 0 — Print the URL value.
0
pkgstring

Required

The name of the branding package to search.

A valid branding package name.package1
needfileBoolean

Required

Whether to return the cPanel_magic_revision URL.

  • 1 — Return the full URL.
  • 0 — Return the cPanel_magic_revision section of the URL.
1
nomagicBoolean

Required

Whether to return the image file's absolute path.

  • 1 — Return the absolute file path.
  • 0 — Return the cPanel_magic_revision URL.
0
needbothBoolean

Whether to return both the file and the URL.

Important:

Only use this parameter when you call the function from a Perl script.

This value defaults to 0.

 

  • 1 — Return the file and image URL.
  • 0 — Do not return the file and image URL.
0
reqextBoolean

Required

Whether to return the image's filename extension.

  • 1 — Return the filename extension.
  • 0 — Do not return the filename extension.
1
skip_logo_checkBoolean

Required

Whether to return the file.

  • 1 — Return the image's file.
  • 0 — Return the image's URL.
0


Returns

This function returns a URL to the image file, a full file path, or an image file.