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?
I think the easiest way would be to download the Private Accounts extension, and modifying it. I think just opening up the default.php file and changing if ($Context->SelfUrl == 'account.php' && $Context->Session->UserID == 0) { into if ($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.
Wanderer... Havent looked into weither its only installed or activated extensions that are checked for updates, (EGAD--I still have to update to 1.1.2) but I think either storing the extension elsewhere or taking its include line out of conf/extensions.php and putting it somewhere else like conf/settings.php will work.
Does it really matter whether it does confuse the update checker or not? And in any case why not just upload this as an extension? It might be simple but if it does what a couple of people want it to do then I dont see a problem with that...
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 :(
That is really weird. Are you sure you're uploaded the edited file to the right place? And you're sure you don't have anything in your guests.php file that might redirect people to the index page?
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 just guests.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) {
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 just guests.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 :-)