Eric @ EricBess WebHome

Wins do not arrogant, not to lose hungry, there is shock chest and face, such as mine Pinghu

Chinese (Simplified) flagItalian flagKorean flagPortuguese flagEnglish flagGerman flagFrench flagSpanish flagJapanese flagArabic flagRussian flagGreek flagDutch flagBulgarian flagCzech flagCroat flagDanish flagFinnish flagHindi flagPolish flagRumanian flagSwedish flagNorwegian flag
By N2H

Rewrite Permalinks in plugin development.

We add a rewrite rule that tells WordPress to interpret / geostate / oregon URLs the same as? Geostate = oregon.
there are two steps:

(1) "flush" the cached rewrite rules using an init filter, to force WordPress to recalculate the rewrite rules,
  add_action ( 'init', 'geotags_flush_rewrite_rules'); 

  function geotags_flush_rewrite_rules () 
  ( 
     global $ wp_rewrite; 
     $ wp_rewrite-> flush_rules (); 
  ) 
(2) use the generate_rewrite_rules action to add a new rule when they are calculated. Here's the "flush" code:
  add_action ( 'generate_rewrite_rules',' geotags_add_rewrite_rules'); 

  function geotags_add_rewrite_rules ($ wp_rewrite) 
  ( 
    $ new_rules = array ( 
       'geostate /(. )' =>' index.php? geostate = '. 
         $ wp_rewrite-> preg_index (1)); 

    $ wp_rewrite-> rules = $ new_rules   $ wp_rewrite-> rules; 
  ) 

July 7th, 2008 Posted by eric | Wordpress Programming, unclassified | no comments

Mod_rewrite using load balanced

APACHE mode_rewrite read the document, referred to rewrite some of the methods used to achieve load balance method, the record.

Load balanced

Description:

How to balance www.foo.com load to www[0-5].foo.com total of 6 server)?

:

There are many issues that may be the solution here, we discussed what is known as the "based on DNS (DNS-based)" program, and special use mod_rewrite program:

  1. DNS cycle (DNS Round-Robin)

    The easiest way is to use BIND for DNS characteristics of the cycle, as long as the practice set up www[0-9].foo.com the DNS of the A (address) records, such as:

      www0 IN A 1.2.3.1 
      www1 IN A 1.2.3.2 
      www2 IN A 1.2.3.3 
      www3 IN A 1.2.3.4 
      www4 IN A 1.2.3.5 
      www5 IN A 1.2.3.6 
    

    Then, add the following:

      www IN CNAME www0.foo.com. 
             IN CNAME www1.foo.com. 
             IN CNAME www2.foo.com. 
             IN CNAME www3.foo.com. 
             IN CNAME www4.foo.com. 
             IN CNAME www5.foo.com. 
             IN CNAME www6.foo.com. 
    

    Note that the above may seem wrong, but a matter of fact, it is BIND a desired characteristics, but also can be used. In any case, now www.foo.com resolution has BIND BIND can be given www0-www6 though each will be on the order of the minor replacement / cycle, the client's request can be distributed among the various servers. However, this is not a good load balancing because, DNS resolution information can be the name of the other network server buffer, and once www.foo.com for the resolution was wwwN.foo.com while its follow-up request will be sent to To www.foo.com But the end result is correct, because the request was indeed the total distributed to the various servers

Click to continue reading

July 5th, 2008 Posted by eric | System | no comments

Jquery results: sliding panels

[html code = 'y']

Slide Panel

[/ html]

July 4th, 2008 Posted by eric | Web technology | no comments

PHP Paypal IPN Class

NEW VERSION

I rewrite the class, release the Version: 1.3.1
v1.3.1 [06.25.2008] - more strict ipn validation, ssl fsockopen (), sandbox option.

Donate for this class development, Thanks!

This free PHP script provides a simple method to interface with paypal and the paypal Instant Payment Notification (IPN) system. It is not a complete system but a single PHP class allowing the PHP developer more control. Included in the zip file is a demonstration PHP script called paypal.php which shows the basic usage of the class.


This class handles the submission of an order to paypal as well as the processing an Instant Payment Notification (IPN). Including the demonstration file, the entire "paypal system" consists of just 2 PHP scripts. Once is the class and one implements the class .

