/** * Check if a comment has recently been posted to be used with the Delay setting * @param int $seconds The number of seconds to match against * @return bool Whether there are recent comments or not * @member UGC * @public */ function checkCommentRecent($seconds) { $time_created = time() + $seconds; // Should we check based on user ID or ip address? if ($this->user) { $where = sprintf('(user_id = %s)', $this->user['user_id']); } else { $where = sprintf('(ip = "%s")', Tools::getIP()); } $qry = sprintf('SELECT COUNT(*) AS num_comments FROM %s WHERE %s AND (time_created >= %s)', $this->config['Comments']['Table_Comments'], $where, $time_created); $row = $this->getRow($qry); return $row['num_comments'] > 0; }
<?php $headers = sprintf('From: %s <%s>', $this->config['Core']['Title'], $this->config['Core']['Email']); $subject = sprintf('Password Reset', $this->config['Core']['Title']); $message = sprintf('Hi %s, Did you forget your password? No problem! Please follow the below link to reset your password: %s Thanks, -%s (Note: this request was sent from %s)', $user['username'], $params['resetURL'], $this->config['Core']['Title'], Tools::getIP());