Jump to content

chrules

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Posts posted by chrules

  1. Thx for your reply,

    I have a working commenting feature and all, and wasn't really comparing Wordpress to a CMS, but more just giving an example of the one feature.

     

    I know how to do this with MySQL, and i use MySQL for most of my site already. Was just getting worried that it would be to database reliant.

     

    I was more thinking something in the line of having a .php document with DEFINE = true; statements in. But if MySQL is the best way, then i would just have to go with that then :P

  2. Hey, i'm working on a CMS

    What would be the best way to give a choice to allow comments on their posts/pages?

    Kindda like Wordpress, where when you create a post/page you give the user

    the opportunity to allow for comments...

    I would prefer if it was not a MySQL based solution :/

     

    In advance, thx :P

  3. Take a look at this http://www.evolt.org/node/60384

    Maybe a bit complex, but a very comprehensive system :)...

     

    But basicly, like Pikachu2000 said, you need a form to process the user login,

    then you need to send that form to a php script that checks if the user exists in database, if yes, you can proceed.

    Form.html --> checkform.php --> site.html...

     

    But that's just a very simple and not secure way. If you can, then try and play with the system in the link at the top.

  4. Hi there,

    I've been working on a way to create a new page file while adding it's path and name(alias) to a MySQL database... My problem is that some of the information, apparently, isn't being send :S...

     

    The form file

    <form name="pagecreate" method="POST" action="pagecreate.php">
    Alias:	<input type"text" name"pagealias" />
    	<input type="submit" value="submit">
    </form>

     

    And the submit function

    <?php
    // connect to database
    include '../../include/databaseconnection.php';
    
    // grab the variables from the form
    $pagealias = $_POST['pagealias'];
    
    // get the number for the page (choose max + 1, so that you don't have existing value)
    $query = "SELECT MAX(pagenumber) FROM Links"; 
    $result = mysql_query($query) or die(mysql_error());
    $row = mysql_fetch_array($result);
    $max = $row['MAX(pagenumber)'];
    $pagenumber = $max+1;
    
    // create the file
    $createFileName = "../../pages/page_".$pagenumber.".php";
    $FileHandle = fopen($createFileName, 'w+') or die("can't create file");
    fclose($FileHandle);
    
    // create filepath
    $filepath = "page_".$pagenumber;
    
    // insert the data into the database
    $query2 = "INSERT INTO Links VALUES('', '$pagealias', '$filepath', '$pagenumber')";
    mysql_query($query2) or die(mysql_error());
    
    // redirect to another page
    header("Location: ../../index.php");
    ?>

     

    Argh!, forgot to say, that it is pagealias that isn't being send ^^...

  5. Thanks for your reply. I've been trying to use curdate() but couldn't get that to work...

    Anyways, I implemented the function AND calDate>NOW() , but now it only displays the ones 3 days ahead of current time.

    Example:

     

    Todays date is the 7th

    using the NOW() statement, I can only see the ones from the 10th, and not the 9th or 8th.

    Now my question, i guess, is, how would one subtract time from the NOW() statement.

    so it'll be like "AND calDate>NOW()-(3 days)"?

  6. Hey,

    I have been coding a bit on a site where you can login, submit your schedule in the form of posts. My problem is, that the users give a date to where the post is going to happen, and i wan't to check if the given date from the post is older than the current date. If so, then hide/do not show the post.

    Like this

    POST:

    Work the 22/02-10 at 19:00 - 20:00            <---- meaning the 22nd of February 2010

    CURRENT DATE:

    24/02-10

    Then it should hide/remove the post so it isn't viewable.

     

    My php code is:

    <?php
    include "../../scripts/config.php";
    include "../include/session.php";
    global $max_items;
    
    $query = "SELECT calID, calDate, calName, calDesc," . "DATE_FORMAT(calDate, 'd/m-y') as date " . "FROM calTbl WHERE calUser='$username' ORDER BY calDate ASC";
    $result = mysql_query($query) or die(mysql_error());
    
    while ($row = mysql_fetch_assoc($result)) {
    $calID = strip_tags( $row['calID']);
    $calStamp = $row['calStamp'];
    $calDate1 = strtotime( $row['calDate']);
    $calDate = strip_tags( $row['calDate']);
    $calName = strip_tags( $row['calName']);
    $calDesc = nl2br (strip_tags ($row['calDesc'], '<a><b><i><u>'));
    
    echo "<p><b>($calID) $calName the $calDate at $calDesc</b></p>";
    echo "<p>----------------------------------------------------------------</p>";}
    
    ?>
    

     

    Any help would be appreciated, and if this post needs clarification please say so.

    In Advance, thx for any help.

  7. Hi, i have a kind of blog like feature on my site, and i store the text in a seperate .txt file. I have been searching for a way to make so that

     

    if "Button1" pressed
    $myFile = "text1.txt";
    $fh = fopen($myFile, 'r');
    $theData = fread($fh, filesize($myFile));
    fclose($fh);
    echo $theData;
    
    if "Button2" pressed
    $myFile = "text2.txt";
    $fh = fopen($myFile, 'r');
    $theData = fread($fh, filesize($myFile));
    fclose($fh);
    echo $theData;

     

    and so on.. is there any easy way to do this?

    any help appreciated :P..

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.