Original Author: Micah Carrick
Website: http://www.micahcarrick.com

UPDATE DESCRIPTION

More Strict IPN Validation: add ipn_status and receiver mail validation.

  • $ p-> ipn_status / / get the ipn validation status detial.

SSL fsockopen (): change the fsockopen http (80) to ssl (443) / / paypal ipn (80) support unstable.

Sandbox Option: Create a "sandbox" account for a buyer and a seller. This is just a test account (s) that allow you to test your site from both the seller and buyer perspective. The instructions for this is available at https: / / developer.paypal.com / as well as a great forum where you can ask all your paypal integration questions. Make sure you follow all the directions in setting up a sandbox test environment, including the addition of fake bank accounts and credit cards.

  • $ p = new paypal_class (true); / / open sandbox
  • $ p = new paypal_class (false); / / live use

Click to continue reading

June 27th, 2008 Posted by eric | Coding, Web technology | no comments

One guy WP-Codebox release suggestion

Hello --

Let me first tell you that I love this plugin. Today I had the brilliant idea of changing the ' ' and '-' symbol that are in the upper right corner of the box. I wanted to use an image instead. At first I just changed the 'main.php' file. That made the images appear fine when the page loaded. Although, once clicked on, it would go back to the text version. I determined that the problem was with the javascript file. I found where I though should be changed and I got it to work fine in Firefox, but it's getting stuck in Internet Explorer.

I've attached a text file of the changes that I've made. Is there any way that you can help me out with this?

Thank you so much!

Bill Fisher

Click to continue reading

June 20th, 2008 Posted by eric | Wordpress Programming | no comments

PayPal IPN process

PAYPAL instant payment notification (IPN) is used PayPal to identify and deal with real-time purchase of server to server communications interface. IPN send the PayPal payment you receive immediate notification and confirmation, and provide payments to be, has been canceled or failure of the state of transactions and other data.

IPN can be used to customize a variety of management and the opening of PayPal's API and communications, including:

  • Custom Web site for customers shopping in real time back
  • Through IPN "transmit" variable to track customers
  • To download the software and other digital products, the distribution of key visit
  • Automatically carry out operations
  • Partners to track sales and commissions
  • In your own database to store information on the transaction

PayPal Sign up now and begin to accept credit card payments.

Search variable

Carried out after the payment, PayPal will be sent to POST through PayPal server notify_url variables specified in the notice sent URL. The script is above the designated paypal_ipn_handler.php, so the creation of this document, and as such the following definition of it:

? View Code PHP
 1 
 2 
 3 
 4 
 5 
 6 
 7 
 8 
 9 
 10 
 11 
  Of 12 
 13 
  <? Php 
  'includes/user_functions.php' ) ; include ( 'includes / user_functions.php'); 
  'includes/shared_functions.php' ) ; include ( 'includes / shared_functions.php'); 

  / / Assign posted variables to local variables 
  $_POST [ 'payment_status' ] ; $ payment_status = $ _POST [ 'payment_status']; 
  $_POST [ 'mc_gross' ] ; $ amountDue = $ _POST [ 'mc_gross']; 
  $_POST [ 'txn_id' ] ; $ txn_id = $ _POST [ 'txn_id']; 
  $_POST [ 'mc_currency' ] ; $ payment_currency = $ _POST [ 'mc_currency']; 
  $_POST [ 'custom' ] ; $ cartid = $ _POST [ 'custom']; 
  $_POST [ 'business' ] ; $ my_email = $ _POST [ 'business']; 
  $_POST [ 'payer_email' ] ; $ email = $ _POST [ 'payer_email']; 
  ... 

First of all, through PayPal to send POST over an important variable in the preservation of local variables.

Verify payment

To pay for a way to verify is: to collect from PayPal to send over the variables and send them through the re-POST. Continue to define paypal_ipn_handler.php, add the following code:

Click to continue reading

June 15th, 2008 Posted by eric | Coding | no comments

4 5 6 7 8 9 10 » ... Last » Page 3 of 27 «1 2 3 4 5 6 7 8 9 10» ... Last »