SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Addict itsource's Avatar
    Join Date
    Jun 2001
    Location
    Thailand
    Posts
    369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    about this forum

    How to disign or coding to have

    Important thread at the top of forum.
    I live in Thailand. My English grammar not well.

  2. #2
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's a vBulletin feature that is only available to Advisors and Administrators. In other forums, it is termed "Sticky".

    Sketch
    Aaron Brazell
    Technosailor



  3. #3
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It can also be termed "pinned".

    Do you want code or do you want to know how you get it pinned/sticked/important on this forum?


    Sketch answeared if you want to know how to on this forum...

  4. #4
    SitePoint Addict itsource's Avatar
    Join Date
    Jun 2001
    Location
    Thailand
    Posts
    369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I know only Administrator can set it.

    I want to know how coding it. How to design table that store topic, and run SQL to get it. Is select 2 time?
    I live in Thailand. My English grammar not well.

  5. #5
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, generally, each post is incremented (I believe) or given a Unix Timestamp. Then the posts are ordered from first to last. A sticky thread would be given a number that was prior to all others, say 0 or something and that way when the posts are ordered, the sticky thread is at the top.

    Sketch
    Aaron Brazell
    Technosailor



  6. #6
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    or you have an extra field in your database, let's call it sticky......just a boolean. if it's true (or 1) the thread is sticky, if not it's...aeh...not
    then in your select that gets all threads you "order by sticky, submitted_date_time desc" (assuming that submitted_date_time is your field with the unix timestamp)...
    job's a good'n
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  7. #7
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that's probablly a better method although it adds the overhead of an additional field...

    Sketch
    Aaron Brazell
    Technosailor



  8. #8
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how else would you do it? all you need is a TINYINT column. no big deal.

    BTW, just add `&explain=1' onto the end of any vB URL (unless it's been removed ) to see the queries on a page. do it on the forum pages here and you can see how the Stickys are done.
    - Matt ** Ignore old signature for now... **
    Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
    "Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR

  9. #9
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    doc...that's absolutely crazy ! &explain knocks my socks off (ok, so i'm easily impressed)
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  10. #10
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know, that's really weird...


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
  •