Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP






SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Simple Php Web Templates


I would like to know how to setup a basic textfield like the one used to create these posts to edit files online. I figure this is simple and easy but everything I download has so much crud loaded in to it that it becomes nothing more then a ghost hunt.




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
What Is The Best Way To Use Simple Templates In PHP?

What is the best way to use simple templates in PHP?

header, footer, etc, not parsing code

1.require
2.include
3.not using php but only HTML instead
4. Fast templates
5. other?

where I can find a well explained tutorial on this?

View Replies !   View Related
OOP Templates And SE
Within a site I have a section built out of user generated directory.
Each dir has an Index.php (template and OOP based).

Those indexes when created are open and written with their corresponding ID
Obviously that ID is the only difference in between all indexes.

In order to grab all components’ content from my DB. I need to pass that ID as a SESSION. So the content only exists when an index is parsed

… Still with me? …

Now the question is:

Does a SE spider follow a link leading to content generated out of passing a session?

View Replies !   View Related
More Help With Templates Please
I am still struggling to get my mind around having html templates doing the
mark-up. What do I have to change so the PHP script that will bring in the
HTML template and put the value $row in the table?

<?php
// simple PHP script that outputs just one string
require_once "DB.php";
$dsn = "pgsql://username:password@localhost/zendtestdatabase";
$db = DB::connect($dsn);
$query = "SELECT * FROM links WHERE link_id = 3";
$result = $db->query($query);
while ($row = $result->fetchRow())
{
print "$row[1] <br />";
}
$result->free();
$db->disconnect();
?>

<html>
<!-- basic html template -->
<body>
<table border="1" cellpadding="1" cellspacing="1" width="95%" >
<tr>
<th>Title</th>
</tr>
<tr>
<td><?=$row?></td>
</tr>
</table>
</body>
</html>

View Replies !   View Related
Templates
I've just started workin' with templates, got any good (I mean real good) site to hve some good idea?

View Replies !   View Related
Php Web Templates
i am looking for free web templates written in php.

I know only Php Nuke.

I need something to create a classic personal web site.

View Replies !   View Related
Templates?
i want to rewrite my website to separate the php script from the HTML code.
Therefore a web designer can update the design of the website without any
knowledge in PHP.

I read a lot of information about several templates like PhpLib,
FastTemplates, Smarty etc etc.

Some do not have a specific language so you cannot do complex things.
For example it's not easy to display a table (sometimes you need to have a
specific template to display the TR HTML tags...).
, it's not easy to use a different color to display a table row according to
a parameter etc etc

Some have a specific language, like Smarty.

My question is, what is the interest to learn another language??
What is the real interest of Smarty (or other one)?

What is the difference between these 2 situations:
I explain to a webdesigner this code:
{section name=sec1 loop=$contacts}
phone: {$contacts[sec1].phone}<br>
fax: {$contacts[sec1].fax}<br>
cell: {$contacts[sec1].cell}<br>
{/section}

Or I explain this:
foreach($contacts as $key=>$contact){
phone: <? echo $contact["phone"]?><br>
fax: <? echo $contact["fax"]?> <br>
cell: <? echo $contact["cell"]?> <br>
}

So I really think it's better to have;
- a php script which set some variables
- a HTML templates which build the content of the page. It uses a lot of
HTML tags and of course some really basic php function (if, foreach, echo).

Of course the php script call the HTML template.
You only use php, you work with the same variables, you don't need to call
some specific functions (assign etc etc), you don't need to know another
language etc etc.

View Replies !   View Related
Using Templates
Anyone feeling like they want to give me a 101 on general template handling in
PHP?

My history
I used to be a Roxen guy, where you could define your own HTML-tags, so that
"<foo />" could be set by "<define tag='foo'>Hello World</define>" so every
time you use the tag <foo /> it would be parse and replaced with "Hello World".
Naturally, within a <define>, any kind of roxen code can be used.

Today
I am using "php_value auto_prepend_file" and "php_value auto_append_file" to
insert a header and foot script to create the layout of a page, and function()
in required files to make small scriptlets such as headline() and stuff like
that.

The problem
With PHP, I can't make containers. Not real ones anyway. In Roxen, I could have
done this:

<define container="headline">
<span class="headline">
<contents />
</span>
</define>

So <headline>Hello!</headline>
Would become <span class="headline">Hello!</span>

You get the idea.

Now, with PHP, the above would be:

