Using The Rollover Images Function

From PhpCOIN Documentation

Jump to: navigation, search

Rollover Images

You may enable the Rollover Images Functions by editing "# Use Rollover Images" switch in the config.php file for the theme you are using. Please note that this is theme-specific, so if you switch themes you will have to edit the config.php file for the new theme as well.

Some Considerations:

  • Only a small sample of alternative rollover images are supplied - you should be prepared to create your own rollover images as required.
  • Only the main horizontal menu and the logged-in user menu are coded to use rollover images. No other buttons use the code to utilize rollover images. The four default themes do have definitions in their config.php file for rollover images for some other buttons, such as the footer buttons on listings, but those rollovers were never implemented.


Rollover Enabling Other Images

If you want rollovers for other images, you would need to do three things:

  • Create the image (if necessary)
  • Edit each line in the config.php file to reflect the file name for your new rollover button. Rollover buttons are identified by the _MO suffix for each $_TCFG (You will see most of the definitions are set to use the same image for both mouse over and mouse out in the default file)
  • Edit each call to do_nav_link() in phpCOIN source code where you want to enable rollovers

To utilize a mouse-over image for the listings "admin" footer menu button for instance:

1: Create the image and save it in the theme's /nav directory. In our example, we will call the new image "n_med_admin2.gif"

2: Edit the theme's config.php file so the button has both a regular image and a rollover image defined

# This definition is already in the themes config.php
$_TCFG['_IMG_ADMIN_M'] = $_PARM_PREFIX.'n_med_admin.gif'
    .'" alt="'.$_LANG['_THEME']['ALT_IMG_ADMIN_M'].'"'.$_PARM_SUFFIX;
         // Image URL for: Admin Button (medium)

# This definition must be added to the themes config.php
$_TCFG['_IMG_ADMIN_M_MO'] = $_CCFG['_PKG_URL_THEME_IMGS']
    .'nav/'.'n_med_admin2.gif';
         // Image URL for: Rollover Admin Button (medium)

3: Edit phpCOIN source code in each listing where you want the rollover image. Most buttons are built by calling do_nav_link(LINK, IMAGENAME, NULL). Change it to use five parameters instead of three: do_nav_link(LINK, IMAGENAME, ROLLOVERIMAGENAME, TARGET, BUTTONID). The ROLLOVERIMAGENAME and the BUTTONID 'must be defined, or rollovers will not work:

LINK: Where the button should link to.
IMAGENAME: $_TCFG['_IMG_xxxxx_M'] from the theme's config.php file
ROLLOVERIMAGENAME: $_TCFG['_IMG_xxxxx_M_MO'] from the theme's config.php file
TARGET: Can be "_blank", "_new", _self", etc. Leave blank for the default _self
BUTTONID: The javascript rollover function needs a unique ID for each image on
          the page that you want to use a rollover on.  You could start as B01
          then B02 then B03 or whatever you want to name the buttons.
Personal tools

Inscrita el Registro Mercantil de Mallorca Tomo 2140, Hoja No. PM-51034, Folio 135
This website owned and operated by: Technology Services RPVW S.L. CIF# B57345084
Avda Constitucion 48 Bajos Alaro 07340 Baleares SPAIN
Tel:+34 971518362    Fax: +34 971518368    eMail: support@phpcoin.com