[Plugin: Support Tickets] display the tickets on page
-
hi all
a few months ago I started using a support ticket using the plugin, I searched the forums if there was an option for show tickets at the contact page and saw that there was no taking the decision to set myself the code.The following code can be inserted into a wordpress theme that allows sidebar and widgets.
Paste this code into the sidebar.php file in your theme folder.
<li id="meta" class="widget-container"> <h3 class="widget-title"><?php _e( 'Tickets', 'twentyten' ); ?></h3> <ul> <?php global $current_user; get_currentuserinfo(); // tickets php code // the name of variables can be changed $cedu = $current_user->ID ; //db connect //there is a function called $wpdb but it dont // for me $db=mysqli_connect('localhost','username','passworp','name_of_databse'); if($db!=null) { $consulta="select * from wp_suptic_tickets where user_id = '$cedu' "; $resultado=mysqli_query($db,$consulta); $num_res=mysqli_num_rows($resultado); if( $num_res == 0 ){ echo " "; } else{ for($i=0; $i<$num_res; $i++) { $fila=mysqli_fetch_assoc($resultado); echo'<li> number of ticket: '; echo' '.$fila['id'].'</li> '; echo'<li> Subject: '; echo'<a href="?page_id='.$fila['page_id'].'&ticket='.$fila['id'].'&accesskey='.$fila['access_key'].'">'.$fila['subject'].'</a></li>'; } mysqli_close($db); } //corchete de cierre del else } //corchete de cierre del if ?> </ul> </li>
you can see that in this image: https://i.imgur.com/7DfNH.png
note: sorry for my english, i used a translator because i am from colombia and my native language is spanish.
note2: im working to integrate it in the profile wordpress panel.
if u have question feel free to writenote3: if u want to donate to me, my paypal is: [email protected]
thanks, Santiago
- The topic ‘[Plugin: Support Tickets] display the tickets on page’ is closed to new replies.