function headline($headline){
print "<span class='headline'>$headline</span>";
}

But the obvious problem is when you want to use this function for more than
just a small string - you might want a big block of HTML and PHP code to be
contained inside a HTML table with a border - for example. In Roxen this would
be done by:

<square>
Big old chunk of text, html, mysql, rxml or whatever.
</square>

And the end result would be that big chunk of text surrounded with the code of
a table. This is useful for lots of things, bbut generally for framing things
in different ways - mainly for news-boxes on pages

Currently, Im am doing this in php this way:

<?=square("start") ?>
Big old chunk of text, html, mysql, rxml or whatever.
<?=square("end") ?>

But that's just ugly code and cumbersome.

Now to the point (finally!) - How does templating workm, and could it be used
to accomplish what I am trying to do here? I am aware of 'Smarty' and I have
downloaded it and played with it, but it was just a difficult concept to grasp
for me (yeah,. so call me stupid) and it did caching and had compiled scripts
and whatever. Isn't there a smpler solution?

View Replies !   View Related
Templates In PHP
how do I go about on creating a template engine. Something like the XMB forum board templates (I really like how the templates are handled on the XMB forum board script). Something that will store the template in a database table and called out with the eval(). Please do not recommend smarty. For some reason, I'm not gonna go with smarty.

View Replies !   View Related
Php-css Templates
how to develop website using css templates(header,navbar,footer.. etc). how to update our website contents fron mysql database through control panel.

View Replies !   View Related
Templates With Php
I made the template using photoshop and html and so far the only php I have on there is a simple blog i coded and a login script. how do i template the site sort of like how phpbb is templated.

for those not familiar with it. the php files call a *.tpl file which has the html template within it. how do i do that?

View Replies !   View Related
BB Templates
I downloaded a phpBB style from there web site that i want to use instead of the standerd subSilber style.

I have no clue how to add the style i downloaded? As of now it is a in a folder on my desctop and i tryed uploading it to the "templates" section in my forum section of my webserver but it did not work.

View Replies !   View Related
TPL Templates
I've researched this for a couple days, and I've found template engines like Smarty, but I don't want to use something I have to install separately. I know phpBB (probably others too, but I've only used phpBB) doesn't do that. So I'd like to do something like what they do, but I can't figure out how they did what they did.

View Replies !   View Related
Simple Script For Doing A Simple Photo Album And Journal?
I'm looking to quickly get a photo album online. Very simple, thumbnails,
a few pages, maybe a description, but hopefully a small script that's easy
to edit and work into my existing site. I know about hot scripts, etc. but
I was wondering if any one could recommend one?

Secondly, I also want to setup a journal. It's not really a "blog"
although I guess blog software may work. But it isn't going to be a
message board or anything like that. Just a place to put out random bits
of news. Once again, same premise, I'm trying to find the most simple
script possible that could basically traverse a directory of simple
textfiles and produce a list.

I know all about Blosxom and stuff like that, but I'd like a script that
just did the above and didn't overtake my site like PHPNuke or something
like that. I'll probably roll my own, but I thought I'd check first.

View Replies !   View Related
Need Help W/using Loops With Templates
I'm starting to use templates for my site and was curious about how they handled loops. For example, let's say I have a HTML table like this:

<table width="750" border="0">
<tr>
<td>{ARTIST}</td>
<td>{SONG_TITLES}</td>
</tr>
<tr>
<td>{ALBUM_TITLE}</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>

And the PHP file then calls records from the database for each placeholder in a while loop like this...

$result=mysql_query("select * from music where id = '$album_id'");
while ($row = mysql_fetch_array($result))

{
$album_id=$row['album_id'];
$artist= $row['artist'];
$album_title= $row['album_title'];
$song_title=$row['song_title'];
}

Normally, I would do something like this in the php file to point the data to the placeholder....

$myTemplate->tag("Site_title",gettitle());

So...my question is...where would I place the call to the database and the while loop and point each placeholder. Would I do something like this...

getmusic();
$myTemplate->tag("Album_Title",$row['album_title']); OR
$myTemplate->tag("Album_Title",$album_title);

If anyone has experience with this, please help! Thanks!!

View Replies !   View Related
Smarty Templates + PHP (need Help)
Need some help with the syntax. For example, if this is my tpl file:

<html>
{$sample}
</html>

And this is my php file:
$s->assign("sample","This is where I want to insert php code");

