Welcome, Guest. Please login or register.
Did you miss your activation email?
February 12, 2012, 11:26:12 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
149698 Posts in 21103 Topics by 7538 Members
Latest Member: ionline
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Core codeing problem  (Read 792 times)
4nthony

Offline Offline

Posts: 13


« on: December 19, 2008, 12:28:53 AM »

hi im trying to edit the registration page and the user information pages

Im having some problems draging the data from the sql and iv just abouts bust my limit of searching for variables.

i have edited

Pref_form
Code:
<tr>
    <td width="140"><?php echo $TEXT['ADDRESS']; ?>:</td>
    <td>
        <input type="text" name="address" style="width: 380px;" maxlength="255" value="<?php echo $wb->get_address(); ?>"/>
    </td>
</tr>

Prefs for when the data is updated
Code:
// Set the page content include file
if(isset($_POST['current_password']) AND isset($_POST['new_password'])) {
    define('PAGE_CONTENT', WB_PATH.'/account/password.php');
} elseif(isset($_POST['current_password']) AND isset($_POST['email'])) {
    define('PAGE_CONTENT', WB_PATH.'/account/email.php');
} elseif(isset($_POST['display_name'])) {
    define('PAGE_CONTENT', WB_PATH.'/account/details.php');
} elseif(isset($_POST['address'])) {
    define('PAGE_CONTENT', WB_PATH.'/account/details.php');
    } else {
    define('PAGE_CONTENT', WB_PATH.'/account/preferences_form.php');
}

details
Code:
// Get entered values
$display_name = $wb->add_slashes(strip_tags($wb->get_post('display_name')));
$address = $wb->add_slashes(strip_tags($wb->get_post('address')));
$cf = $wb->add_slashes(strip_tags($wb->get_post('cf')));
$language = $wb->get_post_escaped('language');
$timezone = $wb->get_post_escaped('timezone')*60*60;
$date_format = $wb->get_post_escaped('date_format');
$time_format = $wb->get_post_escaped('time_format');

// Create a javascript back link
$js_back = "javascript: history.go(-1);";

// Update the database
$database = new database();
$query = "UPDATE ".TABLE_PREFIX."users SET display_name = '$display_name', language = '$language', timezone = '$timezone', date_format = '$date_format', address = '$address', cf = '$cf', time_format = '$time_format' WHERE user_id = '".$wb->get_user_id()."'";
$database->query($query);
if($database->is_error()) {
    $wb->print_error($database->get_error,'index.php',false);
} else {
    $wb->print_success($MESSAGE['PREFERENCES']['DETAILS_SAVED'], WB_URL.'/account/preferences.php');
    $_SESSION['DISPLAY_NAME'] = $display_name;
    $_SESSION['ADDRESS'] = $address;
    $_SESSION['CF'] = $cf;
    $_SESSION['LANGUAGE'] = $language;
    $_SESSION['TIMEZONE'] = $timezone;

class.wb
Code:
//Get the current users address
    function get_address(){
    return $_SESSION['ADDRESS'];
    }

    //Get the current users Codice Fiscale
    function get_cf(){
    return $_SESSION['CF'];
    }

I have checked all the other files for the other vairiables and can nto find anything i can not see the error atall.

My servers php and SQL is all up to date and the names in the sql are direct copies to the php script.

Can anyone help me with this please. it would be much apriciated

Anthony
Logged
4nthony

Offline Offline

Posts: 13


« Reply #1 on: December 19, 2008, 11:43:14 AM »

ok one question for somone,

do core eddits need to be done before wb is intsalled.

any help would be realy apriciative.

thanks

anthony
Logged
kweitzel
Forum administrator
*****
Offline Offline

Posts: 6823


WWW
« Reply #2 on: December 20, 2008, 04:58:18 PM »

No, they don't need to be done before ... but you should keep in mind that after editing you can not easily update WB!

And on a personal note, if you have questions like this, maybe you should also post, what you are trying to achieve with your edit.

cheers

Klaus
Logged

WebsiteBaker Org e.V. - for WebsiteBaker

4nthony

Offline Offline

Posts: 13


« Reply #3 on: December 20, 2008, 09:00:25 PM »

more information registerd on registration
then in the edit info section for all this info to be shown Cheesy

and then once this has been masterd for that information to be included at the beggining of a form. as for updates once i have everything set out and working i can then place the info where it is needed.

I hope somone can help me with this....

Anthony
Logged
4nthony

Offline Offline

Posts: 13


« Reply #4 on: December 24, 2008, 01:15:11 AM »

i am gessing that there is another file somware that needs edditing can anyone advise me which file it is please thanks.

Anthony
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!