[BETA] FIND - Forum Integrated News Delivery - Input

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.
Locked
beardeddone
Registered User
Posts: 192
Joined: Thu Jan 16, 2003 1:47 am

Post by beardeddone »

netclectic wrote: The erros is caused by a missing parameter...

Code: Select all

function add_search_words($post_id, $post_text, $post_title = '') 
Was this a clean install of 2.0.4 or did you upgrade it?


to get rid of the error, try this...
in mods/netclectic/includes/functions_insert_post.php
find

Code: Select all

add_search_words('', $post_id, stripslashes($message), stripslashes($subject));
replace with

Code: Select all

add_search_words($post_id, stripslashes($message), stripslashes($subject));


I upgraded from 2.0.3 to 2.0.4

By golly that did it, no errors

Information

Completed: successfully:
http://www.4-anti-spam.org/backend.php



Completed: with problems:
None


Powered by phpBB 2.0.4 © 2001 phpBB Group

Thank You very much.
Best Regards
Skyport Forums   &#8226 Suzuki LC 1500 Parts & Accessories Links   &#8226  SexTalk &#8226 Music

User avatar
Haywood Jahelpme
Registered User
Posts: 475
Joined: Wed Oct 23, 2002 9:16 am
Location: San Diego
Contact:

Post by Haywood Jahelpme »

First I wanna say, that this mod was easy to install, and I am very excited about getting it working.

I was getting the first error in /functions_insert_post.php but the fix you mentioned made that go away, but now I have

Code: Select all

Could not insert new word matches

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Jun 10 2003 11:43PM ET... [url=http://c.moreover.com/click/her

INSERT INTO phpbb_search_wordmatch (post_id, word_id, title_match) SELECT Scotsman Online Jun 10 2003 11:43PM ET... [url=http://c.moreover.com/click/here.pl?r75310721]Read more...[/url], word_id, 0 FROM phpbb_search_wordlist WHERE word_text IN ('crops', 'worth', 'gbp50m', 'year')

Line : 242
File : /home/activist/public_html/wwwboard/includes/functions_search.php
I am using an upgraded 2.04, and this is my functions add_search_words();

Code: Select all

function add_search_words($mode, $post_id, $post_text, $post_title = '')
{
	global $db, $phpbb_root_path, $board_config, $lang;

	$stopword_array = @file($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . "/search_stopwords.txt"); 
	$synonym_array = @file($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . "/search_synonyms.txt"); 

	$search_raw_words = array();
	$search_raw_words['text'] = split_words(clean_words('post', $post_text, $stopword_array, $synonym_array));
	$search_raw_words['title'] = split_words(clean_words('post', $post_title, $stopword_array, $synonym_array));

	$word = array();
	$word_insert_sql = array();
	while ( list($word_in, $search_matches) = @each($search_raw_words) )
	{
		$word_insert_sql[$word_in] = '';
		if ( !empty($search_matches) )
		{
			for ($i = 0; $i < count($search_matches); $i++)
			{ 
				$search_matches[$i] = trim($search_matches[$i]);

				if( $search_matches[$i] != '' ) 
				{
					$word[] = $search_matches[$i];
					if ( !strstr($word_insert_sql[$word_in], "'" . $search_matches[$i] . "'") )
					{
						$word_insert_sql[$word_in] .= ( $word_insert_sql[$word_in] != "" ) ? ", '" . $search_matches[$i] . "'" : "'" . $search_matches[$i] . "'";
					}
				} 
			}
		}
	}

	if ( count($word) )
	{
		sort($word);

		$prev_word = '';
		$word_text_sql = '';
		$temp_word = array();
		for($i = 0; $i < count($word); $i++)
		{
			if ( $word[$i] != $prev_word )
			{
				$temp_word[] = $word[$i];
				$word_text_sql .= ( ( $word_text_sql != '' ) ? ', ' : '' ) . "'" . $word[$i] . "'";
			}
			$prev_word = $word[$i];
		}
		$word = $temp_word;

		$check_words = array();
		switch( SQL_LAYER )
		{
			case 'postgresql':
			case 'msaccess':
			case 'mssql-odbc':
			case 'oracle':
			case 'db2':
				$sql = "SELECT word_id, word_text     
					FROM " . SEARCH_WORD_TABLE . " 
					WHERE word_text IN ($word_text_sql)";
				if ( !($result = $db->sql_query($sql)) )
				{
					message_die(GENERAL_ERROR, 'Could not select words', '', __LINE__, __FILE__, $sql);
				}

				while ( $row = $db->sql_fetchrow($result) )
				{
					$check_words[$row['word_text']] = $row['word_id'];
				}
				break;
		}

		$value_sql = '';
		$match_word = array();
		for ($i = 0; $i < count($word); $i++)
		{ 
			$new_match = true;
			if ( isset($check_words[$word[$i]]) )
			{
				$new_match = false;
			}

			if ( $new_match )
			{
				switch( SQL_LAYER )
				{
					case 'mysql':
					case 'mysql4':
						$value_sql .= ( ( $value_sql != '' ) ? ', ' : '' ) . '(\'' . $word[$i] . '\', 0)';
						break;
					case 'mssql':
						$value_sql .= ( ( $value_sql != '' ) ? ' UNION ALL ' : '' ) . "SELECT '" . $word[$i] . "', 0";
						break;
					default:
						$sql = "INSERT INTO " . SEARCH_WORD_TABLE . " (word_text, word_common) 
							VALUES ('" . $word[$i] . "', 0)"; 
						if( !$db->sql_query($sql) )
						{
							message_die(GENERAL_ERROR, 'Could not insert new word', '', __LINE__, __FILE__, $sql);
						}
						break;
				}
			}
		}

		if ( $value_sql != '' )
		{
			switch ( SQL_LAYER )
			{
				case 'mysql':
				case 'mysql4':
					$sql = "INSERT IGNORE INTO " . SEARCH_WORD_TABLE . " (word_text, word_common) 
						VALUES $value_sql"; 
					break;
				case 'mssql':
					$sql = "INSERT INTO " . SEARCH_WORD_TABLE . " (word_text, word_common) 
						$value_sql"; 
					break;
			}

			if ( !$db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Could not insert new word', '', __LINE__, __FILE__, $sql);
			}
		}
	}

	while( list($word_in, $match_sql) = @each($word_insert_sql) )
	{
		$title_match = ( $word_in == 'title' ) ? 1 : 0;

		if ( $match_sql != '' )
		{
			$sql = "INSERT INTO " . SEARCH_MATCH_TABLE . " (post_id, word_id, title_match) 
				SELECT $post_id, word_id, $title_match  
					FROM " . SEARCH_WORD_TABLE . " 
					WHERE word_text IN ($match_sql)"; 
			if ( !$db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Could not insert new word matches', '', __LINE__, __FILE__, $sql);
			}
		}
	}

	if ($mode == 'single')
	{
		remove_common('single', 0.4, $word);
	}

	return;
}
And yes, it appears to be working (doing something), but just hitting a wall for some reason and crasing.

Very cool mod tho. My moderators are very anxious to get this going... Thanks!

netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic »

Haywood Jahelpme wrote: I was getting the first error in /functions_insert_post.php but the fix you mentioned made that go away

which fix? what did you change?
Haywood Jahelpme wrote:

Code: Select all

Could not insert new word matches

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Jun 10 2003 11:43PM ET... [url=http://c.moreover.com/click/her

INSERT INTO phpbb_search_wordmatch (post_id, word_id, title_match) SELECT Scotsman Online Jun 10 2003 11:43PM ET... [url=http://c.moreover.com/click/here.pl?r75310721]Read more...[/url], word_id, 0 FROM phpbb_search_wordlist WHERE word_text IN ('crops', 'worth', 'gbp50m', 'year')

Line : 242
File : /home/activist/public_html/wwwboard/includes/functions_search.php

If the "fix" you're talking about is the one mentioned above (changing the call to add_search_words) then i think that's the problem. What actual error were you getting before?
Defend the game:
Image

User avatar
Haywood Jahelpme
Registered User
Posts: 475
Joined: Wed Oct 23, 2002 9:16 am
Location: San Diego
Contact:

Post by Haywood Jahelpme »

I saw this post earlier in the thread (page 15) and thought I would give it a whirl since the error code and problem were the same as mine, and you commented that you knew about this issue:
netclectic wrote:
Dreamgamer wrote: Full Body Of Page after I clicked "Get News Now!"

Code: Select all

General Error 
Error in posting 

DEBUG MODE 

SQL Error : 1054 Unknown column 'username' in 'field list' 

INSERT INTO phpbb_posts (topic_id, forum_id, poster_id, username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES (1084, 324, 2, '', 1052176844, '', 1, 1, 1, 1) 

Line : 113 
File : /home/dreamgam/public_html/board/mods/netclectic/includes/functions_insert_post.php 
I'm gonna check the file here real quick but i think it could be that i'm using 2.0.2...


Ah, ok. I know about this. I've been too slow updating the files, try this...

in mods/netclectic/includes/functions_insert_post.php
find

Code: Select all

    switch ($board_config['version']) 
    { 
        case '.0.0' : 
        case '.0.1' : 
        case '.0.2' : 
        case '.0.3' : 
            Define('POSTS_USERNAME', 'username'); 
            Define('POSTS_TEXT_SUBJECT', 'subject'); 
            break; 
        
        default : 
            Define('POSTS_USERNAME', 'post_username'); 
            Define('POSTS_TEXT_SUBJECT', 'post_subject'); 
            break; 
    } 
 
replace with

Code: Select all

 

            Define('POSTS_USERNAME', 'post_username'); 
            Define('POSTS_TEXT_SUBJECT', 'post_subject'); 
 

So I felt confident making the change. Maybe too confident... :)

netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic »

Ah ok, that change is ok. You'll need to also change this...

Code: Select all

    switch ($board_config['version'])
    {
        case '.0.0' : 
        case '.0.1' : 
        case '.0.2' : 
        case '.0.3' : 
            add_search_words($post_id, stripslashes($message), stripslashes($subject));
            break;
        
        default :
            add_search_words('', $post_id, stripslashes($message), stripslashes($subject));
            break;
    }
replace with

Code: Select all

            add_search_words('', $post_id, stripslashes($message), stripslashes($subject));

or an easier way for you to have avoided both issues would have been to update the version number in the phpbb_config table of your database to .0.4 ;)
Defend the game:
Image

johnjasonm
Registered User
Posts: 6
Joined: Tue Apr 29, 2003 11:48 pm
Contact:

parsing problem?

Post by johnjasonm »

Is there anyway to get <http://www.newshax.com/backend.php> without messed up symbols/text...?

Works fine except for parsing:
"


Comes out as "&-quot-;" ("-" is for demonstation only) and the ' comes out as captial A's...

Is there a workaround

User avatar
Haywood Jahelpme
Registered User
Posts: 475
Joined: Wed Oct 23, 2002 9:16 am
Location: San Diego
Contact:

Post by Haywood Jahelpme »

WOO HOO!!!!!! THANK YOU!!!!

Sorry for screaming, but I am very happy...

User avatar
Haywood Jahelpme
Registered User
Posts: 475
Joined: Wed Oct 23, 2002 9:16 am
Location: San Diego
Contact:

Post by Haywood Jahelpme »

netclectic wrote: or an easier way for you to have avoided both issues would have been to update the version number in the phpbb_config table of your database to .0.4 ;)


Shouldn't that have happened when I upgraded to 2.0.4?

netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic »

Haywood Jahelpme wrote:
netclectic wrote:or an easier way for you to have avoided both issues would have been to update the version number in the phpbb_config table of your database to .0.4 ;)


Shouldn't that have happened when I upgraded to 2.0.4?

If you ran the update script that made changes to the database, then yes.
Defend the game:
Image

netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Re: parsing problem?

Post by netclectic »

johnjasonm wrote: Is there anyway to get <http://www.newshax.com/backend.php> without messed up symbols/text...?

Works fine except for parsing:
"


Comes out as "&-quot-;" ("-" is for demonstation only) and the ' comes out as captial A's...

Is there a workaround

There is a definite issue with " which i'm going to be looking at shortly. But the url, it looks as though the other issue is with the xml rather than the mod. If you lool at the xml (using IE) you'll see

- Hillary Clinton&#146;s &#147;Living His Story&#148; -
the apostrophe characters are not apostophes ('), i've seen this before when using curly quotes in word and then cut and pasting into a web page. In typical M$ style, Word uses some strange ascii character > 128 which most browsers wont display and don't know what to do with.

I don't know an easy way around this, other than not using those characters. I'll see what i can come up with.
Defend the game:
Image

jackofall
Registered User
Posts: 34
Joined: Wed Jun 11, 2003 8:05 pm
Contact:

Post by jackofall »

hi I get this error when pressing get news now

Code: Select all

Error in posting

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax near ')' at line 1

INSERT INTO phpbb_posts (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES (500, 26, 377, 'eMuLebOt', 1056127768, '50c23c80', 1, 0, 1, )

Line : 120
File : \\nas02\domains\e\ed2k-it.com\user\htdocs\forum\mods\netclectic\includes\functions_insert_post.php
thanks for any help
Image

netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic »

Strange, i can't see why you'd get an error there. Does the user you're using have a signature? Is it set to be enabled or disabled in the user profile?

Try this...

in mods/netclectic/includes/functions_insert_post.php
find (there's more than one, you only need to change the first one, but it wont hurt to change them all).

Code: Select all

$user_attach_sig, 
replace with

Code: Select all

$user_attach_sig = 0, 


[edit] scrap that -
netclectic wrote:
Have you selected any newsfeeds?
Defend the game:
Image

jackofall
Registered User
Posts: 34
Joined: Wed Jun 11, 2003 8:05 pm
Contact:

Post by jackofall »

netclectic wrote: Have you selected any newsfeeds?


yes for some reason now i get

Code: Select all

Completed: successfully:
http://p.moreover.com/cgi-local/page?c=Computer%20services%20news&o=xml
http://slashdot.org/features.rss



Completed: with problems:
None
but no posts are made :?

the feeds are working as well

http://slashdot.org/features.rss

http://p.moreover.com/cgi-local/page?c= ... news&o=xml
Image

netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic »

You'll need to change the second one to output as rss...

http://p.moreover.com/cgi-local/page?c= ... news&o=rss
netclectic wrote: I'll try them out and see what happens.

Ok they both seem to work fine.

Do you know what version of php you are using and whether or not it's running in safe mode?
Defend the game:
Image

jackofall
Registered User
Posts: 34
Joined: Wed Jun 11, 2003 8:05 pm
Contact:

Post by jackofall »

PHP Version 4.3.1

safe_mode Off Off

from phpinfo()

oh btw im getting the sql errors again :?
Image

Locked

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