How do I put php scripts inside the bolded area?

View Replies !   View Related
PHP Navigation With Templates
I want to create a site navigation system that has URL's like this:

/index.php?page=1, /index.php?page=2, and /index.php?page=3.

View Replies !   View Related
Include In DW Templates
In my file "/Templates/template-file_1.dwg.php" I have:

<?php
include '../include/menulist.php'
?>

to include the file "/include/menulist.php".

Since I use this template-file in many different subfolders, it doesn't work except for "/folder1/file1.php" (since it's the same "tree-level")

and not for
"/file2.php" (root file, less "tree-level")
"/folder2/folder3/file3.php" (one more "tree-level")

I have tried many ways:

include ("@@('/include/menulist.php')@@");
and combinations of:
$_SERVER["DOCUMENT_ROOT"]
$_SERVER["HTTP_HOST"];
require_once

Please help!

View Replies !   View Related
Libraries And Templates
Can someone point me to a good resource explaining how and why to use
templates in php. I am new to php and wondering if these so called templates
are just include files or what. And I have read several things about
libraries in php but some of the applications I see are using includeonce
files. Please don't tell me these are the same as libraries. I would
consider libraries an application global resource that does not need to be
referenced on every page to be utilized. Maybe included in something like a
global.asa (from windows world) to make available to entire application.

Can someone shed some light on these subjects and/or point me to a good
resource?

View Replies !   View Related
Templates = Better Performance?
I'm working on a web site that has a common header,navigation links, and footer.

I'm thinking of just writing 3 funtions:
function header()
function navigation()
function footer ()

and saving them on a common file (something like functions.php)

Then calling the functions in each page?

Will this affect how fast the web page loads?
Will it take longer for the page to load since it has to get part of the page from another file (functions.php)?

I've read a lot of stuff on templates (www.phpbuilder.com), but I think just using functions will work fine for me since I'm not expecting to do anything too fancy with the page.

View Replies !   View Related
PhpDoc Templates
I am currently documenting all of my oo classes to include proper documentation for phpDoc to work right. i was wondering if anybody knows where i can get some templates for it. i dont like the default ones and i dont have time right now to rewite them.

View Replies !   View Related
DB Stored Templates
I'm now having another problem! I can't get the damn PHP to retreive a template from a database. Maybe one of you can fix it? functions.php: PHP Code:

View Replies !   View Related
PHP Design Templates
I am basically a programmer,not a template designer or a good web designer. Is there any PHP classes or programs where I can customize the design and add some images to look better because I I have few php pages where values are taken from database. I wanted to put it in nice looking web pages.

View Replies !   View Related
Success With Pdf Templates?
to replace substitute symbols in an existing pdf file with
php. I found a lot with google, but everything I tried failed. It seems
that this doesn't work with pdf created by Adobe 6 or some of these
pdf printer devices.
Everyone, who succeeded with an older Adobe version, wasn't really glad
with the result. Now I want to know if there is someone who has success
creating pdfs from pdf templates with Adobe 6 (how did you do that?) .
And if there are some limitations or problems, working with this kind
templates.

View Replies !   View Related
How To Loop In Templates?
having developed this simple template engine for my own projects,the
engine simply replaces the {replacable} tags with the appropriate
value.

the template file is read into a string variable $string ,then i use
preg_replace_callback to process the tags.
now,i have a problem with the loops.i've though about this:

{LOOP_NAME}
things to be {repeated}
{/LOOP}

then i though about using preg_replace_callback twice,once to extract
the loop body,repeat it then insert it back into $string.
then use the final preg_replace_callback to replace all {replacable}
variables.
is this a bad idea for server loads?

View Replies !   View Related
Templates And Images
I want to pass a image (from a database) into a template how can I do this? I use templatePower but if you know the solution with another template class it's not a problem.

View Replies !   View Related
Such A Thing As PHP/SQL Templates?
My company uses the open source "osCommerce" to build our website. I
really like how the site is organized.

I have been thinking about designing my own website, and I would love
to have it organized much like the osCommerce sites are organized, but
I don't need the e-commerce functions. My site would just be an
informative site with lots of downloads.

If you go to their website www.oscommerce.com, you'll see that their
website, an informative website without e-commerce, is organized
basically the same way that the commerce sites are organized.

I mentioned this on one of their forums and was told that, because of
the difficulty of removing the commerce components, I would be much
better off to just design my own database and website using PHP and
MySQL.

