{"id":261,"date":"2005-04-29T21:45:21","date_gmt":"2005-04-29T20:45:21","guid":{"rendered":"http:\/\/frenchfragfactory.net\/ozh\/wordpress-plugin-random-words\/"},"modified":"2008-04-11T14:52:01","modified_gmt":"2008-04-11T12:52:01","slug":"wordpress-plugin-random-words","status":"publish","type":"page","link":"https:\/\/planetozh.com\/blog\/my-projects\/wordpress-plugin-random-words\/","title":{"rendered":"WordPress Plugin : Random Words"},"content":{"rendered":"<p>Random Words is another completely futile plugin which aims to bring entropy and randomness into your pages and even posts.<\/p>\n<p>Ever got bored by comment pages with the same &quot;Joe <em>said<\/em>&quot;, &quot;Jim <em>said<\/em>&quot; all page long ? Wouldn&#39;t it be funnier and more attractive if it printed something randomly from &quot;thought&quot;, &quot;wrote&quot;, &quot;said&quot; and &quot;commented&quot; ? Here we are.<\/p>\n<p>Random Words is a WordPress Plugin allowing you to manage a number of lists with any items, and display random items from these lists. Everything is managed from within the Admin interface of your blog, in a very neat interface. It stores its data in two fields of WordPress&#39; built-in Options table, and displays random entries at no cost (no extra SQL query used to fetch items)<\/p>\n<h2>Get it<\/h2>\n<div class=\"download\">\nDownload the plugin :<br \/>\n<a href=\"http:\/\/downloads.wordpress.org\/plugin\/ozh-random-words.zip\">ozh-random-words.zip<\/a><br \/>\nExtract and upload to your blog, preserving directory structure if any.<br \/>\n<small>Note: download counter here and stats on wordpress.org may differ and reflect the number of downloads before this plugin was hosted on the plugin directory<\/small>\n<\/div>\n<p>Activate it, go the options page and follow the instructions.<\/p>\n<h2>Use it<\/h2>\n<p>Use the following syntax :<\/p>\n<ul>\n<li>In .php documents :<br \/>\n<strong>&lt;?php wp_ozh_randomwords(&#39;name_of_list&#39;) ?><\/strong><br \/>\nIf you want the result returned but not echoed, add a second parameter with value zero :<br \/>\n<strong>&lt;?php $test = wp_ozh_randomwords(&#39;name_of_list&#39;, 0) ?><\/strong><\/p>\n<\/li>\n<li>In Posts or Pages :<br \/>\n<strong>&#091;random:name_of_list]<\/strong>\n<\/li>\n<\/ul>\n<p>I don&#39;t see any reasonable use for this in posts, but well, I had to do it :)<\/p>\n<h2>Watch it<\/h2>\n<p>For example, I created a list named &quot;you_are&quot; with the following entries :<\/p>\n<div id=\"ig-sh-1\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">HTML<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"html4strict\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">a nice person<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">a <span style=\"color: #009900\">&lt;<span style=\"color: #000000;font-weight: bold\">em<\/span>&gt;<\/span>porn star<span style=\"color: #009900\">&lt;<span style=\"color: #66cc66\">\/<\/span><span style=\"color: #000000;font-weight: bold\">em<\/span>&gt;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">so <span style=\"color: #009900\">&lt;<span style=\"color: #000000;font-weight: bold\">em<\/span>&gt;<\/span>cute<span style=\"color: #009900\">&lt;<span style=\"color: #66cc66\">\/<\/span><span style=\"color: #000000;font-weight: bold\">em<\/span>&gt;<\/span> !<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #009900\">&lt;<span style=\"color: #000000;font-weight: bold\">span<\/span> <span style=\"color: #000066\">style<\/span><span style=\"color: #66cc66\">=<\/span><span style=\"color: #ff0000\">&quot;color:purple&quot;<\/span>&gt;<\/span>teh master of teh intarweb<span style=\"color: #009900\">&lt;<span style=\"color: #66cc66\">\/<\/span><span style=\"color: #000000;font-weight: bold\">span<\/span>&gt;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">reloading the page<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">pretty. Well, sort of.<\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<p>In this page I wrote :<\/p>\n<div id=\"ig-sh-2\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">HTML<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"html4strict\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">I see, I see ... that you are [ random: you_are ]<\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<p>The result is (reload to see it change) :<br \/>\nI see, I see &#8230; that you are pretty. Well, sort of.<\/p>\n<p>Keep list names short and avoid funky characters, but use anything including HTML in the entries. It has to be one-liners, but you can insert a manual <em>&lt;br\/><\/em><\/p>\n<h2>Push it<\/h2>\n<p>A few suggestions, or examples of use (name of the list, followed by items of the list)<\/p>\n<div id=\"ig-sh-3\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">code<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"code\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">trackback: trackback, pingback, chmlmlback, stuffback, sumthinback, trackpingback<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">comment: wrote, said, replied, thought, commented<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">emphasis: extremely, wickedly, awesomely, completely<\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<p>You could also use it as a <em>Quote of the Second<\/em> script : create a list named &quot;quotes&quot; and add entries like :<\/p>\n<div id=\"ig-sh-4\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">code<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"code\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&lt;em&gt;640K ought to be enough for anybody.&lt;\/em&gt;&lt;br \/&gt;&amp;raquo;&lt;strong&gt;Bill Gates&lt;\/strong&gt;, 1981<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&lt;em&gt;A fast word about oral contraception. I asked a girl to go to bed with me, she said 'no'.&lt;br \/&gt;&amp;raquo;&lt;strong&gt;Woody Allen&lt;\/strong&gt;, yesterday<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">...<\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<h2>Tell me<\/h2>\n<p>Got a suggestion, a bug report, something to tell, to thank or to complain about ? Using this plugin on your blog ? Made something fun with it ? Tell me !<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Random Words is another completely futile plugin which aims to bring entropy and randomness into your pages and even posts. Ever got bored by comment pages with the same &quot;Joe said&quot;, &quot;Jim said&quot; all page long ? Wouldn&#39;t it be funnier and more attractive if it printed something randomly from &quot;thought&quot;, &quot;wrote&quot;, &quot;said&quot; and &quot;commented&quot; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":241,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-261","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/pages\/261","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/comments?post=261"}],"version-history":[{"count":0,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/pages\/261\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/pages\/241"}],"wp:attachment":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/media?parent=261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}