コード例 #1
0
ファイル: db.php プロジェクト: netovs/Core
function spamhurdles_db_get($key)
{
    global $PHORUM;
    $record = $PHORUM['DB']->interact(DB_RETURN_ROW, "SELECT data,expire_time\n         FROM   {$PHORUM['spamhurdles_table']}\n         WHERE id = '" . $PHORUM['DB']->interact(DB_RETURN_QUOTED, $key) . "'");
    // If a record was found, then return the data in case the record
    // isn't expired. If the record is expired, then delete it from
    // the database.
    if ($record) {
        if ($record[1] > time()) {
            return unserialize($record[0]);
        } else {
            spamhurdles_db_remove($key);
        }
    }
    return NULL;
}
コード例 #2
0
ファイル: db.php プロジェクト: sheldon/dejavu
function spamhurdles_db_get($key)
{
    $sql = "SELECT data,expire_time FROM " . SPAMHURDLES_TABLE . " " . "WHERE id = '" . addslashes($key) . "'";
    $record = phorum_db_interact(DB_RETURN_ROW, $sql);
    // If a record was found, then return the data in case the record
    // isn't expired. If the record is expired, then delete it from
    // the database.
    if ($record) {
        if ($record[1] > time()) {
            return unserialize($record[0]);
        } else {
            spamhurdles_db_remove($key);
        }
    }
    return NULL;
}
コード例 #3
0
ファイル: spamhurdles.php プロジェクト: sheldon/dejavu
function phorum_mod_spamhurdles_cleanup_key($key = NULL)
{
    if ($key === NULL && isset($GLOBALS["PHORUM"]["SPAMHURDLES"]["key"])) {
        $key = $GLOBALS["PHORUM"]["SPAMHURDLES"]["key"];
    }
    if ($key !== NULL) {
        spamhurdles_db_remove($key);
    }
}