• Hey there! great plugin, just what we need. Any way Im having some difficult to rettrieve the same data you use in the lead details page, as a json request.

    I was thinking, maybe in here `public function

    convert_to_json($content, $singleJN = false) {
    		$back = '';
    		// Get the back link, if it exists
    		preg_match("/\<p\sclass=\"entryback\"\>(.*?)\<\/p\>/", $content, $matches);
    		if(isset($matches[0])) { $back = $matches[0]; }
    		$content = preg_replace("/\<p\sclass=\"entryback\"\>(.*?)\<\/p\>/", "", $content);
    
    		$content = preg_replace("/<\/?table[^>]*>|<\/?tbody[^>]*>/","", $content);
    		$content = preg_replace("/<thead[^>]*>.*<\/thead>|<tfoot[^>]*>.*<\/tfoot>/is","", $content);
    
    		if(!$singleJN) {
    			$content = preg_replace("/<tr([^>]*)>/","<dl$1>", $content);
    			$content = preg_replace("/<\/tr[^>]*>/","</dl>", $content);
    		} else {
    			$content = preg_replace("/<tr([^>]*)>/","", $content);
    			$content = preg_replace("/<\/tr[^>]*>/","", $content);
    		}
    
    		$content = preg_replace("/\<td([^>]*)\>(\?|)\<\/td\>/","", $content);
    		$content = preg_replace("/\<th([^>]*)\>(.*?)<\/th\>/ism","<dt$1>$2</dt>", $content);
    		$content = preg_replace('/<td(.*?)(title="(.*?)")?>(.*?)<\/td[^>]*>/ism',"<dt$1>$3</dt><dd>$4</dd>", $content);
    		$output = $back;
    		$output .= "\n\t\t\t\t\t\t\t\t".'<dl>';
    		$output .= $content;
    		$output .= "\t\t\t\t\t\t".'</dl>';
    		return $output;
    	}


    [Please use the code buttons to post code here]

    By the way, Im trying to integrate with google charts. Any help or guide will ve very appreciated.
    Yamid

    https://www.ads-software.com/extend/plugins/gravity-forms-addons/

  • The topic ‘Output to Json’ is closed to new replies.