YAFLogo

Eagle_f90
  • Eagle_f90
  • 70% (Friendly)
  • YAF Lover Topic Starter
10 years ago
I am trying to build out a control or my website's home page to display and let users vote in polls. I have been able to trace out how the question, choices, and votes are stored but when it comes to verifying who has voted the only thing I can find is the RemoteIP filed in yaf_PollVote. I know this would be used to track quest votes but is it also the way member votes are tracked or is there more done for members?

Also, how does the IP get converted from the standard xxx.xxx.xxx.xxx format to the INT format used to store them in the DB?

Sponsor
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.1 BETA
10 years ago

I am trying to build out a control or my website's home page to display and let users vote in polls. I have been able to trace out how the question, choices, and votes are stored but when it comes to verifying who has voted the only thing I can find is the RemoteIP filed in yaf_PollVote. I know this would be used to track quest votes but is it also the way member votes are tracked or is there more done for members?

Originally Posted by: Eagle_f90 

Check the PollVote Table Column UserID it saves which user has voted

Also, how does the IP get converted from the standard xxx.xxx.xxx.xxx format to the INT format used to store them in the DB?

Originally Posted by: Eagle_f90 

the ip is saved as string and not as int

Eagle_f90
  • Eagle_f90
  • 70% (Friendly)
  • YAF Lover Topic Starter
10 years ago

Also, how does the IP get converted from the standard xxx.xxx.xxx.xxx format to the INT format used to store them in the DB?

Originally Posted by: tha_watcha 

the ip is saved as string and not as int

Originally Posted by: Eagle_f90 

What transformations are applied to it, the address I am looking at for the test post is just a numeric string and not the normal quad-dotted notation.

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.1 BETA
10 years ago

Also, how does the IP get converted from the standard xxx.xxx.xxx.xxx format to the INT format used to store them in the DB?

Originally Posted by: Eagle_f90 

the ip is saved as string and not as int

Originally Posted by: tha_watcha 

What transformations are applied to it, the address I am looking at for the test post is just a numeric string and not the normal quad-dotted notation.

Originally Posted by: Eagle_f90 

There is a helper class YAF.Utils.Helpers.IPHelper.IPStringToLong(...) and the reverse YAF.Utils.Helpers.IPHelper.StringToIP(...)