Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 01 Nov 2009, 13:11
Adem GENĒ's Avatar
Adem GENĒ Adem GENĒ is offline
 
Join Date: Apr 2005
Real name: Adem GENĒ
Can you help?

Hello,

Real name surname instead of the user name


Here is the error?

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Add New Plugin
Hook Location: ??????? Here, what should I choose?

Thank you

--------------- Added 01 Nov 2009 at 15:42 ---------------

Okay, I solved the problem

Hook Location: parse_templates

Rate correct?

--------------- Added 01 Nov 2009 at 15:55 ---------------

There was a problem

Username show if it is empty Real Name and Surname

How do I do?

Last edited by Adem GENĒ; 02 Nov 2009 at 12:03. Reason: Auto-Merged DoublePost
Reply With Quote
  #2  
Old 04 Nov 2009, 04:22
RenatoMN's Avatar
RenatoMN RenatoMN is offline
 
Join Date: Nov 2008
if ($post[field24]) {
your code;
}
Reply With Quote
  #3  
Old 04 Nov 2009, 14:08
Adem GENĒ's Avatar
Adem GENĒ Adem GENĒ is offline
 
Join Date: Apr 2005
Real name: Adem GENĒ
Thank you very much for your help

But,
I need to work within the template code
Reply With Quote
  #4  
Old 06 Nov 2009, 03:32
RenatoMN's Avatar
RenatoMN RenatoMN is offline
 
Join Date: Nov 2008

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #5  
Old 06 Nov 2009, 14:18
Adem GENĒ's Avatar
Adem GENĒ Adem GENĒ is offline
 
Join Date: Apr 2005
Real name: Adem GENĒ
Not work to plugin

But
Worked smoothly in the template

Here is the error? (RED)
$username_yerine_ad_soyad['postbit_legacy']['find'] = array('$post[musername]');
$username_yerine_ad_soyad['postbit_legacy']['replace'] = Array('<if condition=\"$post[' . $vbulletin->options['username_yerine_ad_field'] . ']\">$post[' . $vbulletin->options['username_yerine_ad_field'] . '] $post[' . $vbulletin->options['username_yerine_soyad_field'] . ']<else />$post[musername]</if>');
$vbulletin->templatecache['postbit_legacy'] = str_replace($username_yerine_ad_soyad['postbit_legacy']['find'], $username_yerine_ad_soyad['postbit_legacy']['replace'], $vbulletin->templatecache['postbit_legacy']);

Last edited by Adem GENĒ; 06 Nov 2009 at 14:45.
Reply With Quote
  #6  
Old 06 Nov 2009, 21:10
RenatoMN's Avatar
RenatoMN RenatoMN is offline
 
Join Date: Nov 2008
When replacing only 1 value, do not need to use arrays as search/replace values (see str_replace manual).

Also, if you're using a plugin, you may check the existence of content in $post[field24] and $post[field38] and, only if true, perform the replacement:

Use the hook postbit_display_complete:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Regards
Reply With Quote
  #7  
Old 07 Nov 2009, 22:13
RenatoMN's Avatar
RenatoMN RenatoMN is offline
 
Join Date: Nov 2008
Hello.

I replied your PM:

May you please continue answering in the thread, please?

Answer there, in simply words:

- what you have in field24?
- what you have in field38?
- when you want to replace 'musername' (and replace with what)?
But I will complete the question:

why aren't you caching the templates (in the zip file you sent me)? is this working the way it is now?

I never used hooks in "parse_templates", this is why i'm asking.
When using other hooks, I had to determine the caching of templates in a plugin, for the hook "cache_templates":


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #8  
Old 07 Nov 2009, 22:31
Adem GENĒ's Avatar
Adem GENĒ Adem GENĒ is offline
 
Join Date: Apr 2005
Real name: Adem GENĒ
I'm beginner
I am learning slowly
know very little php
I would do something for myself
My goal, areas as possible within the forum to show their real name instead of username
I've created a custom profile fields
Real Name and Real Surname
Members in this area are entered into the real names and surnames

field24-->Real Name (Adem)
field38-->Real Surname (GENĒ)



I'm trying to make plugin
Attached Files
File Type: xml product-realname_replace_username.xml (10.0 KB, 2 views)

Last edited by Adem GENĒ; 07 Nov 2009 at 23:10.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 07:10.

Layout Options | Width: Wide Color: