Guest User

Hello Zemin

a guest
Aug 7th, 2019
581
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.06 KB | None | 0 0
  1. <?php
  2. /**
  3.  * @package Hello_Zemin
  4.  * @version 1.0
  5.  */
  6. /*
  7. Plugin Name: Hello Zemin
  8. Plugin URI: http://wordpress.org/plugins/hello-zemin/
  9. Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two poems sung most famously by Zexu Lin: 苟利国家生死以,岂因祸福避趋之. When activated you will randomly see a quote from <cite>Zemin</cite> in the upper right of your admin screen on every page.
  10. Author: Ciel
  11. Version: 1.0
  12. */
  13.  
  14. function hello_zemin_get_quote() {
  15.     /** These are the quotes of Zemin */
  16.     $quotes = "吼呀!
  17. 不要「见着风,是得雨」。
  18. 你等于...你也有责任吧?
  19. 我可以回答你说「无可奉告」!
  20. 我是滋磁的!
  21. 我感觉你们新闻界还要学习一个。
  22. 你们非常熟悉西方的这一套理论。
  23. 你们毕竟还图样。
  24. 我是身经百战了,见得多了。
  25. 西方的哪一个国家我没去过?
  26. 那比你们不知道高到哪里去了!
  27. 我跟他谈笑风生!
  28. 还是要提高自己的知识水平!
  29. 识得唔识得噶?
  30. 图样图森破,上台拿衣服!
  31. 我今天是作为一个长者给你们讲的。
  32. 告诉你们一点,人生的经验。
  33. 中国有一句话叫「闷声发大财」
  34. 我就什么话也不说,这是坠吼的!
  35. 如果你们报道上有偏差,你们要负责!
  36. 没有任何这个意思!
  37. 连任也要按照香港的法律啊!
  38. 当然我们的决定权也是很重要的。
  39. 到那个时候我们会表态的!
  40. 你们啊,不要想喜欢弄个大新闻。
  41. 说现在已经钦定了,把我批判一番。
  42. 你们啊,拿衣服!
  43. I'm angry! 你们这样子是不行的!
  44. 我今天算是得罪了你们一下!
  45. 人呐就不知道,自己就不可以预料。
  46. 一个人的命运啊,当然要靠自我奋斗,但是也要考虑到历史的行程。
  47. 我说另请高明吧。我实在我也不是谦虚。
  48. 我一个上海市委书记怎么到北京来了呢?
  49. 「苟利国家生死以,岂因祸福避趋之?」
  50. 就是军队一律不得经商!
  51. 很惭愧,就做了一点微小的工作。
  52. 你们给我搞的这本东西啊,Excited!";
  53.  
  54.     // Here we split it into lines
  55.     $quotes = explode( "\n", $quotes );
  56.  
  57.     // And then randomly choose a line
  58.     return wptexturize( $quotes[ mt_rand( 0, count( $quotes ) - 1 ) ] );
  59. }
  60.  
  61. // This just echoes the chosen line, we'll position it later
  62. function hello_zemin() {
  63.     $chosen = hello_zemin_get_quote();
  64.     echo "<p id='zemin'>$chosen</p>";
  65. }
  66.  
  67. // We need some CSS to position the paragraph
  68. function zemin_css() {
  69.     // This makes sure that the positioning is also good for right-to-left languages
  70.     $x = is_rtl() ? 'left' : 'right';
  71.  
  72.     echo "
  73.     <style type='text/css'>
  74.     #zemin {
  75.         float: $x;
  76.         padding-$x: 15px;
  77.         padding-top: 5px;      
  78.         margin: 0;
  79.         font-size: 11px;
  80.     }
  81.     </style>
  82.     ";
  83. }
  84.  
  85. // Now we set that function up to execute when the admin_notices action is called
  86. //if(current_user_can('true_fans')===true)
  87. //{
  88. //  require_once( 'pluggable.php' );
  89.     add_action( 'admin_notices', 'hello_zemin' );
  90.     add_action( 'admin_head', 'zemin_css' );
  91. //}
  92.  
  93. ?>
Add Comment
Please, Sign In to add comment