Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can a user automatically have voted for his/her idea? #25

Open
mrentropy opened this issue Apr 17, 2015 · 2 comments
Open

Can a user automatically have voted for his/her idea? #25

mrentropy opened this issue Apr 17, 2015 · 2 comments

Comments

@mrentropy
Copy link

Would it be difficult to modify the voting behavior, so that when a user creates an idea they have already voted for it?

@mrentropy
Copy link
Author

FYI, I have a crude method for making this work, but I'm sure there must be a better way. I have UserIdeas redirecting "back to form" after an idea is submitted. Upon returning, I have a shortened version of the voting ajax request and then I redirect to item list.

var id  = <?php echo $itemId ?>;
var url = "index.php?option=com_userideas&task=item.vote&format=raw";

var fields = {
    id: id
};

jQuery.ajax({
    type: "POST",
    url:  url,
    data: fields,
    dataType: "text json"
}).done(function() {
    window.location("/idea")
  })

@todordev
Copy link
Owner

todordev commented Dec 5, 2015

Hi,
If you would like, you can create content plugin.
So, when an idea be stored, the plugin will vote for it, if it is new.

You should use the event onContentAfterSave

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants