Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Feb 2008
    Posts
    24
    Member #
    16485
    i have a feeling this is the start of a long journey to implement this. However....

    how is it possible to put tags into a webpage when you make a simple text post?

    I think it is our duty to design smart - and not to succumb to templates, open-cms, joomla etc.

    Any ideas?

    Ben

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,693
    Member #
    5580
    Liked
    717 times
    Using PHP includes?

    The text posts append onto a simple text file, and the PHP scripting
    displays that text file on the page. The script that does the text post
    changes the user's input into a link. It could be your own simple CMS
    system ... not using any database, joomla, or anything else ...very simple.


  4. #3
    Junior Member
    Join Date
    Feb 2008
    Posts
    24
    Member #
    16485
    thanks for replying mlseim...

    here's my case
    .
    i have a div and in that div i have a iframe that is referencing another html file....the file is just for adding some 'news' in basic format (text, really) but it is like that so we don't have to keep updating the main html (similar to that php-psuedo cms think your talking about.

    however after each of the posts it would be great to have a tagging system to reference what we are talking about - a lot like blogger style - without succumbing to standardised formats......or php

    do you have any ideas on where to start

    much appreciated.

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,693
    Member #
    5580
    Liked
    717 times
    I guess I would have to see an example page that you have now,
    with tags and the iframe thing. I don't quite see it my mind.


  6. #5
    Junior Member
    Join Date
    Feb 2008
    Posts
    24
    Member #
    16485
    ok...

    here goes...

    this is the primary html page

    very basic

    -------------------------------------

    HTML Code:
    <html>
    <head>
    
    <body>
    
    
        <!-- BLOG -->
           <div class="blog">
           <strong>Blog</strong>
           <iframe src="05_blog/blog.html" height="100%" width="100%"; frameborder="0"></iframe>  
           </div>
    
    
    </body>
    
    </html>
    --------------------------------------------
    this is the referenced iframe html file
    --------------------------------------------

    HTML Code:
    <div style= "font-family:courier; font-size:14px; border-width: 0px; text-align:justify;">
        
    <strong>13.01.07</strong><br>
    this is blog post number one. <a href="http://www.google.com" target="_blank">GOOGLE LINK TEST</a>.
    <br>
    <strong>27.01.07</strong><br>
    this is blog post number two.
    
    <div>

    so we just have to update the blog.html file if we wanted to add news......

    what do you think??!?!

    did i explain this well enough

    ben

  7. #6
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,693
    Member #
    5580
    Liked
    717 times
    Below is the most simple CMS you can do.

    No security or anything ... just basic ...

    Call the script: "edit.php" ...
    PHP Code:
    <?php

    $action
    =$_POST['action'];
    $textarea=$_POST['textarea'];
    $url=$_GET['url'];

    // Where to return when done.
    $return="index.php";

    // This is the default page
    $url "05_blog/blog.html";

    // Get page you want to edit
    if($_GET['url']){
    $url=$_GET['url'];
    }
    $data implode(""file($url)); 

    if(
    $action=="save"){
    $newtext=stripslashes($textarea);
    $newtext str_replace("<?"""$newtext);
    $newtext str_replace("?>"""$newtext);
    $newtext nl2br($newtext);
    $fh fopen($url'w') or die("can't open file");
    fwrite($fh$newtext);
    fclose($fh); 
    header ("location: edit.php?url=$url");
    }
    else{
    echo
    "
    <html>
    <head><title>Text Editor</title>
    <style>
    body,html{
    margin:0px auto;
    width:700px;
    text-align:center;
    }
    #content{
    margin:0px auto;
    width:700px;
    }
    </style>
    <body>
    <div id='content'>
    "
    ;

    $ta=br2nl($data);

    echo
    "
    <a href='
    $return'><-- Return to Page</a><br /><br />
    Make Changes and click \"Save Changes\" at the very bottom ...<br />
    <form action='edit.php' method='post'>
    <input type='hidden' name='action' value='save'>
    <input type='hidden' name='p' value='
    $page'>
    <input type='hidden' name='n' value='
    $n'>
    <textarea name='textarea' rows='25' cols='80'>
    $ta</textarea>
    <br />
    <input type='submit' name='submit' value='Save Changes'>
    </form>
    </div>
    </body>
    </html>
    "
    ;
    }

    function 
    br2nl($str) {
    return 
    preg_replace('=<br */?>=i'""$str);
    }

    ?>
    Your blog.html file is not an html file, but a plain text file called "blog.html",
    or something like that. You can use HTML in the file, but it's only text.

    You then use your iframe like:
    <iframe src="05_blog/blog.html" height="100%" width="100%"; frameborder="0"></iframe>

    Better yet, you should use PHP include instead of an iframe ...

    <div>
    <?php include("05_blog/blog.html")?>
    </div>

    Then, you can style that <div> any way you want.

    The file extension could be anything ... blog.dat, blog.txt, blog.html

    If you type: edit.php?url=05_blog/blog.html
    it will open it, or any other url you specify.

    If you don't specify, it will open a default page.


  8. #7
    Junior Member
    Join Date
    Feb 2008
    Posts
    24
    Member #
    16485
    wow,,,

    ok i am going to try and implement this system....because my page is alot more complicated than the one i specified.....

    i will contact back tomorrow.

    hopefully then i can implement a tagging system from there!

    many thanks
    ben

    palacepalace.com

  9. #8
    Junior Member
    Join Date
    Feb 2008
    Posts
    24
    Member #
    16485
    mlseim,

    so do i need to convert my webpage over to php from html..

    or just leave it. and put in...

    <div>
    <?php include("05_blog/blog.html")?>
    </div>

    ben

  10. #9
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,693
    Member #
    5580
    Liked
    717 times
    Quote Originally Posted by benreynolds4
    mlseim,

    so do i need to convert my webpage over to php from html..

    or just leave it. and put in...

    <div>
    <?php include("05_blog/blog.html")?>
    </div>

    ben
    It's easiest to change the extension from .html to .php,
    but you could also use .htaccess to tell the server to process all .html and .htm as PHP.
    That's a little bit more advanced. If interested in that, search Google for: .htaccess HTML to PHP

    You'll discover that you will be doing all of your pages with PHP in them somewhere.
    PHP allows your pages to be dynamic, with content control, image control, etc.



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 07:00 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com