// digigreg // includes.php // row 2017
// get user id
$dg_id = $config->userid;
// get database
$database = uddeIMgetDatabase();
// get user subscription type
$sql="SELECT `cb_subscriptiontype FROM `#__comprofiler` WHERE `user_id` = ".$dg_id;
$database->setQuery($sql);
$dg_subscription = $database->loadResult();
// get the total number of messages sent from the user from last midnight
$sql="SELECT count(*) FROM `#__uddeim` WHERE #__uddeim.fromid = ".$dg_id." AND #__uddeim.timestamp >= CURDATE()";
$database->setQuery($sql);
$sent_messages_in_last_day = $database->loadResult();
// deny sentence
$block_sentence = JText::_("DG_MESSAGES_LIMIT_REACHED");
if ((($dg_subscription == 'FREE') && ($sent_messages_in_last_day >= 10)) || (($dg_subscription == 'SILVER') && ($sent_messages_in_last_day >= 50))) {
echo $block_sentence;
} else {
echo "<div class='uddeim-sendbutton'>";
echo "<input type='submit' name='reply' class='button' value='"._UDDEIM_SUBMIT."' /> ";
echo "</div>";
}
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.