Advertisement
Ipstenu

Hello Stargate

Nov 26th, 2011
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.45 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. function hello_stargate_get_lines() {
  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.         // Here we split it into lines
  44.         $lyrics = explode( "\n", $lyrics );
  45.  
  46.         // And then randomly choose a line
  47.         return wptexturize( $lyrics[ mt_rand( 0, count( $lyrics ) - 1 ) ] );
  48. }
  49.  
  50. // This just echoes the chosen line, we'll position it later
  51. function hello_stargate() {
  52.         $chosen = hello_stargate_get_lines();
  53.         echo "<p id='stargate'>$chosen</p>";
  54. }
  55.  
  56. // Now we set that function up to execute when the admin_notices action is called
  57. add_action( 'admin_notices', 'hello_stargate' );
  58.  
  59. // We need some CSS to position the paragraph
  60. function dolly_css() {
  61.         // This makes sure that the positioning is also good for right-to-left languages
  62.         $x = is_rtl() ? 'left' : 'right';
  63.  
  64.         echo "
  65.        <style type='text/css'>
  66.        #stargate {
  67.                float: $x;
  68.                padding-$x: 15px;
  69.                padding-top: 5px;
  70.                margin: 0;
  71.                font-size: 11px;
  72.        }
  73.        </style>
  74.        ";
  75. }
  76.  
  77. add_action( 'admin_head', 'dolly_css' );
  78.  
  79. ?>
  80.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement