Page 3 of 3

Posted: Fri Jul 21, 2006 6:50 pm
by ToonArmy
pentapenguin, nice mod - I spotted a few places where you could optimise though :D Note: I have not tested these changes out so please ensure they are sane ;)

wordgraph.php

Find:

Code: Select all

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

	$words_array[$word] = $word_count;

}
Replace With:

Code: Select all

while ( $row = $db->sql_fetchrow($result) )
{
	/**
	 * No need to use strtolower() because words are stored
	 * in the lowercase form.
	 */
	$words_array[$row['word_text']] = $row['word_count'];
}
Find:

Code: Select all

$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 = 18.0 / ( $maximum - $minimum);
Replace With:

Code: Select all

$ratio = 18.0 / ( max($words_array) - min($words_array) );
Yes! One line ;)

Find:

Code: Select all

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

foreach ( $words as $word )
Replace With:

Code: Select all

ksort($words_array);

foreach ( $words_array as $word => $count )
Avoids creating another potentially huge array.

Find:

Code: Select all

'WORD' => ( $board_config['word_graph_word_counts'] ) ? $word . ' (' . $words_array[$word] . ')' : $word,
Inline Find:

Code: Select all

$words_array[$word]
Replace With:

Code: Select all

$count
Optional but why not ;)

Find:

Code: Select all

'WORD_FONT_SIZE' => (int) ( 9 + ( $words_array[$word] * $ratio ) ),
Inline Find:

Code: Select all

$words_array[$word]
Replace With:

Code: Select all

$count
Optional again but why not ;)

That is all.

Posted: Thu Sep 14, 2006 6:25 am
by pentapenguin
ToonArmy wrote: pentapenguin, nice mod - I spotted a few places where you could optimise though :D Note: I have not tested these changes out so please ensure they are sane ;)

Heh...it's 2am here so I can't verify those right now, but thanks a lot for the tips! I will certainly check to make sure they work, and if they do, I will be sure to give you credit. :)
daniela22 wrote: Hello, is there any way to exclude the words from the "search_stopwords.txt"?

To be honest, I have no idea if it this does or does not exclude those words. I will check on this though.
yofx wrote: Okay, I got the wordgraph to display on the search page, instead or addition to the seperate wordgraph.php page.

Good idea but I don't think I will probably make the main MOD that way since it would be a bit harder to install. However, I might include your idea as a "add-on" giving you credit. Good idea to put it on the search page. :)

Okay folks, other than the ideas above and making a admin control panel option to use the built-in forum search or an external search engine (e.g. Google, MSN, Yahoo, Ask, etc.), does anyone have any more ideas for this MOD? I hope to get it finished up soon and submitted to the MODDB. Thanks!!!! :D

Posted: Thu Sep 14, 2006 10:32 pm
by dcz
daniela22 wrote: Hello, is there any way to exclude the words from the "search_stopwords.txt"?

They are filtered if the search tables are up to date.
This mean updating your search_stopwords.txt will be of no effect if you don't take care of the previous entries.

To do this two solutions : http://www.phpbb.com/phpBB/viewtopic.php?t=329629

and http://www.phpbb.com/kb/article.php?article_id=30

The first one (rebuild search) is heavier to run but worth it IMHO.

++

Re: [BETA] phpBB Wordgraph MOD

Posted: Tue Mar 20, 2007 5:38 pm
by kulinar
I have a suggestion and a question.

1. Remove smilies words from wordlist otherwise you get this.

2. Why all my words are the same font size?

Re: [BETA] phpBB Wordgraph MOD

Posted: Tue Mar 20, 2007 7:55 pm
by pentapenguin
Thank you for the suggestion, kulinar. As for your problem, are you using the latest version?

Re: [BETA] phpBB Wordgraph MOD

Posted: Tue Mar 20, 2007 8:08 pm
by kulinar
I downloaded the file from sf.net (the link in first post). I guess version 0.1.0 :roll:

Re: [BETA] phpBB Wordgraph MOD

Posted: Tue Mar 20, 2007 8:49 pm
by pentapenguin
kulinar wrote: I downloaded the file from sf.net (the link in first post). I guess version 0.1.0 :roll:

Oh that is the latest version then from SourceForge. I'll look into your problem later. Please PM and remind me if I forget. :)

Re: [BETA] phpBB Wordgraph MOD

Posted: Tue Mar 20, 2007 9:10 pm
by kulinar
OK. I just wanted to let you know that I use extreme styles mod.

Re: [BETA] phpBB Wordgraph MOD

Posted: Wed Mar 21, 2007 8:44 am
by kulinar
Thanks to a guy from my country I resolved the problem. I use xhtml transitional instead of html 4.01 transitional. That why I had to do:

Code: Select all

OPEN
wordgraph_body.tpl

FIND
			<span style="font-size: {wordgraph_loop.WORD_FONT_SIZE}">

REPLACE WITH

			<span style="font-size: {wordgraph_loop.WORD_FONT_SIZE}pt">

Re: [BETA] phpBB Wordgraph MOD

Posted: Wed Mar 21, 2007 5:55 pm
by pentapenguin
No that's definitely a bug with this MOD. It should always have a unit (pt) with the size. Thanks for finding it!

Re: [BETA] phpBB Wordgraph MOD

Posted: Wed Mar 21, 2007 7:20 pm
by kulinar
You are welcome! As we speek about bugs: Install file should be changed as

Code: Select all

#
#-----[ FIND ]------------------------------------------
#
			$cookie_name = str_replace('.', '_', $new['cookie_name']);
		}

#
#-----[ REPLACE WITH ]------------------------------------------
#
			$new['cookie_name'] = str_replace('.', '_', $new['cookie_name']);
		}

Re: [BETA] phpBB Wordgraph MOD

Posted: Wed Mar 21, 2007 8:25 pm
by pentapenguin
Thank you again. I will try to get a new release out soon. :)

Re: [BETA] phpBB Wordgraph MOD

Posted: Mon Jun 04, 2007 12:34 pm
by likepassion
hi!

i've just installed correctly this mod (you can find it on : http://www.ballarelatino.com/wordgraph.php) but i've 2 questions :

1.is possible to filter the nick of the users and the smilies (the first 2 words are "lol" and "quot"...) ?
2.is possible to put them on the index body ?

Thanks a lot everybody!

Re: [BETA] phpBB Wordgraph MOD

Posted: Wed Nov 07, 2007 12:04 am
by cunyalen
Is this working for phpbb3?

Re: [BETA] phpBB Wordgraph MOD

Posted: Sun Dec 21, 2008 7:23 pm
by Lisbon
Theres a similar mod for phpbb3...????