Plugin Directory

Changeset 1344100


Ignore:
Timestamp:
02/05/2016 03:26:45 PM (10 years ago)
Author:
selnomeria
Message:

minor update

Location:
multi-language-site-basis/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • multi-language-site-basis/trunk/____dashboard_options.php

    r1335013 r1344100  
    736736            Include this post into GROUP ID: ';
    737737            $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>)';
    739739    }
    740740    //  "POST ALTERNATIVE TRANSLATION"  MetaBoxes( for Typical POSTS)
     
    743743    function savpst_22__MLSS( $post_id ){  global $wpdb;
    744744        if(isset($_POST['post_ID']) && isset($_POST['mlss_group_id']) ) {
     745            $Keyname = $_POST['post_type'];
    745746            if ($post_id==$_POST['post_ID']){
    746747                //if group id empty, then remove THIS post id from table
    747748                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 )
    749755                }
    750756                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']) );
    752758                }
    753759                   
  • multi-language-site-basis/trunk/index.php

    r1343176 r1344100  
    33 * Plugin Name: MultiLanguage Site
    44 * 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.73
     5 * Version: 1.74
    66 */
    7 define('version__MLSS', 1.73);
     7define('version__MLSS', 1.74);
    88
    99if ( ! defined( 'ABSPATH' ) ) exit; //Exit if accessed directly
     
    292292        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 -->'; }
    293293    }   
    294 //DETECT ROOT CATEGORY slug for current post
     294//DETECT ROOT CATEGORY slug for current 'post'
    295295    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;} }
    298298        // continue, untill a parent $catid will be null
    299299        while ($catid)  { $cat = get_category($catid);  $catid = $cat->category_parent;  $catParent=$cat->slug; }
    300300        return $catParent;
    301301    }
     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
    302312//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;
    305328    }
    306329//INSERT VALUE IN DATABASE  ===(check Updates:::: https://github.com/tazotodua/useful-php-scripts/blob/master/mysql-commands%20%28%2BWordpress%29.php )
     
    10921115   
    10931116   
    1094        
    1095        
    1096        
    1097    
    10981117   
    10991118   
     
    13921411My TO-DO-LIST:::
    13931412 
    1394 1) sticky posts query (http://goo.gl/otIDaA);
    1395 2)tags; autors pages should contain only langs..;
     14131) sticky posts query ( http://goo.gl/otIDaA );
     14142) tags; autors pages should contain only langs..;
    139614153) 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
     14164) tu sxva custom-post-type-shi gamoqveynenbulia ori sxvadasxna enispostebi (magalitad Woocommerce-stvis), mashin imis ARCHIVE_HOME-shi marto iuzeris ena iyos??
     14175) sequence
    14001418    i.e.  /eng/eng-sub
    14011419    Homepage:
     
    14211439
    14221440//======================================== check for plugin updates =======================
    1423 if (is_admin()){
     1441if (1==2){
    14241442    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/');
    14251443   
  • multi-language-site-basis/trunk/readme.txt

    r1328193 r1344100  
    44Requires at least: 3.7
    55Tested up to: 4.2.1
    6 Stable tag: 1.72
     6Stable tag: 1.74
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.