Support Forum » Your Members Support » Your Members General Support

Private tags, one member type and RSS feeds working happily together!

(6 posts)
  1. ianamy
    Member

    All you really smart guys, I need to make this one last step work!!! I'll buy you a beer if you are ever in New Bedford, MA, USA.

    Here is the deal, I have an RSS aggregator bringing in new posts every hour. It's setup to place the <private> tags in the right pspot on every post it brings in... so each hour new posts are being added that have a private section to them (which it is doing correctly).

    I have one member type that I want to have access to every post that is currently on the site and every post that comes in (from the rss feed), still with me? Good.

    I must have some setting checked (or something) because when new posts are brought in from the RSS feed members get the "you do not have access to this" message.

    To fix this I have to go to "Other Settings > Setup", select "Member" and then check ALL posts, save it out and all members have access to all posts - UNTIL the next hour.... aaahhhhhhh!

    Can someone tell me what options to select or change in order to allow all members (there is only one account type) to have access to the private parts of every post that comes in WITHOUT me having to stay up 24 hours a day and check the boxes every hour.

    (I know, I know I said "access to private parts", we can laugh after this problem gets fixed, ok? good.)

    Posted 1 year ago #
  2. Sean
    Technical Monkey

    Hi there,

    If you can please give me some more info about your aggregator and how you are getting it to add private tags.

    I just emailed you a fixed setup script but I may be able to update your aggregator so it adds the correct user type to it.

    Either post here or just drop me an email with how you are inserting the rss news into your blog.

    thanks
    Sean

    Sean Barton (sean@newmedias.co.uk) - NewMedias.co.uk
    Posted 1 year ago #
  3. ianamy
    Member

    Hi Sean,

    I am using the SmartRSS aggregator for wordpress, in one of the files is the template it uses for linking back to the original story, here is the line:

    $incf++;

    $data=$db[$i]->description."\r\n\r\n

    "."
    <b>[private]Want this?</b> link."'> GET IT HERE [/private]";

    if($incf == 6){

    As you can tell I've added the private tags around the parts I want protected and it seems to work fine (when I view a post without being logged in the get it here part is hidden with the message I entered into YM.

    Any ideas?

    Posted 1 year ago #
  4. Sean
    Technical Monkey

    Hi,

    Sorry for the delay in posting, I had to eat soem lunch :)

    Right firstly your html is invalid above because assuming they don't have access then the <b> tag will never be closed as the code within the private tags will be replaced with the error string you chose in the YM settings pages.

    Secondly don't use <b>, use < strong > as it's not xhtml friendly (if you are bothered by that sort of thing) :)

    If the script has access to Wordpress functions then use the following line to set the access level of the new post to be 'Free'

    update_post_meta($id, '_ym_account_type', 'Free');

    You can add other account types to the string by simply adding a semicolon and the name as follows.

    update_post_meta($id, '_ym_account_type', 'Free;Member');

    They are case sensitive so make sure the capitalisation is the same as it is within YM.

    If the script can't use WP functions then use something like the following

    $sql = 'INSERT INTO ' . $table_prefix . 'wp_postmeta (post_id, meta_key, meta_value) VALUES (' . $id . ', &quot;_ym_account_type&quot;, &quot;Free&quot;)';
    mysql_query($sql) ;

    Either way these blocks of code must be placed past line 146 of the wp_smartrss.php file because we need the post id which is stored in the variable $id on line 145.

    let me know if you need any more help.

    thanks
    Sean

    ps: replace the spaces in < strong > with nothing. I couldn't on here as the forum uses it as a special character.
    pps: replace the ampersand followed by quot; with a double quote. Again the forum is misbehaving

    Sean Barton (sean@newmedias.co.uk) - NewMedias.co.uk
    Posted 1 year ago #
  5. ianamy
    Member

    Hey Sean,

    I tried to add your code, but I don't think I added it in the right spot. I've emailed you the file, can you check it out? Let me know! Thanks.

    Posted 1 year ago #
  6. Sean
    Technical Monkey

    Hi Ian,

    Please see your email for a fixed version of the code. Let me know either on here or via email how it goes.

    thanks
    Sean

    Sean Barton (sean@newmedias.co.uk) - NewMedias.co.uk
    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.