Page 1 of 4 123 ... LastLast
Results 1 to 10 of 38

Thread: reordering content

  1. #1
    Join Date
    Nov 2007
    Posts
    346
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default reordering content

    roddyinnovations.com/?action=resources&cat=81

    hello, I was wondering how to make that. Where the visitor is able to reorder the content posted and the content is like that in those boxes. Can anyone please help me!! Please and thank you! Also how would I be able to reorder from a star rater that I have?

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Easiest way is to use PHP/SQL mix. When an item is added you supply the SQL with name, date, star rating, whatever, in a table(s).

    Then use php to run a search on the SQL when a link is clicked. The php will tell the page (post, self) to reload with the new data. Sort by date/name/rating etc. asc or desc.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Nov 2007
    Posts
    346
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Blizzard you are a genious! Ok, now where do I start? Please and thank you!

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    After a bit of research, we can do this in pure PHP if you like.

    Read up on the php sort() functions here with particular attention to msort() and ksort().

    easier!

    Edit:
    it appears that msort is now know as array_multisort()
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  5. #5
    Join Date
    Nov 2007
    Posts
    346
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks!

  6. #6
    Join Date
    Nov 2007
    Posts
    346
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok, I have read that link and also array_multisort() and I think I get the idea, so now what?

  7. #7
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    well, now you set up your page. Forget the php for right now. make the links in regular html like click here for by date, click here for by name, etc.

    Once you have that you choose the best method of sort() and put the php code in. Then you can go back to your html links and add the php code with all the variables so it will know what to do.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  8. #8
    Join Date
    Nov 2007
    Posts
    346
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    http://www.athletes4excellence.com/sortexample.php

    I am not sure how to do the links, and also on "Ajax Help" from your amazing help, I figured out how to fix the star raters! Thanks a lot!

  9. #9
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Okay, where you have this:

    Code:
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
    
        <td>Sorth by: A to Z | Z to A | Top Rated to Least Rated | Least Rated to Top Rated </td>
      </tr>
    </table>
    Ignoring the typos and the fact you are using tables...

    Code:
    <td>Sort by: <a href="http://www.athletes4excellence.com/sortexample.php#"> A to Z</a> | <a href="http://www.athletes4excellence.com/sortexample.php#">Z to A</a> |
    etc etc..
    </td>
    That will make them basic links for now. Then you can work on the php coding for the sorting.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  10. #10
    Join Date
    Nov 2007
    Posts
    346
    Thanks
    0
    Thanked 0 Times in 0 Posts

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •