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

wpdb create a data table wp use case

? View Code PHP
  A 
  Two 
  Three 
  Four 
  Five 
  Six 
  July 
  August 
  September 
 10 
  November 
 12 
 13 
 14 
 15 
 16 
 17 
 18 
 19 
 20 
 21 
 22 
 23 
 24 
 25 
  26, 
 27 
  28, 
 29 
 30 
 31 
 32 
 33 
 34 
  ; global $ wpdb; 
  donators = $wpdb -> prefix . 'donators' ; //Donators Table Name $ wpdb -> donators = $ wpdb -> prefix. 'donators'; / / Donators Table Name 
  # # # Function: Create Donators Table 
  , 'install' ) ; register_activation_hook (__FILE__, 'install'); 
  function install () ( 
	  ; global $ wpdb; 

	  @ is_file ( ABSPATH . '/wp-admin/upgrade-functions.php' ) ) { if (@ is_file (ABSPATH. '/ wp-admin/upgrade-functions.php')) ( 
		  ABSPATH . '/wp-admin/upgrade-functions.php' ) ; include_once (ABSPATH. '/ wp-admin/upgrade-functions.php'); 
	  ( @ is_file ( ABSPATH . '/wp-admin/includes/upgrade.php' ) ) { ) Elseif (@ is_file (ABSPATH. '/ Wp-admin/includes/upgrade.php')) ( 
		  ABSPATH . '/wp-admin/includes/upgrade.php' ) ; include_once (ABSPATH. '/ wp-admin/includes/upgrade.php'); 
	  { ) Else ( 
		  'We have problem finding your \' /wp-admin/upgrade-functions.php \'  and \' /wp-admin/includes/upgrade.php \' ' ) ; die ( 'We have problem finding your \' / wp-admin/upgrade-functions.php \ 'and \' / wp-admin/includes/upgrade.php \ ''); 
	  ) 

	  / / Create Donators Table 
	  "CREATE TABLE $wpdb->donators (" . $ create_table = "CREATE TABLE $ wpdb-> donators (". 
			  "ID bigint (20) NOT NULL auto_increment,". 
			  "BUYER_EMAIL varchar (100) NOT NULL default'',". 
			  "ITEMNAME varchar (255) NOT NULL default'',". 
			  "ITEMNUMBER varchar (50),". 
			  "URL varchar (255),". 
			  "USER_MEMO varchar (255),". 
			  "PAYMENTDATE varchar (50) NOT NULL default'',". 
			  "TXNID varchar (30) NOT NULL default'',". 
			  "PAYMENT_GROSS varchar (10) NOT NULL default'',". 
			  "PAYMENT_FEE varchar (10) NOT NULL default'',". 
			  "MC_CURRENCY varchar (5) NOT NULL default'',". 
			  "INVOICE varchar (255) NOT NULL default'',". 
			  "PRIMARY KEY (ID));"; 
	  -> donators , $create_table ) ; maybe_create_table ($ wpdb -> donators, $ create_table); 	  

	  , "1.0" ) ; Add_option ( "donators_db_version", "1.0"); 
  ) 

codex.wordpress: Table construction documents
http://codex.wordpress.org.cn/Creating_Tables_with_Plugins

April 29th, 2008 Posted by eric | Wordpress Programming | no comments

Re: Why is Microsoft to buy Yahoo Linux?

Re: Why is Microsoft to buy Yahoo Linux? http://blog.sina.com.cn/s/blog_4e85818901008g4k.html

linux is not opensource all the world, can not even be regarded as a good example. With it too, is difficult to control and too many commercial interests involved in hosting, I do not think it will become a rival of windows, windows at least more organized.
Freebsd preferred framework by the independent authority of the elites to maintain the core of development, in the open on the basis of their own, inclusive of the world. Due to such a manner so that freebsd stability and rich. In fact, "since ancient times to the" large-scale systems in this way are the mainstream of development. Do not agree with you, think about TCP / IP with the RFC.
If Bo from the main responsibility for the acquisition of the point of view of things, microsoft real game of the other party should be Freebsd, TCP / IP represented existed since ancient times and has been very successful model for the development of large-scale systems. That is, by an independent team of elite lay the foundation for material gain does not open and self-sacrifice and absorb all the fine elements of self-achievement. This is like microsoft such a business is unable to face the bane, but microsoft is bound to face one day, Bill.G will see.

April 8th, 2008 Posted by eric | Unix / BSD / Linux, the impression mind | no comments

My Freebsd Setting

Former chapter: FreeBSD standard setup and tuning [load]

Subsection 1: ssh configuration

ee / etc / rc.conf
/ / If there sshd_enable = "YES" then we have to open an ssh server, if not, please add.

ee / etc / ssh / sshd_config
/ / Find # PermitRootLogin no line, remove the # sign in front, then the back of no change yes, according to the ESC and then double-save from the carriage return. If you can use VI.

/ / Restart the SSH service
/ etc / rc.d / sshd restart

Subsection 2: Update system

/ / Cvsup installation procedure. cvsup from a remote server hosts the main cvs (1) distributed database and update the tree-source software package used to update the operating system and software.
setenv PACKAGEROOT "ftp://ftp.freebsdchina.org/"
setenv PACKAGESITE "ftp://ftp.freebsdchina.org/pub/FreeBSD/ports/i386/packages-7.0-release/Latest/" OR
/ / At / etc / profile, quickly set up the domestic packagesite
export PACKAGESITE = ftp://ftp.freebsdchina.org/pub/FreeBSD/ports/i386/packages-7.0-release/Latest/
export PACKAGEROOT = ftp://ftp.freebsdchina.org/

pkg_add-r cvsup-without-gui
rehash

/ / Now we can use the cvsup, first of all-source software package to update ports.
cp / usr / share / examples / cvsup / ports-supfile ~ root

Update servers:

ee ~ root / ports-supfile
/ / * default host = CHANGE_THIS.FreeBSD.org
/ / In order to more rapidly, generally choose from our relatively close to the server:
/ / * default host = cvsup.freebsdchina.org

Update PORTS LIST:

cvsup-g-L 2 ~ root / ports-supfile

Click to continue reading

March 23rd, 2008 Posted by eric | Unix / BSD / Linux | no comments

Stock before and after the first priority before and after the placement of shares and the corresponding strategy Trader

First, the former first-priority sector strategies and operations of the investor's strategy

1, the stock before the first priority, if the market at this time in a wave of Shenglang the main market in the stock market or from the stage at the bottom of the inversion started to rise, the market will have the right to scramble, stock prices rise faster than the market's gains, trading volume significantly Amplification. At this point, the agency will be shipped in small quantities, robbed of the right to force people to sell part of the hands of the chips. Finishing high price to maintain the momentum, after a first-priority so as to reduce the pressure of Tianquan, after a first-priority market Tianquan lay a solid foundation. For investors, if the good performance of the stock, growth, with a large proportion, will be held immobile in order to meet the first priority after the market Tianquan, to maximize profits.

2, when the agency completed Jiancang, after Kongpan try for stock, once the market started from a high of deep down, usually behind high of bargain-hunting mode, so that the share price back up small, so that both can be maintained in the hands of The ratio of chips, after a first-priority Tianquan to prepare, low-cost can be shared to reduce the risk. For investors, the study should be noted that the general trend toward institutional Kong Pan's strength and potential of the unit, decided to make a choice.

Second, after a first-priority sector of the operation's strategy and investment strategy

1, when the stock market rise in first-priority claim on stage, the agency is bound to use the situation to the good development of the stock market Tianquan. Will be made on a first-priority claim in a small market Tianquan, a week after a high throw bargain-hunting, pre-digested more profitable chips, to maintain a small price fluctuations, staggered yin and yang, the suction foot chip, which launched a substantial increase in Tianquan Market. Trader way for the rising wave Ⅲ structure, Ⅰ wave first priority to fill the gap 1 / 4, then yin and yang of staggered sideways to make adjustments, or small yin-yang small 3-5 days or ease the way to adjust. Bargain-hunting agency at this time, to maintain a small price fluctuations in order to attract follow the trend set. Then embarked on the most violent waves of up Ⅱ, the first priority to fill the gap 50% -70%, the agency began to try for the ship, then stock prices started the day 1-3 down, the gap dropped back to 1 / 2, whether or not to fill Or the right to another record high, will be determined at this time of market trends and the performance of the stock in the future could increase. If there is a change in the market, the agency will be distributed on the topping-out to shock all the chips in the future with the stock market fluctuations, not an outstanding performance. If the company was also good follow-up to the subject matter, the agency will adopt the high-throw bargain-hunting mode, the maintenance of the hands of some of the chips. As investors may pay close attention to the market's upward trend, stock and the potential magnitude of the rise.

2, a first-priority claim on the stock. At the stage at the top of the market begin to come down, the stock is very likely out of the market for a right to paste. Would normally be left high bargain-hunting, multi-bottom, to maintain the shock box, in order to share the cost, time to seek a breakthrough. When the market reversed rise, the agency began near the top box-top boxes to maintain Xihuo sideways 5-10, to follow the trend of attracting disk, and then in the top box with a big bang breakthrough try for the rapid phase of the market peaked at the right or fill out Out all the chips. Investors in the stock on a first-priority should be based on market trend, shares the priorities to make the difference. If the stock before and after the first priority, the market is moving from the high point drop the previous phase. Investors are on a first-priority should be to seek high-shipment point, at least to be a firm commitment to sell the original shares, leaving behind Real and then do a high bargain-hunting, the share of low-cost, resolve to seek opportunities in the market and reverse rising , The top price in the box sideways for the past few days, with a big bang breakthrough in the box at the top in bold with the right to fill the post until the unit out sideways.

Third, the placement of shares of stock before and after the operation strategy of institutional investors and Strategy

Of such shares changing the way agencies operate, which is the approach used in the Board of Directors to issue shares before the announcement, shares on the try for a platform, finishing sideways, to make the 2nd Pan Sheng platform of the situation, follow the trend set to attract, then a platform in the region Step by step to ship in 2-3 days before the date of registration to the remaining part of the chip surface Mengza As a result, shares a platform broke down, forcing the regional platform for reinforcing the same message Zhancang set out, take advantage of low body into the next part of the chip, a first-priority claim on the same day Zapan again, so that the first priority after the follow-up once more Zhan Cang out investors. At this point fully Jiancang, try for a certain day trading volume, up more than 30%, followed by Create remittance advices for the distribution of the hands of chips, Trader strategy can be summed up in two birds with one stone: First, follow the trend set in force before and after the two first-priority Zhancang Out to obtain a large number of low chip; second, not the former first-priority access into a large number of chips, only dished out high, low back to the small number of shares involved in a bargaining chip, saving a lot of money. This is part of a small amount of chips as the second Zapan used, not for profit, and followed by a first-priority to enter the stock does not pay the prices as profit. For investors, the stock more difficult to operate that type of risk and are more difficult to master, or a pure concern for the stock Tianquan Real good. Tianquan shares of stock unless the company excellent prospects for development, only a small amount, otherwise it will not intervene in or better.

March 14th, 2008 Posted by eric | Investment feelings | no comments

Wordpress database and that wpdb Class

To collate the following information network of non-original

The following are wp-2.0.5 version of the database structure of (ER diagram). Here only lists the primary key and foreign key. Diamond-shaped figure that 1: n relationship, as part of a white, black as part of the n.

wordpress-db-er-diagram.png

Wordpress A total of 10 tables, divided into four categories according to function.

  • user: user information, including wp_users table and wp_usermeta table.
  • post: The article reviews and information, including wp_posts, wp_postmeta, wp_comments, wp_post2cat, as well as five wp_categories table.
  • link: links, including wp_links table and wp_linkcategories table.
  • option: setting the overall situation, including wp_options table.

