<commit_before><?php

/*
// Alkaline
// Copyright (c) 2010-2011 by Budin Ltd. All rights reserved.
// Do not redistribute this code without written permission from Budin Ltd.
// http://www.alkalineapp.com/
*/

require_once('./../config.php');
require_once(PATH . CLASSES . 'alkaline.php');

$alkaline = new Alkaline;
$orbit = new Orbit;
$user = new User;

$user->perm(true);

if(!empty($_POST['act']) and !empty($_POST['object'])){
	$_SESSION['alkaline']['preview']['act'] = $_POST['act'];
	$object = $_POST['object'];
	
	$block = $_SESSION['alkaline']['preview']['act'] . 's';
	$object[$block] = 1;
	
	if(!empty($object['post_markup'])){
		$post_markup_ext = $object['post_markup'];
		$object['post_text'] = $orbit->hook('markup_' . $post_markup_ext, $object['post_text_raw'], $object['post_text_raw']);
		$object['post_title'] = $orbit->hook('markup_title_' . $post_markup_ext, $object['post_title'], $object['post_title']);
		$object['post_excerpt'] = $orbit->hook('markup_' . $post_markup_ext, $object['post_excerpt_raw'], $object['post_excerpt_raw']);
	}
	elseif($alkaline->returnConf('web_markup')){
		$post_markup_ext = $alkaline->returnConf('web_markup_ext');
		$object['post_text'] = $orbit->hook('markup_' . $post_markup_ext, $object['post_text_raw'], $object['post_text_raw']);
		$object['post_title'] = $orbit->hook('markup_title_' . $post_markup_ext, $object['post_title'], $object['post_title']);
		$object['post_excerpt'] = $orbit->hook('markup_' . $post_markup_ext, $object['post_excerpt_raw'], $object['post_excerpt_raw']);
	}
	else{
		$post_markup_ext = '';
		$object['post_text'] = $alkaline->nl2br($object['post_text_raw']);
		$object['post_excerpt'] = $alkaline->nl2br($object['post_excerpt_raw']);
	}
	
	if(!empty($object['image_markup'])){
		$image_markup_ext = $object['image_markup'];
		$object['image_description'] = $orbit->hook('markup_' . $image_markup_ext, $object['image_description_raw'], $object['image_description_raw']);
		$object['image_title'] = $orbit->hook('markup_title_' . $image_markup_ext, $object['image_title'], $object['image_title']);
		$object['image_excerpt'] = $orbit->hook('markup_' . $image_markup_ext, $object['image_excerpt_raw'], $object['image_excerpt_raw']);
	}
	elseif($alkaline->returnConf('web_markup')){
		$image_markup_ext = $alkaline->returnConf('web_markup_ext');
		$object['image_description'] = $orbit->hook('markup_' . $image_markup_ext, $object['image_description_raw'], $object['image_description_raw']);
		$object['image_title'] = $orbit->hook('markup_title_' . $image_markup_ext, $object['image_title'], $object['image_title']);
		$object['image_excerpt'] = $orbit->hook('markup_' . $image_markup_ext, $object['image_excerpt_raw'], $object['image_excerpt_raw']);
	}
	else{
		$image_markup_ext = '';
		$object['image_description'] = $alkaline->nl2br($object['image_description_raw']);
		$object['image_excerpt'] = $alkaline->nl2br($object['image_excerpt_raw']);
	}
	
	if(!empty($object['page_markup_ext'])){
		$page_markup_ext = $object['page_markup_ext'];
		$object['page_text'] = $orbit->hook('markup_' . $page_markup_ext, $object['page_text_raw'], $object['page_text_raw']);
		$object['page_title'] = $orbit->hook('markup_title_' . $page_markup_ext, $object['page_title'], $object['page_title']);
		$object['page_excerpt'] = $orbit->hook('markup_' . $page_markup_ext, $object['page_excerpt_raw'], $object['page_excerpt_raw']);
	}
	elseif($alkaline->returnConf('web_markup')){
		$page_markup_ext = $alkaline->returnConf('web_markup_ext');
		$object['page_text'] = $orbit->hook('markup_' . $page_markup_ext, $object['page_text_raw'], $object['page_text_raw']);
		$object['page_title'] = $orbit->hook('markup_title_' . $page_markup_ext, $object['page_title'], $object['page_title']);
		$object['page_excerpt'] = $orbit->hook('markup_' . $page_markup_ext, $object['page_excerpt_raw'], $object['page_excerpt_raw']);
	}
	else{
		$page_markup_ext = '';
		$object['page_text'] = $alkaline->nl2br($object['page_text_raw']);
		$object['page_excerpt'] = $alkaline->nl2br($object['page_excerpt_raw']);
	}
	
	$id_label = $_POST['act'] . '_id';<commit_msg>Fixes Dash>Preview PHP warnings<commit_after><?php

/*
// Alkaline
// Copyright (c) 2010-2011 by Budin Ltd. All rights reserved.
// Do not redistribute this code without written permission from Budin Ltd.
// http://www.alkalineapp.com/
*/

require_once('./../config.php');
require_once(PATH . CLASSES . 'alkaline.php');

$alkaline = new Alkaline;
$orbit = new Orbit;
$user = new User;

$user->perm(true);

if(!empty($_POST['act']) and !empty($_POST['object'])){
	$_SESSION['alkaline']['preview']['act'] = $_POST['act'];
	$object = $_POST['object'];
	
	$block = $_SESSION['alkaline']['preview']['act'] . 's';
	$object[$block] = 1;
	
	if($block == 'posts'){
		if(!empty($object['post_markup'])){
			$post_markup_ext = $object['post_markup'];
			$object['post_text'] = $orbit->hook('markup_' . $post_markup_ext, $object['post_text_raw'], $object['post_text_raw']);
			$object['post_title'] = $orbit->hook('markup_title_' . $post_markup_ext, $object['post_title'], $object['post_title']);
			$object['post_excerpt'] = $orbit->hook('markup_' . $post_markup_ext, $object['post_excerpt_raw'], $object['post_excerpt_raw']);
		}
		elseif($alkaline->returnConf('web_markup')){
			$post_markup_ext = $alkaline->returnConf('web_markup_ext');
			$object['post_text'] = $orbit->hook('markup_' . $post_markup_ext, $object['post_text_raw'], $object['post_text_raw']);
			$object['post_title'] = $orbit->hook('markup_title_' . $post_markup_ext, $object['post_title'], $object['post_title']);
			$object['post_excerpt'] = $orbit->hook('markup_' . $post_markup_ext, $object['post_excerpt_raw'], $object['post_excerpt_raw']);
		}
		else{
			$post_markup_ext = '';
			$object['post_text'] = $alkaline->nl2br($object['post_text_raw']);
			$object['post_excerpt'] = $alkaline->nl2br($object['post_excerpt_raw']);
		}
	}
	elseif($block == 'images'){
		if(!empty($object['image_markup'])){
			$image_markup_ext = $object['image_markup'];
			$object['image_description'] = $orbit->hook('markup_' . $image_markup_ext, $object['image_description_raw'], $object['image_description_raw']);
			$object['image_title'] = $orbit->hook('markup_title_' . $image_markup_ext, $object['image_title'], $object['image_title']);
			$object['image_excerpt'] = $orbit->hook('markup_' . $image_markup_ext, $object['image_excerpt_raw'], $object['image_excerpt_raw']);
		}
		elseif($alkaline->returnConf('web_markup')){
			$image_markup_ext = $alkaline->returnConf('web_markup_ext');
			$object['image_description'] = $orbit->hook('markup_' . $image_markup_ext, $object['image_description_raw'], $object['image_description_raw']);
			$object['image_title'] = $orbit->hook('markup_title_' . $image_markup_ext, $object['image_title'], $object['image_title']);
			$object['image_excerpt'] = $orbit->hook('markup_' . $image_markup_ext, $object['image_excerpt_raw'], $object['image_excerpt_raw']);
		}
		else{
			$image_markup_ext = '';
			$object['image_description'] = $alkaline->nl2br($object['image_description_raw']);
			$object['image_excerpt'] = $alkaline->nl2br($object['image_excerpt_raw']);
		}
	}
	elseif($block == 'pages'){
		if(!empty($object['page_markup_ext'])){
			$page_markup_ext = $object['page_markup_ext'];
			$object['page_text'] = $orbit->hook('markup_' . $page_markup_ext, $object['page_text_raw'], $object['page_text_raw']);
			$object['page_title'] = $orbit->hook('markup_title_' . $page_markup_ext, $object['page_title'], $object['page_title']);
			$object['page_excerpt'] = $orbit->hook('markup_' . $page_markup_ext, $object['page_excerpt_raw'], $object['page_excerpt_raw']);
		}
		elseif($alkaline->returnConf('web_markup')){
			$page_markup_ext = $alkaline->returnConf('web_markup_ext');
			$object['page_text'] = $orbit->hook('markup_' . $page_markup_ext, $object['page_text_raw'], $object['page_text_raw']);
			$object['page_title'] = $orbit->hook('markup_title_' . $page_markup_ext, $object['page_title'], $object['page_title']);
			$object['page_excerpt'] = $orbit->hook('markup_' . $page_markup_ext, $object['page_excerpt_raw'], $object['page_excerpt_raw']);
		}
		else{
			$page_markup_ext = '';
			$object['page_text'] = $alkaline->nl2br($object['page_text_raw']);
			$object['page_excerpt'] = $alkaline->nl2br($object['page_excerpt_raw']);
		}
	}
	
	$id_label = $_POST['act'] . '_id';
{'fraction_non_alphanumeric': 0.21705426356589147, 'fraction_numerical': 0.0035778175313059034, 'mean_word_length': 7.818086225026288, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 66, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '460986', 'n_tokens_mistral': 3332, 'n_tokens_neox': 3067, 'n_words': 364}