{"id":4847,"date":"2009-02-25T15:31:31","date_gmt":"2009-02-25T15:31:31","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/factolex\/"},"modified":"2009-03-25T12:26:09","modified_gmt":"2009-03-25T12:26:09","slug":"factolex","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/factolex\/","author":2010849,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0.3","stable_tag":"trunk","tested":"2.7.1","requires":"2.5","requires_php":"","requires_plugins":"","header_name":"Factolex","header_author":"Sebastian Moser","header_description":"","assets_banners_color":"","last_updated":"2009-03-25 12:26:09","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/sebmos.at\/factolex-wordpress-plugin\/","header_plugin_uri":"http:\/\/sebmos.at\/factolex-wordpress-plugin\/","header_author_uri":"http:\/\/sebmos.at\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":1009,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[28925,90],"plugin_category":[57],"plugin_contributors":[],"plugin_business_model":[],"class_list":["post-4847","plugin","type-plugin","status-closed","hentry","plugin_tags-factolex","plugin_tags-tag","plugin_category-taxonomy","plugin_committers-sebmos"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/factolex.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p><a href=\"http:\/\/factolex.com\/\">Factolex<\/a> is a fact lexicon with an API that allows retrieving these facts and use them on your blog. This plugin makes showing facts on a blog very simple.<\/p>\n <p>The most likely use case is spicing up the tag pages with some extra content, basic explanation to a topic, etc. This is an example fact: http:\/\/en.factolex.com\/Google:internet<\/p>\n <p>Facts from Factolex are available in <strong>English<\/strong> and <strong>German<\/strong>.<\/p>\n\n<!--section=installation-->\n<p>To <em>install<\/em> the plug-in, copy the factolex.php-file into the wp-content\/plugins-folder and activate the plug-in in the WordPress Plugin Administration.<\/p>\n <p>There are two ways to <em>get data<\/em> and two ways to <em>use the data<\/em> with the plugin, they require editing your theme's template files.<\/p>\n <p><strong>Step 1: Initialize Plugin<\/strong><\/p>\n <pre><code>$factolex = new Factolex_Facts(); <\/code><\/pre>\n <p><strong>Step 2: Get Data<\/strong><\/p>\n <p><em>2.1 Get Terms by Name<\/em><\/p>\n <p>Get only those terms that equal the search query.<\/p>\n <pre><code>$factolex-&gt;getByTerm($query, $language (en|de)); <\/code><\/pre>\n <p><em>2.2 Get Term by ID<\/em><\/p>\n <p>Get one term based on Factolex' internal term ID.<\/p>\n <pre><code>$factolex-&gt;getById($id); <\/code><\/pre>\n <p><em>2.3 Search for Terms<\/em><\/p>\n <p>Returns all terms, including those that don't exactly equal the search query.<\/p>\n <pre><code>$factolex-&gt;search($query, $language (en|de)); <\/code><\/pre>\n <p><strong>Step 3: Return the Data<\/strong><\/p>\n <p><em>3.1 Return HTML<\/em><\/p>\n <pre><code>$factolex-&gt;getHTML($maximum_facts); <\/code><\/pre>\n <p><em>3.2 Return Array<\/em><\/p>\n <pre><code>$factolex-&gt;getArray();   $data = array(     array(         'title' =&gt; 'Term title',         'id'    =&gt; 'Internal Term ID',         'link'  =&gt; 'Link to term on Factolex homepage',         'tags'  =&gt; 'Tags, separated by spaces',         'facts' =&gt; array(             array(                 'title'     =&gt; 'Fact text',                 'tags'      =&gt; 'Tags, separated by spaces',                 'source'    =&gt; 'Link to source, if available'             )         )     ) ); <\/code><\/pre>\n <p><strong>Example<\/strong><\/p>\n <p>To search for terms on the tag page and return the three best ones.<\/p>\n <pre><code>&lt;?php $factolex = new Factolex_Facts(); $factolex-&gt;getByTerm(single_tag_title('', false), 'en'); echo $factolex-&gt;getHtml(3); ?&gt; <\/code><\/pre>\n <p><strong>Nofollow-Links<\/strong><\/p>\n <p>To automatically nofollow links to Factolex, edit the FACTOLEX_NOFOLLOW constant in factolex.php to 1.<\/p>","raw_excerpt":"Factolex is a fact lexicon with an API that allows retrieving facts and use them on your blog. This plugin makes showing facts on a blog very simple.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/4847","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=4847"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/sebmos"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=4847"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=4847"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=4847"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=4847"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=4847"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=4847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}