Hallo,
first of all I want to say that I am pretty new to Drupal, working and fooling around with Drupal for like 4 weeks max. Therefore any help is appreciated - thanx in advance!
Setting up Drupal was kind of easy but customizing I am stombling into a lot of problems. Some problems where resolved browsing the snipplets for custom profile pages but many problemes are still unresolved.
Today I want to ask for help on some major issue:
- Adding pictures of buddies to the profile
- Adding the guestbook to the profile pages
- Adding Contact information like "Mail me" button, Add to MSN / ICQ button to the main profile page
- Adding Information like User since, Last Online, Visits counter
- Adding a Player (Audio or Video or both> on profile page
- Adding User Gallery
Adding pictures of buddies to the profile
I tried the snipplet published here on this site but no matter how hard I tried the results were kind of wierd (Name left, picture right, lots of space inbetween both). My goal is it to have like a table or block or any other kind of container with style sheet position coordinates that always me to display buddy avatars / pictures and the corresponding user name above the picture (or below however). What is the right approach for this one?
Adding the guestbook to the profile pages
I have installed "Guestbook 5.x-1.0 A guestbook for drupal". It looks good but I do not seem to find any code that enables me to incluede the guestbook within the profiles. It is only accessable through the menu on the left - this kind of annoys my test users as they have to browse through a list of user to get to the guestbook. What they want is, when ever they enter a cool profile they want to leave their guestbook entry right there and they want other users to be able to see it right there.
Adding Contact information like "Mail me" button, Add to MSN / ICQ button to the main profile page
I know that there is a tab for mailing the user but the test users seem to favor one pager - everything should be on the main page because otherwise a lot of them don't see it. Also I want to have some code that enables the user to add the user to e.g. their MSN in case the user has provided that information.
Adding Information like User since, Last Online, Visits counter
This may not sound like a real importaint issue but people tent to prefer trying to communicate with people which are frequently on site rather than once ever 6 months. Therefore I tried the code posted here :
<?php
//Last logged in
global $user;
if ($user->uid>0){
$userid = arg(1);
//$userid = '1';
$u = user_load(array("uid" => $userid));
$output9 .= '<TABLE BORDER="1" CELLPADDING="1" CELLSPACING="3" WIDTH="100%"> <TR><TD BGCOLOR="#f5f4ff"><FONT SIZE=-1>';
$output9 .= '<FONT SIZE=-2><B>Akses:<BR> <FONT SIZE=-2>';
$output9 .= format_date($u->access,'short');
$output9 .= "</TD></TR></TABLE><BR>";
$output9 .= "</FONT></B><FONT SIZE=-1>";
$output9 .= '<center>';
$output9 .= "</center>";
print $output9;
}
?>
The code does work BUT everything after the code gets busted as only User 1 Informations are used after the code. I am not as firm with PHP as I should be but my guess is that with first 4 lines of the code the problem arises. So are there any other solutions then this to call an print the Last Online date? And what is the code to print out the time the user has been registered with the site?
Adding a Player (Audio or Video or both> on profile page
My goal is it to have players up and running within the profile pages to give users the power to indivually customize their profiel as much as possible. I have the following stuff up and running:
- Embedded Media Field 5.x-1.x-dev
- Embedded Media Import 5.x-1.x-dev
- Embedded Image Field 5.x-1.x-dev
- Embedded Video Field 5.x-1.x-dev
All of these seem to work fine with posting to blogs etc. but I don't have ANY clue how to use these to fullfil the task descriped above.
Adding User Gallery
I would also like to add a user gallery with access of vistors through ones profile but I don't even have a clue which module to use - so any help with this one is also strongly welcomed.
The current code of the user_profile.tpl
<style type="text/css">
.derName {
font-family: Arial, Helvetica, Sans-Serif;
font-size: xx-large;
font-weight: 900;
font-style: normal;
font-variant: normal;
text-transform: capitalize;
color: #000000;
background-color: #FF0000;
background-position: center;
border: thin #000000 dashed;
padding: 3px;
}
.derSlogan {
font-family: Arial, Helvetica, Sans-Serif;
font-size: large;
font-weight: 900;
font-style: oblique;
font-variant: normal;
text-transform: capitalize;
color: #000000;
top: 15px;
left: 120px;
text-decoration: underline overline;
padding: 8px
}
.anfang {
font-family: Arial, Helvetica, Sans-Serif;
font-size: large;
font-weight: 900;
font-style: oblique;
font-variant: normal;
color: #000000;
position: relative;
text-decoration: underline overline;
}
.box {
position: relative;
top: 35px;
border: thin #000000 dashed;
padding: 2px 2px 2px 2px;
margin: 2px 2px 2px 2px;
padding-bottom: 2px;
padding-left: 2px;
padding-right: 2px;
padding-top: 2px
z-index: -2
}
.box2 {
position: relative;
top: 35px;
padding: 2px 2px 2px 2px;
margin: 2px 2px 2px 2px;
padding-bottom: 2px;
padding-left: 2px;
padding-right: 2px;
padding-top: 2px
z-index: -2
}
.infos {position: relative; left: 30px}
</style>
<!-- User Avatar / Picture -->
<div style="position: Absolute; right: 15px; top: 100px; z-index: 2">
<?php
if ($user->picture) {
// show the picture, if there is one uploaded, if not, there ain't this value!
print theme('user_picture', $user);
}
else {
// show the default picture
print '<img src="/'.variable_get('user_picture_default', 'images/site/noway.gif').'" alt="Kein Bild hochgeladen" />';
}
?>
</div>
<!-- User Profile start with add to buddies -->
<span class="derName"><?php print $user->name ?></span>
<div class="box2">
<?php if($user->profile_slogan): ?><span class="derSlogan"><?php print $user->profile_slogan ?></span><?php endif ?><p>
<?php
$time_period = variable_get('user_block_seconds_online', 600);
$users = db_query("SELECT DISTINCT(uid), access FROM {users} WHERE access >= %d AND uid = %s", time() - $time_period, $user->uid);
$total_users = db_num_rows($users);
if ($total_users == 1)
{
$output = t($user->name.' ist momentan online');
}
else
{
$output = t($user->name.' is momentan offline');
}
print $output;
?>
<p>
<?php
if ($GLOBALS['user']->uid != $user->uid) {
if (@in_array($user->uid, array_keys(buddylist_get_buddies($viewing_user->uid))) && user_access('maintain buddy list')) {
print l(t('Entferne @username von deiner Buddy Liste',array('@username'=>$user->name)), 'buddy/delete/'. $user->uid);
}
else {
if ($user->uid != $viewing_user->uid && user_access('maintain buddy list')) {
print l(t('Add @username zur Buddy Liste',array('@username'=>$user->name)), 'buddy/add/'. $user->uid);
}
}
}
?>
</div>
<!-- User Summary -->
<div class="box">
<p><span class="anfang">Zusammenfassung:</span></p>
<?php if($user->profile_sirname): ?><p style="position: relative; left: 30px">Vorname: <b style="position: absolute; left: 150px"><?php print $user->profile_sirname ?></b></p><?php endif ?>
<?php if($user->profile_city): ?><p style="position: relative; left: 30px">Stadt: <b style="position: absolute; left: 150px"><?php print $user->profile_city ?></b></p><?php endif ?>
<?php if($user->profile_state): ?><p style="position: relative; left: 30px">Bundesland: <b style="position: absolute; left: 150px"><?php print $user->profile_state ?></b></p><?php endif ?>
<?php if($user->profile_country): ?><p style="position: relative; left: 30px">Land: <b style="position: absolute; left: 150px"><?php print $user->profile_country ?></b></p><?php endif ?>
<!-- Calculating User Age -->
<?php
$year_diff = date("Y") - ($user->profile_birthday{year});
$month_diff = date("m") - ($user->profile_birthday{month});
$day_diff = date("d") - ($user->profile_birthday{day});
if ($month_diff < 0)
$year_diff--;
elseif ($month_diff == 0 && $day_diff < 0)
$year_diff--;
?>
<?php if($user->profile_birthday): ?><p style="position: relative; left: 30px">Alter: <b style="position: absolute; left: 150px"><?php print $year_diff; ?></b></p><?php endif ?>
</div>
<!-- User Details -->
<div class="box">
<p><span class="anfang">Ein paar Details:</span></p>
<?php if($user->profile_orientation): ?><p style="position: relative; left: 30px">Orientierung: <b style="position: absolute; left: 150px"><?php print $user->profile_orientation ?></b></p><?php endif ?>
<?php if($user->profile_status): ?><p style="position: relative; left: 30px">Status: <b style="position: absolute; left: 150px"><?php print $user->profile_status ?></b></p><?php endif ?>
<?php if($user->profile_job): ?><p style="position: relative; left: 30px">Job: <b style="position: absolute; left: 150px"><?php print $user->profile_job ?></b></p><?php endif ?>
<?php if($user->profile_size): ?><p style="position: relative; left: 30px">Größe: <b style="position: absolute; left: 150px"><?php print $user->profile_size ?></b></p><?php endif ?>
<?php if($user->profile_body): ?><p style="position: relative; left: 30px">Figur: <b style="position: absolute; left: 150px"><?php print $user->profile_body ?></b></p><?php endif ?>
<?php if($user->profile_Food): ?><p style="position: relative; left: 30px">Essen: <b style="position: absolute; left: 150px"><?php print $user->profile_food ?></b></p><?php endif ?>
<?php if($user->profile_smoking): ?><p style="position: relative; left: 30px">Rauchen: <b style="position: absolute; left: 150px"><?php print $user->profile_smoking ?></b></p><?php endif ?>
<?php if($user->profile_drinking): ?><p style="position: relative; left: 30px">Trinken: <b style="position: absolute; left: 150px"><?php print $user->profile_drinking ?></b></p><?php endif ?>
</div>
<!-- User because of what... Displaying the checkbox results -->
<div class="box">
<p><span class="anfang">Darum bin ich hier:</span></p>
<p style="position: relative; left: 30px">Chat: <b style="position: absolute; left: 150px"><?php print ($user->profile_chat == '1') ? "Ja" : "Nein"; ?></b></p>
<p style="position: relative; left: 30px">Freunde: <b style="position: absolute; left: 150px"><?php print ($user->profile_friends == '1') ? "Ja" : "Nein"; ?></b></p>
<p style="position: relative; left: 30px">Netzwerk: <b style="position: absolute; left: 150px"><?php print ($user->profile_network == '1') ? "Ja" : "Nein"; ?></b></p>
<p style="position: relative; left: 30px">Dating: <b style="position: absolute; left: 150px"><?php print ($user->profile_dating == '1') ? "Ja" : "Nein"; ?></b></p>
<p style="position: relative; left: 30px">Beziehung: <b style="position: absolute; left: 150px"><?php print ($user->profile_relation == '1') ? "Ja" : "Nein"; ?></b></p>
</div>
<!-- User interests, currently layout based on table as DIV container breaks entire site layout -->
<div class="box">
<p><span class="anfang">Interessen:</span></p>
<table width="600">
<?php if($user->profile_general): ?>
<tr>
<td width="180">
<p><span class="infos">Allgemein: </span>
</td>
<td>
<b><?php print $user->profile_general ?></b></td>
</tr>
<?php endif ?>
<?php if($user->profile_music): ?>
<tr>
<td width="180">
<p><span class="infos">Musik: </span><b>
</td>
<td><?php print $user->profile_music ?></b>
</td>
</tr>
<?php endif ?>
<?php if($user->profile_movies): ?>
<tr>
<td width="180">
<p><span class="infos">Filme: </span>
</td>
<td><b><?php print $user->profile_movies ?></b>
</td>
</tr>
<?php endif ?>
<?php if($user->profile_books): ?>
<tr>
<td width="180">
<p><span class="infos">Bücher: </span>
</td>
<td><b><?php print $user->profile_books ?></b>
</td>
</tr>
<?php endif ?>
</table>
</div>
<!-- User Hompage Link, opening new browser -->
<div class="box">
<?php $urlfieldname='profile_homepage' ;?>
<?php if($user->$urlfieldname): ?><p style="position: relative; left: 30px">Homepage: <b style="position: absolute; left: 150px"><a href="<?php print $user->$urlfieldname ?>" target="_blank"><?php print $user->$urlfieldname ?></a></b></p><?php endif ?>
</div>
<!-- User Extras, hard to layout with Styles -->
<div class="box">
<table>
<tr>
<td width="50%"><p><span class="anfang">Gruppen auf Misfit:</span></p></td>
<td width="50%"><p><span class="anfang">Freunde auf Misfit:</span></p></td>
</tr>
<tr>
<td width="50%" valign="top">
<ul><?php
$groups = $user->og_groups;
if($groups){
foreach($groups as $group){
echo "<li>";
print l($group[title], 'node/'.$group[nid]);
echo "</li>";
}
}
else {
echo "<li>$user->Ist in keiner Gruppe Mitglied</li>";
}
?></ul>
</td>
<td width="50%" valign="top">
<?php
if ( user_access('view buddy lists') || user_access('administer users') ) {
// if thisuser has friends, show friends
$output = '';
$i = 0;
$cnt = variable_get('buddylist_prof_buddies', 5);
if ($buddies = buddylist_get_buddies($user->uid)) {
foreach(array_keys($buddies) as $buddy) {
$account = user_load(array('uid' => $buddy));
$listbuddies[] = $account;
$i++;
if ($i > $cnt) {
break;
}
}
$output .= t('Buddies');
$output .= theme('user_list', $listbuddies);
$output .= '<br />';
if (count($buddies) > variable_get('buddylist_prof_buddies', 5)) {
$output .= '<div class="more-link">' . l(t('more'), 'buddylist', array('title' => t('View more.'))) . '</div>';
}
$sql = 'SELECT b.uid, u.name FROM {buddylist} b INNER JOIN {users} u ON b.uid = u.uid WHERE b.buddy = %d ORDER BY u.access DESC';
$result = db_query_range($sql, $user->uid, 0, $cnt);
while ($row = db_fetch_object($result)) {
$listbuddiesof[$row->uid] = $row;
}
$output .= t('Buddies of');
if ($listbuddiesof) {
$output .= theme('user_list', $listbuddiesof);
}
if (count($sql) > variable_get('buddylist_prof_buddies', 5)) {
$output .= '<div class="more-link">'. l(t('more'), 'buddylist/'. $user->uid .'/buddiesof', array('title' => t('View more.'))) .'</div>';
}
print $output;
}
}
?>
</td>
</tr>
</table>
</div>
Comments
I don't know what you have
I don't know what you have done so far but this will help you: http://shellmultimedia.com/node/274
It's nice
It's nice BUT it does not help me how ever as it is a walkthough how to create profiles based on nodeprofiles - what I want to do is expand the custom profiles following this How To : http://drupal.org/node/35728
I am also looking for same
I am also looking for same answers.....
subscribing.
------------
Volvo, Video, Velcro. (I came, I saw, I stuck around.)