4images Forum & Community
4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: www.girls-on-bikes.com on May 30, 2003, 07:39:36 PM
-
Hello All,
I seem to be having some problems trying to create my own page.
For example, I want to create a page, called "contact" that will be wrapped by the template.
In this particular case, would I just copy one of the .html files, replace the "body" with what I need, then copy a .php file, and simply do a PHP include?
I'm not sure exactly what would need to be in the .php file since all the other php files (which I'm using for examples) have a ton of code in them.
Any help would be greatly appreciated.
-
use one other template from your site, home.html for eg.
edit the layout as you wish, change the name of the template contact.html for ex.
upload that template to your {template folder}
and then to call that template just link to index.php?template=contact
-
Hello,
Thanks for the response.
I would prefer to call the page by www.domain.com/gallery/contact.php
Is this possible?
-
Creating your own custom template page is covered in the FAQ
-
Yes, I read the FAQs, but again, it says to access the page, you would type in:
http://www.MyDomain.com/4images/index.php?template=<page_name_here>
Like I said in my previous post, I dont want to access my page that way, I want to be able to do:
http://www.MyDomain.com/4images/<page_name_here>.php
That's what I don't understand how to do because I don't know how the .html and the .php should interact.
-
yes u can do this but include the php thinks from index.php so the user is still logged in...
-
OK, maybe this will help, cause I need this spelled out.
Below is my contact.html file.
What do I need to put in contact.php in order to access this file from:
mydomain.com/gallery/contact.php?
{header}
</td>
</tr>
<tr>
<td class="bordercolor">
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td class="tablebgcolor">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="navbar" height="23">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" width="50%">
<img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />{clickstream}
</td>
<td align="right" width="50%">
<a href="{url_top_images}"><b>{lang_top_images}</b></a>
<a href="{url_new_images}"><b>{lang_new_images}</b></a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150" class="row2" valign="top">
<table width="150" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head2" height="20"><img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_registered_user}</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
<tr>
<td align="center" class="row1">{user_box} </td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
</table>
{if random_cat_image}
<table width="150" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head2" height="20"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_random_image}</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
<tr>
<td align="center" class="row1">
<br />
{random_cat_image}
<br />
<br />
</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
</table>
{endif random_cat_image}
<?php include("4gmenu.php"); ?>
<p align="center">
<?php
echo date("d.m.Y, H:i");
?>
</p>
<br />
</td>
<td width="1" class="bordercolor" valign="top"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
<td width="18" valign="top"><img src="{template_url}/images/spacer.gif" alt="" width="18" height="18" /></td>
<td width="100%" valign="top"><br />
<span class="title">{lang_contact_us}</span>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td class="bordercolor">
<?php echo @join (@file ("http://www.girls-on-bikes.com/cgi-bin/b3fmail/b3fmail.cgi?action=getform&form=general"),"") ?>
</td>
</tr>
</table>
<p> </p>
</td>
<td width="19" valign="top"><img src="{template_url}/images/spacer.gif" alt="" width="19" height="19" /></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tablebottom">
<tr>
<td width="6"> </td>
<td width="405"> </td>
<td width="225"> </td>
<td width="6"> </td>
</tr>
</table>
</td>
</tr>
</table>
{footer}
-
maybe this will help u:
http://come.no-ip.com/sitestats.phps
and result:
http://come.no-ip.com/sitestats.php
-
Awesome, this is starting to help.
Now I notice all you have in that php file is a couple instances of "sitestats"...is that where you would put the exact name of the .html file?
-
yes, actualy I just noticed myself, that second line with "sitestats" I dont even need...
so, all u need is specify what is your template by adding on top of .php file this line:
$main_template = 'YOUR_TEMPLATE_NAME';
if u're planning use more then one template at same page, then add one more line:
$templates_used = 'ANOTHER_TEMPLATE,ANOTHER_TEMPLATE_2,ANOTHER_TEMPLATE_3';
-
This is weird, I'm getting:
Parse error: parse error, unexpected T_ECHO, expecting ',' or ';' in /home/gob/public_html/new/gallery/includes/template.php(133) : eval()'d code on line 438
And I think it's because I have a php include inside my contact.html, but all of my other files have the same line, and display without a problem (the template I'm using was modified to have a menu include file)
-
try this:
http://www.4homepages.de/forum/viewtopic.php?t=4295
P.S. u cant use <?PHP and ?> in one line, u must separate them.
-
Well, I finally got it to work by not having <?php and ?> php on the same line, which is weird because in all of my other template files I have:
<?php include("4gmenu.php"); ?>
Well, thanks for all your help, I should be on my way to creating my own pages now ;)