Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-17-2012, 02:50 PM
Bulent Tekcan Bulent Tekcan is offline
 
Join Date: Oct 2003
Location: TURKEY - Istanbul
Posts: 437
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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,
Reply With Quote
  #2  
Old 03-19-2012, 07:59 PM
Bulent Tekcan Bulent Tekcan is offline
 
Join Date: Oct 2003
Location: TURKEY - Istanbul
Posts: 437
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any idea ?
Reply With Quote
  #3  
Old 03-19-2012, 08:16 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #4  
Old 03-19-2012, 08:46 PM
Bulent Tekcan Bulent Tekcan is offline
 
Join Date: Oct 2003
Location: TURKEY - Istanbul
Posts: 437
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
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
Reply With Quote
  #5  
Old 03-19-2012, 10:00 PM
vbenhancer's Avatar
vbenhancer vbenhancer is offline
 
Join Date: Dec 2009
Location: Qu?bec city, Canada
Posts: 740
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it will not work in 4.x, as the template codes are different and the hooks have different names.
Reply With Quote
  #6  
Old 03-19-2012, 11:14 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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}.
Reply With Quote
  #7  
Old 03-20-2012, 03:57 PM
Bulent Tekcan Bulent Tekcan is offline
 
Join Date: Oct 2003
Location: TURKEY - Istanbul
Posts: 437
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you help for this ? Becasue I'm not a code exper
Reply With Quote
  #8  
Old 03-26-2012, 09:05 AM
Bulent Tekcan Bulent Tekcan is offline
 
Join Date: Oct 2003
Location: TURKEY - Istanbul
Posts: 437
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #9  
Old 03-26-2012, 11:53 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?).
Reply With Quote
  #10  
Old 03-26-2012, 12:23 PM
Bulent Tekcan Bulent Tekcan is offline
 
Join Date: Oct 2003
Location: TURKEY - Istanbul
Posts: 437
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:12 AM.


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.04110 seconds
  • Memory Usage 2,253KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete