|
Posted by Norman Peelman on 08/26/07 23:17
Matt wrote:
> On Aug 26, 10:23 pm, Sanders Kaufman <bu...@kaufman.net> wrote:
>
>> What - are we working on the same project? ;)
>>
>> The way I did this is to have the article displayed in TWO PHP pages,
>> loaded into the main page.
>>
>> The first page displays the teaser - title and description - to everyone.
>>
>> The second page checks the credentials before displaying the content.
>
> Hmm, this would work, but a) it complicates my code since I already
> have pagination going on (and comments, etc etc), and b) I'd rather
> non premium users didn't even know about the existence of the special
> articles. I think, anyway..
>
> But! You did give me an idea. I could just make a separate file for
> handling premium articles, and just send premium users to that page
> when they're browsing the article index. Simple!
>
But then how do the premium users read the non-premium articles? Of
course if you can answer that then you've solved your original problem.
Norm
p.s. You need to check your users permissions prior to retrieving your
articles. In other words, build your SELECT statement based on your
users permissions:
if ($user_is_premium)
{
SELECT both non-premium and premium articles here
}
else
{
SELECT non-premium articles here
}
....rest of code
should be a rather small change to your code.
[Back to original message]
|