Bloke
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Put result of array to databaseOk this is what I have so far. It will enter each record but it will not enter the prod_order for each line.
$getem = $wpdb->get_row("SELECT * FROM category_assoc WHERE prod_id = '$lastID'"); $prodorder = $getem->prod_order; if($edit) for($i= 0; $i < count($cats); $i++) { $catCategory = "INSERT INTO category_assoc (prod_id, cat_id, prod_order) VALUES('$lastID', '". $cats[$i] . "', '".$prodorder."')"; $wpdb->query($catCategory); }Forum: Fixing WordPress
In reply to: Enable compressionYes I am assuming its not installed. After reading some more, it should be listed as an available module to install. I know my server is really outdated. Since its a dedicated server I will have to search on help forum at the hosting company.
Forum: Fixing WordPress
In reply to: Using Ajax to send IDFinally got it working. At least this part of my project. The missing part was the “action”. It was posting the ID but didn’t know where to send it. Then I saw this simple-ajax-example tutorial sending a variable via Ajax and then printing it. I compared what was being done. Viewed the result in Firebug. Then inside a PHP function “example_ajax_request” I retrieved the ID and ran the query inside this function. All I needed was a simple example to figure how it works.
$("select#category").change(function(){ $("select#type").attr("disabled","disabled"); $("select#type").html("<option>wait...</option>"); jQuery.ajax({ type: 'POST', url: ajaxurl, data: {action:"example_ajax_request",id: $(this).val() }, success:function(data){ $("select#type").removeAttr("disabled"); $("select#type").html(data); } }); }); });Forum: Fixing WordPress
In reply to: Using Ajax to send IDGot this part to work. It sends the post with the ID but I can’t receive it and process it.
<script type="text/javascript"> jQuery(document).ready(function() { $("select#category").change(function(){ $("select#type").attr("disabled","disabled"); $("select#type").html("<option>wait...</option>"); jQuery.ajax({ type: 'POST', url: ajaxurl, data: {id: $(this).val() }, success:function(data){ $("select#type").removeAttr("disabled").html(data); } }); }); }); </script>Forum: Fixing WordPress
In reply to: How to add ajaxurlIt worked! Thanks. But what should show in ‘display’?
function view_site_description(){ echo get_bloginfo( 'description', 'display' ); die(); }function view_site_description(){ echo get_bloginfo( 'description', 'display' ); die(); }Forum: Fixing WordPress
In reply to: How to add ajaxurlThat is what I was thinking. In the exmaple they didn’t use that. How would that look?
Forum: Fixing WordPress
In reply to: How to add ajaxurlLooking above is is included correctly? I am loading them in my theme’s functions file.
Forum: Fixing WordPress
In reply to: How to add ajaxurlNo its only local version. This is what I am doing. Only 3 functions. /wp/wp_ajax
Forum: Fixing WordPress
In reply to: How to add ajaxurljQuery('#view_site_description').click(function(){
Nothing happens. Looking in Firebug I don’t see any events triggered.Forum: Fixing WordPress
In reply to: How to add ajaxurlfunction add_ajaxurl_cdata_to_front(){ ?> <script type="text/javascript"> //<![CDATA[ ajaxurl = '<?php echo admin_url( 'admin-ajax.php'); ?>'; //]]> </script> <?php } add_action( 'wp_head', 'add_ajaxurl_cdata_to_front', 1); add_action( 'wp_footer', 'add_js_to_wp_footer' ); function add_js_to_wp_footer(){ ?> <script type="text/javascript"> jQuery('#view_site_description').click(function(){ jQuery.ajax({ type: 'POST', url: ajaxurl, data: {"action": "view_site_description"}, success: function(data){alert(data);} }); return false; }); </script> <?php } function view_site_description(){ echo get_bloginfo( 'description', 'display' ); die(); } add_action( 'wp_ajax_view_site_description', 'view_site_description' ); add_action( 'wp_ajax_nopriv_view_site_description', 'view_site_description' );Forum: Fixing WordPress
In reply to: Chained select with jqueryI think it is because I was not using admin-ajax URL. I am working on adding that to get it to work.
Forum: Fixing WordPress
In reply to: Chained select with jqueryI looked at some of my other scripts on my WordPress sites and saw they used jQuery(‘select…… instead of $(“select……
So I changed all the instances of $ and still not working.Forum: Plugins
In reply to: [WP eCommerce] Hiding pagination in shortcodeI was able to put ‘tag’ => ‘tag name here’,
and it displayed just the products with that tag but is there a way to accomplish like above without using tags?Forum: Fixing WordPress
In reply to: Chained select with jqueryWell I am stumped. I cannot get it to retrieve that ID. Its only 3 files. If anyone can copy and paste this code in WordPress and get it to work let me know. how-to-create-chained-select-with-php-and-jquery/
Forum: Fixing WordPress
In reply to: Chained select with jqueryI changed the function ShowType()to included
$id = $_POST[id];But still its not receiving the ID. Getting this warning: Notice: Undefined index: id