vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Last Seen Online in Postbit vB 3.8.1 (https://vborg.vbsupport.ru/showthread.php?t=208003)

Dave Hybrid 03-11-2009 09:33 AM

Last Seen Online in Postbit vB 3.8.1
 
Hi all,

So I want to add last seen online to the postbit, there are no new mods for this and old ones do not seem to work.

I know where I add the code manually but if I copy paste the same code used in the member profile it shows the title but not the date, as if the $ command is only good for the member page.

Any ideas what I would use?

BigJohnny 03-11-2009 10:33 AM

its probably going to be either a $userinfo or a $prepared var, it would only be $prepared if vB has an existing variable for last seen online.

I had a problem with signatures in my memberinfo template, when I used $post[signature] it would return the sig, but if there was a sig pic it would only show the bbcode tags for sig pics.

I found out that memberinfo already had a sig part, so I used $prepared[signature] and it displayed the sig with pics, because vbulletin has already "prepared" the signature.

Dave Hybrid 03-11-2009 10:51 AM

Neither work.

Lynne 03-11-2009 02:06 PM

As I posted over on vb.com, you'll need to use $post or $userinfo. However, the code you posted over on vb.com isn't going to work as is. You have a bunch of variables in it that aren't defined for use in the postbit. You will have to simplify it quite a bit.


edit: Someone posted this in another thread. It may work for you:
HTML Code:

<div>$vbphrase[last_seen_online]: $post[lastseen_date] $post[lastseen_time]</div>
You may have to create that phrase or just use text. And, I'm not sure if those are actual working variables or ones he created using a plugin. Try substituting variables that you were going to use in there.

Dave Hybrid 03-11-2009 02:15 PM

Yeah, doesn't work thanks anyway.

Lynne 03-11-2009 02:33 PM

You know, simply saying "doesn't work" isn't going to help us to help you. You need to post the code you are using with a couple of lines before and after your code if you want us to help you debug it. Also, post your plugin code (and location) so we can see how you are getting these variables.

Dave Hybrid 03-11-2009 02:42 PM

I'm just placeing it in postbit under join date.

Code:

<div>$vbphrase[last_seen_online]: $post[lastseen_date] $post[lastseen_time]</div>
The : shows but the data doesn't so the $varibles are not right, otherwise code is fine.

Likewise saying 'just create a plugin is not helpful. What does one put in this plugin?

Lynne 03-11-2009 02:57 PM

I thought you were trying other variable names at first? Not $post[lastseen_date]. I thought you had some names from the memberinfo template that you were trying ($post[lastactivitydate] or $post[lastactivitytime]?). I never said to just create a plugin - I don't know if you need one. I did say that if you do have a plugin, you need to post your code for us to see.

And I know that phrase is not available because I checked - which is why I said you would have to create it or use text.

Dave Hybrid 03-11-2009 03:05 PM

Code:

<div>$vbphrase[last_seen_online]: $userinfo[lastactivitydate] $userinfo[lastactivitytime]</div>
Yeah, these are the other ones, i posted them over at vb.com, they do not work either. The phrase is not a problem, i can just use text. It's the data pulled that is important.

Lynne 03-11-2009 03:13 PM

Then it sounds like you will need to write a plugin to define the variables you want to use. You'll probably want to use one of the postbit_* hook locations. You should look in the code to see what variables are available at each location. If you have a date available, then you should be able to format it using something like (this is taken from a mod I wrote and you'll have to change it a little bit, I'm sure):
PHP Code:

            $user['date'] = vbdate($this->registry->options['dateformat'],$user['dateline']);            
            
$user['time'] = vbdate($this->registry->options['timeformat'], $user['dateline']);
            
$userdateline $user['date'] .' '$user['time']; 

And then you would use $userdateline in the template. As I said though, take a look in the code around the hook location to see what the names of the variables are that you would use in your plugin.


All times are GMT. The time now is 01:10 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.01389 seconds
  • Memory Usage 1,737KB
  • 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_html_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete