Skip to content
Snippets Groups Projects
Commit fe67e7fc authored by Matthew Juhl's avatar Matthew Juhl
Browse files

Get profile pages functional on mobile. CSS work is needed.

parent b25423d5
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,16 @@ ...@@ -11,7 +11,16 @@
*/ */
$iconsize = "medium";
// Load flexprofile model
require_once(dirname(dirname(dirname(dirname(dirname(__FILE__))))) . "/flexprofile/models/model.php");
// Load form profile model
require_once(dirname(dirname(dirname(dirname(dirname(__FILE__))))) . "/form/models/profile.php");
$iconsize = "large";
// wrap all profile info // wrap all profile info
echo "<div id=\"profile_info\">"; echo "<div id=\"profile_info\">";
...@@ -21,9 +30,10 @@ ...@@ -21,9 +30,10 @@
<?php <?php
// wrap the icon and links in a div // wrap the icon and links in a div
echo "<div id=\"profile_info_column_left\">";
echo "<div id=\"profile_icon_wrapper\">"; // TODO: move styles to mobile stylesheet
echo '<div id="profile_icon_wrapper" style="width: 100%; text-align: center;">';
// get the user's main profile picture // get the user's main profile picture
echo elgg_view( echo elgg_view(
"profile/icon", array( "profile/icon", array(
...@@ -35,36 +45,32 @@ ...@@ -35,36 +45,32 @@
); );
echo "</div>"; echo "</div><!-- /#profile_icon_wrapper -->";
echo "<div class=\"clearfloat\"></div>"; // display the users name
// display relevant links echo "<h2><a href=\"" . $vars['entity']->getUrl() . "\" rel=\"$rel\">" . $vars['entity']->name . "</a></h2>";
//echo elgg_view("profile/profilelinks", array("entity" => $vars['entity']));
// close profile_info_column_left
echo "</div>";
?>
// display relevant links
// TODO: determine if we want to keep these or not. They look bad right now.
echo elgg_view("profile/profilelinks", array("entity" => $vars['entity']));
<div id="profile_info_column_middle" >
<?php
$rel = ""; $rel = "";
if (page_owner() == $vars['entity']->guid) if (page_owner() == $vars['entity']->guid)
$rel = 'me'; $rel = 'me';
else if (check_entity_relationship(page_owner(), 'friend', $vars['entity']->guid)) else if (check_entity_relationship(page_owner(), 'friend', $vars['entity']->guid))
$rel = 'friend'; $rel = 'friend';
// display the users name
echo "<h2><a href=\"" . $vars['entity']->getUrl() . "\" rel=\"$rel\">" . $vars['entity']->name . "</a></h2>";
$owner = $vars['entity']->guid; $owner = $vars['entity']->guid;
$latest_wire = get_entities("object", "thewire", $owner, "", 1, 0, false, 0, null); $latest_wire = get_entities("object", "thewire", $owner, "", 1, 0, false, 0, null);
foreach($latest_wire as $lw){$status = $lw->description;} foreach($latest_wire as $lw){$status = $lw->description;}
echo "<div id=\"profilestatus\"> $status </div>"; echo "<div id=\"profilestatus\"><h6>Latest Wire Post</h6> $status </div>";
//check to see if the user is looking at their own profile //check to see if the user is looking at their own profile
if ($_SESSION['user']->guid == page_owner()){ if ($_SESSION['user']->guid == page_owner()){
//ADD A STATUS UPDATE BOX HERE
//TODO: ADD A STATUS UPDATE BOX HERE
} else { } else {
if (isloggedin()) { if (isloggedin()) {
...@@ -84,46 +90,91 @@ ...@@ -84,46 +90,91 @@
?> ?>
</div><!-- /#profile_info_column_middle -->
</div><!-- /#profile_info --> </div><!-- /#profile_info -->
<?php
// 0 open divs at this point
if ($vars['full'] == true) {
$form = flexprofile_get_profile_form($vars['entity']);
if ($form) {
if ($form->profile_format !== 'tabbed') {
$body = '';
$data = form_get_data_for_profile_summary_display($form, $vars['entity']);
}
}
}
?>
<div class="profile_nav"> <div class="profile_nav">
<a href="?view=mobile&p=activity">Activity </a><!-- | <a href="?view=mobile&p=mb">Message Board </a>-->| <a href="?view=mobile&p=info">Info </a> <!-- | <a href="?view=mobile&p=photos">Photos</a>--> <p><a href="?view=mobile&p=activity">Activity </a><!-- | <a href="?view=mobile&p=mb">Message Board </a>-->| <a href="?view=mobile&p=info">Info </a> <!-- | <a href="?view=mobile&p=photos">Photos</a>--></p>
</div> </div>
<?php if (get_input('p') == 'info') { <?php if (get_input('p') == 'info') {
$even_odd = null;
if (is_array($vars['config']->profile) && sizeof($vars['config']->profile) > 0)
foreach($vars['config']->profile as $shortname => $valtype) { $editdetails = elgg_echo("profile:edit");
if ($shortname != "description") { $body = '';
$value = $vars['entity']->$shortname; if ($vars['entity']->canEdit()) {
$body .= <<<END
<p class="profile_info_edit_buttons">
<a href="{$vars['url']}pg/profile/{$vars['entity']->username}/edit/">
$editdetails</a>
</p>
END;
}
// Simple XFN
$rel = "";
if (page_owner() == $vars['entity']->guid)
$rel = 'me';
else if (check_entity_relationship(page_owner(), 'friend', $vars['entity']->guid))
$rel = 'friend';
if ($vars['full'] == true) {
if ($form) {
if ($form->profile_format != 'tabbed') {
// do right column
if ($data['right']) {
foreach($data['right'] as $item) {
$value = $item->value;
if (!empty($value)) { if (!empty($value)) {
//This function controls the alternating class //This function controls the alternating class
$even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';
$body .= "<p class=\"{$even_odd}\"><b>";
$body .= $item->title.':</b> ';
$body .= $item->value;
$body .= "</p>";
?> }
<p class="<?php echo $even_odd; ?>"> }
<b><?php }
echo elgg_echo("profile:{$shortname}"); } else {
?>: </b> $body .= elgg_view('flexprofile/extended',array('entity'=>$vars['entity'],'embedded'=>true));
<?php }
echo elgg_view("output/{$valtype}",array('value' => $vars['entity']->$shortname)); } else {
?> $body .= elgg_echo('form:error_no_profile_form');
</p> }
<?php } } }?> }
<p class="profile_aboutme_title"><b><?php echo elgg_echo("profile:aboutme"); ?></b></p>
<?php
echo elgg_view('output/longtext', array('value' => $vars['entity']->description));
//echo autop(filter_tags($vars['entity']->description));
?>
<?php
if ($vars['entity']->canEdit()) { echo $body;
} else if (get_input('p') == 'activity' || get_input('p') == false){
?> ?>
<a href="<?php echo $vars['url']; ?>pg/profile/<?php echo $vars['entity']->username; ?>/edit/"><?php echo elgg_echo("profile:edit"); ?></a>
<?php } } else if (get_input('p') == 'activity' || get_input('p') == false){ ?>
<div id="profileriver"> <div id="profileriver">
<?php <?php
$type = ''; $type = '';
...@@ -133,7 +184,7 @@ $subject_guid = $vars['entity']->guid; ...@@ -133,7 +184,7 @@ $subject_guid = $vars['entity']->guid;
echo elgg_view_river_items($subject_guid, 0, $relationship_type, $type, $subtype, ''); echo elgg_view_river_items($subject_guid, 0, $relationship_type, $type, $subtype, '');
?> ?>
</div> </div> <!-- /#profileriver -->
<?php } else if (get_input('p') == 'mb'){ <?php } else if (get_input('p') == 'mb'){
// Get the user who is the owner of the message board // Get the user who is the owner of the message board
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment