ohdang888 Posted December 24, 2007 Share Posted December 24, 2007 hey. i am a template and the entire site follows it. i'm wondering is it possible to create a page on my site (only i have access to it), that would have textareas, i could plug the unique info or code into it, specify the name of the folder and index.php to be created, and click go and it would create the page ?????????? Quote Link to comment https://forums.phpfreaks.com/topic/83005-creating-pages-really-fast/ Share on other sites More sharing options...
trq Posted December 24, 2007 Share Posted December 24, 2007 What? You are a template? Quote Link to comment https://forums.phpfreaks.com/topic/83005-creating-pages-really-fast/#findComment-422176 Share on other sites More sharing options...
ohdang888 Posted December 24, 2007 Author Share Posted December 24, 2007 i have a template. i want to create a code ( i know its gonna be more complicated then this but heres the jist of it...) textarea 1 textarea 2 textarea 3 textarea 4 name of new folder it would use the template and put the info i put into those text area and put them in the specified location of textarea 1, etc... create the new folder, open it, and save the new file as "index.php" i know huge sites like youtube and aol use this, i just don;t know how. Quote Link to comment https://forums.phpfreaks.com/topic/83005-creating-pages-really-fast/#findComment-422180 Share on other sites More sharing options...
trq Posted December 24, 2007 Share Posted December 24, 2007 i know huge sites like youtube and aol use this, Huge sites like youtube and aol use dynamic logic and store there data in a database rather than hardcoded into files. Quote Link to comment https://forums.phpfreaks.com/topic/83005-creating-pages-really-fast/#findComment-422184 Share on other sites More sharing options...
ohdang888 Posted December 24, 2007 Author Share Posted December 24, 2007 oh. lol. well is what i'm talking about possible? Quote Link to comment https://forums.phpfreaks.com/topic/83005-creating-pages-really-fast/#findComment-422189 Share on other sites More sharing options...
CMC Posted December 24, 2007 Share Posted December 24, 2007 Yes it's quite possible. Look into PHP's fopen & fwrite functions. Quote Link to comment https://forums.phpfreaks.com/topic/83005-creating-pages-really-fast/#findComment-422215 Share on other sites More sharing options...
cooldude832 Posted December 24, 2007 Share Posted December 24, 2007 What? You are a template? I took a laugh at this Quote Link to comment https://forums.phpfreaks.com/topic/83005-creating-pages-really-fast/#findComment-422218 Share on other sites More sharing options...
cooldude832 Posted December 24, 2007 Share Posted December 24, 2007 Now that I'm done laughing, I will talk to the template. You have a template so what you wanna do is user php to display those template files on each page somethign like <?php include("template_top.php"); //Some content here include("template_bottom.php"); ?> How you generate that //Some content here is up to you, database, hardcode files, included file, etc Quote Link to comment https://forums.phpfreaks.com/topic/83005-creating-pages-really-fast/#findComment-422220 Share on other sites More sharing options...
tibberous Posted December 24, 2007 Share Posted December 24, 2007 Yes it's possible, my new site does it, I spent two weeks writing it. You create a new folder, and then you can use the file manager to edit the files. The editor automatically adds the paragraph tags and the alt tag to images. It supports a tag called blurb, which creates a new file with the blurb text inside it, while still leaving the text as part of the first document. It also supports <blurb strip='true'>, which removes the text from the document. It also supports a video tag, which takes an flv file as a source parameter and writes out all the code to embed my flv player, with that video as a parameter. The image and video tags can be inserted with dialogs in the editor. The site is templated, but all the code is kept out of the templates. The most complex page is: <h1 style='text-align: right; margin-bottom: 5px'><?php echo $game['name']; ?></h1> <div style='text-align: right; margin-bottom: 25px'><?php echo date('F j, Y', ($game['reviewdate']+1)*86400); ?></div> <div style='text-align: left; margin-bottom: 25px'>Publisher: <a href='<?php echo $game['publisherwebsite']; ?>'><?php echo $game['publisher']; ?></a></div> <div style='text-align: left; float: left; width: 100px'>Graphics:</div><?php echo $game['graphics']; ?><br clear='all'> <div style='text-align: left; float: left; width: 100px'>Sound:</div><?php echo $game['sound']; ?><br clear='all'> <div style='text-align: left; float: left; width: 100px'>Stability:</div><?php echo $game['stability']; ?><br clear='all'> <div style='text-align: left; float: left; width: 100px'>Overall:</div><?php echo $game['overall']; ?><br clear='all'> <?php include ($game['folder'].'review.php'); ?> <div style='text-align: center; margin-bottom: 25px'><a href='<?php echo $game['swf']; ?>' target='_blank'>Play</a></div> And all the URL's are rewritten with mod_rewrite. You might want to look into Joomla. Quote Link to comment https://forums.phpfreaks.com/topic/83005-creating-pages-really-fast/#findComment-422231 Share on other sites More sharing options...
Northern Flame Posted December 24, 2007 Share Posted December 24, 2007 I think what he wants to do is create a CMS, you will need to use a mysql database to do what you want to do.... or, heres what I have done before on some websites i have worked on before. (its similar to what cooldude832 posted) first, create a file containing your template and simply put this line of code where you want your page content to appear: <?php pageContent(); ?> now for each page, insert this code <?php function pageContent(){ ?> <p>This is my website. Blah blah blah....</p> <?php } include("template.php"); ?> insert your page content where it says <p>This is my website. Blah blah blah....</p> Quote Link to comment https://forums.phpfreaks.com/topic/83005-creating-pages-really-fast/#findComment-422233 Share on other sites More sharing options...
Northern Flame Posted December 24, 2007 Share Posted December 24, 2007 What? You are a template? LOL i was thinking the same thing when I first read his post Quote Link to comment https://forums.phpfreaks.com/topic/83005-creating-pages-really-fast/#findComment-422237 Share on other sites More sharing options...
ohdang888 Posted December 24, 2007 Author Share Posted December 24, 2007 but if i cchange permissions, won't mine work? Quote Link to comment https://forums.phpfreaks.com/topic/83005-creating-pages-really-fast/#findComment-422407 Share on other sites More sharing options...
Northern Flame Posted December 24, 2007 Share Posted December 24, 2007 what do you mean? Quote Link to comment https://forums.phpfreaks.com/topic/83005-creating-pages-really-fast/#findComment-422595 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.