Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

default category undefined?

codegruntcodegrunt New
edited December 2010 in Vanilla 2.0 - 2.8
Howdy. A quick peek at the code (after importing a test RSS feed) seems to suggest that there is currently no way to have auto-created discussions funnel into a specific category. Right now articles are getting placed into a category but it appears to have been chosen randomly. . .

Is fixing this as simple as adding a line like the following to the FeedDiscussionsPlugin::PollFeed method?

$DiscussionData[$DiscussionModel->CategoryID] = 123456;

If so, a suggestion would be to add an option to the admin interface to associate a feed with a specific category. I will likely do this myself anyway once I get up to speed with Vanilla's internals a bit more but thought I should mention it as it seems like a needed function.

Cheers

Comments

  • I was wondering this too. I wanted to pull specific posts from a category from my wordpress site into a related category on the forums.

    I was also wondering, the feeds seem to be posting a summary. I have my feeds set to display full text, it shows full text from feedburner, but only displays an excerpt in the forums when posted. I'd like to show the full post, is this possible?
  • The plugin stores the full contents of "description" if you look at line 229 of "plugins/FeedDiscussions/class.feeddiscussions.plugin.php":

    $StoryBody = (string)GetValue('description', $Item);

    The only change is that it wraps the contents in a DIV a bit further down. So there should be no truncation or anything like that happening as far as I can see. I would try viewing the source for your RSS feed and make sure the contents are what you think they are.

    Cheers
  • I'll second the need to categorize the feeds. This plugin is very thing I've been looking for - I'm not a coder, but if someone could get that feature working this would become a fantastic plugin!
  • Another feature that would be useful that I've seen on plugins for other forum software like this would be the ability to assign the new discussion posts to a particular user.

    When I ran the test feed on this, all the posts came up under my account. It makes it a little unclear to the reader where the information is coming from (plus it conflicts with interest in my own posts).

    I could create a new account (NicheBot, for example, or, in my case TeaBot) and assign the RSS Feed posts to that. Nice and clear for the users to look at and understand where the wealth of posts and information is coming from.
  • If you know the account ID, you can hardcode the user associated with all feeds by editing "plugins/FeedDiscussions/class.feeddiscussions.plugin.php". Right now the code just looks up the first admin status account ID returned by the MySQL query:

    $InsertUserID = $DiscussionModel->SQL->Select('UserID')->From('User')->Where('Admin',1)->Get()->FirstRow()->UserID;

    Cheers
  • MarkMark Vanilla Staff
    Be sure to mention the author of the plugin when commenting so they get notified about your questions. In this case, the author is @Tim :)
  • edited January 2011


    @codegrunt I'm not a coder but I'm not afraid to get my hands dirty. Can you give me a better idea about how to edit that line if, for example, the username was Bot and the account ID was 12?
  • @Tim is there anyway yet to specify what category we AutoFeed into?
  • @Tim Is it possible to add the ability to select the category and user either per feed or globally?
  • edited January 2011
    @Tim Is it possible to add the ability to select the category and user either per feed or globally?
    signed. Good addition!

    @leafboxtea: that would be simply
    $InsertUserID = '12';
  • I hate to resurrect dead discussions, but is there an easy way to edit FeedDiscussionPlugin so that the category in which discussions are placed would be pre-determined?
  • If you know the ID of the category, I believe you should be able to hardcode the ID around by adding the following around line 248 of "plugins/FeedDiscussions/class.feeddiscussions.plugin.php":

    $DiscussionData[$DiscussionModel->CategoryID] = 1234;

    where "1234" is the id of the category you want the articles to show up under.

    Cheers
  • If you know the ID of the category, I believe you should be able to hardcode the ID around by adding the following around line 248 of "plugins/FeedDiscussions/class.feeddiscussions.plugin.php":

    $DiscussionData[$DiscussionModel->CategoryID] = 1234;

    where "1234" is the id of the category you want the articles to show up under.

    Cheers
    Thanks. I gave that a shot earlier, but perhaps creating a new feed will correctly assign the discussions.
  • @Tim I cosign everything above:

    - I need to pick which categories + user the Feeds are posted.
    - I need the whole RSS post to be posted, not just an intro, as well as the pictures. My feed is set up to show the whole thing.
    - It'd be great to have the direct link to the original article posted too
  • If you know the ID of the category, I believe you should be able to hardcode the ID around by adding the following around line 248 of "plugins/FeedDiscussions/class.feeddiscussions.plugin.php":

    $DiscussionData[$DiscussionModel->CategoryID] = 1234;

    where "1234" is the id of the category you want the articles to show up under.

    Cheers
    That's didn't work for me. I did find the following change worked.

    Original last two lines in function PollFeed:

    $this->UpdateFeed($FeedURL, 'LastImport', date('Y-m-d H:i:s', time()));
    }
    Inserted lines:

    $this->UpdateFeed($FeedURL, 'LastImport', date('Y-m-d H:i:s', time()));
    $CatID = $DiscussionModel->SQL->Select('CategoryID')->From('Category')->Where('Name','Cat2')->Get()->FirstRow()->CategoryID;
    $DiscussionModel->SQL->Update('Discussion')->Set('CategoryID',$CatID)->Where('CategoryID <', 1)->Put();
    }
    Change Cat2 to the name of the category you want to insert the post into.
  • If you know the account ID, you can hardcode the user associated with all feeds by editing "plugins/FeedDiscussions/class.feeddiscussions.plugin.php". Right now the code just looks up the first admin status account ID returned by the MySQL query:

    $InsertUserID = $DiscussionModel->SQL->Select('UserID')->From('User')->Where('Admin',1)->Get()->FirstRow()->UserID;

    Cheers
    Replace the above line with this:

    $InsertUserID = $DiscussionModel->SQL->Select('UserID')->From('User')->Where('Name','PaulRevere')->Get()->FirstRow()->UserID;

    Where "PaulRevere" is the name of the userid you want to use for the insert.

  • Does the resulting topic display images included in the RSS feed, and in what manner (linked, inline, attached)?
  • Does the resulting topic display images included in the RSS feed, and in what manner (linked, inline, attached)?
    I believe it reads the description tag from the rss feed, which only has the short summary of the post.

    The rss does contain the entire post. When I was playing around with it, I tried switching it so it inserted the entire post into VF, but I didn't like the results, and didn't want to work on that area.

    In other words, if you want to hack the code it would be easy to do.

Sign In or Register to comment.