PDA

View Full Version : Anybody help me for member online ip show Profile page


Bulent Tekcan
03-17-2012, 02:50 PM
Hello,

Before I use this code for that, but after vB4.1.11 this code not work. Anybody help for reuse this 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
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

<?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 :(