• May 11, 2008
  • May 4, 2008
    • IBAE v0.6.2 complete. 0.9 in progress. Howto page here.
  • February 4, 2008
    • Work continues on IBAE v0.6. At least, that's what we keep telling ourselves.
  • Project Future
    • Tapewolf has asked for our help with Project Future. Go there. This is a simple code supply, not a full design, though; he designed the page himself.
      We think we'd do a prettier job...

How To Implent the IBAE code

Main Section detailing how to use the basic IBAE code function.
v0.6.4 explaining the chapter variables and chapter name file.
v0.6.1 explaining the counter.
v0.6.2 explaining how to embed php in the template, with an example.
v0.6.3 explaining how to deal with optional multiple images.

Back to Top

This code is relatively easy to use; the starting php file provided is a mere 5 lines of active code; two of which could be skipped in some cases - if you don't need a counter, or if you have a separate file for your archive from your home page. For minimal use, you only need to read this segment; the lower segments are for additional functionality, and may be ignored to begin with. Note that they may or may not be in order of increasing complexity or version number; the menu above is probably a good starting place.

For starters, you can write any html you like, and it will just pass it through, with all the content unchanged; provided you avoid the variables listed below. Obviously, if you use HTML encoded characters, as we have, you can get around this limitation.

Also, if you want to include php, you can; and the method of doing it doesn't change. Some of the variables might, but we'll cover that later. You don't have to, though.

There are a number of strings that will be replaced with generated content. They are:

  • This, in the template:
  • ibae_first_strip_num
  • ibae_first_strip_img
  • ibae_first_strip_title
  • ibae_previous_strip_num
  • ibae_previous_strip_img
  • ibae_previous_strip_title
  • ibae_current_strip_num
  • ibae_current_strip_img
  • ibae_current_strip_title
  • ibae_next_strip_num
  • ibae_next_strip_img
  • ibae_next_strip_title
  • ibae_last_strip_num
  • ibae_last_strip_img
  • ibae_last_strip_title
  • ibae_version
  • Previous Strip
  • Will be replaced with this:
  • ibae_first_strip_num
  • ibae_first_strip_img
  • ibae_first_strip_title
  • ibae_previous_strip_num
  • ibae_previous_strip_img
  • ibae_previous_strip_title
  • ibae_current_strip_num
  • ibae_current_strip_img
  • ibae_current_strip_title
  • ibae_next_strip_num
  • ibae_next_strip_img
  • ibae_next_strip_title
  • ibae_last_strip_num
  • ibae_last_strip_img
  • ibae_last_strip_title
  • ibae_version
  • Next Strip

Use the links to jump back and forth to demonstrate the variables.

The ..._num variables are for use when linking to previous/next strips; presuming you've used the parameter strip (in $_GET['strip'] on the second line) then you would link to ?strip=var_num in the href.

The ..._img variables are for using in img links, obviously.

The ..._chap variables are the chapter numbers.

The ..._title variables are not necessarily required, but if you have a title for each strip, that's where it'll be, so you can inset it into the html wherever you require.

The ..._version is for use in the footer; generally we'll supply what should be in there.

All these are generated from the ...list.txt file, whose prefix is the first parameter provided to the "new IBAE()" line in the php index file. The prefix is also prepended to comic image names, so if the image name is strip001.png, and the prefix is demo, the ibae variable will return demo/strip001.png.

The base format of the file is, as can be seen from the demo:
Strip Number|Chapter|Image Filename|Strip Title

For backwards compatibility, you may remove the chapter number entirely, and the system will cope. It is recommended, however, that you provide a chapter number anyway; if needed later, it is much easier to edit something that's been there all along.

Note that the "strip number" is not required to be a number, it can, in fact, be anything you like. The order that the lines are listed in the file is the order that the system pays attention to; if you want to count down instead of up, or use letters, or randomly change the numbers, the system will cope with no problems at all.

Additional modules may extend the file format; sequence of loading may be significant, but we will attempt to resolve these things programatically.

Back to Top

v0.6.4

  • This, in the template:
  • ibae_first_strip_chap
  • ibae_first_strip_chap_title
  • ibae_previous_strip_chap
  • ibae_previous_strip_chap_title
  • ibae_current_strip_chap
  • ibae_current_strip_chap_title
  • ibae_next_strip_chap
  • ibae_next_strip_chap_title
  • ibae_last_strip_chap
  • ibae_last_strip_chap_title
  • Previous Strip
  • Will be replaced with this:
  • ibae_first_strip_chap
  • ibae_first_strip_chap_title
  • ibae_previous_strip_chap
  • ibae_previous_strip_chap_title
  • ibae_current_strip_chap
  • ibae_current_strip_chap_title
  • ibae_next_strip_chap
  • ibae_next_strip_chap_title
  • ibae_last_strip_chap
  • ibae_last_strip_chap_title
  • Next Strip

As above, use the links to see the effect.

Note: This changed between v0.6.3 and v0.6.4 to include the chapter number. Backwards compatibility is preserved; if you do not provide a chapter name file, the system will generate these strings as blanks. That means they'll be removed, rather than replaced with something, or ignored.

If you provide a chapter column, and ...chap.txt, the chapter titles will be set to the provided strings. If you wish to include html in those strings, it will be passed through unchanged.

Back to Top

v0.6.1

If you initialise the counter (and the code can find the file you provide it), the following will also be set:

  • ibae_counter

The counter won't create the file for you, however.

Current count: 00000064

Back to Top

v0.6.2

To include php code, as per usual with php, use php open and close tags.

Be aware tha the php is run before the variables are replaced, so the code should print out the strings as listed above.

Variables you probably want to use from the ibae code are:

  • $this->first_strip
  • $this->curr_strip
  • $this->last_strip

These would be used like this:

<?php
  if ($this->first_strip == $this->curr_strip) {
	// we're currently viewing the first strip
	// print imgs greyed out
  } else {
	// we're not viewing the first strip
	// print imgs as links
  }
?>

Obviously, you'd need equivalent lines using prev_strip, next_strip, and last_strip.

Equally obviously, this is fairly ugly; I intend to see if I can come up with something cleaner, but no promises. The variables are $this->var because they are included from within the class.

Back to Top

v0.6.3

Multi-image support (update with more than one image) is included; this is applied by supplying multiple images in the control file, comma separated (no spaces), and including the following sort of structure in the template:

<?php
if (isset($this->search_replace['ibae_current_strip_img_num'])) {
  for ($i = 0;
       $i < $this->search_replace['ibae_current_strip_img_num'];
       $i++) {
    print ' <img alt="ibae_current_strip_title" ';
    print 'src="strips/ibae_current_strip_img_'.$i.'"><br>'."\n";
  }
} else {
  print ' <img alt="ibae_current_strip_title" ';
  print 'src="strips/ibae_current_strip_img"><br>'."\n";
}
?>
The rest of the code will manage automatically. Obviously, this can get fairly complicated. If you always have two images, for example, you can hard-code much of this; the complexity is only required for managing sometimes-there-and-sometimes-not.

Note that the code is not as clean and simple as it might be; it's been mashed to fit in the width of the column here.

You may, of course, also use ibae_previous_strip_img_num for previous, and likewise for first, last, and next, if you so desire - although we are at a loss to see why you'd want to, the option is easy enough to supply, so we have. Maybe someone will use it for thumbnails or something.