22, November 2008
trouble with diff. sizes in tag cloud - webmaster forum
This forum shares its ad revenue with its members!
Navigation
Webdigity Services
Pagerank Monitor
Whois Tool
Web Design Gallery
Webmaster Forums
Webmaster Directory
Tutorials Database
Webmaster Forums
WebDigity Community
HumanWorks network new...
Clickbank Contextual S...
Forum Contests
Forum Lounge
New Member Introductions
Tech News
Google Forum
User Forums
aStatSpam forum
Computers
3rd-Party Scripting
The 100 Lists Website ...
PixelThings
Smart Publisher
Forums Talk
Design and Layout
General webmaster disc...
Graphics & Multimedia
Adobe Photoshop
Macromedia Flash & Act...
Web Page Design
HTML & XHTML
CSS
Accesibility issues
Website & Graphic Revi...
Web Development
PhP
PHP classes @finalwebs...
Php User Class
JavaScript
Databases
MySQL
Security
Miscellaneous Languages
ASP & .NET
Java & JSP
Web hosting talk
Hosting companies
Domain names
Configuring your server
Apache web server
Monetizing your site
General Business
CPC programs
Adsense
Chitika eMiniMalls
CPM programs
Affiliate programs & o...
Web site promotion
Promotion techniques
Search Engine Optimiza...
Google SEO
Promoting & building a...
SMF moding & promoting
Marketplace
Advertise your services
Sell your site
Sell a domain name
Request services
Hire people
Link trading requests
[
Home
|
Help
|
Search
|
Forum's Shop
|
Archive
|
Login
|
Register
|
Webmaster Directory
]
Web
www.webdigity.com
Hide the search bar
Whois database search :
Domain :
Use the whois database tool to retrieve information on any top level domain you are interested in.
Webdigity Webmaster Forums
>
Web Development
>
PhP
Topic:
trouble with diff. sizes in tag cloud
« previous
next »
Pages: [
1
]
Author
Topic: trouble with diff. sizes in tag cloud (Read 994 times)
Global Moderator
Community Supporter
?
Jedai Sword Master
Gender:
Posts: 6440
39464 credits
Members referred : 374
It's time to use PHP5!
«
on:
May 11, 2007, 02:50:22 PM »
Hi I have a bit of problems with the calculation of the diff. font-size in my tagcloud:
in this metod I create the array and also the average from all value:
Code:
<?php
function
build_tag_array
() {
$result
=
$this
->
get_records
();
$i
=
0
;
$counting
=
0
;
while (
$obj
=
mysql_fetch_object
(
$result
)) {
$tags
[
$i
][
'name'
] =
$obj
->
tag_name
;
$tags
[
$i
][
'clicks'
] =
$obj
->
tag_clicks
;
$counting
=
$counting
+
$tags
[
$i
][
'clicks'
];
$i
++;
}
$this
->
avg_val
=
$counting
/
$i
;
mysql_free_result
(
$result
);
shuffle
(
$tags
);
return
$tags
;
}
and I create the tags with this code: (using a loop)
Code:
<?php
function
create_element
(
$tag_array
) {
$diff_size
=
$this
->
max_size
-
$this
->
min_size
;
$size
=
$tag_array
[
'clicks'
]/
$this
->
avg_val
*
$diff_size
;
$size
=
round
(
$size
,
1
);
$tag
=
stripslashes
(
$tag_array
[
'name'
]);
if (
$tag_array
[
'name'
] !=
$this
->
current_tag
) {
return
"<span style=\"font-size:"
.
$size
.
"em;\"><a href=\""
.
$this
->
page
.
"?"
.
$this
->
qs_var
.
"="
.
rawurlencode
(
$tag
).
"\">"
.
$tag
.
"</a></span>\n"
;
} else {
return
"<span style=\"font-size:"
.
$size
.
"em;\">"
.
$tag
.
"</span>\n"
;
}
}
is this the right way to calculate the size values?
Website Monitoring Service
Free WordPress Themes
CMS Reviews and Resources
Last blog :
Just a better Internet portal provided by Google
I am a metal monkey!
Administrator
Community Supporter
?
Jedai Sword Master
Gender:
Posts: 8249
42481 credits
Members referred : 3
«
Reply #1 on:
May 11, 2007, 03:16:25 PM »
the max_size and min_size are the minimum and maximum clicks value?
Trial and Error my two best teachers
Join us @ facebook
or
twitter
Last blog :
Free Unlimited Bandwith and disk space to good to be true?
Global Moderator
Community Supporter
?
Jedai Sword Master
Gender:
Posts: 6440
39464 credits
Members referred : 374
It's time to use PHP5!
«
Reply #2 on:
May 11, 2007, 03:47:00 PM »
Quote from: Nikolas on May 11, 2007, 03:16:25 PM
the max_size and min_size are the minimum and maximum clicks value?
no the max and min font size
Website Monitoring Service
Free WordPress Themes
CMS Reviews and Resources
Last blog :
Just a better Internet portal provided by Google
I am a metal monkey!
Administrator
Community Supporter
?
Jedai Sword Master
Gender:
Posts: 8249
42481 credits
Members referred : 3
«
Reply #3 on:
May 11, 2007, 05:39:58 PM »
I would use another way to do this. First you need three variables :
$maxFontSize
$clicks -> Clicks from the active tag
$maxClicks -> The higher clicks value from all tags
In that case the size of a tag would be :
ceil
((
$clicks
*
$maxFontSize
) /
$maxClicks
);
Trial and Error my two best teachers
Join us @ facebook
or
twitter
Last blog :
Free Unlimited Bandwith and disk space to good to be true?
Global Moderator
Community Supporter
?
Jedai Sword Master
Gender:
Posts: 6440
39464 credits
Members referred : 374
It's time to use PHP5!
«
Reply #4 on:
May 11, 2007, 11:31:52 PM »
Quote from: Nikolas on May 11, 2007, 05:39:58 PM
I would use another way to do this. First you need three variables :
$maxFontSize
$clicks -> Clicks from the active tag
$maxClicks -> The higher clicks value from all tags
In that case the size of a tag would be :
ceil
((
$clicks
*
$maxFontSize
) /
$maxClicks
);
thanks I will try that, but I want also a minimum size, maybe I should do that afterwards:
if size < 0.8 size = 0.8...
Website Monitoring Service
Free WordPress Themes
CMS Reviews and Resources
Last blog :
Just a better Internet portal provided by Google
Global Moderator
Community Supporter
?
Jedai Sword Master
Gender:
Posts: 6440
39464 credits
Members referred : 374
It's time to use PHP5!
«
Reply #5 on:
May 12, 2007, 05:02:25 PM »
Quote from: Olaf on May 11, 2007, 11:31:52 PM
Quote from: Nikolas on May 11, 2007, 05:39:58 PM
I would use another way to do this. First you need three variables :
$maxFontSize
$clicks -> Clicks from the active tag
$maxClicks -> The higher clicks value from all tags
In that case the size of a tag would be :
ceil
((
$clicks
*
$maxFontSize
) /
$maxClicks
);
thanks I will try that, but I want also a minimum size, maybe I should do that afterwards:
if size < 0.8 size = 0.8...
I think I got it working thanks!
Website Monitoring Service
Free WordPress Themes
CMS Reviews and Resources
Last blog :
Just a better Internet portal provided by Google
Trackback URI for this entry :
http://www.webdigity.com/trackback.php?topic=6557
Tags :
php
array
tag
cloud
Bookmark this thread :
Digg
Del.icio.us
Dzone
more....
Topic sponsors:
Get a permanent link here for $1.99!
Pages: [
1
]
Webdigity Webmaster Forums
>
Web Development
>
PhP
Topic:
trouble with diff. sizes in tag cloud
« previous
next »
Jump to:
=>Personal Messages
=>My Subscriptions
=>Profile Settings
=>Account Settings
=>Look and Layout Settings
=>Unread Posts
=>Unread Replies To My Posts
=>Affiliate Program
=>Forum's Shop
=>Arcade
Category: WebDigity Community
=> HumanWorks network news & feedback
===> Clickbank Contextual Script Support
=> Forum Contests
=> Forum Lounge
===> New Member Introductions
===> Tech News
===> Google Forum
=> User Forums
Category: Design and Layout
=> General webmaster discussions
=> Graphics & Multimedia
===> Adobe Photoshop
===> Macromedia Flash & Actionscript
=> Web Page Design
===> HTML & XHTML
===> CSS
===> Accesibility issues
=> Website & Graphic Reviews
Category: Web Development
=> PhP
===> PHP classes @finalwebsites.com
=====> Easy PHP Upload
=====> Access_user Class
=====> Validate_fields Class
=====> DB_cart Class
=====> Miscellaneous scripts or snippets
=====> PHP Whois script
=====> 3rd party modifications
===> Php User Class
=> JavaScript
=> Databases
===> MySQL
=> Security
=> Miscellaneous Languages
===> ASP & .NET
===> Java & JSP
=====> Official Java News
Category: Web hosting talk
=> Hosting companies
=> Domain names
=> Configuring your server
===> Apache web server
Category: Monetizing your site
=> General Business
=> CPC programs
===> Adsense
===> Chitika eMiniMalls
=====> Official news from Chitika
=====> Ad placement reviews
=====> eMiniMalls feedback and suggestions
=> CPM programs
=> Affiliate programs & other revenue models
Category: Web site promotion
=> Promotion techniques
=> Search Engine Optimization
===> Google SEO
=> Promoting & building a forum
===> SMF moding & promoting
Category: Marketplace
=> Advertise your services
=> Sell your site
=> Sell a domain name
=> Request services
=> Hire people
=> Link trading requests
User Area
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
Nov 22, 2008, 03:36:43 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Donate to our community, and get a permanent link back to your site!
Forum Statistics
Total Posts:
37.736
Total Topics:
7.650
Total Members:
4.397
Tutorials
:
56
Resources
:
143
Designs
:
220
Latest Member:
Janai
34 Guests, 5 Users online :
Yahoo crawler
,
Googlebot
,
Msnbot
,
Baidu Spider
,
Gigabot
11 users online today:
Nikolas
,
Olaf
,
ruroni
,
IsThatJose
,
webc
,
toy17s
,
dbbrock1
,
edock
,
hintman
,
YMC
,
hobbit
Recent topics
Link exchange
Re: Which is the best resel...
Re: how good are they? ...
Re: Need VPS hosting!...
Re: Plugins in Blog? ...
Breaking News
help needed! Laptop DVD-Rom...
Hello Forum Moderators or A...
HumanWorks Network
Technology news
Webmaster articles
Sublime web directory
RSS Feed directory and viewer
Readers
Web Design Gallery
·
Whois Lookup
·
Pagerank
·
Tag Browsing
·
Lo-fi version
·
Syndication
·
Webmaster forum history
·
Advertise
Developed by
HumanWorks
© 2005 - 2008
Webdigity webmaster community
·
sublime directory
Webdigity Webmaster Forums | Powered by
SMF 1.0.12
. © 2001-2005,
Lewis Media
. All Rights Reserved.