supanoob Posted November 30, 2008 Share Posted November 30, 2008 ok i have a couple of questions really, mainly advice things: 1) so say i have someone uploads 10 pictures onto my site, and i would like them to be able to organise them in a certain order they like. Simple enough to do the first time round, but say i want to allow them to re organise them, but they only want to move 1 of them from say 5-2. So my plan would be to have text boxes with the picture number in, how would i go about changing 2-3-4 to 3-4-5? second question may be a little more complex: 2) so i want to allow people to make their own polls, how would i go about making it so a person may only vote on each poll once? Any help would be much appreciated Link to comment https://forums.phpfreaks.com/topic/134870-ok-a-couple-of-things/ Share on other sites More sharing options...
rhodesa Posted November 30, 2008 Share Posted November 30, 2008 1) Are you keeping the picture info a database? In your table, you need a column called 'pic_order' with the numbers you described (you may already have this). Then, to update those numbers, there are a couple ways i've seen. The easiest is to just have a text field, where they can set the number. The user might accidentally use the same number twice, but it's not a big deal. Another way is to have up/down arrows next to each pic. And if they click the up arrow, it swaps the number with the row above it. Lastly, you can use a JavaScript Drag/Drop Sortable. It will allow the user to move the rows to wherever they want, then click 'save', and you can save the new order. Here is an example of the JS for that: http://demo.script.aculo.us/ajax/sortable_elements Link to comment https://forums.phpfreaks.com/topic/134870-ok-a-couple-of-things/#findComment-702275 Share on other sites More sharing options...
rhodesa Posted November 30, 2008 Share Posted November 30, 2008 2) Oh, and for your second question. Tracking people for a poll is difficult to do. The best way to limit vote spamming is by making them register and validating their email via an 'activation' link in their email. If you don't want people to register, you can put a cookie in their browser. But anyone with a clue will know to just turn cookies off and then keep voting. Logging their IP is another way, but then people behind routers will only be allowed one vote (even though there can be several people), and IP address are easily changed/spoofed. Link to comment https://forums.phpfreaks.com/topic/134870-ok-a-couple-of-things/#findComment-702278 Share on other sites More sharing options...
supanoob Posted November 30, 2008 Author Share Posted November 30, 2008 the people voting will be registered members, and thanks for the image ordering solutions Link to comment https://forums.phpfreaks.com/topic/134870-ok-a-couple-of-things/#findComment-702282 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.