Accueil

Lien Accueil


Arts visuels

<?php

global $user;
$type_artiste = 1;
if (empty($_GET["u"]))
{
#$query = "select uid, name from users WHERE status = 1 AND NOT EXISTS (SELECT uid FROM users_roles WHERE users.uid = users_roles.uid AND rid > 1) ORDER BY name;";
$query = "select uid from users, field_data_field_prenom, field_data_field_nom, field_data_field_typeartiste WHERE status = 1 AND field_data_field_prenom.entity_id = users.uid AND field_data_field_nom.entity_id = users.uid AND field_data_field_prenom.deleted = 0 AND field_data_field_nom.deleted = 0 AND field_data_field_typeartiste.entity_id = users.uid AND field_data_field_typeartiste.field_typeartiste_value = $type_artiste AND NOT EXISTS (SELECT uid FROM users_roles WHERE users.uid = users_roles.uid AND rid > 1) ORDER BY field_data_field_nom.field_nom_value, field_data_field_prenom.field_prenom_value, users.name;";
$result = db_query($query);
foreach ($result as $utilisateur) { $utilisateur_id = $utilisateur->uid; break; }

$user_fields = user_load($utilisateur_id);
#print_r($user_fields);

#print render($content["field_description"]);
#print render(media_filter($user_description));
}
else
{
$user_id = (int) $_GET["u"];
$user_fields = user_load($user_id);

#$user_description = $user_fields->field_description["und"]["0"]["value"];
#print render(media_filter($user_description));
}
$bool_user_profil = (((isset($user_fields->field_typeartiste["und"]["0"]) && ($user_fields->field_typeartiste["und"]["0"]["value"] == $type_artiste))) ||
((isset($user_fields->field_typeartiste["und"]["1"]) && ($user_fields->field_typeartiste["und"]["1"]["value"] == $type_artiste))) ||
((isset($user_fields->field_typeartiste["und"]["2"]) && ($user_fields->field_typeartiste["und"]["2"]["value"] == $type_artiste))) ||
((isset($user_fields->field_typeartiste["und"]["3"]) && ($user_fields->field_typeartiste["und"]["3"]["value"] == $type_artiste))));

if ($bool_user_profil)
{
$user_bio = $user_fields->field_bio["und"]["0"]["url"];
if (arg(0, $user_bio) == 'node' && is_numeric(arg(1, $user_bio)))
{
$bio_nid = arg(1, $user_bio);
}
else
{
$temp_bio_nid = drupal_lookup_path('source', $user_bio);
$bio_nid = arg(1, $temp_bio_nid);
}
}

$result = db_query("SELECT title, nid FROM {node} WHERE nid = '$bio_nid';");
foreach ($result as $row)
{
$bio_title = $row->title;
break;
}

echo '<h1 class="title" id="page-title">' . $bio_title . '</h1>';
$node = node_load($bio_nid);
print render(_video_filter_process(media_filter($node->field_profil['und']['0']['value'])));
?>