Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

kazgrafix on "Need to add the User Role in Support ticket admin page"

$
0
0

Currently within the admin of the support ticket plugin I am using it shows a list of tickets that have been submitted.

What I'm needing is to have the user role next to the user nicename i.e. nicename/user_role

I think I have found the piece of code I need to amend which is :

$output .= '<table class="widefat" style="width:100%"><thead><tr><th>'.__('Ticket', 'wpsc-support-tickets').'</th><th>'.__('Status', 'wpsc-support-tickets').'</th><th>'.__('User', 'wpsc-support-tickets').'</th><th>'.__('Last Reply', 'wpsc-support-tickets').'</th></tr></thead><tbody>';
                            foreach($results as $result) {
                                    if($result['user_id']!=0) {
                                        @$user=get_userdata($result['user_id']);
                                        $theusersname = $user->user_nicename;
                                    } else {
                                        $user = false; // Guest
                                        $theusersname = __('Guest', 'wpsc-support-tickets');
                                    }
									if(trim($result['last_staff_reply'])=='') {
										$last_staff_reply = __('ticket creator', 'wpsc-support-tickets');
									} else {
										if($result['last_updated'] > $result['last_staff_reply']) {
											$last_staff_reply = __('ticket creator', 'wpsc-support-tickets');
										} else {
											$last_staff_reply = '<strong>'.__('Staff Member', 'wpsc-support-tickets').'</strong>';
										}
									}
                                    $output .= '<tr><td><a href="admin.php?page=wpscSupportTickets-edit&primkey='.$result['primkey'].'" style="border:none;text-decoration:none;"><img style="float:left;border:none;margin-right:5px;" src="'.plugins_url('/images/page_edit.png' , __FILE__).'" alt="'.__('View', 'wpsc-support-tickets').'"  /> '.base64_decode($result['title']).'</a></td><td>'.$result['resolution'].'</td><td><a href="'.get_admin_url().'user-edit.php?user_id='.$result['user_id'].'&wp_http_referer='.urlencode(get_admin_url().'admin.php?page=wpscSupportTickets-admin').'">'.$theusersname.'</a></td><td>'.date('Y-m-d g:i A',$result['last_updated']).' '.__('by', 'wpsc-support-tickets').' '.$last_staff_reply.'</td></tr>';
                            }
                            $output .= '</tbody></table>';
                        }

My question is, what coding would I need to enter here to do this and where?

It would be fab if someone could help.

Caroline.


Viewing all articles
Browse latest Browse all 8245

Trending Articles