Index of /~s1nner/docs/examples

[ICO]NameLast modifiedSizeDescription

[DIR]Parent Directory  -  
[IMG]example.png23-Nov-2006 11:18 19K 
[DIR]4/23-Nov-2006 11:18 -  
[DIR]3/23-Nov-2006 11:18 -  
[DIR]2/23-Nov-2006 11:18 -  
[DIR]1/23-Nov-2006 11:18 -  

Virtual War Examples - Readme

Virtual War Examples


1. What are these examples for?

These examples should illustrate the way, how to include VWar into a non-frame website. In our Support-Board, there is often the question about how to include VWar into a website. In a simple post it is very difficult to explain it easy and understandable. These examples should give you an idea of how to include VWar into your site.

2. A few words about the integration

The first mistake that is often made, is: You do not integrate VWar into your website, you integrate your site-code into VWar! For this, you can use these two files:
  • _header.php
  • _footer.php

  • It is important to understand, which code belongs into _header.php and which one into _footer.php. To understand this, you first have to understand the fundamental structure of the html-code. The structure of a html-website looks like this:

    <HTML>

      <HEAD>
        <!-- here is the header-information -->
      </HEAD>

      <BODY>
        <!-- here is the content of the website -->
      </BODY>

    </HTML>













    Now, we have to look closer at the BODY-tag. Into there, we want to have the content of our site, so of VWar, too. But we do not only want VWar itself in one page, we also want our own information displayed.
    In the following example, we want to have "My Website" in orange color above VWar, and "That was my Website" in green color under VWar. So, it should look somehow like this:

    <HTML>

      <HEAD>
        <title>A (not very good) VWar Example</title>
      </HEAD>

      <BODY>
        <font color="orange">My Website</font>

          <!-- here i want my VWar!!! -->

        <font color="green">That was my Website</font>
      </BODY>

    </HTML>


















    Now, we finally have to include this stuff into our VWar. It is easy to realize that. Some lines above i mentioned the two files _header.php and _footer.php. From now on i will talk about "the code above VWar" and "the code under VWar".
    So, in our example, "the code above VWar" is:

    <HTML>

      <HEAD>
        <title>A (not very good) VWar Example</title>
      </HEAD>

      <BODY>
        <font color="orange">My Website</font>










    "The code under VWar" would be:

        <font color="green">That was my Website</font>
      </BODY>

    </HTML>






    The only thing, we have to do now, is to paste/copy "the code above VWar" into the file _header.php.
    And paste/copy "the code under VWar" into the file _footer.php.

    Now, we have done the main thing on how to integrate VWar into your website, or, we better say: How to integrate your site into VWar. Before the integration is finished, we first have to do some other, easy things. Just read on...

    3. Note

    Please note these things, when you integrate your website into VWar:
    • You have to deactivate the template 'header' with the 'Modify Template'-Function in your Admin Control Panel. For the case you do not integrate your website into VWar, we use own header-information that is saved in that template. So just go to your ACP and set that template to the status deleted!

    • Of course you can use integrate as header-information whatever you want. Just note, that that code belongs to the file _header.php and maybe could also affect the design of VWar (for example if you use a css-code to color the links).

    • In the two files _header.php and _footer.php you can use php-code, too. Different to the templates, here php-code will be formatted!
      This allows you to include another header or footer file with this php-code:

      <?php
        include("relative or absolutive path to the file");
      ?>





    Please note for the integration-examples the following thing:
    • In all examples the extras (lastactions, nextactions, events, etc.) used. If you would like to use one of those examples, you would have to change the variable $pathtovwar from
      $pathtovwar = "../"   to
      $pathtovwar = ""   in all extras.
      This is necessary for a working integration of these extras.


    If you need an idea of how you could handle these integration, just have a look at the examples, maybe give a try to some of them and integrate finally your site into VWar...

    4. Example

    To illustrate the integration, here is an example of a possible solution. It is from the example "1" in this directory and shows a simple website structure.
    An image should show you, what is ment by the "code above vwar" and the "code under vwar":



    The exact code for the "code above vwar" can be seen at "1/_header.php", the code for the "code under vwar" at "1/_footer.php".