예제 #1
0
 function getLayout($vardef)
 {
     if (empty($vardef['type'])) {
         $vardef['type'] = 'varchar';
     }
     $mod = return_module_language($GLOBALS['current_language'], 'DynamicFields');
     $this->ss->assign('vardef', $vardef);
     $this->ss->assign('MOD', $mod);
     $this->ss->assign('APP', $GLOBALS['app_strings']);
     //Only display range search option if in Studio, not ModuleBuilder
     $this->ss->assign('range_search_option_enabled', empty($_REQUEST['view_package']));
     $GLOBALS['log']->debug('FieldViewer.php->getLayout() = ' . $vardef['type']);
     switch ($vardef['type']) {
         case 'address':
             return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/address.tpl');
         case 'bool':
             return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/bool.tpl');
         case 'int':
             return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/int.tpl');
         case 'float':
             return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/float.tpl');
         case 'decimal':
             return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/float.tpl');
         case 'date':
             require_once 'modules/DynamicFields/templates/Fields/Forms/date.php';
             return get_body($this->ss, $vardef);
         case 'datetimecombo':
         case 'datetime':
             require_once 'modules/DynamicFields/templates/Fields/Forms/datetimecombo.php';
             return get_body($this->ss, $vardef);
         case 'enum':
             require_once 'modules/DynamicFields/templates/Fields/Forms/enum2.php';
             return get_body($this->ss, $vardef);
         case 'multienum':
             require_once 'modules/DynamicFields/templates/Fields/Forms/multienum.php';
             return get_body($this->ss, $vardef);
         case 'radioenum':
             require_once 'modules/DynamicFields/templates/Fields/Forms/radioenum.php';
             return get_body($this->ss, $vardef);
         case 'html':
             require_once 'modules/DynamicFields/templates/Fields/Forms/html.php';
             return get_body($this->ss, $vardef);
         case 'currency':
             return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/currency.tpl');
         case 'relate':
             require_once 'modules/DynamicFields/templates/Fields/Forms/relate.php';
             return get_body($this->ss, $vardef);
         case 'parent':
             require_once 'modules/DynamicFields/templates/Fields/Forms/parent.php';
             return get_body($this->ss, $vardef);
         case 'text':
             return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/text.tpl');
         case 'encrypt':
             require_once 'modules/DynamicFields/templates/Fields/Forms/encrypt.php';
             return get_body($this->ss, $vardef);
         case 'iframe':
             require_once 'modules/DynamicFields/templates/Fields/Forms/iframe.php';
             return get_body($this->ss, $vardef);
         case 'url':
             require_once 'modules/DynamicFields/templates/Fields/Forms/url.php';
             return get_body($this->ss, $vardef);
         case 'phone:':
             require_once 'modules/DynamicFields/templates/Fields/Forms/phone.php';
             return get_body($this->ss, $vardef);
         default:
             $file = false;
             if (file_exists('custom/modules/DynamicFields/templates/Fields/Forms/' . $vardef['type'] . '.php')) {
                 $file = 'custom/modules/DynamicFields/templates/Fields/Forms/' . $vardef['type'] . '.php';
             } elseif (file_exists('modules/DynamicFields/templates/Fields/Forms/' . $vardef['type'] . '.php')) {
                 $file = 'modules/DynamicFields/templates/Fields/Forms/' . $vardef['type'] . '.php';
             }
             if (!empty($file)) {
                 require_once $file;
                 return get_body($this->ss, $vardef);
             } else {
                 return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/varchar.tpl');
             }
     }
 }
