vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   poll voters.. grab the ip and display on 'who voted' (https://vborg.vbsupport.ru/showthread.php?t=47250)

somerfeld 01-02-2003 09:54 AM

poll voters.. grab the ip and display on 'who voted'
 
poll voters.. grab the ip and display on 'who voted'.

Woundering if anyone has done somethign like this yet?

Chris M 01-02-2003 02:10 PM

Open admin/thread.php
Find:
Code:

        $votes = $DB_site->query("
                SELECT pollvote.*, user.username
                FROM pollvote
                LEFT JOIN user ON(user.userid=pollvote.userid)
                WHERE pollid='$pollid' ORDER BY voteoption, username ASC
        ");

Replace with:
Code:

        $votes = $DB_site->query("
                SELECT pollvote.*, user.username, user.ipaddress
                FROM pollvote
                LEFT JOIN user ON(user.userid=pollvote.userid)
                WHERE pollid='$pollid' ORDER BY voteoption, username ASC
        ");

Now find:
Code:

                if ($vote['username']=="") {
                        $username = "<font size='1'>Guest</font>";
                } else {
                        $username = "<a href=\"../member.php?s=$session[sessionhash]&action=getinfo&userid=$vote[userid]\" target=\"_blank\">$vote[username]</a>";
                }

Add below:
Code:

                if ($vote['ipaddress']=="") {
                        $ipaddress = "<font size='1'>No IP</font>";
                } else {
                        $ipaddress = "<a href=\"/user.php?s=$session[sessionhash]&action=doips&username=$vote[username]\" target=\"_blank\">$vote[ipaddress]</a>";
                }

Now find:
Code:

                if ($lastoption != $vote['voteoption']) {
                        $option = $options[($vote['voteoption']-1)];
                        echo "</td></tr>\n<tr class='".getrowbg()."'><td><b>$option</b></td><td>\n";
                        echo "$username &nbsp;\n";
                } else {
                        echo "$username &nbsp;\n";
                }

Replace with:
Code:

                if ($lastoption != $vote['voteoption']) {
                        $option = $options[($vote['voteoption']-1)];
                        echo "</td></tr>\n<tr class='".getrowbg()."'><td><b>$option</b></td><td>\n";
                        echo "$username ($ipaddress) &nbsp;\n";
                } else {
                        echo "$username ($ipaddress) &nbsp;\n";
                }

:)

Satan

somerfeld 01-16-2003 12:05 PM

how would I get a unregeistered user ip who voted?

Chris M 01-17-2003 06:10 PM

I am afraid that would be impossible without some sort of storage system for unregistered user's ips...

Satan


All times are GMT. The time now is 07:01 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01053 seconds
  • Memory Usage 1,719KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete