Advertisement
pgrytdal

Stargate Quotes Plugin PHP code

Nov 25th, 2011
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.15 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin Name: Stargate Quotes
  4. Plugin URI: http://wordpress.org/extend/plugins/stargate-quotes
  5. Description: When activated, this plugin will randomly display quotes from the Stargate franchise on every page of your user dashboard. Based on the Hello Dolly plugin by Matt Mullenweg.
  6. Author: pgrytdal
  7. Version: 0.1
  8. Author URI: http://pgrytdal.tk/
  9. */
  10.  
  11. // These are the lyrics to Hello Dolly
  12. $lyrics = "Stargate Quotes
  13. yes, you go down the dark hallway alone and i'll stay in the dark room alone.
  14. Things will not calm down, Daniel Jackson. They will, in fact, calm up.
  15. Do we or do we not have a Zanax detector?
  16. I've heard of a place where Earth women do battle in a ring of Jello.
  17. Indeed.
  18. It took us 15 years and three super computers to MacGyver a system that worked.
  19. Jack: Guess I'm going to have to cancel that Oprah interview. Teal'c: What is an \"oprah\"?
  20. I'm still trying to understand, how you thought it was a good idea to test this device by having someone throw you off a balcony.
  21. Had the Wraith attended the Geneva Convention they would have tried to feed on everyone there.
  22. Holy Hannah!
  23. If you once again try to harm me or one of my companions, my patience with you will expire.
  24. Undomesticated equines could not move me.
  25. Many have said that. But you are the first I believe could do it!
  26. Permission to barge in, Sir?
  27. Daniel, find me an anthropologist that dresses like this and I will eat this headdress.
  28. Well. We're off to see the wizard.
  29. Well, I suppose now is the time for me to say something profound... Nothing comes to mind.
  30. We came here in peace, and we expect to go in one... piece.
  31. Ya think?
  32. Weir: Why are you whispering? McKay: I don't know. It seemed like the right thing to do
  33. It's like looking through a microscope at a cell culture and seeing a thousand dancing hamsters!
  34. You know, Normal Teenage stuff. Pimples, Rebellion, sucking the life out of people.
  35. McKay: I built an atomic bomb for my grade six science fair exhibit.  Lt. Ford: They let you do that up in Canada?
  36. Like \"dinosaurs turned into birds\" theoretically or \"theory of relativity\" theoretically?
  37. They're politicians, Rodney - they're all creepy.
  38. I am beat up, tied up, and couldn't order a pizza right now if I wanted to. But if you need it to be, yeah... it's an order.
  39. It's a city, not a yo-yo.
  40. Maybourne, you are an idiot every day of the week. Couldn't you have taken just one day off?
  41. Now that is one sweet potato.
  42. ";
  43.  
  44. // Here we split it into lines
  45. $lyrics = explode("\n", $lyrics);
  46. // And then randomly choose a line
  47. $chosen = wptexturize( $lyrics[ mt_rand(0, count($lyrics) - 1) ] );
  48.  
  49. // This just echoes the chosen line, we'll position it later
  50. function hello_dolly() {
  51.     global $chosen;
  52.     echo "<p id='dolly'>$chosen</p>";
  53. }
  54.  
  55. // Now we set that function up to execute when the admin_footer action is called
  56. add_action('admin_footer', 'hello_dolly');
  57.  
  58. // We need some CSS to position the paragraph
  59. function dolly_css() {
  60.     echo "
  61.     <style type='text/css'>
  62.     #dolly {
  63.         position: absolute;
  64.         top: 2.3em;
  65.         margin: 0;
  66.         padding: 0;
  67.         right: 10px;
  68.         font-size: 16px;
  69.         color: #d54e21;
  70.     }
  71.     </style>
  72.     ";
  73. }
  74.  
  75. add_action('admin_head', 'dolly_css');
  76.  
  77. ?>
  78.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement