HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.


This discussion is related to the IsOnline addon.
edited November 2009 in Vanilla 1.0 Help


  • Just tried this, brand new install and 2nd extention. But there is no semicolon on line 95! Any change of searching for a unique line of code to find the position to paste rather than relying on a line number?
  • This is the line you need to find: <span>'.$this->Context->GetDefinition('CommentTime').'</span>'.TimeDiff($this->Context, $Comment->DateCreated).'<span>IsOnline</span>';
  • thanks for the quick response, found it (currently line 99) added the snippet but still get an error. Fatal error: Call to undefined function str_replace_last_count() in /var/www/forums/extensions/IsOnline/default.php on line 71
  • I'm getting the same error as ColMarmaduke... any ideas?
  • Uploaded version 1.0 of IsOnline.
  • Uploaded version 2.0 of IsOnline.
  • Got it ! It was working fine in mine as it was taking the function str_replace_last_count() from another extension DefaultIcon. I have added the function in version 2.0.For those who have already downloaded this extension please add this function to default.php if (!function_exists('str_replace_last_count')) { function str_replace_last_count($search,$replace,$subject,$times) { $subject_original=$subject; $len=strlen($search); $pos=0; for ($i=1;$i<=$times;$i++) { $pos=strrpos_new($subject,$search,$pos); if($pos!==false) { $subject=substr($subject_original,0,$pos); $subject.=$replace; $subject.=substr($subject_original,$pos+$len); $subject_original=$subject; } else { break; } } return($subject); } }
  • Now I get a different error...

    Call to undefined function strrpos_new()

    Also... is there a quick edit I can make to get this to work with a different theme?
  • OK... if I change strrpos_new() to strrpos() it works.
  • Uploaded version 3.0 of IsOnline.
  • Fixed . As I updated earlier ,this extension is based on DefaultIcon so my local one happened to be calling functions from that extension.For those who is not using DefaultIcon .Here's 3.0 with the required functions.
  • Sweet, thanks for updating!
  • @jlone "Also... is there a quick edit I can make to get this to work with a different theme? "

    Yes You can do it by editing the comments.php of your theme.
  • Just had another go at this.

    No errors and offline icons are showing. However it's not showing when I'm online!

    Could the problem be because Im running the site on localhost and cookies set as
    ['COOKIE_DOMAIN'] = '';
    ['COOKIE_PATH'] = '/sitename/forums/';

  • (nearly) works... it goes from offline to online permanently
  • well @mel The time this addon take in account is the activity within last 5 minutes. So even if you logout it will show you online for some time.
Sign In or Register to comment.