Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 03-06-2002, 11:18 AM
Robert9 Robert9 is offline
 
Join Date: Oct 2001
Location: super
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yeah, one day iss great, havephun
Reply With Quote
  #12  
Old 03-06-2002, 04:10 PM
Freddie Bingham's Avatar
Freddie Bingham Freddie Bingham is offline
 
Join Date: Oct 2001
Posts: 506
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

/me is confused about adding new fields since you can simply reference lastvisit to figure how long it has been since someone has been online. It will be exact if the person logged out and it will be TIMENOW - lastvisit - cookietimeout if they used cookies.
Reply With Quote
  #13  
Old 03-06-2002, 05:10 PM
Neo's Avatar
Neo Neo is offline
 
Join Date: Oct 2001
Location: Anywhere
Posts: 1,817
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thats true, but I wasnt thinking about that...I was just thinking about how it would look in my head if I was coding it without the use of vb.
Reply With Quote
  #14  
Old 03-14-2002, 03:52 AM
Neo's Avatar
Neo Neo is offline
 
Join Date: Oct 2001
Location: Anywhere
Posts: 1,817
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK... I will have something soon.
Reply With Quote
  #15  
Old 12-08-2002, 12:21 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How soon?
Reply With Quote
  #16  
Old 01-02-2003, 02:21 AM
Logik's Avatar
Logik Logik is offline
 
Join Date: Nov 2002
Location: Tx
Posts: 432
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wouldn't mind this hack either.
Reply With Quote
  #17  
Old 01-02-2003, 06:55 AM
Mystis's Avatar
Mystis Mystis is offline
 
Join Date: Jul 2002
Location: Minnesota
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Deviantart inspired? This should be a piece of cake, I believe I've got a function sitting around to return a formatted difference between 2 times. I'll see if I can dig it up. Sorry if I'm stepping on your toes, Neo

Edit: just realized how old this thread is, but I'll still finish the hack anyway, could be useful to someone
Reply With Quote
  #18  
Old 01-02-2003, 07:24 AM
Mystis's Avatar
Mystis Mystis is offline
 
Join Date: Jul 2002
Location: Minnesota
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
function pluralize($word,$var){
    if(
$var!=1){
        
$word $word."s";
    }
    if(
$var>0){
        
$word $var." ".$word." ";
    }else{
        
$word "";
    }
    return 
$word;
}
function 
timediff($earlier,$later){
    
$secs $earlier $later
    
$string="";
    if(
$secs>=604800){
        
$weeks 0;
        while(
$secs>=604800){
            
$secs -= 604800;
            
$weeks++;
        }
        
$string .= pluralize("week",$weeks);
    }
    if(
$secs>=86400){
        
$days 0;
        while(
$secs>=86400){
            
$secs -= 86400;
            
$days++;
        }
        
$string .= pluralize("day",$days);
    }
    if(
$secs>=3600){
        
$hours 0;
        while(
$secs>=3600){
            
$secs -= 3600;
            
$hours++;
        }
        
$string .= pluralize("hour",$hours);
    }
    if(
$secs>=60){
        
$minutes 0;
        while(
$secs>=60){
            
$secs -= 60;
            
$minutes++;
        }
        
$string .= pluralize("minute",$minutes);
    }
    return 
$string;

There are the functions anyway, you would use like this:
PHP Code:
$variable timediff(time(),$userlastvisit); 
with $userlastvisit being the field 'lastvisit' pulled from the user table from the row of the corresponding member. Then, just add $variable in any of your templates and it will return a string something like "1 day 3 hours 12 minutes", or "2 weeks 8 hours 1 minute". Let me know where you would want this information displayed, and I'll write and release a full fledged hack for it.
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 05:34 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04814 seconds
  • Memory Usage 2,250KB
  • 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_php
  • (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
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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