• Resolved riseassist

    (@riseassist)


    Hello! My name is Erik I am new here. This is my First Post I am building a WordPress Site for a client. She’d like a Plugin that rotates images from her portfolio and sends the viewer to the website the image depicts when the image is clicked on. I am trying to adapt the program located here. A Better Image Rotator by Dan Biegerman. This php script uses an external file to call pictures from an external folder. I also modified this script so that it will Display a quote beside the picture. When I activate this in WordPress everything works correctly except that the picture doesn’t showup. I get the standard little red X to see what I am talking about you can click here. Rise WebD esign The plugin is at the footer of the page. (The Footer)The funny thing is I don’t recieve any error message from word Press when I activate this. I’ve made sure e verything is in the plugin Directory. I’d appreciate it if someon with experience with PHP and plugins coud help me fiqure out why the picture isn’t showing up while everything else seems to work as it should. If it helps I’ve included the code at the in this post.

    <?php
    /*
    Plugin Name: Rotate Plugin
    Description: An Attempt To Adapt Dan Beigerman's Plugin For WordPress
    Version:1.0
    */
    #this file contains the descriptons and alt tags for the rotator.
    
      $IMG_CONFIG_FILE = 'images.ini';
    
      # You shouldn't need to change anything below this point
    
      function showImage( $ini=null ) {
        global $IMG_CONFIG_FILE;
        # if no custom ini file has been specified, use the default
        $ini_file = $ini ? $ini : $IMG_CONFIG_FILE;
        # read the config file into an array or die trying
        $images = @parse_ini_file($ini_file,true);
        if (! $images) {
          die('Unable to read ini file.');
        }
    
    add_action('wp_footer' , 'showImage');
    ?>

    Thanks so much for the Help!

    Sincerly,
    Erik

Viewing 4 replies - 1 through 4 (of 4 total)
  • on first glance, you need to fix the paths to the images. In your .ini you are using relative paths to the images. So you either need to adjust your paths or use a base directory path of some kind

    if you look at the source you can see where its looking.

    If you images do not show up, you’ve got the wrog path set. Besides, if the above script is your complete plugin, you are definitely missing something!
    The function showImage does not generate any output.

    If you need a custom WordPress plugin done quickly, contact me at [moderated – no paid services are offered in this forum; read the Rules!]

    if you look at the source on his page, it’s a path issue, clearly.

    <a href="https://www.nps.gov/yell/" title="Apples At YellowStone"><img src="phpimage/Apples.jpg" alt="Apples" /></a>Apples At Yellowstone

    I doubt you need to pay anyone to fix that, just adjust your paths.

    Thread Starter riseassist

    (@riseassist)

    I Thank You All Very Much For your help I understand what was said about it being a path problem But I’d like clarification file if that’s all right.

    This script uses a .ini file and a separate file folder that contains the pictures. This folder is called phpimage this image folder and the .ini file as well as the php file itself are located in the wp-content/Plugins folder. I gave the image source a relative path because the .ini file and the phpimage folder are both located in the WordPress Plugins folder. Here is an example of what the content for the .ini file looks like `[Apples]
    src = phpimage/Apples.jpg
    alt = Apples
    url = https://www.nps.gov/yell/
    title = Apples At YellowStone
    quote = Apples At Yellowstone`

    the src line says that the file Apples.jpg is located in the php imsge folder, which inturn is located in the plugins folder.
    I got this to work fine as it is on another server. Is there something specific to WordPress that I am Missing?

    Thank you so Much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Need assistence adapting Rotator Plugin’ is closed to new replies.