/**
 * GET USER PROFILE IMAGE
 ***********************************/
function wpdc_the_profile_photo($usuario)
{
    if (is_object($usuario) && is_numeric($usuario->ID)) {
        $user_id = $usuario->ID;
    } elseif (is_numeric($usuario)) {
        $user_id = $usuario;
    }
    $user = get_userdata($user_id);
    if (function_exists('get_wp_user_avatar_src') && get_wp_user_avatar_src($user_id, 100, 'medium') != '') {
        $user_photo = get_wp_user_avatar_src($user_id, 100, 'medium');
    } elseif ($user->userphoto_image_file != '') {
        $user_photo = get_bloginfo('url') . '/wp-content/uploads/userphoto/' . $user->userphoto_image_file;
    } else {
        $user_photo = get_stylesheet_directory_uri() . '/img/default/nophoto.png';
    }
    echo '<div class="wrap wrap--photo" title="' . wpdc_get_user_name($user_id) . '"><img src="' . $user_photo . '"></div>';
}
Example #2
0
include locate_template('templates/sections/user-info.php');
?>

  <?php 
if (is_user_role('editor') || is_user_role('administrator') || $user_info->ID == get_current_user_id()) {
    $userdata = ['DNI' => get_the_author_meta('dbem_dnie', $user_info->ID), 'Fecha de nacimiento' => get_the_author_meta('bornday', $user_info->ID), 'Teléfono' => get_the_author_meta('dbem_phone', $user_info->ID), 'Dirección' => get_the_author_meta('dbem_address', $user_info->ID), 'Estudios' => get_the_author_meta('titulacion', $user_info->ID), 'Centro de estudios' => get_the_author_meta('centro_de_estudios', $user_info->ID)];
    /* Datos de asociado */
    if ($user_info->ID == get_current_user_id()) {
        $title_section = 'Tus datos de asociado';
    } else {
        $title_section = 'Datos de asociado';
    }
    wpdc_the_section_custom($userdata, 'userdata', $title_section, true);
    /* Messages */
    if ($user_info->ID == get_current_user_id()) {
        $title_section = 'Mensajes con ' . get_option('blogname');
    } else {
        $title_section = 'Mensajes con ' . wpdc_get_user_name($user_info->ID);
    }
    wpdc_the_section_messages(get_user_notification_track($user_info->ID, 'type', 'message'), 'user_messages', $title_section, true);
}
if (is_user_role('editor') || is_user_role('administrator')) {
    /* Historial de registro */
    wpdc_the_section_registry_track(get_user_registry_track($user_info->ID), 'user_track', 'Historial', true);
}
?>