Table of naming is very interesting. Sum up the basic rules are as follows:

  • To preserve the basic properties of the object, named wp_objects, the use of the plural (for example, wp_posts, wp_comments);
  • Save the expansion of the object attributes, named wp_objectmeta, the use of the singular (for example, wp_postmeta, wp_usermeta);
  • Many-to-many relationship, named wp_a2b, which were b and a many-to-many relationship between the two ends of the object's name abbreviation (for example, wp_post2cat).
WPDB category

http://codex.wordpress.org.cn/Function_Reference/wpdb_Class

http://codex.wordpress.org/Function_Reference/wpdb_Class

Database description

http://codex.wordpress.org/Database_Description # Table_Overview

wp_categories: for the preservation of classified information related to the table. 5, including the field are:

  • cat_ID - each unique ID number classifications for a bigint (20) value, and with additional properties auto_increment.
  • cat_name - a classification name for a varchar (55) value.
  • category_nicename - the classification assigned to a user-friendly names to remember, that is, the so-called slug, this is a varchar (200) value.
  • category_description - a detailed description of the classification, longtext-value.
  • category_parent - the higher the classification categories, as a int (4) value, corresponding to the current table is the cat_ID, that is, wp_categories.cat_ID. No higher level classification, the value is 0.

Click to continue reading

March 12th, 2008 Posted by eric | Database, Wordpress Programming | no comments

PayPal PHP interface

PayPal fast, safe and convenient cross-border trading is the preferred online payment method. PayPal can be now and most of the domestic credit card association, people can achieve the balance of payments cross-border transactions.
PayPal to apply for registration of Web site: https: / / www.paypal.com/

paypal interface with other interface is somewhat different, a little bit complicated. In fact, the bank interface is also a site of the plug-in.

The so-called paypal ipn (Instant Payment Notification), developed by Paypal is a third-party sellers to take the initiative to inform the trading system as a mechanism for the state. The IPN is very simple principle, that is generated when a transaction, the transaction status changes, such as the user has to pay, or refund, when it revoked, Paypal use of commonly used HTTP POST methods, some of the transaction will be submitted to the Web site of the variables A page (referred to as IPN Handler), when this page request received, these data untouched instructions to add a proven cmd = _notify-validate, POST back to the Paypal address of the interface, if the data is correct, then Paypal Return string VERIFIED, or as INVALID, if the result is VERIFIED, then your program will be able to use these data to carry out the operation.

Sandbox open account

However, the debugging code is a very painful thing, because as a third-party developers, it is not possible to open two accounts, each would also like to test some of the transactions between the money, so Paypal has developed a specialized Sandbox to the developers for development, first of all To https: / / developer.paypal.com / registration of a development account, well after the establishment of re-entering the Sandbox test of virtual Paypal account (at least to establish a Business and one of the Personal), this method of registration and Paypal account of the Process, information is false, including bank accounts, credit cards (in fact Paypal Sandbox automatically generate a number of random numbers). The next step to activate Paypal Sandbox virtual account, pay attention to, no matter where you fill in registration Paypal Sanbox what e-mail address, any virtual account number to send the filled-mail messages are kept in the development of account management interface of the page Email ( There are navigation bar). Virtual Sandbox log on Paypal, also need to verify that the virtual bank account, you can not fill, and then to Add Funds to recharge account (fill in the number of how many would like to fill 920-203 920-533). Then, the IPN also need to activate the option of Business in the accounts of the Profile settings page, click, and then click Edit button to open the IPN, here if you are using a fixed IPN Handle, that could fill in the address.

Next, we tested, Paypal should be the address of the interface is set to https: / / www.sandbox.paypal.com / cgi-bin / webscr

1 2 3 4

March 11th, 2008 Posted by eric | Coding, Web technology | no comments

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