code
stringlengths 17
247k
| docstring
stringlengths 30
30.3k
| func_name
stringlengths 1
89
| language
stringclasses 1
value | repo
stringlengths 7
63
| path
stringlengths 7
153
| url
stringlengths 51
209
| license
stringclasses 4
values |
---|---|---|---|---|---|---|---|
function filled_out(array $aVars)
{
foreach ($aVars as $sKey => $sVal) {
if (empty($sKey) || trim($sVal) === '') {
return false;
}
}
return true;
} | Check that all fields are filled.
@param array $aVars
@return bool | filled_out | php | pH7Software/pH7-Social-Dating-CMS | _install/inc/fns/misc.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_install/inc/fns/misc.php | MIT |
function ffmpeg_path()
{
if (is_windows()) {
$sPath = is_file('C:\ffmpeg\bin\ffmpeg.exe') ? 'C:\ffmpeg\bin\ffmpeg.exe' : 'C:\ffmpeg\ffmpeg.exe';
} else {
$sPath = is_file('/usr/local/bin/ffmpeg') ? '/usr/local/bin/ffmpeg' : '/usr/bin/ffmpeg';
}
return $sPath;
} | Try to find and get the FFmpeg path if it is installed (note I don't use system command like "which ffmpeg" for portability reason).
@return string The appropriate FFmpeg path. | ffmpeg_path | php | pH7Software/pH7-Social-Dating-CMS | _install/inc/fns/misc.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_install/inc/fns/misc.php | MIT |
function is_url_rewrite()
{
if (!is_file(PH7_ROOT_INSTALL . '.htaccess')) {
return false;
}
// Check if mod_rewrite is installed and is configured to be used via .htaccess
$sHttpModRewrite = (string)getenv('HTTP_MOD_REWRITE');
if (!$bIsRewrite = (strtolower($sHttpModRewrite) === 'on')) {
$sOutputMsg = 'mod_rewrite Works!';
if (!empty($_GET['a']) && $_GET['a'] === 'test_mod_rewrite') {
exit($sOutputMsg);
}
$sPage = @file_get_contents(PH7_URL_INSTALL . 'test_mod_rewrite');
$bIsRewrite = ($sPage === $sOutputMsg);
}
return $bIsRewrite;
} | Check if Apache's mod_rewrite is installed.
@return bool | is_url_rewrite | php | pH7Software/pH7-Social-Dating-CMS | _install/inc/fns/misc.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_install/inc/fns/misc.php | MIT |
function get_url_contents($sFile)
{
$rCh = curl_init();
curl_setopt($rCh, CURLOPT_URL, $sFile);
curl_setopt($rCh, CURLOPT_HEADER, 0);
curl_setopt($rCh, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($rCh, CURLOPT_FOLLOWLOCATION, 1);
$mResult = curl_exec($rCh);
curl_close($rCh);
unset($rCh);
return $mResult;
} | Get the URL contents with CURL.
@param string $sFile
@return string|bool Returns the result content on success, FALSE on failure. | get_url_contents | php | pH7Software/pH7-Social-Dating-CMS | _install/inc/fns/misc.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_install/inc/fns/misc.php | MIT |
function send_mail(array $aParams)
{
// Frontier to separate the text part and the HTML part.
$sFrontier = "-----=" . md5(mt_rand());
// Removing any HTML tags to get a text format.
// If any of our lines are larger than 70 characters, we return to the new line.
$sTextBody = wordwrap(strip_tags($aParams['body']), 70);
// HTML format (you can change the layout below).
$sHtmlBody = <<<EOF
<html>
<head>
<title>{$aParams['subject']}</title>
</head>
<body>
<div style="text-align:center">{$aParams['body']}</div>
</body>
</html>
EOF;
// If the email sender is empty, we define the server email.
if (empty($aParams['from'])) {
$aParams['from'] = $_SERVER['SERVER_ADMIN'];
}
/*** Headers ***/
// To avoid the email goes to spam folder of email client.
$sHeaders = "From: \"{$_SERVER['HTTP_HOST']}\" <{$_SERVER['SERVER_ADMIN']}>\r\n";
$sHeaders .= "Reply-To: <{$aParams['from']}>\r\n";
$sHeaders .= "MIME-Version: 1.0\r\n";
$sHeaders .= "Content-Type: multipart/alternative; boundary=\"$sFrontier\"\r\n";
/*** Text Format ***/
$sBody = "--$sFrontier\r\n";
$sBody .= "Content-Type: text/plain; charset=\"utf-8\"\r\n";
$sBody .= "Content-Transfer-Encoding: 8bit\r\n";
$sBody .= "\r\n" . $sTextBody . "\r\n";
/*** HTML Format ***/
$sBody .= "--$sFrontier\r\n";
$sBody .= "Content-Type: text/html; charset=\"utf-8\"\r\n";
$sBody .= "Content-Transfer-Encoding: 8bit\r\n";
$sBody .= "\r\n" . $sHtmlBody . "\r\n";
$sBody .= "--$sFrontier--\r\n";
/** Send Email ***/
return @mail($aParams['to'], $aParams['subject'], $sBody, $sHeaders);
} | Send an email (text and HTML format).
@param array $aParams The parameters information to send email.
@return bool Returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise. | send_mail | php | pH7Software/pH7-Social-Dating-CMS | _install/inc/fns/misc.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_install/inc/fns/misc.php | MIT |
public function close()
{
imagedestroy($this->resource);
} | Destroy the image resource / close the file | close | php | pH7Software/pH7-Social-Dating-CMS | _protected/library/FreebieStock/NudityDetector/Image.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/library/FreebieStock/NudityDetector/Image.php | MIT |
public static function type($file)
{
$type = exif_imagetype($file);
switch ($type) {
case IMAGETYPE_GIF:
return 'gif';
case IMAGETYPE_JPEG:
return 'jpg';
case IMAGETYPE_PNG:
return 'png';
case IMAGETYPE_WEBP:
return 'webp';
}
return false;
} | Get image type if it is one of: .gif, .jpg or .png
@param string $file Full path to file
@return string|boolean | type | php | pH7Software/pH7-Social-Dating-CMS | _protected/library/FreebieStock/NudityDetector/Image.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/library/FreebieStock/NudityDetector/Image.php | MIT |
public static function color($r, $g, $b, $a = 0)
{
return ($a << 24) + ($r << 16) + ($g << 8) + $b;
} | Returns an integer representation of a color
@param int $r Red
@param int $g Green
@param int $b Blue
@param int $a Alpha
@return int | color | php | pH7Software/pH7-Social-Dating-CMS | _protected/library/FreebieStock/NudityDetector/Image.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/library/FreebieStock/NudityDetector/Image.php | MIT |
public function rgbXY($x, $y)
{
$color = $this->colorXY($x, $y);
return [($color >> 16) & 0xFF, ($color >> 8) & 0xFF, $color & 0xFF];
} | Returns RGB array of pixel's color
@param int $x
@param int $y | rgbXY | php | pH7Software/pH7-Social-Dating-CMS | _protected/library/FreebieStock/NudityDetector/Image.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/library/FreebieStock/NudityDetector/Image.php | MIT |
public function fitResize($max_width = 150, $max_height = 150, $min_width = 20, $min_height = 20)
{
$kw = $max_width / $this->width();
$kh = $max_height / $this->height();
if ($kw > $kh) {
$new_h = $max_height;
$new_w = round($kh * $this->width());
} else {
$new_w = $max_width;
$new_h = round($kw * $this->height());
}
$this->resize($new_w, $new_h);
// Method chaining
return $this;
} | Fit the image with the same proportion into an area
@param int $max_width
@param int $max_height
@param int $min_width
@param int $min_height
@return Image | fitResize | php | pH7Software/pH7-Social-Dating-CMS | _protected/library/FreebieStock/NudityDetector/Image.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/library/FreebieStock/NudityDetector/Image.php | MIT |
public function scaleResize($width, $height)
{
// calculate source coordinates
$kw = $this->width() / $width;
$kh = $this->height() / $height;
if ($kh < $kw) {
$src_h = $this->height();
$src_y = 0;
$src_w = round($kh * $width);
$src_x = round(($this->width() - $src_w) / 2);
} else {
$src_h = round($kh * $height);
$src_y = round(($this->height() - $src_h) / 2);
$src_w = $this->width();
$src_x = 0;
}
// copy new image
$new = imagecreatetruecolor($width, $height);
imagecopyresampled($new, $this->resource, 0, 0, $src_x, $src_y,
$width, $height, $src_w, $src_h);
$this->resource = $new;
// for method chaining
return $this;
} | Resize image correctly scaled and than crop
the necessary area
@param int $width New width
@param int $height New height | scaleResize | php | pH7Software/pH7-Social-Dating-CMS | _protected/library/FreebieStock/NudityDetector/Image.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/library/FreebieStock/NudityDetector/Image.php | MIT |
public function quantifyYCbCr()
{
// Init some vars
$inc = $this->iteratorIncrement;
$width = $this->width();
$height = $this->height();
list($Cb1, $Cb2, $Cr1, $Cr2) = $this->boundsCbCr;
$white = $this->excludeWhite;
$black = $this->excludeBlack;
$total = $count = 0;
for ($x = 0; $x < $width; $x += $inc)
for ($y = 0; $y < $height; $y += $inc) {
list($r, $g, $b) = $this->rgbXY($x, $y);
// Exclude white/black colors from calculation, presumably background
if ((($r > $white) && ($g > $white) && ($b > $white)) ||
(($r < $black) && ($g < $black) && ($b < $black))) continue;
// Converg pixel RGB color to YCbCr, coefficients already divided by 255
$Cb = 128 + (-0.1482 * $r) + (-0.291 * $g) + (0.4392 * $b);
$Cr = 128 + (0.4392 * $r) + (-0.3678 * $g) + (-0.0714 * $b);
// Increase counter, if necessary
if (($Cb >= $Cb1) && ($Cb <= $Cb2) && ($Cr >= $Cr1) && ($Cr <= $Cr2))
$count++;
$total++;
}
return $count / $total;
} | Quantify flesh color amount using YCbCr color model
@return float | quantifyYCbCr | php | pH7Software/pH7-Social-Dating-CMS | _protected/library/FreebieStock/NudityDetector/Image/FleshSkinQuantifier.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/library/FreebieStock/NudityDetector/Image/FleshSkinQuantifier.php | MIT |
public function isPorn($threshold = false)
{
return $threshold === false
? $this->quantifyYCbCr() >= $this->threshold
: $this->quantifyYCbCr() >= $threshold;
} | Check if image is of pornographic content
@param float $threshold | isPorn | php | pH7Software/pH7-Social-Dating-CMS | _protected/library/FreebieStock/NudityDetector/Image/FleshSkinQuantifier.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/library/FreebieStock/NudityDetector/Image/FleshSkinQuantifier.php | MIT |
public function index($sFirstName = '', $sLastName = '')
{
// Loading hello_world language...
(new Lang)->load('hello_world');
// Meta Tags
$this->view->page_title = t('Hello World');
$this->view->meta_description = t('This module is just an example to show how easy you can create modules with pH7Builder');
$this->view->meta_keywords = t('hello world, test, developpers, CMS, Dating CMS, CMS Dating, Social CMS, pH7, pH7 CMS, Dating Script, Social Dating Script, Dating Software, Social Network Software, Social Networking Software');
/* Heading html tags (H1 to H4) */
$this->view->h1_title = t('Example of a simple module that displays "Hello World"');
$this->view->h3_title = t('H3 title example');
$this->view->desc = t('Hello %0% %1% How are you on this %2%?', $this->str->upperFirst($sFirstName), $this->str->upperFirst($sLastName), $this->dateTime->get()->date('l'));
// Display the page
$this->output();
} | Example URL: http://your-domain.com/m/helloworld/home/index/Pierre-Henry/Soria
@param string $sFirstName
@param string $sLastName | index | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/modules/helloworld/controllers/HomeController.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/modules/helloworld/controllers/HomeController.php | MIT |
public function sendMail(array $aInfo, $bIsUniversalLogin = false)
{
if ($bIsUniversalLogin) {
$sPwdMsg = t('Password: %0% (please change it next time you login).', $aInfo['password']);
} else {
$sPwdMsg = t('Password: ****** (hidden to protect against theft of your account. If you have forgotten your password, please request a new one <a href="%0%">here</a>).', Uri::get('lost-password', 'main', 'forgot', 'user'));
}
$this->oView->content = t('Welcome to %site_name%, %0%!', $aInfo['first_name']) . '<br />' .
t('Hi %0%! We are proud to welcome you as a member of %site_name%!', $aInfo['first_name']) . '<br />' .
$this->getEmailMsg($aInfo) . '<br />' .
'<br /><span style="text-decoration:underline">' . t('Please save the following information for future reference:') . '</span><br /><em>' .
t('Email: %0%.', $aInfo['email']) . '<br />' .
t('Username: %0%.', $aInfo['username']) . '<br />' .
$sPwdMsg . '</em>';
$this->oView->footer = t('You are receiving this email because we received a registration application with "%0%" email address for %site_name% (%site_url%).', $aInfo['email']) . '<br />' .
t('If you think someone has used your email address without your knowledge to create an account on %site_name%, please contact us using our contact form available on our website.');
$sTplName = defined('PH7_TPL_MAIL_NAME') ? PH7_TPL_MAIL_NAME : PH7_DEFAULT_THEME;
$sMsgHtml = $this->oView->parseMail(PH7_PATH_SYS . 'global/' . PH7_VIEWS . $sTplName . '/tpl/mail/sys/mod/user/account_registration.tpl', $aInfo['email']);
$aMailInfo = [
'to' => $aInfo['email'],
'subject' => t('Hello %0%, Welcome to %site_name%!', $aInfo['first_name'])
];
(new Mail)->send($aMailInfo, $sMsgHtml);
return $this;
} | Send the confirmation email with registration details.
@param array $aInfo
@param bool $bIsUniversalLogin
@return self
@throws Framework\File\IOException
@throws Framework\Layout\Tpl\Engine\PH7Tpl\Exception | sendMail | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/classes/RegistrationCore.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/classes/RegistrationCore.php | MIT |
public function getMsg()
{
switch ($this->iActiveType) {
case self::NO_ACTIVATION:
$sMsg = t('Your account has just been created. You can now login!');
break;
case self::EMAIL_ACTIVATION:
$sMsg = t('Please activate your account by clicking the activation link you received by email. If you can not find the email, please look in your SPAM FOLDER and mark as not spam.');
break;
case self::MANUAL_ACTIVATION:
$sMsg = t('Your account must be approved by an administrator. You will receive an email of any decision.');
break;
case self::SMS_ACTIVATION:
$sMsg = t('You have been successfully registered!');
break;
default:
$sMsg = t('You have been successfully registered!');
}
return $sMsg;
} | Get the registration status message.
@return string | getMsg | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/classes/RegistrationCore.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/classes/RegistrationCore.php | MIT |
private function getEmailMsg(array $aData)
{
switch ($this->iActiveType) {
case self::NO_ACTIVATION:
$sEmailMsg = t('Please %0% to meet new people from today!', '<a href="' . Uri::get('user', 'main', 'login') . '"><b>' . t('log in') . '</b></a>');
break;
case self::EMAIL_ACTIVATION:
/* We place the text outside of "Uri::get()", otherwise special characters will be deleted and the params passed in the URL will be unusable thereafter */
$sActivateLink = Uri::get('user', 'account', 'activate') . PH7_SH . $aData['email'] . PH7_SH . $aData['hash_validation'];
$sEmailMsg = t('Activation link: %0%.', '<a href="' . $sActivateLink . '">' . $sActivateLink . '</a>');
break;
case self::MANUAL_ACTIVATION:
$sEmailMsg = t('Caution! Your account is not activated yet. You will receive an email of any decision.');
break;
default:
$sEmailMsg = '';
}
return $sEmailMsg;
} | The the email message to send.
@param array $aData
@return string | getEmailMsg | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/classes/RegistrationCore.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/classes/RegistrationCore.php | MIT |
public function checkMembership()
{
if (UserCore::auth()) {
return $this->oUserModel->checkMembershipExpiration(
$this->session->get('member_id'),
$this->dateTime->get()->dateTime(UserCoreModel::DATETIME_FORMAT)
);
}
return true;
} | Checks whether the user membership is still valid or not.
@return bool Returns TRUE if the membership is still valid (or user not logged), FALSE otherwise. | checkMembership | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/classes/PermissionCore.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/classes/PermissionCore.php | MIT |
public function paymentRedirect()
{
Header::redirect(
Uri::get('payment', 'main', 'index'),
$this->upgradeMembershipMsg(),
Design::WARNING_TYPE
);
} | Redirect the user to the payment page when it is on a page that requires another membership.
@return void | paymentRedirect | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/classes/PermissionCore.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/classes/PermissionCore.php | MIT |
public function getProfileSignupLink($sUsername, $sFirstName, $sSex)
{
if (!self::auth() && !AdminCore::auth()) {
$aHttpParams = [
'ref' => (new HttpRequest)->currentController(),
'a' => Registry::getInstance()->action,
'u' => $sUsername,
'f_n' => $sFirstName,
's' => $sSex
];
$sLink = Uri::get(
'user',
'signup',
'step1',
'?' . Url::httpBuildQuery($aHttpParams),
false
);
} else {
$sLink = $this->getProfileLink($sUsername);
}
return $sLink;
} | Get Profile Link with the link to the registration form if the user is not connected.
@param string $sUsername
@param string $sFirstName
@param string $sSex
@return string The link
@throws Framework\File\IOException | getProfileSignupLink | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/classes/UserCore.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/classes/UserCore.php | MIT |
public function activateAccount($sEmail, $sHash, Config $oConfig, Registry $oRegistry, $sMod = 'user')
{
$sTable = VariousModel::convertModToTable($sMod);
$sRedirectLoginUrl = ($sMod === 'newsletter' ? PH7_URL_ROOT : ($sMod === 'affiliate' ? Uri::get('affiliate', 'home', 'login') : Uri::get('user', 'main', 'login')));
$sRedirectIndexUrl = ($sMod === 'newsletter' ? PH7_URL_ROOT : ($sMod === 'affiliate' ? Uri::get('affiliate', 'home', 'index') : Uri::get('user', 'main', 'index')));
$sSuccessMsg = ($sMod === 'newsletter' ? t('Your subscription to our newsletters has been successfully validated!') : t('Your account has been successfully validated. You can now login!'));
if (isset($sEmail, $sHash)) {
$oUserModel = new AffiliateCoreModel;
if ($oUserModel->validateAccount($sEmail, $sHash, $sTable)) {
$iId = $oUserModel->getId($sEmail, null, $sTable);
if ($sMod !== 'newsletter') {
$this->clearReadProfileCache($iId, $sTable);
}
/** Update the Affiliate Commission **/
$iAffId = $oUserModel->getAffiliatedId($iId);
AffiliateCore::updateJoinCom($iAffId, $oConfig, $oRegistry);
Header::redirect($sRedirectLoginUrl, $sSuccessMsg);
} else {
Header::redirect(
$sRedirectLoginUrl,
t('Oops! The URL is either invalid or you already have activated your account.'),
Design::ERROR_TYPE
);
}
unset($oUserModel);
} else {
Header::redirect(
$sRedirectIndexUrl,
t('Invalid approach, please use the link that has been send to your email.'),
Design::ERROR_TYPE
);
}
} | Message and Redirection for Activate Account.
@param string $sEmail
@param string $sHash
@param Config $oConfig
@param Registry $oRegistry
@param string $sMod (user, affiliate, newsletter).
@return void
@throws Framework\File\IOException | activateAccount | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/classes/UserCore.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/classes/UserCore.php | MIT |
private function __clone()
{
} | Clone is set to private to stop cloning. | __clone | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/classes/UserCore.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/classes/UserCore.php | MIT |
public static function cleanTitle($sTitle)
{
return trim($sTitle);
} | Clean picture/video title, since it cannot have blank space before the beginning and ending,
otherwise the URL pattern won't work.
@param string $sTitle
@return string | cleanTitle | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/classes/MediaCore.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/classes/MediaCore.php | MIT |
public function getMap($sFullAddress, $sMarkerText)
{
$this->oMap->setKey($this->sApiKey);
$this->oMap->setCenter($sFullAddress);
$this->oMap->setSize($this->sMapWidthSize, $this->sMapHeightSize);
$this->oMap->setDivId($this->sMapDivId);
$this->oMap->setZoom($this->iMapZoomLevel);
$this->oMap->addMarkerByAddress($sFullAddress, $sMarkerText, $sMarkerText);
$this->oMap->generate();
return $this->oMap->getMap();
} | Set the Google Maps code to the view.
@param string $sFullAddress
@param string $sMarkerText
@return string | getMap | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/classes/MapDrawerCore.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/classes/MapDrawerCore.php | MIT |
public function sendLoginAttemptsExceededAlert($iMaxAttempts, $iAttemptTime, $sIp, $sTo, Templatable $oView, $sTable = DbTableName::MEMBER)
{
Various::checkModelTable($sTable);
$sFirstName = $this->getUserFirstNameFromEmail($sTo, $sTable);
$sForgotPwdLink = Uri::get('lost-password', 'main', 'forgot', Various::convertTableToMod($sTable));
$oView->content = t('Hi %0%', $sFirstName) . '<br />' .
t('Someone tried to login more than %0% times with the IP address: "%1%".', $iMaxAttempts, $sIp) . '<br />' .
t('For safety and security reasons, we have blocked access to this person for a delay of %0% minutes.', $iAttemptTime) . '<br /><ol><li>' .
t('If it was you who tried to login to your account, we suggest to <a href="%1%">request a new password</a> in %0% minutes.', $iAttemptTime, $sForgotPwdLink) . '</li><li>' .
t("If you don't know the person who made the login attempts, you should be very careful and change your password to a new complex one.") . '</li></ol><br /><hr />' .
t('Have a nice day!');
$sMessageHtml = $oView->parseMail(
PH7_PATH_SYS . 'global/' . PH7_VIEWS . PH7_TPL_MAIL_NAME . '/tpl/mail/sys/core/alert_login_attempt.tpl',
$sTo
);
$aInfo = [
'to' => $sTo,
'subject' => t('Security Alert: Login Attempts - %site_name%')
];
(new Mail)->send($aInfo, $sMessageHtml);
} | Send a Security Alert Login Attempts email.
@param int $iMaxAttempts
@param int $iAttemptTime
@param string $sIp IP address
@param string $sTo Email address of the user to send the message.
@param Templatable $oView
@param string $sTable Default DbTableName::MEMBER
@return void | sendLoginAttemptsExceededAlert | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/classes/SecurityCore.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/classes/SecurityCore.php | MIT |
private function getUserFirstNameFromEmail($sEmail, $sTable)
{
$oUserModel = new UserCoreModel;
$iProfileId = $oUserModel->getId($sEmail, null, $sTable);
$sFirstName = $oUserModel->getFirstName($iProfileId, $sTable);
unset($oUserModel);
return $sFirstName;
} | Get the first name of the user from their email.
@param string $sEmail
@param string $sTable
@return string | getUserFirstNameFromEmail | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/classes/SecurityCore.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/classes/SecurityCore.php | MIT |
public function userCounter()
{
$this->staticFiles('js', PH7_STATIC . PH7_JS, 'jquery/counter.js,Stat.js');
echo '<div class="stat_total_users"></div>';
} | Ajax counter endpoint to count the number of users registered on the site.
@return void | userCounter | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/classes/design/UserDesignCore.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/classes/design/UserDesignCore.php | MIT |
public static function link($sMod, $bPrint = true)
{
$sHtml = '<a rel="nofollow" href="' . Uri::get('lost-password', 'main', 'forgot', $sMod) . '">' . t('Forgot your password?') . '</a>';
if (!$bPrint) {
return $sHtml;
}
echo $sHtml;
} | Get the "forgot password" link.
@param string $sMod
@param bool $bPrint Print or Return the HTML code.
@return void | link | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/classes/design/LostPwdDesignCore.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/classes/design/LostPwdDesignCore.php | MIT |
public static function voting($iId, $sTable, $sCssClass = '')
{
$aRating = self::getRatingData($iId, $sTable);
// Note: The rating.css style file is included by default in the CMS
(new Design)->staticFiles('js', PH7_STATIC . PH7_JS, 'jquery/rating.js');
$fRate = ($aRating['votes'] > 0) ? number_format($aRating['score'] / $aRating['votes'], 1) : 0;
$sPHSClass = 'pHS' . $iId . $sTable;
echo '<div itemscope="itemscope" itemtype="http://schema.org/AggregateRating">';
echo '<div class="', $sCssClass, ' ', $sPHSClass, '" id="', $fRate, '_', $iId, '_', $sTable, '"></div>';
echo '<p itemprop="ratingValue" content="', $fRate, '" itemprop="ratingCount" content="', $aRating['votes'], '" class="', $sPHSClass, '_txt">', t('Score: %0% - Votes: %1%', $fRate, $aRating['votes']), '</p>';
echo '<script>$(".', $sPHSClass, '").pHRating({length:5,decimalLength:1,rateMax:5});</script>';
/**
* Redirect the member to the registration page if not logged in.
* For security reason, a check on the server-side is already present, because this JS code allows users to login easily by modifying it.
*/
if (!UserCore::auth()) {
$sUrl = Uri::get('user', 'signup', 'step1', '?msg=' . t('You need to be a member for voting.'), false);
echo '<script>$(".', $sPHSClass, '").click(function(){window.location=\'', $sUrl, '\'});</script>';
}
echo '</div>';
} | Generates design the voting system.
@param int $iId Unique ID of the column of the table. EX: ID of 'profileId' column for the 'members' table.
@param string $sTable See the list of data tables available in the class: PH7\Framework\Mvc\Model\Engine\Util\Various::checkTable().
@param string $sCssClass Default value is empty. You can add the name of a CSS class (attention, only its name) e.g. 'center'.
@return void | voting | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/classes/design/RatingDesignCore.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/classes/design/RatingDesignCore.php | MIT |
public static function link($sMod)
{
$sHtml = '<p class="center">';
$sHtml .= '<a class="s_marg btn btn-primary" href="' . Uri::get('two-factor-auth', 'main', 'setup', $sMod) . '">' . t('Two-Factor Authentication') . '</a>';
$sHtml .= '</p>';
echo $sHtml;
} | Get the "Enable Two-Factor Authentication" link.
@param string $sMod Module name (user, affiliate, admin123).
@return void HTML output. | link | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/classes/design/TwoFactorAuthDesignCore.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/classes/design/TwoFactorAuthDesignCore.php | MIT |
public function getPicsVids($sTable, $sOrder, $iOffset, $iLimit)
{
$iOffset = (int)$iOffset;
$iLimit = (int)$iLimit;
$sSqlQuery = 'SELECT data.*, m.username FROM' . Db::prefix($sTable) . 'AS data INNER JOIN' .
Db::prefix(DbTableName::MEMBER) . 'AS m ON data.profileId = m.profileId WHERE data.approved = 1 ORDER BY ' .
$sOrder . ' DESC LIMIT :offset, :limit';
$rStmt = Db::getInstance()->prepare($sSqlQuery);
$rStmt->bindParam(':offset', $iOffset, PDO::PARAM_INT);
$rStmt->bindParam(':limit', $iLimit, PDO::PARAM_INT);
$rStmt->execute();
$aData = $rStmt->fetchAll(PDO::FETCH_OBJ);
Db::free($rStmt);
return $aData;
} | Get images or videos from either Videos or Pictures table.
@param string $sTable
@param string $sOrder
@param int $iOffset
@param int $iLimit
@return array | getPicsVids | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/DataCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/DataCoreModel.php | MIT |
public function is()
{
return (bool)DbConfig::getSetting('isSiteValidated');
} | Check if the site has been validated or not.
@internal This method will be used also in the "admin" module through the "ValidateSiteCore" class,
so it needs to be in a Core model and not in the local "ph7cms-helper" module.
@return bool | is | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/ValidateSiteCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/ValidateSiteCoreModel.php | MIT |
public function email($sEmail, $sTable = DbTableName::MEMBER)
{
$sEmail = filter_var($sEmail, FILTER_SANITIZE_EMAIL);
return $this->is('email', $sEmail, $sTable);
} | Checks if the same email address already exists.
@param string $sEmail
@param string $sTable Default is "Members"
@return bool | email | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/ExistCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/ExistCoreModel.php | MIT |
public function username($sUsername, $sTable = DbTableName::MEMBER)
{
return $this->is('username', $sUsername, $sTable);
} | Checks if the same username already exists.
@param string $sUsername
@param string $sTable Default is "Members"
@return bool | username | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/ExistCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/ExistCoreModel.php | MIT |
public function id($iId, $sTable = DbTableName::MEMBER)
{
return $this->is('profileId', $iId, $sTable, PDO::PARAM_INT, 'AND profileId <> ' . PH7_GHOST_ID);
} | Checks if the same ID already exists. Ignore the ghost ID (1)
@param int $iId
@param string $sTable Default is "Members"
@return bool | id | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/ExistCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/ExistCoreModel.php | MIT |
public function bankAccount($sAccount, $sTable = DbTableName::AFFILIATE)
{
return $this->is('bankAccount', $sAccount, $sTable);
} | SECURITY Checks if there is not another affiliate with the same bank account.
@param string $sAccount
@param string $sTable Default is "Affiliate"
@return bool | bankAccount | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/ExistCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/ExistCoreModel.php | MIT |
protected function is($sColumn, $sValue, $sTable, $sType = null, $sParam = null)
{
Various::checkModelTable($sTable);
$sType = empty($sType) ? PDO::PARAM_STR : $sType;
$rExists = Db::getInstance()->prepare('SELECT COUNT(' . $sColumn . ') FROM' . Db::prefix($sTable) . 'WHERE ' . $sColumn . ' = :column ' . $sParam . ' LIMIT 1');
$rExists->bindValue(':column', $sValue, $sType);
$rExists->execute();
return $rExists->fetchColumn() == 1;
} | Generic method to check if the field exists and with the check \PH7\Framework\Mvc\Model\Engine\Util\Various::checkModelTable() method.
@param string $sColumn
@param string $sValue
@param string $sTable
@param string $sType PDO PARAM TYPE (PDO::PARAM_*). Default is PDO::PARAM_STR
@param string $sParam Optional WHERE parameter SQL.
@return bool Returns TRUE if it exists, FALSE otherwise. | is | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/ExistCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/ExistCoreModel.php | MIT |
public static function getDateOfCreation()
{
$oCache = (new Cache)->start(self::CACHE_GROUP, 'dateofcreation', self::CACHE_LIFETIME);
if (!$sSinceDate = $oCache->get()) {
$sSinceDate = Record::getInstance()->getOne(DbTableName::ADMIN, 'profileId', AdminCore::ROOT_PROFILE_ID, 'joinDate')->joinDate;
$oCache->put($sSinceDate);
}
unset($oCache);
return $sSinceDate;
} | Get the date since the website has been created.
@return string The creation date. | getDateOfCreation | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/StatisticCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/StatisticCoreModel.php | MIT |
public function totalMembers(int $iDay = 0, string $sGender = 'all')
{
return (new UserCoreModel)->total(DbTableName::MEMBER, $iDay, $sGender);
} | Get the total number of members.
@param int $iDay Default '0'
@param string $sGender Values available 'all', 'male', 'female', 'couple'. Default 'all'
@return int Total Users | totalMembers | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/StatisticCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/StatisticCoreModel.php | MIT |
public function totalAffiliates($iDay = 0, $sGender = 'all')
{
return (new UserCoreModel)->total(DbTableName::AFFILIATE, $iDay, $sGender);
} | Get the total number of affiliates.
@param int $iDay Default '0'
@param string $sGender Values available 'all', 'male', 'female'. Default 'all'
@return int Total Users | totalAffiliates | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/StatisticCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/StatisticCoreModel.php | MIT |
public function totalAdmins($iDay = 0, $sGender = 'all')
{
return (new UserCoreModel)->total(DbTableName::ADMIN, $iDay, $sGender);
} | Get the total number of admins.
@param int $iDay Default '0'
@param string $sGender Values available 'all', 'male', 'female'. Default 'all'
@return int Total Users | totalAdmins | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/StatisticCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/StatisticCoreModel.php | MIT |
public function getRootIp()
{
$this->cache->start(self::CACHE_GROUP, 'rootip', static::CACHE_TIME);
if (!$sIp = $this->cache->get()) {
$sIp = $this->orm->getOne(DbTableName::ADMIN, 'profileId', 1, 'ip')->ip;
$this->cache->put($sIp);
}
return $sIp;
} | Get the Root Admin IP address.
@return string | getRootIp | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/AdminCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/AdminCoreModel.php | MIT |
public function get(?string $mActive, int $iOffset, int $iLimit, string $sTable = AdsCore::AD_TABLE_NAME)
{
AdsCore::checkTable($sTable);
$iOffset = (int)$iOffset;
$iLimit = (int)$iLimit;
$sSqlActive = !empty($mActive) ? 'WHERE active= :active' : '';
$rStmt = Db::getInstance()->prepare('SELECT * FROM' . Db::prefix($sTable) . $sSqlActive . ' ORDER BY active ASC LIMIT :offset, :limit');
if (!empty($mActive)) {
$rStmt->bindValue(':active', $mActive, PDO::PARAM_STR);
}
$rStmt->bindParam(':offset', $iOffset, PDO::PARAM_INT);
$rStmt->bindParam(':limit', $iLimit, PDO::PARAM_INT);
$rStmt->execute();
$aRow = $rStmt->fetchAll(PDO::FETCH_OBJ);
Db::free($rStmt);
return $aRow;
} | Get Advertisements in the database.
@param string|null $mActive 1 (self::ACTIVE) = active, NULL otherwise.
@param int $iOffset
@param int $iLimit
@param string $sTable The table name.
@return array The advertisements data. | get | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/AdsCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/AdsCoreModel.php | MIT |
public function get($iIdProfileId, $iFriendId, $mLooking, $bCount, $sOrderBy, $iSort, $iOffset, $iLimit)
{
$bCount = (bool)$bCount;
$iOffset = (int)$iOffset;
$iLimit = (int)$iLimit;
$mLooking = trim($mLooking);
$bDigitSearch = ctype_digit($mLooking);
$sSqlSelect = !$bCount ? '(f.profileId + f.friendId - :profileId) AS fdId, f.*, m.username, m.firstName, m.sex' : 'COUNT(f.friendId)';
$sSqlLimit = !$bCount ? 'LIMIT :offset, :limit' : '';
$sSqlWhere = '(f.profileId = :profileId OR f.friendId = :profileId)';
if (!empty($iFriendId)) {
$sSqlWhere = 'f.profileId IN
(SELECT * FROM (SELECT (m.profileId)
FROM ' . Db::prefix(DbTableName::MEMBER_FRIEND) . ' AS m
WHERE (m.friendId IN (:profileId, :friendId))
UNION ALL
SELECT (f.friendId) FROM ' . Db::prefix(DbTableName::MEMBER_FRIEND) . ' AS f
WHERE (f.profileId IN (:profileId, :friendId))) AS fd
GROUP BY fd.profileId HAVING COUNT(fd.profileId) > 1)';
}
$sSqlSearchWhere = '(m.username LIKE :looking OR m.firstName LIKE :looking OR m.lastName LIKE :looking OR m.email LIKE :looking)';
if ($bDigitSearch) {
$sSqlSearchWhere = '(m.profileId = :profileId AND f.friendId= :profileId) OR (m.profileId = :friendId OR f.friendId= :friendId)';
}
$sSqlOrder = SearchCoreModel::order($sOrderBy, $iSort);
$rStmt = Db::getInstance()->prepare(
'SELECT ' . $sSqlSelect . ' FROM' . Db::prefix(DbTableName::MEMBER_FRIEND) . 'AS f INNER JOIN' . Db::prefix(DbTableName::MEMBER) .
'AS m ON m.profileId = (f.profileId + f.friendId - :profileId) WHERE m.ban = 0 AND ' . $sSqlWhere . ' AND ' . $sSqlSearchWhere .
$sSqlOrder . $sSqlLimit
);
$rStmt->bindValue(':profileId', $iIdProfileId, PDO::PARAM_INT);
if ($bDigitSearch) {
$rStmt->bindValue(':looking', $mLooking, PDO::PARAM_INT);
} else {
$rStmt->bindValue(':looking', '%' . $mLooking . '%', PDO::PARAM_STR);
}
if (!empty($iFriendId)) {
$rStmt->bindValue(':friendId', $iFriendId, PDO::PARAM_INT);
}
if (!$bCount) {
$rStmt->bindParam(':offset', $iOffset, PDO::PARAM_INT);
$rStmt->bindParam(':limit', $iLimit, PDO::PARAM_INT);
}
$rStmt->execute();
if (!$bCount) {
$mData = $rStmt->fetchAll(PDO::FETCH_OBJ);
} else {
$mData = (int)$rStmt->fetchColumn();
}
Db::free($rStmt);
return $mData;
} | "Get" and "Find" "Friends" or "Mutual Friends"
@param int $iIdProfileId User ID
@param int|null $iFriendId Enter a user Friend ID to find a mutual friend in the friends list or "NULL" for the whole list.
@param int|string $mLooking Integer for profile ID or string for a keyword.
@param bool $bCount TRUE for count friends or FALSE for the result of friends.
@param string $sOrderBy
@param int $iSort
@param int $iOffset
@param int $iLimit
@return int|array Integer for the number friends returned or an array containing a stdClass object with the friends list) | get | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/FriendCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/FriendCoreModel.php | MIT |
public function inList($iProfileId, $iFriendId, $iPending = self::ALL_REQUEST)
{
$iProfileId = (int)$iProfileId;
$iFriendId = (int)$iFriendId;
$sSqlPending = ($iPending !== self::ALL_REQUEST) ? 'AND pending = :pending' : '';
$rStmt = Db::getInstance()->prepare('SELECT * FROM' . Db::prefix(DbTableName::MEMBER_FRIEND) .
'WHERE (profileId = :profileId AND friendId = :friendId) OR (profileId = :friendId AND friendId = :profileId) ' . $sSqlPending . ' LIMIT 1');
$rStmt->bindValue(':profileId', $iProfileId, PDO::PARAM_INT);
$rStmt->bindValue(':friendId', $iFriendId, PDO::PARAM_INT);
if ($iPending !== self::ALL_REQUEST) {
$rStmt->bindValue(':pending', $iPending, PDO::PARAM_INT);
}
$rStmt->execute();
return $rStmt->fetchColumn() > 0;
} | Check if a user exists in another user's friends list.
@param int $iProfileId
@param int $iFriendId
@param int $iPending 2 = select the friends that are approved and pending, 0 = approved or 1 = pending friend requests.
@return bool | inList | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/FriendCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/FriendCoreModel.php | MIT |
public static function countUnreadMsg($iProfileId)
{
$rStmt = Db::getInstance()->prepare('SELECT COUNT(status) AS unread FROM' . Db::prefix(DbTableName::MESSAGE) .
'WHERE recipient = :recipient AND status = :status AND NOT FIND_IN_SET(\'recipient\', toDelete)');
$rStmt->bindValue(':recipient', $iProfileId, PDO::PARAM_INT);
$rStmt->bindValue(':status', self::UNREAD_STATUS, PDO::PARAM_INT);
$rStmt->execute();
$iUnread = (int)$rStmt->fetchColumn();
Db::free($rStmt);
return $iUnread;
} | Get the number of unread messages.
@param int $iProfileId
@return int | countUnreadMsg | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/MailCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/MailCoreModel.php | MIT |
public function already()
{
$rStmt = Db::getInstance()->prepare('SELECT * FROM' . Db::prefix(DbTableName::MEMBER_WHO_VIEW) .
'WHERE profileId = :profileId AND visitorId = :visitorId LIMIT 1');
$rStmt->bindValue(':profileId', $this->iProfileId, PDO::PARAM_INT);
$rStmt->bindValue(':visitorId', $this->iVisitorId, PDO::PARAM_INT);
$rStmt->execute();
return $rStmt->fetchColumn() > 0;
} | Checks if the profile has already been visited by this user.
@return bool Returns TRUE if the profile has already been seen, otherwise FALSE. | already | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/VisitorCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/VisitorCoreModel.php | MIT |
public function update()
{
$rStmt = Db::getInstance()->prepare('UPDATE' . Db::prefix(DbTableName::MEMBER_WHO_VIEW) .
'SET lastVisit = :dateLastVisit WHERE profileId = :profileId AND visitorId = :visitorId LIMIT 1');
$rStmt->bindValue(':profileId', $this->iProfileId, PDO::PARAM_INT);
$rStmt->bindValue(':visitorId', $this->iVisitorId, PDO::PARAM_INT);
$rStmt->bindValue(':dateLastVisit', $this->sDateVisit, PDO::PARAM_STR);
$rStmt->execute();
Db::free($rStmt);
} | Updates the Date of Viewed Profile.
@return void | update | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/VisitorCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/VisitorCoreModel.php | MIT |
public function getAffiliatedId($iProfileId, $sTable = DbTableName::MEMBER)
{
$this->cache->start(static::CACHE_GROUP, 'affiliatedId' . $iProfileId . $sTable, static::CACHE_TIME);
if (!$iAffiliatedId = $this->cache->get()) {
Various::checkModelTable($sTable);
$iProfileId = (int)$iProfileId;
$rStmt = Db::getInstance()->prepare('SELECT affiliatedId FROM' . Db::prefix($sTable) . 'WHERE profileId = :profileId LIMIT 1');
$rStmt->bindValue(':profileId', $iProfileId, PDO::PARAM_INT);
$iAffiliatedId = (int)$rStmt->fetchColumn();
Db::free($rStmt);
$this->cache->put($iAffiliatedId);
}
return $iAffiliatedId;
} | Get the Affiliated Id of a User.
@param int $iProfileId
@param string $sTable DbTableName::MEMBER, DbTableName::AFFILIATE or DbTableName::SUBSCRIBER. Default DbTableName::MEMBER
@return int The Affiliated ID | getAffiliatedId | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/AffiliateCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/AffiliateCoreModel.php | MIT |
public function login($sEmail, $sPassword, $sTable = DbTableName::MEMBER)
{
Various::checkModelTable($sTable);
$rStmt = Db::getInstance()->prepare(
'SELECT email, password FROM' . Db::prefix($sTable) . 'WHERE email = :email LIMIT 1'
);
$rStmt->bindValue(':email', $sEmail, PDO::PARAM_STR);
$rStmt->execute();
$oRow = $rStmt->fetch(PDO::FETCH_OBJ);
Db::free($rStmt);
$sDbEmail = !empty($oRow->email) ? $oRow->email : '';
$sDbPassword = !empty($oRow->password) ? $oRow->password : '';
if (strtolower($sEmail) !== strtolower($sDbEmail)) {
return CredentialStatusCore::INCORRECT_EMAIL_IN_DB;
}
if (!Security::checkPwd($sPassword, $sDbPassword)) {
return CredentialStatusCore::INCORRECT_PASSWORD_IN_DB;
}
return true;
} | Login method for Members and Affiliate, but not for Admins since it has another method PH7\AdminModel::adminLogin() even more secure.
@param string $sEmail Not case sensitive since on lot of mobile devices (such as iPhone), the first letter is uppercase.
@param string $sPassword
@param string $sTable
@return bool|string (boolean "true" or string "message") | login | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/UserCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/UserCoreModel.php | MIT |
public function getLastUsedIp($iProfileId, $sTable = DbTableName::MEMBER_LOG_SESS)
{
Various::checkModelTable($sTable);
$rStmt = Db::getInstance()->prepare('SELECT ip FROM' . Db::prefix($sTable) . 'WHERE profileId = :profileId ORDER BY dateTime DESC LIMIT 1');
$rStmt->bindValue(':profileId', $iProfileId, PDO::PARAM_INT);
$rStmt->execute();
$sLastUsedIp = $rStmt->fetchColumn();
Db::free($rStmt);
return $sLastUsedIp;
} | Retrieve the user's IP address from the log session table.
@param int $iProfileId
@param string $sTable
@return string The latest used user's IP address. | getLastUsedIp | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/UserCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/UserCoreModel.php | MIT |
public function setLastActivity($iProfileId, $sTable = DbTableName::MEMBER)
{
Various::checkModelTable($sTable);
$this->orm->update($sTable, 'lastActivity', $this->sCurrentDate, 'profileId', $iProfileId);
} | Set the last activity of a user.
@param int $iProfileId
@param string $sTable
@return void | setLastActivity | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/UserCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/UserCoreModel.php | MIT |
public function setLastEdit($iProfileId, $sTable = DbTableName::MEMBER)
{
Various::checkModelTable($sTable);
$this->orm->update($sTable, 'lastEdit', $this->sCurrentDate, 'profileId', $iProfileId);
} | Set the last edit account of a user.
@param int $iProfileId
@param string $sTable
@return void | setLastEdit | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/UserCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/UserCoreModel.php | MIT |
public function getHashValidation($sEmail, $sTable = DbTableName::MEMBER)
{
Various::checkModelTable($sTable);
$rStmt = Db::getInstance()->prepare(
'SELECT email, username, firstName, hashValidation FROM' . Db::prefix($sTable) .
'WHERE email = :email AND active = :emailActivation LIMIT 1'
);
$rStmt->bindValue(':email', $sEmail, PDO::PARAM_STR);
$rStmt->bindValue(':emailActivation', RegistrationCore::EMAIL_ACTIVATION, PDO::PARAM_INT);
$rStmt->execute();
$oRow = $rStmt->fetch(PDO::FETCH_OBJ);
Db::free($rStmt);
return $oRow;
} | Get member data. The validation hash, and other useful data for sending the activation email (hash, email, username, firstName).
@param string $sEmail User's email address.
@param string $sTable
@return stdClass|bool Returns the data member (email, username, firstName, hashValidation) on success, otherwise returns false if there is an error. | getHashValidation | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/UserCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/UserCoreModel.php | MIT |
public function validateAccount($sEmail, $sHash, $sTable = DbTableName::MEMBER)
{
Various::checkModelTable($sTable);
$rStmt = Db::getInstance()->prepare('UPDATE' . Db::prefix($sTable) . 'SET active = :noActivation WHERE email = :email AND hashValidation = :hash AND active = :emailActivation LIMIT 1');
$rStmt->bindValue(':email', $sEmail, PDO::PARAM_STR);
$rStmt->bindValue(':noActivation', RegistrationCore::NO_ACTIVATION, PDO::PARAM_INT);
$rStmt->bindValue(':emailActivation', RegistrationCore::EMAIL_ACTIVATION, PDO::PARAM_INT);
$rStmt->bindParam(':hash', $sHash, PDO::PARAM_STR, self::HASH_VALIDATION_LENGTH);
return $rStmt->execute();
} | Valid on behalf of a user with the hash.
@param string $sEmail
@param string $sHash
@param string $sTable
@return bool | validateAccount | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/UserCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/UserCoreModel.php | MIT |
public function setDefaultPrivacySetting()
{
$rStmt = Db::getInstance()->prepare('INSERT INTO' . Db::prefix(DbTableName::MEMBER_PRIVACY) .
'(profileId, privacyProfile, searchProfile, userSaveViews)
VALUES (:profileId, \'all\', \'yes\', \'yes\')');
$rStmt->bindValue(':profileId', $this->getKeyId(), PDO::PARAM_INT);
return $rStmt->execute();
} | Set the default privacy settings.
@return bool Returns TRUE on success or FALSE on failure. | setDefaultPrivacySetting | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/UserCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/UserCoreModel.php | MIT |
public function setDefaultNotification()
{
$rStmt = Db::getInstance()->prepare('INSERT INTO' . Db::prefix(DbTableName::MEMBER_NOTIFICATION) .
'(profileId, enableNewsletters, newMsg, friendRequest)
VALUES (:profileId, 1, 1, 1)');
$rStmt->bindValue(':profileId', $this->getKeyId(), PDO::PARAM_INT);
return $rStmt->execute();
} | Set the default notifications.
@return bool Returns TRUE on success or FALSE on failure. | setDefaultNotification | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/UserCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/UserCoreModel.php | MIT |
public function checkWaitJoin($sIp, $iWaitTime, $sCurrentTime, $sTable = DbTableName::MEMBER)
{
Various::checkModelTable($sTable);
$rStmt = Db::getInstance()->prepare('SELECT profileId FROM' . Db::prefix($sTable) .
'WHERE ip = :ip AND DATE_ADD(joinDate, INTERVAL :waitTime MINUTE) > :currentTime LIMIT 1');
$rStmt->bindValue(':ip', $sIp, PDO::PARAM_STR);
$rStmt->bindValue(':waitTime', $iWaitTime, PDO::PARAM_INT);
$rStmt->bindValue(':currentTime', $sCurrentTime, PDO::PARAM_STR);
$rStmt->execute();
return $rStmt->rowCount() === 0;
} | To avoid flooding!
Waiting time before a new registration with the same IP address.
@param string $sIp
@param int $iWaitTime In minutes!
@param string $sCurrentTime In date format: 0000-00-00 00:00:00
@param string $sTable
@return bool Return TRUE if the weather was fine, FALSE otherwise. | checkWaitJoin | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/UserCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/UserCoreModel.php | MIT |
public function deleteAvatar($iProfileId)
{
return $this->setAvatar($iProfileId, null, 1);
} | Delete an avatar in the database.
@param int $iProfileId
@return bool | deleteAvatar | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/UserCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/UserCoreModel.php | MIT |
public function getBackground($iProfileId, $iApproved = null)
{
$this->cache->start(self::CACHE_GROUP, 'background' . $iProfileId, static::CACHE_TIME);
if (!$sFile = $this->cache->get()) {
$bIsApproved = $iApproved !== null;
$sSqlApproved = $bIsApproved ? ' AND approved = :approved ' : ' ';
$rStmt = Db::getInstance()->prepare('SELECT file FROM' . Db::prefix(DbTableName::MEMBER_BACKGROUND) . 'WHERE profileId = :profileId' . $sSqlApproved . 'LIMIT 1');
$rStmt->bindValue(':profileId', $iProfileId, PDO::PARAM_INT);
if ($bIsApproved) {
$rStmt->bindValue(':approved', $iApproved, PDO::PARAM_STR);
}
$rStmt->execute();
$sFile = $rStmt->fetchColumn();
Db::free($rStmt);
$this->cache->put($sFile);
}
return $sFile;
} | Get file of a user background.
@param int $iProfileId
@param int|null $iApproved (1 = approved | 0 = pending | NULL = approved and pending).
@return string | getBackground | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/UserCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/UserCoreModel.php | MIT |
public function getGeoProfiles($sCountryCode, $sCity, $bCount, $sOrder, $iOffset = null, $iLimit = null)
{
$bLimit = $iOffset !== null && $iLimit !== null;
$bCount = (bool)$bCount;
$iOffset = (int)$iOffset;
$iLimit = (int)$iLimit;
$sOrder = !$bCount ? SearchCoreModel::order($sOrder, SearchCoreModel::DESC) : '';
$sSqlLimit = (!$bCount || $bLimit) ? 'LIMIT :offset, :limit' : '';
$sSqlSelect = !$bCount ? '*' : 'COUNT(m.profileId)';
$sSqlCity = !empty($sCity) ? 'AND (city LIKE :city)' : '';
$rStmt = Db::getInstance()->prepare(
'SELECT ' . $sSqlSelect . ' FROM' . Db::prefix(DbTableName::MEMBER) . 'AS m LEFT JOIN' . Db::prefix(DbTableName::MEMBER_INFO) . 'AS i USING(profileId)
WHERE (username <> :ghostUsername) AND (country = :country) ' . $sSqlCity . ' AND (username IS NOT NULL)
AND (firstName IS NOT NULL) AND (sex IS NOT NULL) AND (matchSex IS NOT NULL) AND (country IS NOT NULL)
AND (city IS NOT NULL) AND (groupId <> :visitorGroup) AND (groupId <> :pendingGroup) AND (ban = 0)' . $sOrder . $sSqlLimit
);
$rStmt->bindValue(':ghostUsername', PH7_GHOST_USERNAME, PDO::PARAM_STR);
$rStmt->bindValue(':visitorGroup', self::VISITOR_GROUP, PDO::PARAM_INT);
$rStmt->bindValue(':pendingGroup', self::PENDING_GROUP, PDO::PARAM_INT);
$rStmt->bindParam(':country', $sCountryCode, PDO::PARAM_STR, 2);
if (!empty($sCity)) {
$rStmt->bindValue(':city', '%' . $sCity . '%', PDO::PARAM_STR);
}
if (!$bCount || $bLimit) {
$rStmt->bindParam(':offset', $iOffset, PDO::PARAM_INT);
$rStmt->bindParam(':limit', $iLimit, PDO::PARAM_INT);
}
$rStmt->execute();
if (!$bCount) {
$aRow = $rStmt->fetchAll(PDO::FETCH_OBJ);
Db::free($rStmt);
return $aRow;
}
$iTotalUsers = (int)$rStmt->fetchColumn();
Db::free($rStmt);
return $iTotalUsers;
} | Get users from the location data.
@param string $sCountryCode The country code. e.g. US, CA, FR, ES, BE, NL
@param string $sCity
@param bool $bCount
@param string $sOrder
@param int|null $iOffset
@param int|null $iLimit
@return array|stdClass|int Object with the users list returned or integer for the total number users returned. | getGeoProfiles | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/UserCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/UserCoreModel.php | MIT |
public function getPrivacySetting($iProfileId)
{
$this->cache->start(self::CACHE_GROUP, 'privacySetting' . $iProfileId, static::CACHE_TIME);
if (!$oData = $this->cache->get()) {
$iProfileId = (int)$iProfileId;
$rStmt = Db::getInstance()->prepare('SELECT * FROM' . Db::prefix(DbTableName::MEMBER_PRIVACY) . 'WHERE profileId = :profileId LIMIT 1');
$rStmt->bindValue(':profileId', $iProfileId, PDO::PARAM_INT);
$rStmt->execute();
$oData = $rStmt->fetch(PDO::FETCH_OBJ);
Db::free($rStmt);
$this->cache->put($oData);
}
return $oData;
} | Updating the privacy settings.
@param int $iProfileId
@return stdClass | getPrivacySetting | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/UserCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/UserCoreModel.php | MIT |
public function getUsername($iProfileId, $sTable = DbTableName::MEMBER)
{
if ($iProfileId === PH7_ADMIN_ID) {
return t('Administration of %site_name%');
}
$this->cache->start(self::CACHE_GROUP, 'username' . $iProfileId . $sTable, static::CACHE_TIME);
if (!$sUsername = $this->cache->get()) {
Various::checkModelTable($sTable);
$rStmt = Db::getInstance()->prepare('SELECT username FROM' . Db::prefix($sTable) . 'WHERE profileId = :profileId LIMIT 1');
$rStmt->bindValue(':profileId', $iProfileId, PDO::PARAM_INT);
$rStmt->execute();
$sUsername = $rStmt->fetchColumn();
Db::free($rStmt);
$this->cache->put($sUsername);
}
return $sUsername;
} | Retrieves the username from the user ID.
@param int $iProfileId
@param string $sTable
@return string The username of a member. | getUsername | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/UserCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/UserCoreModel.php | MIT |
public function getFirstName($iProfileId, $sTable = DbTableName::MEMBER)
{
$this->cache->start(self::CACHE_GROUP, 'firstName' . $iProfileId . $sTable, static::CACHE_TIME);
if (!$sFirstName = $this->cache->get()) {
Various::checkModelTable($sTable);
$rStmt = Db::getInstance()->prepare('SELECT firstName FROM' . Db::prefix($sTable) . 'WHERE profileId = :profileId LIMIT 1');
$rStmt->bindValue(':profileId', $iProfileId, PDO::PARAM_INT);
$rStmt->execute();
$sFirstName = $rStmt->fetchColumn();
Db::free($rStmt);
$this->cache->put($sFirstName);
}
return $sFirstName;
} | Retrieves the first name from the user ID.
@param int $iProfileId
@param string $sTable
@return string The user first name. | getFirstName | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/UserCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/UserCoreModel.php | MIT |
public function getMatchSex($iProfileId)
{
$this->cache->start(self::CACHE_GROUP, 'matchsex' . $iProfileId, static::CACHE_TIME);
if (!$sMatchSex = $this->cache->get()) {
$rStmt = Db::getInstance()->prepare('SELECT matchSex FROM' . Db::prefix(DbTableName::MEMBER) . 'WHERE profileId = :profileId LIMIT 1');
$rStmt->bindValue(':profileId', $iProfileId, PDO::PARAM_INT);
$rStmt->execute();
$sMatchSex = $rStmt->fetchColumn();
Db::free($rStmt);
$this->cache->put($sMatchSex);
}
return $sMatchSex;
} | Get Match sex for a member (so only from the Members table, because Affiliates and Admins don't have match sex).
@param int $iProfileId
@return string The user's match sex. | getMatchSex | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/UserCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/UserCoreModel.php | MIT |
public function getMembershipDetails($iProfileId)
{
$this->cache->start(self::CACHE_GROUP, 'membershipDetails' . $iProfileId, static::CACHE_TIME);
if (!$oData = $this->cache->get()) {
$sSql = 'SELECT m.*, g.expirationDays, g.name AS membershipName FROM' . Db::prefix(DbTableName::MEMBER) . 'AS m INNER JOIN ' . Db::prefix(DbTableName::MEMBERSHIP) .
'AS g USING(groupId) WHERE profileId = :profileId LIMIT 1';
$rStmt = Db::getInstance()->prepare($sSql);
$rStmt->bindValue(':profileId', $iProfileId, PDO::PARAM_INT);
$rStmt->execute();
$oData = $rStmt->fetch(PDO::FETCH_OBJ);
Db::free($rStmt);
$this->cache->put($oData);
}
return $oData;
} | Get the membership details of a user.
@param int $iProfileId
@return stdClass The membership details. | getMembershipDetails | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/UserCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/UserCoreModel.php | MIT |
public function checkMembershipExpiration($iProfileId, $sCurrentTime)
{
$sSqlQuery = 'SELECT m.profileId FROM' . Db::prefix(DbTableName::MEMBER) . 'AS m INNER JOIN' .
Db::prefix(DbTableName::MEMBERSHIP) . 'AS pay USING(groupId) WHERE
(pay.expirationDays = 0 OR DATE_ADD(m.membershipDate, INTERVAL pay.expirationDays DAY) >= :currentTime) AND
(m.profileId = :profileId) LIMIT 1';
$rStmt = Db::getInstance()->prepare($sSqlQuery);
$rStmt->bindValue(':profileId', $iProfileId, PDO::PARAM_INT);
$rStmt->bindValue(':currentTime', $sCurrentTime, PDO::PARAM_INT);
$rStmt->execute();
return $rStmt->rowCount() === 1;
} | Check if membership is expired.
@param int $iProfileId
@param string $sCurrentTime In date format: 0000-00-00 00:00:00
@return bool | checkMembershipExpiration | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/UserCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/UserCoreModel.php | MIT |
public function updateMembership($iNewGroupId, $iProfileId, $sDateTime = null)
{
$bIsTime = !empty($sDateTime);
$sSqlTime = $bIsTime ? ',membershipDate = :dateTime ' : ' ';
$sSqlQuery = 'UPDATE' . Db::prefix(DbTableName::MEMBER) . 'SET groupId = :groupId' .
$sSqlTime . 'WHERE profileId = :profileId LIMIT 1';
$rStmt = Db::getInstance()->prepare($sSqlQuery);
$rStmt->bindValue(':groupId', $iNewGroupId, PDO::PARAM_INT);
$rStmt->bindValue(':profileId', $iProfileId, PDO::PARAM_INT);
if ($bIsTime) {
$rStmt->bindValue(':dateTime', $sDateTime, PDO::PARAM_STR);
}
return $rStmt->execute();
} | Update the membership group of a user.
@param int $iNewGroupId The new ID of membership group.
@param int $iProfileId The user ID.
@param string|null $sDateTime In date format: 0000-00-00 00:00:00
@return bool Returns TRUE on success or FALSE on failure. | updateMembership | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/UserCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/UserCoreModel.php | MIT |
public function getInfoFields($iProfileId, $sTable = DbTableName::MEMBER_INFO)
{
$this->cache->start(self::CACHE_GROUP, 'infoFields' . $iProfileId . $sTable, static::CACHE_TIME);
if (!$oData = $this->cache->get()) {
Various::checkModelTable($sTable);
$rStmt = Db::getInstance()->prepare('SELECT * FROM' . Db::prefix($sTable) . 'WHERE profileId = :profileId LIMIT 1');
$rStmt->bindValue(':profileId', $iProfileId, PDO::PARAM_INT);
$rStmt->execute();
$oColumns = $rStmt->fetch(PDO::FETCH_OBJ);
Db::free($rStmt);
$oData = new stdClass;
foreach ($oColumns as $sColumn => $sValue) {
if ($sColumn !== 'profileId') {
$oData->$sColumn = $sValue;
}
}
$this->cache->put($oData);
}
return $oData;
} | Get Info Fields from profile ID.
@param int $iProfileId
@param string $sTable
@return stdClass | getInfoFields | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/models/UserCoreModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/models/UserCoreModel.php | MIT |
private function cleanData()
{
$iCleanComment = (int)DbConfig::getSetting('cleanComment');
$iCleanMsg = (int)DbConfig::getSetting('cleanMsg');
$iCleanMessenger = (int)DbConfig::getSetting('cleanMessenger');
// If the option is enabled for Comments
if ($iCleanComment > 0) {
$aCommentMods = ['blog', 'note', 'picture', 'video', 'profile'];
foreach ($aCommentMods as $sSuffixTable) {
if ($iRow = ($this->pruningDb($iCleanComment, CommentCoreModel::TABLE_PREFIX_NAME . $sSuffixTable, 'updatedDate') > 0)) {
echo t('Deleted %0% %1% comment(s) ... OK!', $iRow, $sSuffixTable) . '<br />';
}
}
}
// If the option is enabled for Messages
if ($iCleanMsg > 0) {
if ($iRow = ($this->pruningDb($iCleanMsg, DbTableName::MESSAGE, 'sendDate') > 0)) {
echo nt('Deleted %n% message... OK!', 'Deleted %n% messages... OK!', $iRow) . '<br />';
}
}
// If the option is enabled for Messenger
if ($iCleanMessenger > 0) {
if ($iRow = ($this->pruningDb($iCleanMessenger, DbTableName::MESSENGER, 'sent') > 0)) {
echo nt('Deleted %n% IM message... OK!', 'Deleted %n% IM messages... OK!', $iRow) . '<br />';
}
}
} | Pruning the old data (messages, comments and instant messenger contents).
@return void | cleanData | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/assets/cron/96h/DatabaseCoreCron.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/assets/cron/96h/DatabaseCoreCron.php | MIT |
protected function username($sValue, $sTable)
{
if (!$this->isDbTableValid($sTable)) {
$sTable = DbTableName::MEMBER;
}
$iMin = DbConfig::getSetting('minUsernameLength');
$iMax = DbConfig::getSetting('maxUsernameLength');
$this->iStatus = $this->oValidate->username($sValue, $iMin, $iMax, $sTable) ? 1 : 0;
$this->sMsg = $this->iStatus ? t('This Username is available!') : t('Sorry, but this Username is not available.');
} | Validate the username (must not be empty or already known).
@param string $sValue
@param string $sTable
@return void | username | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/assets/ajax/ValidateCoreAjax.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/assets/ajax/ValidateCoreAjax.php | MIT |
protected function phone($sValue)
{
if (!$this->oValidate->phone($sValue)) {
$this->sMsg = t('Please enter a correct phone number with area code!');
} else {
$this->iStatus = 1;
$this->sMsg = t('OK!');
}
} | Validate international phone numbers in EPP format.
@return string $sValue
@return void | phone | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/assets/ajax/ValidateCoreAjax.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/assets/ajax/ValidateCoreAjax.php | MIT |
protected function terms($sValue)
{
if ($sValue !== 'true') {
$this->sMsg = t('You need to read and accept the terms of use.');
} else {
$this->iStatus = 1;
}
} | Validation of the acceptance of the terms of use.
@param string $sValue
@return void | terms | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/assets/ajax/ValidateCoreAjax.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/assets/ajax/ValidateCoreAjax.php | MIT |
protected function getFieldType()
{
if (strstr($this->sColumn, 'textarea')) {
$sType = 'Textarea';
} elseif (strstr($this->sColumn, 'editor')) {
$sType = 'CKEditor';
} elseif (strstr($this->sColumn, 'email')) {
$sType = 'Email';
} elseif (strstr($this->sColumn, 'password')) {
$sType = 'Password';
} elseif (strstr($this->sColumn, 'url')) {
$sType = 'Url';
} elseif (strstr($this->sColumn, 'phone')) {
$sType = 'Phone';
} elseif (strstr($this->sColumn, 'date')) {
$sType = 'Date';
} elseif (strstr($this->sColumn, 'color')) {
$sType = 'Color';
} elseif (strstr($this->sColumn, 'number')) {
$sType = 'Number';
} elseif (strstr($this->sColumn, 'range')) {
$sType = 'Range';
} elseif (stripos($this->sColumn, 'height') !== false) {
$sType = 'Height';
} elseif (stripos($this->sColumn, 'weight') !== false) {
$sType = 'Weight';
} else {
$sType = 'Textbox';
}
return $sType;
} | Generate other PFBC fields according to the Field Type.
@return string PFBC form type. | getFieldType | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/core/forms/DynamicFieldCoreForm.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/core/forms/DynamicFieldCoreForm.php | MIT |
private function setJsonContentType()
{
Http::setContentType(self::JSON_CONTENT_TYPE);
} | Set the appropriate header output for JSON format.
@return void
@throws Framework\Http\Exception | setJsonContentType | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/pwa/controllers/MainController.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/pwa/controllers/MainController.php | MIT |
private function setXmlContentType()
{
Http::setContentType(self::XML_CONTENT_TYPE);
} | Set the appropriate header output for XML format.
@return void
@throws Framework\Http\Exception | setXmlContentType | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/pwa/controllers/MainController.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/pwa/controllers/MainController.php | MIT |
public function getPicture($iProfileId = null, $iApproved = 1, $iOffset = 0, $iLimit = 1)
{
$sSql = !empty($iProfileId) ? ' AND (profileId <> :profileId) AND FIND_IN_SET(sex, :matchSex)' : ' ';
$rStmt = Db::getInstance()->prepare('SELECT profileId, username, firstName, sex, avatar FROM' . Db::prefix(DbTableName::MEMBER) .
'WHERE (username <> :ghostUsername) AND (ban = 0)' . $sSql . ' AND (avatar IS NOT NULL) AND (approvedAvatar = :approved) ORDER BY RAND() LIMIT :offset, :limit');
$rStmt->bindValue(':ghostUsername', PH7_GHOST_USERNAME, PDO::PARAM_STR);
if (!empty($iProfileId)) {
$rStmt->bindValue(':profileId', $iProfileId, PDO::PARAM_INT);
$rStmt->bindValue(':matchSex', $this->getMatchSex($iProfileId), PDO::PARAM_STR);
}
$rStmt->bindValue(':approved', $iApproved, PDO::PARAM_INT);
$rStmt->bindParam(':offset', $iOffset, PDO::PARAM_INT);
$rStmt->bindParam(':limit', $iLimit, PDO::PARAM_INT);
$rStmt->execute();
$oRow = $rStmt->fetch(PDO::FETCH_OBJ);
Db::free($rStmt);
return $oRow;
} | Get random picture.
@param int|null $iProfileId
If the user is logged in, you need to specify its user ID, in order to not display its own profile since the user cannot vote for themselves.
@param int $iApproved
@param int $iOffset
@param int $iLimit
@return stdClass DATA ot the user (profileId, username, firstName, sex, avatar). | getPicture | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/hotornot/models/HotOrNotModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/hotornot/models/HotOrNotModel.php | MIT |
protected function notFound($b404Status = true)
{
if ($b404Status) {
Http::setHeadersByCode(StatusCode::NOT_FOUND);
}
$this->view->page_title = $this->view->h2_title = $this->sTitle;
$this->view->error = t("Sorry, we weren't able to find the page you requested.") . '<br />' .
t('You can go back on the <a href="%0%">blog homepage</a> or <a href="%1%">search with different keywords</a>.',
Uri::get('blog', 'main', 'index'),
Uri::get('blog', 'main', 'search')
);
} | Set a custom Not Found Error Message with HTTP 404 Code Status.
@param bool $b404Status For the Ajax blocks and others, we can not put HTTP error code 404, so the attribute must be set to FALSE
@return void | notFound | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/blog/controllers/MainController.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/blog/controllers/MainController.php | MIT |
private function setMenuVars()
{
$this->view->top_views = $this->oBlogModel->getPosts(
0,
self::ITEMS_MENU_TOP_VIEWS,
SearchCoreModel::VIEWS
);
$this->view->top_rating = $this->oBlogModel->getPosts(
0,
self::ITEMS_MENU_TOP_RATING,
SearchCoreModel::RATING
);
$this->view->categories = $this->getCategoryList();
} | Sets the Menu Variables for the template.
@return void | setMenuVars | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/blog/controllers/MainController.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/blog/controllers/MainController.php | MIT |
private function notFound()
{
$this->view->page_title = $this->sTitle;
$this->view->h2_title = $this->sTitle;
$this->view->error = t("Sorry, we weren't able to find the page you requested.") . '<br />' .
t('Please <a href="%0%">research with different keywords</a>.',
Uri::get('mail', 'main', 'search')
);
} | Set a Not Found Error Message.
@return void | notFound | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/mail/controllers/MainController.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/mail/controllers/MainController.php | MIT |
private function addAssetFiles()
{
$this->design->addCss(
PH7_LAYOUT . PH7_SYS . PH7_MOD . $this->registry->module . PH7_SH . PH7_TPL . PH7_TPL_MOD_NAME . PH7_SH . PH7_CSS,
'mail.css'
);
$this->design->addJs(
PH7_DOT,
PH7_STATIC . PH7_JS . 'form.js,' . PH7_LAYOUT . PH7_SYS . PH7_MOD . $this->registry->module . PH7_SH . PH7_TPL . PH7_TPL_MOD_NAME . PH7_SH . PH7_JS . 'mail.js'
);
} | Add stylesheets and JavaScript for Mail and Form.
@return void | addAssetFiles | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/mail/controllers/MainController.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/mail/controllers/MainController.php | MIT |
public function setTo($iProfileId, $iMessageId, $sMode)
{
if (!in_array($sMode, self::MODES, true)) {
throw new PH7InvalidArgumentException(
sprintf('Invalid set mode: "%s"!', $sMode)
);
}
$oData = $this->getMsg($iMessageId);
$sFieldId = $oData->sender == $iProfileId ? self::SENDER_DB_FIELD : self::RECIPIENT_DB_FIELD;
if ($sMode === self::RESTORE_MODE) {
$sTrashVal = str_replace([$sFieldId, Db::SET_DELIMITER], '', $oData->trash);
} else {
$sTrashVal = ($oData->sender === $oData->recipient) ? 'sender,recipient' : $sFieldId . (!empty($oData->trash) ? Db::SET_DELIMITER . $oData->trash : '');
} | Set message to 'trash' or 'toDelete'.
@param int $iProfileId User ID
@param int $iMessageId Message ID
@param string $sMode Set to this category. Choose between 'trash', 'restore' and 'delete'
@return bool
@throws PH7InvalidArgumentException | setTo | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/mail/models/MailModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/mail/models/MailModel.php | MIT |
private function addFriendJsFile()
{
$this->design->addJs(
PH7_LAYOUT . PH7_SYS . PH7_MOD . 'friend' . PH7_SH . PH7_TPL . PH7_TPL_MOD_NAME . PH7_SH . PH7_JS,
'friend.js'
);
} | Add the JS file for the Ajax Friend block (if friend module is enabled).
@return void | addFriendJsFile | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/user-dashboard/controllers/MainController.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/user-dashboard/controllers/MainController.php | MIT |
public function select($sTo)
{
$sSqlQuery = 'SELECT * FROM' . Db::prefix(DbTableName::MESSENGER) .
'WHERE (toUser = :to AND recd = 0) ORDER BY messengerId ASC';
$rStmt = Db::getInstance()->prepare($sSqlQuery);
$rStmt->bindValue(':to', $sTo, PDO::PARAM_STR);
$rStmt->execute();
return $rStmt->fetchAll(PDO::FETCH_OBJ);
} | Select Data of content messenger.
@param string $sTo Username
@return array SQL content | select | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/im/models/MessengerModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/im/models/MessengerModel.php | MIT |
private function notFound()
{
Http::setHeadersByCode(StatusCode::NOT_FOUND);
$this->view->page_title = t('Comment Not Found');
$this->view->error = t('No comments yet 😢 <a class="bold" href="%0%">Add one</a>!', Uri::get('comment', 'comment', 'add', $this->sTable . ',' . $this->str->escape($this->httpRequest->get('id'))));
} | Set a Not Found Error Message with HTTP 404 Code Status.
@return void
@throws Framework\File\IOException
@throws Framework\Http\Exception | notFound | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/comment/controllers/CommentController.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/comment/controllers/CommentController.php | MIT |
private function addAjaxCommentJsFile()
{
$this->design->addJs(
PH7_LAYOUT . PH7_SYS . PH7_MOD . $this->registry->module . PH7_SH . PH7_TPL . PH7_TPL_MOD_NAME . PH7_SH . PH7_JS,
'comment.js'
);
} | JavaScript file for Ajax Comment.
@return void | addAjaxCommentJsFile | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/comment/controllers/CommentController.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/comment/controllers/CommentController.php | MIT |
public function idExists($iId, $sTable)
{
$this->cache->start(static::CACHE_GROUP, 'idExists' . $iId . $sTable, static::CACHE_TIME);
if (!$bExists = $this->cache->get()) {
$iId = (int)$iId;
$sTable = CommentCore::checkTable($sTable);
$sRealTable = Comment::getTable($sTable);
$sProfileIdColumn = lcfirst($sTable) . 'Id';
$rStmt = Db::getInstance()->prepare(
'SELECT COUNT(' . $sProfileIdColumn . ') FROM' . Db::prefix($sRealTable) . 'WHERE ' . $sProfileIdColumn . ' = :id LIMIT 1'
);
$rStmt->bindValue(':id', $iId, PDO::PARAM_INT);
$rStmt->execute();
$bExists = $rStmt->fetchColumn() == 1;
Db::free($rStmt);
$this->cache->put($bExists);
}
return $bExists;
} | Check if the recipient ID exists in the table.
@param int $iId
@param string $sTable
@return bool | idExists | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/comment/models/CommentModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/comment/models/CommentModel.php | MIT |
public static function unmodifiable($sMod, $sField)
{
$aMemberUnmodifiableFields = static::MEMBER_UNMODIFIABLE_FIELDS;
if (SysMod::isEnabled('sms-verification')) {
$aMemberUnmodifiableFields[] = 'phone';
}
$aFields = $sMod === 'aff' ? static::AFFILIATE_UNMODIFIABLE_FIELDS : $aMemberUnmodifiableFields;
return in_array(strtolower($sField), $aFields, true);
} | Checks if the field is editable.
@param string $sMod Mod name ("user" or "aff").
@param string $sField
@return bool | unmodifiable | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/field/inc/class/Field.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/field/inc/class/Field.php | MIT |
private function notFound($b404Status = true)
{
if ($b404Status === true) {
Http::setHeadersByCode(StatusCode::NOT_FOUND);
}
$sErrMsg = '';
if ($b404Status === true) {
$sErrMsg = '<br />' . t('Please return to <a href="%0%">the previous page</a> or <a href="%1%">add new photos</a> in this album.', 'javascript:history.back();', Uri::get('picture', 'main', 'addphoto', $this->httpRequest->get('album_id')));
}
$this->view->page_title = $this->view->h2_title = $this->sTitle;
$this->view->error = $this->sTitle . $sErrMsg;
} | Set a Not Found Error Message with HTTP 404 Code Status.
@param bool $b404Status For the Ajax blocks profile, we can not put HTTP error code 404, so the attribute must be set to "false". Default TRUE
@return void | notFound | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/picture/controllers/MainController.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/picture/controllers/MainController.php | MIT |
private function notFound($b404Status = true)
{
if ($b404Status === true) {
Http::setHeadersByCode(StatusCode::NOT_FOUND);
}
$sErrMsg = '';
if ($b404Status === true) {
$sErrMsg = '<br />' . t('Please return to <a href="%0%">the previous page</a> or <a href="%1%">add a new video</a> in this album.', 'javascript:history.back();', Uri::get('video', 'main', 'addvideo', $this->httpRequest->get('album_id')));
}
$this->view->page_title = $this->view->h2_title = $this->sTitle;
$this->view->error = $this->sTitle . $sErrMsg;
} | Set a Not Found Error Message with HTTP 404 Code Status.
@param bool $b404Status For the Ajax blocks profile, we can not put HTTP error code 404, so the attribute must be set to "false". Default: TRUE
@return void | notFound | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/video/controllers/MainController.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/video/controllers/MainController.php | MIT |
private function getApiVideoTitle(Apible $oInfo)
{
if ($this->httpRequest->postExists('title') &&
$this->str->length($this->str->trim($this->httpRequest->post('title'))) > 2
) {
return $this->httpRequest->post('title');
}
return $oInfo->getTitle() ? $oInfo->getTitle() : t('Untitled');
} | Creates a nice title if no title is specified.
@param Apible $oInfo
@return string | getApiVideoTitle | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/video/forms/processing/VideoFormProcess.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/video/forms/processing/VideoFormProcess.php | MIT |
private function getVideoTitle(V\Video $oVideo)
{
if ($this->httpRequest->postExists('title') &&
$this->str->length($this->str->trim($this->httpRequest->post('title'))) > 2
) {
return $this->httpRequest->post('title');
}
return $this->str->upperFirst(
str_replace(
['-', '_'],
' ',
str_ireplace(PH7_DOT . $oVideo->getExt(), '', escape($_FILES['video']['name'], true))
)
);
} | Creates a nice title if no title is specified.
@param V\Video $oVideo
@return string | getVideoTitle | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/video/forms/processing/VideoFormProcess.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/video/forms/processing/VideoFormProcess.php | MIT |
public function set(int $iStatus = 1)
{
return DbConfig::setSetting($iStatus, 'isSiteValidated');
} | Set a site validated/unvalidated.
@param int $iStatus Set "1" to validate the site or "0" to unvalidated it. Default: 1
@return int 1 on success. | set | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/ph7cms-helper/models/ValidateSiteModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/ph7cms-helper/models/ValidateSiteModel.php | MIT |
public static function username(string $sUsername, int $iMaxLength = PH7_MAX_USERNAME_LENGTH)
{
$sUsername = str_replace(['.', ' '], '-', $sUsername);
return substr($sUsername, 0, $iMaxLength);
} | Remove invalid characters that may contain in the Faker usernames.
@return string | username | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/profile-faker/inc/class/Cleanup.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/profile-faker/inc/class/Cleanup.php | MIT |
private function setNotFoundPage()
{
$this->design->setRedirect(
Uri::get(
'newsletter',
'admin',
'browse'
),
null,
null,
self::REDIRECTION_DELAY_IN_SEC
);
$this->displayPageNotFound(t('Sorry, Your search returned no results!'));
} | Redirects to admin browse page, then displays the default "Not Found" page.
@return void | setNotFoundPage | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/newsletter/controllers/AdminController.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/newsletter/controllers/AdminController.php | MIT |
public function getSubscribers()
{
$rStmt = Db::getInstance()->prepare(
'SELECT email, name AS firstName FROM' . Db::prefix(DbTableName::SUBSCRIBER) . 'WHERE active = :status'
);
$rStmt->bindValue(':status', self::ACTIVE_STATUS, PDO::PARAM_INT);
$rStmt->execute();
$aRow = $rStmt->fetchAll(PDO::FETCH_OBJ);
Db::free($rStmt);
return $aRow;
} | Get all Active Subscribers (it is required by the law to send emails only to the confirmed opt-in subscribers).
@return array | getSubscribers | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/newsletter/models/SubscriberModel.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/newsletter/models/SubscriberModel.php | MIT |
private function removeSessionsFromRegistrationProcess()
{
$this->session->destroy();
} | Removes sessions created during the user singup process.
In that case, if the module is requested, but "mail_step3" session doesn't exist, it won't run.
Otherwise, admin would receive several times the "milestone succeeded" email.
@return void | removeSessionsFromRegistrationProcess | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/milestone-celebration/controllers/MainController.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/milestone-celebration/controllers/MainController.php | MIT |
private function getProfileId()
{
$iId = $this->session->get('member_id');
if ($this->bAdminLogged && $this->httpRequest->getExists('profile_id')) {
$iId = $this->httpRequest->get('profile_id');
}
return (int)$iId;
} | Returns the correct profile ID (depending if it's with the "login as" admin or not).
@return int | getProfileId | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/user/controllers/SettingController.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/user/controllers/SettingController.php | MIT |
private function getHomepageUrl()
{
if (SysMod::isEnabled('user-dashboard')) {
return Uri::get('user-dashboard', 'main', 'index');
}
return Uri::get('user', 'main', 'index');
} | Redirect this page to the user homepage.
@return string | getHomepageUrl | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/user/controllers/AccountController.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/user/controllers/AccountController.php | MIT |
private function getUsername()
{
if (!$this->httpRequest->getExists('username')) {
return $this->session->get('member_username');
}
return $this->httpRequest->get('username');
} | If the user is logged in, get 'member_username' session, otherwise get username from URL.
@return string | getUsername | php | pH7Software/pH7-Social-Dating-CMS | _protected/app/system/modules/user/controllers/VisitorController.php | https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/app/system/modules/user/controllers/VisitorController.php | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.