Fork me on GitHub

Random Image with Text  Bottom

  • I need something to display a random image from a selected directory with a short line of text. I intend to use it in a block on my PostNuke site.

    I will edit the images so they fit and supply the correct text in any manner necessary, I just need some type of existing PN block (I can't find one for Mediashare) that will show an image with a piece of text.

    I look forward to your suggestions.

    Joe
  • If you only have a few 'pages'

    Create a folder somewhere....
    Put your code for each 'page' in a file

    Call it "ammodump.txt"

    Code

    <img src="/yourdirectorylocation/images/pic_of_ammodump.jpg"
    < /br>
    AmmoDump is a handsome guy!


    No need to use headers and open HTML or anything just keep it simple.. just the meat and potatos of the code...

    Create the image folder and add the image to the folder.
    yourpagedirectory/images/

    Now create an HTML block in the PN admin panel.

    Code

    <!-- Begin
    var howMany = 3;  // the number of pages about ammodump
    var page = new Array(howMany+1);
    page[0]="ammodump.txt";
    page[1]="ammodump2.txt";
    page[2]="ammodump3.txt";
    function rndnumber(){
    var randscript = -1;
    while (randscript < 0 || randscript > howMany || isNaN(randscript)){
    randscript = parseInt(Math.random()*(howMany+1));
    }
    return randscript;
    }
    quo = rndnumber();
    quox = page[quo];
    window.location=(quox);
    // End -->


    Let us know what you are trying to do... how big...?

    The above is only theory... I did not test it, myself.



    edited by: AmmoDump, Sep 14, 2006 - 05:27 PM

    --
    David Pahl
    Zikula Support Team
  • Take a look at MultiImage. It displays random images with text.
    http://noc.postnuke.…rojects/multiimage/

    Curt

This list is based on users active over the last 60 minutes.