Page 1 of 1

Word Graph - Size of words!!!

Posted: 19. November 2009 22:12
by Foxy
Your Portal Version: 1.0.0RC3
Your phpBB Type: Standard phpBB3
MODs installed: Yes
Your knowledge: Beginner
Boardlink: http://www.border-forums.com

What have you done before the problem was there?
Nothing

What have you already tryed to solve the problem?
Nothing

Description and Message
Hi all,

Can anyone tell me what has happened to the Wordgraph on my Portal!!

It was ok last night and tonight, well, see the screenshot!!

Image

All the words are huge and the same size. I have set the Text size aspect ratio to 10 and it makes no difference.

Also, all the words seem to have approximately the same number of occurences!!!

This may have something to do with the guy who was doing my site. He made a whole load of changes and did a runner. Now I'm having to try and fix them one by one and I don't have a clue.

Regards
Foxy

Re: Word Graph - Size of words!!!

Posted: 19. November 2009 22:23
by Marc
First of, it would be nice to know which version of Board3 Portal you use. Secondly, I can't reproduce the sizing error you seem to have. Also, I don't know how the words would be recounted. Therefore, I would suggest you open a support topic on phpBB.com for that, too.

Re: Word Graph - Size of words!!!

Posted: 21. November 2009 14:31
by Foxy
Marc,

I am using version 1.0.4

I did as you said and posted the problem over at phpBB.com.
The thread can be viewed here: http://www.phpbb.com/community/viewtopi ... &t=1865025

I have rebuilt my search index and it has made no difference. I am using Fulltext native as my search backend as it says 'Wordgraph does not work when fulltext mysql is selected as the search backend' on the ACP Wordgraph settings.

I have left my Wordgraph in place so you can see for yourself what the problem is.
http://www.border-forums.com


Here is my wordgraph.php:

<?php

/**
*
* @package - Board3portal
* @version $Id: wordgraph.php 523 2009-08-27 21:41:08Z christian_n $
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

if (!defined('IN_PHPBB') || !defined('IN_PORTAL'))
{
exit;
}

$words_array = array();

// Get words and number of those words
$sql = 'SELECT l.word_text, COUNT(*) AS word_count
FROM ' . SEARCH_WORDLIST_TABLE . ' AS l, ' . SEARCH_WORDMATCH_TABLE . ' AS m
WHERE m.word_id = l.word_id
GROUP BY m.word_id
ORDER BY word_count DESC';
$result = $db->sql_query_limit($sql, $portal_config['portal_wordgraph_max_words']);

while ($row = $db->sql_fetchrow($result))
{
$word = strtolower($row['word_text']);
$words_array[$word] = $row['word_count'];
}
$db->sql_freeresult($result);

$minimum = 1000000;
$maximum = -1000000;

foreach ( array_keys($words_array) as $word )
{
if ( $words_array[$word] > $maximum )
{
$maximum = $words_array[$word];
}

if ( $words_array[$word] < $minimum )
{
$minimum = $words_array[$word];
}
}

// ratio
$ratio = $portal_config['portal_wordgraph_ratio'] / ( $maximum - $minimum +1);

$words = array_keys($words_array);
sort($words);

foreach ( $words as $word )
{
$template->assign_block_vars('wordgraph', array(
'WORD' => ($portal_config['portal_wordgraph_word_counts']) ? $word . '(' . $words_array[$word] . ')' : $word,
'WORD_FONT_SIZE' => (int) ( 9 + ( $words_array[$word] * $ratio ) ),
'WORD_SEARCH_URL' => append_sid("{$phpbb_root_path}search.$phpEx", 'keywords=' . urlencode($word)),
));
}

$template->assign_vars(array(
'S_DISPLAY_WORDGRAPH' => true,
'L_WORDGRAPH' => $user->lang['WORDGRAPH'],
)
);

?>



Regards
fujcube

Re: Word Graph - Size of words!!!

Posted: 22. November 2009 20:58
by Foxy
Anyone got any ideas as I am all out!!!

Regards

Foxy