Results 1 to 3 of 3

Thread: How to get currency mod working after upgrading from 3.04 to 3.05.2

  1. #1
    Thread Starter
    katjaaclass's Avatar
    Join Date
    Oct 2010
    Location
    Los Angeles, CA
    Posts
    106
    Thanks
    9
    Thanked 5 Times in 3 Posts

    Lightbulb How to get currency mod working after upgrading from 3.04 to 3.05.2

    Hello guys,

    Under my former install (3.04) I've created classipress_child file with functions.php and currency-mod according to:

    http://appthemes.com/blog/classipres...torial-part-1/

    http://appthemes.com/blog/classipres...torial-part-2/

    The currency mod worked good under 3.04.

    Now I've upgraded to 3.05.2 and I would like this mod working again. It's not working now. The classipress_child with her functions.php and currency-mod are not affected during upgrade.

    Instructions please.

    Thanks in advance.

    Below copy of the functions.php script in my classipress_child file.
    <?php
    /**
    * Write your own functions or modify functions, actions, and filters using this file.
    * LIST YOUR FUNCTIONS (optional):
    * cp_import_wp_childstyle() [CUSTOM]
    * cp_get_price() [OVERWRITE]
    */

    //Place All Your Custom Function Below This Line

    //change price to spit out correct looking currency and ignore anything that's not a price.
    function cp_get_price($postid) {
    if(get_post_meta($postid, 'cp_price', true)) {
    $price_out = get_post_meta($postid, 'cp_price', true);

    // uncomment the line below to change price format
    $price_out = ereg_replace("[^0-9.]", "", $price_out);
    $price_out = number_format($price_out, 2, '.', ',');
    $price_out = cp_pos_currency($price_out);
    } else {
    if( get_option('cp_force_zeroprice') == 'yes' )
    $price_out = cp_pos_currency(0);
    else
    $price_out = '&nbsp;';
    }
    echo $price_out;
    }

    /**
    * HOMEPAGE DYNAMIC SIDEBAR LOGIN/REGISTRATION : here we are updating the home page sidebar
    * to have a login form and display user options when logged in. Already enabled in child theme.
    * USE: I suggest you replace the get_option('cp_ads_welcome_msg') on sidebar.php with our new
    * function here <?php echo cp_dynamic_get_option('cp_ads_welcome_msg'); ?>.
    */

    function cp_dynamic_welcome_widget($optionString) {
    global $user_ID, $user_identity, $user_level;
    if(!isset($optionString)) $optionString = 'cp_ads_welcome_msg';
    if ( $user_ID ) {
    $smHomepageSidebar = '<h2>User Options</h2>';
    $smHomepageSidebar .= '<div>';
    $smHomepageSidebar .= '<ul>';
    $smHomepageSidebar .= '<li><a href="' . CP_DASHBOARD_URL . '">' . __('My Dashboard','cp') . '</a></li>' ;
    $smHomepageSidebar .= '<li><a href="' . CP_PROFILE_URL . '">' . __('Edit Profile','cp') . '</a></li>';
    $smHomepageSidebar .= '<li><a href="' . CP_PROFILE_URL . 'change_password/">' . __('Change Password','cp') . '</a></li>';
    if (current_user_can('manage_options'))
    $smHomepageSidebar .= '<li><a href="' . get_option('home') . '/wp-admin/">' . __('WordPress Admin','cp') . '</a></li>';
    $smHomepageSidebar .= '<li><a href="' . wp_logout_url() . '">' . __('Log Out','cp') . '</a></li>';
    $smHomepageSidebar .= '</ul>';
    $smHomepageSidebar .= '</div><!-- /recordfromblog -->';
    }
    else { //if the user has no user ID then they are not logged in
    $smHomepageSidebar = '<div style="padding-bottom:10px;">';
    $smHomepageSidebar .= get_option($optionString); //cp_ads_welcome_msg
    $smHomepageSidebar .= '<div style="float: right; text-align: center;">';
    $smHomepageSidebar .= '<a href="' . get_option('home') . '/wp-login.php">' . __("Already a Member?", 'cp') . '</a><br />';
    $smHomepageSidebar .= '</div>';
    if (get_option('users_can_register') || get_blog_option($blog_id, 'users_can_register', 0))
    $smHomepageSidebar .= '<a href="' . get_option('home') . '/wp-login.php?action=register">' . __("Join Now!", 'cp') . '</a>';
    $smHomepageSidebar .= '<br />';
    $smHomepageSidebar .= '</div><!-- /dotted -->';

    //Create the Login Form
    $smHomepageSidebar .= '<div style="margin-top: 10px;">';
    $smHomepageSidebar .= '<form action="' . get_bloginfo('url') . '/wp-login.php" method="post">';
    $smHomepageSidebar .= '<label style="font-size: 11px; margin-left: 1px;" for="log">Username: <input type="text" name="log" id="log" value="' . wp_specialchars(stripslashes($user_login), 1) . '" size="11" style="height: 10px; font-size: 10px;" /></label>';

    $smHomepageSidebar .= '<label style="font-size: 11px; margin-left: 1px;" for="pwd">Password: <input type="password" name="pwd" id="pwd" size="11" style="height: 10px; font-size: 10px;" /></label>';
    $smHomepageSidebar .= '<input style="font-size: 11px; margin-left: 1px;" type="submit" name="submit" value="Login" /><br />';
    $smHomepageSidebar .= '<label style="font-size: 11px; margin-left: 1px; vertical-align:baseline; line-height: 2.1em;" for="rememberme"><input style="margin: 0; position: relative; top: 3px;" name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> Onthoud me </label> | ';
    $smHomepageSidebar .= '<a style="font-size: 11px; margin-left: 1px;" href="' . get_bloginfo('url') . '/wp-login.php?action=lostpassword">Password opvragen</a>';
    $smHomepageSidebar .= '<input type="hidden" name="redirect_to" value="' . $_SERVER['REQUEST_URI'] . '"/>';
    $smHomepageSidebar .= '</form>';
    $smHomepageSidebar .= '</div>';
    }
    return $smHomepageSidebar;
    }

    //Do not place any code below this line.
    ?>

  2. #2
    Thread Starter
    katjaaclass's Avatar
    Join Date
    Oct 2010
    Location
    Los Angeles, CA
    Posts
    106
    Thanks
    9
    Thanked 5 Times in 3 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  3. #3
    Thread Starter
    katjaaclass's Avatar
    Join Date
    Oct 2010
    Location
    Los Angeles, CA
    Posts
    106
    Thanks
    9
    Thanked 5 Times in 3 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. upgrading Ads
    By daysow in forum Report ClassiPress Bugs
    Replies: 2
    Last Post: October 24th, 2010, 10:39 AM
  2. [SOLVED] Upgrading from 3.0 to 3.0.4
    By ejikoala in forum Help Using ClassiPress
    Replies: 2
    Last Post: October 6th, 2010, 10:34 AM
  3. upgrading to 3.0
    By emo777 in forum Help Using ClassiPress
    Replies: 1
    Last Post: May 22nd, 2010, 02:01 AM