How do I add a phrase type via the acp

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zsdave
    Member
    • Feb 2004
    • 37
    • 3.0.0 Release Candidate 4

    How do I add a phrase type via the acp

    How can I add a phrase type? I know I can use queries to do it. But there is talk about 'adding a phrase group' in the admin help... Does anyone know where to add a phrase group? - yes debug mode is on :P

    Thanks
    Last edited by zsdave; Sat 25 Feb '06, 7:56am.
    www.p3tz.com
    Virtual Pets
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    There is no front-end for adding phrase categories. You will have to do it manually.

    Comment

    • FractalizeR
      Member
      • Oct 2005
      • 82
      • 3.8.x

      #3
      And how to do it manually? Is that enough to just add an entry to a phrase_type table?

      Comment

      • dfidler
        Member
        • Apr 2008
        • 64
        • 3.6.x

        #4
        Originally posted by FractalizeR
        And how to do it manually? Is that enough to just add an entry to a phrase_type table?

        Not quite, but close. I just had the same requirement and so started digging into this. You seem to have to insert some data and change the schema per the following:

        Code:
        insert into vb_phrasetype (fieldname,title,editrows,special) values ('pplreg','People Registration',3,0);
        
        alter table vb_language add (phrasegroup_pplreg mediumtext default null);
        vb_phrasetype:
        * fieldname - can't have spaces or other punctuation in it as it's used later to create a new column in table vb_language.
        * title - the title of the phrase type/group that appears in the drop down list in the phrase manager
        * editrows - no idea what this does; I chose 3 because that's the value for 'GLOBAL'
        * product - I left this blank because I'm not building a "product" per se
        * special - seems to allow {0,1}; no idea what it does so I chose 0 (again, same as GLOBAL).

        vb_language:

        You have to add the column phrasegroup_<fieldname> where fieldname is the fieldname that you specified above.

        In my example, I used varname 'pplreg' for the fieldname of the phrasetype and so created the subsequent column vb_language.phrasegroup_pplreg.

        It looks like the phrasegroup_<fieldname> column is a cache of all of the different phrases for that language, but I didn't spend long enough to actually figure out if that is true or not.

        Cheers,
        Dave.

        PS - Wait till you see what my second post is gonna be.

        Note: this is on vB 3.7
        Last edited by dfidler; Fri 6 Jun '08, 10:55am.

        Comment

        • dfidler
          Member
          • Apr 2008
          • 64
          • 3.6.x

          #5
          Oh, I think I get it... vb_language.phrasegroup_<fieldname> is what gets loaded from the db with the $phrasegroups = array [...] when you define them in your page code.

          So, having said that, I'd like to request acp capability to add/remove custom phrase types/groups.

          If someone saves all of their phrase under 'GLOBAL' then that means that they're going to have to load all of the global phrases into mem just to get their custom phrases. That seems painful on memory.

          It would be better if we could create new phrase types/groups for our custom code.

          Comment

          • FractalizeR
            Member
            • Oct 2005
            • 82
            • 3.8.x

            #6
            dfidler
            The same can be achieved with calling function add_phrase_type($phrasegroup_name, $phrasegroup_title, $productid = 'vbulletin') from includes/adminfunctions_language.php

            Comment

            • dfidler
              Member
              • Apr 2008
              • 64
              • 3.6.x

              #7
              FractalizeR,

              That's awesome, thanks mate.

              It's funny though; this question has been asked and re-asked (and re-asked) since about 2004 and none of the threads that I could find (guess I missed one) had an answer or a link to one. I was wondering how that was possible for something that should be so fundamental.

              Anyways, armed with your answer, I found (http://www.vbulletin.com/forum/showt...dd_phrase_type) which mentions add_phrase_type offhandedly, like everyone should already know it... except that it's the only mention of this function in the boards (other than this thread, now).

              As a suggestion for the future, and I know that people generally do this but, could we please put the answers (or links to them) that we find in our own threads so that we document this stuff? It makes searching for knowledge a lot less arduous.

              Comment

              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
              Working...