Jump to content

SkyRanger

Members
  • Content Count

    700
  • Joined

  • Last visited

Everything posted by SkyRanger

  1. All I can say they are happy with what is done so far and now I have another company thanks to an idiot friend...lol that would like a copy also which is the reason I am trying to get the permalink issue resolved. Almost have them talked into using the Post Name Permalink as right now they are using plain which is causing a nightmare with what I currently have coded.
  2. 2 reasons. One is I am an idiot for not doing it that way and was too far in to the plugin to redo (possible next version if I can talk the company I work for to go that route). They also wanted to keep the entries in a separate table for ease of transfer to another site later down the road (previous guy who wrote the kudos program back in 2014 for tham also last time WordPress was updated, provided no way to update so they wanted stand alone plugin that can also me modified down the road for use on a stand alone site if needed.
  3. Might not have been one if I would have typed and copied it in properly. The whole plugin is separate from posttype. Own database tables for settings and entries. User role access only pages etc.
  4. Thanks maxxd, except for the parse error under the $rules = array_merge thank you. It looks like there may be an issue with my code in the end as I am unable to get it to work properly on my end. More than likely it is something I have done so will just need to see what I have done wrong. Thank you for all your assistance thus far.
  5. Little farther ahead almost got it working but not sure how to get the var to work properly to only show the kudokey entry only and not the full list of kudos. This is what I have so far: add_action( 'init', 'add_kudoskey_rule' ); function add_kudoskey_rule() { add_rewrite_rule( '^kudos/(.+)/?$', 'index.php?kudokey=$matches[1]', 'top' ); } add_filter('query_vars', 'kudos_plugin_query_vars'); function kudos_plugin_query_vars($vars) { $vars[] = 'kudokey'; return $vars; } Current URL: echo '<a target=blank href=' .get_permalink( get_page_by_title( 'kudos' ) ). '?kudokey=' .$kudokey. '>View Kudo</a>'; http://127.0.0.1/?kudokey=JFMGTTQ5 That link will show the kudokey post but when I use the URL rewrite: this link http://127.0.0.1/?page_id=142?kudokey=JFMGTTQ5 it shows all entries.
  6. Hi maxxd yes I did thank you. Actually have it open and have been reading it over and starting to figure out the premises behind it. Confused but slowly starting to understand it but. This needs to go in to my plugin functions file and somehow this is suppose to make : href= ". get_permalink( get_page_by_path( '$kudopagename' ) ) . "?kudokey=" .$kudokey .">View Kudo work with any permalink chosen ie: plain function custom_rewrite_kudos() { add_rewrite_rule('^kudos/([0-9]+)/?', 'index.php?page_id=$matches[1]', 'top'); add_rewrite_tag('%kudokey%', '([^&]+)'); } add_action('init', 'custom_rewrite_kudos');
  7. Due to being VERY new to coding wordpress plugins, was wondering if somebody could point me in a direction to learn more about rewrites (actually looking for example) so I can properly learn how to do it. I do know I need something along this line: (.?.+?)?(:/([0-9]+))?/?$ to ensure that a permalink will work properly in my plugin when a site owner chooses a permalink option in settings. Right now the link /kudos/?kudoid= but need to figure out how to make it change from post name to plain and back when the permalink is changed in wordpress so the ?kudoid= will continue working.
  8. Right now I am coding it to work with $_GET urlid so the link right now would go http://127.0.0.1/kudos/?urlid=randomcode but if I change it to http://127.0.0.1/?p=123 the ?urlid will not work after but the ?p=123&urlid=randomcode does The issue that I am running into is right now is that permalink is set to post name. Trying to sort out how to fix it if somebody else is running plain. The ? will work in post name but not plain.
  9. Could not edit post as took to long check on a piece of code that I thought might work. I thought maybe str_replace would work but unsure how I would get it to recognize the permalink to have it work.
  10. Run into an issue with links and permlink. The issue I am having is depending on the permalink setting: if link is http://url.com/kudos/?urlid=abc123 and the permalink gets changed http://url.com/?p123 how would i get the ?urlid=abc123 to change to &urlid=abc123 as the same time. I am currently using: get_permalink( get_page_by_path( 'kudos' ) );
  11. Found the issue. Might have helped if I actually enabled the capability on the role for it to work.
  12. Sorry requinix. Forgot to add the result of that. I get "You can not be here" for all roles.
  13. 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"; }
  14. 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.
  15. 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.
  16. 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.
  17. 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>
  18. 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.
  19. 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>"; }
  20. 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.
  21. 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.
  22. 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.
  23. 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 }) });
  24. 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']
×
×
  • 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.