Support » Plugins » random banner hack

  • Hi, I’m trying to use this hack:

    I uploaded it to my wordpressroot/wp-content/plugins directory, and I’ve changed the name to “random-banner.php”

    I’ve created a new folder inside the /wp-content/ folder called “random-banner”. I’ve edited the “random-banner.php” file so that:

    $image_directory = “/wp/wp-content/random-banner/”;


    $image_url_dir = “/wp-content/random-banner/”;

    The instructions then say to “activate the plugin” but when I got to my WP admin panel and go to the plugins section, there is no random banner plugin listed that I can activate…what’s wrong, and how do I fix it?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Well, the instructions say “full path” for the image directory.

    but it says:

    $image_directory is the full path to the image directory on your webserver. To figure out what this is, change to that directory and issue the command ‘pwd’.

    how do I do what? issue the command “pwd”??

    What folder are you using to store the images? Is it inside the wp installation? What I would do, if I were doing this, is make an images folder inside the /wp-content/ folder, chmod it to 777 so it’s accessible to wp and the hack, and then your full path to the folder would be something like /public_html/path-to-wordpress-install/wp-content/images/

    I don’t know. But I know (because I’ve learned from the initial info from my host) what the “path” is to my scripts.
    Usually it’s something like the one left in the .phps file by the author:

    AFAIK, btw, I don’t know that you CAN issue a “pwd” command if you don’t have shell access. However, if you have some sort of control panel (cPanel, plesk, ensim, vdesk) with your host, if you use the File Manager, navigate to the image folder and click on it, at the top of the page you may be able to see the path to the folder.

    Yes, I’ve got cPanel X version 10.

    My full account location is:, or

    My WordPress is installed in a directory simply called “wp”

    So the location of my main wordpress is or

    I don’t think I have shell access, no.

    I’m using the cPanel File Manager, and I can navigate through my files easily.

    So I created a folder for the banners I want to cycle through, and I created it in the /wp-content/ folder, so you can find it here: or here:

    That folder has only 4 images that I want to have the banners cycle through, no other types of files as the instructions specified.

    So, what should my new things be? Should I be using “” or “home/public_html/wp/wp-content/random-banner/”?

    Which URL should I be using, and for which variable?

    I really appreciate the help, and feel I am almost getting it to work.

    oh, another quick questions regarding the same thing, the instructions say:

    Edit your index.php (or whatever file you want a custom banner). Anywhere you want to insert an image, do your normal image placement fu. Between the quotation marks where you would normally place the path to the image, type “<? PHP random_banner(); ?>“.

    How do I do this, because right now this is what that section of my header.php file looks like:

    /* To ease the insertion of a personal header image, I have done it in such a way,
    that you simply drop in an image called ‘personalheader.jpg’ into your /images/
    directory. Dimensions should be at least 760px x 200px. Anything above that will
    get cropped off of the image. */

    #headerimg { background: url(‘<?php bloginfo(‘stylesheet_directory’); ?>/images/ss3.jpg’) no-repeat top;}

    How do I replace the image location with the PHP reference, since I’m not actually using the image source HTML code? thanks!

    Should be home/username/public_html/wp/wp-content/random-banner/ most likely. That’s the “path” to the images. Otherwise it would say I *think*, “url” to the images.

    And I absolutely have no clue about the last question there – I don’t use kubrick, no idea how to tweak stuff like its inline css etc. Moshu may know….

    hi all, for those of you who have installed this plugin and got errors in the admins area, warning you about non-existent directories, I have found a solution. its a bit crude, but it works fine.

    I’ll explain my case, all directories are as I have them:
    the problem is originated because, in my site, wordpress is not at the root of the site.

    root folder is —-‘/’
    wordpress is in —‘/wp/’
    images are in —–‘/images’

    those warnings appear because I did not properly configure wordpress to work in a different directory than the root folder. I learned about that when I had been blogging for some time, and since I linked to my images and files using paths like ‘../images/bla.jpg’ changing would have been too much of a hassle.

    so this plugin complains because, once installed, it gets the paths ok, like this, and it works:
    $image_directory = “./../images/”;
    $image_url_dir = “./../images/”;

    BUT when you get in the admin area, wordpress complains, because in that case, the admin script expects the following directory to exist:


    and since that does not exist, because I host the images in the previous level ‘/images/’ the warnings appear, although the script works later. soooo…

    the solution I have found to avoid moving wordpress around and having to re-check all of my links is to replicate the directory structure.

    just creat the directory the admin expects to find, which would be ‘/wp/images/’ and place a single image in there, and hop, no more complains. it does not interfere with the normal use of the plugin, since it takes the images from the real directory, ‘/images/’

    hope this helps. cheers.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘random banner hack’ is closed to new replies.