I am new to PHP and MySQL, and have only learned so far to make minor
changes to an already-existing site/database. I don't feel that I
could build one from scratch by myself.

So, my question is... Is there such a thing as "templates" that I
could download (much like the osCommerce open source is a template) to
use and modify to make my own?



View Replies !   View Related
Templates In Conjunction With Php?
I m designing my first 'real' site and want to do things proper this time.
Using dreamwaever and php I was wondering what u guys think of templates in
conjunction with php? Do you think it is the best way to apply my site
design to the entire site or are there better ways?

View Replies !   View Related
Dynamic Templates With PHP
I don't know if this is even possible, but I was wondering if their is a better way to be doing things when displaying php and html code.  (This might be considered using OOP as I am trying to convert from normal php coding to OOP.) Code:

View Replies !   View Related
Joomla Templates
Does anyone happen to know where there might be an up-to-date tutorial on how to make a joomla template? All the ones I've tried are either very assuming, too technical or out-of-date or a combination. I'm running Joomla 1.5.0.

View Replies !   View Related
Smarty Templates...
I've checked. Smarty.php.net, taken a look through all their tutorials and
documents etc. and I'm atuck on starting to use Smarty. basically I dont
know how to start the class etc.

View Replies !   View Related
Format Templates
I have created a select menu form page. When the user selects from the menus and hits submit they are taken to the next php page which displays output in table format.

Is there anyway that I can allow the user to view the output in two different table styles??

e.g. One user might want to view a table with 5headings, another might want to view a table with 6headings and so on.

View Replies !   View Related
Smarty Templates
I have a Variable:

$var = "A,B,C"; //stored in DB

in my template I want the designer of the template to decide when to list the data in rows like

<td>A,</td>
<td>B,</td>
<td>C</td>

Can this be done without the php code? I will have content in a database and I won't know if the designer wants to make a particular field into a list.

View Replies !   View Related
Creating Templates With XML
I need to create 4 different templates for one of the functions of my project but i don't have any experience in using XML. how do i create template with XML and integrate it in PHP platform?

View Replies !   View Related
Get Pre-Made Templates
i am trying to find a place to get Pre-Made Templates please help me out.

View Replies !   View Related
Scripts Templates
I bought two scripts templates. I would like to change the template header but i do not know how to do. i have been trying for 2 days now, getting close but there is something i am not getting that is beyond my knowledge. Here are a few more details: The php script I got (job site) is set up with a main.php file apparently containing all, and an index file (and other fils obviously), but the main.php holds the header infos i want to change.

Now i want to change it with a flash movie header from the second template. I know this should not be difficult to do as I really got close to it. but there is something I do not understand. so would anyone be kind enough to receive the files and see if they can sort it out, if it is simple.

View Replies !   View Related
Templates - NAV Bars
Each time i create a new part on my NAV Bars i need to copy and paste it throughout each individual page i create. Is PHP the answer to this? Can i have it so i only maintain a NAV BAR in one place and it to automatically update on all pages.

View Replies !   View Related
Templates, *sigh*
i'm having problems with templates, my site's not showing up at all. Visit www.betterphp.wghq.net to view this. Any ideas, i've done all the debugging methods i know, and there are no errors. Code below (1st template class, then the index.php). Code:

View Replies !   View Related
Integrated Templates
I'm trying out PEAR Integrated Templates and have encountered a problem. I have the following code in an include (.inc) file:

require_once "HTML/Template/IT.php";

function printerror($error)
{
$template = new HTML_Template_IT("./");
$template->loadTemplatefile("error.tpl.htm", true, true);
$template->setCurrentBlock("ERROR");
$template->setVariable("ERRORTEXT", $error);
$template->parseCurrentBlock();
$template->show();
return;
}

View Replies !   View Related
Working With Templates
I starting to work on some big projects now and i would like to get some experience with working with Templates. I know that smarty is a great template engine i was wondering if any one has any tutorials that i can follow on making a system using a template engine and the best work follow to follow.

View Replies !   View Related
Includes And DW Templates
Having a strange problem. The cart I am working on makes heavy use "include" which is just fine with me as it keeps the amount of code sitting infront of my face at any one time minimal. I made a DW template for this cart and tried to adhere explicitly to the structure and spirit of this cart.

