• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 30
  • Last Modified:

Help, need to compare 2 php files and fix the old one

Hello, I have a big problem and I need help please.

After wordpress updating from 3.5.2 to 3.6+ I have a problem with a specific function of a php file.

This file is responsible for any extra user data (eg city, country, etc.) which are stored in wp_usermeta table.
My knowledge in php is minimal. I managed and found a newer file but has too many differences and I can not figure out which are the data I need.

The old one works fine for everything else except this piece of code:

        $_POST['form']['ID'] 		= $userdata->ID;
		$_POST['form']['jabber']  	= $_POST['address']['country']."**";
		$_POST['form']['jabber'] 	.= $_POST['address']['state']."**";
		$_POST['form']['jabber'] 	.= $_POST['address']['address']."**";
		$_POST['form']['jabber'] 	.= $_POST['address']['city']."**";
		$_POST['form']['jabber'] 	.= $_POST['address']['zip']."**";
		$_POST['form']['jabber'] 	.= $_POST['address']['phone'];

Open in new window


This piece of code if operated, would create inside wp_usermeta table, a meta_key "jabber" & a meta_value "country*state*address*city*zip*phone"

This file is also responsible for other things like User Name, Surname, email, orders etc. Everything works fine except the previous code.

I have also try to manually add the records in database and my sript read the user data without problems, the only problem is to save the data.

This is the old php file with the problem:
OldPhp

This is the new one I found but it has many changes:
NewPhp


Please help me, Nicolas
0
Nicolas Lagios
Asked:
Nicolas Lagios
1 Solution
 
Terry WoodsIT GuruCommented:
Can you describe in which way it is breaking? eg is it throwing an error?
0
 
eemitCommented:
- Make a backup first then
- Update to WordPress 3.8.2
- Post here if error still occur
0
 
Nicolas LagiosAuthor Commented:
TerryAtOpus
No its not an error. The problem is that I can't save the user extra data, city country etc, but everything else works

eemit
After wordpress updating to 3.8.2, the problem still remains.


A guy in stackoverflow site told me:
ust realised it's a plugin (opened link). Are you sure it is those lines of code that's causing it? Steps to debug would be- check the $_POST data and then if that checks out, have a look at the $userdata variable and make sure it's not using a deprecated function

What should I do? My php knowledge are limited.
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
eemitCommented:
1)
Files you have posted are the same

2)
As this is a commercial theme, you need to seek support from the theme vendors.
0
 
Terry WoodsIT GuruCommented:
@eemit, the posted files are different for me; maybe you made a mistake?

Anyway, I've made an attempt at modifying the "new" code to incorporate the post data like the old code does. My changes are clearly labelled.

Please find the code attached.
ee-new.php
0
 
Terry WoodsIT GuruCommented:
It's reasonably likely that it won't work; it's clearly not meant to be modified in the way you've modified it.

However, it does look like the new code is intended to handle custom data (in a way that's meant to be done!). The code labelled with "// SAVE THE CUSTOM PROFILE DATA" indicates that. Perhaps you can find something that makes use of it for collecting your extra data?
0
 
Sam CohenCommented:
Download sublimetext http://www.sublimetext.com/
It has a excellent file comparing feature..
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now