* Invision Power Services
* IP.Board v3.3.4
* ACP tools skin file
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
*
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 10914 $
*
*/
class cp_skin_tools
{
/**
* Registry Object Shortcuts
*
* @var $registry
* @var $DB
* @var $settings
* @var $request
* @var $lang
* @var $member
* @var $memberData
* @var $cache
* @var $caches
*/
protected $registry;
protected $DB;
protected $settings;
protected $request;
protected $lang;
protected $member;
protected $memberData;
protected $cache;
protected $caches;
/**
* Constructor
*
* @param object $registry Registry object
* @return @e void
*/
public function __construct( ipsRegistry $registry )
{
$this->registry = $registry;
$this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest();
$this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
$this->lang = $this->registry->class_localization;
}
/**
* Merge start form
*
* @param array Member data
* @return string HTML
*/
public function mergeStart( $member ){
$IPBHTML = "";
$desc = sprintf( $this->lang->words['merge_explanation'], $member['members_display_name'], $member['members_display_name'] );
$form['name'] = ipsRegistry::getClass('output')->formInput( 'name', ipsRegistry::$request['name'], 'member' );
$form['email'] = ipsRegistry::getClass('output')->formInput( 'email', ipsRegistry::$request['email'] );
$form['target_id'] = ipsRegistry::getClass('output')->formSimpleInput( 'target_id', ipsRegistry::$request['target_id'] );
$IPBHTML .= <<
{$desc}
HTML;
//--endhtml--//
return $IPBHTML;
}
/**
* Confirm merge of two members
*
* @param array Member data
* @param array Member data
* @return string HTML
*/
public function mergeConfirm( $member, $member2 ){
$IPBHTML = "";
$desc = sprintf( $this->lang->words['merge_confirmation'], $member2['members_display_name'], $member['members_display_name'], $member2['members_display_name'] );
$IPBHTML .= <<
{$desc}
HTML;
//--endhtml--//
return $IPBHTML;
}
/**
* Member tools splash page
*
* @param string Message
* @param array Form elements
* @return string HTML
*/
public function toolsIndex( $message, $form=array() ) {
$IPBHTML = "";
//--starthtml--//
if( $message )
{
$IPBHTML .= <<
{$message}
HTML;
}
$form_name = ipsRegistry::getClass('output')->formInput( "name", isset($_POST['name']) ? IPSText::stripslashes($_POST['name']) : '' );
$form_ip = ipsRegistry::getClass('output')->formInput( "ip", isset($_POST['ip']) ? IPSText::stripslashes($_POST['ip']) : '' );
$IPBHTML .= <<
{$this->lang->words['t_iptoolstitle']}
{$this->lang->words['t_guesttools']}
HTML;
//--endhtml--//
return $IPBHTML;
}
/**
* Delete PM wrapper
*
* @param array Member
* @param int Total topics
* @param int Total replies
* @return string HTML
*/
public function deleteMessagesWrapper( $member, $countTopics, $countReplies )
{
$IPBHTML = "";
//--starthtml--//
$countTopics['total'] = intval($countTopics['total']);
$countReplies['total'] = intval($countReplies['total']);
$this->lang->words['total_pms_topics'] = sprintf( $this->lang->words['total_pms_topics'], $countTopics['total'] );
$this->lang->words['total_pms_replies'] = sprintf( $this->lang->words['total_pms_replies'], $countReplies['total'] );
$topicsYesNo = $this->registry->output->formYesNo( 'topics', 0 );
$repliesYesNo = $this->registry->output->formYesNo( 'replies', 0 );
$IPBHTML .= <<
{$this->lang->words['member_management_h2']}
HTML;
//--endhtml--//
return $IPBHTML;
}
/**
* Show all of a member's IP addresses
*
* @param array Member data
* @param array All IPs
* @param string Page links
* @param array Member's registering with IP
* @return string HTML
*/
public function showAllIPs( $member, $allips, $links, $reg=array() ) {
$IPBHTML = "";
//--starthtml--//
$count = count($allips);
$counttxt = sprintf( $this->lang->words['t_counttxt'], $member['members_display_name'], $count );
$IPBHTML .= <<
{$counttxt}
| {$this->lang->words['t_ipaddy']} |
{$this->lang->words['t_timesused']} |
{$this->lang->words['t_lastused']} |
{$this->lang->words['t_usedotherreg']} |
{$this->lang->words['t_iptool']} |
HTML;
if( is_array($allips) AND count($allips) )
{
foreach( $allips as $ip_address => $use_info )
{
$date = $use_info[1] ? ipsRegistry::getClass( 'class_localization')->getDate( $use_info[1], 'SHORT' ) : 'No Info';
$others = intval( count( $reg[ $ip_address ] ) );
$IPBHTML .= <<
{$ip_address} |
{$use_info[0]} |
{$date} |
{$others} |
{$this->lang->words['t_learnmore']} |
HTML;
}
}
else
{
$IPBHTML .= <<
{$this->lang->words['t_noips']} |
HTML;
}
$IPBHTML .= <<
{$links}
HTML;
//--endhtml--//
return $IPBHTML;
}
/**
* Learn about an IP
*
* @param string Host address
* @param array All registering members
* @param array All posting members
* @param array All voting members
* @param array All emailing members
* @param array All validating members
* @param array All other instances of IP
* @return string HTML
*/
public function learnIPResults( $hostAddr, $registered=array(), $posted=array(), $voted=array(), $emailed=array(), $validating=array(), $results=array() ) {
$IPBHTML = "";
//--starthtml--//
$IPBHTML .= <<
{$this->lang->words['hostaddress_for']} {$this->request['ip']}
| {$this->lang->words['t_ipresolves']} |
{$hostAddr} |
{$this->lang->words['t_ipreg']}
| {$this->lang->words['t_ipname']} |
{$this->lang->words['t_ipemail']} |
{$this->lang->words['t_ipposts']} |
{$this->lang->words['t_ipip']} |
{$this->lang->words['t_ipregistered']} |
HTML;
if( is_array($registered) AND count($registered) )
{
foreach( $registered as $member )
{
$IPBHTML .= <<
{$member['members_display_name']} |
{$member['email']} |
{$member['posts']} |
{$member['ip_address']} |
{$member['_joined']} |
HTML;
}
}
else
{
$IPBHTML .= <<
{$this->lang->words['t_nomatches']} |
HTML;
}
$IPBHTML .= <<
{$this->lang->words['t_ipposting']}
| {$this->lang->words['t_ipname']} |
{$this->lang->words['t_ipemail']} |
{$this->lang->words['t_ipip']} |
{$this->lang->words['t_ipposted']} |
{$this->lang->words['t_ipview']} |
HTML;
if( is_array($posted) AND count($posted) )
{
foreach( $posted as $member )
{
$IPBHTML .= <<
{$member['members_display_name']} |
{$member['email']} |
{$member['ip_address']} |
{$member['_post_date']} |
{$this->lang->words['t_ipviewpost']} |
HTML;
}
}
else
{
$IPBHTML .= <<
{$this->lang->words['t_nomatches']} |
HTML;
}
$IPBHTML .= <<
{$this->lang->words['t_ipvoting']}
| {$this->lang->words['t_ipname']} |
{$this->lang->words['t_ipemail']} |
{$this->lang->words['t_ipip']} |
{$this->lang->words['t_ipfirstused']} |
{$this->lang->words['t_ipview']} |
HTML;
if( is_array($voted) AND count($voted) )
{
foreach( $voted as $member )
{
$IPBHTML .= <<
{$member['members_display_name']} |
{$member['email']} |
{$member['ip_address']} |
{$member['_vote_date']} |
{$this->lang->words['t_ipviewpoll']} |
HTML;
}
}
else
{
$IPBHTML .= <<
{$this->lang->words['t_nomatches']} |
HTML;
}
$IPBHTML .= <<
{$this->lang->words['t_ipemailing']}
| {$this->lang->words['t_ipname']} |
{$this->lang->words['t_ipemail']} |
{$this->lang->words['t_ipip']} |
{$this->lang->words['t_ipfirstused']} |
HTML;
if( is_array($emailed) AND count($emailed) )
{
foreach( $emailed as $member )
{
$IPBHTML .= <<
{$member['members_display_name']} |
{$member['email']} |
{$member['from_ip_address']} |
{$member['_email_date']} |
HTML;
}
}
else
{
$IPBHTML .= <<
{$this->lang->words['t_nomatches']} |
HTML;
}
$IPBHTML .= <<
{$this->lang->words['t_ipvalidating']}
| {$this->lang->words['t_ipname']} |
{$this->lang->words['t_ipemail']} |
{$this->lang->words['t_ipip']} |
{$this->lang->words['t_ipfirstused']} |
HTML;
if( is_array($validating) AND count($validating) )
{
foreach( $validating as $member )
{
$IPBHTML .= <<
{$member['members_display_name']} |
{$member['email']} |
{$member['ip_address']} |
{$member['_entry_date']} |
HTML;
}
}
else
{
$IPBHTML .= <<
{$this->lang->words['t_nomatches']} |
HTML;
}
$IPBHTML .= <<
{$this->lang->words['t_ipalsofound']}
| {$this->lang->words['t_ipname']} |
{$this->lang->words['t_ip_table']} |
{$this->lang->words['t_ipip']} |
{$this->lang->words['t_ipfirstused']} |
HTML;
if( is_array($results) AND count($results) )
{
foreach( $results as $table => $result )
{
if( count($result) )
{
foreach( $result as $member )
{
$date = $member['date'] ? ipsRegistry::getClass( 'class_localization')->getDate( $member['date'], 'SHORT' ) : '';
$member['members_display_name'] = $member['members_display_name'] ? $member['members_display_name'] : $this->lang->words['t_guest'];
$IPBHTML .= <<
{$member['members_display_name']} |
{$table} |
{$member['ip_address']} |
{$date} |
HTML;
}
}
}
}
else
{
$IPBHTML .= <<
{$this->lang->words['t_nomatches']} |
HTML;
}
$IPBHTML .= <<
HTML;
//--endhtml--//
return $IPBHTML;
}
}