Skip to content

Instantly share code, notes, and snippets.

@pafnuty
Forked from n0wheremany/ajax.block.pro.php
Created April 29, 2013 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pafnuty/5483110 to your computer and use it in GitHub Desktop.
Save pafnuty/5483110 to your computer and use it in GitHub Desktop.
<?php
/*
=============================================================================
BlockPro 3 - Модуль для вывода блоков с новостями на страницах сайта DLE (тестировался на 9.7 и 9.8)
=============================================================================
Автор модуля: ПафНутиЙ
URL: http://blockpro.ru/
ICQ: 817233
email: pafnuty10@gmail.com
=============================================================================
Файл: ajax.block.pro.php - вывод аякс-блоков
-----------------------------------------------------------------------------
Версия: 1.0.0.0 (08.02.2013)
=============================================================================
*/
@error_reporting ( E_ALL ^ E_WARNING ^ E_NOTICE );
@ini_set ( 'display_errors', true );
@ini_set ( 'html_errors', false );
@ini_set ( 'error_reporting', E_ALL ^ E_WARNING ^ E_NOTICE );
define( 'DATALIFEENGINE', true );
define( 'ROOT_DIR', substr( dirname( __FILE__ ), 0, -24 ) );
define( 'ENGINE_DIR', ROOT_DIR . '/engine' );
include ENGINE_DIR . '/data/config.php';
if( $config['http_home_url'] == "" ) {
$config['http_home_url'] = explode( "engine/modules/blockpro/ajax.block.pro.php", $_SERVER['PHP_SELF'] );
$config['http_home_url'] = reset( $config['http_home_url'] );
$config['http_home_url'] = "http://" . $_SERVER['HTTP_HOST'] . $config['http_home_url'];
}
require_once ENGINE_DIR . '/classes/mysql.php';
require_once ENGINE_DIR . '/data/dbconfig.php';
require_once ENGINE_DIR . '/modules/functions.php';
if(function_exists('dle_session')){
dle_session();
} else {
@session_start();
}
@header( "Content-type: text/html; charset=" . $config['charset'] );
$allowed_post=array('template','prefix','...','imgSize','...'); // прописываем доступные переменные
$agregate_post=array();
foreach($_POST as $ii => $dd)
if(in_array($ii,$allowed_post))
$agregate_post[$ii]=$dd; // Нужно ещё добавить фильтры входящих данных
parse_str(http_build_query($agregate_post)); // Преобразуем данные из массива в переменные
require_once ENGINE_DIR . '/modules/blockpro/block.pro.3.php';
// трололо ))
echo "<pre style=\"margin:0;font: normal 12px/14.5px Consolas, Courier, monospace;\"> ## </pre>";
echo "<pre style=\"margin:0;font: normal 12px/14.5px Consolas, Courier, monospace;\"> # </pre>";
echo "<pre style=\"margin:0;font: normal 12px/14.5px Consolas, Courier, monospace;\"> #### ### ### # </pre>";
echo "<pre style=\"margin:0;font: normal 12px/14.5px Consolas, Courier, monospace;\"> # # # # # # </pre>";
echo "<pre style=\"margin:0;font: normal 12px/14.5px Consolas, Courier, monospace;\"> # # # # # # </pre>";
echo "<pre style=\"margin:0;font: normal 12px/14.5px Consolas, Courier, monospace;\"> # # # # # # </pre>";
echo "<pre style=\"margin:0;font: normal 12px/14.5px Consolas, Courier, monospace;\"> #### ### ### ### </pre>";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment