{"id":189,"date":"2008-11-21T23:35:30","date_gmt":"2008-11-21T18:05:30","guid":{"rendered":"http:\/\/www.bin-co.com\/blog\/?p=189"},"modified":"2008-11-21T23:35:30","modified_gmt":"2008-11-21T18:05:30","slug":"quartz-wordpress-plugin","status":"publish","type":"post","link":"https:\/\/www.bin-co.com\/blog\/2008\/11\/quartz-wordpress-plugin\/","title":{"rendered":"Quartz WordPress Plugin"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.bin-co.com\/blog\/wp-content\/uploads\/2008\/10\/wordpress_logo-1-1.png\" alt=\"WordPress Plugin Week\" title=\"WordPress Logo\" width=\"183\" height=\"145\" class=\"alignnone size-full wp-image-136 intro\" align=\"right\" \/><\/p>\n<p class=\"intro\"><strong class=\"highlight\"><a href=\"http:\/\/www.bin-co.com\/tools\/wordpress\/plugins\/quartz\/\">Quartz Plugin<\/a> lets you show random quotes\/tips\/links\/pictures\/something else to visitors<\/strong>. These quotes can be added from the admin side. You can add these one by one &#8211; or you can bulk import the stuff from a text file.<\/p>\n<p>For those of you who are not in the know, this is the Plugin Week. Actually, this is the final day of the plugin week. In Plugin week, I release a new WordPress Plugin each day, every day for one week. This is the fifth plugin in that series. The plugins released so far are&#8230;<\/p>\n<ul>\n<li><a href=\"http:\/\/www.bin-co.com\/blog\/2008\/11\/eventr-wordpress-plugin\/\">Eventr WordPress Plugin<\/a><\/li>\n<li><a href=\"http:\/\/www.bin-co.com\/blog\/2008\/11\/autofields-wordpress-plugin\/\">Autofields WordPress Plugin<\/a><\/li>\n<li><a href=\"http:\/\/www.bin-co.com\/blog\/2008\/11\/pollin-wordpress-plugin\/\">Pollin WordPress Plugin<\/a><\/li>\n<li><a href=\"http:\/\/www.bin-co.com\/blog\/2008\/11\/surveys-wordpress-plugin\/\">Surveys WordPress Plugin<\/a><\/li>\n<\/ul>\n<p><strong class=\"highlight\">Note 1:<\/strong> Quartz is a beta plugin(as are most of the plugins released in the Plugin Week) &#8211; so watch out for bugs. And trust me, there will be a lot of them.<\/p>\n<p><strong class=\"highlight\">Note 2:<\/strong> I would recommend that you don&#8217;t install Quartz right now. It has not yet been accepted into the <a href=\"http:\/\/wordpress.org\/extend\/plugins\/quartz\/\">WordPress Plugin Repository<\/a>. You can install it using the zip file I provide below &#8211; but then there will be some problems with auto updating of the plugin. Its <strong class=\"highlight\">better to wait until WordPress accepts the plugin before installing it<\/strong>. I&#8217;ll update this section when that happens. <strong>UPDATE:<\/strong> WordPress have accepted Quartz &#8211; feel free to install it now.<\/p>\n<h2>Installation<\/h2>\n<ul>\n<li>Download the <a href=\"http:\/\/downloads.wordpress.org\/plugin\/quartz.zip\">zipped file<\/a>.<\/li>\n<li>Extract and upload the contents of the folder to \/wp-contents\/plugins\/ folder<\/li>\n<li>Go to the Plugin management page of WordPress admin section and enable the Quartz plugin<\/li>\n<li>Go to the Quotes Management page(Tools &gt; Manage Quote) to create or edit Quotes<\/li>\n<li>You can add the Quartz widget by going to the widget area and drag-dropping it into your sidebar. Add the code &lt;?php if(function_exists(&#8216;quartz_show&#8217;)) quartz_show() ?&gt; in your template &#8211; this will display the quote at that location.<\/li>\n<\/ul>\n<h2>Usage<\/h2>\n<p>The most apparent use of the plugin is to <strong class=\"highlight\">show random quotes to your visitors<\/strong>. Something like the famous Hello Dolly plugin &#8211; but for the client side. It also useful for showing small tips &#8211; say you are running a <a href=\"http:\/\/lindesk.com\/\">linux blog<\/a>. You can insert useful <a href=\"http:\/\/txt.binnyva.com\/\">linux commands<\/a> with a small description into the quotes database &#8211; and the visitors will see random linux commands when they visit a new page. You can even upload image and add that to the database &#8211; users will see the a random image on each visit.<\/p>\n<p>After installing the plugin, go to the Quartz Management page(Manage > Manage Quote). Now you can create new quotes.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.bin-co.com\/blog\/wp-content\/uploads\/2008\/11\/quartz_manage-1-1.png\" alt=\"Quartz WordPress Plugin - Manage\" title=\"Quartz WordPress Plugin - Manage\" width=\"384\" height=\"226\" class=\"alignnone size-full wp-image-190\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.bin-co.com\/blog\/wp-content\/uploads\/2008\/11\/quartz_edit-1-1.png\" alt=\"Quartz WordPress Plugin - Edit Quote\" title=\"Quartz WordPress Plugin - Edit Quote\" width=\"412\" height=\"550\" class=\"alignnone size-full wp-image-191\" \/><\/p>\n<p>A better and easier way to do this is to <strong class=\"highlight\">use the bulk import method<\/strong>. You can use that to import a text file full of quotes into the database. Each line in the text file must have a quote in it. An example is the <a href=\"http:\/\/binnyva.com\/pro\/dos\/boot_booster\/quotes\/celebrity.txt\">Celebrity Quotes File<\/a>. You can import that file by entering the value &#8216;http:\/\/binnyva.com\/pro\/dos\/boot_booster\/quotes\/celebrity.txt&#8217; in the &#8216;Remote Text File&#8217; field.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.bin-co.com\/blog\/wp-content\/uploads\/2008\/11\/quartz_import-1-1.png\" alt=\"Quartz WordPress Plugin - Edit Quote\" title=\"Quartz WordPress Plugin - Import Quote\" width=\"352\" height=\"451\" class=\"alignnone size-full wp-image-192\" \/><\/p>\n<p>After the quotes are ready, you have to modify the template code a bit. Go to the <strong class=\"highlight\">location in the template where you want to show the quote and add the code<\/strong>&#8230;<\/p>\n<pre><code class=\"php\">&lt;?php quartz_show() ?&gt;<\/code><\/pre>\n<p>This function can take two arguments&#8230;<\/p>\n<dl>\n<dt>$quotes_count<\/dt>\n<dd>The first argument decides how many quotes must be shown. It is an optional argument and it defaults to 1.<\/dd>\n<dt>$quotes_joiner<\/dt>\n<dd>If you are showing more than 1 quote, use this string to join the quotes. The value defaults to &#8216;&lt;br \/&gt;&#8217;.<\/dd>\n<\/dl>\n<h3>Examples<\/h3>\n<pre><code class=\"php\">&lt;?php quartz_show(3, '&lt;br \/&gt;') ?&gt;<\/code><\/pre>\n<p>If you are trying to insert the quotes into the sidebar, this might be the way(might be different depending on your themes code)&#8230;<\/p>\n<pre><code class=\"php\">&lt;li&gt;&lt;h2&gt;Random Quip&lt;\/h2&gt;\n\t&lt;ul&gt;\n\t&lt;li&gt;&lt;?php if(function_exists('quartz_show')) quartz_show(2, '&lt;\/li&gt;&lt;li&gt;') ?&gt;&lt;\/li&gt;\n\t&lt;\/ul&gt;\n&lt;\/li&gt;\n<\/code><\/pre>\n<h2>See it in Action<\/h2>\n<p>You will see it running in my <a href=\"http:\/\/wordpress.binnyva.com\/\">WordPress Demo Blog<\/a> &#8211; look at the sidebar under the heading &#8216;Random Quips&#8217;. It don&#8217;t look all that refined &#8211; but that&#8217;s the themes fault. And I was too lazy to fix the theme \ud83d\ude09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.bin-co.com\/blog\/wp-content\/uploads\/2008\/11\/quartz_result-1-1.png\" alt=\"Quartz WordPress Plugin - Final Result\" title=\"Quartz WordPress Plugin - Final Result\" width=\"233\" height=\"240\" class=\"alignnone size-full wp-image-193\" \/><\/p>\n<h2>Feedback<\/h2>\n<p>If you have any suggestions or notice any problems with the plugin, post it in the <a href=\"http:\/\/projects.binnyva.com\/forum\/viewforum.php?f=15\">Quartz forum<\/a>.<\/p>\n<h2>Last Words?<\/h2>\n<p>This should be the last plugin of my Plugin Week &#8211; but since you have been such a wonderful audience, <strong class=\"highlight\">I&#8217;ll throw in one more &#8211; as a bonus. It will be released tomorrow<\/strong>. Until then!<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p><strong class=\"highlight\"><a href=\"http:\/\/www.bin-co.com\/tools\/wordpress\/plugins\/quartz\/\">Quartz Plugin<\/a> lets you show random quotes\/tips\/links\/pictures\/something else to visitors<\/strong>. These quotes can be added from the admin side. You can add these one by one &#8211; or you can bulk import the stuff from a text file.<\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,25,31],"tags":[212,214,226,229,236,304],"class_list":["post-189","post","type-post","status-publish","format-standard","hentry","category-blogging","category-scripts","category-wordpress","tag-plugin","tag-plugin-week","tag-quartz","tag-quotes","tag-release","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/posts\/189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/comments?post=189"}],"version-history":[{"count":0,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/posts\/189\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/media?parent=189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/categories?post=189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/tags?post=189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}