leftpanel.php 1.5 KB

12345678910111213141516171819202122232425262728293031
  1. <div id='left_column'>
  2. <div id='search_panel' class='section'>
  3. <h3 id='search_panel_header' class='section_title search_element no_mobile'><?=$lng["blog_search"]?></h3>
  4. <div class='entry' id='search_panel_inputs'>
  5. <form action='#' onSubmit='event.preventDefault();launchSearch("<?=$lng["search_field_all"]?>");'>
  6. <input id='search_panel_input' class='search_element' type='text' name='query' placeholder='<?=$lng["blog_search"]?>'/>
  7. <input id='search_panel_submit' class='search_element' type='submit' value='<?=$lng["blog_search"]?>'/>
  8. </form>
  9. </div>
  10. </div>
  11. <div id='tag_cloud' class='section desktop'>
  12. <h3 class='section_title'><?=$lng["blog_tag_cloud"]?></h3>
  13. <div class='entry'>
  14. <?php
  15. //Get the most used tag
  16. $q_max = mysqli_query($con, "SELECT max(count) AS max FROM (SELECT count(post) AS count FROM post_tag GROUP BY tag) AS t;");
  17. $r_max = mysqli_fetch_array($q_max);
  18. $max = $r_max["max"];
  19. $q_tag = mysqli_query($con, "SELECT tag, count(post) AS count FROM post_tag GROUP BY tag;");
  20. while($r_tag = mysqli_fetch_array($q_tag)){
  21. $size = round(60 + 100 * $r_tag['count'] / $max);
  22. ?>
  23. <a href='<?=$server?>/blog/buscar/tag/<?=$r_tag["tag"]?>'>
  24. <span style='font-size: <?=$size?>%'><?=$r_tag["tag"]?></span>
  25. </a>
  26. <?php
  27. }
  28. ?>
  29. </div>
  30. </div>
  31. </div>