summaryrefslogtreecommitdiff
path: root/lib/deck/view.php
diff options
context:
space:
mode:
authorNicolas BERNSTEIN <alexis211@gmail.com>2011-09-18 12:07:29 +0200
committerNicolas BERNSTEIN <alexis211@gmail.com>2011-09-18 12:07:29 +0200
commita565e649898c629874ef812a13806b1c384f68e4 (patch)
treeafc03ed12ec7e82ce17bcfff5ba76440ff43eb97 /lib/deck/view.php
parent8d9321225140a3db0b72796d4d0236d6cacfeb8a (diff)
downloadBits-a565e649898c629874ef812a13806b1c384f68e4.tar.gz
Bits-a565e649898c629874ef812a13806b1c384f68e4.zip
Added study program. Yay!
Diffstat (limited to 'lib/deck/view.php')
-rw-r--r--lib/deck/view.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/deck/view.php b/lib/deck/view.php
index eda2ca0..5604395 100644
--- a/lib/deck/view.php
+++ b/lib/deck/view.php
@@ -31,4 +31,12 @@ while ($nn = mysql_fetch_assoc($n)) $cards[] = $nn;
$can_edit = false;
if ($deck["owner_id"] == $user['id']) $can_edit = true;
+$can_start_study = false;
+if ($user['id'] != 0) {
+ if (!mysql_fetch_assoc(sql("SELECT id FROM deck_study WHERE deck = $deckid AND user = " . $user['id'])))
+ $can_start_study = true;
+} else {
+ $message = "You should create an account in order to study this deck.";
+}
+
require("tpl/deck/view.php");