Search Results

Search found 2270 results on 91 pages for 'joe on wp'.

Page 2/91 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • VS 2010, Silverlight, WP 7, Azure, F#, jQuery & more take Center Stage at India's Definitive Microso

    Microsoft has announced a slew of new and exciting releases that will help you take your code to the next level in 2010. As one of the longest running independent developer conferences in India, GIDS.NET at the Great Indian Developer Summit 2010 is uniquely positioned to provide a blend of practical, pragmatic and immediately applicable knowledge and a glimpse of the future of technology. At GIDS.NET, 0n 20 April 2010 in Bangalore, expert speakers will address a wide range of topics, including .NET...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Ranking hit after WP site migration

    - by Ben
    I migrated my site from its old domain over a month ago. I followed WMT completely, including 301 redirects from every existing URL to the new domain, and then submitting a change of address. Traffic continued as normal, but then a few days after submitting the change of address traffic plummeted to about 20-30% of what it was previously. Most of my traffic come from organic search, and I can see that for the keywords I had targeted before and performed well with and am now ranking much much lower for. In some cases for low competition keywords I've only lost a few places, for higher competition terms I have really suffered. This has started to pick up a bit (one of my keywords I have risen from 195 to 100 in the last week), but it seems to be a very slow process. How seamless is this process normally? I was under the impression that this would not affect my rankings too severely, but it has now been a month since the move and recovery seems to be very slow, if at all. Is it likely that I've missed something? The only change is that I have moved what was the home page to be more of a sub-page, and now in its place is a magazine-style home page. I understand that links to the old site will now be pointing to the latter which means that rankings for some keywords attributed to the old home page will take a hit, but even on other pages that seem to fit in exactly the same page structure as the previous site I have seen a drop in rankings. Any help would be greatly appreciated. Thanks!

    Read the article

  • Can't install drivers for Epson wp-4530

    - by Rick
    It looks like it's installing ok then I get an error: (Reading database ... 177199 files and directories currently installed.) Unpacking epson-inkjet-printer-escpr:i386 (from .../epson-inkjet-printer-escpr_1.3.0-1lsb3.2_i386.deb) ... dpkg: dependency problems prevent configuration of epson-inkjet-printer-escpr:i386: epson-inkjet-printer-escpr:i386 depends on lsb (>= 3.2). dpkg: error processing epson-inkjet-printer-escpr:i386 (--install): dependency problems - leaving unconfigured Errors were encountered while processing: epson-inkjet-printer-escpr:i386 Can anyone help me with this? Tried install under linux mint 14 and ubuntu 12.04 same problem. Tried installing using cups and Software center. Driver is from http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX which is only driver site I can find for this printer Please help

    Read the article

  • SEO effects of intermix of WP blog, custom PHP site and FB app game

    - by melbournetechlover
    We're a melbourne tech company in the process of building a custom site in PHP. We plan to launch a "pre-launch" page which is also custom coded (CSS3 on twitter bootstrap framework + HTML5 front end and PHP back end). On that site will be a link to a blog - the idea behind this is to build up ranking for a variety of relevant keywords prior to the full site going live (given the majority of the site is a member only community anyway so the blog is really the main way we'll be able to execute on-site SEO. Ideally, we would like to install wordpress in a subdirectory on our servers and just customise the header to look the same as the landing page of the website. But some questions and concerns... Is there any detrimental effect on SEO efforts in having two separate systems (one custom PHP, the other an installation of wordpress) to manage the blog vs the rest of the site? Are there any benefits or detriments to installing on a sub domain such as blog.sitename.com vs. sitename.com/blog. My preference would be sitename.com/blog as it feels neater - but open to suggestions based on knowledge of Google preferences. Separately, we are building a Facebook app which is under another site name. Again because we are launching this app first, from an SEO perspective, would it actually be better to run it from a sub domain on the main site - e.g. gamename.mainsitename.com instead of on app.gamename.com? Currently we have it on app.gamename.com, but if there are SEO benefits to moving it to the other domain and server then we'll do it. Basically we don't want to have our SEO efforts divided - will Google algorithms prefer two sites heavily referring traffic, or is it better to focus our efforts on one. I guess that's the crux of the issue. But the other one is - does Google care about traffic accessing a page built for the Facebook app iFrame - does that count toward rankings? Sorry I hope these questions aren't too complex - but we're in the tech world every day and still can't seem to find a good answer to these ones...hence I'm taking to the forums!! Free beer for whoever can give me a solid answer!

    Read the article

  • WP: Oracle Multitenant on SuperCluster T5-8: Study of Database Consolidation Efficiency

    - by uwes
    Consolidation in the data center is the driving factor in reducing capital and operational expense in IT today. This is particularly relevant as customers invest more in cloud infrastructure and associated service delivery. Database consolidation is a strategic component in this effort. Oracle Database 12 c introduces Oracle Multitenant , a new database consolidation model in which multiple Pluggable Databases (PDBs) are consolidated within a Container Database (CDB). While keeping many of the isolation aspects of single databases, it allows PDBs to share the system global area (SGA) and background processes of a common CDB . The white paper recently published on OTN: Oracle Multitenant on SuperCluster T5-8: Study of Database Consolidation Efficiency analyzes and quantifies savings in compute resources, efficiencies in transaction processing, and consolidation density of Oracle Multitenant compared to consolidated single instance databases (SIDBs) running in a bare-metal environment.

    Read the article

  • Apache Getting Bogged Down By Certain Script (Wp-Cron.php) - How To Kill Process Automatically

    - by user50037
    I have a server that is running a number of wordpress blogs, and a number of them have several hundred/thousand posts. Every couple of days, the server slows to a crawl due to a file being run on Wordpress called WP-cron.php. My entire apache process log turns into this : http:// imgur.com/A7K9k.png Times that by quite a bit. And server no go. Each process takes up about 1.1% of ram. And when we have 50 of them on the go. It gets insane. Not all of them are coming from the same blog, they are pretty widespread. In the Apache process page of WHM, they are usually ALL set to the status of "C", which means closing. But they can sit there until they crash the server, and they still hold the memory. Just google "wp-cron.php load" and you will find plenty of people with similar issues. In anycase, we have think it is down to users adding a tonne of dead "pinglists" to their wordpress installation. Which in turn wordpress loops through them endlessly. Problem number 1. Does anyone have any other suggestions about what would cause the Wordpress file wp-cron.php to loop endlessly. I still think it is down to pings, because all of the people we have contacted about their account load going sky high, have had massive ping lists. Problem number 2. Even if it is down to excessive pinglists in wordpress. We cannot be babying every single account on the server waiting for it to start spawning the wp-cron processes. It often happens overnight, and I start getting SMS alerts at 2am about the load. I have CSF installed, which apparently would have ended the processes if they ran over XXX time. But I have been told that it won't catch the processes because they end up in this state of "closing" (They show up as "C" on the Apache page of WHM). Apparently CSF will only kill processes that are "running" which C does not count. I have seen various other scripts such as : http://dltj.org/article/die-apache-die/ . I took a look at the stat of /proc. But I was boggled at which delimited part was the time running. And if there was any way I could connect it back to an actual Apache process, so that I could see what file was running (So only close connections connected to wp-cron.php, with a state of "C"). Overall I know Problem 2 glosses over the real reason. But I do put the whole thing to excessive pinglists in Wordpress. But I just cannot sit there and babysit every single installation 24/7. So I need a way to save the server when I am not available. Any help would be much appreciated.

    Read the article

  • how to prevent hacking of a WP site

    - by HollerTrain
    I have a WP install, and every few weeks some hackers keep adding some bunk script to the bottom of certain files, making the WP site not function. I've changed the user/pass to WP and this obviously isn't working. I'm thinking since they are effecting files that are not visible via the WP login files (which are just theme files) then does this mean they are getting access to the FTP and making their hacks there? If they are getting into FTP then why wouldn't they just remove all docs? Any insight would be greatly appreciate it. While I appreciate the billable hours to find/remove this code every few days the client isn't as excited about it as I am.

    Read the article

  • W3 Total Cache or WP Super Cache?

    - by javipas
    I'm just preparing the setup of a new VPS where I will migrate a WordPress blog with a good traffic (currently, around 40k pageviews a day), and I was thinking about the caching strategy. I've found different ideas and recommendations, but from previous experiences I will setup a Nginx+PHP-FPM+MySQL (LEMP) system on a Linode VPS. I've read also about setting Nginx as a reverse proxy with Apache, and even using Varnish too, but I don't know if all of this can benefit the speed/performance of the blog (that's the only thing that will be installed on the VPS). The question now is... would you recommend W3 Total Cache or WP Super Cache? I've used W3 on some blogs, but I haven't noticed great benefits and don't need all its options, so I think I could give the veteran WP Super Cache a try. Besides, some users have complained about W3 complex configuration and lack of performance (even consumig more CPU) on some cases.

    Read the article

  • Cannot Call WordPress Plugin Files Under wp-content

    - by Volomike
    I have a client who has many blog customers. Each of these WordPress blogs calls a plugin that provides a product link. The way that link is composed looks like this: {website}/wp-content/plugins/prodx/product?id=432320 This works fine on all blogs except two. On those two, when you try to call the URL, you get a 404. So, I disabled all plugins except prodx and reverted the theme to default (Kubrick), thinking perhaps a plugin intercept with add_action() API was doing this, such as intercepting URLs and redirecting them. However, this did not help. So, I upgraded the WordPress to the latest version. Again, didn't fix. So, I checked permissions, comparing with a blog that worked just fine. Again, didn't fix. So I replaced the .htaccess, using one from a working blog. Again, didn't fix. So I replaced all the files using some from a working blog that was identical to this one, and then restored the wp-config.php file back so that it talked to the right blog database. Again, didn't fix. Again I checked permissions meticulously, comparing to a perfectly working blog. Again, didn't fix. So, I created a test.php that looks like so: <?php print_r($_GET); echo "hello world"; I then copied it into another plugin folder and used my browser to get to it -- again, 404. So I copied it into the root of wp-content/plugins and tried to call it there -- again, 404. So I copied it into wp-content -- again, 404. Last, I copied it into the root of the WordPress blog website, and this time, it worked! Doesn't make sense. I started to think that perhaps something was going on with /etc/httpd/conf/httpd.conf for this customer, but the only thing I saw different in their for this customer was the IP address was different than the customer's blog that worked. Each customer gets their own IP in this environment my client has built. My client sysop is baffled too. What do you think is going on? Is there something wrong in the WP database for this customer? Is there something wrong in httpd.conf?

    Read the article

  • What's the correct way to hide/prevent access to wp-admin

    - by Jaypee
    I'm dealing with this matter since a while, I have read a ton of articles and stuff out there but I couldn't find a place that shows the RIGHT way, standard, correct, whatever you like to call it, to prevent access to my wp-admin or wp-login.php On all Wordpress sites I see (the well made ones) you will never see anything if you type thesite.com/wp-admin As I could see, one way to do this is by restricting the access to that folder by creating an .htaccess file and restrict by IP the access to the folder. Seems to be the "cleanest" way to do. What I'm not sure about it is that I have a dynamic address provided by my ISP, so on a certain time my IP will change, that will force me to also change the .htaccess to my new address, I don't see that practical. I can set a range also, but by doing that I will also authorize access to all people within that range of IPs (other clients of my ISP for example). I'm then struggling to find the best/standard way to do this. Anyone can help me? Thanks

    Read the article

  • WP Function to retrieve database connection

    - by HollerTrain
    Is there a function or command that pulls the db connection info from the WP blog? I am writing a Plugin which would have to connect to the db to retrieve the info, wondering if there was one single command/function i could call which could connect. this would make the plugin portable and would work on any WP blog. is this possible?

    Read the article

  • Need to link WP Blog with Rails App on Heroku

    - by John Glass
    I have a client who wants to migrate his Rails app to Heroku. However the client also has a blog associated with his domain that runs on WordPress. Currently, the WordPress blog is running happily alongside the Rails app, but once we migrate to Heroku, that clearly won't be possible. The url for the app is like http://mydomain.com, and the url for the blog is like http://mydomain/blog. I realize that the best long-term solution is to redo the blog in a Rails format like Toto or Jekyll. But in the short term, what is the best way to continue hosting the WP blog where it is (or somewhere) but use Heroku to run the app? The client doesn't want the blog to be on a subdomain, but to remain at mydomain/blog for SEO reasons and also since there is traffic to the blog. I have two ideas: Use rack_rewrite or refraction (or just a regular old 301 and Apache mod_rewrite) on the old (non-Heroku) server to redirect the main url from the old site to Heroku. In this case, I can just leave the Wordpress blog running happily where it is. I think?? Is there a reason to choose one of those options (rack_rewrite, refraction, or mod_rewrite) over the others if I do it this way? Switch the DNS info to point to the Heroku site, and then use a 301 redirect from the blog to the old site. But then I'll have to get the old (non-Heroku) site on a subdomain and use some kind of rewrite rules anyway so it looks like it isn't a subdomain. Are either of these approaches preferable, or is there another way to do it that's easier that I'm missing?

    Read the article

  • IIS Messing on Wordpress Permalinks or WP's fault?

    - by Jesus Rodriguez
    Hello, I had a problem and after some research I discovered the exactly point where is failing. blog.domain.com Is not working, it says that the page cannot be found (404) blog.domain.com/index.php Working as expected If you click on Home, it will says that the page cannot be found, if you try to preview a new post, it says that the page cannot be found... I can see every post btw. I run my blog on a Windows hosting using IIS. my permalink is this: /index.php/%postname% IIRC I had to use index.php because my IIS doesn't have URL rewriting. I have no problem with the index.php thing on the url, I have now a good SEO and I don't want to change my permalink but I Don't know why is not working now... just from one day to the next... It's a problem of WP or is just my host messing up? If is my blog, do you know what is causing this? (Just for create a concrete ticket about the exactly problem) Thank you.

    Read the article

  • mod_rewrite to redirect to specific WP page

    - by djdy
    The goal is to redirect all requests coming to Wordpress from IE 6 and 7, to a specific Wordpress page using mod_rewrite. My confusion comes from multiple conditions that are needed for the rewrite not entering an endless loop once on the specific Wordpress page. So the condition must be: (IE 6 or 7) and request is not the same as the page we are sending them to. I've tried things along the lines of: RewriteCond %{HTTP_USER_AGENT} MSIE\ ([67])\. RewriteCond %{REQUEST_URI} !iepage RewriteRule .* /iepage/ [R] In IE 6 and 7, I get page cannot be displayed errors. Could it really mean too many redirects, because the 2nd condition isn't working?

    Read the article

  • Wordpress XML-RPC call from Objective C: wp.newComment

    - by radesix
    I'm using Eric Czarny's Cocoa XML-RPC framework to make a call to the Wordpress API's. I've downloaded the sample app from Wordpress which gives some good examples. Unfortunately the good examples are for every call EXCEPT wp.newComment. I'm trying to post a comment using the code below and I keep getting an error with a localized description that tells me to check my input parameters. I've checked and rechecked and I don't understand what is wrong. Any ideas? NSDictionary *commentStructure = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:0], @"comment_parent", @"xmlrpc anonymous comments plugin now enabled", @"content", @"Test Author", @"author", @"http://iphone.someurl.com", @"author_url", @"[email protected]", @"author_email", nil]; NSArray *args = [NSArray arrayWithObjects:[NSNumber numberWithInt:0], @"", @"", [NSNumber numberWithInt:[self.parentFeedItem.postID intValue]], commentStructure, nil]; // the param(s) NSString *server = [[[NSString alloc] initWithString:@"http://www.someurl.com/xmlrpc.php"] autorelease]; // the server NSString *method = [[[NSString alloc] initWithString:@"wp.newComment"] autorelease]; // the method XMLRPCRequest *request = [[XMLRPCRequest alloc] initWithHost:[NSURL URLWithString:server]]; [request setMethod:method withObjects:args]; id response = [self executeXMLRPCRequest:request]; [request release]; if( [response isKindOfClass:[NSError class]] ) { //return nil; NSLog(@"There was a problem"); NSLog([response localizedDescription]); }

    Read the article

  • artisteer wp-theme metadata (date, category) lost

    - by Mattias Svensson
    I am going nuts over wordpress and artisteer. I am trying something that used to be pretty straightforward - turning on and off the display of date and post category for my posts on my blog page. I find this in content.php global $post; theme_post_wrapper( array( 'id' => theme_get_post_id(), 'class' => theme_get_post_class(), 'title' => theme_get_meta_option($post->ID, 'theme_show_page_title') ? get_the_title() : '', 'heading' => theme_get_option('theme_single_article_title_tag'), 'before' => theme_get_metadata_icons('date', 'header'), 'content' => theme_get_content() ) ); And the instruction says that all you got to do is insert or remove 'date' in the 'before' line. I've done it back and forth with my content files and nothing changes on the output. I can't find the actual code that prints it all, wordpress used to be so simple before everything was dug down 10 levels deep and you now have to look through millions of different functions to find the simplest things... As you can probably tell, I usually don't work with WP =) But this is on my table now and I haven't stayed up to date with WP for a couple of years... Any input as to where I can find the variables is appreciated... I had expected to at some point find 'posted at '.echo($date).' in category '.echo($category) or something at least remotely similar...

    Read the article

  • How to give my user permission to add/edit files on local apache server? [duplicate]

    - by Logan
    Possible Duplicate: How to make Apache run as current user I'm setting up my local test server again, and I seem to have forgotten how to successfully set up the LAMP server. I have installed LAMP server via tasksel command and I have configured the /var/www directory according to a guide I've found: After the lamp server installation you will need write permissions to the /var/www directory. Follow these steps to configure permissions. Add your user to the www-data group sudo usermod -a -G www-data <your user name> now add the /var/www folder to the www-data group sudo chgrp -R www-data /var/www now give write permissions to the www-data group sudo chmod -R g+w /var/www So logan user is now part of www-data group and the file/folder permissions look like the output below: logan@computer:/var/www$ ls -lart total 172 -rw-r--r-- 1 www-data www-data 1997 Oct 23 2010 wp-links-opml.php -rw-r--r-- 1 www-data www-data 3177 Nov 1 2010 wp-config-sample.php -rw-r--r-- 1 www-data www-data 3700 Jan 8 2012 wp-trackback.php -rw-r--r-- 1 www-data www-data 271 Jan 8 2012 wp-blog-header.php -rw-r--r-- 1 www-data www-data 395 Jan 8 2012 index.php -rw-r--r-- 1 www-data www-data 3522 Apr 10 2012 wp-comments-post.php -rw-r--r-- 1 www-data www-data 19929 May 6 2012 license.txt -rw-r--r-- 1 www-data www-data 18219 Sep 11 08:27 wp-signup.php -rw-r--r-- 1 www-data www-data 2719 Sep 11 16:11 xmlrpc.php -rw-r--r-- 1 www-data www-data 2718 Sep 23 12:57 wp-cron.php -rw-r--r-- 1 www-data www-data 7723 Sep 25 01:26 wp-mail.php -rw-r--r-- 1 www-data www-data 2408 Oct 26 15:40 wp-load.php -rw-r--r-- 1 www-data www-data 4663 Nov 17 10:11 wp-activate.php -rw-r--r-- 1 www-data www-data 9899 Nov 22 04:52 wp-settings.php -rw-r--r-- 1 www-data www-data 9175 Nov 29 19:57 readme.html -rw-r--r-- 1 www-data www-data 29310 Nov 30 08:40 wp-login.php drwxr-xr-x 14 root root 4096 Dec 24 17:41 .. drwx------ 9 www-data www-data 4096 Dec 26 16:11 wp-admin drwx------ 9 www-data www-data 4096 Dec 26 16:11 wp-includes -rw-rw-rw- 1 www-data www-data 3448 Dec 26 16:14 wp-config.php drwxrwxr-x 5 www-data www-data 4096 Dec 26 16:14 . drwx------ 6 www-data www-data 4096 Dec 26 16:19 wp-content Things work perfectly at http://localhost, I can view the website fine. The thing with this is that I will be working on a plugin for wordpress and I don't want to deal with separate owners under www directory to create or modify files/folders. When I give my user the ownership of /var/www recursively as logan:www-data I can create/modify files but cannot view the http://localhost. I get a Forbidden error. I'm assuming that this is because of the Apache's configuration? Which one is healthier or easier considering this is just a local test website, configuring apache to give user logan to view website and chmod /var/www logan:logan so that I can create files etc. without any sudo commands; or is it easier to configure user groups to get www-data user to act like my logan user? (Idk how that's possible, maybe putting www-data user under logan group?) Please shed some light to this subject. All I want is to be able to create/modifiy files under my user, and yet to be able to successfully view http://localhost I appreciate the help!

    Read the article

  • Modify PHP Search Script to Handle Multiple Entries For a Single Input

    - by Thomas
    I need to modify a php search script so that it can handle multiple entries for a single field. The search engine is designed for a real estate website. The current search form allows users to search for houses by selecting a single neighborhood from a dropdown menu. Instead of a dropdown menu, I would like to use a list of checkboxes so that the the user can search for houses in multiple neighborhoods at one time. I have converted all of the dropdown menu items into checkboxes on the HTML side but the PHP script only searches for houses in the last checkbox selected. For example, if I selected: 'Dallas' 'Boston' 'New York' the search engine will only search for houses in New York. Im new to PHP, so I am a little at a loss as to how to modify this script to handle the behavior I have described: <?php require_once(dirname(__FILE__).'/extra_search_fields.php'); //Add Widget for configurable search. add_action('plugins_loaded',array('DB_CustomSearch_Widget','init')); class DB_CustomSearch_Widget extends DB_Search_Widget { function DB_CustomSearch_Widget($params=array()){ DB_CustomSearch_Widget::__construct($params); } function __construct($params=array()){ $this->loadTranslations(); parent::__construct(__('Custom Fields ','wp-custom-fields-search'),$params); add_action('admin_print_scripts', array(&$this,'print_admin_scripts'), 90); add_action('admin_menu', array(&$this,'plugin_menu'), 90); add_filter('the_content', array(&$this,'process_tag'),9); add_shortcode( 'wp-custom-fields-search', array(&$this,'process_shortcode') ); wp_enqueue_script('jquery'); if(version_compare("2.7",$GLOBALS['wp_version'])>0) wp_enqueue_script('dimensions'); } function init(){ global $CustomSearchFieldStatic; $CustomSearchFieldStatic['Object'] = new DB_CustomSearch_Widget(); $CustomSearchFieldStatic['Object']->ensureUpToDate(); } function currentVersion(){ return "0.3.16"; } function ensureUpToDate(){ $version = $this->getConfig('version'); $latest = $this->currentVersion(); if($version<$latest) $this->upgrade($version,$latest); } function upgrade($current,$target){ $options = $this->getConfig(); if(version_compare($current,"0.3")<0){ $config = $this->getDefaultConfig(); $config['name'] = __('Default Preset','wp-custom-fields-search'); $options['preset-default'] = $config; } $options['version']=$target; update_option($this->id,$options); } function getInputs($params = false,$visitedPresets=array()){ if(is_array($params)){ $id = $params['widget_id']; } else { $id = $params; } if($visitedPresets[$id]) return array(); $visitedPresets[$id]=true; global $CustomSearchFieldStatic; if(!$CustomSearchFieldStatic['Inputs'][$id]){ $config = $this->getConfig($id); $inputs = array(); if($config['preset']) $inputs = $this->getInputs($config['preset'],$visitedPresets); $nonFields = $this->getNonInputFields(); if($config) foreach($config as $k=>$v){ if(in_array($k,$nonFields)) continue; if(!(class_exists($v['input']) && class_exists($v['comparison']) && class_exists($v['joiner']))) { continue; } $inputs[] = new CustomSearchField($v); } foreach($inputs as $k=>$v){ $inputs[$k]->setIndex($k); } $CustomSearchFieldStatic['Inputs'][$id]=$inputs; } return $CustomSearchFieldStatic['Inputs'][$id]; } function getTitle($params){ $config = $this->getConfig($params['widget_id']); return $config['name']; } function form_processPost($post,$old){ unset($post['###TEMPLATE_ID###']); if(!$post) $post=array('exists'=>1); return $post; } function getDefaultConfig(){ return array('name'=>'Site Search', 1=>array( 'label'=>__('Key Words','wp-custom-fields-search'), 'input'=>'TextField', 'comparison'=>'WordsLikeComparison', 'joiner'=>'PostDataJoiner', 'name'=>'all' ), 2=>array( 'label'=>__('Category','wp-custom-fields-search'), 'input'=>'DropDownField', 'comparison'=>'EqualComparison', 'joiner'=>'CategoryJoiner' ), ); } function form_outputForm($values,$pref){ $defaults=$this->getDefaultConfig(); $prefId = preg_replace('/^.*\[([^]]*)\]$/','\\1',$pref); $this->form_existsInput($pref); $rand = rand(); ?> <div id='config-template-<?php echo $prefId?>' style='display: none;'> <?php $templateDefaults = $defaults[1]; $templateDefaults['label'] = 'Field ###TEMPLATE_ID###'; echo $this->singleFieldHTML($pref,'###TEMPLATE_ID###',$templateDefaults); ?> </div> <?php foreach($this->getClasses('input') as $class=>$desc) { if(class_exists($class)) $form = new $class(); else $form = false; if(compat_method_exists($form,'getConfigForm')){ if($form = $form->getConfigForm($pref.'[###TEMPLATE_ID###]',array('name'=>'###TEMPLATE_NAME###'))){ ?> <div id='config-input-templates-<?php echo $class?>-<?php echo $prefId?>' style='display: none;'> <?php echo $form?> </div> <?php } } } ?> <div id='config-form-<?php echo $prefId?>'> <?php if(!$values) $values = $defaults; $maxId=0; $presets = $this->getPresets(); array_unshift($presets,__('NONE','wp-custom-fields-search')); ?> <div class='searchform-name-wrapper'><label for='<?php echo $prefId?>[name]'><?php echo __('Search Title','wp-custom-fields-search')?></label><input type='text' class='form-title-input' id='<?php echo $prefId?>[name]' name='<?php echo $pref?>[name]' value='<?php echo $values['name']?>'/></div> <div class='searchform-preset-wrapper'><label for='<?php echo $prefId?>[preset]'><?php echo __('Use Preset','wp-custom-fields-search')?></label> <?php $dd = new AdminDropDown($pref."[preset]",$values['preset'],$presets); echo $dd->getInput()."</div>"; $nonFields = $this->getNonInputFields(); foreach($values as $id => $val){ $maxId = max($id,$maxId); if(in_array($id,$nonFields)) continue; echo "<div id='config-form-$prefId-$id'>".$this->singleFieldHTML($pref,$id,$val)."</div>"; } ?> </div> <br/><a href='#' onClick="return CustomSearch.get('<?php echo $prefId?>').add();"><?php echo __('Add Field','wp-custom-fields-search')?></a> <script type='text/javascript'> CustomSearch.create('<?php echo $prefId?>','<?php echo $maxId?>'); <?php foreach($this->getClasses('joiner') as $joinerClass=>$desc){ if(compat_method_exists($joinerClass,'getSuggestedFields')){ $options = eval("return $joinerClass::getSuggestedFields();"); $str = ''; foreach($options as $i=>$v){ $k=$i; if(is_numeric($k)) $k=$v; $options[$i] = json_encode(array('id'=>$k,'name'=>$v)); } $str = '['.join(',',$options).']'; echo "CustomSearch.setOptionsFor('$joinerClass',".$str.");\n"; }elseif(eval("return $joinerClass::needsField();")){ echo "CustomSearch.setOptionsFor('$joinerClass',[]);\n"; } } ?> </script> <?php } function getNonInputFields(){ return array('exists','name','preset','version'); } function singleFieldHTML($pref,$id,$values){ $prefId = preg_replace('/^.*\[([^]]*)\]$/','\\1',$pref); $pref = $pref."[$id]"; $htmlId = $pref."[exists]"; $output = "<input type='hidden' name='$htmlId' value='1'/>"; $titles="<th>".__('Label','wp-custom-fields-search')."</th>"; $inputs="<td><input type='text' name='$pref"."[label]' value='$values[label]' class='form-field-title'/></td><td><a href='#' onClick='return CustomSearch.get(\"$prefId\").toggleOptions(\"$id\");'>".__('Show/Hide Config','wp-custom-fields-search')."</a></td>"; $output.="<table class='form-field-table'><tr>$titles</tr><tr>$inputs</tr></table>"; $output.="<div id='form-field-advancedoptions-$prefId-$id' style='display: none'>"; $inputs='';$titles=''; $titles="<th>".__('Data Field','wp-custom-fields-search')."</th>"; $inputs="<td><div id='form-field-dbname-$prefId-$id' class='form-field-title-div'><input type='text' name='$pref"."[name]' value='$values[name]' class='form-field-title'/></div></td>"; $count=1; foreach(array('joiner'=>__('Data Type','wp-custom-fields-search'),'comparison'=>__('Compare','wp-custom-fields-search'),'input'=>__('Widget','wp-custom-fields-search')) as $k=>$v){ $dd = new AdminDropDown($pref."[$k]",$values[$k],$this->getClasses($k),array('onChange'=>'CustomSearch.get("'.$prefId.'").updateOptions("'.$id.'","'.$k.'")','css_class'=>"wpcfs-$k")); $titles="<th>".$v."</th>".$titles; $inputs="<td>".$dd->getInput()."</td>".$inputs; if(++$count==2){ $output.="<table class='form-field-table form-class-$k'><tr>$titles</tr><tr>$inputs</tr></table>"; $count=0; $inputs = $titles=''; } } if($titles){ $output.="<table class='form-field-table'><tr>$titles</tr><tr>$inputs</tr></table>"; $inputs = $titles=''; } $titles.="<th>".__('Numeric','wp-custom-fields-search')."</th><th>".__('Widget Config','wp-custom-fields-search')."</th>"; $inputs.="<td><input type='checkbox' ".($values['numeric']?"checked='true'":"")." name='$pref"."[numeric]'/></td>"; if(class_exists($widgetClass = $values['input'])){ $widget = new $widgetClass(); if(compat_method_exists($widget,'getConfigForm')) $widgetConfig=$widget->getConfigForm($pref,$values); } $inputs.="<td><div id='$this->id"."-$prefId"."-$id"."-widget-config'>$widgetConfig</div></td>"; $output.="<table class='form-field-table'><tr>$titles</tr><tr>$inputs</tr></table>"; $output.="</div>"; $output.="<a href='#' onClick=\"return CustomSearch.get('$prefId').remove('$id');\">Remove Field</a>"; return "<div class='field-wrapper'>$output</div>"; } function getRootURL(){ return WP_CONTENT_URL .'/plugins/' . dirname(plugin_basename(__FILE__) ) . '/'; } function print_admin_scripts($params){ $jsRoot = $this->getRootURL().'js'; $cssRoot = $this->getRootURL().'css'; $scripts = array('Class.js','CustomSearch.js','flexbox/jquery.flexbox.js'); foreach($scripts as $file){ echo "<script src='$jsRoot/$file' ></script>"; } echo "<link rel='stylesheet' href='$cssRoot/admin.css' >"; echo "<link rel='stylesheet' href='$jsRoot/flexbox/jquery.flexbox.css' >"; } function getJoiners(){ return $this->getClasses('joiner'); } function getComparisons(){ return $this->getClasses('comparison'); } function getInputTypes(){ return $this->getClasses('input'); } function getClasses($type){ global $CustomSearchFieldStatic; if(!$CustomSearchFieldStatic['Types']){ $CustomSearchFieldStatic['Types'] = array( "joiner"=>array( "PostDataJoiner" =>__( "Post Field",'wp-custom-fields-search'), "CustomFieldJoiner" =>__( "Custom Field",'wp-custom-fields-search'), "CategoryJoiner" =>__( "Category",'wp-custom-fields-search'), "TagJoiner" =>__( "Tag",'wp-custom-fields-search'), "PostTypeJoiner" =>__( "Post Type",'wp-custom-fields-search'), ), "input"=>array( "TextField" =>__( "Text Input",'wp-custom-fields-search'), "DropDownField" =>__( "Drop Down",'wp-custom-fields-search'), "RadioButtonField" =>__( "Radio Button",'wp-custom-fields-search'), "HiddenField" =>__( "Hidden Constant",'wp-custom-fields-search'), ), "comparison"=>array( "EqualComparison" =>__( "Equals",'wp-custom-fields-search'), "LikeComparison" =>__( "Phrase In",'wp-custom-fields-search'), "WordsLikeComparison" =>__( "Words In",'wp-custom-fields-search'), "LessThanComparison" =>__( "Less Than",'wp-custom-fields-search'), "MoreThanComparison" =>__( "More Than",'wp-custom-fields-search'), "AtMostComparison" =>__( "At Most",'wp-custom-fields-search'), "AtLeastComparison" =>__( "At Least",'wp-custom-fields-search'), "RangeComparison" =>__( "Range",'wp-custom-fields-search'), //TODO: Make this work... // "NotEqualComparison" =>__( "Not Equal To",'wp-custom-fields-search'), ) ); $CustomSearchFieldStatic['Types'] = apply_filters('custom_search_get_classes',$CustomSearchFieldStatic['Types']); } return $CustomSearchFieldStatic['Types'][$type]; } function plugin_menu(){ add_options_page('Form Presets','WP Custom Fields Search',8,__FILE__,array(&$this,'presets_form')); } function getPresets(){ $presets = array(); foreach(array_keys($config = $this->getConfig()) as $key){ if(strpos($key,'preset-')===0) { $presets[$key] = $key; if($name = $config[$key]['name']) $presets[$key]=$name; } } return $presets; } function presets_form(){ $presets=$this->getPresets(); if(!$preset = $_REQUEST['selected-preset']){ $preset = 'preset-default'; } if(!$presets[$preset]){ $defaults = $this->getDefaultConfig(); $options = $this->getConfig(); $options[$preset] = $defaults; if($n = $_POST[$this->id][$preset]['name']) $options[$preset]['name'] = $n; elseif($preset=='preset-default') $options[$preset]['name'] = 'Default'; else{ list($junk,$id) = explode("-",$preset); $options[$preset]['name'] = 'New Preset '.$id; } update_option($this->id,$options); $presets[$preset] = $options[$preset]['name']; } if($_POST['delete']){ check_admin_referer($this->id.'-editpreset-'.$preset); $options = $this->getConfig(); unset($options[$preset]); unset($presets[$preset]); update_option($this->id,$options); list($preset,$name) = each($presets); } $index = 1; while($presets["preset-$index"]) $index++; $presets["preset-$index"] = __('New Preset','wp-custom-fields-search'); $linkBase = $_SERVER['REQUEST_URI']; $linkBase = preg_replace("/&?selected-preset=[^&]*(&|$)/",'',$linkBase); foreach($presets as $key=>$name){ $config = $this->getConfig($key); if($config && $config['name']) $name=$config['name']; if(($n = $_POST[$this->id][$key]['name'])&&(!$_POST['delete'])) $name = $n; $presets[$key]=$name; } $plugin=&$this; ob_start(); wp_nonce_field($this->id.'-editpreset-'.$preset); $hidden = ob_get_contents(); $hidden.="<input type='hidden' name='selected-preset' value='$preset'>"; $shouldSave = $_POST['selected-preset'] && !$_POST['delete'] && check_admin_referer($this->id.'-editpreset-'.$preset); ob_end_clean(); include(dirname(__FILE__).'/templates/options.php'); } function process_tag($content){ $regex = '/\[\s*wp-custom-fields-search\s+(?:([^\]=]+(?:\s+.*)?))?\]/'; return preg_replace_callback($regex, array(&$this, 'generate_from_tag'), $content); } function process_shortcode($atts,$content){ return $this->generate_from_tag(array("",$atts['preset'])); } function generate_from_tag($reMatches){ global $CustomSearchFieldStatic; ob_start(); $preset=$reMatches[1]; if(!$preset) $preset = 'default'; wp_custom_fields_search($preset); $form = ob_get_contents(); ob_end_clean(); return $form; } } global $CustomSearchFieldStatic; $CustomSearchFieldStatic['Inputs'] = array(); $CustomSearchFieldStatic['Types'] = array(); class AdminDropDown extends DropDownField { function AdminDropDown($name,$value,$options,$params=array()){ AdminDropDown::__construct($name,$value,$options,$params); } function __construct($name,$value,$options,$params=array()){ $params['options'] = $options; $params['id'] = $params['name']; parent::__construct($params); $this->name = $name; $this->value = $value; } function getHTMLName(){ return $this->name; } function getValue(){ return $this->value; } function getInput(){ return parent::getInput($this->name,null); } } if (!function_exists('json_encode')) { function json_encode($a=false) { if (is_null($a)) return 'null'; if ($a === false) return 'false'; if ($a === true) return 'true'; if (is_scalar($a)) { if (is_float($a)) { // Always use "." for floats. return floatval(str_replace(",", ".", strval($a))); } if (is_string($a)) { static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"')); return '"' . str_replace($jsonReplaces[0], $jsonReplaces[1], $a) . '"'; } else return $a; } $isList = true; for ($i = 0, reset($a); $i < count($a); $i++, next($a)) { if (key($a) !== $i) { $isList = false; break; } } $result = array(); if ($isList) { foreach ($a as $v) $result[] = json_encode($v); return '[' . join(',', $result) . ']'; } else { foreach ($a as $k => $v) $result[] = json_encode($k).':'.json_encode($v); return '{' . join(',', $result) . '}'; } } } function wp_custom_fields_search($presetName='default'){ global $CustomSearchFieldStatic; if(strpos($presetName,'preset-')!==0) $presetName="preset-$presetName"; $CustomSearchFieldStatic['Object']->renderWidget(array('widget_id'=>$presetName,'noTitle'=>true),array('number'=>$presetName)); } function compat_method_exists($class,$method){ return method_exists($class,$method) || in_array(strtolower($method),get_class_methods($class)); }

    Read the article

  • wp e-commerce php modification

    - by user1015687
    Here are a few lines of code from a wordpress plugin (WP E-commerce) that calculate the price. Now what i want is that if 'cart_item' are more than 3 in quantity then the price should be (number of items * 4) else the function should work as it is listed below. Thnks for help. function calculate_subtotal($for_shipping = false) { 1047 global $wpdb; 1048 if($for_shipping == true ) { 1049 $total = 0; 1050 foreach($this->cart_items as $key => $cart_item) { 1051 if($cart_item->uses_shipping == 1) { 1052 $total += $cart_item->total_price; 1053 } 1054 } 1055 } else { 1056 $total = 0; 1057 if($this->subtotal == null) { 1058 foreach($this->cart_items as $key => $cart_item) { 1059 $total += $cart_item->total_price; 1060 } 1061 $this->subtotal = $total; 1062 } else { 1063 $total = $this->subtotal; 1064 } 1065 } 1066 return $total; 1067 }

    Read the article

  • How to find distance between two geopoints in c using calculateDistance(const CWaypoint& wp)

    - by Harsha
    void getAllDataByPointer(string *pname,double *platitude, double *plongitude); void getAllDataByReference(string &pname,double &platitude, double &plongitude); double calculateDistance(const CWaypoint& wp); void print(int format); bool less(const CWaypoint& wp_right); CWaypoint add(const CWaypoint& wp_right); These are the functions I am using. I have the values as output but how to call the latitude values of two different cities so that I can use the following formula distance = ERADIUS * (acos(sin(latitude_1)*sin(latitude_2) + cos(latitude_1) * cos(latitude_2)*cos(longitude_2 - longitude_1)));

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >