Page 33 of 41

Re: [DEV] Smixmods Feed News Center v0.4.0

Posted: Thu Mar 28, 2013 7:45 am
by wintstar
Sorry I can not help you there. There must help you Smix. Works for me the Mod, look here http://formel1.wintstar.de/viewforum.php?f=3

My setting:
http://i47.tinypic.com/jb4u42.jpg

Re: [DEV] Smixmods Feed News Center v0.4.0

Posted: Thu Mar 28, 2013 8:09 am
by camaro92
1 question and a bug found :-)

1. How do you stop specific repeating msgs being posted? I run a Camaro site and can only find topics tagged "Chevrolet" and not "Camaro" so I get MOST Camaro but some other chevrolet news. If I delete the article, it seems to re-post it the next time it checks. ?

2. BUG - Appears there is a bug in that POSTS are not recorded into the poster (ie. NewBot posting the articles). Shows "0" posts

Re: [DEV] Smixmods Feed News Center v0.4.0

Posted: Thu Mar 28, 2013 8:21 am
by wintstar
1. I do not know
2. Right. I still have not noticed

Re: [DEV] Smixmods Feed News Center v0.4.0

Posted: Thu Mar 28, 2013 8:30 am
by Smix
Hello,
@winstar : thank you for your help ;-)

@camaro92 : At first, BIG THANKS for the donation :!: I really appreciate it ;-)
  • Yes, one hour is the minimal time, because there were some problems when the feed was initiated sooner than that (with index init and many feeds, it was slowing the board ;-) )
  • There is no need to upgrade to 0.4.0c if anybody has a 0.4.0, because there are no new features in 0.4.0c - it's still the v0.4.0, with only a minimal changes in code (it tries to fix the upgrade problems and adds a missing string in ACP "ACP_SFNC_AVAILABLE_ATTRIBUTES") - you can see what has changed on the commits page for sfnc project @¬†github
  • Well, yes I see the problem - the template is too long - 255 characters is a maximum now. At this moment, please try to make the template shorter and I'll try to fix this during the weekend ;-)
  • You can't stop the posting of a message, that you've removed, it always checks for a new content and than it's posted.
  • It's not a bug, but it's about permission settings in the forum
    Update : Users and groups -> Group forum permissions -> select group -> select forum -> Misc tab -> Increment post counter ... or a similar way with User forum permissions -> select user -> select forum -> Misc tab -> Increment post counter ;)
And once again, thanks for the donation ;)

Re: [DEV] Smixmods Feed News Center v0.4.0

Posted: Fri Mar 29, 2013 11:12 am
by camaro92
Could someone please explain the difference between:

RSS
ATOM
RDF

There are websites posting links like:
http://jalopnik.com/the-camaro-z-28-is-back-461112191

That doesnt appear to be a RSS feed so I am not sure how to set up a feed like how the other sites are doing.

Also what is the UTF-8? and how do I know what a feed is?

Re: [DEV] Smixmods Feed News Center v0.4.0

Posted: Fri Mar 29, 2013 11:38 am
by Smix
Hello,
the difference is in the structure of the feeds and available data ;-)
http://en.wikipedia.org/wiki/Atom_%28st ... to_RSS_2.0
It's possible to add it only if the source is generating a feed (ATOM/RSS/RDF), it's not possible to add any page on the web.
Well, to answer your question about that, if it's UTF-8 encoding or not ... Easy way - if you don't know, don't fill anything ... If the post looks well, than you don't need to think about the encoding ;-) And that's very likely, because according to Wiki, UTF-8 is used on more than half of websites. ... If it's not showing correctly, you have to know what's "default" encoding families for your country and try them ... For example, you can try to load the feed in your browser - I'm using Firefox - in "View" menu, there is an "encoding" and you can try to select a different encoding and if it views correctly, you've found your encoding ;-)

Re: [DEV] Smixmods Feed News Center v0.4.0

Posted: Mon Apr 01, 2013 5:18 pm
by camaro92
Will you be making it so you can block a post and have it not post that same one again? If not, then there is no way I can use this program :-(

They don't seem to have RSS feeds anywhere that is CAMARO specific and so I can only find chevrolet which means feeds are posted for all chevy cars. And what should be easy to fix, I just delete the non-related posts, the next time a feed is checked it's re-posted again..

The one in Vbulletin must have this feature because I see websites of the same topic having only this topic and not unrelated even tho we have the same feed set up.

Re: [DEV] Smixmods Feed News Center v0.4.0

Posted: Mon Apr 01, 2013 6:07 pm
by FoulFoot
Smix wrote:
  • You can't stop the posting of a message, that you've removed, it always checks for a new content and than it's posted.
Here's a suggestion on how you might want to handle this, as well as the ignoring of news items with duplicate titles (but different text):

OPEN includes/mods/sfnc/sfnc_class.php

FIND

Code: Select all

			$sql = 'SELECT topic_title
					FROM ' . TOPICS_TABLE . '
					WHERE topic_title = "' . $db->sql_escape($subject) . '"
						AND topic_poster = ' . (int) $this->poster_id;

			$result = $db->sql_query($sql);
			$row = $db->sql_fetchrow($result);
			$db->sql_freeresult($result);

			// Do we have a new item to post ?
			if (strnatcasecmp($row['topic_title'], $subject))
            {
REPLACE WITH

Code: Select all

			$sql_ary = array(
				'SELECT'	=> 't.topic_first_post_id, p.post_id, p.post_text',
				'FROM'		=> array(
					POSTS_TABLE => 'p', 
					TOPICS_TABLE => 't'
					),
				'WHERE'     => 't.topic_title = ' . $db->sql_escape($subject) . ' AND t.topic_poster = ' . (int) $this->poster_id' AND t.topic_first_post_id = p.post_id',				
			);
			$sql	= $db->sql_build_query('SELECT', $sql_ary);
			$result	= $db->sql_query($sql);
			$row	= $db->sql_fetchrow($result);
			$db->sql_freeresult($result);
			
			// Message content the same?  Do not re-post
			if (!strnatcasecmp($row['post_text'], $message))
			{	
  		              goto exitwithoutpost;
			}			

			// Message just has word "removed"?  Do not re-post			
			while( $aRow= $db-> sql_fetchrow( $result ) )
			{
				if( stripos( $aRow['post_text'], 'removed' ) !== false )
				{							
					goto exitwithoutpost;
				}	
			}
			
			$db-> sql_freeresult( $result );
FIND

Code: Select all

			}
			// change $i to the next (ehm previous :D ) item
			$i--;
			$j++;
		}
REPLACE WITH

Code: Select all

			// change $i to the next (ehm previous :D ) item
			$i--;
			$j++;
		}
	exitwithoutpost:
I haven't tried this out to see if it works, and I'm sure I have a syntax error or three in there. But basically, it compares the text of the posts to see if they're the same, as some news posts may have matching titles but different content. Next, it checks to see if the message text equals the word "removed". When you get a news post you don't want, edit the message, replace the message with the word "removed" (don't touch the subject), and it will be skipped when the script next cycles.

It's not particularly clean -- you've still got a topic subject with something you don't want -- but I'm not sure how else to match it.

Foul

Re: [DEV] Smixmods Feed News Center v0.4.0

Posted: Mon Apr 01, 2013 6:23 pm
by Smix
Hello,
@camaro92: the only possibility for you, will be the ACP manual posting which will be introduced in future versions (not in 0.4.x - it's introducing the templating release), but future roadmap is actually a bit uncertain as I'd like to rework the core next.

@FoulFoot : thanks for idea, I'll test it ;-)

Re: [DEV] Smixmods Feed News Center v0.4.0

Posted: Tue Apr 02, 2013 10:03 am
by Shakensoul
When running the contrib/install.php, error is received as below and unable to complete installation.
[phpBB Debug] PHP Notice: in file /includes/db/mysql.php on line 188: strpos() expects parameter 1 to be string, array given

Warning: Cannot modify header information - headers already sent by (output started at /home/www/public_html/forum/includes/functions.php:3780) in /home/www/public_html/forum/includes/functions.php on line 2678
Return to the index page
General Error
ERROR during SQL query : Array
Using phpBB 3.0.8
PHP version 5.3.19
MySQL version 5.1.66-cll

Re: [DEV] Smixmods Feed News Center v0.4.0

Posted: Tue Apr 02, 2013 11:15 am
by Smix
Hello,
as I think, you are upgrading from previous version of this mod, is it true? Hopefully fixed now - please try the fixed version :arrow: https://github.com/jirismika/SFNC/archive/master.zip and report how it works ;-) Thank you

Re: [DEV] Smixmods Feed News Center v0.4.0

Posted: Tue Apr 02, 2013 12:08 pm
by Shakensoul
Thanks for replying. Yes, previously I had installed version sfnc_0.3.4, but never got it to work.

Before install the latest version, I removed the previous edits and files. Also deleted the ACP module and 'phpbb_smixmods_feed_news_center' table from phpmyadmin.

Now using the master file, I get this error
General Error
SQL ERROR [ mysql4 ]

Can't find file: './xxx_phpbb/phpbb_smixmods_feed_news_center.frm' (errno: 2) [1017]

SQL

RENAME TABLE phpbb_smixmods_feed_news_center TO phpbb_sfnc_feeds

BACKTRACE

FILE: includes/db/mysql.php
LINE: 175
CALL: dbal->sql_error()

FILE: contrib/install.php
LINE: 137
CALL: dbal_mysql->sql_query()
Please help :(

Re: [DEV] Smixmods Feed News Center v0.4.0

Posted: Tue Apr 02, 2013 12:16 pm
by Shakensoul
Update: I realised it was looking for the 'phpbb_smixmods_feed_news_center' to install the update. Fortunately I had exported the table before deleting. I imported the table and ran the install script, it went fine.

Will go ahead with the rest of the configuration and report if any issues are encountered. :oops:

Re: [DEV] Smixmods Feed News Center v0.4.0

Posted: Tue Apr 02, 2013 5:47 pm
by Shakensoul
Everything seems to be working now. Thanks for the great mod :)

Is it possible to truncate the title after xx characters with trailing dots ...

something similar to this https://www.phpbb.com/customise/db/mod/ ... 14#p189414

Re: [DEV] Smixmods Feed News Center v0.4.0

Posted: Wed Apr 03, 2013 6:06 am
by camaro92
Did the edit to fix the duplicating posts work?