Wordpress | generate unique link - wordpress

I am turning to Stackoverflow community for a need of critical advice.
It's simple, I want a person to generate a link... and that link will have a button where whoever it is sent to, that person can click yes/no - then return the value.
user 1 > generate link > user 2 > options > return option to user 1
Please can anyone point me in the right direction?
Thanks very much!

All the code you need is in wp-login.php
Generate unique URL (for password reset)
Email URL (or you could just display it)
Set user profile metadata (so you can track it)
If you want to track individual users, then you can either generate a unique url per user, per authored page or perhaps simpler is generate one unique url per page, but check that the user is logged when the unique link is clicked.
Either way you can use that to prevent multiple votes etc

Related

Creating user WantList and WantToSellList in Buddypress / Wordpress

I’m working on a site cataloging recording artists and their releases. It is hosted on Siteground and posted with Wordpress. It is a wordpress database.
We catalog records, all the way down to the specific version of each release (each version is a post). I'm currently using buddypress to create the user accounts and etc.
https://staging3.recordcollectorsoftheworldunite.com/release/like-a-virgin-3/
Here’s an example of a release page. Each version is uploaded as a post. Custom post type->album (is one example). Currently I have buttons (they don’t do anything) in each version’s foreach loop that say “WANT” “HAVE” “SELL”.
I want these buttons to add to the user's WantList, HaveList, and WantToSellList. These will be unique arrays for each user.
I'm thinking the best way would be to create new column in the album's entry in the database called this_user_wants_this, _has_this, _wants_to_sell_this, etc. That column would be a dynamic column that each user's profile would fill in? Each user would have an entirely different list of wants and haves and wants-to-sells.
Here’s what I want to do in English.
If user is logged in and presses the WANT button on this_post(), Change this post’s row “want_this_item” to ‘1’ for this_user only.
if “want_this_item” == 1, change “want_this_item” back to 0.
I don’t understand the language of what I would need to write out. How do I create the field for “want_this_item”, and then what code do I need to modify it?
I've tried creating an x_profile_field in buddypress, is there something to this? I still don't exactly understand how to modify that with the buttons.
Thanks so much!

Populate data based on the response given in Google Form

I have created two sections
First Section I have Order ID after entering the order ID and I click Next - In second section I want to populate order id's related data like (Name, Address, list of orders) All these data are available in an excel sheet, Once it is populated I would like the user to confirm their orders are correct and then hit submit.
Is this possible using google form or any add-ons for Google forms?
Thanks!
i read your question
As far i know about google form, google form don't give option to recheck your pre-filled options. So, what we can do is to give a confirm button at the end which is must required to fill.
You can see it through this example.
https://docs.google.com/forms/d/e/1FAIpQLSchhhCjcyQe-ZTdl8pFF-ETLPGFTXPcuqQGDGQ1nMbtcwOnGQ/viewform?usp=sf_link
If you want to create a more user defined form you can make it from simple html and php.
hope this will help you.
thanks!

ASP.NET MVC forbid access after form was submited

I am building a survey where customers are sent a direct link with an id that relates to the database so we can know who the customer is without them having to fill in their personal information. I based it off the Edit scaffolding since the row is precreated in the database and only needs to be edited to fill in the questions.
For clarity, the url is mydomain.com/controller/action/id -> where id is the PK of the row that holds the answers to the survey.
The issue I'm facing is that if they visit the direct link again they can edit the survey as many times as they want. I want to make it so once it is submitted the link leads to page that says "survey already submitted"
Add a Boolean column to the row, and set it to true the first time the survey is submitted. In the method that loads the survey, check the value of this column before returning the view. If the value is true, redirect to another controller action, which lands the user to the 'Survey already submitted' page.
You have a few options ahead of you. Effectively you want to disable the survey if it has been submitted.
Two solutions I can think of are:
If the survey has already been filled out, don't let them edit it.
If you want the users to have the ability to edit a survey prior to submitting it, have a "SubmittedOn" Date field. If that field is populated, the Survey is complete and unable to be edited.

Wordpress: Counter for page views to be inserted in a different page

I have been looking for a plugin in wordpress that allows me to insert a page view counter in a different page: I´ll explain;
In page A I have buttom with a contact form to vote a video (it is a video contest). This contact form sends the voter an email with a link to page B so that they can validate their email this way. Every visit to page B will be counted as a vote.
The thing is that I want to count the number times that page B is accessed to show it in page A (to show the number of votes next to the video).
It seems pretty straightforward but I can´t find an easy way to do this. Do you think you could help me?
Thanks!
Guzmán
If a very small number of people will access the page you can just store a value in WordPress and add to it each time. If you expect a lot of users on the page at once you may need a more complex method.
For a lightly trafficed page, with the risk that some visits might not be counted you could leverage the post meta and simply store a counter variable. If two people viewed the page at the same time they could get the same value for the counter variable and so they would not properly increment the variable.
You could add this to the template for the page in question:
$vcount = get_post_meta($post->ID, "view_counter");
add_post_meta($post->ID, "view_counter", $vcount+1, true);
So two people accessing the page would end up with equal $vcount variables. To display the count you'd just need the post id for the post you saved the meta to: print get_post_meta(<POSTIDHERE>, "view_counter", true);
If you need to have a more robust solution, you'd want to store a unique value for each visitor and then to report the total you would count the values and display it. So you could store the visitor's IP address as a multi-value meta:
add_post_meta($post->ID, "view_counter", $_SERVER['REMOTE_ADDR'], false);
Then to display the count you'd need to count the number of post meta values stored with the view_counter key:
$ips = get_post_meta(<POSTIDHERE>, "view_counter", false);
$views = count($ips);
print "Total views: $views";
This is just a sample solution, you should probably check to see if an IP already exists and consider throttling individual IPs. You could also risk filling your database if you have a small shared server unless you write some additional code to keep this from being abused since it adds data to your database on every page view. Finally this will not work correctly if you have any type of caching enabled.
Depending on the plugin that you are using for your contact form you may also be able to report the number of times that the contact form was submitted by querying the database directly.
For more information see the documentation for add_post_meta and get_post_meta
(disclaimer, code written from memory and documentation, not tested)

Pass the node and create a dynamic view according to the nid? Drupal

I am creating a website in which users enter challenges through a form(created by CCK) so every challenge is a node. Now i want to pass the node id to a view so that the related information to that challenge can be displayed. That is when users click on the challenge name it should display all the information related to that challenge.
Please help
Thanks in advance
Kanwal
Additional info:
Thanks alot i have done that now the view is displaying the participants according to the argument i.e challenge node id but i have given the challenges url as challenge/[nid] instead of node/[nid]. If i keep it as node.[nid] it is picking up the view but not with challenge/[nid] even the pathe of the page is challenge/%. Any suggestions.
Thanks
Kanwal
Can you explain a little more what you mean?
Creating a node view, adding a node id argument, and then creating a page display where you put a % in the path where you want the node to come in is fairly easy - give it a try.

Resources