[ABD] Smixmods Feed News Center v0.4.0

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
wintstar
Registered User
Posts: 330
Joined: Sat Mar 07, 2009 12:39 pm
Location: Central Hessen, close to the "heart of nature", Germany
Contact:

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

Post 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
camaro92
Registered User
Posts: 450
Joined: Sat Oct 05, 2002 10:55 pm
Contact:

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

Post 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
wintstar
Registered User
Posts: 330
Joined: Sat Mar 07, 2009 12:39 pm
Location: Central Hessen, close to the "heart of nature", Germany
Contact:

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

Post by wintstar »

1. I do not know
2. Right. I still have not noticed
User avatar
Smix
Registered User
Posts: 482
Joined: Mon Sep 11, 2006 1:07 am

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

Post 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 ;)
camaro92
Registered User
Posts: 450
Joined: Sat Oct 05, 2002 10:55 pm
Contact:

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

Post 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?
User avatar
Smix
Registered User
Posts: 482
Joined: Mon Sep 11, 2006 1:07 am

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

Post 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 ;-)
camaro92
Registered User
Posts: 450
Joined: Sat Oct 05, 2002 10:55 pm
Contact:

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

Post 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.
FoulFoot
Registered User
Posts: 262
Joined: Mon Jun 23, 2003 1:04 am
Location: Honolulu, HI
Contact:

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

Post 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
Last edited by FoulFoot on Wed Apr 03, 2013 1:41 pm, edited 2 times in total.
User avatar
Smix
Registered User
Posts: 482
Joined: Mon Sep 11, 2006 1:07 am

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

Post 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 ;-)
User avatar
Shakensoul
Registered User
Posts: 77
Joined: Fri Mar 20, 2009 9:37 am
Location: India
Contact:

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

Post 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
User avatar
Smix
Registered User
Posts: 482
Joined: Mon Sep 11, 2006 1:07 am

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

Post 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
User avatar
Shakensoul
Registered User
Posts: 77
Joined: Fri Mar 20, 2009 9:37 am
Location: India
Contact:

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

Post 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 :(
User avatar
Shakensoul
Registered User
Posts: 77
Joined: Fri Mar 20, 2009 9:37 am
Location: India
Contact:

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

Post 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:
User avatar
Shakensoul
Registered User
Posts: 77
Joined: Fri Mar 20, 2009 9:37 am
Location: India
Contact:

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

Post 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
camaro92
Registered User
Posts: 450
Joined: Sat Oct 05, 2002 10:55 pm
Contact:

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

Post by camaro92 »

Did the edit to fix the duplicating posts work?
Locked

Return to “[3.0.x] Abandoned MODs”