Created
February 6, 2012 09:22
-
-
Save dodyw/1751028 to your computer and use it in GitHub Desktop.
Part 1: retrieve listing type from database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- mod: retrieve listing type from database --> | |
| <%php%> | |
| global $dbConn; | |
| $id = $_GET['id']; | |
| // premium sponsored | |
| $query = "select * from idx_paid_listing where link_id = '$id'"; | |
| $row2 = $dbConn->FetchOne($query); | |
| $raw_premium = $row2["premium"]; | |
| $raw_sponsored = $row2["sponsored"]; | |
| $raw_expire = $row2["expire"]; | |
| $raw_paid = $row2["paid"]; | |
| $premium = 0; | |
| $sponsored = 0; | |
| if ($raw_paid == 1 && | |
| $raw_premium == 1 && | |
| @strtotime("now") < @strtotime($raw_expire)) { | |
| $premium = 1; | |
| $sponsored = 0; | |
| } | |
| if ($raw_paid == 1 && | |
| $raw_sponsored == 1 && | |
| @strtotime("now") < @strtotime($raw_expire)) { | |
| $premium = 0; | |
| $sponsored = 1; | |
| } | |
| if (!$premium && !$sponsored) { | |
| $basic = 1; | |
| } | |
| $this->assign('status_basic', $basic); | |
| $this->assign('status_premium', $premium); | |
| $this->assign('status_sponsored', $sponsored); | |
| <%/php%> | |
| <!-- /mod: retrieve listing type from database --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment