Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Sets the users background
- public function executeUserStylesheet(sfWebRequest $request)
- {
- // Dont load a layout with this template
- $this->setLayout(false);
- // Set the content type
- $this->getResponse()->setContentType('text/css');
- $this->user = Doctrine::getTable('User')->getUser($this->getUser()->getAttribute('user_id'));
- }
- ------
- userStylesheetSuccess
- <?php
- $user_id = $user->id;
- $profile_background_color = $user->profile_background_color;
- $profile_background_image = $user->background_file_name;
- echo 'body { background:#'.$profile_background_color.' url(/uploads/'.$user_id.'/profile/background/'.$profile_background_image.'); }';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement