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
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- internetking created topic »password problem« 25. May
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
- mdee created topic »How to implement returnpage ?« 25. May
- nestormateo responded to »Fillters in Clip« 24. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Random Image with Text
-
- Rank: Team Member
- Registered: Dec 07, 2003
- Last visit: May 09, 2010
- Posts: 2703
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 -
- Rank: Softmore
- Registered: Feb 07, 2003
- Last visit: Jun 11, 2008
- Posts: 225
Take a look at MultiImage. It displays random images with text.
http://noc.postnuke.…rojects/multiimage/
Curt
- Moderated by:
- Support
