Search Results

Search found 24 results on 1 pages for 'shortcode'.

Page 1/1 | 1 

  • Make a shortcode echo in the middle of an URL in HREF

    - by Liso22
    The shortcode [mmjs-city] echoes the city the user is in. I want to make a link that takes the user to a results page with the user's city as search term. Basically the URL should be the results page URL + the result of the shortcode (the city). I tried to write it this way: Search for your city Normally I would just use PHP and assign the city to a value but I'm in a page not the theme and PHP doesn't work on pages for some reason, most likely It's possible but I don't know how. Anyway, anybody knows how could I do it? Thanks and merry christmas

    Read the article

  • wpautop() - when shortcode attributes are on new lines -breaks args array

    - by Luca
    I have a custom shortcode tag with a few attributes, and I would like to be able to display its attributes on new lines - to make it more readable to content editors: [component attr1 ="value1" attr2 ="value of the second one" attr3 ="another" attr4 ="value" ... attrN ="valueN"] The reason behind this requirement is that a few attributes might be quite verbose in content. Unfortunately, wpautop() adds some nasty extra markup that breaks the args array like this (using php print_r($args)): Array ( [0] => attr1 [1] => ="value1" /> [3] => attr2 = [4] => "value [5] => of [6] => the [7] => second [8] => one" /> [10] => "" //...and more like this) I've tried with the attributes inline: [component attr1 ="value1" attr2 ="value of the second one" ="value"... attrN ="valueN"] and the output is as expected: Array ( [attr1] => value1 [attr2] => value of the second one [attr3] => //...and so on) is there any way to have the attributes intented and avoid that extra markup that breaks the $args array?

    Read the article

  • Wordpress Shortcode in Theme, Trying to use Gallery

    - by Akash Kava
    We are using SuperSlidShow Plugin to display gallery of images in our post. However when I write shortcode [gallery] in my post/page images appear correctly, but can anyone guide me if I want to fix this [gallery] shortcode in the theme itself like page.php/post.php so that images will appear on all pages. We have images for every page/post.

    Read the article

  • Database locking: ActiveRecord + Heroku

    - by JP
    I'm building a Sinatra based app for deployment on Heroku. You can imagine it like a standard URL shortener but where old shortcodes expire and become available for new URLs (I realise this is a silly concept but its easier to explain this way). I'm representing the shortcode in my database as an integer and redefining its reader to give a nice short and unique string from the integer. As some rows will be deleted, I've written code that goes thru all the shortcode integers and picks the first free one to use just before_save. Unfortunately I can make my code create two rows with identical shortcode integers if I run two instances very quickly one after another, which is obviously no good! How should I implement a locking system so that I can quickly save my record with a unique shortcode integer? Here's what I have so far: Chars = ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a CharLength = Chars.length class Shorts < ActiveRecord::Base before_save :gen_shortcode after_save :done_shortcode def shortcode i = read_attribute(:shortcode).to_i return '0' if i == 0 s = '' while i > 0 s << Chars[i.modulo(CharLength)] i /= 62 end s end private def gen_shortcode shortcode = 0 self.class.find(:all,:order=>"shortcode ASC").each do |s| if s.read_attribute(:shortcode).to_i != shortcode # Begin locking? break end shortcode += 1 end write_attribute(:shortcode,shortcode) end def done_shortcode # End Locking? end end

    Read the article

  • WordPress: Problem with the shortcode regex

    - by peroyomas
    This is the regular expression used for "shortcodes" in WordPress (one for the whole tag, other for the attributes). return '(.?)\[('.$tagregexp.')\b(.*?)(?:(\/))?\](?:(.+?)\[\/\2\])?(.?)'; $pattern = '/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/'; It parses stuff like [foo bar="baz"]content[/foo] or [foo /] In the WordPress trac they say it's a bit flawed, but my main problem is that it don't support shortcodes inside the attributes, like in [foo bar="[baz /]"]content[/foo] because the regex stops the main shortcode at the first appearance of a closing bracket, so in the example it renders [foo bar="[baz /] and "]content[/foo] shows as it is. Is there any way to change the regex so it bypass any ocurrence of [ with ] and its content when occurs between the opening tag or self-closing tag?

    Read the article

  • Shortcodes and Custom Fields

    - by user1429400
    How do I get shortcodes to process properly in custom fields? I've tried using the code below, but I cannot figure out where to place it ("button" is the name of the field): <?php if ( get_post_meta($post->ID, 'button', true) ) echo do_shortcode(get_post_meta($post->ID, 'button', $single = true)); ?> As of now, the shortcode is working in the sense that the button is displaying, but the shortcode text is displaying where the "buy now" button is supposed to be. See screenshot: http://i.imgur.com/41vsr.png

    Read the article

  • Can't make HREF change based on PHP value

    - by Liso22
    I want to retrieve the user's location and then show a link that points to an URL that changes according to that location. I just want to place the user's city name at the end of the HREF. I need this work on my wordpress site, on a static page. I use a plugin called Exec-php which let's me run PHP in pages. I have a plugin that provides me the user's city through the shortcode "[mmjs-city]". I tried to make it work through different paths but I never get the link to work. Here I tried assigning that shortcode to a value, <?php $city= "[mmjs-city]"; echo $city; echo "<a href='?s=" . $city ."'>Search for your city</a>"; ?> I added the first two lines to check whether the shortcode is working or not and if it's correctly assinged to the value $city. That part works. Then it creates the link and put's the value $city at the end of it. But when trying it instead of taking me to: /?s=new+york It takes me to: /?s=%3Cscript%20language=%22javascript%22%3Edocument.write(geoip_city());%3C/script%3E I have no idea what to do. I would be really thankful for any info on how to make it work, it's really an important feature for my site. Please ask for any further info or idk anything. Also this is where I tested that code: http://chusmix.com/?page_id=1129 Thanks

    Read the article

  • why is there different syntax same outcome?

    - by Lizard
    Why is there different syntax same outcome? For example # Example 1 if($myCondition == true) : #my code here endif; if($myCondition == true) { #my code here } # Example 2 foreach($films as $film) : #my code here endforeach; foreach($films as $film) { #my code here } Also I have been using <?= for ages now and i now understand that is deprecated and I should be using <?php echo Is this the case and why? Its alot more annoying to have to write that out each time. What are your thoughts?

    Read the article

  • c# short if statement not working with int? (int=null)

    - by kobe
    I am trying to shorten my code by using short-if: int? myInt=myTextBox.Text == "" ? null : Convert.ToInt32(myTextBox.Text); But I'm getting the following error: Type of conditional expression cannot be determined because there is no implicit conversion between '' and 'int' The following works: int? myInt; if (myTextBox.Text == "") //if no text in the box myInt=null; else myInt=Convert.ToInt32(myTextBox.Text); And if I replace the 'null' in integer (say '4') it also works: int? myInt=myTextBox.Text == "" ? 4: Convert.ToInt32(myTextBox.Text);

    Read the article

  • Linking each text word or words divided by comma into an existing URL?

    - by Mezelderz
    I am trying to auto add each word or words divided by comma into an existing url. I have url lets say http://stackoverflow.com/search?q=HERE IS THAT TEXT. I have this function: function movie_cast( $atts, $content = null ) { return '<div class="movie_cast">Cast: '.$content.'</div>'; } add_shortcode( 'movie_cast', 'movie_cast' ); I am using it: [movie_cast]Actor 1, Actor 2[/movie_cast] Output from this is just text: Actor 1, Actor 2 How can I get otput it like this: <a href="http://stackoverflow.com/search?q=Actor 1">Actor 1</a>, <a href="http://stackoverflow.com/search?q=Actor 2">Actor 2</a>

    Read the article

  • How to remove the xmlns:XSI and xmlns:XSD namespaces from the xml output of a webservice in .net fra

    - by Chetan
    HI, This is an old question, i have seen some solutions on this forum itself, but am trying to use webservices for the first time so please bear with me on this one. I have a webservice that returns XML in the following format <subs xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" msisdn="965xxxxxx"> <shortcode label="XXXX"> <channels> <channel> <id>442</id> <name>News</name> <billingperiod>7</billingperiod> <billingamount>3</billingamount> <lastbilling>4/14/2010 1:41:11 PM</lastbilling> </channel> <channel> <id>443</id> <name>News2</name> <billingperiod>7</billingperiod> <billingamount>3</billingamount> <lastbilling>4/14/2010 1:41:19 PM</lastbilling> </channel> </channels> </shortcode> </subs> I want the same XMl output without the xmlns:xsd and xmlns:xsi tags. I have tried the following solution that was suggested: Public Function GetSubscription(....) As String Dim namespaces As New XmlSerializerNamespaces namespaces.Add(String.Empty, String.Empty) Dim serializer As New XmlSerializer(SubsDetail.GetType) Dim sw As New System.IO.StringWriter Dim writer As New System.Xml.XmlTextWriter(sw) writer.Formatting = Formatting.None serializer.Serialize(writer, SubsDetail, namespaces) writer.Close() Return sw.toString() The result was that I got an xml in the following format: <string> <?xml version="1.0" encoding="utf-16"?><subs msisdn="965xxxx"> <shortcode label="XXXX"> <channels> <channel> <id>442</id> <name>News</name> <billingperiod>7</billingperiod> <billingamount>3</billingamount> <lastbilling>4/14/2010 1:41:11 PM</lastbilling> </channel> <channel> <id>443</id> <name>News2</name> <billingperiod>7</billingperiod> <billingamount>3</billingamount> <lastbilling>4/14/2010 1:41:19 PM</lastbilling> </channel> </channels> </shortcode> </subs> </string> Though the format of the xml is correct it is coming as string within the <string> tags. This is really driving me nuts. Can I get the output as xml without the outer string tags?

    Read the article

  • How do I convert the below PHP code to VB.NET?

    - by Greg
    How do I convert the below PHP code to VB.NET? <?php $X_HOST ="foo.com"; $X_URL = "/index.php"; $X_PORT ="8080"; $X_USERNAME = "foo"; $X_PASSWORD = "bar"; $s_POST_DATA = "Channel=UK.VODAFONE"; // Channel $s_POST_DATA .= "&Shortcode=12345"; // Shortcode $s_POST_DATA .= "&SourceReference=3456"; // Source Reference $s_POST_DATA .= "&MSISDN=447811111111"; // Phone $s_POST_DATA .= "&Content=test"; // Content $s_POST_DATA .= "&DataType=0"; // Data Type $s_POST_DATA .= "&Premium=1"; // Premium $s_POST_DATA .= "&CampaignID=4321"; // CampaignID $s_Request = "POST ".$X_URL." HTTP/1.0\r\n"; $s_Request .="Host: ".$X_HOST.":".$X_PORT."\r\n"; $s_Request .="Authorization: Basic ".base64_encode($X_USERNAME.":".$X_PASSWORD)."\r\n"; $s_Request .="Content-Type: application/x-www-form-urlencoded\r\n"; $s_Request .="Content-Length: ".strlen($s_POST_DATA)."\r\n"; $s_Request .="\r\n".$s_POST_DATA; //Sends out the request to the server. $fp = fsockopen ($X_HOST, $X_PORT, $errno, $errstr, 30) or die("Error!!!"); fputs ($fp, $s_Request); while (!feof($fp)) { $s_GatewayResponse .= fgets ($fp, 128); } fclose ($fp); //Array of official response codes. $a_Responses = array( "100" => "Server has returned an unspecified error.", "101" => "Server successfully received the request.", "102" => "Server has returned an database error", "103" => "Server has returned an syntax error." ); echo "<HTML>\n<BODY>\n\n"; //Checks for an official response code. foreach ($a_Responses as $s_ResponseCode => $s_ResponseDescription) { if (stristr($s_GatewayResponse, "\n$s_ResponseCode\n")) { echo "A response code of $s_ResponseCode was returned – "; echo $s_ResponseDescription"; $b_CodeReturned = true; } } //Checks for an authorization failure where an official response code has //not been recognized. if (!$b_CodeReturned) { if (stristr($s_GatewayResponse, "HTTP/1.1 401")) { echo "The server rejected your username/password (HTTP 401)."; } else { echo "No recognised response code was returned by the server."; } } echo "\n\n</BODY>\n</HTML>"; ?> and <?php $s_ref = $HTTP_POST_VARS["Reference"]; // Reference $s_trg = $HTTP_POST_VARS["Trigger"]; // trigger $s_shc = $HTTP_POST_VARS["Shortcode"]; // shortcode $s_pho = $HTTP_POST_VARS["MSISDN"]; // MSISDN $s_con = $HTTP_POST_VARS["Content"]; // Content $s_chn = $HTTP_POST_VARS["Channel"]; // Channel $s_pay = $HTTP_POST_VARS["DataType"]; // Data Type $s_dat = $HTTP_POST_VARS["DateReceived"]; // Date Received $s_cam = $HTTP_POST_VARS["CampaignID"]; // CampaignID $b_IsValid = getValidateRequest($s_ref, $s_trg, $s_shc, $s_pho, $s_con, $s_cam, $s_chn, $s_pay, $s_dat); if ($b_IsValid) { $s_ResponseCode = "success"; } else { $s_ResponseCode = "fail"; } exit($s_ResponseCode); /*******************************************************************************/ function getValidateRequest ($s_req_ref, $s_req_trg, $s_req_shc, $s_req_pho, $s_req_con, $s_req_cam, $s_req_chn, $s_req_pay, $s_req_dat) { /* * Stub function to be replaced with whatever process is needed to * process/validate request from server by specific client requirements. */ return(true); } ?> lastly <?php $s_ref = $HTTP_POST_VARS["Reference"]; // Reference $s_sta = $HTTP_POST_VARS["Status"]; // Status $s_dat = $HTTP_POST_VARS["DateDelivered"]; // Date Delivered $b_IsValid = getValidateReceipt($s_ref, $s_sta, $s_dat); if ($b_IsValid) { $s_ResponseCode = "success"; } else { $s_ResponseCode = "fail"; } exit($s_ResponseCode); /*******************************************************************************/ function getValidateReceipt ($s_req_ref, $s_req_sta, $s_req_dat) { /* * Stub function to be replaced with whatever process is needed to * process/validate receipts from server by specific client requirements. */ return(true); } ?> Thank you very much in advance Regards Greg

    Read the article

  • WordPress plugin for handling User Submitted Posts

    - by Ravish
    User Submitted Posts plugin is a highly useful form, which can be embedded on the desired areas of your WordPress site using a shortcode. User Submitted Posts plugin will allow you to customize the fields in the form like title, or tags. It provides you with useful tools to control uploads. Why you need this? [...] Related posts:Insights WordPress Plugin For Efficient Blogging WordPress User related Plug-ins AddInto Social Bookmarking plugin for WordPress & Blogger

    Read the article

  • Passing an address inside a WordPress post to a Google Map elsewhere on the Page

    - by ael_ecurai
    Background: My client is building their own WordPress site (using a purchased feature-rich theme), and I'm modifying a child theme as necessary to achieve customizations she wants. The theme comes with a Page template that includes a full-width Google Map across the top, which pulls its marker from a single address set within the Theme Options. It's meant to be used for one main "Contact Us" page. The client's business has several locations, and she wants each location's page to include such a map. (Example linked below.) It seems that the ideal solution would be the ability to specify an address within a shortcode in the Post, and have that set the map marker. Here's how the theme makes the map (where $mapAddress is the address from the Theme Options): <?php $mapAddress = ot_get_option( 'map_address' ); $mapHeight = ot_get_option( 'map_height' ); $mapContent = ot_get_option( 'map_content' ); ?> <section id="block-map-wrapper"> <div id="block-map" class="clearfix"> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=true"></script> <script> jQuery(document).ready(function(){ // Map Options var mapOptions = { zoom: 15, scrollwheel: false, zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL, position: google.maps.ControlPosition.TOP_LEFT }, mapTypeControl: true, scaleControl: false, panControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP }; // The Map Object var map = new google.maps.Map(document.getElementById("map"), mapOptions); var address = ""; var geocoder = new google.maps.Geocoder(); geocoder.geocode({ "address" : "<?php echo $mapAddress; ?>" }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { address = results[0].geometry.location; map.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({ position: address, map: map, clickable: true, animation: google.maps.Animation.DROP }); var infowindow = new google.maps.InfoWindow({ content: "<?php echo $mapContent; ?>" }); google.maps.event.addListener(marker, "click", function() { infowindow.open(map, marker); }); } }); }); </script> <div id="map" class = "map" style = "width: 100%; height: <?php echo $mapHeight; ?>px"></div> </div><!-- #block-map --> <div class="shadow-bottom"></div> </section><!-- #block-map-wrapper --> Here's a test page using a custom Page template I've created. Right now it's using the same map code as above. I've tried creating a shortcode that takes an address attribute and sets it as $mapAddress, but that didn't work. I believe it's because the map is already loaded by the time the Loop gets parsed. How can I tell Maps to "come back" to the post to get the proper address? My specialty lies in HTML & CSS, but Javascript befuddles me fairly easily, so please be explicit when explaining implementation. Bonus: A further goal is to have the locations' parent Page also include such a map, but have multiple markers representing the multiple locations. When taking more than one location, Google Maps only accepts latitude/longitude. I don't want my client to be concerned with coordinates, so I know there's got to be something I can do with the geocoding service so she can just input a list of addresses instead (into the same, or similar, shortcode solution developed for my main question). But I am extra-clueless about how to do that.

    Read the article

  • Sending confirmation SMS automatically

    - by agentxy
    I hope this gets a response. Say Person A sends an SMS to a shortcode in a certain syntax. How could a confirmation SMS be sent to Person A's mobile phone automatically ("Your message has been received successfully!"), after determining that the SMS received from Person A is in the correct syntax? I'm a total newbie when it comes to SMS - so if anyone could describe the entire end-to-end process/architecture that could make this happen, I'd be grateful!

    Read the article

  • SQL SERVER – Poll – What would you love to see in SQL in Sixty Seconds?

    - by Pinal Dave
    Last week, I had my very first SQL in Sixty Seconds Video of this year. Lots of people send me email asking for me to continue this series as it was extremely fun at times to watch the video. I am going to start the series again in the month of June. However, I need your help to decide what would like to see in SQL in Sixty Seconds Videos. Here are quick poll and I requesting you to help me with the poll. Take Our Poll (function(d,c,j){if(!d.getElementById(j)){var pd=d.createElement(c),s;pd.id=j;pd.src='http://s1.wp.com/wp-content/mu-plugins/shortcodes/js/polldaddy-shortcode.js';s=d.getElementsByTagName(c)[0];s.parentNode.insertBefore(pd,s);} else if(typeof jQuery !=='undefined')jQuery(d.body).trigger('pd-script-load');}(document,'script','pd-polldaddy-loader')); Contest  If you leave a comment to this blog post and if I build a SQL in Sixty Seconds Video on it. I will send you a surprise gift (worth USD 25). Earlier Videos Here are few of my previous SQL in Sixty Seconds Video. Please check them out they should give you an idea what I usually cover in Sixty Seconds. Reference: Pinal Dave (https://blog.sqlauthority.com)Filed under: PostADay, SQL, SQL Authority, SQL in Sixty Seconds, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Video

    Read the article

  • php script gets two ajax requests, only returns one?

    - by Dan.StackOverflow
    I'll start from the beginning. I'm building a wordpress plugin that does double duty, in that it can be inserted in to a post via a shortcode, or added as a sidebar widget. All it does is output some js to make jquery.post requests to a local php file. The local php file makes a request to a webservice for some data. (I had to do it this way instead of directly querying the web service with jquery.ajax because the url contains a license key that would be public if put in the js). Anyway, When I am viewing a page in the wordpress blog that has both the sidebar widget and the plugin output via shortcode only one of the requests work. I mean it works in that it gets a response back from the php script. Once the page is loaded they both work normally when manually told to. Webpage view - send 2 post requests to my php script - both elements should be filed in, but only one is. My php script is just: <?php if(isset($_POST["zip"])) { // build a curl object, execute the request, // and basically just echo what the curl request returns. } ?> Pretty basic. here is some js some people wanted to see: function widget_getActivities( zip ){ jQuery("#widget_active_list").text(""); jQuery.post("http://localhost/wordpress/wp-content/ActiveAjax.php", { zip: zip}, function(text) { jQuery(text).find("asset").each(function(j, aval){ var html = ""; html += "<a href='" + jQuery(aval).find("trackback").text() + "' target='new'> " + jQuery(aval).find("assetName").text() + "</a><b> at </b>"; jQuery("location", aval).each(function(i, val){ html += jQuery("locationName", val).text() + " <b> on </b>"; }); jQuery("date", aval).each(function(){ html += jQuery("startDate", aval).text(); <!--jQuery("#widget_active_list").append("<div id='ActivityEntry'>" + html + " </div>");--> jQuery("#widget_active_list") .append(jQuery("<div>") .addClass("widget_ActivityEntry") .html(html) .bind("mouseenter", function(){ jQuery(this).animate({ fontSize: "20px", lineHeight: "1.2em" }, 50); }) .bind("mouseleave", function(){ jQuery(this).animate({ fontSize: "10px", lineHeight: "1.2em" }, 50); }) ); }); }); }); } Now imagine there is another function identical to this one except everything that is prepended with 'widget_' isn't prepended. These two functions get called separately via: jQuery(document).ready(function(){ w_zip = jQuery("#widget_zip").val(); widget_getActivities( w_zip ); jQuery("#widget_updateZipLink").click(function() { //start function when any update link is clicked widget_c_zip = jQuery("#widget_zip").val(); if (undefined == widget_c_zip || widget_c_zip == "" || widget_c_zip.length != 5) jQuery("#widget_zipError").text("Bad zip code"); else widget_getActivities( widget_c_zip ); }); }) I can see in my apache logs that both requests are being made. I'm guessing it is some sort of race condition but that doesn't make ANY sense. I'm new to all this, any ideas? EDIT: I've come up with a sub-optimal solution. I have my widget detect if the plugin is also being used on the page, and if so it waits for 3 seconds before performing the request. But I have a feeling this same thing is going to happen if multiple clients perform a page request at the same time that triggers one of the requests to my php script, because I believe the problem is in the php script, which is scary.

    Read the article

  • Domain driven design value object, how to ensure a unique value

    - by Darren
    Hi, I am building a questionnaire creator. A questionnaire consists of sections, sections consist of pages and pages consist of questions. Questionnaire is the aggregate root. Sections, pages and questions can have what are called shortcodes which should be unique within a questionnaire (but not unique within the database hence they are not strictly an identity). I intended to make the shortcode a value object and wanted to include the business rule that it should be unique within the questionnaire but I am unsure how to ensure that. My understanding is that the value object should not access the repository or service layer so how does it find out if it is unique? Thanks for any help. Darren

    Read the article

  • datatables-multi-filter-select

    - by user1871603
    I am using the jquery plug-in datatables. I am using the feature, datatables-multi-filter-select on my website with php code. I want to move the drop down filter from the footer to the header like in the following example: http://www.datatables.net/extras/thirdparty/ColumnFilterWidgets/DataTables/extras/ColumnFilterWidgets/ Can anyone please update the following PHP code sample to accomplish this? Code: /** * Register necessary Plugin Filters */add_filter( 'tablepress_shortcode_table_default_shortcode_atts', 'tablepress_add_shortcode_parameters_multi_filter_select' );add_filter( 'tablepress_table_render_options', 'tablepress_set_table_foot_option', 10, 2 );add_filter( 'tablepress_table_js_options', 'tablepress_add_multi_filter_select_js_options', 10, 3 );add_filter( 'tablepress_datatables_command', 'tablepress_add_multi_filter_select_js_command', 10, 5 ); /** * Add "datatables_multi_filter_select" as a valid parameter to the [table /] Shortcode */function tablepress_add_shortcode_parameters_multi_filter_select( $default_atts ) { $default_atts['datatables_multi_filter_select'] = false; return $default_atts;} /** * Make sure that "table_foot" and "datatables_scrollX" are false, if "datatables_multi_filter_select" is true, * as the footer will be appended by the JS. Scrolling will not work with automatically added content */function tablepress_set_table_foot_option( $render_options, $table ) { if ( $render_options['datatables_multi_filter_select'] ) { $render_options['table_foot'] = false; $render_options['datatables_scrollX'] = false; } return $render_options;} /** * Pass "datatables_multi_filter_select" from Shortcode parameters to JavaScript arguments */function tablepress_add_multi_filter_select_js_options( $js_options, $table_id, $render_options ) { $js_options['datatables_multi_filter_select'] = $render_options['datatables_multi_filter_select']; // register the JS if ( $js_options['datatables_multi_filter_select'] ) { $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; $js_multi_filter_select_url = plugins_url( "multi-filter-select{$suffix}.js", __FILE__ ); wp_enqueue_script( 'tablepress-multi_filter_select', $js_multi_filter_select_url, array( 'tablepress-datatables' ), '1.0', true ); } return $js_options;} /** * Evaluate "datatables_multi_filter_select" parameter and add corresponding JavaScript code, if needed */function tablepress_add_multi_filter_select_js_command( $command, $html_id, $parameters, $table_id, $js_options ) { if ( ! $js_options['datatables_multi_filter_select'] ) return $command; $name = str_replace( '-', '_', $html_id ); $datatables_name = "DT_{$name}"; $command = <<<JSvar {$name} = $('#{$html_id}'), {$datatables_name} = {$name}.dataTable({$parameters}), {$name}_tfoot, {$name}_selects, ths = '<tfoot>';{$name}.find('thead th').each( function( i ) { ths += '<th>' + datatables_fnCreateSelect( {$datatables_name}.fnGetColumnData(i) ) + '</th>';} );ths += '</tfoot>';{$name}_tfoot = {$name}.append(ths).find('tfoot');{$name}_selects = {$name}_tfoot.find('select');{$name}_tfoot.on( 'change', 'select', function() { {$datatables_name}.fnFilter( $(this).val(), {$name}_selects.index(this) );} );JS; return $command;} (function($) {/* * Function: fnGetColumnData * Purpose: Return an array of table values from a particular column. * Returns: array string: 1d data array * Inputs: object:oSettings - dataTable settings object. This is always the last argument past to the function * int:iColumn - the id of the column to extract the data from * bool:bUnique - optional - if set to false duplicated values are not filtered out * bool:bFiltered - optional - if set to false all the table data is used (not only the filtered) * bool:bIgnoreEmpty - optional - if set to false empty values are not filtered from the result array * Author: Benedikt Forchhammer <b.forchhammer /AT\ mind2.de> */$.fn.dataTableExt.oApi.fnGetColumnData = function ( oSettings, iColumn, bUnique, bFiltered, bIgnoreEmpty ) { // check that we have a column id if ( typeof iColumn == "undefined" ) return new Array(); // by default we only wany unique data if ( typeof bUnique == "undefined" ) bUnique = true; // by default we do want to only look at filtered data if ( typeof bFiltered == "undefined" ) bFiltered = true; // by default we do not wany to include empty values if ( typeof bIgnoreEmpty == "undefined" ) bIgnoreEmpty = true; // list of rows which we're going to loop through var aiRows; // use only filtered rows if (bFiltered == true) aiRows = oSettings.aiDisplay; // use all rows else aiRows = oSettings.aiDisplayMaster; // all row numbers // set up data array var asResultData = new Array(); for (var i=0,c=aiRows.length; i<c; i++) { iRow = aiRows[i]; var aData = this.fnGetData(iRow); var sValue = aData[iColumn]; // ignore empty values? if (bIgnoreEmpty == true && sValue.length == 0) continue; // ignore unique values? else if (bUnique == true && jQuery.inArray(sValue, asResultData) > -1) continue; // else push the value onto the result data array else asResultData.push(sValue); } return asResultData;}}(jQuery)); function datatables_fnCreateSelect( aData ) { var r = '<select><option value=""></option>', i, iLen = aData.length; for ( i=0 ; i<iLen ; i++ ) { r += '<option value="'+aData[i]+'">'+aData[i]+'</option>'; } return r + '</select>';}

    Read the article

  • RewriteCond to change displayed host, but not server

    - by coneybeare
    Typing out the title to this leads me to believe this might not be possible due to security concerns, but I will ask anyway. I have shortcode support running on my server, lets call it xx.yy I want it so when a user sends a request to xx.yy, it just changes the displayed host to another valid domain running on the same box. I have this so far (lets the server know to accept requests from xx.yy): RewriteCond %{HTTP_HOST} ^.*xx.yy [NC] RewriteRule ^/(.*)$ http://127.0.0.1:<PORT_OMITTED>%{REQUEST_URI} [P,QSA,L] RewriteCond %{HTTP_HOST} ^.*mysite.com [NC] RewriteRule ^/(.*)$ http://127.0.0.1:<PORT_OMITTED>%{REQUEST_URI} [P,QSA,L] It works, and it directs the traffic into my app, but the url says http://xx.yy when I would rather it say http://mysite.com I know i could redirect to http://mysite.com instead of 127.0.0.1, but I have 4 parallel boxes of mysite.com and going back out to DNS to maybe go to another box seems like a waste when I am already here. Also, I am not sure how POST requests would work like that. What can I do?

    Read the article

  • Googla Maps Javascript API, Jquery Tabs

    - by user1357598
    I have tried everything possible.. unminified all javascript, still can't get the map to load properly inside the tab. Trying to use this custom code too with no success jQuery('.tabs-shortcode > ul').bind('tabsshow', function(e, ui) { if (ui && ui.panel) { jQuery('.mapp-canvas', ui.panel).each(function() { var id = jQuery(this).attr('id'); if (id) { window[id].resize(); } }); } }); webpage: http://bit.ly/UTHskS thanks in advance, Andy

    Read the article

  • Wordpress meta data is written on top of page instead of the loop

    - by Fruxelot
    i'm building a wordpress webpage based on the Skeleton Wordpress theme. I have 2 posts showing on a page and each of these posts have custom fields values (meta data). Im using the shortcode from the skeleton theme to get a post-feed from a specific category and in that loop i have inserted this tag that displays the custom fields data <?php the_meta(); ?> I am getting the data - but the problem is, the data is shown on TOP of the page instead of inside the in the post. What could've ive possibly done wrong? or is it something with skeleton i am doing wrong? Webpage : http://visbyfangelse.se.preview.binero.se/rum-priser-preview/ as you can see two posts are shown - and the meta data is shown on the top of the page. Code to the loop : http://pastebin.com/mRQY5GNz As you can see i want the meta displayed in the div which i assigned this class to "my_room_meta".

    Read the article

  • Best WordPress Shopping Cart & Ecommerce Plugins

    - by Edward
    A versatile WordPress Shopping Cart plugin can help you create a feature-rich online store on your WordPress-powered website or blog. Some are so advanced that you can get your store up and running in minutes. Some plugins allow you to take ecommerce to a next level with their high end customization tools. Here is a list of best WP shopping cart plugins available: Cart66 One of the best WordPress plugin with lots of features, great quality and ease of use. It accepts few more payment getways such as PayPal Website Payments Standard, PayPal Website Payments Professional, PayPal Express Checkout, eProcessing Network etc. It has flexible design options, recurring payments for subscriptions, memberships, and payment plans, Easy PCI Compliance – Safe and Secure. It is fast and efficient, one can sell digital and physical products and support is good. Price: Standard $49 & Professional $99 Details Download StorePress StorePress is a WordPress theme, which is fully coded. It comes with scripts that can change a WordPress blog into a veritable e-commerce virtual store. With this great premium WordPress theme, one can start affiliate stores, or promote affiliate products. Price: Single $59.99 & Developer License $119.99 Details Download WordPress eStore Plugin This shopping cart plugin comes with easy checkout, ease of design and use, automatic instant digital product delivery, Next Gen gallery integration, autoresponder integration etc. It is a lightweight shopping cart and allows multi site license. This plugin offers an amazingly comprehensive toolkit that will ensure your online shop is almost just plug-and-play. Price: $49.99 Details Download Shoppers Press Shoppers press is a premium cart for Word Press that comes with 20+ to choose from and 20+ built in payment gateways. It features one-click setups, personalized user accounts, easy management tools, detailed sales tracking, promotional options, a variety of product import tools, and many more features Price:$79 Details Download WordPress Shopping Cart plugin The WordPress Shopping Cart plugin by Tribulant quickly and seamlessly integrates an online shop with a fully functional shopping cart interface into any WordPress website. It has easy to use interface, which enables set up of multiple products and categorize and organizing them into multiple product categories. It also has many more attractive features. Price: $49.99 Details Download WP e-commerce WP e-commerce is a free full-featured shopping cart plugin for WordPress. It is a full featured shopping cart and boasts of easy checkout. It offers a wide range of features including SSL compatibility, customization and merchandising, integrated payment processing solutions including manual payment, Google Checkout and PayPal Payments, and email marketing. It is wordpress and social networking integrated. It is customizable by use of PHP template tag, wordpress shortcode and widgets. Details Download YAK for WordPress YAK is an open source shopping cart plugin for WordPress. It associates products with weblog entries (in other words, posts), so the post ID also becomes the product code. It supports both pages and posts as products, handles different types of product through categories. YAK supports downloadable products, so any e-books, plugins, or zip files you’re marketing can be easily purchased and dowloaded. Details Download Market Press It is another shopping cart full of many features. It offers following features such as assign categories and tags to products to make them easy to find, stock tracking with alerts, order management/alerts, fully customizable email messages, full support for most major currencies, fully customizable store urls/slugs, customers can checkout without being a site user etc. Expensive, but good option for those who can afford it. Price: $17.42/month Details Download Shopp It is an excellent shopping cart plugin for Word Press. This plugin is extremely easy to install and use. It has a cleaner interface. The customer support is good. Use can easily customize the look of the cart by using its amazing features. Price: $55 Details Download Related posts:8 PHP Shopping Cart Software for Reliable Ecommerce Solution Shopping Cart SEO 8 Free Open Source Shopping Carts

    Read the article

1