• 28-02-2014, 05:20:16
    #1
    Kullanmış olduğum Sosyal sayaç eklentisinde Google Plus özelliği çalışmıyor. Ne yapmam gerekir? Sanırım google api problemi var

    /* Google+ Followers */
    function arq_google_count(){
    	global $arq_data, $arq_options, $arq_transient;
    	
    	/*if( !empty($arq_transient['google']) ){
    		$result = $arq_transient['google'];
    	}
    	elseif( empty($arq_transient['google']) && !empty($arq_data) && !empty( $arq_options['data']['google'] )  ){
    		$result = $arq_options['data']['google'];
    	}
    	else{*/
    		$id = $arq_options['social']['google']['id'];
    		$id = str_replace('+', '%2B', $id);
    		try {		
    			//$data = @arq_remote_get( "https://apis.google.com/u/0/_/pages/badge?bsv&hl=en-US&width=200&url=https%3A%2F%2Fplus.google.com%2F$id%3Fprsrc%3D1" , false );
    			$data = @arq_remote_get( "https://apis.google.com/u/0/_/widget/render/page?usegapi=1&bsv=o&width=180&href=https%3A%2F%2Fplus.google.com%2F$id&showcoverphoto=0&showtagline=0&hl=en-US" , false );
    			
    			if( empty($data) )
    				//$data =	file_get_contents( "https://apis.google.com/u/0/_/pages/badge?bsv&hl=en-US&width=200&url=https%3A%2F%2Fplus.google.com%2F$id%3Fprsrc%3D1" );
    				$data =	file_get_contents( "https://apis.google.com/u/0/_/widget/render/page?usegapi=1&bsv=o&width=180&href=https%3A%2F%2Fplus.google.com%2F$id&showcoverphoto=0&showtagline=0&hl=en-US" );
    			
    			preg_match('/<div class="rce kdd Z6d" style="font-size:11px;">(.*?)<\/div>/s', $data, $result);
    			if (isset($result) && !empty($result)){
    				$count = $result[1];
    				$result = preg_replace('/[^0-9_]/', '', $count);
    				$result = (int) $result;
    			}
    		} catch (Exception $e) {
    			$result = 0;
    		}
    		
    		if( !empty( $result ) ) //To update the stored data
    			$arq_data['google'] = $result; 
    
    		if( empty( $result ) && !empty( $arq_options['data']['google'] ) ) //Get the stored data
    			$result = $arq_options['data']['google'];	
    	//}
    	return $result;
    }
  • 28-02-2014, 17:58:29
    #2
    Konu Güncel.
  • 05-03-2014, 19:21:39
    #3
    Up.