Is this too broad a question? I don't have anything else to say except for asking the question!
Option 1
I mean changing the code and adding to it ...
Check if user is logged in and display the button (normally you wouldn't see it - correct). If a user is logged in they wouldn't see it. So you are not changing the original Start New discussion code - just merely adding the button if no one is logged in (guest status).
If not logged in display Start New discussion - that links to signin
essentially what you said you wanted.
If you are not up for programming a change.
Option 2
The alternative and second option
You could download the anonymouse plugin - it allows people to post if they are not members - they merely have to respond to a captcha code (personally I find it easier to log in), but some users don't want to be members and that gives them the option to post.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
Answers
guests are defined as users who can only view. Anyone who is not logged in is considered a guest. Try the anonymouse plugin if you want people to post messages without becoming members,
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
1 · Insightful 1Awesome LOL ·Thanks for your answer! I realize now that it was not clear what I was asking. I would actually like to show the button, but not allow the user to post. He or she would be brought to the sign in/ register page upon clicking the "Start a New Discussion" button.
My aim is to encourage participation in the forum this way.
- Spam
- Abuse
0 · Insightful Awesome LOL ·Best I can do for you...
You have to experiment....
apparently this is the code for the new discussion button:
echo Anchor(T('Start a New Discussion'), '/post/discussion'.(array_key_exists('CategoryID', $Data) ? '/'.$Data['CategoryID'] : ''), 'BigButton NewDiscussion');
this is the signin destination... http://localhost/vanilla/entry/signin?Target=discussions
perhaps if you merged them somewhere - you might get what you want.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
0 · Insightful Awesome LOL ·I think I understand you. If I understand correctly, your solution overlooks the fact that the button is not displayed for guests. Do you mean to use that anonymouse plugin to enable displaying of the "Start a New Discussion" button for guests? The problem here would be that if I changed this code —
echo Anchor(T('Start a New Discussion'), '/post/discussion'.(array_key_exists('CategoryID', $Data) ? '/'.$Data['CategoryID'] : ''), 'BigButton NewDiscussion');
— then I would be changing it for the logged in users as well, no?
Do you follow me? Thanks for the info. (I'm brand new with Vanilla and absolutely loving learning it:))
- Spam
- Abuse
0 · Insightful Awesome LOL ·I might actually try the anonymouse plugin in order to encourage registrations in the early days. Thanks for the information. I'll be back to implement option 1 later, and hopefully this is helpful for others who may want the same functionality!
edit: On second thought, I'm going to try Option 1, as suggested, and I'll get back with my results. Like I said, I'm a complete newbie so we'll see how long it takes me to figure it all out.
- Spam
- Abuse
0 · Insightful Awesome LOL ·I've been messing around with
/vanilla/applications/vanilla/views/modules/newdiscussion.phpand trying to write some code that identifies guests. However I just realized that newdiscussion.php doesn't seem to even get called if the user is a guest, so there's no point in editing it until I can tell Vanilla to call that file for guests also. That's where I'm at. Appreciate it if you had any thoughts on direction from here. I'll follow up if I find out where to go from here.- Spam
- Abuse
0 · Insightful Awesome LOL ·Answer
This is literally the easiest solution.
/vanilla/applications/vanilla/modules/class.newdiscussionmodule.phpif ($HasPermission)So now Vanilla won't check if the user has permissions to see the "Start a New Discussion" button; it'll just display it no matter what. And if a guest clicks that button he's brought to the Sign in page.
Unfortunately I already selected peregrine's option as the answer and I can't revoke that, but this is the solution that works for me. Wouldn't have gotten here without your support, peregrine, cheers!
- Spam
- Abuse
0 · Insightful Awesome LOL ·In addition to above, the following change is possible to make the "Start a New Discussion" go directly to the Register page for Guests. However, it's probably not a good practice to implement this, because logged-out users would be brought to the register page upon clicking the button, and they wouldn't be able to sign in from that page.
Change
/vanilla/applications/vanilla/views/modules/newdiscussion.phpto the following:- Spam
- Abuse
0 · Insightful Awesome LOL ·