public static function showSpecificAd($input) { $user = User::checkLoginStatus(FALSE); $ad = self::getSpecificAd($input); if ($user) { $sql = "UPDATE user_interested_in_ad \n\t\t\t\t\tINNER JOIN ads\n\t\t\t\t\tON user_interested_in_ad.ad_id = ads.id\n\t\t\t\t\tSET new = '0'\n\t\t\t\t\tWHERE user_interested_in_ad.ad_id = " . $ad->id . "\n\t\t\t\t\tAND ads.user_id = " . $user->id; DB::query($sql); } $output = ['ad' => $ad, 'page' => 'ads.showspecificad.twig', 'browserTitle' => $ad->title, 'tags' => self::getAllTags(), 'user' => $user, 'userInterest' => self::getUserInterest($ad->id, FALSE), 'countInterest' => self::countUserInterest($ad->id), 'newInterests' => User::getNewInterests()]; return $output; }
public static function fallback() { $output = ['browserTitle' => 'Byt och låna prylar nära dig', 'page' => 'home.twig', 'user' => User::checkLoginStatus(FALSE), 'activeAdsAmount' => self::countActiveAds(), 'usersAmount' => self::countUsers(), 'latestUpload' => self::latestUploadedAd(), 'newInterests' => User::getNewInterests()]; return $output; }