Ejemplo n.º 1
0
		<option value="posts">' . $vbphrase['post_count'] . '</option>
		<option value="lastactivity">' . $vbphrase['last_activity'] . '</option>
		<option value="joindate">' . $vbphrase['join_date'] . '</option>
	</select>', '', 'top', 'order');
    print_submit_row($vbphrase['find']);
}
// ############################# user change history #########################
if ($_REQUEST['do'] == 'changehistory') {
    require_once DIR . '/includes/class_userchangelog.php';
    require_once DIR . '/includes/functions_misc.php';
    $vbulletin->input->clean_array_gpc('r', array('userid' => TYPE_UINT));
    if ($vbulletin->GPC['userid']) {
        // initalize the $user storage
        $users = false;
        // create the vb_UserChangeLog instance and set the execute flag (we want to do the query, not just to build)
        $userchangelog = new vb_UserChangeLog($vbulletin);
        $userchangelog->set_execute(true);
        // get the user change list
        $userchange_list = $userchangelog->sql_select_by_userid($vbulletin->GPC['userid']);
        if (!$userchange_list) {
            print_stop_message('invalid_user_specified');
        }
        if ($db->num_rows($userchange_list)) {
            //start the printing
            $printed = array();
            print_table_start();
            print_column_style_code(array('width: 30%;', 'width: 35%;', 'width: 35%;'));
            // fetch the rows
            while ($userchange = $db->fetch_array($userchange_list)) {
                if (!$printed['header']) {
                    // print the table header
Ejemplo n.º 2
0
 /**
  * Return user change history
  *
  * @param integer $userid
  * @return array |bool User change history array. False means no change history.
  */
 public function changeHistory($userid)
 {
     $this->checkHasAdminPermission('canadminusers');
     require_once DIR . '/includes/class_userchangelog.php';
     require_once DIR . '/includes/functions_misc.php';
     // initalize the $user storage
     $users = false;
     // create the vb_UserChangeLog instance and set the execute flag (we want to do the query, not just to build)
     $userchangelog = new vb_UserChangeLog(vB::get_registry());
     $userchangelog->set_execute(true);
     // get the user change list
     $userchange_list = $userchangelog->sql_select_by_userid($userid);
     if (!$userchange_list) {
         return false;
     } else {
         $usergroupcache = vB::getDatastore()->getValue('usergroupcache');
         // fetch the rows
         foreach ($userchange_list as $userchange) {
             // get/find some names, depend on the field and the content
             switch ($userchange['fieldname']) {
                 // get usergroup names from the cache
                 case 'usergroupid':
                 case 'membergroupids':
                     foreach (array('oldvalue', 'newvalue') as $fname) {
                         $str = '';
                         if ($ids = explode(',', $userchange[$fname])) {
                             foreach ($ids as $id) {
                                 if ($usergroupcache["{$id}"]['title']) {
                                     $str .= $usergroupcache["{$id}"]['title'] . '<br/>';
                                 }
                             }
                         }
                         $userchange["{$fname}"] = $str ? $str : '-';
                     }
                     break;
             }
             $userchanges[] = $userchange;
         }
         return $userchanges;
     }
 }