Giter Club home page Giter Club logo

cakephp-whos-online-plugin's Introduction

Online CakePHP Plugin
======================
Keeps track of users visiting your site, tracking where they are in
your application.  This will use the user's IP address (converted to a database friendly int).

About
======================
Author Nick Baker
Version 2.0
Link http://www.webtechnick.com
Email [email protected]

Get it
======================
GIT: [email protected]:webtechnick/CakePHP-Whos-Online-Plugin.git 

Changelog:
======================
	2.0: CakePHP 2.x upgrade
  1.2: Added nicer included element.
  1.1: Added tests.
  1.0: Initial Release


Setup:
======================
 1) Copy /Online into app/Plugin/Online
 
 2a) Run the online.sql into your database
 2b) Run cake schema run create --plugin Online
   note: If you choose the cake schema route -- I suggest changing your database engine
   to MEMORY as it will be faster to access/write than default.
   note2: if you choose the cake schema route -- change the ip column to 'unsigned' 
 
 3) Add a bit of code to your AppController.php
  
//AppController.php
var $uses = array('Online.Online');

function beforeRender(){
  $this->Online->update($this->here);
}


See Who's Online:
======================
  I've included a few ways for you to view who's online without too much hassle.

1) Use the built in OnlineHelper:

  <?php 
  $users_online = $Online->all();
  echo debug($users_online);
  ?>
  
2) Use requestAction():

  <?php 
  $users_online = $this->requestAction('/online/onlines');
  echo debug($users_online);
  ?>
  
3) Or you can use the built in element (css will be needed to make it look nice)

  <?php echo $this->element('Online.online'); ?>
  
  
Enjoy!
Nick

cakephp-whos-online-plugin's People

Contributors

webtechnick avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.