jlhaslip
Apr 3 2006, 05:57 PM
Php based Templating Systemhttp://jlhaslip.trap17.com/template/index.php The Source Code for the scripts are included (literally) on the different pages on the Demo, including the Contact / Email script. The only page not there yet is the Message Script. Maybe tonight I will upload that. This one uses a little bit of query-string checking to confirm that the contents of the page are actually available (file_exists())and an allowed page content before serving it up. The 'allowed page content' is done by checking against a flat-file containing an array of acceptable query-string contents. I had another part of the script working to check against the contents of the third column of the menu_data.txt file, but it fails on the Trap17 server and I haven't sourced the problem, yet, so this array check is a temporary measure. Also, there is a Conact, or email script which writes to a text file as a repository for messages received from the site in case for some reason the Mail() doesn't work for the Hosting service. (ie: trap17.net disables the mail() on the Free Hosting Accounts) I have written a script to extract and print them also, maybe a Tutorial about that will be next? Also, I have used a 'fixed' header and sidebar approach to the template design which some of you might find interesting. There is a conditional statement there to utilize a different css file for the page structure of IE, due to the Browser differences, this was the way to make it 'cross-browser friendly'. Since I don't have an IE6 Browser, I will only state that the responses I have received are positive. I haven't actually seen the page in an IE6 Browser yet, so I don't know if it explodes or not. If the Alt= for the menus are removed, the page validates to the w3c standards set in the DTD. (html 4 strict). Can someone tell me if IE6 still requires the Alt= for tooltips? Or can they be removed and have the title= displayed instead?Anyway, thanks Vujsa over at Astahost for his original topic(CMS 101). I found it quite valuable as a guide to learning the php required for this scripting and it has opened up an entirely new perspective on the Web Sites I intend to build in the next short while. I hope someone else might be encouraged by this sample I have added to the Topic. And as Vujsa stated up in his Topic ay Astahost, the greatest advantage of viewing these codes and Templates is not in 'sniping' the code to install the files as a website, although it is possible to do that, the greatest value to be received is as an enticement to proceed on the path to learn the language and develop an understanding of the uses for the tools which php provide. If you want to use the code, PM or email me and I'll zip a set to you, but you wil receive much more benefit from writing your own Templating System. And it will be easier to modify or maintain because you are familiar with the parts, what they do and how they operate. Having said that, if you want / need a copy of the code, let me know and I'll pass you the zip file. Thanks for showing some interest in my scripts.
Reply
electriic ink
Apr 3 2006, 06:30 PM
QUOTE(jihaslip) Can someone tell me if IE6 still requires the Alt= for tooltips? Or can they be removed and have the title= displayed instead? IE6 uses both the alt and title attributes for tooltips. If the alt attribute is present however, IE will take preference to it and use it as a tooltip but if it isn't, it will use the title attribute. Ie:
HTML <a href="/" title="Aunty Mauvais"> <img src="Image2.gif" alt="Johnny"></a> Will show Johnny as the tooltip
HTML <a href="/" title="Aunty Mauvais"> <img src="Image2.gif"></a>
Will show Aunty Mauvais as the tooltip
HTML <a href="/" title="Aunty Mauvais"> <img src="Image2.gif" alt=""></a>
Will show no the tooltip
Reply
jlhaslip
Apr 3 2006, 07:41 PM
Okay, then I will remove the Alt= from the scripting on the templates. I have been mistaken about them for a while. I thought IE still required them and ignored the title=. That is good. Won't be long and the template up there will validate without changes. Thanks, Electric Ink.
Reply
Avalon
Apr 4 2006, 12:18 PM
Before you remove the ALT tags, wouldn't you be better to leave both the TITLE and ALT tags, with the same text, so older versions of IE will still see the tooltips? This way a wider audience will see the site the way you intended.
Reply
jlhaslip
Apr 4 2006, 02:28 PM
At last I found someone who thinks like me... That's why they are in there in the first place, for the benefit of the Older Browsers... but with the trend towards using strict Doc Types and validations, etc, I thought it might be time to drop them from the code. Not yet, eh?
Reply
Tyssen
Apr 4 2006, 10:31 PM
Leave the alts where they are for people who browse with images turned off. It doesn't hurt from an SEO point of view either cos it gives you another opportunity to use keywords.
Reply
jlhaslip
Mar 22 2007, 07:03 PM
PHP paging script updated. Test it here. New version of the Zip file here. Changelog: Added a security check to ward off injections by using the htmlentities() in the GET['page']. Let me know if this fails for you... or if you are able to add injections.
Reply
friiks
Mar 22 2007, 07:18 PM
Wow, it's great! I really need a templating system for my projects but I want to make it like... forums use it... You know... But this is still good, very good! Nice work. Though, why it echoes $_GET['page']; ?
Reply
jlhaslip
Mar 22 2007, 07:47 PM
Where? in the title tag? that changes the information in the tab label to describe which page you are viewing. CODE <title>Template : <?php echo 'Page: ' . $_GET[page]; ?></title>
Reply
friiks
Mar 22 2007, 07:57 PM
no ,no! in Array script CODE $submit = $_GET[page]; echo $_GET[page];
Reply
jlhaslip
Apr 28 2007, 01:17 AM
Already covered this. I will merge your post with the other tutorial. http://www.trap17.com/forums/index.php?s=&...st&p=241112
Reply
Unholy Prayer
Apr 27 2007, 10:16 PM
Ever wonder how to make your site one file? For example, in these forums, the posting page is index.php?act=post and so on. This tutorial will teach you how to do that. First, you'll need a text editor, and a PHP supported server. You can achieve this type of navigation by using the example below: CODE <?php $action = $_GET['action']; / /Gets whatever action equals from the url. Example: index.php?action=news Since action equals news, it will display whatever is in the "news" if statement.
echo "<a href='index.php'>Main</a> | <a href='index.php?action=news'>News</a> | <a href='index.php?action=other'>Other</a>"; // This navigation will appear at the top of every page. if($action == ""){ //If the url is just index.php, then action is blank. Let's echo some text. echo "Content of the main index page."; }
if($action == "news"){ //If the action equals news, then echo some more text. echo "This is the news page of the site."; }
if($action == "other"){ //If the action equals other, then echo some different text. echo "This is some other page."; }
?> You can also use includes to shorten your coding. After all the code is together, it can get kind of long and confusing. For example, you could use this: [code] if($action == "news"){ include('news.php'); //Includes a file called news.php } ?> And there you have it. A very simple script that you can use to make your website more organized and have less files. You don't have to do your whole site with the index page. For example, if you run a hosting site and you want the hosting plans to be hosting.php but you don't want a seperate page to apply, you can use hosting.php?action=apply. Hope this tutorial helped you guys.
Reply
Blessed
Mar 23 2007, 11:15 AM
Recent Queries:--
simple php template system $_get - 74.97 hr back. (1)
-
php system() background parentheses - 91.01 hr back. (1)
-
write your own php html template system - 97.77 hr back. (1)
-
using - 145.60 hr back. (1)
-
remote shutdown through system ip using php code - 147.58 hr back. (1)
-
html css php templating system - 203.41 hr back. (1)
-
php code dynamic nav selected include - 256.54 hr back. (1)
-
how to change color of text in php using if loop when message recivied - 268.74 hr back. (1)
-
how to include paging in dynamic page using php - 299.15 hr back. (1)
-
show dynamic images through php with echo command - 323.50 hr back. (1)
-
php templating paging system - 335.33 hr back. (1)
-
building php template system - 356.64 hr back. (1)
-
using php includes to create a dynamic web site - 380.14 hr back. (1)
-
full php templating system - 426.29 hr back. (1)
Similar Topics
Keywords : templating, system, php, includes, building, dynamic, site, includes, flat, files
- Shadow_x21 Tutorial Includes: Remote Shutdown
and Local Shutdown (7)
Deny Or Grant Users Access To Files Of Choice (vista)
Uses Bat Files To Deny Or Grant People Access To Files (3) Deny Or Grant Permission Requires Notepad Vista This Technique Can be Used On Earlier
Versions Of Windows But Uses Different Syntax: To Deny Access Open Notepad and Type @echo off
cls Icacls PATH OF FILE GOES HERE WITHOUT PARENTHESES /deny USERNAME OF PERSON YOU WANT TO DENY:(F)
And To Grant Is The Same Process @echo off cls Icacls PATH OF FILE GOES HERE WITHOUT
PARENTHESES /grant USERNAME OF PERSON YOU WANT TO DENY:(F) And There It Is. Simple Huh!....
[aef] Most Recent Topics Listing Mod
on your Web-site pages (2) Assuming that you have an AEF Forum software installed on your Hosting Account, and that you need
to display a list of the most Recent Topics to be display, say, on your Index page, then read this
Tutorial. To begin, Define the variables that you need to connect to the Database and also define
the URL to the Forum in the prescribed format as follows: CODE <?php //start the script
//define db information here DEFINE ('DB_USER', ' '); // required info
DEFINE ('DB_PASSWORD', ' '); // required info DEFINE ('....
How To Create Pdf Files Using Free Tool
Introduction to use a free tool to create PDF file (0) Now, that you don't need to have expensive software like Acrobat to create PDF. All you need is
Microsoft Office and a software name doPDF. You can download the freeware from
http://www.dopdf.com/download.php After downloading dopdf.exe, follow the instruction below 1.
Double click to install it, as display at image 1.jpg, choose a language and click OK 2. You will
see 2.jpg click next 3. Click I accept the agreement see 3.jpg, click next 4. Now you will see
4.jpg, select the folder to install it and click next 5. When seeing 5.jpg, This is the folder group
in Star....
Create Dynamic Html/php Pages Using Simple Vb.net Code
Taking your application data, and creating a webpage for others to vie (1) This example will show you how use a string in VB to create PHP code. In order to do this, you need
a string to store your PHP page and a function that I will list at the bottom of the page for you to
put in a module. This code is written in VB.NET Public Sub CreatePage(ByVal HTMLTitle As
String, ByVal HTMLText As String, ByVal HTMLFileName As String) Dim strFile As String '
---------------------- ' -- Prepare String -- ' ---------------------- strFile = "" '
-------------------- ' -- Write Starter -- ' -------------------- strFile = " " ....
Clearing Your Ie Tif
Clear your Temporary Internet Files on IE (0) -Welcome to: Clearing your Internet Explorer Temporary Internet Files Tutorial-!
Attention!: As some of the members on here may know, it is possible to clear your Internet
Explorer Temporary Files. I have searched this entire Tutorials subforum to find a topic already
made, and I have found nothing. This tutorial I did NOT find this on Google, or any other search
engine. I always find this out for myself. Lets start: Ok, first we open up Internet Explorer,
then we click "Tools"...then we click on "Internet Options...". On the Main page "Gener....
How To Download Any Flv Files From Any Sites
(6) Now you can download any flv files from any websites!! People often know how to download
youtubes clip, but not from other sites. In this tutorial you will need a tool name Moyea FLV
Downloader, it is free and you can download it at http://www.flvsoft.com/download_flv/ This is
the best tool i have meet up with to download flv files in any site. Since it can detect flv files,
and list it, you can download it as you want, so no more favourite clips goes away from your sight
and now you have it on your own hard drive! 1. Run moyea flv downloader see 1.jpg 2.....
Debug Exe Files
How to debug an exe file. (4) Think that we have written a program, and some codes are wrong. We can go back to compiler and
change the code, and compile again. But I will show you how to correct our mistakes without using
the compiler. Let's start: I have written a program in Delphi. Let's see my mistake. I
have created a form like this. After this I wrote the codes in the Compare Button click as
below. CODE 1. procedure TForm1.ComparebuttonClick(Sender: TObject); 2. var
3. a,b:integer; 4. begin 5. a := StrToInt(EditA.Text); 6. b :....
How To Make An Ultimate Game List.
If you're making a site on video games or such. (0) Hello. I am BuBBaG. You can call me Bubba for short. I'm going to show you how to make an
Ultimate Game List. First off, we need to make a database, we are going to call this database
`my_db`, leave out the `'s. Inside that database we will need to create a table
called `ugl'(Ultimate Game List, duh). To make the table, simply enter this in the Syntax.
CODE CREATE TABLE ugl ( System char(50), Game char(50), ) In the
above code, it is stating we are creating a table called ugl, with two columns, System, and Gam....
Download Files Off Esnips.com
even now that the download button is gone! (0) hey everyone, i am sure that many of you may have heard of esnips , which is basically online file
storage/sharing. you can now find almost any file imaginable on esnips, and in many ways it is
better than rapidshare. previously, once you are signed in to esnips, you were able to download any
esnips file via a button only viewable to members. back then, there was a method to download any
file without even signing in. then, probably due to legal issues, users were able to choose whether
or not people could download their files. the hack mentioned above, though, still....
Simple Stylesheet Tutorial
Stylesheet embedded in your site. (2) Hi - ill show you how to make a simple style sheet that will be embedded into your site. OK make
sure your site is set up already (like the standard tags) To start and end off a stylesheet you
need to do the following CODE <style type="text/css"> </stlye> Ok
lets start CODE <style type="text/css"> p { font-family: "Tahoma";
font-size: 9; color: "red"; } </style> So when you come to put in
CODE <p>Hi!</p> The text will appear red and will be in Tahom....
How To Hide Your Important Files And Folders
In Ms. Windows, Without Using Programmes. (7) Most of people share their computers with others -family, mates, buddy or whoever- and that sharing
threatens their secrets and private file to be revealed, letting some people to know things they
shouldn't know.. My Securing Way: Operation - Camouflage Use an Icon
Editor to generate a 1x1 Transparent Icon and Save it .. > 1 Open CMD.. Start >> Run or Press
WindowsLogo+R.. Lets Say you wanna hide a Folder named " secure " and it's located in
E:\folder\ so Write E: and Press Enter then Write Cd folder and Enter then At....
How To Set Up A Bookmarking System On Wii
Use your favorite social bookmarking site. (0) This is a simple tutorial on a way to set up a bookmarking system on your Wii with greater stroage
than the Favorites. It is more complicated than the Favorites and requires manual URL typing. Well
let's dive on in. Items Required Nintendo Wii Internet Channel 3 Empty Favorites Internet
Connection An account on a social bookmarking site I will be using delicious as an example.
delicious Ok, if you do not have an account, read on. If you do have an account, go to the
{account} section. Ok, first you need to register an account. This can be done by clicki....
Create A Google Seach Result Page Embed Within Your Site Page.
(12) Create a google seach result page embed within your site page. It is easier to create
web page that embeded the google search result in it. The first step is to go to google apply an
account for the google ad-sense. After that login to you account and choose the create ad-seach
option. Most of time the google search box give all we have the great and powerfull seach ability.
But, have you think every time users get seach with it. They do redirected to another page that is
not within you site. It is easier to create web page that embeded the google sea....
Php Word Filter
Have you accidently sworn on your site? Or do you want to keep visitor (9) This is pretty simple but very useful if you don't want people to swear. We will be using
str_replace for this. CODE <?php str_replace ("curseword,
"replacemet"); ?> Thats pretty simple, just fill in the curse word and the
replacement, and then repeat... heres what it would look like full size: CODE <?php
str_replace("swear", "replacement"); str_replace("swear",
"replacement"); str_replace("swear", "replacement");
str_replace("swear", "....
Php Echo
Learn what the echo can do for you. Includes basic echo and variable p (10) PHP Echo Description The echo() command has one purpose, displaying whatever you put in between the
brackets. Learn to use it to your advantage. Try It Out There is your echo command. For now,
it does nothing. It has no value to display. Outcome This is my text. Now this echo command
has a value to display. Whatever you replace "This is my text." with will be displayed. Alright,
lets move onto the next step. This time, we will include a variable in the echo command.
$var = "This is a variable"; echo "$var. Congratualations, you just parsed a....
Faux Ajax Loading - Css Only
Pretend your site is Ajax based (3) Link: http://www.jlhaslip.trap17.com/samples/misc/ajax/index.html Check that out. The first page
has information and the second and has the actual example of its use with sample CSS code. I find
that when you visit a site which has a slow server and attempt to view 'large' Image files,
it is pretty boring to sit and stare at a blank screen, so this little snippet of code can be used
to give the visitor something to see to indicate that the image is being downloaded. I built a
small animated gif that sits in the background of the space allocated for the image....
How To Fix Problems With Shareaza
ONLY for people to download LEGAL files with. (1) Can't run shareaza and surf the internet at the same time? There could be two
problems: Your uploads are killing your downloads and/or you are using Windows 95/98/ME. If you
are uploading constantly and havent limited the bandwidth then it is likely that you are killing
your download speed which is affecting your ability to surf the web and do other tasks. If you
are uploading lots and download speeds are suffering: Start Shareaza. Click on the Tools menu,
then click Shareaza Settings. In the box that just popped up, there is a list of men....
How To: Make A Simple Php Site
Making one file show up on all pages using php (21) I have looked all over the site and could not find anything that was like this simple, or just like
this at all.. For some people i know that you are using a basic HTML site...and having a big menu
if you want to add somthing you have to go into every one of the pages and add or remove or edit
what you want to do, but with somthing verry simple all you would have to do is edit one file, and
all of the pages that have the PHP script on them would suddenly change to what that one file is.
So to start off if you are planning on using this little tirck, the page that you a....
Changing Background Color In Php
usefull for templating. (5) Tutorial on how to change background color with PHP I will be descibing to similiar ways that
you can change the background color of your website with php and leave it at that till the user
changes it again. We are going to do this with CSS. You can either have your cSS info on your page
or in a spereate document. The first thing youll have to do is decide if your going for the linked
stylesheet or directly on your page. IF you link it you'll need to have this code in you
tags. CODE <style type="text/css"> <?php include ("st....
Delete Files And Directories Using Php
following up from creating and writing (7) How To Delete Files and Directories follow up from creating them Hello all and
welcome to my second tutorial involving file management. In my previous tutorial , I explained how
to create, write and read files. In this tutorial I'll explain how to remove the files and
directories you took so long to create. I did not explain last time how to create directories as I
did not know, now I do, you can use the mkdir() function. Now with this tutorial.... Removing
Files Removing files can easily be done with the unlink() function: CODE <? un....
Phpbb Forum Site Transfer
How to do it, step by step instructions (20) I'm sure many of you out there have used phpBB at some point. To those who enjoy running forums
and online communities, specifically supporting phpBB, I am about to tell everyone how to restore
the forums database from one website, to another. This is presuming you do not have any mods or
hacks installed. Some of you may find this information useful. Here is the scenario: Let's say
you have forums running phpBB version 2.0.17 (currently the latest one). You have decided that you
want to move your forums to a whole new URL and provider, and as an added bonus, ch....
How To Read And Write Files Using Php
php :: reading and writing files (20) How To Read And Write And Files a simple trick using php For this script all you need is a
php enabled server, a text document and a basic understanding of php itself: Beginning Create a
text file called name.txt in any directory. Change the file permissions to 777 Create a empty
php file in the same directory. You are now ready to begin reading and writing your files. If you
just want to read the file scroll straight down to Reading the File else read through the whole
tut /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /> ....
Css And Javascript Combined For Dynamic Layout
use of different CSS files at same site (9) This tutorial is meant for people that are dealing with problems while coding their site at 100% of
width. Important notice: Some people has JavaScript disabled, so they will not be able to load CSS
file (take this in account when creating your website). How this script works. In the HEAD of your
HTML document will apply this command, so variable.js file will be load at start: CODE
<script type="text/javascript" src="variable.js"></script> In
browser JavaScript file variable.js is loaded. This Javascript file consist of this para....
How To Make A Very Simple Wap Site
A quick tutorial about WML language (40) WAP Site Tutorial : How to Make A Wap site? Before We begin.. Defination from the
Web about Wap. QUOTE WAP is an open international standard for applications that use
wireless communication . Its principal application is to enable access to the Internet from a
mobile phone or PDA .A WAP browser provides all of the basic services of a computer based web
browser but simplified to operate within the restrictions of a mobile phone. WAP is now the
protocol used for the majority of the world's mobile internet sites, known as WAP sites ....
Checking The Web Site Speed
(10) Did you taking too much time to access your favorite sites? Probably the problem is on the server
used by those sites. To make sure that is the problem, use Windows PING facility. Ping is a small
program, which sends a 32-bit signal to the Web site server. Next, Ping record the time needed by
the server to answer it. To activate Ping: Click on the Start-Run menus, type command, and then
click OK. Type PING "site name" in the MS-DOS prompt window, for example PING www.yahoo.com. In a
moment, the result will appear on the screen. A result less than 300ms is normal spee....
How To Put A Phpbb Login Box On Your Main Site.
Code and .php included!!! (18) I have included my coded file with this... Ok here is the code. CODE // //Create login area,
replace the phpBB2 in /phpBB2/login.php with your forum's //directory // <form
action="/phpBB2/login.php" method="post" target="_top"> <table
width="25%" cellspacing="2" cellpadding="2" border="0"
align="center"> <tr> <td align="left"
class="nav"><a href="/phpBB2/index.php" class="nav">Prank Place
Forum Index</a></td>....
Changing A Dynamic Ip
How to change your dynamic IP. (18) In this tutorial I will tell you how to change a dynamic IP if you have Windows XP. First of all go
to - Start >> Run - and type 'cmd'. A window with a black background and grey text. In
this window type 'ipconfig' and text should come up saying: IP Address ............. *IP
HERE* Subnet Mask ................ *SUBNET MASK HERE* Default Gateway .......... *DEFAULT GATEWAY*
Write this down on a bit of paper on in notepad. You will need them later. Now type
'ipconfig/release' - this will terminate your internet connection - but don't g....
Php Quiz Script
Make quizzes for your site. (20) Hello all, A little bit back I decided to make a quiz scriptjust out of no where lol. However it
doesnt do anything special but I am going to make an email mod for it so that it will email results
to your email address. So here is the basis of it. INSTRUCTIONS: Open a new page in your text
editor and paste in the following code. CODE <?php $qid = "Quiz ID-00"; ?>
<html> <head> <title><? echo "Gamers Pub $qid";
?></title> </head> <body> <p><h3><? echo "....
Php Emailer/contact System
An email or contact system for your site (20) Hello all, Here is an easy Emailer or Contact system that allows visitors or members of your site
to email you just by filling out a form. So here is what you need to do to set it up. First open up
a new page in your text editor and paste in the following code. CODE <?php $Name =
$_POST['Name']; $Subject = $_POST['Subject'];
$Email = $_POST['Email']; $Site =
$_POST['Site']; $Message=$_POST['Message'];
$align = $_POST[....
Looking for templating, system, php, includes, building, dynamic, site, includes, flat, files
|
*RANDOM STUFF*
*SIMILAR VIDEOS*
Searching Video's for templating, system, php, includes, building, dynamic, site, includes, flat, files
*MORE FROM TRAP17.COM*
|
advertisement
|
|