Getting the ip address from a visitor and show it on extra fields

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting the ip address from a visitor and show it on extra fields

Pedro
Step 1:  http://support.nabble.com/Extra-Profile-Fields-td7586937.html
Step 2:
<override_macro name="new_post" parameters="page_name,mailing_list_etiquette,bottom,focus" requires="servlet">
    <n.node_page.>
        <n.handle_new_node_permission_error/>
        <n.if.not.is_submitted_form>
            <then>
                <n.subject_field.set_value value="[n.page_node.default_reply_subject/]" />
                <n.alert_field.set_value value="[n.page_node.alert_default_value/]" />
                <n.init_new_post_custom_fields/>
            </then>
            <else>
                <!-- Getting the user ip after he has made a post-->
                <n.visitor.set_property name="ip" value="[n.now.long_format/] : [n.visitor_ip_address/]" />        
                
                <n.catch_exception. id="save-block">
                    <n.handle_anonymous_submit/>
                    <n.check_antispam_submit bypass="preview"/>
                    <n.check_recent_post_limit/>
                    <n.create_child_of_page_node commit="[n.not.is_preview/]">
                        <subject><n.subject_field.value/></subject>
                        <message><n.message_field.value/></message>
                        <is_html><n.html_format_field.value/></is_html>
                        <type><n.type_field.value/></type>
                        <kind>post</kind>
                        <do>
                            <n.remember_new_node/>
                            <n.if.not.is_preview>
                                <then>
                                    <n.save_post/>
                                    <n.save_new_post_custom_fields/>
                                    <n.new_node.send_node_as_email/>
                                </then>
                            </n.if.not.is_preview>
                        </do>
                    </n.create_child_of_page_node>
                    <n.if.not.is_preview>
                        <then>
                            <n.new_node.save_alert_field/>
                            <n.redirect_to.new_node.url/>
                        </then>
                    </n.if.not.is_preview>
                </n.catch_exception.>
            </else>
        </n.if.not.is_submitted_form>
        <n.html>
            <head>
                <META NAME="robots" CONTENT="noindex,nofollow"/>
                <n.title.><n.page_name/></n.title.>
                <n.focus/>
                <style type="text/css">
                    .title-row {
                        padding:.6em .8em;
                        font-weight:bold;
                    }
                    div.field-title {
                        margin-top: 0;
                    }
                </style>
            </head>
            <body>
                <n.edit_header first_text="[n.page_name/]" second_text="[n.truncate. size='80'][n.page_node.subject/][/n.truncate.]" />

                <n.if.is_submitted_form>
                    <then>
                        <n.if.has_exception for="save-block">
                            <then.show_new_node_error/>
                            <else>
                                <n.if.is_preview>
                                    <then.new_node.preview/>
                                </n.if.is_preview>
                            </else>
                        </n.if.has_exception>
                    </then>
                </n.if.is_submitted_form>

                <n.subscription_reminder/>

                <n.form. onsubmit="return singleSubmit(this)">
                    <n.type_field.hidden/>
                    <n.mailing_list_notice.mailing_list_etiquette/>

                    <n.reply_form />

                    <div style="margin-top:1em">
                        <n.antispam_submit_button class="toolbar action-button" value="[t]Post Message[/t]"/>
                        <input type="submit" class="toolbar action-button" name="preview" value="[t]Preview Message[/t]"/>
                        <t>or</t>
                        <a href="[n.page_node.url /]"><t>Cancel</t></a>
                    </div>
                </n.form.>

                <n.hide_null.bottom/>
            </body>
        </n.html>
    </n.node_page.>
</override_macro>
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Getting the ip address from a visitor and show it on extra fields

Harvey
Pedro,

Can I see what this looks like when implemented?

How does it help me to have the IP?
HTTPS Please!
Reply | Threaded
Open this post in threaded view
|

Re: Getting the ip address from a visitor and show it on extra fields

Pedro

Post something in my test forum, then check your profile. I guess it is working there.

Em 01/10/2013 23:44, "Harvey [via Nabble Support]" <[hidden email]> escreveu:
Pedro,

Can I see what this looks like when implemented?

How does it help me to have the IP?


If you reply to this email, your message will be added to the discussion below:
http://support.nabble.com/Getting-the-ip-address-from-a-visitor-and-show-it-on-extra-fields-tp7586939p7586944.html
To start a new topic under NAML, email [hidden email]
To unsubscribe from Nabble Support, click here.
NAML
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Getting the ip address from a visitor and show it on extra fields

Harvey
Pedro can you put a link to your test forum in your signature?
HTTPS Please!
Reply | Threaded
Open this post in threaded view
|

Re: Getting the ip address from a visitor and show it on extra fields

Pedro
Look here, you can see the time and my ip based on my last post.
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Getting the ip address from a visitor and show it on extra fields

Harvey
So both last login and IP are only visible to the admin?
HTTPS Please!
Reply | Threaded
Open this post in threaded view
|

Re: Getting the ip address from a visitor and show it on extra fields

Pedro
Everybody can see. The intention of  this post is to teach our users how get the ip from someone.
My test forum.