vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Anybody help me for member online ip show Profile page (https://vborg.vbsupport.ru/showthread.php?t=280218)

Bulent Tekcan 03-17-2012 02:50 PM

Anybody help me for member online ip show Profile page
 
Hello,

Before I use this code for that, but after vB4.1.11 this code not work. Anybody help for reuse this code ?

Code:

<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="membergetip" active="1">
    <title>Get Member IP</title>
    <description />
    <version>1.0.2</version>
    <url />
    <versioncheckurl />
    <apm_releasedate>0</apm_releasedate>
    <apm_author />
    <apm_relatedurl />
    <apm_extrainfo />
    <apm_extraedit />
    <dependencies>
    </dependencies>
    <codes>
    </codes>
    <templates>
    </templates>
    <plugins>
        <plugin active="1" executionorder="5">
            <title>Get Online Ip</title>
            <hookname>member_complete</hookname>
            <phpcode><![CDATA[if (is_member_of($vbulletin->userinfo, 5) OR is_member_of($vbulletin->userinfo, 6) OR is_member_of($vbulletin->userinfo, 9))
{
$getip = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "session WHERE userid=".$userinfo['userid']);
$prepared[where] .= '<br />Online IP : <b>'.$getip['host'] . '</b>'; 
}]]></phpcode>
        </plugin>
    </plugins>
    <phrases>
    </phrases>
    <options>
    </options>
    <helptopics>
    </helptopics>
    <cronentries>
    </cronentries>
    <faqentries>
    </faqentries>
</product>

Regards,

Bulent Tekcan 03-19-2012 07:59 PM

Any idea ?

kh99 03-19-2012 08:16 PM

I don't see why that code would stop working. Are you sure the plugin is still enabled (did you disable them for the upgrade then forget to reenable?).

Do you see the "Online IP:" with no ip, or nothing at all?

Bulent Tekcan 03-19-2012 08:46 PM

Quote:

Originally Posted by kh99 (Post 2311134)
I don't see why that code would stop working. Are you sure the plugin is still enabled (did you disable them for the upgrade then forget to reenable?).

Do you see the "Online IP:" with no ip, or nothing at all?

Hello,

I don't know maybe the member_complete location wrong or code is not compatible.But this is still work on vB3.8.x

vbenhancer 03-19-2012 10:00 PM

it will not work in 4.x, as the template codes are different and the hooks have different names.

kh99 03-19-2012 11:14 PM

Right, I didn't realize that that the upgrade was from vb3. Still, it looks like the code should work and $prepared is getting registered to a template, so it seems you should be able to use {vb:raw prepared.where} to show it. If you were adding $prepared[where] to a template to get it to display, then you'd have to change it {vb:raw prepared.where}.

Bulent Tekcan 03-20-2012 03:57 PM

Can you help for this ? Becasue I'm not a code exper

Bulent Tekcan 03-26-2012 09:05 AM

I get this error

Parse error: syntax error, unexpected T_STRING in /home/xxxxx/public_html/xxxxx/member.php(633) : eval()'d code on line 4

kh99 03-26-2012 11:53 AM

I installed exactly the product file you posted above on a vb.4.1.11 test site and it works for me. I had to edit the MEMBERINFO template and insert {vb:raw prepared.where} where I wanted it to appear, but otherwise I had no problems.

(The file above should be saved as an xml file then imported from the product manager, right?).

Bulent Tekcan 03-26-2012 12:23 PM

My xml is like that

Code:

<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="membergetip" active="1">
    <title>Get Member IP</title>
    <description />
    <version>1.0.2</version>
    <url />
    <versioncheckurl />
    <apm_releasedate>0</apm_releasedate>
    <apm_author />
    <apm_relatedurl />
    <apm_extrainfo />
    <apm_extraedit />
    <dependencies>
    </dependencies>
    <codes>
    </codes>
    <templates>
    </templates>
    <plugins>
        <plugin active="1" executionorder="5">
            <title>Get Online Ip</title>
            <hookname>member_complete</hookname>
            <phpcode><![CDATA[if (is_member_of($vbulletin->userinfo, 5) OR is_member_of($vbulletin->userinfo, 6) OR is_member_of($vbulletin->userinfo, 9))
{
$getip = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "session WHERE userid=".$userinfo['userid']);
{vb:raw prepared.where} .= '<br />Online IP : <b>'.$getip['host'] . '</b>'; 
}]]></phpcode>
        </plugin>
    </plugins>
    <phrases>
    </phrases>
    <options>
    </options>
    <helptopics>
    </helptopics>
    <cronentries>
    </cronentries>
    <faqentries>
    </faqentries>
</product>

Is it correct ?

kh99 03-26-2012 12:35 PM

Well, like I said, I used what you included in your first post.

Bulent Tekcan 03-26-2012 12:54 PM

I'm still get same error :(


All times are GMT. The time now is 05:03 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.02092 seconds
  • Memory Usage 1,740KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (12)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