Rotating banner script: Difference between revisions

Jump to navigation Jump to search
m
Blockquote -> code.
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:


<blockquote>
[USS Columbia]
[USS Columbia]<br />
src = "images/randomship/random-columbia.jpg"
src = "images/randomship/random-columbia.jpg"<br />
alt = "USS Columbia"
alt = "USS Columbia"<br />
url = "http://columbia.starbase118.net/"
url = <nowiki>"http://columbia.starbase118.net/"</nowiki><br />
title = "USS Columbia"
title = "USS Columbia"<br />
</blockquote>


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:


: <nowiki><?php include "randomship.php"; ?></nowiki>
<?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:  


: <nowiki><?php randomImage("randomship.ini"); ?></nowiki>
<?php randomImage("randomship.ini"); ?>


Now save your file and close it.  
Now save your file and close it.  

Navigation menu