The problem I am having is with the refs. Pages at the root of the site will only properly call the incuded files if I right the ref like this <?php include "xyz/inc/xyz.php"?> and that makes sence.

However, when I try to make links relitave like <?php include "../xyz/inc/xyz.php"?> I get error messages when I view the page saying no such luck basically. But, pages that are in subdirectories like this. Tried "/xyz/" too, but no luck. I also tried using the full url of the site, but that gave me the same problem no matter where the file was.

I would really like to be about to keep using my template the way it was supposed to be used and have files in subdirectories. I hate throwing all my files in the root directory. Can any body tell me what I am doing wrong?

Sorry if this seems like a dumb question. I am pretty new to PHP, mostly a graphics and css jock. I have never had this kind of problem with just xhtml.

View Replies !   View Related
Includes, Templates
I have a .php that does all my sums and shows some adverts... Thats fine, because I can display this across multiple php files fine...

Except, (here it comes) when I come to include it within a phpBB page. Now you will understand that phpBB is template based, so I can't include it there. And if I include it in the php file, it prints it before compiling it.

Is there a way of doing an include that only includes when it is told to by the tpl file?

View Replies !   View Related
Templates -> Static Page
I was wondering if i can get help on how to go about writing a file using a template. The template does several calls to the database and all parses out nicely.. but i want to save that as a static html page.

I've tried to use the fputs but it needs a string... and I'm stumped here. Has anyone tried doing this and has an example I could follow?

View Replies !   View Related
Display 3 Random Templates
Alright, so I have a bunch of files called link1.html, link2.html, etc.

I want to call 3 random templates into one file...except I want it to make sure it isn't calling the same file more than once at a time.

View Replies !   View Related
API For Handling Users And Templates
I'm looking for an API to handle user authentication and output.

I have previously played with PHP Application Tools
(http://www.php-tools.de). This suite of tools has tons of potential, but
on-going development has been stagnate as of late and support is nearly
non-existent.

I've also developed with Drupal and don't want a CMS.

All comments/suggestions welcome.

View Replies !   View Related
Templates Stored In Database
I have a form where a user can enter different feild, for simplicities sake,
say a 'To:', 'From' and 'Message' feild. The can select a 'template' from
the databse, each one has different layouts, images etc, and is sotred as
HTML code in the mySql. My question is how do I insert the vairables into
the correct places in the template? I realise if it was hard-coded I could
use something like:

echo "To:". $to. "<br><br>". $message. "<br><br>From:". $from;

etc, although this is simplified alot and the ones int databse contain
images, tables, css etc. I don't really want to hardcode them using IF
statements as I want it to be easy to add new 'templates'.

View Replies !   View Related
Templates W/dynamic Functionality
I've seen a few template engine scripts mentioning that they have built-in dynamic functionality. Can someone tell me what that means?

View Replies !   View Related
Using Templates To Send E-mail In PHP
I'm looking at sending e-mails from PHP based on templates with
expansion of variables, similar to a mail merge. Does anyone know of
existing code for this or can point me in the right direction. I
assume I will need to use regexps but am not yet sure exactly how.

View Replies !   View Related
PHP Templates And HTML Select
For those of you using templates to keep your PHP and HTML code
separate.....

How do you handle a HTML Select statement when the initial option
selected needs to come from a database field?

View Replies !   View Related
Making Language Templates
how you do those language template things because I am doing a multilingual site. So in the HTML or whatever i would do {SITE_TITLE} or similar and then if i include a language file at the top like require_once("lang.en.inc.php"); it would then replace them with the variables in the file. like the file would be: declare (SITE_TITLE) "Dev Shed Forums";
or however like they do in forums and CMS systems.

View Replies !   View Related
Phplib, Templates And Blocks
I want to use a block in a template but each time i try (using the example on devshed) it just prints 'ABLOCK' rather than the expected result i.e. the contents of an array. Code:

View Replies !   View Related
Fast Templates With If And While Statements
If i, for example, have a template where i want a number of entries to be while'd, outputting a long tables of names, for instance. How would anything allow me to do that when I'm using some sort of fast template/template class? The .tpl file will not be split into several parts, so how is it done?

This would also apply to if statements, if i, for example, want to show some text to a logged in user, and another text to a user that's not logged in.

View Replies !   View Related
While Loops And HTML Templates
I'm writing a forum script and I need to use a while loop within the HTML template, I'm not sure how to do that. Code:

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved