<?php

require_once dirname(dirname(__FILE__)) . '/include/common_functions.php';
require_once dirname(dirname(__FILE__)) . '/include/admin_functions.php';
$myts =& MyTextSanitizer::getInstance();
$db =& Database::getInstance();
$index = intval($_GET['index']);
$option_value_utf8 = $myts->stripSlashesGPC(@$_GET['option_value']);
$option_value = d3pipes_common_convert_encoding_utf8toie($mydirname, $option_value_utf8);
$all_joints = d3pipes_admin_fetch_joints($mydirname);
$disabled_option_input = '<input type="text" name="joint_option[' . $index . ']" id="joint_option_' . $index . '" value="' . htmlspecialchars($option_value, ENT_QUOTES) . '" size="20" disabled="disabled" />';
@(list($joint_type, $joint_class) = explode('::', $myts->stripSlashesGPC(@$_GET['type_class'])));
if (empty($joint_type) || !isset($all_joints[$joint_type])) {
    die($disabled_option_input);
}
$valid_classes = d3pipes_admin_fetch_classes($mydirname, $joint_type);
if (!isset($valid_classes[$joint_class])) {
    die($disabled_option_input);
}
$obj =& d3pipes_common_get_joint_object($mydirname, $joint_type, $joint_class);
while (ob_get_level()) {
    ob_end_clean();
}
@ini_set('default_charset', 'UTF-8');
@header('Content-Type: text/html; charset=UTF-8');
echo d3pipes_common_convert_encoding_ietoutf8($mydirname, $obj->renderOptions($index, $option_value));
if (!defined('ALTSYS_DONT_USE_ADMIN_IN_THEME')) {
    define('ALTSYS_DONT_USE_ADMIN_IN_THEME', 1);
}
unset($xoopsUser);
// for preventing older admin_in_theme
<?php

$field_defs = array('pubtime' => 'time', 'headline' => 'string', 'link' => 'string', 'description' => 'text', 'content_encoded' => 'text');
require_once dirname(dirname(__FILE__)) . '/include/common_functions.php';
require_once dirname(dirname(__FILE__)) . '/include/admin_functions.php';
require_once dirname(dirname(__FILE__)) . '/class/gtickets.php';
$myts =& MyTextSanitizer::getInstance();
$db =& Database::getInstance();
// get field
$field = @$_GET['field'];
if (isset($field_defs[$field])) {
    // get value (from UTF-8 to IE)
    $value_utf8 = $myts->stripSlashesGPC(@$_POST['value']);
    $value4disp = d3pipes_common_convert_encoding_utf8toie($mydirname, $value_utf8);
    $value = d3pipes_admin_disp2raw($value4disp, $field_defs[$field]);
    // get clipping
    $clipping_id = intval(@$_GET['clipping_id']);
    $clipping = d3pipes_common_get_clipping($mydirname, $clipping_id);
    if ($clipping) {
        list($data_serialized) = $db->fetchRow($db->query("SELECT data FROM " . $db->prefix($mydirname . "_clippings") . " WHERE clipping_id={$clipping_id}"));
        $data = d3pipes_common_unserialize($data_serialized);
        $data[$field] = $value;
        $db->query("UPDATE " . $db->prefix($mydirname . "_clippings") . " SET `data`='" . addslashes(serialize($data)) . "' WHERE clipping_id={$clipping_id}");
        // This query can raise an error, but it's OK
        $db->query("UPDATE " . $db->prefix($mydirname . "_clippings") . " SET `{$field}`='" . addslashes($value) . "' WHERE clipping_id={$clipping_id}");
    }
}
while (ob_get_level()) {
    ob_end_clean();
}
//	ini_set( 'default_encoding' , 'UTF-8' ) ;