</div><!-- end of flexboxer -->
<?php 
get_footer();
if ($_GET['id'] > 0 && (is_user_role('editor') || is_user_role('administrator'))) {
    ?>
		<?php 
    global $post;
    $post_id = $_GET['id'];
    $post = get_post($post_id);
    $job_bussiness = get_post_meta($post_id, 'job_bussiness', true);
    $job_info = get_post_meta($post_id, 'job_info', true);
    ?>
 

		<?php 
    if (is_user_role('editor') || is_user_role('administrator')) {
        $pageoptions = ["postinfo" => "Detalles"];
        wpdc_the_pageoptions($pageoptions);
        $infoarray = ["Publicado" => get_the_date('Y-m-d h:i:s'), "Última modificación" => get_the_date('Y-m-d h:i:s'), "Autor" => wpdc_get_user_name($post->post_author)];
        wpdc_the_section_custom($infoarray, 'postinfo', 'Detalles del artículo', true, true);
    }
    ?>


		<section id="newconcurso" class="wrap wrap--content wrap--form wrap--shadow">
			<h3 class="title title--section">Editar artículo</h3>
			<form method="POST" action="">
			  	<input type="hidden" name="id" value="<?php 
    echo $post_id;
    ?>
">

			    <?php 
    wpdc_the_input_text('post_name', get_the_title($post_id), 'Título del artículo', 'Título');
 }
 if ($paymethod == '') {
     $hasError = true;
     $msg .= '<p>Método de pago no seleccionado</p>';
 }
 if (!is_singular('fee')) {
     $hasError = true;
     $msg .= '<p>¿Qué intentas?</p>';
 }
 if (!is_numeric($user_id) || $user_id < 1) {
     $hasError = true;
     $msg .= '<p>Usuario inválido</p>';
 }
 if (!$hasError) {
     $treasury_page = get_page_by_title('Configuration treasury');
     $username = wpdc_get_user_name($user_id);
     if ($paymethod == 'transferency') {
         $pending_members = get_post_meta($post_id, 'members_pending', true);
         if (!is_array($pending_members)) {
             $pending_members = array();
         }
         if (!in_array($user_id, $pending_members)) {
             $pending_members[$user_id] = current_time('mysql');
         }
         update_post_meta($post_id, 'members_pending', $pending_members);
         $alerts_success .= '<p>Cuota actualizada</p>';
         $message = '<a href="' . get_permalink($post_id) . '">' . $username . ' pagará ' . get_the_title($post_id) . ' mediante transferencia</a> <a href="#hidden">' . current_time('mysql') . '</a>';
     } elseif ($paymethod == 'paypal') {
         //TODO Pago por paypal
     } else {
         //TODO Errores
        <li class="item wrap wrap--frame wrap--flex">
          <div class="wrap wrap--frame wrap--frame__middle">
            <a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a>
          </div>
          <div class="wrap wrap--frame wrap--frame__fourth">
            <a href="<?php 
        echo get_author_posts_url(get_the_author_meta('ID'));
        ?>
"><?php 
        echo wpdc_get_user_name(get_the_author_meta('ID'));
        ?>
</a>
          </div>
          <div class="wrap wrap--frame wrap--frame__fourth">
            <a href="<?php 
        echo site_url('/edit-posts/?id=' . $post_id);
        ?>
"><span class="js-date"><?php 
        echo get_the_date('Y-m-d h:i:s');
        ?>
</span></a>
              <span class="js-date-fromnow help-info"><?php 
        echo get_the_date('Y-m-d h:i:s');
        ?>
</span>
<section class="wrap wrap--content wrap--shadow">
  <div class="wrap wrap--frame wrap--flex wrap--userinfo">
    <div class="wrap wrap--frame wrap--frame__100">
      <?php 
wpdc_the_profile_photo($user_info->ID);
?>
    </div>
    <div class="wrap wrap--frame wrap--frame__middle">
      <p>
        <a href="<?php 
echo get_author_posts_url($user_info->ID);
?>
">
          <?php 
echo wpdc_get_user_name($user_info->ID);
?>
        </a>
        <br><?php 
echo get_user_meta($user_info->ID, 'position', 1);
?>
        <br><?php 
wpdc_the_asociation_position($user_info->ID);
?>
      </p>
    </div>
  </div>

  <?php 
wpdc_the_edit_icon(get_bloginfo('url') . '/edit-profile/?id=' . $user_info->ID);
?>
    
            $output .= '<span class="msg">' . $track['msg'] . '</span> ';
        }
        $output .= ' <span title="' . $track['date'] . '" class="js-date-fromnow">' . $track['date'] . '</span>';
        $output .= '</li>';
        echo $output;
    }
    ?>
    </ul>
  </div>
<?php 
} elseif (is_user_role('administrator') || is_user_role('editor')) {
    ?>
  <div class="wrap wrap--frame wrap--notification wrap--notification__send">
    <h4><?php 
    echo wpdc_get_user_name(get_query_var('author'));
    ?>
</h4>
    <form method="POST" action="">
      <input type="text" name="msguser" placeholder="Mensaje rápido a <?php 
    echo wpdc_get_user_name(get_query_var('author'));
    ?>
"> 
      <div class="options">
        <label for="sendmsg">Enviar</label>
      </div>
      <input type="submit" id="sendmsg" class="hidden" name="notification" value="message"></button>
      <input type="hidden" name="action" value="update-notification"/>
    </form>
  </div>
<?php 
}
Example #8
0
            ?>
						</figure>
					</div>
				<?php 
        }
        ?>

				<div class="wrap wrap--content">
					<h3 class="title title--article__sub"><?php 
        the_title();
        ?>
</h3>
					<p class="info info--post">
					<?php 
        if (!is_user_role('administrator', get_the_author_meta('ID'))) {
            echo 'Por <a href="' . get_author_posts_url(get_the_author_meta('ID')) . '">' . wpdc_get_user_name(get_the_author_meta('ID')) . '</a> ';
        }
        ?>
					<span class="js-date"><?php 
        echo get_the_date('Y-m-d H:i:s');
        ?>
</span><p>
					<?php 
        if (function_exists('the_subtitle')) {
            ?>
<h3 class="subtitle subtitle--article"><?php 
            the_subtitle();
            ?>
</h3><?php 
        }
        ?>
Example #9
0
    } elseif (is_author()) {
        ?>
    
    <?php 
        include locate_template('templates/forms/form-messageuser.php');
        ?>

  <?php 
    } else {
        ?>



  <div class="wrap wrap--frame">
    <h4 class="title">Hola <?php 
        echo wpdc_get_user_name(get_current_user_id());
        ?>
</h4>

      <div class="wrap wrap--frame wrap--flex">
        <div class="wrap wrap--frame wrap--frame__middle">
          <p id="notificationcount" class="notificationresume">
            <?php 
        comments_number('Todo está en regla ¡Que tengas un buen día!', 'Tienes <span class="number">1</span> notificación pendiente:', 'Tienes <span class="number">%</span> notificaciones pendientes:');
        ?>
          </p>
        </div>
        <div class="wrap wrap--frame wrap--frame__middle">
          <p class="notificationresume text text--right">
            <a id="archivelaunch" class="action js-section-launch <?php 
        if (!$comments_trash) {