Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to add a new page to your script
09-12-2011, 12:43 PM
Post: #1
How to add a new page to your script
In this tutorial I will show you how to properly add a new page to your script,
when I say properly I mean; it will have the same url structure as other pages.
Quote:http://www.domain.com/?option=newpage

I will also show you how to add a line into your htaccess file for this new page so that you can have a link like;
Quote:htt://www.domain/com/newpage

First, adding our page.

1. Open the /include/functions.php file.

2. Do a text search for
Quote:switch ($_GET['option']) {

3. Under that line, is where we are going to add our new page. Here is an example;
Code:
case "newpage":
return '<h1 class="title">New Page Title</h1>
          <center>New Page Content.</center>';
break;

Second, adding a link to this page in the menu.

1. Open the /include/functions.php file.

2. Do a text search for
Quote:function call_menuler()

3. This is our menu function, you should be able to see the structure it uses with ul and li, here is an example of adding our new page;
Code:
function call_menuler() {
global $root_url,$lcl;
return '<li><a href="'.$root_url.'">'.$lcl['homepage'].'</a></li>
<li><a href="'.$root_url.'">'.$lcl['videos'].'</a></li>
<li><a href="'.$root_url.'?option=popular">'.$lcl['popularvideos'].'</a></li>
<li><a href="'.$root_url.'?option=games">'.$lcl['games'].'</a></li>
<li><a href="'.$root_url.'?option=populargames">'.$lcl['populargames'].'</a></li>
<li><a href="'.$root_url.'?option=contact">'.$lcl['contact'].'</a></li>
<li><a href="'.$root_url.'?option=newpage">New Page</a></li>';
}

Now, you have the new page, and a menu link.
Next we will add a line to the htaccess file for a neater url. (The htaccess file that is in your root_dir)

Third, adding to htaccess.

1. Open .htaccess file.

2. Add this line to the file (edit for your own page name
Code:
RewriteRule ^newpage /?option=newpage [NC]

Note:
You shouldnt have to, but if it doesnt work the first time, try clearing your cache files.

Custom HTML/CSS/PHP
http://theorderofindividualacceptance.co...p.php?id=1
Find all posts by this user
Quote this message in a reply
17-02-2012, 08:44 PM
Post: #2
RE: How to add a new page to your script
So on the New Page where it says New Page Content is that where we put the new page content at like a link to a new page?
Find all posts by this user
Quote this message in a reply
18-02-2012, 12:37 PM
Post: #3
RE: How to add a new page to your script
if i wanted a page that said "HI" on it,
i would put "HI" where it says "new page content".

Custom HTML/CSS/PHP
http://theorderofindividualacceptance.co...p.php?id=1
Find all posts by this user
Quote this message in a reply
21-02-2012, 12:23 AM
Post: #4
RE: How to add a new page to your script
So sorry for being such a pain I have another question so if I wanted like a link list to different pages I would put it there? Like a list of different Pornstar Names that you can click on to view there profile with a image gallery for them?


(18-02-2012 12:37 PM)Punktured Wrote:  if i wanted a page that said "HI" on it,
i would put "HI" where it says "new page content".
Find all posts by this user
Quote this message in a reply
22-02-2012, 03:05 PM
Post: #5
RE: How to add a new page to your script
correct.
but if those pornstar profiles and galleries were also to be hosted on your site,
your looking at much more work.

Custom HTML/CSS/PHP
http://theorderofindividualacceptance.co...p.php?id=1
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: