{"id":233006,"date":"2023-02-02T09:58:00","date_gmt":"2023-02-02T06:58:00","guid":{"rendered":"https:\/\/wordpress.mediadoma.com\/?p=233006"},"modified":"2023-02-07T13:25:20","modified_gmt":"2023-02-07T10:25:20","slug":"kuidas-luua-wordpressis-edetabelilehte-gd-star-rating-pistikprogrammi-pohjal","status":"publish","type":"post","link":"https:\/\/wordpress.mediadoma.com\/et\/kuidas-luua-wordpressis-edetabelilehte-gd-star-rating-pistikprogrammi-pohjal\/","title":{"rendered":"Kuidas luua WordPressis edetabelilehte GD Star Rating pistikprogrammi p\u00f5hjal?"},"content":{"rendered":"<p><a href=\"https:\/\/wordpress.mediadoma.com\/et\/gd-star-ratingi-pistikprogramm-ei-toeoeta-korralikult-kui-cloudflare-on-sisse-luelitatud\/\" title=\"GD Star Rating Plugin\">GD Star Rating Plugin<\/a> on kuulus pistikprogramm, mis v\u00f5imaldab lugejatel (ilma sisselogimise v\u00f5i registreerimiseta) hinnata artikleid, postitusi, lehti ja isegi kommentaare.<\/p>\n<p>Seet\u00f5ttu v\u00f5ib olla kasulik reitingud j\u00e4rjestada ja vaadata, millised postitused on populaarsed. N\u00e4iteks selle <a href=\"https:\/\/helloacm.com\/top\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">lehe<\/a> teine \u200b\u200btabel n\u00e4itab hinnanguid positsiooni j\u00e4rgi.<\/p>\n<p>Sellise lehe loomiseks vajate WordPressi pistikprogrammi, mis lisab lehtedele\/postitustele PHP-koodi. Saate otsida \u201eKaasa HTML ja PHP&quot; ja lisada pistikprogrammi.<\/p>\n<p>Kui olete seda teinud, looge uus leht (Postitus on OK) ja sisestage j\u00e4rgmine:<\/p>\n<p>Kaasake GD t\u00e4rnide reitingu edetabelileht<\/p>\n<p>Seej\u00e4rel minge oma WordPressi teema kausta ja looge \u00fclaltoodud viisil <strong>top.php<\/strong>.<\/p>\n<pre><code>&lt;?php\n\u00a0 global $wpdb;\n\u00a0 $query = \"\n \u00a0 \u00a0 \u00a0SELECT \n \u00a0 \u00a0 \u00a0 \u00a0`p`.`ID`, \n \u00a0 \u00a0 \u00a0 \u00a0`p`.`post_name` as `name`, \n \u00a0 \u00a0 \u00a0 \u00a0`p`.`post_title` as `title`, \n \u00a0 \u00a0 \u00a0 \u00a0`visitor_votes` + `user_votes` as `total_votes`, \n \u00a0 \u00a0 \u00a0 \u00a0`visitor_votes`, \n \u00a0 \u00a0 \u00a0 \u00a0`user_votes` \u00a0\n \u00a0 \u00a0 \u00a0FROM \u00a0`\".$wpdb-&gt;prefix.\"gdsr_data_article` as `da` \n \u00a0 \u00a0 \u00a0 \u00a0INNER JOIN $wpdb-&gt;posts as `p` ON `da`.`post_id` = `p`.`ID` \n \u00a0 \u00a0 \u00a0having\n \u00a0 \u00a0 \u00a0 \u00a0`total_votes` &gt; 0\n \u00a0 \u00a0 \u00a0order by \n \u00a0 \u00a0 \u00a0 \u00a0`total_votes` desc \n \u00a0 \u00a0 \u00a0limit 20\n \u00a0\";\n\u00a0 $results = $wpdb-&gt;get_results($query);\n\u00a0 if ($results) { \n\u00a0 \u00a0 \u00a0 \u00a0 $position = 0;\n\u00a0 \u00a0 \u00a0 \u00a0 foreach ($results as $toppost) {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 $position++; \n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 echo \"#\".$position.\"&lt;a title='\".htmlentities($toppost-&gt;title, ENT_QUOTES).\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \"' href='\/archives\/\".($toppost-&gt;ID).\"\/'&gt;\".$toppost-&gt;title.\"&lt;\/a&gt; - \".\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ($toppost-&gt;total_votes).\" &lt;BR&gt;\";\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 }\n?&gt;<\/code><\/pre>\n<p>V\u00f5imalik, et peate kohandama WordPressi postituste URL-i vorme, kui need erinevad siin n\u00e4idatust.<\/p>\n<p><a href=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-155237-61e55875bfe3a.jpg\" data-rel=\"lightbox\"><img decoding=\"async\" class=\"SDStudio-light-box-enable SDStudio-editor-tools-md-imp\" src=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-155237-61e55875bfe3a.jpg\" alt=\"Kuidas luua Wordpressis edetabelilehte GD Star Rating pistikprogrammi p\u00f5hjal?\"><\/a><\/p>\n<p>WordPressi p\u00fcsilingi s\u00e4tted<\/p>\n<p><div id=\"PostUnique_PostSource\" style=\"padding-top: 50px\">:  <a target=\"_blank\" rel=\"noopener nofollow\" href=\"\/\/helloacm.com\" class=\"external external_icon\">helloacm.com<\/a><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Kuidas luua WordPressis edetabelilehte GD Star Rating pistikprogrammi p\u00f5hjal?<\/p>\n","protected":false},"author":1,"featured_media":224746,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[833,894,842,802,812,863],"tags":[1165],"class_list":["post-233006","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-juhend-algajatele","category-kood","category-opetused","category-php-4","category-pistikprogrammid","category-wordpress-4","tag-affiai-et"],"_links":{"self":[{"href":"https:\/\/wordpress.mediadoma.com\/et\/wp-json\/wp\/v2\/posts\/233006","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.mediadoma.com\/et\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.mediadoma.com\/et\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/et\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/et\/wp-json\/wp\/v2\/comments?post=233006"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.mediadoma.com\/et\/wp-json\/wp\/v2\/posts\/233006\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/et\/wp-json\/wp\/v2\/media\/224746"}],"wp:attachment":[{"href":"https:\/\/wordpress.mediadoma.com\/et\/wp-json\/wp\/v2\/media?parent=233006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/et\/wp-json\/wp\/v2\/categories?post=233006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/et\/wp-json\/wp\/v2\/tags?post=233006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}