User     Pass    
Remember me    Forgot login details?
Forum index » FRUWAR » Support » Creating your own custom pages
Users reading this thread:
Reply
General

Clan Member
Joined Feb 14 2009
Posts: 803

Send pmProfile
QuoteReport
Creating your own custom pages
2010-04-21, 12:24
Did you find this helpful?

You must be logged in to vote!

In this guide, we will show you how to create your own custom pages to your website.

First off, you should start a text editor, such as notepad.
I strongly recommend you to download Notepad++, as it will make it a lot easier for you.

Now you need to create a new file. You can name it whatever you like, but it must end with .php and it's recommended that you only use the letters a-z and numbers 0-9.

Next thing is very important.
Copy and paste these lines to the top of your document.
<?php
session_start
();
include 
$_SERVER['DOCUMENT_ROOT']."/connect.php";
include 
$_SERVER['DOCUMENT_ROOT']."/functions.php";
include 
$_SERVER['DOCUMENT_ROOT']."/Templates/$tpDir/html.php";
include 
$_SERVER['DOCUMENT_ROOT']."/login.php";


So what does this do?
First, it starts a new session, which is needed to handle the login system and so on.
Then it includes necessary files that are needed for different reasons.


Okey, so let's go to the next step.
Now we need to add the standard html, which takes care of everything that is the same on each page, such as menus, logo, footer, login window and so on..
If you have programming experience, you will see that this is really simple, and if not, you can just copy and paste it.

$html = new Html();
$html->title = "Your pagetitle";
$html->sidemenu = 1;
$html->start();
?>
Here you can write all your normal XHTML or a bunch of text
<?
$html->end();


Here you can set your own pagetitle, which is the text that is displayed at the very top of your web browser.
You can set which sidemenu you are gonna use, and if you don't want any sidemenu, you can just delete that line, or set it to 0. Click here for more information on sidemenus.
Now, you can edit anything you want between ?> and <?. You can write any HTML you want there.


When you've done this, save the file where you want it, then, if you want, you can add it to your sidemenu. If you don't how to do, you can follow this guide.

Conclusion:
<?php
session_start
();
include 
$_SERVER['DOCUMENT_ROOT']."/connect.php";
include 
$_SERVER['DOCUMENT_ROOT']."/functions.php";
include 
$_SERVER['DOCUMENT_ROOT']."/Templates/$tpDir/html.php";
include 
$_SERVER['DOCUMENT_ROOT']."/login.php";

$html = new Html();
$html->title "My page title";
$html->sidemenu 1;
$html->start();
?>
All your text and xHTML goes here.
<? $html->end();
Last edited by Eric, 2010-05-24, 18:17.

General

Clan Member
Joined Feb 14 2009
Posts: 803

Send pmProfile
QuoteReport
A simple page
2010-04-21, 12:25
This is an example of how a custom page can look like.

Let's say that we want to make a page where we have all our awards.
We can call it awards.php and put it under our root directory.

<?php
session_start
();
include 
$_SERVER['DOCUMENT_ROOT']."/connect.php";
include 
$_SERVER['DOCUMENT_ROOT']."/functions.php";
include 
$_SERVER['DOCUMENT_ROOT']."/Templates/$tpDir/html.php";
include 
$_SERVER['DOCUMENT_ROOT']."/login.php";

$html = new Html();
$html->title "Awards";
$html->sidemenu 1;
$html->start();
?>

<h1>E-dom awards</h1>

