Register Register Member Login Member Login Member Login Forgot Password ??
PHP (Hypertext Preprocessor), ASP (Active Server Pages), ASP.NET, VB.NET, C# (.Net 1.1, 2.0, 3.5, 4.0)
   
 

Registered : 86,976

 
 
HOME > บทความจากสมาชิก > มาทำ tag cloud เก๋ๆ ไว้ใช้กันเถอะ

มาทำ tag cloud เก๋ๆ ไว้ใช้กันเถอะ

 
 

ลองใช้ค้นหาข้อมูล


   
Bookmark.
โค้ดการสร้าง tagcloud จาก array ก็ดังรูปเลยครับ

<style type="text/css">
.tag_cloud { padding: 3px; text-decoration: none; }
.tag_cloud:link { color: #81d601; }
.tag_cloud:visited { color: #019c05; }
.tag_cloud:hover { color: #ffffff; background: #69da03; }
.tag_cloud:active { color: #ffffff; background: #ACFC65; }
</style>
<?
function get_tag_data() {
$arr = Array('Actionscript' => 35, 'Adobe' => 22, 'Array' => 44, 'Background' => 43,
'Blur' => 18, 'Canvas' => 33, 'Class' => 15, 'Color Palette' => 11, 'Crop' => 42,
'Delimiter' => 13, 'Depth' => 34, 'Design' => 8, 'Encode' => 12, 'Encryption' => 30,
'Extract' => 28, 'Filters' => 42, 'Flash' => 32, 'Functions' => 19,
'Gaussian Blur' => 44, 'Grafix' => 49, 'Graphics' => 35, 'Hue' => 47, 'Illustrator' => 8,
'Image Ready' => 12, 'Javascript' => 47, 'Jpeg' => 15, 'Keyboard' => 18, 'Level' => 28,
'Liquify' => 30, 'Listener' => 10, 'Logo' => 12, 'Loops' => 22, 'Macromedia' => 26,
'Method' => 28, 'MySQL' => 18, 'Obfuscation' => 13, 'Object' => 39, 'Optimize' => 25,
'PDF' => 37, 'PHP' => 44, 'PSD' => 17, 'Photography' => 28, 'Photoshop' => 46,
'Revert' => 50, 'Saturation' => 35, 'Save as' => 28, 'Scope' => 11, 'Scripting' => 9,
'Security' => 41, 'Sharpen' => 49, 'Switch' => 41, 'Templates' => 11, 'Texture' => 22,
'Tool Palette' => 30, 'Variables' => 50);
return $arr;
}
function get_tag_cloud() {
// Default font sizes
$min_font_size = 12;
$max_font_size = 30;
// Pull in tag data
$tags = get_tag_data();
$minimum_count = min(array_values($tags));
$maximum_count = max(array_values($tags));
$spread = $maximum_count - $minimum_count;
// modify by www.narongrit.net
if($spread == 0) {
$spread = 1;
}
$cloud_html = '';
$cloud_tags = array(); // create an array to hold tag code
foreach ($tags as $tag => $count) {
$size = $min_font_size + ($count - $minimum_count)
* ($max_font_size - $min_font_size) / $spread;
$cloud_tags[] = '<a style="font-size: '. floor($size) . 'px'
. '" class="tag_cloud" href="http://www.google.com/search?q=' . $tag
. '" title="' . $tag . '" returned a count of ' . $count . '">'
. htmlspecialchars(stripslashes($tag)) . '</a>';
} //modify by www.narongrit.net
$cloud_html = join("|", $cloud_tags) . "";
return $cloud_html;}
?>
<h3>Sample Tag Cloud results</h3>
<div id="wrapper" align="center">
<!-- BEGIN Tag Cloud -->
<?php print get_tag_cloud(); ?>
<!-- END Tag Cloud -->
</div>


อันนี้ผมปรับแต่งมาจากเว็บเมืองนอกน่ะครับ
ส่วนถ้าใครสนใจวิธีการทำ tag cloud จากฐานข้อมูลก็อ่านต่อที่บทความนี้ครับ
http://www.narongrit.net/download-readdownload-id63.html


Reference : http://www.narongrit.net



  By : คุณฉุย
  Article : บทความเป็นการเขียนโดยสมาชิก หากมีปัญหาเรื่องลิขสิทธิ์ กรุณาแจ้งให้ทาง webmaster ทราบด้วยครับ
  Score Rate :
  Create Date : 2009-02-19
  View : 5,891
  Download : No files
Sponsored Links
 
 
Thanks. Our Sponsor.
Download Google Chorme
 
Ads Contact : 08-1987-6107

Sponsored Links

หา Latitude Longitud ของสถานที่ จากที่อยู่ใน Google map v3
หา Latitude Longitud ของสถานที่ จากที่อยู่ใน Google map v3
หา Latitude Longitude โดย Google Map v3 ด้วยฟังก์ชั่น Geocode ร่วมกับ Jquery + JqueryUI
Rate :
Update :
2011-09-30 06:44:07 View : 1,885
Apache Using 404 Error URL Rewrite - SEO Friendly URL for PHP
Apache Using 404 Error URL Rewrite - SEO Friendly URL for PHP
เป็นเทคนิค Apache การเรียกใช้งาน 404 Error (Page Not Found) มาใช้สร้าง URL Rewrite - SEO Friendly
Rate :
Update :
2011-05-27 08:36:55 View : 9,420
ColorBox jQuery Images  SlideShow  ทำ Gallery แบบ สไลด์รูปภาพแสดงภาพเปลี่ยนไปเรื่อยๆ
ColorBox jQuery Images SlideShow ทำ Gallery แบบ สไลด์รูปภาพแสดงภาพเปลี่ยนไปเรื่อยๆ
ใช้ ColorBox ของ jQuery ในการทำ SlideShow แสดงรูปภาพใน Gallery ในฐานข้อมูล PHP กับ MySQL โดยสไลด์ภาพเลื่อนแสดงภาพเปลี่ยนไปเรื่อยๆ
Rate :
Update :
2011-10-30 15:10:41 View : 5,569
เขียน JavaScript ใช้งาน Cookie แบบง่าย ๆ
เขียน JavaScript ใช้งาน Cookie แบบง่าย ๆ
รู้วิธีการใช้งาน JavaScript เพื่อเก็บค่าต่าง ๆ ของ Client ลงใน Cookie ของ Web Browser เช่นค่าที่ผู้ใช้กรอกตรงใน Input หรือ textarea
Rate :
Update :
2011-05-20 23:41:04 View : 8,955
ดึงค่า tag form ด้วยคำสั่ง jsp
ดึงค่า tag form ด้วยคำสั่ง jsp
กรณีมีหน้า form หน้าแรกแล้วทำการ submit มา จะดึงค่าภายใน object จากหน้าดังกล่าวมาใช้งานต่อโดยใช้คำสั่ง s=request.getParameter("s");
Rate :
Update :
2011-05-21 00:09:30 View : 1,064
การติดตั้ง ปลั๊กอิน Statpress บน WordPress
การติดตั้ง ปลั๊กอิน Statpress บน WordPress
Download ปลั๊กอินจาก ทำการอัพโหลดปลั๊กอิน โดยเข้าไปที่ เมนู Plugins—->Add New
Rate :
Update :
2011-11-20 21:45:51 View : 298
ThaiCreate.Com Forum
ThaiCreate.Com Forum คลังกระทู้
บทความโดยสมาชิก
PHP Forum ASP Forum
.NET Forum Graphic Forum
Comunity Forum Free Web Script
Jobs Freelance Free Uploads
Free Web Hosting Free Tools



 

© www.ThaiCreate.Com. 2003-2011 All Rights Reserved. Link : ไทยกู๊ดเว็บ , ติดแก๊ส , Promote Website
Comments & Suggestions Please Contact Us : thaicreate at hotmail dot com [Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่

Inline