Advertisement
Guest User

Untitled

a guest
May 26th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. // Sets the users background
  2.   public function executeUserStylesheet(sfWebRequest $request)
  3.   {
  4.     // Dont load a layout with this template
  5.     $this->setLayout(false);
  6.    
  7.     // Set the content type
  8.     $this->getResponse()->setContentType('text/css');
  9.    
  10.     $this->user   = Doctrine::getTable('User')->getUser($this->getUser()->getAttribute('user_id'));
  11.  
  12.   }
  13.  
  14.  
  15. ------
  16.  
  17. userStylesheetSuccess
  18.  
  19. <?php
  20.  
  21.   $user_id                    = $user->id;
  22.   $profile_background_color   = $user->profile_background_color;
  23.   $profile_background_image   = $user->background_file_name;
  24.  
  25.   echo 'body { background:#'.$profile_background_color.' url(/uploads/'.$user_id.'/profile/background/'.$profile_background_image.'); }';
  26.  
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement