Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by SkyRanger

  1. Thank you guys. It was me who did a stupid and not watching what I was typing. Thanks for your help it is working perfectly now.
  2. echo "<table>"; echo "<form name='FormData' method='post' action=''>"; echo "<thead><th>Name</th><th>Email</th><th> <button type='submit' value='kudoemaildelete' class='formbutton' name='kudoemaildelete' />Delete</button> </th></thead>"; $kudolistem = $wpdb->get_results( "SELECT * from $tableemname where kuemqueue = '$kemail->kuemqueue'" ); foreach ($kudolistem as $kudosndem) { $kuemid = $kudosndem->kuemid; echo "<tr>"; echo "<td>" .$kudosndem->kuemname. " </td><td>" .$kudosndem->kuemaddy. "</td><td><center><input name='kuemid[]' type='checkbox' id='checkbox[]' value=" .$kuemid. "></center></td>"; echo "</tr>"; } echo "</form>"; echo "</table>"; It is probably something so stupid I am missing. I have tried both _POST and _GET
  3. The query is not running. For some reason the page just refreshes and reloads the list with checkboxes. The isset is not being called
  4. Unsure why this is not working debug is showing no issues if (isset($_GET['kudoemaildelete'])) { //data removal code will be going here $kuemid = $_GET['kuemid']; for($i=0;$i<count($kuemid);$i++){ $del_id = $kuemid[$i]; $wpdb->query( 'DELETE FROM '.$wpdb->prefix.'kudos_email WHERE kuemid IN($del_id)' ); $adminurl = get_admin_url(); $redirurl = $adminurl."admin.php?page=kudos"; echo "Removing emails if not returned in 5 seconds <a href=" .$redirurl . ">click here</a>"; # echo("<script>location.href = '".$redirurl."';</script>"); } } else { ?> <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <script> $( function() { $( "#accordion" ).accordion({ collapsible: true }); } ); </script> <table><tr><td width=300px> <?php global $wpdb; $tableemname= $wpdb->prefix.'kudos_email'; $kudoemlist = $wpdb->get_results( "SELECT * from $tableemname group by kuemqueue" ); echo " <div id='accordion'> "; foreach ($kudoemlist as $kemail) { echo "<h3>" .$kemail->kuemqueue. "</h3> <div> <p>"; echo "<table>"; ?> <form name="FormData" method="post" action=""> <?php echo "<thead><th>Name</th><th>Email</th><th> <button type='submit' value='kudoemaildelete' class='formbutton' name='kudoemaildelete' />Delete</button> </th></thead>"; $kudolistem = $wpdb->get_results( "SELECT * from $tableemname where kuemqueue = '$kemail->kuemqueue'" ); foreach ($kudolistem as $kudosndem) { $kuemid = $kudosndem->kuemid; echo "<tr>"; echo "<td>" .$kudosndem->kuemname. " </td><td>" .$kudosndem->kuemaddy. "</td><td><center><input name='kuemid[]' type='checkbox' id='checkbox[]' value=" .$kuemid. "></center></td>"; echo "</tr>"; } echo "</form>"; echo "</table>"; echo "</p> </div>"; } ?> </div> </td></tr></table> <?php }
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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>'; That link will show the kudokey post but when I use the URL rewrite: this link it shows all entries.
  10. 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');
  11. 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.
  12. Right now I am coding it to work with $_GET urlid so the link right now would go but if I change it to 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.
  13. 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.
  14. 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' ) );
  15. Found the issue. Might have helped if I actually enabled the capability on the role for it to work.
  16. Sorry requinix. Forgot to add the result of that. I get "You can not be here" for all roles.
  17. 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"; }
  18. 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.
  19. 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.
  20. 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.
  21. 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>
  22. 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.
  23. 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>"; }
  24. 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.
  25. 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.
  • 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.