Tagged: , , , ,

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #4480

    Hi, Kriesi,

    Thanks for a great theme! I downloaded and deployed it with no problem. Now, I’m customizing it and I was wondering about the blog section. So, I want to create a while loop to pull blog entries from a database, and I was wondering about pagination, because it looks like the Blog page limits it to 2 entries per page. Is that an automatic function or do I have to do something to create more tabs at the bottom where it says 1, 2, 3, 4, 5, etc.

    I’m really excited about using this theme. I’ve been looking forward to it for months! Way to go, Kriesi!

    #46500

    Hey,

    The number of posts appearing on a blog page is controlled through WP Admin, you can find the option under Settings > Reading and change the number from the default of 10 to a number of your choosing. By the sounds of it, yours is set to 2.

    Please post the site URL if you need further help.

    James

    #46501

    Thanks, James for the quick response. I didn’t get an email, and so I figured I’d check the site to see if there were any responses. I’m not using WP for this, I’m just customizing the html and php to suit my needs. But I figured out how to do it manually, so thanks for your help.

    One other thing, though, I guess I have to do the same for the comments as well, then, eh? Customize the function to also include a mysql update whenever someone submits a comment and then loop through them to display them on the page.

    This is such a great theme, I’m really impressed with it. Thanks for everything!

    #46502

    Hey,

    yes – if you build your website with a custom php framework you need to write everything from scratch or you can use functions which are provided by the framework (i.e. cake, codigniter, etc.).

    #46503

    Interestingly enough, I got everything to work, except the comments section. I’m forwarding the link to my blog page:

    http://www.artispot.com/main/blog.php

    If you click on any of the blog entries, it’ll take you to the post page, where I’m having an issue.

    As you can see, validation works just fine. However, when I try to submit a new post, the button disappears and nothing happens.

    I’m posting some code so you can see how I’m trying to acheive it. Form code first. I’ve altered the original to allow ajax:

    <form id="commentform" method="post" action="" class="ajax_form">

    <div class="personal_data"><?php if (!isset($errorC) || $errorC == true){ ?>

    <p class="<?php if (isset($the_nameclass)) echo $the_nameclass; ?>" ><label for="author"><small>Name (required)</small></label><input type="text" tabindex="1" size="22" value='<?php if (isset($the_name)) { echo $the_name; } else { echo "Name"; } ?>' id="author" class="text_input is_name" name="author"/>

    </p>

    <p class="<?php if (isset($the_emailclass)) echo $the_emailclass; ?>"><label for="email"><small>Mail (will not be published) (required)</small></label><input type="text" tabindex="2" size="22" value='<?php if (isset($the_email)) { echo $the_email; } else { echo "Email"; } ?>' id="email" class="text_input is_email" name="email"/>

    </p>

    <p><label for="url"><small>Website</small></label><input type="text" tabindex="3" size="22"value="<?php if (isset($the_website)) { echo $the_website; } else { echo "Website URL"; }?>" id="url" class="text_input" name="url"/>

    </p>

    </div>

    <div class="message_data">

    <p class="<?php if (isset($the_messageclass)) echo $the_messageclass; ?>"><textarea style="width: 589px !important" tabindex="4" class="text_area is_empty" rows="10" cols="100%" id="comment" name="comment"><?php if (isset($the_message)) echo $the_message ?></textarea></p>

    </div>

    <input type="hidden" id="postID" name="postID" value="<?php echo $postID; ?>" />

    <p><input type="submit" value="Submit" tabindex="5" id="submit" class="button" name="submit"/>

    <?php } else { ?>

    <?php } ?>

    </p>

    </form>

    Now for the actual submission code. I’ve just re-used the Contact.php code and changed some things:

    if(isset($_POST) || isset($_POST)){

    $errorC = false;

    $postID = $_POST;

    $the_name = $_POST;

    $the_email = $_POST;

    date_default_timezone_set('America/New_York');

    $time = time();

    function makeClickableWebsite($the_website) {

    $the_website = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_+.~#?&//=]+)',

    '\1', $the_website);

    $the_website = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_+.~#?&//=]+)',

    '\1\2', $the_website);

    $the_website = eregi_replace('([_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3})',

    '\1', $the_website);

    return $the_website;

    }

    $the_website = makeClickableWebsite(stripslashes($_POST));

    function makeClickableLinks($the_message) {

    $the_message = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_+.~#?&//=]+)',

    '\1', $the_message);

    $the_message = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_+.~#?&//=]+)',

    '\1\2', $the_message);

    $the_message = eregi_replace('([_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3})',

    '\1', $the_message);

    return $the_message;

    }

    $the_message = makeClickableLinks(str_replace(array("\r\n", "\r", "\n"), "
    ", stripslashes($_POST)));

    if(!checkmymail($the_email))

    {

    $errorC = true;

    $the_emailclass = "error";

    }else{

    $the_emailclass = "valid";

    }

    if($the_name == "" || $the_name == "Name")

    {

    $errorC = true;

    $the_nameclass = "error";

    }else{

    $the_nameclass = "valid";

    }

    if($the_message == "")

    {

    $errorC = true;

    $the_messageclass = "error";

    }else{

    $the_messageclass = "valid";

    }

    if($errorC == false)

    {

    $newcomment = mysql_query("INSERT into $table24 (postID, commentDate, author, email, website, comment) VALUES ('$postID', '$time', '$the_name', '$the_email', '$the_website', '$message')") or die (mysql_error());

    if(isset($_POST)){

    echo"<p>Thank you for your comment!</p>";

    }

    getcount($table24, $postID);

    getcomments($table24, $postID);

    }

    }

    function checkmymail($the_email){

    $email_flag=preg_match("!^w[w|.|-]+@w[w|.|-]+.[a-zA-Z]{2,4}$!",$the_email);

    return $email_flag;

    }

    I’m calling in the script using this code:

    if(isset($_POST))

    {

    include('../phpf/submitcomment.php');

    }

    Same as on the contact page. Calling in the script once the form is set. Can you help?

    #46504

    Okay, I realized that the problem was that the ajax function I’m calling isn’t made to work with the comments section. After opening up custom.js, I see it’s strictly for the contact page. I’m seeing if I can tweak some things now, but any pointers?

    #46505

    Okay, I got the form to submit, now I just need it to refresh the page and reset the form to its default settings.

    I just realized I’m supporting myself on this one! LOL.

    #46506

    Hey,

    Glad you got this figured out, let us know if you have any other questions.

    James

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘ELEMENTIA 4 IN 1 – Blog Entries’ is closed to new replies.