Changeset 1344100
- Timestamp:
- 02/05/2016 03:26:45 PM (10 years ago)
- Location:
- multi-language-site-basis/trunk
- Files:
-
- 3 edited
-
____dashboard_options.php (modified) (2 diffs)
-
index.php (modified) (5 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
multi-language-site-basis/trunk/____dashboard_options.php
r1335013 r1344100 736 736 Include this post into GROUP ID: '; 737 737 $group_array = GetGroupByPostID__MLSS($post->ID); 738 echo '<input type="text" name="mlss_group_id" value="'. ($group_array ? $group_array->groupId : '' ) .'" placeholder="'.(($post->ID)*3+31).'"/> (<a href="javascript:alert(\'In this field, you should insert the unique GROUP ID number.. for example, when you open several different language posts as alternatives of each another, then use the same GROUP ID for them. So, when your visitor clicks the LANGUAGE FLAG in the dropdown, he will not be redirected simply to the chosen LANGUAGE MAIN-PAGE, but directly to the translated ALTERNATIVE page.\r\n\r\n\r\np.s. If this is a completely new post, and the field is empty, then you should see the recommended UNIQUE ID. So, you can actually use that ID as new UNIQUE INDEX ...\');">Read This Popup!</a>)';738 echo '<input type="text" name="mlss_group_id" value="'. ($group_array ? $group_array->groupId : '' ).'" placeholder="i.e.'.(($post->ID)*2+31) .' "/> (<a href="javascript:alert(\'In this field, you should insert the unique GROUP ID number.. for example, when you open several different language posts as alternatives of each another, then use the same GROUP ID for them. So, when your visitor clicks the LANGUAGE FLAG in the dropdown, he will not be redirected simply to the chosen LANGUAGE MAIN-PAGE, but directly to the translated ALTERNATIVE page.\r\n\r\n\r\np.s. If this is a completely new post, and the field is empty, then you should see the recommended UNIQUE ID. So, you can actually use that ID as new UNIQUE INDEX ...\');">Read This Popup!</a>)'; 739 739 } 740 740 // "POST ALTERNATIVE TRANSLATION" MetaBoxes( for Typical POSTS) … … 743 743 function savpst_22__MLSS( $post_id ){ global $wpdb; 744 744 if(isset($_POST['post_ID']) && isset($_POST['mlss_group_id']) ) { 745 $Keyname = $_POST['post_type']; 745 746 if ($post_id==$_POST['post_ID']){ 746 747 //if group id empty, then remove THIS post id from table 747 748 if (empty($_POST['mlss_group_id'])){ 748 UPDATEE_OR_INSERTTT__MLSS(OldTablePostsRel__MLSS, array($_POST['post_type'] => '' ), array($_POST['post_type'] => $post_id ) ); 749 //we are removing the post from table, only when it existed alread (because on first post PUBLISH, it GROUP_ID is empty by default , and in that case, we dont need to take any action) 750 $exists = $wpdb->get_var($wpdb->prepare('SELECT IDD from '.OldTablePostsRel__MLSS." WHERE $Keyname ='%d'", $post_id)); 751 if (!empty($exists)) { 752 UPDATEE_OR_INSERTTT__MLSS(OldTablePostsRel__MLSS, array( $Keyname => '' ), array( $Keyname => $post_id ) ); 753 } 754 //$res= $wpdb->delete( $table, $where, $where_format = null ) 749 755 } 750 756 else{ 751 UPDATEE_OR_INSERTTT__MLSS(OldTablePostsRel__MLSS, array( $_POST['post_type']=> $post_id ), array('groupId'=> $_POST['mlss_group_id']) );757 UPDATEE_OR_INSERTTT__MLSS(OldTablePostsRel__MLSS, array( $Keyname => $post_id ), array('groupId'=> $_POST['mlss_group_id']) ); 752 758 } 753 759 -
multi-language-site-basis/trunk/index.php
r1343176 r1344100 3 3 * Plugin Name: MultiLanguage Site 4 4 * Description: Build a Multi-Language Site. This plugin gives you a good framework. After activation, read the explanation. (P.S. OTHER MUST-HAVE PLUGINS FOR EVERYONE: http://bitly.com/MWPLUGINS ) 5 * Version: 1.7 35 * Version: 1.74 6 6 */ 7 define('version__MLSS', 1.7 3);7 define('version__MLSS', 1.74); 8 8 9 9 if ( ! defined( 'ABSPATH' ) ) exit; //Exit if accessed directly … … 292 292 if ( !is_404() && !is_page() && !is_single() && !is_search() && !is_archive() && !is_admin() && !is_attachment() && !is_author() && !is_category() && !is_front_page() && !is_home() && !is_preview() && !is_tag()) { echo '<meta name="robots" content="noindex, nofollow"><!-- by MLSS -->'; } 293 293 } 294 //DETECT ROOT CATEGORY slug for current post294 //DETECT ROOT CATEGORY slug for current 'post' 295 295 function PostRootCatDetect__MLSS ($postid=false, $catid=false) { $catParent=''; 296 if (!$postid){ $postid=$GLOBALS['post']->ID;}297 if (!$catid) {$ bla3423525=get_the_category($postid); if (!empty($bla3423525[0])) {$catid=$bla3423525[0]->term_id;} }296 if (!$postid){ $p=$GLOBALS['post']; $postid= is_array($p) ? $p['ID'] : $p->ID; } 297 if (!$catid) {$x=get_the_category($postid); if (!empty($x[0])) {$catid=$x[0]->term_id;} } 298 298 // continue, untill a parent $catid will be null 299 299 while ($catid) { $cat = get_category($catid); $catid = $cat->category_parent; $catParent=$cat->slug; } 300 300 return $catParent; 301 301 } 302 //DETECT ROOT PAGE slug for current 'page' 303 function PageRootDetect__MLSS($postid=false, $pageid=false) { $catParent=''; 304 if (!$postid){ $p=$GLOBALS['post']; $postid=is_array($p) ? $p['ID'] : $p->ID; } 305 if (!$pageid) {$x=get_post($postid); if (!empty($x)) {$pageid=$x->post_parent;} } 306 // continue, untill a parent $pageid will be null 307 while ($pageid != 0) { $pg = get_post($pageid); $pageid = $pg->post_parent; $pslug=$pg->post_name; } 308 exit( $pslug); 309 } 310 311 302 312 //DETECT ROOT CATEGORY's LANGUAGE 303 function DetectedPostLang__MLSS($postid=false, $catid=false){ 304 $catRoot = PostRootCatDetect__MLSS($postid); if (in_array($catRoot, LANGS__MLSS())){return $catRoot;} else {return false;} 313 function DetectedPostLang__MLSS($post_ID___or_ARRAY=false, $catid=false){ $x=$post_ID___or_ARRAY; 314 if (is_array($x) || is_object($x)){ 315 if(is_array($x)) {$pTYPE=$x['post_type']; $id=$x['ID'];} 316 elseif (is_object($x)) {$pTYPE=$x->post_type; $id=$x->ID;} 317 // 318 if (in_array($pTYPE, LANGS__MLSS())){return $pTYPE;} 319 $x=$id; 320 } 321 if(is_numeric($x)) { 322 //find parent ROOT_PAGE slug (i.e. "eng") for 'page' 323 if ($pTYPE=='page') {$pageRoot= PageRootDetect__MLSS($x); if (in_array($pageRoot, LANGS__MLSS())){return $pageRoot;} } 324 //find parent CATEGORY slug (i.e. "eng") for 'post' 325 elseif($pTYPE=='post') {$catRoot = PostRootCatDetect__MLSS($x); if (in_array($catRoot, LANGS__MLSS())) {return $catRoot;} } 326 } 327 return false; 305 328 } 306 329 //INSERT VALUE IN DATABASE ===(check Updates:::: https://github.com/tazotodua/useful-php-scripts/blob/master/mysql-commands%20%28%2BWordpress%29.php ) … … 1092 1115 1093 1116 1094 1095 1096 1097 1098 1117 1099 1118 … … 1392 1411 My TO-DO-LIST::: 1393 1412 1394 1) sticky posts query ( http://goo.gl/otIDaA);1395 2) tags; autors pages should contain only langs..;1413 1) sticky posts query ( http://goo.gl/otIDaA ); 1414 2) tags; autors pages should contain only langs..; 1396 1415 3) category is found on any 404 page, if basename meets category.. 1397 4) post alternatives 1398 5) tu sxva custom-post-type-shi gamoqveynenbulia ori sxvadasxna enispostebi, mashin imis ARCHIVE_HOME-shi marto iuzeris ena iyos?? 1399 6) sequence 1416 4) tu sxva custom-post-type-shi gamoqveynenbulia ori sxvadasxna enispostebi (magalitad Woocommerce-stvis), mashin imis ARCHIVE_HOME-shi marto iuzeris ena iyos?? 1417 5) sequence 1400 1418 i.e. /eng/eng-sub 1401 1419 Homepage: … … 1421 1439 1422 1440 //======================================== check for plugin updates ======================= 1423 if ( is_admin()){1441 if (1==2){ 1424 1442 define('PluginName__MLSS', 'Multi-Language-Plugin-Simple'); define('PluginUrl__MLSS','http://plugins.svn.wordpress.org/multi-language-site-basis/trunk/index.php'); define('PluginDown__MLSS','https://wordpress.org/plugins/multi-language-site-basis/changelog/'); 1425 1443 -
multi-language-site-basis/trunk/readme.txt
r1328193 r1344100 4 4 Requires at least: 3.7 5 5 Tested up to: 4.2.1 6 Stable tag: 1.7 26 Stable tag: 1.74 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.