6,244
edits
m (→Introduction: Removing unnecessary section.) |
m (Blockquote -> code.) |
||
Line 29: | Line 29: | ||
For each image you want to display, you will have a "block" of text. Each block will include five lines. Let's look at an example: | For each image you want to display, you will have a "block" of text. Each block will include five lines. Let's look at an example: | ||
[USS Columbia] | |||
[USS Columbia] | src = "images/randomship/random-columbia.jpg" | ||
src = "images/randomship/random-columbia.jpg" | alt = "USS Columbia" | ||
alt = "USS Columbia" | url = "http://columbia.starbase118.net/" | ||
url = | title = "USS Columbia" | ||
title = "USS Columbia" | |||
As you can see, line one simply names the block below. It tells the script that there is a block which is going to include information that will help the script work. This line is in brackets, [like so]. You can use any arbitrary name for each block, but in the file used on the main website, I found it easiest to just identify each block by the name of the ship that the image is for. | As you can see, line one simply names the block below. It tells the script that there is a block which is going to include information that will help the script work. This line is in brackets, [like so]. You can use any arbitrary name for each block, but in the file used on the main website, I found it easiest to just identify each block by the name of the ship that the image is for. | ||
Line 63: | Line 61: | ||
The first tag we need will call the script to the page, and tell the user's web-browser that it's about to run a script. You will put this tag above ALL OTHER HTML in your page. Above <nowiki><html>, above <title></nowiki>, above ALL of it! So switch over to the HTML/source view of your file and go all the way to the top of the file. Then, copy the following tag into the page: | The first tag we need will call the script to the page, and tell the user's web-browser that it's about to run a script. You will put this tag above ALL OTHER HTML in your page. Above <nowiki><html>, above <title></nowiki>, above ALL of it! So switch over to the HTML/source view of your file and go all the way to the top of the file. Then, copy the following tag into the page: | ||
<?php include "randomship.php"; ?> | |||
With this done, now we just need to put a tag in which tells the script exactly where we want the image to display. So, switch back over to your main view, if you're using a WYSIWYG editor. Find the ''exact'' location where you'd like to display the image. At that location, put the following tag: | With this done, now we just need to put a tag in which tells the script exactly where we want the image to display. So, switch back over to your main view, if you're using a WYSIWYG editor. Find the ''exact'' location where you'd like to display the image. At that location, put the following tag: | ||
<?php randomImage("randomship.ini"); ?> | |||
Now save your file and close it. | Now save your file and close it. |