User Tools

Site Tools


wordpress

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wordpress [2009/08/05 07:26] suapapawordpress [2013/08/03 05:04] (current) – external edit 127.0.0.1
Line 8: Line 8:
 DELETE FROM wp_posts WHERE post_type = "revision"; DELETE FROM wp_posts WHERE post_type = "revision";
 </code> </code>
 +  *[[http://luv4.us/archives/1626|WP 자동저장/리비전 기능 조절하기]]
 <code python> <code python>
 mport MySQLdb mport MySQLdb
  
-db = MySQLdb.connect(db='suapapa_blog', user='blog_admin', passwd='enakflxhRl', host='localhost')+db = MySQLdb.connect(db='suapapa_blog', user='blog_admin', passwd='******', host='localhost')
 c = db.cursor() c = db.cursor()
 c.execute('DELETE FROM wp_posts WHERE post_type = "revision"') c.execute('DELETE FROM wp_posts WHERE post_type = "revision"')
Line 32: Line 33:
  
 db.commit() db.commit()
- 
- 
 </code> </code>
  
 +====== 다국어 지원 ======
 +  *[[http://wordpress.org/extend/plugins/tags/multilingual|다국어지원 플러그인들]]
 +===== wp_multilingual =====
 +저장된 번역은 다음과 같이 쌍으로 존재함.
 <code mysql> <code mysql>
-mysql> desc wp_postmeta; +select meta_id,post_id,meta_key from wp_postmeta; 
-+------------+--------------+------+-----+---------+----------------+ +|    1338     421 translations        
-Field      | Type         | Null | Key | Default | Extra          | +|    1339 |     421 searchsyn           |
-+------------+--------------+------+-----+---------+----------------+ +
-| meta_id    bigint(20)   NO   | PRI | NULL    | auto_increment +
-post_id    bigint(20)   | NO   | MUL | 0                      | +
-| meta_key   | varchar(255) | YES  | MUL | NULL    |                | +
-| meta_value | longtext     | YES      | NULL    |                | +
-+------------+--------------+------+-----+---------+----------------+ +
-4 rows in set (0.00 sec)+
 </code> </code>
- +/home/suapapa/wp-content/plugins/wp-multilingual/multilingual.php
-======== wp_multi+
 <code php> <code php>
 +$str = serialize(array(base64_encode(serialize(unserialize(serialize($translation))))));
 +...
 $GLOBALS['wpdb']->query( $GLOBALS['wpdb']->query(
 "INSERT INTO ".$GLOBALS['table_prefix']. "INSERT INTO ".$GLOBALS['table_prefix'].
-"postmeta (post_id,meta_value,meta_key) VALUES ('".$item['ID']."', '".$str ."', 'translations')");+"postmeta (post_id,meta_value,meta_key) VALUES ('".$item['ID']."', '".$str ."', 'translations')"); #알수없게 인코딩된 데이타
 $GLOBALS['wpdb']->query( $GLOBALS['wpdb']->query(
 "INSERT INTO ".$GLOBALS['table_prefix']. "INSERT INTO ".$GLOBALS['table_prefix'].
-"postmeta (post_id,meta_value,meta_key) VALUES ('".$item['ID']."', '".WP_Multilingual::SafeVar(serialize(unserialize(serialize($translation))))."', 'searchsyn')");+"postmeta (post_id,meta_value,meta_key) VALUES ('".$item['ID']."', 
 +'".WP_Multilingual::SafeVar(serialize(unserialize(serialize($translation))))."', 'searchsyn')"); #한글토막들 (regex 패턴?)
  
 </code> </code>
 +translation 데이타는 아래와 같이 찾아서 복원함.
 +<code php>
 +$translations = unserialize($item['meta_value']);
 +$translations = unserialize(base64_decode($translations[0]));
 +</code>
 +====== themes ======
 +  *[[http://getk2.com/|K2]]
 +====== references ======
 +  *[[http://codex.wordpress.org/Database_Description|WP Database Description]]
wordpress.1249457196.txt.gz · Last modified: 2013/08/03 05:04 (external edit)