Page 1 of 2 1 2 LastLast
Results 1 to 15 of 17

How to get the threadid

This is a discussion on How to get the threadid within the General Discussion forums, part of the vBSEO SEO Plugin category; Hi. I was just wondering, is there a good way to get the thread id from a thread url on ...

  1. #1
    Junior Member
    Real Name
    Gaz Thomas
    Join Date
    Jun 2007
    Posts
    29
    Liked
    0 times

    How to get the threadid

    Hi.

    I was just wondering, is there a good way to get the thread id from a thread url on a non-vbulletin page? It's already connected to the vBulletin database. Since it's already in the url I could just get it from there but is there a better way that accounts for if the url layout is changed etc.?

    The reason I want it is to display the number of replies to a thread on a non-vBulletin page + when I have the threadid I can get that from the vb database.

    Thanks!

    -okgaz

  2. #2
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    Hello,

    currently there is no special function for that in vBSEO API, so you should use regular expression depending on the URL format you defined, like:
    PHP Code:
    preg_match('#^[^/]+/(\d+)#'$seo_url$matches); 
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  3. #3
    Junior Member
    Real Name
    Gaz Thomas
    Join Date
    Jun 2007
    Posts
    29
    Liked
    0 times
    Quote Originally Posted by Oleg Ignatiuk View Post
    Hello,

    currently there is no special function for that in vBSEO API, so you should use regular expression depending on the URL format you defined, like:
    PHP Code:
    preg_match('#^[^/]+/(\d+)#'$seo_url$matches); 
    Thanks. I think I have the default vbseo urls, they look like:

    Code:
    forum-category/867-thread-title.html#post4029
    Do you know the code I would need to get the threadid from that?

    Thanks.

  4. #4
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    An example I have provided should work for default vBSEO URLs.
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  5. #5
    Senior Member
    Join Date
    Oct 2005
    Posts
    131
    Liked
    0 times
    Sorry to ressurrect an older thread but I have a recently installed mod - Force Users to Read a Thread - vBulletin.org Forum - that I require a thread ID for. Could someone please walk me thru this process?

  6. #6
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    What exactly do you need - to extract thread ID from SEOed URL in PHP code? You can use the code posted above: How to get the threadid
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  7. #7
    Senior Member
    Join Date
    Oct 2005
    Posts
    131
    Liked
    0 times
    Thanks Oleg, yes that is what I need. The original (non vbseo) thread ID. I don't want to sound thick :P but I don't know what to do with that code above....

  8. #8
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    Do you need to find thread ID from one single thread URL or you want to implement atuomatic thread ID retrieval in vB modification?
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  9. #9
    Senior Member
    Join Date
    Oct 2005
    Posts
    131
    Liked
    0 times
    Just one each month please.

  10. #10
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    The thread ID is included in SEOed URL and you can "guess" it (if that is what you need), for instance for forum-category/867-thread-title.html URL the thread ID is 867.
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  11. #11
    Senior Member
    Join Date
    Oct 2005
    Posts
    131
    Liked
    0 times
    Thank you Oleg, that was the information I needed.

  12. #12
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    You are welcome!
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  13. #13
    Junior Member
    Real Name
    Daniel Martin
    Join Date
    Sep 2006
    Location
    Venezuela
    Posts
    18
    Liked
    0 times
    Hi guys,

    But if for example the thread it's an annoucement, how I can get the thread id:

    for example this one:
    http://www.website.com/galer-de-adul...uncements.html

    I don't see anything on that URL that help me out :(

  14. #14
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    That link corresponds to "All announcements" page, i.e. "domain.com/announcement.php" (not individual announcement that has URL like "domain.com/announcement.php?a=X").
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  15. #15
    Junior Member
    Real Name
    Daniel Martin
    Join Date
    Sep 2006
    Location
    Venezuela
    Posts
    18
    Liked
    0 times
    Well,

    If I copy the link from the form, that's the URL that I get.

    But from the admincp, when I try to edit I get:
    http://www.website.dot/admincp/annou...p?do=edit&a=25

    But If I enter 25 as thread id I get the thread 25, witch it's not the annoucement that I want.

    Any idea?

    Would be great to have a function in vbseo admin to place the URL and get the thread id for things like this one.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Subdreamer and VBSEO
    By mljask in forum General Discussion
    Replies: 38
    Last Post: 03-12-2009, 07:20 AM
  2. Replies: 2
    Last Post: 02-05-2007, 03:27 PM
  3. Threadid questions
    By soletrader in forum General Discussion
    Replies: 2
    Last Post: 10-26-2006, 12:21 PM

Posting Permissions

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