PHP Script
No comment
Download Count: 99
Date Added: Saturday, 10-Sep-11 17:34:05 CDT
Tags: pyrocms, codeigniter, php, ip address, session, userdata
This is a simple PyroCMS plugin that uses session data to display the visitors IP address.
Place the IP Address plugin file in your PyroCMS shared_addons/plugins folder and you're all set to go
To use the plugin, add this tag to your page or template:
{{ ip:address text="Your IP address is" }}
Hope you find this useful!File Name: ip.php - Code Type: PHP
<?php defined('BASEPATH') OR exit('No direct script access allowed'); /** * This is a simple plugin to show a visitors IP address in PyroCMS * * @author Larry Price * @website http://lfwebpro.com * @package IP Address plugin */ class Plugin_Ip extends Plugin { /** * * Usage: * {pyro:ip:address text="Your IP address is"} * * Required attributes * none * @return string */ function address() { $data = ''; if ($this->attribute('text')) { $data .= $this->attribute('text') .' '; } $data .= $this->session->userdata('ip_address'); return "$data"; } } /* End of file ip.php */
Parsed in 0.163 seconds - Rate: 3.70 KB/s - GeSHi version: 1.0.8.10
Hope you find this helpful! If you have any questions, please leave a comment.