[BETA] phpBB Wordgraph MOD

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
pentapenguin
Former Team Member
Posts: 11030
Joined: Thu Jul 01, 2004 4:15 am
Location: GA, USA

Post by pentapenguin »

Hmm...maybe something like this?
Use phpBB search engine for links? Yes No
If you don't want to use phpBB's search, then enter a URL below:
__http://www.google.com/search?q=__
Support Resources: Support Request Template
If you need professional assistance with your board, please contact me for my reasonable rates.

dcz
Registered User
Posts: 787
Joined: Sun Feb 13, 2005 5:37 am
Contact:

Post by dcz »

pentapenguin wrote: Hmm...maybe something like this?
Use phpBB search engine for links? Yes No
If you don't want to use phpBB's search, then enter a URL below:
__http://www.google.com/search?q=__


Yep or a jumpbox with different search url such as :
http://www.google.fr/search?&q=site%3Aw ... om+keyword for a site search or like you said for a regular web search.

and yahoo and msn :

http://fr.search.yahoo.com/search?p=sit ... om+keyword

http://fr.search.yahoo.com/search?p=keyword

http://search.msn.fr/results.aspx?q=sit ... om+keyword

http://search.msn.fr/results.aspx?q=keyword

And why not a phpbb search as well (but I'd allow desactivation of this one , since bots could end up following all links arrasing the server)

But as I told you, as is your mod is great, and everybody can use the search engine he wants using the small tweak I posted, so it's all up to you. The mod is also great right now :)

I would have been happy to help on this one, but jumpbox is not like the thing I understand the most in phpbb (since I did not bother finding out more about them until now).

++

phpBB SEO || phpBB3 SEO Premod || SEO phpBB3
GYM Sitemaps & RSS for phpBB3: GYM Sitemaps & RSS

User avatar
pentapenguin
Former Team Member
Posts: 11030
Joined: Thu Jul 01, 2004 4:15 am
Location: GA, USA

Post by pentapenguin »

I think I'll include this in 0.2.0 Thanks for the idea! :)
Support Resources: Support Request Template
If you need professional assistance with your board, please contact me for my reasonable rates.

yofx
Registered User
Posts: 22
Joined: Thu Mar 09, 2006 5:55 am
Contact:

Post by yofx »

Awesome idea, great MOD. I've seen this in a few other places like flickr.

http://flickr.com/photos/tags/

But personally I sort of see a seperate wordgraph.php page worthless, any way to somehow include it so it shows up on the search.php?

dcz
Registered User
Posts: 787
Joined: Sun Feb 13, 2005 5:37 am
Contact:

Post by dcz »

pentapenguin wrote: I think I'll include this in 0.2.0 Thanks for the idea! :)


Your welcome, I am glad I could inspire you a bit :)

++

phpBB SEO || phpBB3 SEO Premod || SEO phpBB3
GYM Sitemaps & RSS for phpBB3: GYM Sitemaps & RSS

yofx
Registered User
Posts: 22
Joined: Thu Mar 09, 2006 5:55 am
Contact:

Post by yofx »

yofx wrote: Awesome idea, great MOD. I've seen this in a few other places like flickr.

http://flickr.com/photos/tags/

But personally I sort of see a seperate wordgraph.php page worthless, any way to somehow include it so it shows up on the search.php?


Would it be as easy as just moving the code from the wordgraph.php page into search.php? (Any other code changes needed)?

yofx
Registered User
Posts: 22
Joined: Thu Mar 09, 2006 5:55 am
Contact:

Post by yofx »

So could I just copy all of the code in wordgraph.php and put it in the search.php? Woud it be that easy?

Maybe change this line

Code: Select all

'PAGE_URL' => "wordgraph.$phpEx",
to something like

Code: Select all

'PAGE_URL' => "search.$phpEx",
????

yofx
Registered User
Posts: 22
Joined: Thu Mar 09, 2006 5:55 am
Contact:

Post by yofx »

I'm trying to install this MOD but I don't have this file.

Code: Select all

includes/mod_page_id.php

Peter77sx
Registered User
Posts: 3258
Joined: Wed Nov 09, 2005 2:51 pm

Post by Peter77sx »

yofx wrote: I'm trying to install this MOD but I don't have this file.

Code: Select all

includes/mod_page_id.php


You need the Page ID Extension MOD. http://www.phpbb.com/phpBB/viewtopic.php?t=154273

yofx
Registered User
Posts: 22
Joined: Thu Mar 09, 2006 5:55 am
Contact:

Post by yofx »

Thanks Peter77sx, that should be added to the first post.

yofx
Registered User
Posts: 22
Joined: Thu Mar 09, 2006 5:55 am
Contact:

Post by yofx »

Okay, I got the wordgraph to display on the search page, instead or addition to the seperate wordgraph.php page.

You only need to add two bits of code in two files.

OPEN search.php

FIND:

Code: Select all

'S_SORT_OPTIONS' => $s_sort_by,
	'S_HIDDEN_FIELDS' => '')
);
ADD AFTER:

Code: Select all

$words_array = array();

$sql = 'SELECT w.word_text, COUNT(*) AS word_count  
	FROM ' . SEARCH_WORD_TABLE . ' AS w, ' . SEARCH_MATCH_TABLE . ' AS m 
	WHERE m.word_id = w.word_id 
	GROUP BY m.word_id 
	ORDER BY word_count DESC LIMIT ' . intval($board_config['word_graph_max_words']);

if ( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, 'Could not obtain word list', '', __LINE__, __FILE__, $sql);
}

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

	$words_array[$word] = $word_count;

}

$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);

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

foreach ( $words as $word )
{
	$template->assign_block_vars('wordgraph_loop', array(
		'WORD' => ( $board_config['word_graph_word_counts'] ) ? $word . ' (' . $words_array[$word] . ')' : $word,
		'WORD_FONT_SIZE' => (int) ( 9 + ( $words_array[$word] * $ratio ) ),
		'WORD_SEARCH_URL' => append_sid("search.$phpEx?search_keywords=" . urlencode($word)),
	));
}
OPEN search_body.tpl

FIND:

Code: Select all

td class="row4" colspan="4" align="center" height="28">{S_HIDDEN_FIELDS}<input class="liteoption" type="submit" value="{L_SEARCH}" /></td>
	</tr>
</table>{TPL_FTR}
ADD AFTER:

Code: Select all

<br />
<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0">
	<tr>
		<th class="thHead" height="25" valign="middle"><span class="genmed"><font color="white">Most Popular Words</font></span></th>
	</tr>
	<tr>
		<td class="row1" align="center">
			<!-- BEGIN wordgraph_loop -->
			<span style="font-size: {wordgraph_loop.WORD_FONT_SIZE}"><a href="{wordgraph_loop.WORD_SEARCH_URL}">{wordgraph_loop.WORD}</a></span>
			<!-- END wordgraph_loop -->
			</td>
	</tr>
</table>

Again, this just puts the wordgraph at the bottom part of the search pages. Check out a screenshot from my site below.

Image

Or see it in live action below.
http://abstractinfluence.com/forums/search.php

Peter77sx
Registered User
Posts: 3258
Joined: Wed Nov 09, 2005 2:51 pm

Post by Peter77sx »

Hey that is pretty neat, thanks for sharing. 8)

cotp
Registered User
Posts: 445
Joined: Wed Sep 14, 2005 7:34 pm
Contact:

Post by cotp »

yofx wrote: Okay, I got the wordgraph to display on the search page, instead or addition to the seperate wordgraph.php page.

You only need to add two bits of code in two files.


And how can I display it on every topic page ? I wouuld appreciate your help because I tried to copy what you did on viewtopic and topic body template but the wordgraph displayed the bloc of words like 5 times 8O

Cotp

Daniela22
Registered User
Posts: 1
Joined: Sun Jul 02, 2006 12:48 pm

Post by Daniela22 »

Hello, is there any way to exclude the words from the "search_stopwords.txt"?

Sorry for my bad english :oops: :oops: :oops:

German:

Hier nochmal in deutsch:

Ich suche einen Weg um Wörter die sich in der "search_stopwords.txt" befinden auszublenden. Sie sollen also nicht im Wordgraph angezeigt werden. Ich hab schon im deutschen Support-Forum nachgefragt aber ich denke nicht das mir dort jemand helfen kann :)


Wäre echt toll wenn jemand ne Lösung parat hätte :) :) :)

Ciao Dani

cotp
Registered User
Posts: 445
Joined: Wed Sep 14, 2005 7:34 pm
Contact:

Post by cotp »

Daniela22 wrote: Hello, is there any way to exclude the words from the "search_stopwords.txt"?


They do not appear in mine...

Maybe because I use this mod, you can use it f you want:

Prune Search Tables (in French)

Still didn't find how to make it appear on every page...

Cotp

Post Reply

Return to “[2.0.x] MODs in Development”