Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Letting users see topics, but not discussion
Hi,
Is there a way for the admin to allow users to view the topic titles on the front page, but when they click to view the actual thread it asks them to register?
0
This discussion has been closed.
Comments
if ($Context->SelfUrl == 'account.php' && $Context->Session->UserID == 0) {
intoif ($Context->SelfUrl == 'comments.php' && $Context->Session->UserID == 0) {
should do it. You might want to change the name in the file as well so it doesn't think it's the same as the real Private Accounts extension.Then save it, uploading it to your extensions directory, and activate it, and you're done.
I changed the name to TopicsOnly.
Now I wish there was a way to mark extensions [not for release] to exempt them from the update checker?
Posted: Wednesday, 28 March 2007 at 4:45PM
I have done as you have suggested and its working fine
But i want to redirect guest to a page with the note that he has to register first blah blah...
For that i have made a page guests.php and placed it in vanilla root directory
and edited the extension default file with:
if ($Context->SelfUrl == 'comments.php' && $Context->Session->UserID == 0) {
header('location:'.GetUrl($Configuration, 'guests.php'));
die();
}
BUT its again redirecting to index page instead to guests.php page I have also tried reintalling extension but vain
Can you help me in this please?
Thanks a lot for your help
I just tested on my local server, and it worked just fine (even tried copying your code exactly as you've posted, and it works just fine). Okay, so it goes to
guests.php#Item_0
rather than justguests.php
, but that's just cosmetic.Edit: Just another note, I thought of that you might want to block search.php as well, because searching shows bits of comments (and if you're going to block guests from comments they really have no use for searching anyway). So that first line should be
if (($Context->SelfUrl == 'comments.php' || $Context->SelfUrl == 'search.php') && $Context->Session->UserID == 0) {
but still it redirect to www.site.com/community/#Item_0
I have also added rewrite rule in .htaccess file as i am using friendly url mod:
RewriteRule ^guests/$ guests.php [QSA,L]
Still not working ;((
Thanks for trying bjrn :-)