Viewing 7 replies - 1 through 7 (of 7 total)
  • @qlex266

    How are you getting that form on the front end? Is is via a plugin? Can it be extended via an API?

    Thread Starter qlex266

    (@qlex266)

    no no , it’s from Aruna theme.
    profile-edit.php
    <?php
    get_header();
    global $current_user; get_currentuserinfo();
    $id = $current_user->ID;
    $bg = get_user_meta($id, ‘_cover’, true);
    $avatar = get_user_meta($id, ‘_avatar’, true);
    $nsfw = get_user_meta($id, ‘_nsfw’, true);
    if($bg == ”) {
    $bg = get_template_directory_uri() . ‘/img/user-cover02.jpg’;
    }
    if(isset($_GET[‘error’]) ) {
    $error = esc_html(stripslashes(urldecode($_GET[‘error’]) ) );
    }
    if(isset($_GET[‘success’]) ) {
    $success = 1;
    }
    ?>
    <section id=”main” role=”main”>
    <div class=”container”>
    <div class=”row”>
    <div class=”col-sm-9 right-content profile-bg”>
    <div class=”row”>
    <div class=”col-sm-12″>
    <div class=”main-wrap”>
    <h1><?php _e(‘PUBLIC PROFILE & ACCOUNT’, ‘Aruna’);?></h1>
    <div class=”separator”></div>
    <form enctype=”multipart/form-data” action=”” method=”post”>
    <div class=”user-cover-edit” style=”background-image: url(‘<?php echo $bg;?>’);”>
    <div class=”col-sm-9 col-md-9″>
    <div class=”outer”>
    <div class=”inner”>
    <figure>
    <?php echo teo_get_avatar($current_user->ID, 90, 90);?>
    </figure>
    <div class=”text”>
    <div class=”outer”>
    <div class=”inner”>
    <?php echo $current_user->display_name;?>
    <div class=”page-name”><?php _e(‘Settings page’, ‘Aruna’);?></div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    <div class=”col-sm-3 col-md-3″>
    <div class=”outer”>
    <div class=”inner”>
    <?php
    $kudos = teo_get_kudos();
    if($kudos > 1000) {
    $kudos = ($kudos/1000) . ‘k’;
    }
    ?>
    <div class=”counter-item”>
    <span class=”number”><?php echo $kudos;?></span>
    <span class=”exp”><?php _e(‘Likes’, ‘Aruna’);?></span>
    </div>
    <div class=”counter-item”>
    <span class=”number”><?php echo count_user_posts($current_user->ID);?></span>
    <span class=”exp”><?php _e(‘posts’, ‘Aruna’);?></span>
    </div>
    </div>
    </div>
    </div>
    </div>
    <?php if(isset($error) || isset($success) ) { ?>
    <div class=”row”>
    <div class=”col-sm-10″>
    <?php if(isset($success) && $success != ”) { ?>
    <div class=”alert alert-success”>
    <?php _e(‘Profile edited successfully’, ‘Aruna’);?>
    </div>
    <?php } elseif($error != ”) { ?>
    <div class=”alert alert-danger”>
    <?php echo $error;?>
    </div>
    <?php } ?>
    </div>
    </div>
    <?php } ?>
    <div class=”row”>
    <div class=”col-sm-5″>
    <div class=”input-group”>
    <span class=”input-group-addon”><?php _e(‘Email:’, ‘Aruna’);?></span>
    <input name=”email” type=”text” class=”form-control” value=”<?php echo $current_user->user_email;?>”>
    </div>
    <div class=”input-group”>
    <span class=”input-group-addon”><?php _e(‘New Password:’, ‘Aruna’);?></span>
    <input name=”password” type=”password” class=”form-control” value=”” placeholder='<?php _e(“Only if you want to change it”, “Aruna”);?>’>
    </div>
    </div>
    <div class=”col-sm-5″>
    <div class=”input-group”>
    <span class=”input-group-addon”><?php _e(‘Display name:’, ‘Aruna’);?></span>
    <input name=”display” type=”text” class=”form-control” value=”<?php echo $current_user->display_name;?>”>
    </div>
    <div class=”input-group”>
    <span class=”input-group-addon”><?php _e(‘Repeat Password:’, ‘Aruna’);?></span>
    <input name=”password2″ type=”password” class=”form-control” value=”” placeholder=”<?php _e(‘(if applicable)’, ‘Aruna’);?>”>
    </div>
    </div>
    </div>
    <div class=”row”>
    <div class=”col-sm-5″>
    <div class=”input-group “>
    <span class=”input-group-addon”><?php _e(‘Background img:’, ‘Aruna’);?></span>
    <input type=”text” readOnly class=”form-control” value=”<?php echo $bg;?>” placeholder=”The url of the background image”>
    </div>
    </div>
    <div class=”col-sm-5 profilebgedit”>
    <input name=”cover” type=”file” />
    </div>
    </div>
    <div class=”row”>
    <div class=”col-sm-5″>
    <div class=”input-group “>
    <span class=”input-group-addon”><?php _e(‘Avatar image:’, ‘Aruna’);?></span>
    <input type=”text” readOnly class=”form-control” value=”<?php echo $avatar;?>” placeholder=”The url of the avatar image”>
    </div>
    </div>
    <div class=”col-sm-5 profilebgedit”>
    <input name=”avatar” type=”file” />
    </div>
    </div>
    <div style=”clear: both”></div>
    <div class=”row”>
    <div class=”col-sm-5″>
    <button name=”editprofile” class=”btn btn-primary custom-button btn-block” type=”submit”><i class=”glyphicon glyphicon-check”></i> <?php _e(‘Save Settings’, ‘Aruna’);?></button>
    <div class=”spacer”></div>
    </div>
    </div>
    </form>
    </div>
    </div>
    </div>
    </div>
    <?php get_sidebar(‘left’);?>
    </div>
    </div>
    </section>
    <?php get_footer();?>`

    Thread Starter qlex266

    (@qlex266)

    How can i integrate this:
    echo “<td><label><input type=\”checkbox\” name=\”sub2-one-click-subscribe\” value=\”1\” ” . checked( ! get_user_meta($user->ID, $this->get_usermeta_keyname(‘s2_subscribed’), true), false, false ) . ” /> ” . __(‘Receive notifications’, ‘subscribe2’) . “</label>\r\n”;

    Into html , i try something like this :
    <input type=”checkbox” name=”sub2-one-click-subscribe” value=”1″><?php( ! get_user_meta($user->ID, $this->get_usermeta_keyname(‘s2_subscribed’), true), false, false )?></input>\
    but didin’t work.

    I manage to introduce this into profile-edit.php:

    <h3>Email subscription</h3>
    <table class=”form-table”>
    <tr><th scope=”row”>Subscribe / Unsubscribe</th>
    <td><label><input type=”checkbox” name=”sub2-one-click-subscribe” value=”1″ checked=’checked’/> Receive notifications</label>
    <span class=”description”>Check if you want to receive email notification when new posts are published</span>
    </td></tr></table>

    But i still neeed php code :
    . checked( ! get_user_meta($user->ID, $this->get_usermeta_keyname(‘s2_subscribed’), true), false, false ) .
    but i can’t do it .. he gives me white page..

    @qlex266

    To make it appear you need to wrap the PHP you pasted above in PHP tags ( <?php and ?>), but more than that you need to access the correct ID – you can use $id from the Aruna theme code, but you also need to access the $mysubscribe2 global and replace any instances of $this with it in the code from Subscribe2. Finally, you’ll actually need to process any change to that setting if the form is submitted.

    Thread Starter qlex266

    (@qlex266)

    pfuu is little complicated for me ??
    $userid i think it is
    nah it’s to complicated for me .. i need an example something because i can’t handled just like that ??
    and i really need to move that because if a user want to unsubscribe how can he do it ? I block the user panel , just admin can acces the user/admin panel

    @qlex266

    From the file you posted above I cannot see where form input is handled and Aruna seems to be a premium theme so I can’t access the source code.

    If you make file level changes you’ll need to remember these if the theme ever gets updated and re-apply them after the update.

    The easiest way to fix this if you are not too familiar with PHP code is to allow access to the admin area or pay a coder to implement a fix for your site.

    Thread Starter qlex266

    (@qlex266)

    Yep , i think i would do that .
    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How can i move Receive notifications from user panel to frontend user edit’ is closed to new replies.