public function testTimeSinceUpdate() { // 10 Minutes 1206028575/1206028586 $dataBaseTime = "2008-03-20 11:56:15"; //1206028598 $test10sec = 1206028585; $test10min = 1206029198; $test10hours = 1206064198; $test10days = 1206892572; //Seconds $arryUpdateTime = ProfileApp::timeSinceUpdate($dataBaseTime, $test10sec); $this->assertEquals(2, sizeof($arryUpdateTime)); $this->assertEquals('seconds', $arryUpdateTime['units']); $this->assertEquals(10, $arryUpdateTime['value']); //Minutes $arryUpdateTime = ProfileApp::timeSinceUpdate($dataBaseTime, $test10min); $this->assertEquals(2, sizeof($arryUpdateTime)); $this->assertEquals('minutes', $arryUpdateTime['units']); $this->assertEquals(10, $arryUpdateTime['value']); //Hours $arryUpdateTime = ProfileApp::timeSinceUpdate($dataBaseTime, $test10hours); $this->assertEquals(2, sizeof($arryUpdateTime)); $this->assertEquals('hours', $arryUpdateTime['units']); $this->assertEquals(10, $arryUpdateTime['value']); //Days $arryUpdateTime = ProfileApp::timeSinceUpdate($dataBaseTime, $test10days); $this->assertEquals(2, sizeof($arryUpdateTime)); $this->assertEquals('days', $arryUpdateTime['units']); $this->assertEquals(10, $arryUpdateTime['value']); }
function run() { if (!$this->Request->isEmpty('user')) { $id = $this->Request->get('user'); $name = $this->Request->get('show'); $size = $this->Request->getOr('size', '150'); $image = $this->Ctrl->getConf('root.dir') . '/data/user/' . $id . '/img/' . $size . 'x' . $size . '/' . $name; header('content-type: image/jpeg;'); echo file_get_contents($image); die; } return parent::run(); }
<?php /** * Profile Listing Page * */ require_once dirname(__FILE__) . "/ProfileApp.php"; // Get reference to our app, model and caclulated fields for display $app = new ProfileApp(); $updateOccured = $app->saveWorkChanges($_REQUEST); $user = $app->getUserData(); //$formDataArry=$app->getWFormData(); $page = 6; ?> <h1>Edit Profile</h1> <?php include dirname(__FILE__) . "/menu.inc"; if ($updateOccured) { ?> <fb:success><fb:message><strong>Success!</strong> Your changes have been saved. </fb:message></fb:success> <?php } ?> <div class="profile-editor-form"> <form id="form1" name="form1" method="post" action=""> <div id="work_history_1" class="work_position">
<?php /** * Profile Listing Page * */ require_once dirname(__FILE__) . "/ProfileApp.php"; // Get reference to our app, model and caclulated fields for display $app = new ProfileApp(); $updateOccured = $app->saveContactChanges($_REQUEST); $user = $app->getUserData(); $page = 2; ?> <h1>Edit Profile</h1> <?php include dirname(__FILE__) . "/menu.inc"; if ($updateOccured) { ?> <fb:success><fb:message><strong>Success!</strong> Your changes have been saved. </fb:message></fb:success> <?php } ?> <div class="profile-editor-form"> <form id="form1" name="form1" method="post" action=""> <table border="0" cellspacing="0"> <tr>
/** * Renders the users current status and a form which can be used to update * your status. */ public function getStatusBlock($flavor = 'wide') { $statusRow = new Status(); $statusRow = $statusRow->find($this->uid); $status_fbml[] = "<div id='profile_status' class='profile_status'><div id='status_caption{$flavor}'>\n"; if (is_null($statusRow)) { $status_text = "Status Unknown"; $status_fbml[] = "{$status_text}<br>\n"; //$status_fbml[]="And has never been updated.<br>\n"; } else { if (strtoupper(substr($statusRow->status, 0, 2)) == 'IS') { $status_text = $statusRow->status; $status_fbml[] = "{$status_text}<br>\n"; } else { $status_text = 'is ' . $statusRow->status; $status_fbml[] = "{$status_text}<br>\n"; } $theTime = time(); $updateParams = ProfileApp::timeSinceUpdate($statusRow->modified, time()); $timeSinceUpdate = $updateParams['value']; $timeUnitsSinceUpdate = $updateParams['units']; $status_fbml[] = "Updated {$timeSinceUpdate} {$timeUnitsSinceUpdate} ago.\n"; } if ($this->readOnly) { $status_fbml[] = "</div>\n"; } else { $status_fbml[] = "<a href='' onClick='toggleEdit{$flavor}();'><img src='" . RingsideApiClientsConfig::$webUrl . "/images/status_icon.gif'/><span style='font-style: normal; font-size: small; vertical-align: top; '>edit</span></a></div>\n"; } $status_fbml[] = "<form id='statusForm{$flavor}' name='statusForm{$flavor}' method='post' style='display: none;' ><fb:name firstnameonly='true' useyou='false' uid='{$this->uid}' /> \n"; $status_fbml[] = "<input name='action' type='hidden' value='saveStatus'/><input name='textfieldStatus' value='{$status_text}' type='text' id='textfieldStatus' size='14' />\n"; $status_fbml[] = "<a href=\"\" onClick=\"clearField{$flavor}(this);\">Clear Status</a> | <a href=\"\" onClick=\"toggleEdit{$flavor}();\">Cancel</a></form><br>\n"; $status_fbml[] = "</div><br>"; return $status_fbml; }
<?php include_once 'config.php'; require_once "ProfileApp.php"; $uid = $ringside->get_loggedin_user(); $readonly = false; if (array_key_exists('id', $_REQUEST)) { $uid = $_REQUEST['id']; $ringside->user = $uid; $readonly = true; } $flavor = $ringside->getFlavor(); $app = new ProfileApp($uid, $readonly, $ringside->api_client); $app->saveStatusChanges($_REQUEST); ?> <script language="JavaScript" type="text/javascript"> function toggle(obj) { var el = document.getElementById(obj); if ( el.style.display != 'none' ) { el.style.display = 'none'; } else { el.style.display = ''; } } function clearFieldsidebar(field){ document.forms["statusFormsidebar"].textfieldStatus.value=""; } function clearFieldwide(field){ document.forms["statusFormwide"].textfieldStatus.value="";
<?php /** * Profile Listing Page * */ require_once dirname(__FILE__) . "/ProfileApp.php"; require_once "ringside/web/RingsideWebUpload.php"; // Get reference to our app, model and caclulated fields for display $app = new ProfileApp(); $updateOccured = $app->savePicture($_REQUEST); $user = $app->getUserData(); $page = 7; ?> <h1>Edit Profile</h1> <?php include dirname(__FILE__) . "/menu.inc"; if ($updateOccured) { ?> <fb:success><fb:message><strong>Success!</strong> Your changes have been saved. </fb:message></fb:success> <?php } ?> <div class="profile-editor-form"> <div style="float:left; width:30%"> <h2>Current Picture</h2> <fb:profile-pic uid="<?php
<?php /** * Profile Listing Page * */ require_once dirname(__FILE__) . "/ProfileApp.php"; require_once 'ringside/api/clients/RingsideApiClients.php'; $ringside = new RingsideApiClients(RingsideSocialConfig::$apiKey, RingsideSocialConfig::$secretKey); $ringside->setLocalClient(true); $user = $ringside->require_login(); if ($user == null) { return; } // Get reference to our app, model and caclulated fields for display $app = new ProfileApp(); $updateOccured = $app->saveEditChanges($_REQUEST); $user = $app->getUserData(); $formDataArry = $app->getEditFormData(); //print("form data ".$user->userbasicprofile->political."zz<p>\n"); //var_dump($formDataArry); $page = 1; ?> <h1>Edit Profile</h1> <?php include dirname(__FILE__) . "/menu.inc"; if ($updateOccured) { ?> <fb:success><fb:message><strong>Success!</strong> Your changes have been saved. </fb:message></fb:success>
<?php /** * Personal Information Listing Page * */ require_once dirname(__FILE__) . "/ProfileApp.php"; // Get reference to our app, model and caclulated fields for display $app = new ProfileApp(); $updateOccured = $app->savePersonalChanges($_REQUEST); $user = $app->getUserData(); $page = 4; ?> <h1>Edit Profile</h1> <?php include dirname(__FILE__) . "/menu.inc"; if ($updateOccured) { ?> <fb:success><fb:message><strong>Success!</strong> Your changes have been saved. </fb:message></fb:success> <?php } ?> <div class="profile-editor-form"> <form id="form1" name="form1" method="post" action=""> <table border="0" cellspacing="0"> <tr>
<?php /** * Profile Listing Page * */ require_once dirname(__FILE__) . "/ProfileApp.php"; // Get reference to our app, model and caclulated fields for display $app = new ProfileApp(); $updateOccured = $app->saveEducationChanges($_REQUEST); $user = $app->getUserData(); //$formDataArry=$app->getEducationFormData(); $page = 5; ?> <h1>Edit Profile</h1> <?php include dirname(__FILE__) . "/menu.inc"; if ($updateOccured) { ?> <fb:success><fb:message><strong>Success!</strong> Your changes have been saved. </fb:message></fb:success> <?php } ?> <div class="profile-editor-form"> <form id="form1" name="form1" method="post" action=""> <div id="education_college_1" class="school">
<?php /** * Profile Listing Page * */ require_once dirname(__FILE__) . "/ProfileApp.php"; // Get reference to our app, model and caclulated fields for display $app = new ProfileApp(); $updateOccured = $app->saveRelationshipChanges($_REQUEST); $user = $app->getUserData(); $formDataArry = $app->getRelationshipFormData(); $page = 3; ?> <h1>Edit Profile</h1> <?php include dirname(__FILE__) . "/menu.inc"; if ($updateOccured) { ?> <fb:success><fb:message><strong>Success!</strong> Your changes have been saved. </fb:message></fb:success> <?php } ?> <div class="profile-editor-form"> <form id="form1" name="form1" method="post" action=""> <table border="0" cellspacing="5">