Announcement

Collapse
No announcement yet.

Sol'n for fixing duplicate templates without reinstalling board/templates database

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sol'n for fixing duplicate templates without reinstalling board/templates database

    I've come across a possible solution for those of you who have the duplicate template problem in your forum software, but are unwilling to drop the templates database so you don't lose your style sets.

    In MySQL or phpMyAdmin (whichever you use), run the following query:

    "SELECT count(templateid) from template where templateid='-1';"

    This *usually* returns between 480 and 500. If you are getting more, then you most likely have the templates problem. To find out where it starts, execute this query:

    "SELECT templateid, templatesetid, title from template where title='aim'";

    This tells you which template reference # the 'aim' templates start at (and 'aim' is usually the first template in the set.) One should return 1, -1, aim. The other should return a template id number that's considerably higher. That's where your duplicate templates start. To fix, execute this query (it would be a good idea to back your board up first):

    "DELETE from template where templateid > {the template id of the second 'aim' template above} AND templatesetid='-1';"

    Once this is done, check your admin panel -> templates -> modify. You should now notice that there are absolutely no dupes. I've done this twice so far, both with positive results. I hope this post helps some people out, who are having trouble regarding dupe templates.
    To alcohol! The cause of, and solution to, all of life's problems. -- Homer Simpson

  • #2
    Originally posted by cka
    I've come across a possible solution for those of you who have the duplicate template problem in your forum software, but are unwilling to drop the templates database so you don't lose your style sets.

    In MySQL or phpMyAdmin (whichever you use), run the following query:

    "SELECT count(templateid) from template where templateid='-1';"

    This *usually* returns between 480 and 500. If you are getting more, then you most likely have the templates problem. To find out where it starts, execute this query:

    "SELECT templateid, templatesetid, title from template where title='aim'";

    This tells you which template reference # the 'aim' templates start at (and 'aim' is usually the first template in the set.) One should return 1, -1, aim. The other should return a template id number that's considerably higher. That's where your duplicate templates start. To fix, execute this query (it would be a good idea to back your board up first):

    "DELETE from template where templateid > {the template id of the second 'aim' template above} AND templatesetid='-1';"

    Once this is done, check your admin panel -> templates -> modify. You should now notice that there are absolutely no dupes. I've done this twice so far, both with positive results. I hope this post helps some people out, who are having trouble regarding dupe templates.
    You should note delete templateid = -1 this is not a template problem but intended behaviour, thats the master template set. If you try and create any template sets it will result in an error as the master set has been deleted. They are also used for other board functions.
    Scott MacVicar

    My Blog | Twitter

    Comment


    • #3
      Originally posted by Scott MacVicar
      You should note delete templateid = -1 this is not a template problem but intended behaviour, thats the master template set. If you try and create any template sets it will result in an error as the master set has been deleted. They are also used for other board functions.
      Yeah I know, I only search duplicate templates with the id of -1 (the master set). Notice in my last query that it does a search of templates that have start at a higher ID than it usually does, and ALSO checks against the templatesetid being -1. Let's say you have 2 'aim' templates. One has a templateid of 1, a templatesetid of -1, and the title 'aim'. The next one has a templateid of 500, a templatesetid of -1, and the title 'aim'. My query tells mysql to delete everything with a -1 templatesetid and that starts at the duplicate templates (aim, templateid 500). Hope that clears up what I was trying to point across.

      Just this morning I had to do what I suggested in this thread because a vBulletin forum I admin had 3 or 4 sets of repeating templates for each regular template (eg; 4 'aim' templates.) Now it has no repeating templates, just the originals.
      To alcohol! The cause of, and solution to, all of life's problems. -- Homer Simpson

      Comment


      • #4
        Originally posted by cka
        Yeah I know, I only search duplicate templates with the id of -1 (the master set). Notice in my last query that it does a search of templates that have start at a higher ID than it usually does, and ALSO checks against the templatesetid being -1. Let's say you have 2 'aim' templates. One has a templateid of 1, a templatesetid of -1, and the title 'aim'. The next one has a templateid of 500, a templatesetid of -1, and the title 'aim'. My query tells mysql to delete everything with a -1 templatesetid and that starts at the duplicate templates (aim, templateid 500). Hope that clears up what I was trying to point across.

        Just this morning I had to do what I suggested in this thread because a vBulletin forum I admin had 3 or 4 sets of repeating templates for each regular template (eg; 4 'aim' templates.) Now it has no repeating templates, just the originals.
        this should not happen, the only time it would, would be a failed upgrade when the templates are re-written.

        Do duplicate templates show in the admin panel under every style or just certain oens?
        Scott MacVicar

        My Blog | Twitter

        Comment


        • #5
          Originally posted by Scott MacVicar
          this should not happen, the only time it would, would be a failed upgrade when the templates are re-written.

          Do duplicate templates show in the admin panel under every style or just certain oens?
          Yeah, it seems that the only time people run into this problem is when they botch an install/upgrade. The dupes do indeed show under every set of templates (the forums I was fixing have 3 or 4 different styles, each had 3 or 4 different copies of the same default templates.) It does get irritating, especially when you're trying to modify one and it just doesn't take until you edit a specific version of it.

          Sometimes stuff like this happens, and I figured out a relatively safe way of dealing with it, just thought I'd share it with everybody.
          To alcohol! The cause of, and solution to, all of life's problems. -- Homer Simpson

          Comment


          • #6
            Originally posted by cka
            Yeah, it seems that the only time people run into this problem is when they botch an install/upgrade. The dupes do indeed show under every set of templates (the forums I was fixing have 3 or 4 different styles, each had 3 or 4 different copies of the same default templates.) It does get irritating, especially when you're trying to modify one and it just doesn't take until you edit a specific version of it.

            Sometimes stuff like this happens, and I figured out a relatively safe way of dealing with it, just thought I'd share it with everybody.
            To get rid of duplicate templates in the Master template set go to Admin -> Styles -> Upload/Download and reupload the master template set in vbulletin.style. It will delete the existing templates and replace it with the contents of that file.
            Translations provided by Google.

            Wayne Luke
            The Rabid Badger - a vBulletin Cloud demonstration site.
            vBulletin 5 API - Full / Mobile
            Vote for your favorite feature requests and the bugs you want to see fixed.

            Comment

            Loading...
            Working...
            X