<table class='awards'>
    <tr>
        <td><img src='http://www.eurodomination.net/images/medals/tournament1.png' alt='' /></td>
        <td>Modern Warfare 2, Road to Victory Tournament, Winners, CTF Original Mode, Season 7</td>
    </tr>
    <tr>
        <td><img src='http://www.eurodomination.net/images/medals/tournament1.png' alt='' /></td>
        <td>Modern Warfare 2, Road to Victory Tournament, Winners, S&D Original Mode, Season 7</td>
    </tr>
    <tr>
        <td><img src='http://www.eurodomination.net/images/medals/league1.png' alt='' /></td>
        <td>Call of Duty 4, Royal Green Jackets, Winners, Search and Destroy, Season 15</td>
    </tr>
    <tr>
        <td><img src='http://www.eurodomination.net/images/medals/tournament1.png' alt='' /></td>
        <td>Call of Duty 4, Road to Victory Tournament, Winners, DOM Group 1, Season 1</td>
    </tr>
    <tr>
        <td style='width: 60px;'><img src='http://www.eurodomination.net/images/medals/friendliness2.png' alt='Friendliness' /></td>
        <td>Good conduct: 100% Friendliness.</td>
    </tr>
    <tr>
        <td><img src='http://www.eurodomination.net/images/medals/punctuality3.png' alt='Punctuality' /></td>
        <td>Good conduct: 100% Puncutality</td>
    </tr>
    <tr>
        <td><img src='http://www.eurodomination.net/images/medals/league1.png' alt='' /></td>
        <td>Call of Duty 2, Division Winners, Capture the Flag, Season 3</td>
    </tr>
    <tr>
        <td><img src='http://www.eurodomination.net/images/medals/league1.png' alt='' /></td>
        <td>Call of Duty 2, Winners: 85th Custer Division, Capture the Flag, Season 5</td>
    </tr>
    <tr>
        <td><img src='http://www.eurodomination.net/images/medals/league1.png' alt='' /></td>
        <td>Call of Duty 2, Crossover Champions, Season 5</td>
    </tr>
    <tr>
        <td><img src='http://www.eurodomination.net/images/medals/tournament2.png' alt='' /></td>
        <td>Call of Duty 4, Road to Victory Tournament, Runners up, S&D Hardcore Mode, Season 7</td>
    </tr>
    <tr>
        <td><img src='http://www.eurodomination.net/images/medals/tournament2.png' alt='' /></td>
        <td>Call of Duty 4, Road to Victory Tournament, Runners up, S&D Hardcore Mode, Season 6</td>
    </tr>
    <tr>
        <td><img src='http://www.eurodomination.net/images/medals/league2.png' alt='' /></td>
        <td>Call of Duty 4, Runners-up: Parachute Regiment, SAB/DOM/KOTH/TDM, Season 11</td>
    </tr>
    <tr>
        <td><img src='http://www.eurodomination.net/images/medals/league2.png' alt='' /></td>
        <td>Call of Duty 2, Division Runners Up, Capture The Flag, Season 4</td>
    </tr>
    <tr>
        <td><img src='http://www.eurodomination.net/images/medals/supporter3.png' alt='' /></td>
        <td>Euro Domination Supporter</td>
    </tr>
</table>

<? $html->end();


You can see how it looks like right here.
Last edited by Eric, 2010-04-25, 14:27.

Private

Joined Jul 24 2010
Posts: 6

Send pmProfile
QuoteReport
2010-07-27, 11:41
Hello Fruwar clan,
first i want to say that this is awesome work what you have done.....im at beginner level of creating HP´s and php scripting. It really helped me to understand some things, because its really clean code. So now i have a question :
What i must edit when i want insert a background image, i mean that you can see it in Firfox and in InternetExplorer?
I had changed it but it was onlyto say in firefox. Hope i dont waste your time, i´m sure its something really easy...

THX much Violator79
General

Clan Member
Joined Feb 14 2009
Posts: 803

Send pmProfile
QuoteReport
2010-07-27, 12:30
Hi Violator79.

Have you downloaded FRUWAR?
It can be found at http://clanfru.ath.cx/fruwar/, where you will also find a FAQ, screenshots and additional packets.

The background image of a page is handled by the template you are using.
If you want to change the background image, you can change your template CSS file (found at /Templates/name/style.css), or you can create your own template (this requires some php and css knowledge).
Private

Joined Jul 24 2010
Posts: 6

Send pmProfile
QuoteReport
2010-07-28, 17:01
ok thx muxh for fast reply.....in moment im getting php, html and java knowledge ^^...... me and some mates are starting project about BC2
Private

Joined Jul 24 2010
Posts: 6

Send pmProfile
QuoteReport
2010-07-29, 21:23
how can i add a section in the headmenue?
General

Clan Member
Joined Feb 14 2009
Posts: 803

Send pmProfile
QuoteReport
2010-07-30, 00:24
The links in the head menu are images which means that for every new link you will need a new image as a link.

You can see how the images are made in /Templates/name/Images/. They are usually called topmenu_home.png or something like that.

After you got an image for your new link, you need to go your template style.css.
In there you will find some classes named menu_home, menu_forum and so on.
You need to create a new class like those, but replace the name and the image.

Then you need to go to your layout.php and find the function called menu() which outputs the head menu links.
In there you can add a new link and give it the class name that you created in your template style.css.


The reason this is so complicated is because we want to be able to have a custom appearance to each template.
Last edited by Eric, 2010-07-30, 00:43.

Private

Joined Jul 24 2010
Posts: 6

Send pmProfile
QuoteReport
2010-07-30, 12:02
okay you are really great !!.....thx
Clan leader

Clan Member
Joined Feb 14 2009
Posts: 1576

Send pmProfile
QuoteReport
2010-07-30, 17:35
He's not that great tbh... and he smells funny :)
General

Clan Member
Joined Feb 14 2009
Posts: 803

Send pmProfile
QuoteReport
2010-07-30, 18:52

FRUKaosLDR wrote:

He's not that great tbh... and he smells funny :)


Shoo!
Clan [FRU] sponsored by:
gamehosting.co.uk
Reply
Message

Copyright © 2009-2010 Clan FRU - Fallen Rebels Unite - All rights reserved.