Permalink
Browse files

Merge branch 'develop'

  • Loading branch information...
2 parents f902bad + 5347d95 commit 72e65f976c0a5b6e0747129a09541cf48521850a @thisismeonmounteverest thisismeonmounteverest committed May 20, 2016
@@ -152,6 +152,9 @@ public function termsOfUse() {
if (isset($this->route_vars['language'])) {
$lang = $this->route_vars['language'];
}
+ if ($lang === null) {
+ $lang = $_SESSION['lang'];
+ }
$page = new AboutGenericPage('terms', $lang);
$page->lang = $lang;
$page->setModel(new AboutModel());
@@ -24,9 +24,8 @@
$words = new MOD_words();
?>
+<?php if ($this->_lang != 'fr') { ?>
<p><?= $words->getFormatted('TermsOfUseWarning') ?></p>
-<?php if ($this->_lang === null) { ?>
- <p><?= $words->getFormatted('TermsOfUseTranslation', $_SESSION['lang']) ?></p>
<?php }?>
-<?= $words->getInLang('TermsOfUseFullText', $this->_lang === null ? 'fr' : $this->_lang); ?>
+<?= $words->getInLang('TermsOfUseFullText', $this->_lang); ?>
@@ -3760,34 +3760,11 @@ public function prepare_notification($postId, $type) {
// We reuse the $group entity from above
$subscriberEntities = $group->getEmailAcceptingMembers();
- $membersTemp = array();
foreach($subscriberEntities as $subscriber) {
$memberId = $subscriber->getPKValue();
if ($memberId == 0) continue;
if (array_search($memberId, $members) === false) {
- $membersTemp[] = $memberId;
- }
- }
- if (!empty($membersTemp)) {
- $count = 0;
- $query = "
- INSERT INTO
- posts_notificationqueue (
- `IdMember`,
- `IdPost`,
- `created`,
- `Type`,
- `TableSubscription`,
- `IdSubscription`
- )
- VALUES ";
- foreach($membersTemp as $member) {
- $query .= "(" . $member . ", " . $postId . ", now(), '" . $type . "', 'membersgroups', 0), ";
- $count++;
- }
- if ($count > 0) {
- $query = substr($query, 0, -2);
- $this->dao->query($query);
+ $members[$memberId] = $memberId;
}
}
}
@@ -3806,46 +3783,18 @@ public function prepare_notification($postId, $type) {
// just don't write notifications
return;
}
- $membersTemp = array();
while ($row = $res->fetch(PDB::FETCH_OBJ)) {
if ($row->subscriber > 0 && $row->notificationsEnabled) {
// if member already gets notification don't add one
if (array_search($row->subscriber, $members) === false) {
- $membersTemp[$row->subscriber] = $row->subscriptionId;
+ $members[$row->subscriber] = $row->subscriptionId;
}
} else {
// did member disable notifications for this thread?
if (array_search($row->subscriber, $members) !== false) {
- unset($membersTemp[$row->subscriber]);
- }
- }
- }
-
- if (!empty($membersTemp)) {
- $count = 0;
- $query = "
- INSERT INTO
- posts_notificationqueue (
- `IdMember`,
- `IdPost`,
- `created`,
- `Type`,
- `TableSubscription`,
- `IdSubscription`
- )
- VALUES ";
- foreach($membersTemp as $member => $subscriptionId) {
- if (($post->groupId == 0) || ($post->PostVisibility != 'GroupOnly' && $post->ThreadVisibility != 'GroupOnly')
- || (array_search($member, $groupMembers) !== false)) {
- $query .= "(" . $member . ", " . $postId . ", now(), '" . $type . "', 'members_threads_subscribed', '" . $this->dao->escape($subscriptionId) . "'), ";
- $members[] = $member;
- $count++;
+ unset($members[$row->subscriber]);
}
}
- if ($count > 0) {
- $query = substr($query, 0, -2);
- $this->dao->query($query);
- }
}
// Set notifications for subscribed tags
@@ -3866,18 +3815,18 @@ public function prepare_notification($postId, $type) {
return;
}
- $membersTemp = array(); // members that will receive a notification because of tags
while ($row = $res->fetch(PDB::FETCH_OBJ)) {
// Unfortunately the DB has a lot of faulty entries
$subscriber = $row->subscriber;
if ($subscriber > 0 && $row->notificationsEnabled) {
// Add only if the member doesn't already get a notification
if (array_search($subscriber, $members) === false) {
- $membersTemp[$subscriber] = $row->subscriptionId;
+ $members[$subscriber] = $row->subscriptionId;
}
}
}
- if (!empty($membersTemp)) {
+
+ if (!empty($members)) {
$count = 0;
$query = "
INSERT INTO
@@ -3890,7 +3839,7 @@ public function prepare_notification($postId, $type) {
`IdSubscription`
)
VALUES ";
- foreach($membersTemp as $member => $subscriptionId ) {
+ foreach($members as $member => $subscriptionId ) {
if ($member == 0) continue;
if (($post->groupId == 0) || ($post->PostVisibility != 'GroupOnly' && $post->ThreadVisibility != 'GroupOnly')
|| (array_search($member, $groupMembers) !== false)) {
@@ -22,8 +22,12 @@
</div> <!-- c50r -->
</div> <!-- subcolumns -->
-
- <h3><?=$words->get('PreferencePublicProfile')?></h3>
+ <?php
+ $isPublic = $this->member->get_publicProfile();
+ if ($isPublic) {
+ // Only show if profile is currently public. Effectively disable new public profiles.
+ ?>
+ <h3><?=$words->get('PreferencePublicProfile')?></h3>
<div class="subcolumns">
<div class="c33l" >
@@ -41,8 +45,9 @@
</div> <!-- c50r -->
</div> <!-- subcolumns -->
+ <?php } ?>
-<?php
+ <?php
$doNotShow = array('PreferenceLanguage');
foreach ($p as $rr) {
if (!in_array($rr->codeName, $doNotShow)) {
@@ -215,7 +215,7 @@ public function getAllCityLatLong()
{
$query= <<<SQL
- SELECT latitude,longitude
+ SELECT geonames_cache.latitude,geonames_cache.longitude
FROM members, geonames_cache, addresses
WHERE geonames_cache.geonameid=addresses.IdCity AND members.Status='Active'
AND addresses.IdMember = members.id AND addresses.rank = 0
@@ -172,9 +172,13 @@ public function RetrieveLastAcceptedProfilesWithAPicture($quantity = 5)
SELECT SQL_CACHE
members.id, members.Username, MAX(g2.name) AS countryname
FROM
- members, membersphotos, addresses, geonames_cache AS g1, geonames_cache AS g2
+ members, membersphotos, addresses, geonames_cache AS g1, geonames_cache AS g2
WHERE
- members.Status='Active' AND ABS(HOURS(TIMEDIFF(members.created, now())) > 24 AND membersphotos.IdMember = members.id AND members.id = addresses.IdMember AND addresses.IdCity = g1.geonameid AND g2.geonameid = g1.parentCountryId
+ members.Status='Active'
+ AND HOUR(TIMEDIFF(members.created, now())) > 24
+ AND HOUR(TIMEDIFF(members.created, now())) < 72
+ AND membersphotos.IdMember = members.id
+ AND members.id = addresses.IdMember AND addresses.IdCity = g1.geonameid AND g2.geonameid = g1.parentCountryId
GROUP BY
members.id, members.Username
ORDER BY

0 comments on commit 72e65f9

Please sign in to comment.