예제 #1
0
" />
      <input type="hidden" name="curr" value="<?php 
    print (int) $_GET['curr'];
    ?>
" />
      <input type="hidden" name="delete" value="1" />
      <input type="submit" name="confirm" value="Yes" />
      <input type="submit" name="confirm" value="No" />
    </form>
  </div>
  <?php 
    return;
}
// Delete a custom profile field after confirmation.
if (isset($_POST["curr"]) && isset($_POST["delete"]) && $_POST["confirm"] == "Yes") {
    phorum_api_custom_profile_field_delete((int) $_POST["curr"]);
    phorum_admin_okmsg("Profile field deleted");
}
// Check if we are in create or edit mode.
$curr = isset($_GET['curr']) ? (int) $_GET['curr'] : "NEW";
$field = $curr != 'NEW' && isset($PHORUM['PROFILE_FIELDS'][$curr]) ? $PHORUM['PROFILE_FIELDS'][$curr] : NULL;
// Setup data for create mode.
if ($field === NULL) {
    $name = '';
    $length = 255;
    $html_disabled = 1;
    $show_in_admin = 0;
    $title = "Add A Profile Field";
    $submit = "Add";
    // Setup data for edit mode.
} else {
예제 #2
0
<?php

require_once './include/api/custom_profile_fields.php';
// Find out if we have an active real_name custom user profile field.
$field = phorum_api_custom_profile_field_byname('real_name');
if (empty($field) || !empty($field['deleted'])) {
    return;
}
// If we do, then copy all available real_names to the new real_name
// field in the user table.
$ids = phorum_api_user_search_custom_profile_field($field['id'], '', '*', TRUE);
if (!empty($ids)) {
    foreach ($ids as $id) {
        $user = phorum_api_user_get($id);
        phorum_api_user_save_raw(array("user_id" => $id, "real_name" => $user["real_name"]));
    }
}
// Now we can delete the existing real_name field.
phorum_api_custom_profile_field_delete($real_name_field_id, TRUE);