Jump to content

SkyRanger

Members
  • Posts

    738
  • Joined

  • Last visited

Everything posted by SkyRanger

  1. Trying to block access to a page unless they logged in user has the proper capability ie: kudos global $userdata; wp_get_current_user(); if ( current_user_can('kudos') ) { echo "kudo add form here"; } else { echo "You can not be here"; }
  2. elseif (isset($_GET['kudodeloffice'])) { //data removal code will be going here $adminurl = get_admin_url(); $redirurl = $adminurl."admin.php?page=kudos/admin-test-kudos"; wp_redirect($redirurl); } Trying to setup a redirect for after somebody chooses a del link. The link already works and will show the kudodeloffice but will not redirect, keeps giving a header error.
  3. Found out the problem. It is my ISP that is blocking the emails. The mail guard program they are using is blocking the emails due to a url. I have contacted them and they have fixed the issue. HTML emails are working now.
  4. I installed a mail logger/checker. It is also showing no errors. Going to contact my service provider to see if it is being blocked on the server side.
  5. This is the template file: kudos-email-template.html and everythings shows correctly on check. Also going to check out phpmailer <html> <head> <meta content="en-ca" http-equiv="Content-Language" /> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Untitled 3</title> <style type="text/css"> .auto-style1 { text-align: center; } </style> </head> <body> <table style="width: 100%"> <tr> <td class="auto-style1">View Online</td> </tr> <tr> <td><img src="buslogo.png" width="94" alt="" style="border-width:0; max-width:94px;height:auto; display:block" /></td> </tr> <tr> <td> </td> </tr> <tr> <td class="auto-style1">{kudomsg}</td> </tr> <tr> <td> </td> </tr> <tr> <td> <div style="color:#4b4f55; font-size:16px; margin-top: 60px; margin-bottom: 40px; text-align:left; font-family: Verdana, Geneva, sans-serif"> <div> {kudoagent} </div> <div> {kudoclient} </div> <div> {agentloc} </div> <div> {kudoposted} </div> </div> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table> </body> </html>
  6. Thanks guys, yeah forgot about the @ and yeah the $headers was incorrect. They have been fixed but pulling no errors, template it populating properly as it is suppose and stating the email has been sent but not receiving. Not sure if receiver server or outbound is blocking it. or it is just stating it is sending but not sending.
  7. Email will send with the #$body but will not send with the $body = str_replace $the_kudo_image = '<img src=' . $kudobanner . '>'; $dir = plugin_dir_path( __DIR__ ); $template = file_get_contents( $dir .'/partials/kudos-email-template.html'); $emtemp = $dir .'/kudos/admin/partials/kudos-email-template.html'; $body = str_replace( array( '{kudos_link}', '{the_kudo_image}', '{kudoagent}', '{kudoclient}', '{agentloc}', '{kudoposted}', '{kudomsg}' ), array( $kudos_link, $the_kudo_image, $kudoagent, $kudoclient, $agentloc, $kudoposted, $kudomsg ), $template ); #$body = "testing email"; //commented out due to test body $to = "daveellis@eastlink.ca"; $subject = "Kudos for $kudoagent"; $headers = array('Content-Type: text/html; charset=UTF-8'); $headers .= 'From = Kudo Server <noreply@aciwork.cloudaccess.host>'; $mail = @wp_mail( $to, $subject, $body, $headers ); if($mail) { echo "<p>Mail Sent.</p>"; } else { echo "<p>Mail Fault.</p>"; }
  8. I don't know what to say and I wish I could send something your way for a thank you for your assistance This part of my project has been a thorn in my side for weeks. If i get the $$$ to be able to send you something I definitely will. If it wasn't for people like you on here and the others who offer there time and assistance with very little in return I thank you. I will be at least adding you to credits of the program so people know. I have coming to this site for help for over 14 yrs and I still remember you were the first on then to help me and I will never forgot. Again thank you.
  9. Thank you Barand. I think I might have copied something wrong but will figure it out (delete row is not working and the select will not populate. Thanks for pointing me in the right direction.
  10. When I add the select to the append it shows the box but not the data when I add: $(wrapper).append('<div><input type="hidden" name="input_array_kuemid[]" value=""/><input type="text" name="input_array_email[]" placeholder="Email Address" /> <input type="text" name="input_array_name[]" placeholder="Email Address Owner" /> <select id="jobqueue" name="input_array_queue[]"><option value="' + val + '">' + val + '</option></select> <a href="javascript:void(0);" class="remove_field">Remove</a></div>'); It causes my add more fields to stop working.
  11. Having issue having it output in my script. I can have it display outside the wrapper and I can have it display without the <input type="hidden" id="jobdata" value='<?=$jobqueue?>'> but how can I get it to show in the wrapper? This is currently in the wrapper: <select id="jobqueue" name="input_array_queue[]"></select> $(document).ready(function() { var max_fields = 10; //Maximum allowed input fields var wrapper = $(".wrapper"); //Input fields wrapper var add_button = $(".add_fields"); //Add button class or ID var x = 1; //Initlal input field is set to 1 var select = $('#jobqueue'); //request the JSON data and parse into the select element var data = JSON.parse($("#jobdata").val()) //clear the current content of the select select.html(''); //iterate over the data and append a select option $.each(data, function(key, val){ select.append('<option id="' + val + '">' + val + '</option>'); }) //When user click on add input button $(add_button).click(function(e){ e.preventDefault(); //Check maximum allowed input fields if(x < max_fields){ x++; //input field increment //add input field $(wrapper).append('<div><input type="hidden" name="input_array_kuemid[]" value=""/><input type="text" name="input_array_email[]" placeholder="Email Address" /> <input type="text" name="input_array_name[]" placeholder="Email Address Owner" /> <select id="jobqueue" name="input_array_queue[]"></select><a href="javascript:void(0);" class="remove_field">Remove</a></div>'); } }); //when user click on remove button $(wrapper).on("click",".remove_field", function(e){ e.preventDefault(); $(this).parent('div').remove(); //remove inout field x--; //inout field decrement }) });
  12. Thanks maxxd. Yeah I need to sort out my script to enable it in my plugin but first I need to start to sort out the mess I got myself into beginning at the start of this thread which caused the whole issue. Thanks Barand for the start of what I need to do. Only one question though and I know you must think I am an idiot...lol at times I think I am but how would I get: [{"kuqudept":"Tech Support"},{"kuqudept":"AR"},{"kuqudept":"PNI"},{"kuqudept":"Shared"},{"kuqudept":"Mobile"}] To show as this 'Tech Support', 'AR', 'PNI', 'Shared', 'Mobile']
  13. Select not populating with json jobqueue.json file [{"kuqudept":"Tech Support"},{"kuqudept":"AR"},{"kuqudept":"PNI"},{"kuqudept":"Shared"},{"kuqudept":"Mobile"}] php page: <script type="text/JavaScript"> var $select = $('#jobqueue');</code> //request the JSON data and parse into the select element $.getJSON('C:\Ampps\www\wp-content\plugins\kudos\admin\js\jobqueue.json', function(data){ //clear the current content of the select $select.html(''); //iterate over the data and append a select option $.each(data.jobqueue, function(key, val){ $select.append('<option id="' + val.kuqudept + '">' + val.kuqudept + '</option>'); }) }); </script> <select id="jobqueue"></select> C:\Ampps\www\wp-content\plugins\kudos\admin\js\ <- this is going to change once I can figure out how to auto fill this depending on site owners url
  14. And that is did. Thanks requinix $data = $wpdb->get_results("select kuqudept from $tableofname where trim(coalesce(kuqudept, '')) <>''");
  15. That works. Pulled: [{"kuqudept":""},{"kuqudept":""},{"kuqudept":""},{"kuqudept":"Tech Support"},{"kuqudept":"AR"},{"kuqudept":"PNI"}] but now just need to get rid of the empty columns
  16. Trying to to pull data out to echo for json but getting [ ] results function get_queue() { global $wpdb; $tableofname= $wpdb->prefix.'kudos_queue'; $data = $wpdb->get_results("select kuqudept from $tableofname"); $job_array = array(); foreach ($data as $kuque) { if($kuque->kuqudept !=''){ $job_array[] = array ( $job_array => $kuque->kuqudept ); } return json_encode($job_array); } } echo '<pre>'; print_r(get_queue()); echo '</pre>';
  17. Thanks requinix. Googling now how to do this. (confusing as all heck but should be able to figure it out eventually lol)
  18. Trying to add a select drop down that contains php $(wrapper).append('<div><input type="hidden" name="input_array_kuemid[]" value=""/><input type="text" name="input_array_email[]" placeholder="Email Address" /> <input type="text" name="input_array_name[]" placeholder="Email Address Owner" /><select name="input_array_queue[]" size="1"><option selected="selected" value="">Current Job</option><--php mysql output code needs to be here---></select> <a href="javascript:void(0);" class="remove_field">Remove</a></div>'); } }); php code that needs to show <?php $kudoqulist = $wpdb->get_results( "SELECT kuqudept from $tableofname" ); foreach ($kudoqulist as $kuque) { if($kuque->kuqudept !=''){ echo "<option value=" .$kuque->kuqudept. ">" .$kuque->kuqudept. "</option>"; } } ?>
  19. Thanks Barand but I need to ensure I can still use the same email address for another queue in case they want to be notified on multiple queues when email notifications are sent out. ie: email1@account.com Accounting email2@account.com Tech Support email1@account.com Tech Support
  20. Perfect. Thanks Barand works pefectly. foreach($kuemname as $emkey=>$value){ $kudoemcheck = $wpdb->get_results( "SELECT * from $tableemname where kuemaddy='$kuemaddy[$emkey]' and kuemqueue='$kuemqueue[$emkey]'" ); $rowcount = $wpdb->num_rows; if ($rowcount > 0) { echo $kuemaddy[$emkey]. " with " .$kuemqueue[$emkey]. " already exists<br/>"; } else { echo "insert stuff here"; }
  21. Trying to check if if entries exist before inserting database. This is what I have so far: $kuemname = isset($_POST['input_array_name']) ? $_POST['input_array_name'] : "" ; $kuemaddy = isset($_POST['input_array_email']) ? $_POST['input_array_email'] : "" ; $kuemqueue = isset($_POST['input_array_queue']) ? $_POST['input_array_queue'] : "" ; foreach($kuemname as $emkey=>$value){ $kudoemcheck = $wpdb->get_results( "SELECT * from $tableemname where kuemaddy='$kuemaddy[$emkey]' and kuemqueue='$kuemqueue[$emkey]'" ); } $rowcount = $wpdb->num_rows; if ($rowcount > 0) { echo $kuemaddy[$emkey]. " with " .$kuemqueue[$emkey]. " already exists<br/>"; } else { echo "insert stuff here"; } So what I am trying to do is for example: email@account.com Helpdesk - Exists email2@account.com Accounting - Not exists email3@account.com Tech Support - Exists The one that exists will echo that those entries exist while the one does not exist will insert in to database and states entry entered in to database. So far I can get the last one in the list to say it does not exist but unsure how to display both or more stating exists and how to get the one that does not exist to insert in to database.
  22. I have gotten the textarea entry to work but yeah Barand I am going to need to change over to separate fields and use jquery to do the code as I need an extra field per row to be inserted.
  23. Not sure if possible, been doing a google search to try to find the answer. If somebody can directly me to location where I can figure out how to do this if it is possible. What I am trying to do is pull information from a text area and each line inserts in to separate row in mysql. ex textarea contains: email1@email.tld email2@email.tld email3@email.tld I am trying to figure out how to put each address in to separate row in table.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.