Results 1 to 9 of 9

Thread: Remove ID from Categories - Posts

  1. #1
    Join Date
    Mar 2004
    Location
    MA
    Posts
    146

    Default Remove ID from Categories - Posts

    Using the SEF urls, how could I drop the ID from the output URL? I have NO chance of there being any duplications with the categories or the content itself. We also don't allow posting under this section, so there will be no issues there.

    Current category rewrite: /category-title-3/
    Desired category rewrite: /category-title/

    Current post rewrite: /post-title-3/
    Desired post rewrite: /post-title/

    By dropping the ID it will flow with how the rest of the site displays urls via vbseo.

  2. #2
    Join Date
    Mar 2004
    Location
    MA
    Posts
    146

    Default

    I am posting to just bump this. If anyone knows how to do this it would be appreciated. I ran some searches and found others who have asked the same thing with no absolute response on how to accomplish this. I simply don't need the ID to be shown based on the section I have created and would love to see the cleaner URL's.

  3. #3
    Join Date
    Mar 2004
    Location
    MA
    Posts
    146

    Default

    I am posting to just bump this again. I guess I will bump it every few days until someone comes along who can answer it.

  4. #4
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default

    I'm not sure how well this will work since not all category links worked for me when I tested it, but I *think* my issue might be related to something with my Apache setup. You could try looking in your forum/includes/vba_dyna_plugin_sf.php file for this code:
    PHP Code:
        $rewritecatid substr(strrchr($vbulletin->GPC['catrewrite'], '-'), 1); 
    Replace with this:
    PHP Code:
    foreach ($vbulletin->adv_dyna_cats AS $dcatid => $dcat)
    {
        if (
    $vbulletin->GPC['catrewrite'] == $dcat['surl'])
        {
            
    $rewritecatid $dcatid;
            
    $vbulletin->GPC['catid'] = $dcatid;
        }

    Then look in your forum/includes/vba_dyna_functions_savecat.php file for this line:
    PHP Code:
                $cats['surl'] = dyna_fetch_spider_url($cats['title'], $cats['catid']); 
    And replace with this:
    PHP Code:
                $cats['surl'] = preg_replace('/-{2,}/''-'str_replace(' ''-'preg_replace("/[^a-z_0-9 -]/i"''strtolower(html_entity_decode($cats['title']))))); 
    Then login to your Admin CP, edit, and save a category so the cache will be updated.
    Frequently Asked Questions
    CMPS Users Manual

    For vBadvanced software assistance, please use the support forums.
    Unsolicted PMs, IMs, and email will not be responded to.
    If you have a non-software related question or problem with your account, please submit a support ticket.

  5. #5
    Join Date
    Mar 2004
    Location
    MA
    Posts
    146

    Default

    That works fantastic Brian, thank you! Is there a similar method for removing the ID from threads? I will never have duplicates based on how this is being created.

  6. #6
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default

    I'm sure something similar would be possible, but I'm not nearly as familiar with vBulletin's rewrite system.
    Frequently Asked Questions
    CMPS Users Manual

    For vBadvanced software assistance, please use the support forums.
    Unsolicted PMs, IMs, and email will not be responded to.
    If you have a non-software related question or problem with your account, please submit a support ticket.

  7. #7
    Join Date
    Sep 2006
    Posts
    28

    Default

    What about adding the main category into the link. For instance my boards are sports and are set up like:

    Football
    --2015
    --2014
    --2013

    Basketball
    --2015
    --2014
    --2013

    With the ID removed vbdyna has a hard time knowing which one to use but if the sport was added into the link it would know.

  8. #8
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default

    I'm sure that would be possible, but would take a bit more work to setup and code properly.
    Frequently Asked Questions
    CMPS Users Manual

    For vBadvanced software assistance, please use the support forums.
    Unsolicted PMs, IMs, and email will not be responded to.
    If you have a non-software related question or problem with your account, please submit a support ticket.

  9. #9
    Join Date
    Mar 2004
    Location
    MA
    Posts
    146

    Default

    The easiest way to do what you want Andrewsimm is to simply edit the years and append them to include the category as part of their title. That will rewrite exactly as you wish for them to display.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How Do I Remove Sub Categories From Header Category..
    By g0dfather in forum "How Do I..." Questions
    Replies: 1
    Last Post: 06-21-2010, 04:17 PM
  2. How do I remove posts/attachemtns from D.dynamics?
    By nmculeague in forum "How Do I..." Questions
    Replies: 1
    Last Post: 10-08-2009, 12:28 PM
  3. Replies: 1
    Last Post: 09-07-2008, 08:25 AM
  4. Replies: 0
    Last Post: 10-11-2007, 08:18 PM
  5. Remove categories in browsecategory
    By attroll in forum Feedback & Suggestions
    Replies: 12
    Last Post: 08-17-2007, 01:39 AM

Posting Permissions

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