leftpanel.php 1.3 KB

123456789101112131415161718192021222324252627
  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"><?php echo $lng['blog_search'];?></h3>
  4. <div class="entry" id="search_panel_inputs">
  5. <form action="#" onSubmit="event.preventDefault();launchSearch('<?php echo $lng['search_field_all']; ?>');">
  6. <input id="search_panel_input" class="search_element" type="text" name="query" placeholder="<?php echo($lng['blog_search']); ?>"/>
  7. <input id="search_panel_submit" class="search_element" type="submit" value="<?php echo $lng['blog_search'];?>"/>
  8. </form>
  9. </div>
  10. </div>
  11. <div id="tag_cloud" class="section desktop">
  12. <h3 class="section_title"><?php echo $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); //TEST: Relativize
  22. echo "<a href='$proto$http_host/blog/buscar/tag/$r_tag[tag]'><span style='font-size: $size%'>$r_tag[tag]</span></a>\n";
  23. }
  24. ?>
  25. </div>
  26. </div>
  27. </div>