Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Builds a URL based on whether it's running on IIS (dev, which is funny with URL rewrites) or Apache (production, which has different DB
- // settings, etc)
- function b_url($topic = null, $ctype = null, $cid = null) {
- if (DEV) {
- $base = '?';
- if ($topic) {
- return $base . "topic=$topic";
- }
- if ($topic && $ctype) {
- return $base . "topic=$topic&ctype=$ctype";
- }
- if ($topic && $ctype && $cid) {
- return $base . "topic=$topic&ctype=$ctype&cid=$cid";
- }
- return $base;
- } else {
- $base = '/';
- if ($topic) {
- return $base . "$topic";
- }
- if ($topic && $ctype) {
- return $base . "$topic/$ctype";
- }
- if ($topic && $ctype && $cid) {
- return $base . "$topic/$ctype/$cid";
- }
- return $base;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement