Пример #1
0
    $fn2 = $arrGDHandler[1];
    if (!($old_img = $fn1($szImagePath))) {
        exit('Could not open image. Wrong type?');
    }
    $new_img = imagecreatetruecolor($_POST['tw'], $_POST['th']);
    imagecopyresampled($new_img, $old_img, 0, 0, $_POST['left'], $_POST['top'], $_POST['tw'], $_POST['th'], $_POST['width'], $_POST['height']);
    //echo '<pre>';
    //print_r($is);
    //exit;
    //	header('Content-type: '.$is['mime']);
    $fn2($new_img, $szImagePath);
    //echo '<p>Image saved to <a href="'.$_POST['image'].'">'.$_POST['image'].'</a>. <a href="'.$szReferer.'">Go back</a>.</p>';
    header('Location: ' . $szReferer);
    exit;
}
tpl_header();
if (!isset($_GET['tw'], $_GET['th'])) {
    echo '<form method="get" action="">';
    echo '<input type="hidden" name="referer" value="' . htmlspecialchars($szReferer) . '" />';
    echo '<input type="hidden" name="image" value="' . htmlspecialchars($_GET['image']) . '" />';
    echo '<p>Target width:<br /><input type="text" id="tw" name="tw" value="100" /></p>';
    echo '<p>Target height:<br /><input type="text" id="th" name="th" value="100" /></p>';
    echo '<p>Choose predefined dimensions:<br /><select onchange="var x=this.value.split(\',\');$(\'tw\').value=x[0];$(\'th\').value=x[1];"><option value="0,0">--</option>';
    foreach ($db->select('image_dimension_sets') as $s) {
        echo '<option value="' . $s->width . ',' . $s->height . '">' . $s->name . ' (' . $s->width . ' * ' . $s->height . ')</option>';
    }
    echo '</select></p>';
    echo '<p><input type="submit" value="Continue" /></p>';
    echo '</form>';
    exit;
}
Пример #2
0
/**
 * Prepare standard page templates
 */
function tpl_page($help = '', $title = '')
{
    tpl_language();
    tpl_header($help, $title);
    tpl_footer();
}
Пример #3
0
*/
$VERSION = '$Id$';
////////// READ OPTIONAL CONFIGURATION FILE ////////////
if (file_exists("apc.conf.php")) {
    include "apc.conf.php";
}
////////////////////////////////////////////////////////
////////////////////////////////
// Load config file
////////////////////////////////
$admin_page = 'apc';
require_once '../config.php';
require_once 'require_login.php';
require_once 'template.php';
if (!isset($_REQUEST['IMG'])) {
    tpl_header('APCu');
}
////////// BEGIN OF DEFAULT CONFIG AREA ///////////////////////////////////////////////////////////
defaults('USE_AUTHENTICATION', 0);
// Use (internal) authentication - best choice if
// no other authentication is available
// If set to 0:
//  There will be no further authentication. You
//  will have to handle this by yourself!
// If set to 1:
//  You need to change ADMIN_PASSWORD to make
//  this work!
defaults('ADMIN_USERNAME', 'apc');
// Admin Username
defaults('ADMIN_PASSWORD', 'password');
// Admin Password - CHANGE THIS TO ENABLE!!!
Пример #4
0
// Usage
// -----
// * Access this file in your browser and follow the instructions to update your site config files.
// * See section on automatic updates for a URL you can fetch periodically (e.g. with cron) to update site config files
error_reporting(E_ALL ^ E_NOTICE);
ini_set("display_errors", 1);
@set_time_limit(120);
////////////////////////////////
// Load config file
////////////////////////////////
$admin_page = 'update';
require_once '../config.php';
require_once '../libraries/humble-http-agent/HumbleHttpAgent.php';
require_once '../libraries/humble-http-agent/CookieJar.php';
require_once 'template.php';
tpl_header('Update site patterns');
//////////////////////////////////
// Username and password must be available
//////////////////////////////////
if (!isset($options->admin_credentials) || $options->admin_credentials['username'] == '' || $options->admin_credentials['password'] == '') {
    header("X-Robots-Tag: noindex, nofollow", true);
    die('<h2>Username and password not set</h2><p>Full-Text RSS has not been configured with admin credentials.</p><p>If you are the administrator, please edit your <tt>custom_config.php</tt> file and enter the credentials in the appropriate section. When you\'ve done that, this page will prompt you for your admin credentials.</p>');
}
$admin_hash = sha1($options->admin_credentials['username'] . '+' . $options->admin_credentials['password']);
$_self_host = $_SERVER['HTTP_HOST'];
$_self_path = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\');
$self_update_url = 'http://' . htmlspecialchars($_self_host . $_self_path) . '/update.php?key=' . urlencode($admin_hash);
$latest_remote = 'https://codeload.github.com/fivefilters/ftr-site-config/zip/master';
$version = @file_get_contents('../site_config/standard/version.txt');
/////////////////////////////////
// Check for update key
Пример #5
0
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
// Usage
// -----
// Access this file in your browser
error_reporting(E_ALL ^ E_NOTICE);
ini_set("display_errors", 1);
@set_time_limit(120);
////////////////////////////////
// Load config file
////////////////////////////////
require_once '../config.php';
require_once 'require_login.php';
require_once 'template.php';
tpl_header('Admin');
?>
<p>The admin pages are intended to help you manage your copy of Full-Text RSS more easily.</p>
<ul>
<li><a href="update.php">Update patterns</a>: an easy way to keep site config files up to date.</li>
<li><a href="edit-pattern.php">Edit patterns</a>: need to fine-tune extraction for a certain site? Use this tool.</li>
<li><a href="apc.php?OB=3">APC</a>: If APC is enabled, you can use this tool to see what Full-Text RSS caches, and clear the cache if you need to.</li>
</ul>
Пример #6
0
            } else {
                $process[$key][stripslashes($k)] = stripslashes($v);
            }
        }
    }
    unset($process);
}
require_once '../libraries/content-extractor/SiteConfig.php';
////////////////////////////////
// Load config file
////////////////////////////////
$admin_page = 'edit-pattern';
require_once '../config.php';
require_once 'require_login.php';
require_once 'template.php';
tpl_header('Edit site patterns');
$version = file_get_contents('../site_config/standard/version.txt');
function filter_only_text($filename)
{
    return strtolower(substr($filename, -4)) == '.txt';
}
function is_valid_hostname($host)
{
    return preg_match('!^[a-z0-9_.-]+$!i', $host);
}
/////////////////////////////////
// Process changes
/////////////////////////////////
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    // DELETE
    if (@$_POST['delete'] != '' && @$_POST['delete_dir'] != '') {
Пример #7
0
function app_display_download($tp_table, $cond, $download, $filename)
{
    global $SCHEMA;
    $tp = _db_temporal($tp_table, $table);
    $data = _app_getdata($table, $cond);
    $data["FILENAME"] = $filename;
    if ($filename) {
        if ($cb = @$SCHEMA[$table]["FIELDS"][$download]["CB_DOWNLOAD"]) {
            $data = $cb($data);
        }
        tpl_header_download($data);
        print $data["DATA"][0][$download];
        exit(0);
    } else {
        tpl_header($data);
        tpl_body_start($data);
        print "<tt>" . _tpl_format_ascii($data["DATA"][0][$download]) . "</tt>";
        tpl_body_end($data);
        tpl_footer($data);
    }
}
Пример #8
0
*/
$VERSION = '$Id: apc.php 307048 2011-01-03 23:53:17Z kalle $';
////////// READ OPTIONAL CONFIGURATION FILE ////////////
if (file_exists("apc.conf.php")) {
    include "apc.conf.php";
}
////////////////////////////////////////////////////////
////////////////////////////////
// Load config file
////////////////////////////////
$admin_page = 'apc';
require_once '../config.php';
require_once 'require_login.php';
require_once 'template.php';
if (!isset($_REQUEST['IMG'])) {
    tpl_header('APC');
}
////////// BEGIN OF DEFAULT CONFIG AREA ///////////////////////////////////////////////////////////
defaults('USE_AUTHENTICATION', 0);
// Use (internal) authentication - best choice if
// no other authentication is available
// If set to 0:
//  There will be no further authentication. You
//  will have to handle this by yourself!
// If set to 1:
//  You need to change ADMIN_PASSWORD to make
//  this work!
//defaults('ADMIN_USERNAME','admin'); 			// Admin Username
//defaults('ADMIN_PASSWORD','');  	// Admin Password - CHANGE THIS TO ENABLE!!!
// (beckerr) I'm using a clear text password here, because I've no good idea how to let
//           users generate a md5 or crypt password in a easy way to fill it in above
Пример #9
0
$download = @$_REQUEST["download"];
if ($download) {
    $debug = false;
}
if (!@$debug) {
    $debug = false;
}
// shutup php warnings
require_once $BASEDIR . "/../common/db/db.php";
require_once $BASEDIR . "/../common/app.php";
app_get_templates();
///////////////////////////////////////////////////////////////////////////
// call the "app stuff" for generic table management
if (!$download) {
    $data = array("TITLE" => "inspect_{$table}", "ACTION" => $_SERVER["PHP_SELF"] . "?table={$table}");
    tpl_header($data);
    tpl_body_start($data);
    app_links();
    if (@$debug) {
        print_r($_REQUEST);
        echo "<br>\n";
    }
}
if (isset($_REQUEST["primary"])) {
    $cond = app_get_id($table, $_REQUEST["primary"]);
    if ($download) {
        app_display_download($table, $cond, $download, @$_REQUEST["filename"]);
    } else {
        app_display_record($table, $cond);
    }
} else {
Пример #10
0
tfoot a {font-size: 8pt;font-weight: normal;text-decoration: underline;}
#s {padding: 0px;text-align: right;}
#s input{width: 65px;border: solid 1px #ddd;color: #999;padding: 5px 5px 5px 27px;background: url("<?php 
echo $this_script;
?>
?image=search") no-repeat 3px 3px;}
</style>
</head>

<body>
<table cellpadding="0" cellspacing="1">
	<thead>
		<tr>
			<td colspan="2">
				<?php 
echo tpl_header();
?>
			</td>
			<td id="s">
				<form action="" method="post">
					<input name="search" type="text" value="<?php 
if (!empty($search)) {
    echo $search;
} else {
    echo $_["search"];
}
?>
" onclick=" if(this.value == '<?php 
echo $_["search"];
?>
') { this.value = ''; }" />