Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Using phrases in user profile fields Details »»
Using phrases in user profile fields
Version: 1.1.1, by JoergZ JoergZ is offline
Developer Last Online: Dec 2012 Show Printable Version Email this Page

Version: 3.5.0 Rating:
Released: 10-20-2005 Last Update: 10-31-2005 Installs: 16
Uses Plugins Template Edits
Code Changes Additional Files Is in Beta Stage  
No support by the author.

Short Description

Unfortunately it is not possible in the standard-vB to use phrases in user profile fields. If you have only one language installed, this is no problem. But if you have more than one language on your board, this is bad.

With this hack, you can use phrases for user profile field title, description and select-options.

So you will have in the UserCP, in the meber-search and in the profile-view the text for user profile fields multilanguage. (See screenshots)

Though the main part of this hack is packed into a product, it is necessary to make some code-modifications, because there are new hooks necessary.


Requirements

vB 3.5 (Tested up to 3.5.1)


Installation-Time

approx. 15 - 20 minutes


Changes

Code-Modifications: 4
Template-Modifications: 3
New files: 1


Support

I have not marked the box "supported" because I am not always available and can answer in short time, but of course I will try helping you, if there are problems.


Open issues

When you get as administrator a mail, that a new user has registrated, in this mail, the phrase-converting is not implemented yet.


Updates

21.10.05: I have updated the hack. Now the phrases for the profile fields are shon correct on the registration page and in the AdminCP, when you add or search there a user. The ZIP-file contains a install-description for the new version, and a update-description, if you had already installed version 1.0


01.11.05: Update to 1.1.1: Bugfix for selection-options. They were interpreted always as phrase, even if you entered them as fix text. For updating only import the product and choose "Allow Overwrite" yes.



NOTE !!!

I marked "is in beta-stage" because I want to have first a feedback of some people, if this hack works on their board correct. Of course I have tested it on my installation, but you know, strange things can happen. When some people use this hack without problems, I will remove the beta-stage.



Please click if you have installed this hack, to get informations, if there are upadtes or corrections.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 03-23-2006, 01:38 PM
JoergZ JoergZ is offline
 
Join Date: Jun 2002
Location: Germany
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello Felix !

You are right, sorry. I have "cheated" in my board. I have in the memberlist a field "country", but it shows a flag. And the header comes not from the profile-field, I modified the template and use a phrase.

Quote:
Originally Posted by derfelix
but as I see it.. its more complicated.. than I thought because the title and the stored field content are replaced at different locations..
Maybe that's the reason, why it is not included yet ...

But I will have a look at the problem and if I have a solution, either release a new version or give the instruction how to have the fields in the memberlist. (But maybe I have no time before the weekend for this, so you have to wait 2 or 3 days).


Best regards

J?rg
Reply With Quote
  #13  
Old 03-23-2006, 02:13 PM
derfelix derfelix is offline
 
Join Date: Nov 2001
Posts: 204
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanx... guess what..

I got it working for me... :banana:

It was a little tricky though

And as I am a newbie to vbulletin (used to hack only phpbb boards) i could never put this into a plugin..

(and as there allready was a fileedit.. i think this will cost less ressources)

ATTENTION I only tested it with the multiple checkbox example in your file..

so what i did:

first find in memberlist.php
PHP Code:
     if ($value['type'] == 'checkbox' OR $value['type'] == 'select_multiple')
     {
      unset(
$customfield);
      foreach (
$value['data'] AS $key => $val)
      {
       if (
$userinfo["$value[varname]"] & pow(2$key))
       {
        
$customfield .= iif($customfield', ') . $val;
       }
      }
     }
     else
     {
      
$customfield $userinfo["$value[varname]"];
     } 
and replace with:
PHP Code:
// ########### Lang hack part one ---start ########
     
if ($value['type'] == 'checkbox' OR $value['type'] == 'select_multiple')
     {
      unset(
$customfield);
      foreach (
$value['data'] AS $key => $val)
      {
       if (
$userinfo["$value[varname]"] & pow(2$key))
       {
        
$phraseprffld '';
        
$testforphrase substr(trim($val), 01); 
        if (
$testforphrase == '$'
        { 
         
$prffldphrase substr(trim($val), 1); 
         
$val $vbphrase[$prffldphrase]; 
        }
        
$customfield .= iif($customfield', ') . $val;
       }
      }
     }
     else
     {
      
$phraseprffld '';
      
$testforphrase substr(trim($userinfo["$value[varname]"]), 01); 
      if (
$testforphrase == '$'
      { 
       
$prffldphrase substr(trim($userinfo["$value[varname]"]), 1); 
       
$customfield $vbphrase[$prffldphrase]; 
      }
      else
      { 
       
$customfield $userinfo["$value[varname]"];
      } 
      
     }
// ########### Lang hack part one ---end ######## 
then find:
PHP Code:
   $customfield $customfield['title']; 
and ABOVE add:
PHP Code:
// ########### Lang hack part two ---start ########
   
$testforphrase substr($customfield['title'], 01);
   if (
$testforphrase == '$')
   {
    
$prffldtitle substr($customfield['title'], 1);
    
$customfield['title'] = $vbphrase[$prffldtitle];
   }
// ########### Lang hack part two ---end ######## 
Well for me it seems to work!!!!

Felix
Reply With Quote
  #14  
Old 06-15-2007, 10:55 PM
BWJ BWJ is offline
 
Join Date: Aug 2005
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this hack work with 3.6.7?
Reply With Quote
  #15  
Old 06-16-2007, 12:20 AM
BWJ BWJ is offline
 
Join Date: Aug 2005
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Unfortunately it didn't work for me:

I could see the check boxes in edit profile but when saving it gives this error:

Parse error: syntax error, unexpected T_GLOBAL, expecting '{' in /home/xxxxxxx/public_html/forums/includes/class_dm_user.php on line 972

when trying to access the member list it gives this error:

Parse error: syntax error, unexpected T_ELSE in /home/xxxxxxx/public_html/forums/memberlist.php on line 898

I didn't try derfelix's modification...

But the idea is great and useful!
Reply With Quote
  #16  
Old 08-10-2008, 12:51 PM
KubisForce KubisForce is offline
 
Join Date: May 2006
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a newer version or does it work with vb 3.7?
Reply With Quote
  #17  
Old 08-10-2008, 01:10 PM
JoergZ JoergZ is offline
 
Join Date: Jun 2002
Location: Germany
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have not installed it on 3.7, but I doubt it will work. Sorry, there is no newer version. And I currently don't have time to work on a version for 3.7.

Br

Joerg
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:40 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.03846 seconds
  • Memory Usage 2,297KB
  • Queries Executed 21 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete