Jump to content

SkyRanger

Members
  • Content Count

    727
  • Joined

  • Last visited

Everything posted by SkyRanger

  1. 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']
  2. 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
  3. And that is did. Thanks requinix $data = $wpdb->get_results("select kuqudept from $tableofname where trim(coalesce(kuqudept, '')) <>''");
  4. That works. Pulled: [{"kuqudept":""},{"kuqudept":""},{"kuqudept":""},{"kuqudept":"Tech Support"},{"kuqudept":"AR"},{"kuqudept":"PNI"}] but now just need to get rid of the empty columns
  5. 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>';
  6. Thanks requinix. Googling now how to do this. (confusing as all heck but should be able to figure it out eventually lol)
  7. 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>"; } } ?>
  8. 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
  9. 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"; }
  10. 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.
  11. 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.
  12. Perfect thanks maxxd
  13. 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.
  14. Thanks maxxd, yeah I heard a lot of nightmares about the $)_REQUEST plan on used the $_POST method. Thinking I will take another stab at it tomorrow with fresh eyes. Been working on this plugin for the past 14hrs so far just today (going on 12 days straight) (honestly can't wait to be done...lol). Tonight's mission is to finish reading how all this works and learning how I messed it up so I can fight with it another day. You have informed me a lot on how it works which is greatly appreciated. Go enjoy your wine...lol, I am going for another beer.
  15. omg maxxd no that is perfect you never missed anything. After pulling my code apart (past 24 hrs) and starting to see some of the errors that might be happening. I am running codelobster which i like and loading up the edit file guess I was a little tired when I coded that and found a few errors. Will post update once I do a little more studying on ajax and wordpress and try to figure out the error in my ways (Getting close to finally finishing this plugin at 80% mark) just need to sort out edit part and another section in the admin so thanks for your assistance so far. Had come in handy having another set of eyes.
  16. Just a heads up this is my first try at a plugin for wordpress. I have done some research on the form ajax jquery and ended up changing the action to: <?php echo admin_url('admin-ajax.php'); ?> and adding <input type="hidden" name="action" value="acikudos_ajax_handler"> to my form but now instead of just a blank white page I get a blank white page with a 0 on it and not submitting form. ps: if this is now suppose to be in javascript can a mod or admin please move it over.
  17. After hours of beating head off desk and not being able to figure out what is going on I scrapped most of the code and expanded with more functions with doing some reason online with some examples and trying to implement them in to my own code. So first sorry if this is the wrong area for this, i am getting the error in the acikudos-update.php script and I can not figure out why: acikudo-plugin.php function acikudos_enqueue_script() { wp_enqueue_script( 'acikudos', plugins_url( ACI_KUDOS_URL.'/js/kudoform.js', __FILE__ ), // URL path relative to the folder of the PHP script this code is placed in array( 'jquery' ) // Requires jQuery, make sure it's loaded first ); wp_localize_script( 'acikudos', // Name of script, from above 'acikudos', // Name of JavaScript variable array( 'ajaxUrl' => admin_url( 'admin-ajax.php' ), ) ); } add_action( 'wp_enqueue_scripts', 'acikudos_enqueue_script' ); acikudos-edit.php (this works) $kudoacct = $_GET['acct']; $tablename=acikudos_table_name(); $editkudos = $wpdb->get_results( "SELECT * FROM $tablename WHERE kudoacct = '$kudoacct'"); foreach ( $editkudos as $editkudo ) { ?> <form name="acikudos-update" id="acikudos-update" method="post" action="<?php echo plugins_url( 'advantage-kudos/include/acikudos-update.php' ); ?>" enctype="multipart/form-data"> <table> <tr> <td>Agent Name</td> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td> <td><input name="kudoagent" type="text" value="<?php echo $editkudo->kudoagent; ?>" /></td> </tr> <tr> <td>Agent ID</td> <td></td> <td><input name="kudoagentid" type="text" value="<?php echo $editkudo->kudoagid; ?>" /></td> </tr> <tr> <td>Agent Location</td> <td></td> <td><select name="agentloc" size="1"> <option value="<?php echo $editkudo->kudoloc; ?>"><?php echo $editkudo->kudoloc; ?></option> <option value="Amherst Center">Amherst Center</option> <option value="Charlottetown Center">Charlottetown Center</option> <option value="Kingston Center">Kingston Center</option> </select></td> </tr> <tr> <td>Agent Queue</td> <td></td> <td><select name="kudoclient" size="1"> <option value="<?php echo $editkudo->kudoclient; ?>"><?php echo $editkudo->kudoclient; ?>"</option> <option value="AR">AR</option> <option value="Eastlink Tech Support">Eastlink Tech Support</option> <option value="PNI">PNI</option> </select></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> <tr> <td>Customer Name</td> <td></td> <td><input name="kudocust" type="text" value="<?php echo $editkudo->kudocust; ?>"/></td> </tr> <tr> <td>Customer Account #</td> <td></td> <td><input name="kudoacct" type="text" value=" <?php echo $kudoacct; ?>" /></td> </tr> <tr> <td>Kudos</td> <td></td> <td><textarea cols="50" name="kudomsg" rows="5"><?php echo $editkudo->kudomsg; ?></textarea></td> </tr> <tr> <td><input type="hidden" value="<?php echo $editkudo->kudoid; ?>" name="kudoid"></td> <td></td> <td></td> </tr> <tr> <td><button type="submit" value="update" class="aciformbutton" name="submit" />Update Kudos</button> <td></td> <td><button type="reset" value="reset" class="aciformbutton">Start Over</button></td> </tr> </table> </form> <?php } acikudos-update.php (here is the problem) Fatal error: Uncaught Error: Call to undefined function add_action() in C:\Program Files (x86)\Ampps\www\wp-content\plugins\advantage-kudos\include\acikudos-update.php on line 112 Error: Call to undefined function add_action() in C:\Program Files (x86)\Ampps\www\wp-content\plugins\advantage-kudos\include\acikudos-update.php on line 112 /** * Handle the request and return the result. */ function acikudos_process_request() { global $wpdb; $errors = array(); // array to hold validation errors $data = array(); // array to pass back data /*Ensure no fields are empty, and if they are, return $errors array encoded in JSON */ if (empty($_POST['kudoagent'])) $errors['kudoagent'] = 'Agent Name is required.'; if (empty($_POST['kudoagentid'])) $errors['kudoagentid'] = 'Agent ID is required.'; if (empty($_POST['agentloc'])) $errors['agentloc'] = 'Agent Location is required.'; if (empty($_POST['kudoclient'])) $errors['kudoclient'] = 'Agent Queue is required.'; if (empty($_POST['kudocust'])) $errors['kudocust'] = 'Customer Name is required.'; if (empty($_POST['kudoacct'])) $errors['kudoacct'] = 'Customer Account # is required'; if (empty($_POST['kudomsg'])) $errors['kudomsg'] = 'Kudo Messge is required'; if (empty($_POST['kudoid'])) $errors['kudoid'] = 'If you see this message contact Intranet Admin or Supervisor with date of posting kudos, tech agents name and your name'; // return a response =========================================================== // if there are any errors in our errors array, return a success boolean of false if ( ! empty($errors)) { // if there are items in our errors array, return those errors $data['success'] = false; $data['errors'] = $errors; } else { // if there are no errors process our form, then return a message /* Set the proper table name to a variable */ $kudotable=acikudos_table_name(); #$table_name = acikudos_table_name(); if (isset($_POST['create'])) { $kudomsg = $_POST['kudomsg']; $kudoagent = $_POST['kudoagent']; $kudoagid = $_POST['kudoagentid']; $kudocust = $_POST['kudocust']; $kudoacct = $_POST['kudoacct']; $kudoclient = $_POST['kudoclient']; $kudoloc = $_POST['agentloc']; $kudoid = $_POST['kudoid']; $wpdb->update( $kudotable, array( 'kudomsg' => $kudomsg, 'kudoagent' => $kudoagent, 'kudoagid' => $kudoagid, 'kudocust' => $kudocust, 'kudoacct' => $kudoacct, 'kudoclient' => $kudoclient, 'kudoloc' => $kudoloc ), array('kudoid' => $kudoid), array( '%s', '%s', '%s', '%s', '%s', '%s', '%s' ), array( '%d' ) ); } // show a message of success and provide a true success variable $data['success'] = true; $data['message'] = 'Success!'; } // return all our data to an AJAX call echo json_encode($data); return $data; } /** * AJAX handler for the "ACIKudos" action. */ function acikudos_ajax_handler() { global $wpdb; $data = acikudos_process_request(); header( 'Content-Type: application/json; charset=' . get_bloginfo( 'charset' ) ); echo json_encode( $data ); exit; } add_action( 'wp_ajax_nopriv_acikudos', 'acikudos_ajax_handler' ); <--- Line 112 add_action( 'wp_ajax_acikudos', 'acikudos_ajax_handler' ); kudoform.js file !function( $ ) { // Self-executing function closure, will ensure $ is jQuery - might be running in noConflict mode $( document ).ready( function() { $( "#acikudos-update" ).submit( // Don't bind to all forms, just ours function ( event ) { event.preventDefault(); $('.form-group').removeClass('has-error'); // remove the error class $('.help-block').remove(); // remove the error text var data = $( this ).serializeArray(); // Will automatically grab all form fields and data data.push({ name : "create", value: "1" }); data.push({ name : "action", value: "acikudos" // This parameter needs to match the wp_ajax_* hook. }); $.post( acikudos.ajaxUrl, // Use our JavaScript variable "acikudos" we defined in wp_localize_script() data, // POST data function ( data ) { // Your form handling } ); } ) } ); }( jQuery );
  18. Stripped out the permission section of the script until I get the update issue resolved. Here is the full page: function kudos_edit_new() { global $userdata, $current_user, $wpdb; wp_get_current_user(); //start of update if(isset($_POST['submit'])) { global $wpdb; $tablename=acikudos_table_name(); $kudotable = $tablename; $kudomsg = $_POST['kudomsg']; $kudoagent = $_POST['kudoagent']; $kudoagid = $_POST['kudoagentid']; $kudocust = $_POST['kudocust']; $kudoacct = $_POST['kudoacct']; $kudoclient = $_POST['kudoclient']; $kudoloc = $_POST['agentloc']; $kudoid = $_POST['kudoid']; $wpdb->update( $kudotable, array( 'kudomsg' => $kudomsg, 'kudoagent' => $kudoagent, 'kudoagid' => $kudoagid, 'kudocust' => $kudocust, 'kudoacct' => $kudoacct, 'kudoclient' => $kudoclient, 'kudoloc' => $kudoloc ), array('kudoid' => $kudoid), array( '%s', '%s', '%s', '%s', '%s', '%s', '%s' ), array( '%d' ) ); $lastsql = $wpdb->last_query; echo $lastsql; echo "<br />Kudos Updated"; } else { echo "Something went really wrong"; } //end of update $kudoacct = $_GET['acct']; $tablename=acikudos_table_name(); $editkudos = $wpdb->get_results( "SELECT * FROM $tablename WHERE kudoacct = '$kudoacct'"); foreach ( $editkudos as $editkudo ) { ?> <form name="acikudos_form_update" id="updatekudos" method="post" action="" enctype="multipart/form-data"> <table> <tr> <td>Agent Name</td> <td> </td> <td><input name="kudoagent" type="text" value="<?php echo $editkudo->kudoagent; ?>" /></td> </tr> <tr> <td>Agent ID</td> <td></td> <td><input name="kudoagentid" type="text" value="<?php echo $editkudo->kudoagid; ?>" /></td> </tr> <tr> <td>Agent Location</td> <td></td> <td><select name="agentloc" size="1"> <option value="<?php echo $editkudo->kudoloc; ?>"><?php echo $editkudo->kudoloc; ?></option> <option value="Amherst Center">Amherst Center</option> <option value="Charlottetown Center">Charlottetown Center</option> <option value="Kingston Center">Kingston Center</option> </select></td> </tr> <tr> <td>Agent Queue</td> <td></td> <td><select name="kudoclient" size="1"> <option value="<?php echo $editkudo->kudoclient; ?>"><?php echo $editkudo->kudoclient; ?>"</option> <option value="AR">AR</option> <option value="Tech Support">Tech Support</option> <option value="PNI">PNI</option> </select></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> <tr> <td>Customer Name</td> <td></td> <td><input name="kudocust" type="text" value="<?php echo $editkudo->kudocust; ?>"/></td> </tr> <tr> <td>Customer Account #</td> <td></td> <td><input name="kudoacct" type="text" value=" <?php echo $kudoacct; ?>" /></td> </tr> <tr> <td>Kudos</td> <td></td> <td><textarea cols="50" name="kudomsg" rows="5"><?php echo $editkudo->kudomsg; ?></textarea></td> </tr> <tr> <td><input type="hidden" value="<?php echo $editkudo->kudoid; ?>" name="kudoid"></td> <td></td> <td></td> </tr> <tr> <td><button type="submit" value="submit" class="aciformbutton" name="submit" />Update Kudos</button> <td></td> <td><button type="reset" value="reset" class="aciformbutton">Start Over</button></td> </tr> </table> </form> <?php } } This is what I get when I submit: SHOW FULL COLUMNS FROM `wpl2_acikudos` Kudos Updated
  19. I run $wpdb->last_query; but getting SHOW FULL COLUMNS FROM `wpl2_acikudos` instead of the update
  20. Trying to update to database but not updating an not getting any errors. The info is posting but not sure why not updating. if (!empty($_POST)) { global $wpdb; $table = $tablename; $kudomsg = $_POST['kudomsg']; $kudoagent = $_POST['kudoagent']; $kudoagid = $_POST['kudoagentid']; $kudocust = $_POST['kudocust']; $kudoacct = $_POST['kudoacct']; $kudoclient = $_POST['kudoclient']; $kudoloc = $_POST['agentloc']; $data = array( 'kudomsg' => $kudomsg, 'kudoagent' => $kudoagent, 'kudoagid' => $kudoagid, 'kudocust' => $kudocust, 'kudoacct' => $kudoacct, 'kudoclient' => $kudoclient, 'kudoloc' => $kudoloc ); $where = array('kudoid' => $_POST['kudoid']); $success=$wpdb->update($table , $data, $where); if($success){ echo "Kudos has been updated. Go to Kudos page to view"; echo "<br /><a href='" .$kudourl."'>Close</a>"; } } else { $kudoacct = $_GET['acct']; $tablename=acikudos_table_name(); $editkudos = $wpdb->get_results( "SELECT * FROM $tablename WHERE kudoacct = '$kudoacct'"); foreach ( $editkudos as $editkudo ) { ?> <form name="acikudos_form" id="updatekudos" method="post" action="" enctype="multipart/form-data"> <table> <tr> <td>Agent Name</td> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td> <td><input name="kudoagent" type="text" value="<?php echo $editkudo->kudoagent; ?>" /></td> </tr> <tr> <td>Agent ID</td> <td></td> <td><input name="kudoagentid" type="text" value="<?php echo $editkudo->kudoagid; ?>" /></td> </tr> <tr> <td>Agent Location</td> <td></td> <td><select name="agentloc" size="1"> <option value="<?php echo $editkudo->kudoloc; ?>"><?php echo $editkudo->kudoloc; ?></option> <option value="Amherst Center">Amherst Center</option> <option value="Charlottetown Center">Charlottetown Center</option> <option value="Kingston Center">Kingston Center</option> </select></td> </tr> <tr> <td>Agent Queue</td> <td></td> <td><select name="kudoclient" size="1"> <option value="<?php echo $editkudo->kudoclient; ?>"><?php echo $editkudo->kudoclient; ?>"</option> <option value="AR">AR</option> <option value="Eastlink Tech Support">Eastlink Tech Support</option> <option value="PNI">PNI</option> </select></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> <tr> <td>Customer Name</td> <td></td> <td><input name="kudocust" type="text" value="<?php echo $editkudo->kudocust; ?>"/></td> </tr> <tr> <td>Customer Account #</td> <td></td> <td><input name="kudoacct" type="text" value=" <?php echo $kudoacct; ?>" /></td> </tr> <tr> <td>Kudos</td> <td></td> <td><textarea cols="50" name="kudomsg" rows="5"><?php echo $editkudo->kudomsg; ?></textarea></td> </tr> <tr> <td><input type="hidden" value="<?php echo $editkudo->kudoid; ?>" name="kudoid"></td> <td></td> <td></td> </tr> <tr> <td><button type="submit" value="sendkudos" class="aciformbutton" name="sendkudos" />Update Kudos</button> <td></td> <td><button type="reset" value="reset" class="aciformbutton">Start Over</button></td> </tr> </table> </form>
  21. This is off the original topic I started but I am running in to a new issue. "Update" I can post and delete but having a problem updating. I am getting no errors showing just white screen. I have verified that everything is posting but the database is not updating for some reason. Not sure if it is late and I am not seeing straight or I actually messed something up that I can not see yes I probably could have put the _POST in the array but they are outside for testing purposes.: if (!empty($_POST)) { global $wpdb; $table = $tablename; $kudomsg = $_POST['kudomsg']; $kudoagent = $_POST['kudoagent']; $kudoagid = $_POST['kudoagentid']; $kudocust = $_POST['kudocust']; $kudoacct = $_POST['kudoacct']; $kudoclient = $_POST['kudoclient']; $kudoloc = $_POST['agentloc']; $data = array( 'kudomsg' => $kudomsg, 'kudoagent' => $kudoagent, 'kudoagid' => $kudoagid, 'kudocust' => $kudocust, 'kudoacct' => $kudoacct, 'kudoclient' => $kudoclient, 'kudoloc' => $kudoloc ); $where = array('kudoid' => $_POST['kudoid']); $success=$wpdb->update($table , $data, $where); if($success){ echo "Kudos has been updated. Go to Kudos page to view"; echo "<br /><a href='" .$kudourl."'>Close</a>"; } } else { $kudoacct = $_GET['acct']; $tablename=acikudos_table_name(); $editkudos = $wpdb->get_results( "SELECT * FROM $tablename WHERE kudoacct = '$kudoacct'"); foreach ( $editkudos as $editkudo ) { ?> <form name="acikudos_form" id="updatekudos" method="post" action="" enctype="multipart/form-data"> <table> <tr> <td>Agent Name</td> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td> <td><input name="kudoagent" type="text" value="<?php echo $editkudo->kudoagent; ?>" /></td> </tr> <tr> <td>Agent ID</td> <td></td> <td><input name="kudoagentid" type="text" value="<?php echo $editkudo->kudoagid; ?>" /></td> </tr> <tr> <td>Agent Location</td> <td></td> <td><select name="agentloc" size="1"> <option value="<?php echo $editkudo->kudoloc; ?>"><?php echo $editkudo->kudoloc; ?></option> <option value="Amherst Center">Amherst Center</option> <option value="Charlottetown Center">Charlottetown Center</option> <option value="Kingston Center">Kingston Center</option> </select></td> </tr> <tr> <td>Agent Queue</td> <td></td> <td><select name="kudoclient" size="1"> <option value="<?php echo $editkudo->kudoclient; ?>"><?php echo $editkudo->kudoclient; ?>"</option> <option value="AR">AR</option> <option value="Eastlink Tech Support">Eastlink Tech Support</option> <option value="PNI">PNI</option> </select></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> <tr> <td>Customer Name</td> <td></td> <td><input name="kudocust" type="text" value="<?php echo $editkudo->kudocust; ?>"/></td> </tr> <tr> <td>Customer Account #</td> <td></td> <td><input name="kudoacct" type="text" value=" <?php echo $kudoacct; ?>" /></td> </tr> <tr> <td>Kudos</td> <td></td> <td><textarea cols="50" name="kudomsg" rows="5"><?php echo $editkudo->kudomsg; ?></textarea></td> </tr> <tr> <td><input type="hidden" value="<?php echo $editkudo->kudoid; ?>" name="kudoid"></td> <td></td> <td></td> </tr> <tr> <td><button type="submit" value="sendkudos" class="aciformbutton" name="sendkudos" />Update Kudos</button> <td></td> <td><button type="reset" value="reset" class="aciformbutton">Start Over</button></td> </tr> </table> </form> This is a list of my columns kudoid kudomsg kudoagent kudoagid kudocust kudoacct kudoclient kudoloc kudoentry kudoadmin kudopic kudostatus
  22. Honestly maxxd never even thought of going that route. Thank you that fixed the problem. ref the error reporting. the wp_debug is on which is allowing me to catch most errors that are happening (which is lots..lol) but some are still slipping through. I might just go back to the error_reporting as I am use to that. This is my first time making a plugin for wordpress so still learning, thank you for your help.
  23. Here is the issue I am having, as you see with the above code I got part of what I need done. What the problem I am having now is: if $url with ?viewkudoid=XX - This works to show the kudo with the id of whatever if $url without the $?viewkudoid - This works to show all the kudos if $url with ?viewkudoid= (without the xx) - This shows a blank page without even a page title (wordpress) I have part 1 and 2 working, now sure how to implement 3. Any help would be greatly appreciated.
  24. Getting closed got everything working but the $viewkudosid=(blank) getting blank page with no errors. Trying to figure out where to have it echo No Kudos in Database $actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $url = $actual_link; if (strpos($url, "?viewkudoid")!==false){ $viewkudoid = $_GET['viewkudoid']; $tablename=acikudos_table_name(); $showkudos = $wpdb->get_results( "SELECT * FROM $tablename WHERE kudoid = '$viewkudoid'"); foreach ( $showkudos as $kudo ) { echo "<blockquote class=\"otro-blockquote\">"; echo $kudo->kudomsg; echo "<span>"; echo "<b>Kudos for:</b> " .$kudo->kudoagent. ", " .$kudo->kudoloc; echo "<br>By: ".$kudo->kudocust. ", " . date("F j, Y g:i a", strtotime($kudo->kudoentry));; echo "</span></blockquote>"; } } else { $tablename=acikudos_table_name(); $showkudosall = $wpdb->get_results( "SELECT * FROM $tablename order by kudoentry desc"); foreach ( $showkudosall as $allkudo) { echo "<blockquote class=\"otro-blockquote\">"; echo $allkudo->kudomsg; echo "<span>"; echo "<b>Kudos for:</b> " .$allkudo->kudoagent. ", " .$allkudo->kudoloc; echo "<br>By: ".$allkudo->kudocust. ", " . date("F j, Y g:i a", strtotime($allkudo->kudoentry));; echo "</span></blockquote>"; echo "<hr>"; } } }
×
×
  • 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.