@@ -48,18 +48,29 @@ function readentry($file)
4848 if ($ lc_name == '' ) {
4949 Fatal_Error ($ GLOBALS ['I18N ' ]->get ('Name cannot be empty: ' )." $ lc_name " );
5050 }
51- $ lc_name = getNewAttributeTablename ( $ lc_name );
51+
5252
5353 $ typeValue = 'select ' ;
54- if ($ lc_name === 'termsofservice ' ){
54+ $ terms = 'termsofservice ' ;
55+ $ adult = 'subscriberisanadult ' ;
56+
57+ if ($ lc_name == '' ) {
58+ Fatal_Error ($ GLOBALS ['I18N ' ]->get ('Name cannot be empty: ' )." $ lc_name " );
59+ }
60+ $ lc_name = getNewAttributeTablename ($ lc_name );
61+
62+ if (substr ($ lc_name , 0 , strlen ($ terms )) === $ terms ){
5563 $ typeValue = 'checkbox ' ;
56- $ name .= getConfig ('domain ' );
64+ if (getConfig ('domain ' )!==null && getConfig ('domain ' )!=='' ){
65+ $ name .= getConfig ('domain ' );
66+ } else $ name .= 'our website ' ;
67+
5768 }
58- if ($ lc_name === ' subscriberisanadult ' ){
69+ if (substr ( $ lc_name, 0 , strlen ( $ adult )) === $ adult ){
5970 $ typeValue = 'checkbox ' ;
6071 }
6172
62- $ query = sprintf ('insert into %s (name,type,required,tablename) values("%s","%s",%d,"%s") ' ,
73+ $ query = sprintf ('insert into %s (name,type,required,tablename) values("%s","%s",%d,"%s") ' ,
6374 $ tables ['attribute ' ], addslashes ($ name ), $ typeValue , 1 , $ lc_name );
6475 Sql_Query ($ query );
6576 $ insertid = Sql_Insert_id ();
0 commit comments