diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2009-02-22 13:15:37 -0500 | 
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2009-02-22 13:15:37 -0500 | 
| commit | eee98526c48b9154cd9e9bc8bc3e07769e6a39ea (patch) | |
| tree | 9d8d719a2ccea91de86435ccd985241ddb3fa0cb /includes/functions.php | |
| parent | 653c7b3a488488d4b161a8fae41ada5851bf7685 (diff) | |
| download | pillowcase-eee98526c48b9154cd9e9bc8bc3e07769e6a39ea.tar.gz pillowcase-eee98526c48b9154cd9e9bc8bc3e07769e6a39ea.tar.bz2 pillowcase-eee98526c48b9154cd9e9bc8bc3e07769e6a39ea.zip  | |
Rewrote Pillowcase
NOTE: There is a new database schema now, so the database from the testing server has to be copied over to the production server, otherwise this code will fail.
Diffstat (limited to 'includes/functions.php')
| -rw-r--r-- | includes/functions.php | 35 | 
1 files changed, 35 insertions, 0 deletions
| diff --git a/includes/functions.php b/includes/functions.php new file mode 100644 index 0000000..edb666b --- /dev/null +++ b/includes/functions.php | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | function has_meta($id, $name) | ||
| 4 | { | ||
| 5 | $getmeta = "SELECT * FROM meta WHERE comic_id = " . $id . " AND name = \"" . $name . "\""; | ||
| 6 | $getmeta2 = mysql_query($getmeta); | ||
| 7 | $getmeta3 = mysql_fetch_array($getmeta2); | ||
| 8 | |||
| 9 | if ($getmeta3['name'] == $name) | ||
| 10 | { | ||
| 11 | return true; | ||
| 12 | } | ||
| 13 | |||
| 14 | return false; | ||
| 15 | } | ||
| 16 | |||
| 17 | function get_meta($id, $name) | ||
| 18 | { | ||
| 19 | $getmeta = "SELECT * FROM meta WHERE comic_id = " . $id . " AND name = \"" . $name . "\""; | ||
| 20 | $getmeta2 = mysql_query($getmeta); | ||
| 21 | $getmeta3 = mysql_fetch_array($getmeta2); | ||
| 22 | |||
| 23 | return $getmeta3['value']; | ||
| 24 | } | ||
| 25 | |||
| 26 | function next_comic_id() | ||
| 27 | { | ||
| 28 | $getcomic = "SELECT * FROM comics WHERE status = \"publish\" ORDER BY comic_id DESC LIMIT 0,1"; | ||
| 29 | $getcomic2 = mysql_query($getcomic); | ||
| 30 | $getcomic3 = mysql_fetch_array($getcomic2); | ||
| 31 | |||
| 32 | return ($getcomic3['comic_id']+1); | ||
| 33 | } | ||
| 34 | |||
| 35 | ?> | ||
