WordPress.org

Plugin Directory

Changeset 723414


Ignore:
Timestamp:
06/06/13 08:44:37 (4 years ago)
Author:
dotcomdotbd
Message:

Update Notice
Update post date bugs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • shongkha/trunk/shongkha.php

    r666719 r723414  
    55Plugin URI: http://wordpress.org/extend/plugins/shongkha/ 
    66Description: A very simple plugin to change Date, Time, Months and Days in Bangla. It will change default Archive and Calendar Widget too.  
    7 Version: 1.0 
     7Version: 1.1 
    88Author: the Fanush Team 
    9 Author URI: http://fanush.edevs.net/ 
     9Author URI: http://devs.fanush.net/ 
    1010*/ 
    1111 
     
    3838 
    3939 
     40 
     41 
    4042/****************************************************** 
    4143### GET ALL URL FORM STRING/CONTENT 
     
    4345### RETURN ALL URL/LINK AS ARRAY 
    4446*****************************************************/ 
     47 
    4548function geturls($string) { 
    4649        $regex = '/https?\:\/\/[^\" ]+/i'; 
     
    4851        return ($matches[0]); 
    4952} 
     53 
     54 
    5055 
    5156 
     
    5863 
    5964 
    60 /****************************************************** 
    61 ### GET ALL QUOTE FORM STRING/CONTENT 
    62 ### PARAMETER: CONTENT 
    63 ### RETURN ALL QUOTED STRING AS ARRAY 
    64 *****************************************************/ 
    65  
    66 function get_quote($input){ 
    67     preg_match_all('~([\'"])(.*?)\1~s', $input, $result); 
    68     return ($result[0]); 
    69 } 
    7065 
    7166 
     
    7671*****************************************************/ 
    7772 
     73 
     74function get_quote($input){ 
     75    preg_match_all('~([\'"])(.*?)\1~s', $input, $result); 
     76    return ($result[0]); 
     77} 
     78 
     79 
     80 
     81 
     82 
     83/****************************************************** 
     84### GET ALL QUOTE FORM STRING/CONTENT 
     85### PARAMETER: CONTENT 
     86### RETURN ALL QUOTED STRING AS ARRAY 
     87*****************************************************/ 
     88 
     89 
    7890function en_to_bangla($content=''){ 
    7991    include('language.php'); 
     92     
     93 
    8094    $converted = replace_matches($content, array_keys($digits), $digits); 
    8195    $converted = replace_matches($converted, array_keys($days), $days); 
    8296    $converted = replace_matches($converted, array_keys($months), $months); 
     97    $converted = replace_matches($converted, array_keys($enstrings), $enstrings); 
    8398     
    8499 
     
    86101    $allurls = geturls($content); 
    87102     
    88     foreach($allurls as $url) { 
    89         $converted_digits[] = replace_matches($url, array_keys($digits), $digits); 
    90         $converted_months[] = replace_matches($converted_digits, array_keys($months), $months); 
    91         $converted_days[] = replace_matches($converted_months, array_keys($days), $days); 
    92         $all_converted_url =  array_unique(array_merge($converted_digits,$converted_months,$converted_days)); 
     103     
     104    if($allurls){ 
     105        foreach($allurls as $url) { 
     106            $converted_digits[] = replace_matches($url, array_keys($digits), $digits); 
     107            $converted_months[] = replace_matches($converted_digits, array_keys($months), $months); 
     108            $converted_days[] = replace_matches($converted_months, array_keys($days), $days); 
     109            $all_converted_url =  array_unique(array_merge($converted_digits,$converted_months,$converted_days)); 
     110        } 
     111 
     112        $converted_exclude_links = replace_matches($converted, $all_converted_url, $allurls); 
    93113    } 
    94114 
    95     $converted_exclude_links = replace_matches($converted, $all_converted_url, $allurls); 
     115     
    96116 
    97117     
     
    99119    $allquotes = get_quote($content); 
    100120     
    101     foreach($allquotes as $quote) { 
    102         $qconverted_digits[] = replace_matches($quote, array_keys($digits), $digits); 
    103         $qconverted_months[] = replace_matches($qconverted_digits, array_keys($months), $months); 
    104         $qconverted_days[] = replace_matches($qconverted_months, array_keys($days), $days); 
    105         $all_converted_quotes = array_unique(array_merge($qconverted_digits,$qconverted_months,$qconverted_days)); 
     121    if($allquotes){ 
     122         
     123        foreach($allquotes as $quote) { 
     124            $qconverted_digits[] = replace_matches($quote, array_keys($digits), $digits); 
     125            $qconverted_months[] = replace_matches($qconverted_digits, array_keys($months), $months); 
     126            $qconverted_days[] = replace_matches($qconverted_months, array_keys($days), $days); 
     127            $all_converted_quotes = array_unique(array_merge($qconverted_digits,$qconverted_months,$qconverted_days)); 
     128        } 
     129     
     130        $converted_exclude_links = replace_matches($converted, $all_converted_quotes, array_unique($allquotes));     
     131         
     132        return $converted_exclude_links; 
     133    }   else{ 
     134 
     135        return $converted; 
    106136    } 
     137 
    107138     
    108     $converted_exclude_links = replace_matches($converted, $all_converted_quotes, array_unique($allquotes));     
    109      
    110     return $converted_exclude_links; 
    111139 
    112140} 
     141 
     142 
     143 
    113144 
    114145 
Note: See TracChangeset for help on using the changeset viewer.