The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Replace some characters in User Profile Field content (Many people should need it)
I need to replace some characters in User Profile Field content,
for example aaa to be bbb maybe there is two way, please help to make one of them or both works : 1. i see in User Profile Field Manager, there is regex function, what is the regex function patern to search and replace there? 2. or using a plugin with profile_updateprofile hook, but looks like below variable code in red are still wrong, so this is still not working Quote:
|
#3
|
||||
|
||||
thank you for replying, Simon Lloyd, i already tried it :
Quote:
Quote:
i already tried this too Quote:
please help guys, make this plugin working, or using regex function patern to search and replace in the profile fields |
#4
|
|||
|
|||
It might work if you use hook profile_start and code like this:
Code:
if ($_POST['do'] == 'updateprofile') { $vbulletin->input->clean_gpc('p', 'userfield', TYPE_ARRAY); $fieldcontentbefore = array( 'aaa', 'ccc' ); $fieldcontentafter = array( 'bbb', 'ddd' ); $vbulletin->GPC['userfield'][$field] = str_replace($fieldcontentbefore, $fieldcontentafter, $vbulletin->GPC['userfield'][$field]); } but of course you need to set $field to something. |
#5
|
||||
|
||||
thank you for replying too, i already tried the code and using profile_start hook
but its looks like still not working do you mean change $field, to using field id like this right : $field1, or is it need other variable? please help guys, i think this is basic thing that needed for vb, it will be rare characters that we want to replaced, but its should be patched too |
#6
|
||||
|
||||
It wouldn't be $field1 but rather ['field1'] so the id of the field you are trying to manipulate
|
#7
|
||||
|
||||
Hmm i am afraid still not working
using this Quote:
or this Quote:
how is it the code actually? |
#8
|
||||
|
||||
Have you thought about leaving out you IF condition and see if you can get a replacement every time the hook is called?
|
#9
|
||||
|
||||
If you mean removing the if condition, i already tried it too
Quote:
or this Quote:
but still not replacing too, you can try it in your vb3 test site, or i can give a vb3 test site access if you like |
#10
|
|||
|
|||
Sorry, I left something out in the code I posted. It should have been:
Code:
$vbulletin->input->clean_gpc('p', 'userfield', TYPE_ARRAY); By the way, the reason that I thought profile_start would be better is that at profile_updateprofile the datamanager fields have been set already, so just doing a replace won't work. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|