예제 #2
0
 function getLayout($vardef)
 {
     if (empty($vardef['type'])) {
         $vardef['type'] = 'varchar';
     }
     $mod = return_module_language($GLOBALS['current_language'], 'DynamicFields');
     $this->ss->assign('vardef', $vardef);
     $this->ss->assign('MOD', $mod);
     $this->ss->assign('APP', $GLOBALS['app_strings']);
     //Only display range search option if in Studio, not ModuleBuilder
     $this->ss->assign('range_search_option_enabled', empty($_REQUEST['view_package']));
     if (isset($vardef['name']) && in_array($vardef['name'], self::$fieldNameBlacklist) || isset($vardef['type']) && in_array($vardef['type'], self::$fieldTypeBlacklist)) {
         $this->ss->assign('hideDuplicatable', 'true');
     }
     if ($fieldRangeValue = DynamicField::getFieldRangeValueByType($vardef['type'])) {
         $this->ss->assign('field_range_value', $fieldRangeValue);
     }
     if (isset($vardef['name']) && in_array($vardef['name'], self::$fieldNameNoRequired)) {
         $this->ss->assign('hideRequired', true);
     } else {
         $this->ss->assign('hideRequired', false);
     }
     $GLOBALS['log']->debug('FieldViewer.php->getLayout() = ' . $vardef['type']);
     switch ($vardef['type']) {
         case 'address':
             return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/address.tpl');
         case 'bool':
             return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/bool.tpl');
         case 'int':
             return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/int.tpl');
         case 'float':
             return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/float.tpl');
         case 'decimal':
             return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/float.tpl');
         case 'date':
             require_once 'modules/DynamicFields/templates/Fields/Forms/date.php';
             return get_body($this->ss, $vardef);
         case 'datetimecombo':
         case 'datetime':
             require_once 'modules/DynamicFields/templates/Fields/Forms/datetimecombo.php';
             return get_body($this->ss, $vardef);
         case 'enum':
             require_once 'modules/DynamicFields/templates/Fields/Forms/enum2.php';
             return get_body($this->ss, $vardef);
         case 'multienum':
             require_once 'modules/DynamicFields/templates/Fields/Forms/multienum.php';
             return get_body($this->ss, $vardef);
         case 'radioenum':
             require_once 'modules/DynamicFields/templates/Fields/Forms/radioenum.php';
             return get_body($this->ss, $vardef);
         case 'html':
             require_once 'modules/DynamicFields/templates/Fields/Forms/html.php';
             return get_body($this->ss, $vardef);
         case 'currency':
             return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/currency.tpl');
         case 'relate':
             require_once 'modules/DynamicFields/templates/Fields/Forms/relate.php';
             return get_body($this->ss, $vardef);
         case 'parent':
             require_once 'modules/DynamicFields/templates/Fields/Forms/parent.php';
             return get_body($this->ss, $vardef);
         case 'text':
             return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/text.tpl');
         case 'encrypt':
             require_once 'modules/DynamicFields/templates/Fields/Forms/encrypt.php';
             return get_body($this->ss, $vardef);
         case 'iframe':
             require_once 'modules/DynamicFields/templates/Fields/Forms/iframe.php';
             return get_body($this->ss, $vardef);
         case 'url':
             require_once 'modules/DynamicFields/templates/Fields/Forms/url.php';
             return get_body($this->ss, $vardef);
         case 'phone':
             require_once 'modules/DynamicFields/templates/Fields/Forms/phone.php';
             return get_body($this->ss, $vardef);
         default:
             if (SugarAutoLoader::requireWithCustom('modules/DynamicFields/templates/Fields/Forms/' . $vardef['type'] . '.php')) {
                 return get_body($this->ss, $vardef);
             } else {
                 return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/varchar.tpl');
             }
     }
 }
예제 #3
0
파일: compare.php 프로젝트: 4play/gazelle2
	!isset($_GET['id']) || 
	!is_number($_GET['old']) || 
	!is_number($_GET['new']) || 
	!is_number($_GET['id']) || 
	$_GET['old'] > $_GET['new']
) { error(0); }

$ArticleID = $_GET['id'];

$Article = $Alias->article($ArticleID);
list($Revision, $Title, $Body, $Read, $Edit, $Date, $AuthorID, $AuthorName) = array_shift($Article);
if($Read > $LoggedUser['Class']){ error(404); }

show_header('Compare Article Revisions');
$Diff2 = get_body($ArticleID, $_GET['new']);
$Diff1 = get_body($ArticleID, $_GET['old']);
?>
<div class="thin">
	<h2>Compare <a href="wiki.php?action=article&id=<?php 
echo $ArticleID;
?>
"><?php 
echo $Title;
?>
</a> Revisions</h2>
	<div class="box center_revision" id="center">
		<div class="body"><? foreach(diff($Diff1, $Diff2) AS $Line) { echo $Line; } ?></div>
	</div>
</div>
<?
show_footer();
예제 #4
0
/** Luo HTML kysymykselle
 * @param $question_id integer
 */
function create_body($question_id)
{
    /* 
     * $body string
     */
    $body = get_body($question_id);
    echo "<div class='question_box'>" . "<div class='question_body'>" . "<div id='question_content'>" . $body . "</div>" . "</div>";
}
예제 #5
0
     $cc = substr($cc, 0, strlen($cc) - 2);
     $subject = $h->subject;
     if (substr(strtolower($subject), 0, 3) != "re:") {
         $subject = "RE: " . $subject;
     }
     $output .= "<form action=index.php method=post>";
     $output .= "<b>To</b>: ";
     $output .= sprintf("<input size=40 type=text name=to_line value=\"%s\" />", $to);
     $output .= "<hr />";
     $output .= "<b>CC</b>: ";
     $output .= sprintf("<input size=40 type=text name=cc_line value=\"%s\" />", $cc);
     $output .= "<hr />";
     $output .= "<b>Subject</b>: ";
     $output .= sprintf("<input size=40 type=text name=subject value=\"%s\" />", $subject);
     $output .= "<hr />";
     $msgBody = get_body($mb, $_REQUEST['num'], False);
     if (strstr(strtolower($msgBody), "<html>") !== False) {
         $msgBody .= "<html>\n\n\n<hr />";
     } else {
         $msgBody = "\n\n\n>" . str_replace("\n", "\n>", $msgBody);
     }
     $output .= "<textarea name=body rows=10 cols=40>";
     $output .= $msgBody;
     $output .= "</textarea>";
     $output .= "<hr />";
     $output .= "<input type=submit name=send value=Send />";
     $output .= sprintf("<input type=hidden name=mbox value=\"%s\" />", $_REQUEST['mbox']);
     $output .= "</form>";
 } else {
     $folders = imap_getmailboxes($mb, $server, "*");
     $output .= "<a href=index.php?folder=INBOX>INBOX</a><br />";
예제 #6
0
파일: db.php 프로젝트: d42f/s-eng
function put_relations_data($id, $field, $lr_id, $rr_id)
{
    global $mysqli;
    $data = get_body(array($field));
    if (is_null($data) || count($data) == 0) {
        return null;
    }
    $data = $data[0];
    return put_data_by_relate_id($lr_id, $rr_id, $id, $data);
}
예제 #7
0
 function getLayout($vardef)
 {
     if (empty($vardef['type'])) {
         $vardef['type'] = 'varchar';
     }
     $mod = return_module_language($GLOBALS['current_language'], 'EditCustomFields');
     $this->ss->assign('vardef', $vardef);
     $this->ss->assign('MOD', $mod);
     $GLOBALS['log']->debug('FieldViewer.php->getLayout() = ' . $vardef['type']);
     switch ($vardef['type']) {
         case 'bool':
             return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/bool.tpl');
         case 'int':
             return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/int.tpl');
         case 'float':
             return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/float.tpl');
         case 'date':
             require_once 'modules/DynamicFields/templates/Fields/Forms/date.php';
             return get_body($this->ss, $vardef);
         case 'enum':
             require_once 'modules/DynamicFields/templates/Fields/Forms/enum2.php';
             return get_body($this->ss, $vardef);
         case 'multienum':
             require_once 'modules/DynamicFields/templates/Fields/Forms/multienum.php';
             return get_body($this->ss, $vardef);
         case 'radioenum':
             require_once 'modules/DynamicFields/templates/Fields/Forms/radioenum.php';
             return get_body($this->ss, $vardef);
         case 'html':
             require_once 'modules/DynamicFields/templates/Fields/Forms/html.php';
             return get_body($this->ss, $vardef);
         case 'currency':
             return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/currency.tpl');
         case 'relate':
             require_once 'modules/DynamicFields/templates/Fields/Forms/relate.php';
             return get_body($this->ss, $vardef);
         case 'parent':
             require_once 'modules/DynamicFields/templates/Fields/Forms/parent.php';
             return get_body($this->ss, $vardef);
         case 'text':
             return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/text.tpl');
         case 'encrypt':
             require_once 'modules/DynamicFields/templates/Fields/Forms/encrypt.php';
             return get_body($this->ss, $vardef);
         case 'iframe':
             require_once 'modules/DynamicFields/templates/Fields/Forms/iframe.php';
             return get_body($this->ss, $vardef);
         case 'url':
             require_once 'modules/DynamicFields/templates/Fields/Forms/url.php';
             return get_body($this->ss, $vardef);
         default:
             $file = false;
             if (file_exists('custom/modules/DynamicFields/templates/Fields/Forms/' . $vardef['type'] . '.php')) {
                 $file = 'custom/modules/DynamicFields/templates/Fields/Forms/' . $vardef['type'] . '.php';
             } elseif (file_exists('modules/DynamicFields/templates/Fields/Forms/' . $vardef['type'] . '.php')) {
                 $file = 'modules/DynamicFields/templates/Fields/Forms/' . $vardef['type'] . '.php';
             }
             if (!empty($file)) {
                 require_once $file;
                 return get_body($this->ss, $vardef);
             } else {
                 return $this->ss->fetch('modules/DynamicFields/templates/Fields/Forms/varchar.tpl');
             }
     }
 }
예제 #8
0
function xpress_render($contents)
{
    global $xoops_config;
    global $xoopsUser, $xoopsTpl, $xpress_config, $xoopsModule, $xoopsLogger, $xoopsConfig;
    //for XOOPS
    require_once ABSPATH . '/include/xpress_breadcrumbs.php';
    $xoops_breadcrumbs = get_breadcrumbs();
    xpress_remake_global_for_permlink();
    $mydirname = basename(dirname(dirname(__FILE__)));
    include $xoops_config->xoops_root_path . "/header.php";
    $xoopsTpl->assign('xoops_breadcrumbs', $xoops_breadcrumbs);
    $xoopsTpl->assign('xoops_module_header', get_xpress_module_header($contents));
    $page_title = $GLOBALS["xoopsModule"]->getVar("name") . ' &raquo;' . get_xpress_title($contents);
    $xoopsTpl->assign('xoops_pagetitle', $page_title);
    $xoops_keywords = $xoopsTpl->get_template_vars('xoops_meta_keywords');
    $wp_keyword = get_xpress_meta_name('keywords', $contents);
    switch ($xpress_config->meta_keyword_type) {
        case 'xoops':
            break;
        case 'wordpress':
            if (!empty($wp_keyword)) {
                $xoopsTpl->assign('xoops_meta_keywords', $wp_keyword);
            }
            break;
        case 'wordpress_xoops':
            if (!empty($wp_keyword)) {
                if (!empty($xoops_keywords)) {
                    $keywords = $wp_keyword . ', ' . $xoops_keywords;
                } else {
                    $keywords = $wp_keyword;
                }
                $xoopsTpl->assign('xoops_meta_keywords', $keywords);
            }
            break;
        default:
    }
    $xoops_description = $xoopsTpl->get_template_vars('xoops_meta_description');
    $wp_description = get_xpress_meta_name('description', $contents);
    switch ($xpress_config->meta_description_type) {
        case 'xoops':
            break;
        case 'wordpress':
            if (!empty($wp_description)) {
                $xoopsTpl->assign('xoops_meta_description', $wp_description);
            }
            break;
        case 'wordpress_xoops':
            if (!empty($wp_description)) {
                if (!empty($xoops_description)) {
                    $description = $wp_description . ' ' . $xoops_description;
                } else {
                    $description = $wp_description;
                }
                $xoopsTpl->assign('xoops_meta_description', $description);
            }
            break;
        default:
    }
    $wp_robots = get_xpress_meta_name('robots', $contents);
    switch ($xpress_config->meta_robot_type) {
        case 'xoops':
            break;
        case 'wordpress':
            if (!empty($wp_robots)) {
                $xoopsTpl->assign('xoops_meta_robots', $wp_robots);
            }
            break;
        default:
    }
    if (empty($contents)) {
        $template_name = get_option('template');
        $xpress_data['body_contents'] = "<p>Themes \"{$template_name}\" is broken or doesn't exist. </p><p>Please choose the right theme from the admin page of wordpress.</p>";
    } else {
        $xpress_data['body_contents'] = get_body($contents);
    }
    // used $GLOBALS. becose xpress_left_arrow_post_link() and xpress_right_arrow_post_link() is other loop in this position
    $xpress_data['left_post_link'] = @$GLOBALS['left_arrow_post_link'];
    $xpress_data['right_post_link'] = @$GLOBALS['right_arrow_post_link'];
    $xpress_data['left_posts_link'] = str_replace('&laquo;', '', xpress_left_arrow_posts_link('echo=0'));
    $xpress_data['right_posts_link'] = str_replace('&raquo;', '', xpress_right_arrow_posts_link('echo=0'));
    $xpress_data['now_user_level'] = xpress_now_user_level('echo=0');
    //If notification_select.php is not executed in CMS other than XCL, the selector of in-line is not displayed.
    if (is_object($xoopsModule) && $xoopsModule->getVar('hasnotification') == 1 && is_object($xoopsUser)) {
        require_once $xoops_config->xoops_root_path . '/include/notification_select.php';
    }
    $xoopsTpl->assign('xpress', $xpress_data);
    $templates_file = 'db:' . $mydirname . '_index.html';
    echo $xoopsTpl->fetch($templates_file);
    include $xoops_config->xoops_root_path . '/footer.php';
}
예제 #9
0
#!/usr/bin/php
<?php 
include 'config.inc.php';
$sender = trim($argv[1]);
$recipient = trim($argv[2]);
$raw_message = get_body();
// If you only have one car, you can skip all this.
// But if you have multiple cars, you need some way to identify which cars the incoming email refers to.
if (message_contains('corolla')) {
    $owner = '*****@*****.**';
    // This email address needs to be the same as the email address found in your database, in the cars table.
} else {
    if (message_contains('highlander')) {
        $owner = '*****@*****.**';
    }
}
if (!isset($owner)) {
    die("Unknown sender: {$sender}");
}
if (!eregi("[ \n\r\t]*([^-][0-9\\,\\.]+)[ \n\r\t]*k?m?[ \n\r\t]+\\\$?[ \n\r\t]*([0-9\\,\\.]+)[ \n\r\t]*\\\$?[ \n\r\t]+([0-9\\,\\.]+[^:])[ \n\r\t]*l?", $raw_message, $regs) && !eregi("[ \n\r\t]*([^-][0-9\\,\\.]+)[ \n\r\t]*k?m?[ \n\r\t]*<[/div]+>[ \n\r\t]*\\\$?[ \n\r\t]*([0-9\\,\\.]+)[ \n\r\t]*\\\$?[ \n\r\t]*<[/div]+>[ \n\r\t]*([0-9\\,\\.]+[^:])[ \n\r\t]*l?", $raw_message, $regs)) {
    file_put_contents('/tmp/temp.txt', "Sender: {$sender}, Recipient: {$recipient}, Can't find KPL in message body: " . $raw_message);
    die("Can't find KPL in message body.");
} else {
    $km = str_replace(',', '.', $regs[1]);
    $price = str_replace(',', '.', $regs[2]);
    $liters = str_replace(',', '.', $regs[3]);
    file_put_contents('/tmp/fuel_temp.txt', var_export($regs, TRUE) . "found in message body: " . $raw_message . ", with subject: " . $subject);
    $db = mysql_connect($config->db_host, $config->db_username, $config->db_password) or die("Can't connect to DB.");
    mysql_select_db($config->db_name) or die("Can't select DB.");
    $query = sprintf("SELECT * FROM cars WHERE owner = '%s'", mysql_escape_string($owner));
    $results = mysql_query($query) or die("Can't select car.");
예제 #10
0
    include("error.php");
} else {
    $r = Recipe::getById($id);
    $c = NULL;
    $cat = $_REQUEST['cat'];
    if (strlen($cat) > 0) {
        $c = Category::getById($cat);
    }
    $action = $_REQUEST['action'];
    if ($action == "save") {
        $r->setTitle(StripSlashes($_REQUEST['title']));
        $r->setCategory($c);
        $r->setOrigin(StripSlashes($_REQUEST['origin']));
        $r->setSize(StripSlashes($_REQUEST['size']));
        $r->setIngredients(StripSlashes($_REQUEST['ingredients']));
        $r->setSteps(StripSlashes(get_body($_REQUEST['kupu'])));
        if ($_FILES['photo']['size'] != 0) {
            $filename = $_FILES['photo']['name'];
            $extension = strrchr($filename, '.');
            if ($extension != ".jpg") {
                $r->save();
                header("Location: editkupu.php?id=".$r->getId()."&err=OnlyJpegFiles");
            } else {
                $r->hasPhoto(TRUE);
                $r->save();
                $r->setPhoto($_FILES['photo']['tmp_name'], $extension);
                header("Location: viewkupu.php?id=".$r->getId());
            }
        } else {
            $r->save();
            header("Location: viewkupu.php?id=".$r->getId());