Just wondering if I need to look for another way to protect certain content.

Comments

Chill35’s picture

I would like to know too. I tried to contact the maintainer but I got no response. Maybe my e-mail ended up in his/her spam folder.

peterx’s picture

StatusFileSize
new85 bytes

I am testing the 4.7 version under 5.0. I enclose a premium.info. Delete the .txt from the file name and use with 4.7 under 5.0.

peterx’s picture

StatusFileSize
new625 bytes

The .install file needs {} around the table name. I enclose the .install file with that change plus an uninstall function so you can experiment with activate module, deactivate module, uninstall, activate module...

peterx’s picture

StatusFileSize
new51 bytes

Premium needs CSS to highlight the premium message. Here is a CSS file.

peterx’s picture

StatusFileSize
new6.33 KB

Here is the module file for 5.0. Added CSS to message.
Removed help stuff that goes into .info.
Changed nodeapi view. It could be moved to nodeapi alter.
Changed settings to use system_settings_form($form) and put the settings function in the menu.
If you want more documentation of the changes then send an owl.

vm’s picture

These should really have been patches not .txt files.

vm’s picture

if you roll patches we can set the status as code to be reviewed so that a developer can role them into a release

see: http://drupal.org/node/60108

theorichel’s picture

I'd like to support that last remark/Please make these files available in a 5.1 package that we can actually use. I am sure you will do many people a favor. Thanks!

TR

Chill35’s picture

peterx, great work.

Any status on that update? Me has that opinion that premium should be given out by its current maintainer for adoption. I am willing to take over, and I am sure that a few other people are interested too. You, peterx, are interested.. ? There are a few good patches that haven't been applied, and now we should really get this to work for Drupal 5 officially. It really is a quite simple module. Unlike other access modules, premium shows you the teaser... nodes are not just invisible.

The following patch by Eaton should get applied too, after a little more testing, in both the 4.7 version and the 5 one : http://drupal.org/node/51483

Eaton's patch adds the following functionalities :

- several premium 'levels'
- a different "this is premium content' message for each level, customizable, with different input formats...

I also added an implementation of hook_file_download to block download of files attachments...

BarisW’s picture

Subscribing.. I really need this :p

polar-bear’s picture

Me too.

discursives’s picture

me three!

zostay’s picture

Very interested as well.

zostay’s picture

Status: Active » Needs review
StatusFileSize
new3.86 KB

Converted the files provided by peterx into a patch.

ray007’s picture

subscribing

neurojavi’s picture

subscribing

theorichel’s picture

Me too!!

designwork’s picture

Title: Will this module be updated for drupal 5.0? » testing the patch

Hi

I´m testing the patch with 5.1 but i can not find the way to mark node type as premium did i missed some thing?

Dirk

designwork’s picture

Hi

as i´m testing it for me the hook_form_alter() does not work. I have no choise to selcet if a content is premium or not?
Why? I think it´s because of the "case $type.'_node_settings':" it should be somthing like node_settings or system_node_settings.

Let´s see

Dirk

terrybritton’s picture

Dirk, Any luck on getting the premium setting to show up under default options on the adminster content types? Other than that the 5.X version appears to work for me (so far).

mosh’s picture

StatusFileSize
new5.07 KB

Thanks for your work so far :-)

I changed the patch to make hook_form_alter() work.
This patch is tested with the current DRUPAL-4-7 branch of the premium module.

The module seems to work for me now with a Drupal 5.1 install.

terrybritton’s picture

Mosh - Thanks for the patch. I tested it this morning and everything seems to work fine.

mrgoltra’s picture

subscribing

joewickert’s picture

Version: 4.7.x-1.x-dev » master
Category: feature » bug

Didn't work for me with existing premium content. The premium message appeared but so did all the content.

I've made a version of the module that does work for me(and blocks attachments too, which happened by accident but is what i wanted) happy to share it if anyone finds the same problem I did. I used:

$node->body = theme('premium_body', $node->body); to hide the content.

I'm not much of coder, so advice about how to make this useful is appreciated. Sorry if this is posted in the wrong place.

Jow

designwork’s picture

Hi drupallers,

I made a version of the Premium module that works for 5.1 with a link function that shows a member only link on all teasers of premium nodes and a function for restict acceess to attached files. How can i provide that patch/version for everybody?

Dirk

PS. I used the patch of this thread as base.

seakayjay’s picture

got patch for 5.1? sounds nice. that's what i'm waiting for. however, i don't know how to create patch. probably someone else can help. meanwhile i'll try look through the handbook http://drupal.org/patch if i can find out how.

designwork’s picture

Hi ckjian,

nice if you could help. I will ask to some core drupaler to see how it works. Maybe we find a way....

Dirk

designwork’s picture

StatusFileSize
new8.59 KB

Hi

as promised the changes to the premium.module.

Changes:
1. function premium_link and funktion theme_premium_links (line 209) for a "Members only" link on teasers, if the node is premium.
2. premium_file_download (line 241) for hidding the att. files of a premium node. But it just works when the file system is private !!!

if your filesystem is public try this dirty hack in the node.tpl.php

<?php global $user;
					if (!$node->premium || user_access('access premium content')){
						print theme_upload_attachments($files);
					}
					else{
						print '<span class="premium-message">your premium text</span>';
					}
					?>
pcdonohue’s picture

Title: testing the patch » Will this module be updated for drupal 5.0?

Hi all.

thanks for everyone's efforts on this, the premium module will be very useful to have ported to 5.x

DesignWork, I planned on using your provided module as a basis to generate a patch for Premium, but I don't understand what "premium_left" is in your code. Can you explain? You seemed to add a fair amount of code to support that.

I'm going to work on rolling a patch based on some of the patches provided in this thread, as well as including issues from http://drupal.org/node/69432 and http://drupal.org/node/117586

I've also been testing some code that lets you set the default for "Access restricted for non-premium users" for a content type like the other workflow options (Published, Promoted to the Front Page, etc.)

p.s. It's much easier to find and to follow an issue if the title of the issue isn't changed, so I'm switching the title back to its original title. This is confusing because with normal comments, supplying a title doesn't change the main node's title, but with issues in the project module it does!

pcdonohue’s picture

Oops,

that's what I get for just assuming the files at the end of the issue thread were the most relevant ones... I see the patch provided by zostay and peterx seem to do the trick, although I'm going to add in the issues from http://drupal.org/node/69432 and http://drupal.org/node/117586

The module maintainer does seem to be very active lately, posting some code to another project a little over a month ago, but no posts for quite some time. Any one looking to take this over?

designwork’s picture

Hi,

the module provided by me works the same way like that from peterrex. Exept i have a premium_link and a premium_download function in it. The premium left was something that I need for my custom temolate because it has two collums. Just delete it. Sorry i forgott this.

How to use premium. take the install and the info file provided by peterrex and my module. put it in a folder call it premium and copy the folder to your modules dir.. Than administer->modules activate it. After that please go to administer->settings->premium and fil in the text you want to show to non-premium users. You can style it via a css file called premium (put it in the module folder)

If you want a node to be premium go to the workflow section and mark The Access denied for non-premium user checkbox. Now every teaser of this node has Members Only instead of read more. Change it via Location module if you want its a t-string. All attachments to this file are restrict for download only for premium user. To mark a role to be premium just go to the usermanagemt section of your site.

Any more explanation just ask.

Dirk

dagomar’s picture

Oh no...

I don't seem to get this to work. I applied the patches, and everything seems to be in the right place. I even get some message in place from 'premium', but for the rest it does nothing. It just shows me the complete message, logged in or out. I tried using "

" but that doesn't help. I tried using it with the 'node teaser' module, but that doesn't help either; the full message is just shown. I think i must be doing something wrong (obviously), anyone have any suggestion? Thanks!

dagomar’s picture

" " = the break tag

allie micka’s picture

Version: master » 5.x-1.x-dev
Status: Needs review » Fixed

I have committed an updated version, and the snapshot release should be available within a day or so.

Big thanks to peterx, zostry, mosh, and everyone else who participated in this thread!

DesignWork: I appreciate your feature enhancements, but since development on 5.x is now open, I'm hoping you'll submit separate issues for these. For 5.x, I'm hoping to merge Eaton's changes with other feature requests.

designwork’s picture

Hi Allie Micka,

so how we should go on with the features I updated the module? I think at least the link funcion is good feature. The update_attachement function is not perfect because it depends the filesystem be private. May be we should just make it an option in the premium settings!

Let´s talk about.

Dirk

allie micka’s picture

Good stuff -

your features are welcome, but I wanted to keep them separate from the upgrade itself. It's always easier to discuss and implement one thing at a time.

Please open an additional issue (or several, if you have several feature requests/additions)

Thanks!

nath’s picture

Thanks for porting this to 5.x. It is a key feature on our site.

Anonymous’s picture

Status: Fixed » Closed (fixed)
Chill35’s picture

Status: Closed (fixed) » Active

May we have a release version ?

allie micka’s picture

Sure, pending bug fixes such as:

http://drupal.org/node/281414
http://drupal.org/node/112127
http://drupal.org/node/281414

And possibly features such as:
http://drupal.org/node/117575

Testing and followup are most welcome for these issues.

Thanks!

Chill35’s picture

Issue marked twice -- and unable to replicate: http://drupal.org/node/281414

http://drupal.org/node/117575 -- a batch operation? Not exactly a killer feature, just a way to save time. One can use SQL to do the same.

allie micka’s picture

http://drupal.org/node/117575 -- a batch operation? Not exactly a killer feature, just a way to save time. One can use SQL to do the same.

Yes and no. When you update the settings/preferences on the admin screen, they don't have any effect on previously-created nodes. I would characterize this as a bug, and I have some usability concerns with popping up an error message that reads "Please learn SQL so that your site can function as expected".

If you'd like to work on / verify / help close the other issue (or any others), your help is appreciated.

Thanks!

jerdavis’s picture

Status: Active » Closed (fixed)

1.0 has been released - let us know if you still see issues! We'll work on getting a few other things in soon.

peterx’s picture

Thank you zostay for the conversion. I tried creating patches for another module and the software on my computer created patches incompatible with the format used for Drupal.

Thank you to everyone who contributed and started maintaining this module. I applied to formally upgrade another module but the Drupal overlords said I could only upgrade it if I would take on the long term maintenance. This is not possible. Many times I am just installing modules for sites that will be maintained by other people. I cannot maintain a module if it is not used on a site I administer every day.

There is a real problem that should be discussed in a separate post. We cannot tell if a module is actively maintained by people using the module on a site. Perhaps a module description could include a list of sites that use the module. Perhaps there could be demonstration sites for modules. Set up a VPS with Drupal 6 and call it 6.drupal.org. The premium module could then be in premium.6.drupal.org.

petermoulding.com/web_architect