Keyword - Weighted List Modification
Posted: 12 June 2005 05:24 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  279
Joined  10-17-2002

I’ve found the a way I could modify the sizes of the largest and smallest but what I’d like to modify is the 2nd to largest - is there a way to do that?

 Signature 

————————
Babs - Babineau.ca
Calgary | Alberta | Canada.

Profile
 
 
Posted: 14 June 2005 02:19 PM   [ Ignore ]   [ # 1 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  279
Joined  10-17-2002

hmmm.
Guess not. smile

but there MUST be a way! with EE there’s always a way! You just need to find the person that can figure it out.

 Signature 

————————
Babs - Babineau.ca
Calgary | Alberta | Canada.

Profile
 
 
Posted: 14 June 2005 02:54 PM   [ Ignore ]   [ # 2 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32895
Joined  05-14-2004

i’d imagine the way would involve contacting the author of said plugin… wink

 Signature 
Profile
MSG
 
 
Posted: 14 June 2005 03:10 PM   [ Ignore ]   [ # 3 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9868
Joined  06-19-2002

I think it just does a linear scale between whatever’s specified at the two limits, doesn’t it?  So the individual “levels” wouldn’t be directly modifiable.

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 14 June 2005 03:11 PM   [ Ignore ]   [ # 4 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32895
Joined  05-14-2004

I’m pretty sure you’re right - I don’t think this is a minor modification to the plugin.

 Signature 
Profile
MSG
 
 
Posted: 14 June 2005 03:34 PM   [ Ignore ]   [ # 5 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  279
Joined  10-17-2002

I will send a FR to the author. It’s not a do or die feature. if it’s not doable. I’m quite fine with the way it is.

I could probably try to figure out the plugin, but that would require me to learn the language first!

 Signature 

————————
Babs - Babineau.ca
Calgary | Alberta | Canada.

Profile
 
 
Posted: 14 June 2005 07:43 PM   [ Ignore ]   [ # 6 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23536
Joined  05-20-2002

Yea, there’s no easy way to just affect a single ‘increment’ amount.  Take a look around line 1325- that’s where the font size is calculated:

$font_size_array[$keyword] = round($font_smallest + (($count - 1)/$font_step));

$font_smallest is whatever you set as the smallest font size- default is 10.
$count I THINK refers to the number of articles a given keyword appears in.
$font_step is the increment - I’m not going to get into how it’s calculated as it’s pretty much a constant and you can figure it out from the code.

So….  Basically the way I see to change things is to play with $count in some way- so that the increments end up non-linear.  Maybe use the log or something- don’t know, as I suck with math.  But the php is easy if you had the math- just change the formula as needed.  Anyway, it’s not a constant, so seems the easiest thing to play with.

Wouldn’t change a given increment, but could change the overall pattern.  Hm- don’t know if that made any sense, but hopeful a math geek will chime in.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 14 June 2005 08:27 PM   [ Ignore ]   [ # 7 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23536
Joined  05-20-2002

Heh- and just dinking around, it was easy to modify the interval between the smallest and the next smallest and the largest and the next largest- which is halfway what you want.  Because you can lock in on the smallest and largest, you can use a conditional to play with the baseline for them.  Um… so if you wanted a larger or smaller gap between smallest/next smallest or largest/next largest- you can do:

$font_size_array = array();

foreach ($keywordlist as $keyword => $count)
{
if ($count == min($keywordlist)) {
$font_size_array[$keyword] = (round($font_smallest + (($count - 1)/$font_step))) - 2; }
else {
$font_size_array[$keyword] =  round($font_smallest + (($count - 1)/$font_step));
    }
}

Get it?  In this case, the smallest font is actually 2 smaller than the ‘minimum’ font setting.  So if you left it to the default of 10, the smallest would actually be 8, while everything else is calculated with a base min of 10, thus widening the gap between smallest and next smallest.  Same logic would work subbing in if ($count == max($keywordlist)) .  Still not a fine level of control, but it’s closer.
//

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 16 June 2005 08:48 PM   [ Ignore ]   [ # 8 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  279
Joined  10-17-2002

I will have to give that a try! but not now, I’ve already proved on another thread that I’m not fit for tinkering tonight.

 Signature 

————————
Babs - Babineau.ca
Calgary | Alberta | Canada.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64978 Total Logged-in Users: 30
Total Topics: 82017 Total Anonymous Users: 17
Total Replies: 440817 Total Guests: 171
Total Posts: 522834    
Members ( View Memberlist )