protected function tableCell_from($message) { $direction_in = $message->IdReceiver == $_SESSION['IdMember']; $contact_username = $direction_in ? $message->senderUsername : $message->receiverUsername; $date_sent = $message->DateSent; $date_created = $message->created; $layoutbits = new MOD_layoutbits(); $date_string = date("M d, Y - H:i", strtotime($date_created)); ?> <table><tr> <td> <?php echo MOD_layoutbits::PIC_50_50($contact_username, ''); ?> </td> <td> <a class="username" href="members/<?php echo $contact_username; ?> "><strong><?php echo $contact_username; ?> </strong></a> <br /> <span class="small" title="<?php echo $date_created; ?> "><?php echo $layoutbits->ago(strtotime($date_created)); ?> </span> </td> </tr></table> <?php }
protected function column_col3() { $words = $this->getWords(); $member = $this->member; $visitor_count = $this->member->getVisitorCount(); $layoutbits = new MOD_layoutbits(); $purifier = MOD_htmlpure::getBasicHtmlPurifier(); if (!$visitor_count) { echo $words->get("ProfileNoVisitors"); return; } $params = new StdClass(); $params->strategy = new HalfPagePager('right'); $params->items = $visitor_count; $params->items_per_page = 20; $pager = new PagerWidget($params); $pager->render(); echo '<div class="myvisitors">'; foreach ($member->getVisitorsSubset($pager) as $m) { $image = new MOD_images_Image('', $m->Username); $image = MOD_layoutbits::PIC_50_50($m->Username, '', $style = 'float_left framed'); if ($m->HideBirthDate == "No") { $m->age = floor($layoutbits->fage_value($m->BirthDate)); } else { $m->age = $words->get("Hidden"); } echo <<<HTML <div class="subcolumns"> <div class="c33l"> <div class="subcl"> {$image} <div class="userinfo"> <a class="username" href="members/{$m->Username}">{$m->Username}</a><br /> <p class="small">{$words->getFormatted("visited")}: {$layoutbits->ago(strtotime($m->visited))}</p> <p class="small">{$words->getFormatted("yearsold", $m->age)}, {$m->city}</p> </div> </div> </div> <div class="c66r"> <div class="subcr"> <div class="profilesummary">{$purifier->purify(stripslashes($words->mInTrad($m->ProfileSummary, $language_id = 0, true)))}</div> </div> </div> </div> HTML; } echo "</div>"; }
/** * singleton getter * * @param void * @return PApps */ public static function get() { if (!isset(self::$_instance)) { $c = __CLASS__; self::$_instance = new $c(); } return self::$_instance; }
public function render() { $numberOfMembers = 12; $memberships = $this->_group->getLastLoggedInMembers($numberOfMembers); foreach ($memberships as $membership) { echo <<<HTML <div class="groupmembers center float_left"> HTML; echo MOD_layoutbits::PIC_50_50($membership->Username); echo <<<HTML <a href="members/{$membership->Username}">{$membership->Username}</a> </div> HTML; } }
public function render() { $memberships = $this->_group->getMembers(); for ($i = 0; $i < 6 && $i < count($memberships); $i++) { ?> <div class="groupmembers center float_left"> <?php echo MOD_layoutbits::PIC_50_50($memberships[$i]->Username); ?> <a href="members/<?php echo $memberships[$i]->Username; ?> "><?php echo $memberships[$i]->Username; ?> </a> </div> <?php } }
<?php } ?> <div class="profile float_left" > <p class="center"> <?php if (isset($_SESSION['Username']) && $e['memberdata']->Username == $_SESSION['Username']) { $username = $words->get('me'); $myself = true; } else { $username = $e['memberdata']->Username; $myself = false; } ?> <?php echo MOD_layoutbits::PIC_30_30($e['memberdata']->Username, '', $style = ''); ?> <br /> <span title="<?php echo $e['memberdata']->City; ?> , <?php echo $e['memberdata']->Country; ?> " ><?php echo '<a href="members/' . $e['memberdata']->Username . '">' . $username . '</a>'; ?> </span> </p> </div> <!-- profile float_left --> <?php
protected function column_col3() { $words = new MOD_words(); $message = $this->message; $purifier = new MOD_htmlpure(); $purifier = $purifier->getMessagesHtmlPurifier(); $contact_username = $message->senderUsername; $model = new MembersModel(); $direction_in = true; if ($contact_username == $_SESSION['Username']) { $contact_username = $message->receiverUsername; $direction_in = false; } $member = $model->getMemberWithUsername($contact_username); ?> <div id="message" class="floatbox"> <div id="shade_top"></div> <div id="buttonstop"> <p class="floatbox"> <?php if ($direction_in) { ?> <a class="button float_left" href="messages/<?php echo $message->id; ?> /reply"><?php echo $words->get('replymessage'); ?> </a> <?php if ($message->InFolder == 'Spam') { ?> <a class="button float_right" href="messages/<?php echo $message->id; ?> /nospam"><?php echo $words->get('marknospam'); ?> </a> <?php } else { ?> <a class="button float_right" href="messages/<?php echo $message->id; ?> /spam"><?php echo $words->get('markspam'); ?> </a> <?php } ?> <?php } else { ?> <a class="button float_left" href="messages/<?php echo $message->id; ?> /edit"><?php echo $words->get('editmessage'); ?> </a> <?php } ?> <a class="button float_right" href="messages/<?php echo $message->id; ?> /delete" onclick="return confirm ('<?php echo $words->getBuffered('MessagesWarningConfirmDelete'); ?> ')"><?php echo $words->get('delmessage'); ?> </a> <?php echo $words->flushBuffer(); ?> </p> </div> <!-- buttonstop --> <div id="messageheader" class="floatbox"> <div id="messageside" class="float_right"> <p class="small grey"> <?php echo $words->get('LivesIn'); ?> <strong><?php echo $member->City; ?> , <?php echo $member->Country; ?> </strong> <br/> <?php echo $words->get('Speaks'); ?> <?php $languages = $member->get_languages_spoken(); if (count($languages) > 0) { $ii = 0; $max = count($languages); foreach ($languages as $language) { $space = $ii != $max - 1 ? ', ' : ''; ?> <strong><span title="<?php echo $words->getSilent('LanguageLevel_' . $language->Level); ?> "><?php echo $language->Name; echo $space; ?> </span> </strong><?php echo $words->flushBuffer(); $ii++; } } ?> </p> <p class="small grey"> <a href="messages/with/<?php echo $contact_username; ?> "><img src="images/icons/comments.png" alt="<?php echo $words->getSilent('messages_allmessageswith', $contact_username); ?> " title="<?php echo $words->getSilent('messages_allmessageswith', $contact_username); ?> "/> <?php echo $words->getSilent('messages_allmessageswith', $contact_username); ?> </a> </p> </div> <!-- messageside --> <p class="float_left"> <?php echo MOD_layoutbits::PIC_50_50($contact_username); ?> </p> <p class=""> <span class="grey"><?php echo $direction_in ? $words->get('MessageFrom', '<a href="members/' . $contact_username . '">' . $contact_username . '</a>') : $words->get('MessageTo', '<a href="members/' . $contact_username . '">' . $contact_username . '</a>'); ?> </span> </p> <p class=""> <span class="grey"><?php echo $words->get('MessagesDate'); ?> : </span> <?php echo date($words->getSilent('DateFormatShort'), strtotime($message->created)); ?> </p> </div> <div id="messagecontent"> <p class="text"> <?php echo $purifier->purify($message->Message); ?> </p> </div> <!-- messagecontent --> <div id="messagefooter"> <p class="floatbox"> <?php if ($direction_in) { ?> <a class="button float_left" href="messages/<?php echo $message->id; ?> /reply"><?php echo $words->get('replymessage'); ?> </a> <?php if ($message->InFolder == 'Spam') { ?> <a class="button float_right" href="messages/<?php echo $message->id; ?> /nospam"><?php echo $words->get('marknospam'); ?> </a> <?php } else { ?> <a class="button float_right" href="messages/<?php echo $message->id; ?> /spam"><?php echo $words->get('markspam'); ?> </a> <?php } ?> <?php } else { ?> <a class="button float_left" href="messages/<?php echo $message->id; ?> /edit"><?php echo $words->get('editmessage'); ?> </a> <?php } ?> <a class="button float_right" href="messages/<?php echo $message->id; ?> /delete"><?php echo $words->get('delmessage'); ?> </a> </p> </div> <!-- messagefooter --> <div id="shade"></div> </div> <!-- message --> <?php echo $words->flushBuffer(); ?> <?php }
<div id="profile"> <div id="profile_notes" class="floatbox box"> <?php $vars = array(); $words = $this->words; $layoutbits = new MOD_layoutbits(); $member = $this->member; $Username = $member->Username; $edit_mode = false; $categories = $this->loggedInMember->getNoteCategories(); $mem_redirect = $this->layoutkit->formkit->getMemFromRedirect(); if (!$mem_redirect) { $note = $this->loggedInMember->getNote($this->member); if (!isset($note)) { $vars['errors'] = 'ProfileNoteDeleteDoesntExist'; } } else { $vars = $mem_redirect->post; $note = new StdClass(); $note->Category = $vars['ProfileNoteCategory']; $note->CategoryFree = $vars['ProfileNoteCategoryFree']; $note->Comment = $vars['ProfileNoteComment']; } // Display errors from last submit if (isset($vars['errors'])) { foreach ($vars['errors'] as $error) { echo '<div class="error">' . $words->get($error) . '</div>'; } } $formkit = $this->layoutkit->formkit; $callback_tag = $formkit->setPostCallback('MembersController', 'deleteNoteCallback');
</tr> <?php } ?> <?php for ($ii = 0; $ii < $iiMax; $ii++) { $m = $list[$ii]; ?> <tr class="<?php echo $styles[$ii % 2]; ?> "> <td align="center"> <?php echo MOD_layoutbits::PIC_50_50($m->Username); ?> <br /> <a class="username" href="bw/member.php?cid=<?php echo $m->Username; ?> "><?php echo $m->Username; ?> </a> </td> <td align="center"><?php echo $m->CityName; ?> </td> <td align="center"><?php
?> </a> <?php } ?> </h2> <p class="grey"> <?php echo $agestr; if ($occupation != null) { echo ", " . $occupation; } ?> <br /> <?php $strGender = MOD_layoutbits::getGenderTranslated($member->Gender, $member->HideGender, true); if (!empty($strGender)) { echo $strGender . "<br />"; } ?> <?php if ($this->loggedInMember) { ?> <?php echo $words->get("MemberSince") . ': '; if (strtotime($member->created) > strtotime('-1 week')) { echo $words->get("LastLoginPrivacy"); } else { echo $layoutbits->ago(strtotime($member->created)); } echo $this->memberSinceDate($member);
echo $words->flushBuffer(); ?> </li> </ul> <?php // ### NEW To be programmed: show the first visitor, then the second. !! Different div's (c50l, c50r)! ### $next_trips = MOD_trips::get()->RetrieveVisitorsInCityWithAPicture($_SESSION['IdMember']); echo $next_trips ? '<h3>' . $words->getFormatted('RecentMemberCity') . '</h3>' : ''; for ($ii = 0; $ii < count($next_trips); $ii++) { $m = $next_trips[$ii]; $tripDate = explode(" ", $m->tripDate); ?> <p class="floatbox UserpicFloated"> <?php echo MOD_layoutbits::PIC_30_30($m->Username, '', $style = 'float_left framed'); echo $words->flushBuffer(); ?> <?php echo '<a href="members/' . $m->Username . '">' . $m->Username . '</a>'; ?> <br /> <?php echo $m->city; ?> / <?php echo $m->country; ?> <br /> <?php echo '<a href="blog/' . $m->Username . '/' . $m->tripId . '">' . $words->get('ComingOn') . ' ' . $tripDate[0] . '</a>';
"><img src="images/icons/comments.png" alt="<?php echo $words->getSilent('messages_allmessageswith', $receiver_username); ?> " title="<?php echo $words->getSilent('messages_allmessageswith', $receiver_username); ?> " /> <?php echo $words->getSilent('messages_allmessageswith', $receiver_username); ?> </a> </p> </div> <!-- messageside --> <div class="float_left"> <?php echo MOD_layoutbits::PIC_50_50($receiver_username); ?> </div> <div class="float_left"> <?php if (!isset($message->DateSent)) { ?> <h3><?php echo $words->get('MessageCompose'); ?> </h3> <?php } ?> <?php if (isset($message->DateSent) && isset($this->edit)) {
$member = $this->member; //print_r($this->model->get_profile_language()); //just to showcase the language selection method below while the //profile language switch isn't ready for action //not sure if non-english profile should be shown as default in production //$profile_language = $_SESSION['IdLanguage']; $lang = $this->model->get_profile_language(); $profile_language = $lang->id; $profile_language_code = $lang->ShortCode; $profile_language_name = $lang->Name; $words = $this->getWords(); //$words->setLanguage('fr'); $ww = $this->ww; $wwsilent = $this->wwsilent; $comments_count = $member->count_comments(); $layoutbits = new MOD_layoutbits(); $right = new MOD_right(); $agestr = ""; if ($member->age == "hidden") { $agestr .= $ww->AgeHidden; } else { $agestr = $ww->AgeEqualX($layoutbits->fage_value($member->BirthDate)); } $messengers = $member->messengers(); $website = $member->WebSite; $languages = $member->get_profile_languages(); $occupation = $member->get_trad("Occupation", $profile_language, true); $trips_array = $member->getTripsArray(); $trips = $trips_array[0]; $trip_data = $trips_array[1]; if ($this->myself) {
?> </span> <?php } else { ?> <?php if ($option->modifier) { ?> <h4><?php echo $words->get('SuggestionOptionModifiedBy'); ?> </h4> <div class="userinfo"> <div class="picbox_activities float_left"> <?php echo MOD_layoutbits::PIC_30_30($option->modifier->Username, '', $style = 'framed float_left'); ?> <a class="username" href="members/<?php echo $option->modifier->Username; ?> "> <?php echo $option->modifier->Username; ?> </a><br /> <span class="small"><?php echo $option->modified; ?> </span> </div> </div>
?> </a> </h3> <?php if ($blog->name) { if ($bloggeo = $this->model->getBlogGeo($blog->blog_geonameid)) { $country = $bloggeo->getCountry(); $countryname = $country->name; } else { $countryname = ''; } echo "<span class='trip_author'>{$blog->name}, {$countryname}</span><br />"; } if ($blog->blog_text) { $blogtext = $blog->blog_text; $moreLink = '<br /><a href="blog/' . $trip->handle . '/' . $blogid . '">' . $words->get('ReadMore') . ' ...</a>'; echo '<div>' . MOD_layoutbits::truncate_words($blogtext, 60, $moreLink) . '</div>'; } ?> <div> <?php if ($member && $isOwnTrip) { ?> <a href="blog/edit/<?php echo $blogid; ?> "><img src="styles/css/minimal/images/iconsfam/pencil.png" style="vertical-align:bottom;" alt="<?php echo $words->get('Trip_EditMyOwnSubTrip'); ?> " /></a> <a href="blog/edit/<?php echo $blogid; ?>
} else { $locationName = ''; $countryName = ''; } echo '<td><div class="small grey">' . $words->get('ActivityListLocation') . '</div><p>' . $locationName . '<br /> ' . $countryName . '</p></td>'; echo '<td><div class="small grey">' . $words->get('ActivityListAttendees') . '</div><p>'; if ($activity->attendeesYes != 0) { echo $activity->attendeesYes . ' ' . $words->get('ActivitiesNumbAttendeesYes') . '<br />'; } if ($activity->attendeesMaybe != 0) { echo $activity->attendeesMaybe . ' ' . $words->get('ActivitiesNumbAttendeesMaybe'); } echo '</p></td><td width="112px"><div class="small grey">' . $words->get('ActivitiesOrganizedBy') . '</div>'; $organizers = ''; foreach ($activity->organizers as $organizer) { $organizers .= MOD_layoutbits::PIC_40_40($organizer->Username, '', $style = 'framed float_left') . " "; } echo substr($organizers, 0, -1) . '</td>'; echo '<td>'; if ($activity->status == 0) { $activityInTheFuture = time() - 24 * 60 * 60 < strtotime($activity->dateTimeEnd); if ($this->member && in_array($this->member->id, array_keys($activity->organizers)) && $activityInTheFuture) { echo '<a href="activities/' . $activity->id . '/edit">' . '<img src="images/icons/comment_edit.png" title="' . $words->getBuffered('ActivityEdit') . '" alt="' . $words->getBuffered('ActivityEdit') . '" />' . $words->flushBuffer() . '</a>'; } } else { echo '<img src="images/icons/cancel.png" title="' . $words->getBuffered('ActivityCancelled') . '" alt="' . $words->getBuffered('ActivityCancelled') . '" />' . $words->flushBuffer(); } echo '</td>'; echo '</tr>'; $count++; }
echo $this->suggestion->created; ?> </span> </div> </div> <?php if ($this->suggestion->modifier) { ?> <h3><?php echo $words->get('SuggestionModifiedBy'); ?> </h3> <div class="userinfo"> <div class="picbox_activities float_left"> <?php echo MOD_layoutbits::PIC_50_50($this->suggestion->modifier->Username, '', $style = 'framed float_left'); ?> <a class="username" href="members/<?php echo $this->suggestion->modifier->Username; ?> "> <?php echo $this->suggestion->modifier->Username; ?> </a><br /> <span class="small"><b></b></span><br /> <span class="small"><?php echo $this->suggestion->modified; ?> </span> </div>
<a href="members/<?php echo $comment->user_handle; ?> "><?php echo $comment->user_handle; ?> </a> <a href="blog/<?php echo $comment->user_handle; ?> " title="Read blog by <?php echo $comment->user_handle; ?> "><img src="images/icons/blog.gif" alt="" /></a> - <?php echo MOD_layoutbits::ago($comment->unix_created); ?> <a href="#" title="<?php echo date($format['short'], $comment->unix_created); ?> ">(i)</a> </div> <div class="text"><?php echo nl2br(htmlentities($comment->text, ENT_COMPAT, 'utf-8')); ?> </div> </td> </tr> </table> </div>
protected function teaserHeadline() { $words = $this->words; return '<h3 class="userpage">' . MOD_layoutbits::PIC_50_50($this->member->Username, '', $style = 'float_left') . ' <a href="members/' . $this->member->Username . '">' . $this->member->Username . '</a></h3>'; }
<?php echo '<h2 class="paddingtop">' . $words->get('members') . '</h2>'; $User = new APP_User(); $words = new MOD_words(); $layoutbits = new MOD_layoutbits(); $url = '/places/' . htmlspecialchars($this->countryName) . '/' . $this->countryCode . '/'; if ($this->regionCode) { $url .= htmlspecialchars($this->regionName) . '/' . $this->regionCode . '/'; } if ($this->cityCode) { $url .= htmlspecialchars($this->cityName) . '/' . $this->cityCode . '/'; } $loginUrlOpen = '<a href="login' . $url . '#login-widget">'; $loginUrlClose = '</a>'; if (!$this->members) { if ($this->totalMemberCount) { echo $words->get('PlacesMoreMembers', $words->getSilent('PlacesMoreLogin'), $loginUrlOpen, $loginUrlClose) . $words->flushBuffer(); } else { echo $words->get('PlacesNoMembersFound', htmlspecialchars($this->placeName)); } } else { if ($this->totalMemberCount != $this->memberCount) { echo $words->get('PlacesMoreMembers', $words->getSilent('PlacesMoreLogin'), $loginUrlOpen, $loginUrlClose) . $words->flushBuffer(); } // divide members into pages of Places::MEMBERS_PER_PAGE (20) $params = new StdClass(); $params->strategy = new HalfPagePager('right'); $params->page_url = $url; $params->page_url_marker = 'page'; $params->page_method = 'url';
echo implode(' - ', $e['reversetype']); ?> <?php } ?> </p> </div> <!-- float_left --> <div class="float_left" style="padding-right: 15px"> <p class="center"> <?php echo '<a href="bw/member.php?cid=' . $e['memberdata']->Username . '">' . $e['memberdata']->Username . '</a>'; ?> <br /> <?php echo MOD_layoutbits::PIC_50_50($e['memberdata']->Username, '', $style = 'framed'); ?> <br /> <span class="small grey"><?php echo $e['memberdata']->Country; ?> </span> </p> </div> <!-- float_left --> <?php } ?> </div> <!-- floatbox --> <?php }
<div class="subcr" > <?php /*<input type="hidden" name="<?=$callbackId ?>" value="1"/> */ $m = $this->member2; $verification_status = $m->verification_status; if ($verification_status) { $verification_text = $words->getSilent('verifymembers_' . $verification_status); } ?> <div class="row"> <table> <tr> <td><?php echo MOD_layoutbits::PIC_50_50($m->Username, '', $style = 'framed'); ?> </td> <td> <?php echo '<a href="members/' . $m->Username . '">' . $m->Username . '</a>'; ?> <?php echo $verification_status ? '<img src="images/icons/shield.png" alt="' . $verification_text . '" title="' . $verification_text . '">' : ''; ?> <br /> <?php echo $m->country; ?> </td> </tr>
public function get_age() { if ($this->HideBirthDate == 'Yes') { return 'hidden'; } $layoutbits = new MOD_layoutbits(); return $layoutbits->fage_value($this->BirthDate); }
public function teasermain() { $words = new MOD_words(); $thumbPathMember = MOD_layoutbits::smallUserPic_userId($_SESSION['IdMember']); //$imagePathMember = MOD_user::getImage(); // We will mark the fact the member has or has no picture here, this is based on the returned default picture et something if (strpos($thumbPathMember, "et_male.square") !== false or strpos($thumbPathMember, "et.square") !== false or strpos($thumbPathMember, "et_female.square") !== false) { $_SESSION['MemberHasNoPicture'] = 1; } else { if (isset($_SESSION['MemberHasNoPicture'])) { unset($_SESSION['MemberHasNoPicture']); } } $_newMessagesNumber = $this->_model->getNewMessagesNumber($_SESSION['IdMember']); if ($_newMessagesNumber > 0) { $_mainPageNewMessagesMessage = $words->getFormatted('MainPageNewMessages', $_newMessagesNumber); } else { $_mainPageNewMessagesMessage = $words->getFormatted('MainPageNoNewMessages'); } require 'templates/teaser_main.php'; }
public function getCommentGuidelinesRead() { $layoutbits = new MOD_layoutbits(); return intval($layoutbits->getPreference("ReadCommentGuidelines")); }
BW Rox is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. BW Rox is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/> or write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ $User = APP_User::login(); $words = new MOD_words(); $layoutbits = new MOD_layoutbits(); ?> <?php $uri = ForumsView::getURI(); if ($threads = $boards->getThreads()) { ?> <table class="forumsboardthreads floatbox"> <?php $threadsliced = array_slice($threads, 0, 5); foreach ($threadsliced as $cnt => $thread) { $url = ForumsView::threadURL($thread); if ($url[0] == 's') {
echo $m->FullName; ?> <br /><?php echo $m->age; ?> </td> <td><?php echo $m->country; ?> <br/><?php echo $m->city; ?> </td> <td> <?php echo $words->getFormatted("MemberSinceColumn", MOD_layoutbits::ago(strtotime($m->created))); ?> </td> <td> <a href="members/<?php echo $m->Username; ?> /comments"><?php echo $words->getFormatted("ViewComments") . "(" . $m->NbComments . ")"; ?> </a><br/> <?php echo $purifier->purify(stripslashes($words->mInTrad($m->ProfileSummary, $language_id = 0, true))); ?> </td> </tr>
<?php // Hide the admin list if no user is logged in (which means that visible lis if ($memberCount == $visibleMemberCount) { ?> <br><br> <h4><?php echo $words->get('GroupAdmins'); ?> </h4> <div class="floatbox"> <?php $admins = $this->group->getGroupOwners(); if (isset($admins) && !empty($admins)) { foreach ($admins as $admin) { echo '<div class="groupmembers center float_left">'; echo MOD_layoutbits::PIC_40_40($admin->Username); echo '<div><a href="members/' . $admin->Username . '">' . " " . $admin->Username . '</a></div></div>'; } } else { echo $words->get('GroupNoAdmin'); } ?> </div> <?php if ($this->isGroupMember()) { ?> <div class="row clearfix"> <a class="button" href="groups/<?php echo $this->group->id; ?> /leave">
<div class="float_right" style="padding-top: 1em"> <form method="get" action="blog/search/" class="def-form" id="blog-search-form"> <div id="search" class="row"> <input type="text" id="search-field" name="s" /> <input type="submit" value="Search" class="submit"<?php echo isset($submitName) && !empty($submitName) ? ' name="' . $submitName . '"' : ''; ?> /> </div> </form> </div> <h1><a href="blog"><?php echo $words->getFormatted('blogs'); ?> </a></h1> <?php $titleSetting = false; /* TODO: Create a user-setting for a blog-title $titleSetting = A PP_User::getSetting($userId, 'blog_title'); */ if ($userHandle) { if (!$titleSetting) { echo MOD_layoutbits::PIC_50_50($userHandle, '', $style = 'framed float_left'); echo '<h1>' . $words->getFormatted('blogUserPublicTitle', $userHandle) . '</h1>'; } else { echo '<h1>' . $titleSetting->value . '</h1>'; } } echo $words->flushBuffer(); ?> </div>
/** * * Runs a members search with passed restrictions and returns * a list of matches * * @param array $vars: input variables to be passed back (passed by reference) * @param string $tablelist: list of tables to query * @param string $where: WHERE condition * @param string $orderBy: ORDER BY for query * @param string $start: first match to show (from pagination) * @param string $limit: ORDER BY for query * * @return array list of matches (member records) * * @TODO: Optimise queries (jsfan) */ private function doSearch(&$vars, $tablelist, $where, $orderBy, $start = 0, $limit = 100) { $TMember = array(); // This query only fetch indexes (because SQL_CALC_FOUND_ROWS can be a pain) $str = 'SELECT SQL_CALC_FOUND_ROWS DISTINCT members.id AS IdMember, Username, geonames_cache.name AS CityName, geonames_countries.name AS CountryName, IF(members.ProfileSummary != 0, 1, 0) AS HasSummary, IF(DATEDIFF(NOW(), members.LastLogin) < 300, 1, 0) AS HasLoggedIn FROM (' . $tablelist . ') ' . $where . ' ' . $orderBy . ' LIMIT ' . $start . ',' . $limit; $qry = $this->dao->query($str); $result = $this->dao->query("SELECT FOUND_ROWS() as cnt"); $row = $result->fetch(PDB::FETCH_OBJ); $rCount = $row->cnt; $vars['rCount'] = $rCount; while ($rr = $qry->fetch(PDB::FETCH_OBJ)) { $sData = 'SELECT m.created, m.BirthDate, m.HideBirthDate, m.Accomodation, m.ProfileSummary, m.Gender, m.HideGender, date_format(m.LastLogin,\'%Y-%m-%d\') AS LastLogin, gc.latitude AS Latitude, gc.longitude AS Longitude FROM members AS m, geonames_cache AS gc, addresses AS a WHERE a.IdCity = gc.geonameid AND m.id = ' . $rr->IdMember . ' AND m.id = a.IdMember'; $qryData = $this->dao->query($sData); $rData = $qryData->fetch(PDB::FETCH_OBJ); $rr->created = $rData->created; $rr->BirthDate = $rData->BirthDate; $rr->HideBirthDate = $rData->HideBirthDate; $rr->Accomodation = $rData->Accomodation; $rr->ProfileSummary = $this->ellipsis($this->FindTrad($rData->ProfileSummary, true), 200); $rr->Gender = $rData->Gender; $rr->HideGender = $rData->HideGender; $rr->LastLogin = $rData->LastLogin; $rr->Latitude = $rData->Latitude; $rr->Longitude = $rData->Longitude; $sData = "\n SELECT\n COUNT(*) as NbComment\n FROM\n comments,\n members\n WHERE\n comments.IdToMember =" . $rr->IdMember . "\n AND\n members.id = comments.IdFromMember\n AND\n members.status IN ('Active')\n "; $qryData = $this->dao->query($sData); $rData = $qryData->fetch(PDB::FETCH_OBJ); $rr->NbComment = $rData->NbComment; $query = $this->dao->query('SELECT SQL_CACHE * FROM membersphotos WHERE IdMember=". $rr->IdMember . " AND SortOrder=0'); $photo = $query->fetch(PDB::FETCH_OBJ); if (isset($photo->FilePath)) { $rr->photo = $photo->FilePath; } else { $rr->photo = $this->DummyPict($rr->Gender, $rr->HideGender); } $rr->photo = MOD_layoutbits::linkWithPicture($rr->Username, $rr->photo, 'map_style'); if ($rr->HideBirthDate == "No") { $rr->Age = floor($this->fage_value($rr->BirthDate)); } else { $rr->Age = "Hidden"; } // push found record to list of members to be output array_push($TMember, $rr); } return $TMember; }