vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Phrase Type Manager (https://vborg.vbsupport.ru/showthread.php?t=98316)

Andreas 10-12-2005 10:00 PM

Phrase Type Manager
 
Phrase Type Manager

Description
This Hack allows you to easily manage custom phrase types.

Details
1 Product XML (12 Phrases)
1 ACP Script
1 ACP Navigation XML

Note: As this Hack is meant for developers, it can only be used in debug mode!

Credits to Hoffi for PhraseGroupManager, which inspired this Hack :)

d3adlythegame 10-13-2005 02:45 PM

first to reply w00t, thanx :-)

Cyricx 10-13-2005 03:44 PM

Nice one!!

Lizard King 10-13-2005 03:54 PM

I cannot get the Phrase Type Manager in admincp .
Even searched and saved a phrase it is over there.

Andreas 10-13-2005 04:36 PM

Quote:

Originally Posted by Lizard King
I cannot get the Phrase Type Manager in admincp .

This is working as designed :)

Feckie (Roger) 10-13-2005 04:52 PM

Quote:

Originally Posted by Lizard King
I cannot get the Phrase Type Manager in admincp .
Even searched and saved a phrase it is over there.

Samo Here nuttin

JJR512 10-13-2005 04:53 PM

If you create a custom phrase group as part of a custom product, does it get exported along with that product? Am I correct in assuming that I can create a product, create a custom phrase type as part of that product, create phrases as part of that product and in that custom phrase type, and export the product, and the product will contain all of that, and when someone else installs the product, even if they don't have your hack, they will get the new phrase group and all the new phrases will be in that group?

JJR512 10-13-2005 04:56 PM

Also, if I do create a custom phrase group, should that group then be defined in a custom script (custom PHP file) in the beginning like this:
Code:

$phrasegroups = array('customgroup1' , 'customgroup2');

Revan 10-13-2005 04:59 PM

JJR512, that is part of the point of this hack :)

This be cool $h1t :D
[high]* Revan clicks install[/high]

Andreas 10-13-2005 05:07 PM

@JR512
Just icnlude the varname in array $phrasegroups, just as you would do with any other phrasegroup too.

If you export a product, product management will take care of everything; the user does not need this hack - it's just to make developers life easier :)

Andreas 10-13-2005 05:08 PM

Quote:

Originally Posted by Feckie (Roger)
Samo Here nuttin

As said, this is working as designed :)
It's a developers tool and therefore will not show up for endusers, as pointed out in the first post.

EvilHawk 10-13-2005 05:11 PM

Quote:

Originally Posted by Lizard King
I cannot get the Phrase Type Manager in admincp .
Even searched and saved a phrase it is over there.

->
Quote:

it can only be used in debug mode!
;)

EvilHawk clicks install!

uae 10-14-2005 02:29 PM

Thank you Kirby

Clicked installed :)

JJR512 10-14-2005 02:56 PM

How do you enter debug mode and how do you confirm it's on?

I asked this question at vbulletin.com (http://www.vbulletin.com/forum/showthread.php?t=153385) and was told by Steve Machol (a vB developer) that all I have to do is put
Code:

$debug = 1;
anywhere in the config.php file (between the opening and closing PHP tags, of course). I was also told that I would know when it's on.

Well, I put that statement in the config.php of my test board and uploaded it. I looked at the board's front end, seemed normal. I looked at the admin cp, seemed normal. So far, it's not obvious that debug mode is on, although Steve implied it would be.

I tried installing this hack on my test board. It doesn't show up in the admincp. Now apparently it should show up in the admincp if debug mode is on, and it should also be obvious that it's on, but nothing seems different to me. So I figure I must be doing something wrong, and debug mode is not on. What's my problem?

Andreas 10-14-2005 03:01 PM

$debug =1 is for vBulletin 3.0
For vBulletin 3.5 take a look here:
https://vborg.vbsupport.ru/showthread.php?t=82835

JJR512 10-14-2005 03:14 PM

Yeah, I found that, I should have searched here first before asking. :o

Anyway, I fixed it and now have access to your hack. Thanks! :)

One suggestion/question: Is it possible you could make it so that after I create a new Phrase Type and have it tied to a particular Product, that when I go through Phrase Manager, select my custom phrase type from the drop-down box, and click the Add New Phrase button, that on the next Add New Phrase screen, the same product that the Phrase Type is associated with when it was created also is pre-selected in the Product field on this Add New Phrase screen? It's pre-set to vBulletin, and to my thinking, it seems likely that if you create a new Phrase Type, any phrases you create for it would be part of the same Product that the Phrase Type was created for.

Andreas 10-14-2005 03:30 PM

This is not easily possible without file edits, furtheremore you can add phrases that belog to different products into one phrasegroup

JoergZ 10-15-2005 01:03 PM

Very nice, now you don't have to do the necessry steps for new phrase-groups manually. But...

I have an own phrase-group for my induvidual modifications. In vB 3.0 I added in the init.php at the end these 3 lines

PHP Code:

  $phrasegroups array_merge(array(
   
'mygroup'
  
), $phrasegroups); 

so I have my phrases everywhere available, same as the standard GLOBAL-phrases.

In vB 3.5 this is not working anymore.

Which PHP I have to modify, to get my individual phrase-group loaded gloabal, so I can use the phrases everywhere ?

Thanks for help.

BR

J?rg

Andreas 10-15-2005 10:50 PM

@JoergZ
Hook init_startup can be used to load phrasegroups

@Rabbitoh Warren
It is intended behaviour that it does not show up if you don't need it!
If you are a developer and need it it will show up.

Hoffi 11-08-2005 07:44 PM

Ah... Great. Thaks.

akanevsky 12-02-2005 03:53 PM

Does the product manager export the phrase types?

Andreas 12-02-2005 04:16 PM

Sure.

akanevsky 12-02-2005 04:23 PM

Uhh... But your hack doesn't seem to be adding anything into the product manager. So if custom phrases are not a default functionality, why would the product manager be exporting them?

Andreas 12-02-2005 04:29 PM

They are a default functionality, there is just no nice GUI for it - which this Hack does add.
=> adminfunctions_language.php, add_phrase_type()

akanevsky 12-02-2005 04:35 PM

So will this hack be present in the next vbulletin release? :)

Hoffi 08-08-2006 01:37 PM

It is not in 3.6, and I think this will not work in 3.6 because the structure of the Table is changed.

See who ist first to build a 3.6 Version. Andreas or myself. ;)

Ahriman 08-28-2006 08:55 AM

Anything new here? ;)

sabret00the 03-25-2007 01:23 PM

To get this to work in 3.6.x find:
PHP Code:

if ($_REQUEST['do']  == 'listgroups')
{
    
print_form_header('phrasetype''add');
    
print_table_header($vbphrase['custom_phrase_types']); 

and replace with:
PHP Code:

if ($_REQUEST['do']  == 'listgroups')
{
    
print_form_header('phrasetype''add');
    
print_table_header($vbphrase['custom_phrase_types']);

    
$defaultphrasetypes = array('accessmask''attachment_image''banning''bbcode''calendar''cpglobal''cphelptext''cphome''cpoption''cppermission''cprank''cprofilefield''cpstopmsg''cpuser''cpusergroup''cron''diagnostic''emailbody''emailsubject''error''faqtext''faqtitle''forum''forumdisplay''fronthelp''frontredirect''global''help_faq''holiday''infraction''infractionlevel''inlinemod''language''logging''maintenance''messaging''moderator''plugins''pm''poll''postbit''posting''profilefield''promotion''register''reputation''reputationlevel''search''showthread''sql''stats''style''subscription''thread''threadmanage''timezone''user''vbsettings''wol');

    
$phrasetypes fetch_phrasetypes_array();
    foreach(
$phrasetypes AS $id => $type)
    {
        
$cell = array();
        
//if ($id > 56 AND $id < 1000)
        
if (!in_array($id$defaultphrasetypes)) 
        { 


sabret00the 03-25-2007 01:30 PM

find:
PHP Code:

if ($_REQUEST['do'] == 'edit'
{
    
$vbulletin->input->clean_gpc('r''phrasetypeid'TYPE_INT);
    
$phrasetype $db->query_first("SELECT * FROM " TABLE_PREFIX "phrasetype WHERE phrasetypeid = " $vbulletin->GPC['phrasetypeid']);
    
print_form_header('phrasetype''update');
    
construct_hidden_code('phrasetypeid'$phrasetype['phrasetypeid']);
    
print_table_header($vbphrase['edit_phrase_type']);
    
print_label_row($vbphrase['varname'], $phrasetype['fieldname']);
    
print_input_row($vbphrase['phrase_type'], 'groupname'$phrasetype['title']);
    
$products fetch_product_list();
    
print_label_row($vbphrase['product'], $products["$phrasetype[product]"]);
    
print_submit_row($vbphrase['save']);


replace:
PHP Code:

if ($_REQUEST['do'] == 'edit'
{
    
$vbulletin->input->clean_gpc('r''phrasetypeid'TYPE_STR);
    
$phrasetype $db->query_first("SELECT * FROM " TABLE_PREFIX "phrasetype WHERE fieldname = '" $db->escape_string($vbulletin->GPC['phrasetypeid']) . "'");
    
print_form_header('phrasetype''update');
    
construct_hidden_code('phrasetypeid'$phrasetype['phrasetypeid']);
    
print_table_header($vbphrase['edit_phrase_type']);
    
print_label_row($vbphrase['varname'], $phrasetype['fieldname']);
    
print_input_row($vbphrase['phrase_type'], 'groupname'$phrasetype['title']);
    
$products fetch_product_list();
    
print_label_row($vbphrase['product'], $products["$phrasetype[product]"]);
    
print_submit_row($vbphrase['save']);



TheRed 04-19-2007 09:09 PM

Thanks Andreas, sabret00the.

Correct implementation would be:

PHP Code:

if ($_REQUEST['do']  == 'listgroups')
{
    
print_form_header('phrasetype''add');
    
print_table_header($vbphrase['custom_phrase_types']);

    
$defaultphrasetypes = array('accessmask''attachment_image''banning''bbcode''calendar''cpglobal''cphelptext''cphome''cpoption''cppermission''cprank''cprofilefield''cpstopmsg''cpuser''cpusergroup''cron''diagnostic''emailbody''emailsubject''error''faqtext''faqtitle''forum''forumdisplay''fronthelp''frontredirect''global''help_faq''holiday''infraction''infractionlevel''inlinemod''language''logging''maintenance''messaging''moderator''plugins''pm''poll''postbit''posting''profilefield''promotion''register''reputation''reputationlevel''search''showthread''sql''stats''style''subscription''thread''threadmanage''timezone''user''vbsettings''wol');

    
$phrasetypes fetch_phrasetypes_array();
    foreach(
$phrasetypes AS $id => $type)
    {
        
$cell = array();
        
//if ($id > 56 AND $id < 1000)
        
if (!in_array($id$defaultphrasetypes)) 
        {
            
$cell[] = $type['title'];
            
$cell[] = construct_link_code($vbphrase['edit'], 'phrasetype.php?' $vbulletin->session->vars['sessionurl'] . "do=edit&amp;phrasetypeid=$id")." ".construct_link_code($vbphrase['delete'], 'phrasetype.php?' $vbulletin->session->vars['sessionurl'] . "do=delete&amp;phrasetypeid=$id");
        }
        
print_cells_row($cell);
    }
    
print_submit_row($vbphrase['add_new_phrase_type']);
    
print_table_footer();



ART 05-07-2007 01:16 PM

Thanks, with the little patches posted above, installed smoothly on vb365, works very well. Before installing I directly made changes to the db, now this task is a lot faster.

mokujin 02-04-2009 07:03 PM

Any version for vb 3.8?

Link14716 07-28-2009 06:57 AM

For 3.8, do the edits above, but after this:
PHP Code:

'timezone''user''vbsettings''wol' 

add this (to the same line, immediately after):
PHP Code:

'album''hvquestion''notice''prefix''prefixadmin''socialgroups' 

Just installed it as I am going to need a custom phrase group, I'm amazed that this hasn't been made default yet.

brodband 01-25-2011 03:41 AM

For vB 4 do the edits above, and add this

PHP Code:

'advertising''contenttypes''cpcms''tagscategories''vbblock''vbblocksettings''vbblogadmin''vbblogcat''vbblogglobal''vbcms''widgettypes' 

after this
PHP Code:

'prefix''prefixadmin''socialgroups' 


Easy5s.net 08-29-2012 09:27 AM

Can't delete

MySQL Error : Unknown column 'phrasetypeid' in 'where clause'

Easy5s.net 12-11-2012 03:52 PM

please update 4.2


All times are GMT. The time now is 06:51 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01393 seconds
  • Memory Usage 1,874KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (10)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (36)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete