<?php include "../../../wp-config.php"; do_action('connect_init'); if ($_GET['do'] == "profile") { if (is_user_logged_in()) { if ($_POST['add_qq'] || $_POST['add_sina'] || $_POST['add_renren'] || $_POST['add_shuoshuo'] || $_POST['add_sohu'] || $_POST['add_netease'] || $_POST['add_douban'] || $_POST['add_tianya'] || $_POST['add_kaixin'] || $_POST['add_twitter']) { wp_connect_header(); } else { $user_id = get_current_user_id(); wp_user_profile_update($user_id); header('Location:' . admin_url('profile.php')); } } } if ($_GET['do'] == "page") { $wptm_options = get_option('wptm_options'); $wptm_advanced = get_option('wptm_advanced'); $password = $_POST['password']; if (isset($_POST['message'])) { if ($wptm_options['page_password'] && $password == $wptm_options['page_password'] || is_user_logged_in() && function_exists('wp_connect_advanced') && $wptm_advanced['registered_users']) { wp_update_page(); } else { echo 'pwderror'; } } } if ($_GET['do'] == "login") { $user = wp_connect_get_cookie("wp_connect_cookie_user"); if ($user) { $user[0][1] = ifuser($user[0][1]);
function wp_user_profile_fields($user) { global $plugin_url, $user_level, $wptm_options, $wptm_advanced; $user_id = $user->ID; wp_user_profile_update($user_id); $account = wp_usermeta_account($user_id); $wptm_profile = get_user_meta($user_id, 'wptm_profile', true); $_SESSION['user_id'] = $user_id; $_SESSION['wp_url_bind'] = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; if ($wptm_options['multiple_authors'] && ($user_level > 1 || is_super_admin())) { //是否开启多作者和判断用户等级 $canbind = true; ?> <h3>同步设置</h3> <table class="form-table"> <tr> <th>同步内容设置</th> <td><input name="sync_option" type="text" size="1" maxlength="1" value="<?php echo $wptm_profile['sync_option']; ?> " onkeyup="value=value.replace(/[^1-5]/g,'')" /> (填数字,留空为不同步) <br />提示:1. 前缀+标题+链接 2. 前缀+标题+摘要/内容+链接 3.文章摘要/内容 4. 文章摘要/内容+链接 </td> </tr> <tr> <th>自定义消息</th> <td>新文章前缀:<input name="new_prefix" type="text" size="10" value="<?php echo $wptm_profile['new_prefix']; ?> " /> 更新文章前缀:<input name="update_prefix" type="text" size="10" value="<?php echo $wptm_profile['update_prefix']; ?> " /> 更新间隔:<input name="update_days" type="text" size="2" maxlength="4" value="<?php echo $wptm_profile['update_days']; ?> " onkeyup="value=value.replace(/[^\d]/g,'')" /> 天 [0=修改文章时不同步] </td> </tr> </table> <?php } if ($canbind || $wptm_advanced['registered_users']) { ?> <p class="show_botton"></p> </form> </div> <?php echo $super_admin; include dirname(__FILE__) . '/bind.php'; ?> <div class="hide_botton"> <?php } }