pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

PHP paste-bin - collaborative debugging tool View Help


Posted by rdeacon on Fri 18th May 10:42 (modification of post by view diff)
diff | download | new post

  1.                 // New visitor should see default theme first, then go to random themes
  2.                 if(empty($_COOKIE['subsonicradio_visited'])){
  3.                         $this->current = 'default';
  4.                         setcookie('visited', true, strtotime("+10 year"), '/');
  5.                        
  6.                 } else {
  7.                        
  8.                         // Does the Cookie Theme
  9.                         if(isset($_GET['theme']))
  10.                         {
  11.                                 if($_GET['theme'] == 'random')
  12.                                 {
  13.                                         $this->current = null;
  14.                                         $_COOKIE['subsonicradio_theme'] = null;
  15.                                 }
  16.                                 else
  17.                                 {
  18.                                         $this->current = $_GET['theme'];
  19.                                         setcookie("subsonicradio_theme", $this->current, strtotime("+1 year"), "/" );
  20.                                 }
  21.                         }
  22.                        
  23.                         if(empty($this->current))
  24.                         {
  25.                                 if(isset($_COOKIE['subsonicradio_theme']))
  26.                                 {
  27.                                         $this->current = $_COOKIE['subsonicradio_theme'];
  28.                                 } else {
  29.                                         $themes = array_keys($this->themeList);
  30.                                         $rand = rand(1, count($themes)) -1;
  31.                                         $this->current = $themes[$rand];
  32.                                         setcookie("subsonicradio_theme", $this->current, null, "/"); // Since it's a random theme, just set it for the current session
  33.                                 }
  34.                         }
  35.                 }

Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Use syntax highlighting

To highlight particular lines, prefix each line with @@
:
:
Remember my settings