예제 #1
1
function CAMOS_report($pid, $encounter, $cols, $id)
{
    $data = formFetch("form_CAMOS", $id);
    if ($data) {
        //echo "(category) ".stripslashes($data['category'])." | ";
        //echo "(subcategory) ".stripslashes($data['subcategory'])." | ";
        //echo "(item) ".stripslashes($data['item']);
        echo "<div class='navigateLink'><a href='" . $GLOBALS['webroot'] . "/interface/forms/CAMOS/rx_print.php?sigline=embossed' target=_new>" . xl('Rx') . "</a>\n";
        echo " | ";
        echo "<a href='" . $GLOBALS['webroot'] . "/interface/forms/CAMOS/rx_print.php?sigline=signed' target=_new>" . xl('Signed Rx') . "</a>\n";
        echo "<br>";
        echo "<a href='" . $GLOBALS['webroot'] . "/interface/forms/CAMOS/rx_print.php?letterhead=true&signer=patient' target=_new>" . xl('Letterhead that patient signs') . "</a>\n";
        echo " | ";
        echo "<a href='" . $GLOBALS['webroot'] . "/interface/forms/CAMOS/rx_print.php?letterhead=true&signer=doctor' target=_new>" . xl('Letterhead that doctor signs') . "</a>\n";
        echo "<br>";
        echo "<a href='" . $GLOBALS['webroot'] . "/interface/forms/CAMOS/notegen.php?pid=" . $pid . "&encounter=" . $encounter . "' target=_new>" . xl('Print This Encounter') . "</a>\n";
        echo " | ";
        echo "<a href='" . $GLOBALS['webroot'] . "/interface/forms/CAMOS/notegen.php' target=_new>" . xl('Print Any Encounter') . "</a></div>\n";
        //    echo "<pre>".wordwrap(stripslashes(content_parser($data['content'])))."</pre><hr>\n";
        echo "<pre>" . wordwrap(stripslashes(replace($pid, $encounter, $data['content']))) . "</pre><hr>\n";
    }
}
예제 #2
0
function get_product_list($select = 0, $ignore = 0)
{
    global $apx, $db, $set;
    $select = (int) $select;
    //Leeres Feld
    $list = '<option value=""></option>';
    //Sprachplatzhalter dropen
    $apx->lang->drop('type', 'products');
    //Auslesen
    $lasttype = '';
    $data = $db->fetch("SELECT id,type,title FROM " . PRE . "_products WHERE active='1' ORDER BY type ASC,title ASC");
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            if ($ignore == $res['id']) {
                continue;
            }
            //Gruppieren
            if ($res['type'] != $lasttype) {
                if ($lasttype) {
                    $list .= '</optgroup>';
                }
                $list .= '<optgroup label="' . $apx->lang->get('PRODTYPE_' . strtoupper($res['type'])) . '">';
            }
            $list .= '<option value="' . $res['id'] . '"' . iif($res['id'] == $select, ' selected="selected"') . '>' . replace($res['title']) . '</option>';
            $lasttype = $res['type'];
        }
        if ($lasttype) {
            $list .= '</optgroup>';
        }
    }
    return $list;
}
예제 #3
0
 private function BuildDeleteMissilesForm(&$CurrentPlanet)
 {
     global $resource, $lang;
     if ($_POST['form'] == 'missiles') {
         $_POST['502'] = replace('+', '', $_POST['502']);
         $_POST['502'] = replace('-', '', $_POST['502']);
         $_POST['503'] = replace('+', '', $_POST['503']);
         $_POST['503'] = replace('-', '', $_POST['503']);
         $_POST['502'] = intval($_POST['502']);
         $_POST['503'] = intval($_POST['503']);
         if ($_POST['502'] > $CurrentPlanet[$resource[502]]) {
             $_POST['502'] = $CurrentPlanet[$resource[502]];
         }
         if ($_POST['503'] > $CurrentPlanet[$resource[503]]) {
             $_POST['503'] = $CurrentPlanet[$resource[503]];
         }
         doquery("UPDATE {{table}} SET `" . $resource[502] . "` = `" . $resource[502] . "` - " . $_POST['502'] . " , `" . $resource[503] . "` = `" . $resource[503] . "` - " . $_POST['503'] . " WHERE `id` = " . $CurrentPlanet['id'] . ";", 'planets');
         $CurrentPlanet[$resource[502]] -= $_POST['502'];
         $CurrentPlanet[$resource[503]] -= $_POST['503'];
     }
     $RowsTPL = gettemplate('infos/delete_missile_rows');
     $parse['max_mis'] = pretty_number($CurrentPlanet[$resource[44]] * MAX_MIS_PER_LEVEL);
     $parse['int_miss'] = $lang['tech'][502] . ': ' . $CurrentPlanet[$resource[502]];
     $parse['plant_miss'] = $lang['tech'][503] . ': ' . $CurrentPlanet[$resource[503]];
     $Result = parsetemplate($RowsTPL, $parse);
     return $Result;
 }
예제 #4
0
 function show()
 {
     global $set, $db, $apx, $html;
     quicklink('contact.add');
     $orderdef[0] = 'title';
     $orderdef['title'] = array('title', 'ASC', 'COL_TITLE');
     $orderdef['email'] = array('email', 'ASC', 'COL_EMAIL');
     $col[] = array('ID', 3, 'align="center"');
     $col[] = array('COL_TITLE', 50, 'class="title"');
     $col[] = array('COL_EMAIL', 47, '');
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_contact");
     pages('action.php?action=contact.show&amp;sortby=' . $_REQUEST['sortby'], $count);
     $data = $db->fetch("SELECT id,title,email FROM " . PRE . "_contact " . getorder($orderdef) . getlimit());
     if (count($data)) {
         foreach ($data as $res) {
             ++$i;
             $tabledata[$i]['COL1'] = $res['id'];
             $tabledata[$i]['COL2'] = replace($res['title']);
             $tabledata[$i]['COL3'] = replace($res['email']);
             //Optionen
             if ($apx->user->has_right('contact.edit')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTML('edit.gif', 'contact.edit', 'id=' . $res['id'], $apx->lang->get('CORE_EDIT'));
             }
             if ($apx->user->has_right('contact.del')) {
                 $tabledata[$i]['OPTIONS'] .= optionHTMLOverlay('del.gif', 'contact.del', 'id=' . $res['id'], $apx->lang->get('CORE_DEL'));
             }
         }
     }
     $apx->tmpl->assign('TABLE', $tabledata);
     $html->table($col);
     orderstr($orderdef, 'action.php?action=contact.show');
     save_index($_SERVER['REQUEST_URI']);
 }
예제 #5
0
 function get_catlist($selected = null)
 {
     global $set, $db, $apx;
     if (is_null($selected)) {
         $selected = $_POST['catid'];
     }
     $catlist = '<option></option>';
     if ($set['news']['subcats']) {
         $data = $this->cat->getTree(array('title', 'open', 'forgroup'));
     } else {
         $data = $db->fetch("SELECT id,title,open,forgroup FROM " . PRE . "_news_cat ORDER BY title ASC");
     }
     if (!count($data)) {
         return '';
     }
     foreach ($data as $res) {
         $allowed = unserialize($res['forgroup']);
         if ($res['level']) {
             $space = str_repeat('&nbsp;&nbsp;', $res['level'] - 1);
         }
         if ($res['open'] && ($res['forgroup'] == 'all' || is_array($allowed) && in_array($apx->user->info['groupid'], $allowed))) {
             $catlist .= '<option value="' . $res['id'] . '" ' . iif($selected == $res['id'], ' selected="selected"') . ' style="color:green;">' . $space . replace($res['title']) . '</option>';
         } else {
             $catlist .= '<option value="" disabled="disabled">' . $space . replace($res['title']) . '</option>';
         }
     }
     return $catlist;
 }
function linker($content, $regex, $url, $max = -1)
{
    $link_replacements = array();
    $other_replacements = array();
    $title_replacements = array();
    preg_match_all('/<(img|input)(.*?) \\/?>/iu', $content, $others);
    if (!empty($others[0])) {
        $other_replacements = gen_replacements($others[0], 'others');
        $content = replace($other_replacements, $content);
    }
    preg_match_all('/<title>(.+)<\\/title>/', $content, $titles);
    if (!empty($titles[0])) {
        $title_replacements = gen_replacements($titles[0], 'others');
        $content = replace($title_replacements, $content);
    }
    preg_match_all('/<a(.*?)href="(.*?)"(.*?)>(.*?)<\\/a>/iu', $content, $links);
    if (!empty($links[0])) {
        $start = count($link_replacements);
        $tmp = gen_replacements($links[0], 'links', $start);
        $content = replace($tmp, $content);
        $link_replacements = array_merge($link_replacements, $tmp);
    }
    $replace = sprintf('$1<a href="%1$s" title="$2">$2</a>$3', $url);
    $content = preg_replace($regex, $replace, $content, $max);
    $content = replace_bak($link_replacements, $content);
    $content = replace_bak($title_replacements, $content);
    $content = replace_bak($other_replacements, $content);
    return $content;
}
예제 #7
0
function user_assign_visitors($object, $id, &$tmpl)
{
    global $apx, $set, $db, $user;
    $userdata = array();
    $data = $db->fetch("SELECT u.userid,u.username,u.groupid,u.realname,u.gender,u.city,u.plz,u.country,u.city,u.lastactive,u.pub_invisible,u.avatar,u.avatar_title,u.custom1,u.custom2,u.custom3,u.custom4,u.custom5,u.custom6,u.custom7,u.custom8,u.custom9,u.custom10 FROM " . PRE . "_user_visits AS v LEFT JOIN " . PRE . "_user AS u USING(userid) WHERE v.object='" . addslashes($object) . "' AND v.id='" . intval($id) . "' AND v.time>='" . (time() - 24 * 3600) . "' ORDER BY u.username ASC");
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            $userdata[$i]['ID'] = $res['userid'];
            $userdata[$i]['USERID'] = $res['userid'];
            $userdata[$i]['USERNAME'] = replace($res['username']);
            $userdata[$i]['GROUPID'] = $res['groupid'];
            $userdata[$i]['ONLINE'] = iif(!$res['pub_invisible'] && $res['lastactive'] + $set['user']['timeout'] * 60 >= time(), 1, 0);
            $userdata[$i]['REALNAME'] = replace($res['realname']);
            $userdata[$i]['GENDER'] = $res['gender'];
            $userdata[$i]['CITY'] = replace($res['city']);
            $userdata[$i]['PLZ'] = replace($res['plz']);
            $userdata[$i]['COUNTRY'] = $res['country'];
            $userdata[$i]['LASTACTIVE'] = $res['lastactive'];
            $userdata[$i]['AVATAR'] = $user->mkavatar($res);
            $userdata[$i]['AVATAR_TITLE'] = $user->mkavtitle($res);
            //Custom-Felder
            for ($ii = 1; $ii <= 10; $ii++) {
                $tabledata[$i]['CUSTOM' . $ii . '_NAME'] = $set['user']['cusfield_names'][$ii - 1];
                $tabledata[$i]['CUSTOM' . $ii] = compatible_hsc($res['custom' . $ii]);
            }
        }
    }
    $tmpl->assign('VISITOR', $userdata);
}
예제 #8
0
function get_gallery_list($selected = 0)
{
    global $set, $db, $apx;
    $list = '<option value=""></option>';
    if ($set['gallery']['subgals']) {
        require_once BASEDIR . 'lib/class.recursivetree.php';
        $tree = new RecursiveTree(PRE . '_gallery', 'id');
        $data = $tree->getTree(array('title'), null, "'" . time() . "' BETWEEN starttime AND endtime " . section_filter(true, 'secid'));
        if (!count($data)) {
            return '';
        }
        foreach ($data as $res) {
            $list .= '<option value="' . $res['id'] . '"' . iif($selected == $res['id'], ' selected="selected"') . '>' . str_repeat('&nbsp;&nbsp;', $res['level'] - 1) . replace(strip_tags($res['title'])) . '</option>';
        }
    } else {
        $data = $db->fetch("SELECT id,title FROM " . PRE . "_gallery WHERE '" . time() . "' BETWEEN starttime AND endtime " . section_filter(true, 'secid') . " ORDER BY title ASC");
        if (!count($data)) {
            return '';
        }
        foreach ($data as $res) {
            $list .= '<option value="' . $res['id'] . '"' . iif($selected == $res['id'], ' selected="selected"') . '>' . replace(strip_tags($res['title'])) . '</option>';
        }
    }
    return $list;
}
예제 #9
0
 function get_catlist($selected = null)
 {
     global $set, $db, $apx;
     if (is_null($selected)) {
         $selected = $_POST['catid'];
     }
     //Neue Kategorie erstellen
     if ($apx->user->has_right('links.catadd')) {
         $catlist = '<option value=""></option>';
     }
     $data = $this->cat->getTree(array('title', 'open'));
     if (!count($data)) {
         return '';
     }
     foreach ($data as $res) {
         if ($res['level']) {
             $space = str_repeat('&nbsp;&nbsp;', $res['level'] - 1);
         }
         if ($res['open']) {
             $catlist .= '<option value="' . $res['id'] . '" ' . iif($selected == $res['id'], ' selected="selected"') . ' style="color:green;">' . $space . replace($res['title']) . '</option>';
         } else {
             $catlist .= '<option value="" disabled="disabled">' . $space . replace($res['title']) . '</option>';
         }
     }
     return $catlist;
 }
예제 #10
0
function unSpecialStrReplace($content, $startStr)
{
    $content = replace($content, '[$╠п╩РОоичA]$', $startStr . '|');
    $content = replace($content, '[$╠п╩РОоичB]$', $startStr . '-');
    $content = replace($content, '[$╠п╩РОоичC]$', $startStr . ',');
    $content = replace($content, '[$╠п╩РОоичD]$', $startStr . '\'');
    $content = replace($content, '[$╠п╩РОоичE]$', $startStr . '"');
    $unSpecialStrReplace = $content;
    return @$unSpecialStrReplace;
}
예제 #11
0
function edit1($word)
{
    $list1 = delete($word);
    $list2 = insert($word);
    $list3 = transpose($word);
    $list4 = replace($word);
    $union = array_merge($list1, $list2, $list3, $list4);
    $union = array_unique($union);
    return $union;
}
예제 #12
0
 private function apply($query, $args)
 {
     $sql = $this->sql;
     return replace(['/\\[(\\w+)\\]/', '/\\$(\\w+)/'], [function ($matches) use($args) {
         $name = $matches[1];
         return isset($args[$name]) ? $args[$name] : $matches[0];
     }, function ($matches) use($sql, $args) {
         $name = $matches[1];
         return isset($args[$name]) ? $sql->quote($args[$name]) : $matches[0];
     }], $query);
 }
예제 #13
0
파일: remind.php 프로젝트: skcho/seminar
function gen_msg($snt)
{
    $names = array_map(function ($id) {
        return get_member_name($id);
    }, $snt["who"]);
    $talk_time = time_of_when($snt["when"]);
    $abs_time = mktime(23, 59, 0, $snt["when"]["month"], $snt["when"]["day"] - 7, $snt["when"]["year"]);
    $memo_time = mktime(9, 0, 0, $snt["when"]["month"], $snt["when"]["day"] - 2, $snt["when"]["year"]);
    $msg = replace(__ROOT__ . "/template/remind.temp", array("names" => implode(', ', $names), "talk_time" => date('Y-m-d', $talk_time), "abs_time" => date('Y-m-d H:i', $abs_time), "memo_time" => date('Y-m-d H:i', $memo_time)));
    return $msg;
}
예제 #14
0
파일: notice.php 프로젝트: skcho/seminar
function gen_talk_msg($is_fst, $t, $where, $who)
{
    $talk = get_talk_data($t, $who);
    if ($is_fst) {
        $pdf = "";
    } else {
        $date = date('ymd', $t);
        $pdf = "http://ropas.snu.ac.kr/snt_memo2/{$date}_{$who}.pdf";
    }
    $src = array("TITLE" => $talk["title"], "SPEAKER" => get_member_name($who), "TIME" => date('M j (D)', $t) . " at " . date('H:i', $t), "WHERE" => $where, "ABSTRACT" => $talk["abstract"], "PDF" => $pdf);
    return replace(__ROOT__ . "/template/notice.temp", $src);
}
예제 #15
0
function createTeamData($res, $parse)
{
    global $apx, $db, $set, $user;
    $userdata = array();
    if ($res['birthday']) {
        $bd = explode('-', $res['birthday']);
        $birthday = intval($bd[0]) . '. ' . getcalmonth($bd[1]) . iif($bd[2], ' ' . $bd[2]);
        if ($bd[2]) {
            $age = date('Y') - $bd[2];
            if (intval(sprintf('%02d%02d', $bd[1], $bd[0])) > intval(date('md'))) {
                $age -= 1;
            }
        }
    }
    $userdata['ID'] = $res['userid'];
    $userdata['USERID'] = $res['userid'];
    $userdata['NAME'] = replace($res['username']);
    $userdata['USERNAME'] = replace($res['username']);
    $userdata['GROUPID'] = $res['groupid'];
    $userdata['EMAIL'] = replace(iif(!$res['pub_hidemail'], $res['email']));
    $userdata['EMAIL_ENCRYPTED'] = replace(iif(!$res['pub_hidemail'], cryptMail($res['email'])));
    $userdata['ONLINE'] = iif(!$res['pub_invisible'] && $res['lastactive'] + $set['user']['timeout'] * 60 >= time(), 1, 0);
    $userdata['ISONLINE'] = $userdata['ONLINE'];
    $userdata['REALNAME'] = replace($res['realname']);
    $userdata['GENDER'] = $res['gender'];
    $userdata['CITY'] = replace($res['city']);
    $userdata['PLZ'] = replace($res['plz']);
    $userdata['COUNTRY'] = $res['country'];
    $userdata['REGTIME'] = $res['reg_time'];
    $userdata['REGDAYS'] = floor((time() - $res['reg_time']) / (24 * 3600));
    $userdata['LASTACTIVE'] = $res['lastactive'];
    $userdata['AVATAR'] = $user->mkavatar($res);
    $userdata['AVATAR_TITLE'] = $user->mkavtitle($res);
    $userdata['BIRTHDAY'] = $birthday;
    $userdata['AGE'] = $age;
    if (in_array($varname . '.ISBUDDY', $parse)) {
        $userdata['ISBUDDY'] = $user->is_buddy($res['userid']);
    }
    //Custom-Felder
    for ($ii = 1; $ii <= 10; $ii++) {
        $userdata['CUSTOM' . $ii . '_NAME'] = $set['user']['cusfield_names'][$ii - 1];
        $userdata['CUSTOM' . $ii] = compatible_hsc($res['custom' . $ii]);
    }
    //Interaktions-Links
    if ($user->info['userid']) {
        $userdata['LINK_SENDPM'] = mklink('user.php?action=newpm&amp;touser='******'userid'], 'user,newpm,' . $res['userid'] . '.html');
        $userdata['LINK_SENDEMAIL'] = mklink('user.php?action=newmail&amp;touser='******'userid'], 'user,newmail,' . $res['userid'] . '.html');
        if (in_array($varname . '.LINK_BUDDY', $parse) && !$user->is_buddy($res['userid'])) {
            $userdata['LINK_BUDDY'] = mklink('user.php?action=addbuddy&amp;id=' . $res['userid'], 'user,addbuddy,' . $res['userid'] . '.html');
        }
    }
    return $userdata;
}
예제 #16
0
파일: commenter.php 프로젝트: skcho/seminar
function gen_msg($snt, $commenter_info)
{
    $talk_time = time_of_when($snt["when"]);
    $comment_time = mktime(18, 0, 0, $snt["when"]["month"], $snt["when"]["day"] - 1, $snt["when"]["year"]);
    $commenters_msg = "";
    foreach ($commenter_info as $speaker => $commenters) {
        $speaker_name = get_member_name($speaker);
        $commenters_name = array_map("get_member_name", $commenters);
        $commenters_msg .= $speaker_name . ": " . implode(", ", $commenters_name) . "\n";
    }
    $msg = replace(__ROOT__ . "/template/commenter.temp", array("talk_time" => date("Y-m-d H:i", $talk_time), "comment_time" => date("Y-m-d H:i", $comment_time), "chair_info" => get_member_name($snt["chair"]), "commenter_info" => $commenters_msg));
    return $msg;
}
예제 #17
0
 private function apply($query, $args)
 {
     $self = $this;
     return replace(['/\\[(\\w+)\\]/', '/\\$(\\w+)/'], [function ($matches) use($args) {
         $name = $matches[1];
         isset($args[$name]) or backend_error('bad_input', 'Unknown procedure parameter: ' . $name);
         return $args[$name];
     }, function ($matches) use($self, $args) {
         $name = $matches[1];
         isset($args[$name]) or backend_error('bad_input', 'Unknown procedure parameter: ' . $name);
         return $self->sql->quote($args[$name]);
     }], $query);
 }
예제 #18
0
function posts_init() {
	
	global
	$theme_posts;
	
	if (!empty($theme_posts)) {
		foreach ($theme_posts as $post) {
			register_post_type(replace($post['label']), $post);
			
			if (!empty($post['categories'])) {
				register_taxonomy(replace($post['categories']['label']), replace($post['label']), $post['categories']);
			}
		}
	}
}
예제 #19
0
 /**
  * Helper function to get the common hidden form fields.
  * Any additional optional fields can be set as hidden.
  * TODO: the ability to pull out additional fields as hidden would be useful.
  */
 public function getHiddenFormFields()
 {
     $html = array();
     // The merchant ID is mandatory.
     $html[] = replace(array('{name}', '{value}'), array('merchantId', $this->getMerchantId()), $this::HTML_TEMPLATE_HIDDEN_FIELD);
     // The dev mode flag is optional.
     if ($this->getDeveloperMode()) {
         $html[] = replace(array('{name}', '{value}'), array('dev', '1'), $this::HTML_TEMPLATE_HIDDEN_FIELD);
     }
     // The test mode flag is optional.
     if ($this->getTestMode()) {
         $html[] = replace(array('{name}', '{value}'), array('test', '1'), $this::HTML_TEMPLATE_HIDDEN_FIELD);
     }
     return implode("\n", $html);
 }
예제 #20
0
function misc_articlesfeed()
{
    global $set, $db, $apx;
    $apx->tmpl->loaddesign('blank');
    header('Content-type: application/rss+xml');
    //Verwendete Variablen
    $parse = $apx->tmpl->used_vars('rss', 'articles');
    //Baum holen, wenn nur eine bestimmte Kategorie gezeigt werden soll
    $cattree = articles_tree($_REQUEST['catid']);
    $data = $db->fetch("SELECT a.id,a.type,a.catid,a.title,a.subtitle,a.teaser,a.starttime,a.top,b.username,b.email,b.pub_hidemail FROM " . PRE . "_articles AS a LEFT JOIN " . PRE . "_user AS b USING (userid) WHERE ( " . time() . " BETWEEN starttime AND endtime " . iif(count($cattree), "AND catid IN (" . @implode(',', $cattree) . ")") . " " . section_filter() . " ) ORDER BY starttime DESC LIMIT 20");
    //Kategorien auslesen
    $catinfo = articles_catinfo(get_ids($data, 'catid'));
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            //Wohin soll verlinkt werden?
            if ($res['type'] == 'normal') {
                $link2file = 'articles';
            } else {
                $link2file = $res['type'] . 's';
            }
            //Link
            $link = mklink($link2file . '.php?id=' . $res['id'], $link2file . ',id' . $res['id'] . ',0' . urlformat($res['title']) . '.html');
            //Text: Teaser oder Artikelseite
            if ($res['teaser'] && $set['articles']['teaser']) {
                $text = $res['teaser'];
            } else {
                list($text) = $db->first("SELECT text FROM " . PRE . "_articles_pages WHERE artid='" . $res['id'] . "' ORDER BY ord ASC LIMIT 1");
                $text = $text;
            }
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['TITLE'] = rss_replace($res['title']);
            $tabledata[$i]['SUBTITLE'] = rss_replace($res['subtitle']);
            $tabledata[$i]['TIME'] = date('r', $res['starttime']);
            //Kein TIMEDIFF weil Zeitverschiebung mit angegeben!
            $tabledata[$i]['TEXT'] = rss_replace(preg_replace('#{IMAGE\\(([0-9]+)\\)}#s', '', $text));
            $tabledata[$i]['CATTITLE'] = rss_replace($catinfo[$res['catid']]['title']);
            $tabledata[$i]['LINK'] = HTTP_HOST . $link;
            $tabledata[$i]['USERNAME'] = replace($res['username']);
            $tabledata[$i]['EMAIL'] = replace(iif(!$res['pub_hidemail'], $res['email']));
            $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(iif(!$res['pub_hidemail'], cryptMail($res['email'])));
            $tabledata[$i]['TOP'] = $res['top'];
        }
    }
    $apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']);
    $apx->tmpl->assign('ARTICLE', $tabledata);
    $apx->tmpl->parse('rss', 'articles');
}
예제 #21
0
function reg()
{
    $id = get_valid_id($_REQUEST["id"]);
    $date = get_valid_date($_REQUEST["date"]);
    $t = strtotime($date);
    $talk_data = get_talk_data_or_gen($t, $id);
    if (file_exists(gen_memo_filename($t, $id))) {
        $memo_filename = date('ymd', $t) . "_{$id}.pdf";
        $link = "http://ropas.snu.ac.kr/snt_memo2/" . $memo_filename;
        $memo = "<a href=\"" . $link . "\">" . $memo_filename . "</a>";
    } else {
        $memo = "등록된 메모가 없습니다.";
    }
    $arr = array("ID" => $id, "NAME" => get_member_name($id), "WHEN" => $date, "TITLE" => htmlspecialchars($talk_data["title"]), "ABSTRACT" => htmlspecialchars($talk_data["abstract"]), "MEMO" => $memo);
    echo replace(__ROOT__ . "/template/reg_abstract.temp", $arr);
}
예제 #22
0
파일: gen_xml.php 프로젝트: skcho/seminar
function run_talk($snt, $n, $t, $id)
{
    $talk_data = get_talk_data($t, $id);
    if (get_member_lab($id) === "ropas") {
        $who = "<r:who member=\"" . $id . "\"/>";
    } else {
        $who = "<r:who>" . get_member_name($id) . "</r:who>";
    }
    $src = array("TITLE" => htmlspecialchars($talk_data["title"]), "WHO" => $who, "WHEN" => date(DATE_ATOM, $t), "WHERE" => $snt["where"], "ABSTRACT" => htmlspecialchars($talk_data["abstract"]), "SLIDES_FILENAME" => date('md', $t) . "_" . $n . ".pdf", "MEMO_FILENAME" => date('ymd', $t) . "_" . $id . ".pdf", "ID" => $id, "DATE" => date('Y-m-d', $t));
    $temp_filename = __ROOT__ . "/template/xml.temp";
    $msg = replace($temp_filename, $src);
    $filename = __ROOT__ . "/talk_root/" . date('Y', $t) . "/" . date('md', $t) . "_" . $n . ".xml";
    if (!my_file_put_contents($filename, $msg)) {
        exit(1);
    }
}
 function templates()
 {
     global $apx, $set;
     //Variablen
     $this->assign_static('SECTOKEN', $apx->session->get('sectoken'));
     $this->assign_static('CHARSET', $set['main']['charset']);
     $this->assign_static('ACTIVE_MODULE', $apx->module());
     $this->assign_static('ACTIVE_ACTION', $apx->action());
     $this->assign_static('SET_MAXUPLOAD', str_replace('M', 'MB', ini_get('upload_max_filesize')));
     $this->assign_static('SID', SID);
     $this->assign_static('SERVER_REQUEST_METHOD', $_SERVER['REQUEST_METHOD']);
     //Benutzerinfos
     $this->assign_static('LOGGED_ID', $apx->user->info['userid']);
     $this->assign_static('LOGGED_USERNAME', replace($apx->user->info['username']));
     $this->assign_static('LOGGED_EDITOR', $apx->user->info['admin_editor']);
     //Sektionen verwendet?
     if (count($apx->sections)) {
         $this->assign_static('SET_SECTIONS', 1);
         $this->assign_static('SELECTED_SECTION', $apx->session->get('section'));
     }
     //Set-Variablen
     foreach ($set as $module => $settings) {
         if (!is_array($settings)) {
             continue;
         }
         foreach ($settings as $key => $value) {
             $this->assign_static('SET_' . strtoupper($module) . '_' . strtoupper($key), $value);
         }
     }
     //Installierte Module
     foreach ($apx->modules as $module => $trash) {
         $this->assign_static('MODULE_' . strtoupper($module), 1);
     }
     //Rechte
     foreach ($apx->actions as $module => $actions) {
         foreach ($actions as $action => $trash) {
             if ($apx->user->has_right($module . '.' . $action)) {
                 $this->assign_static('RIGHT_' . strtoupper($module) . '_' . strtoupper($action), 1);
             }
             if ($apx->user->has_spright($module . '.' . $action)) {
                 $this->assign_static('SPRIGHT_' . strtoupper($module) . '_' . strtoupper($action), 1);
             }
         }
     }
     ob_start();
     parent::tengine(true);
 }
예제 #24
0
파일: 19.php 프로젝트: mrk-j/adventofcode
function replace($input, $step = 1)
{
    global $replacementsReverse, $createdMolecules;
    if ($input === 'e') {
        echo 'Molecule found after ' . ($step - 1) . ' steps' . PHP_EOL;
    }
    $createdMolecule = $input;
    foreach ($replacementsReverse as $molecule => $replacement) {
        if (($pos = strpos($createdMolecule, $molecule)) !== false) {
            $createdMolecule = substr($createdMolecule, 0, $pos) . $replacement . substr($createdMolecule, $pos + strlen($molecule));
            $step++;
        }
    }
    if (!in_array($createdMolecule, $createdMolecules)) {
        $createdMolecules[] = $createdMolecule;
        replace($createdMolecule, $step);
    }
}
예제 #25
0
 function get_catlist()
 {
     global $set, $db, $apx;
     if ($set['calendar']['subcats']) {
         $data = $this->cat->getTree(array('title'));
     } else {
         $data = $db->fetch("SELECT id,title FROM " . PRE . "_calendar_cat ORDER BY title ASC");
     }
     if (!count($data)) {
         return '';
     }
     foreach ($data as $res) {
         if ($res['level']) {
             $space = str_repeat('&nbsp;&nbsp;', $res['level'] - 1);
         }
         $catlist .= '<option value="' . $res['id'] . '" ' . iif($_POST['catid'] == $res['id'], ' selected="selected"') . '>' . $space . replace($res['title']) . '</option>';
     }
     return $catlist;
 }
function html_65c161fa3974dab7ff9b5b08fa07491e($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0)
{
    if (isset($Pile[0]["doublons"]) and is_array($Pile[0]["doublons"])) {
        $doublons = nettoyer_env_doublons($Pile[0]["doublons"]);
    }
    $connect = '';
    $page = ($t1 = strval(invalideur_session($Cache, (function_exists("autoriser") || include_spip("inc/autoriser")) && autoriser('configurer', '_admin_vider') ? " " : "" ? ' ' : ''))) !== '' ? $t1 . ('

' . boite_ouvrir(interdire_scripts(wrap(concat(filtre_balise_img_dist(chemin_image('image-24.png'), '', 'cadre-icone'), _T('info_images_auto')), '<h3>')), 'simple', 'titrem') . '<div id="placehoder_taille_cache_images"><p>&nbsp;<br />&nbsp;<br />&nbsp;<br /></p></div>
	<script type="text/javascript">
		jQuery(function(){jQuery(\'#placehoder_taille_cache_images\').animateLoading().load(\'' . invalideur_session($Cache, replace(generer_action_auteur('calculer_taille_cache', 'images'), '&amp;', '&')) . '\');});
	</script>
	<noscript>
		<iframe src="' . invalideur_session($Cache, generer_action_auteur('calculer_taille_cache', 'images')) . '" style="width: 100%;height: 3em;overflow: hidden;"></iframe>
	</noscript>

' . boite_pied() . '
	' . bouton_action(_T('public|spip|ecrire:bouton_vider_cache'), invalideur_session($Cache, generer_action_auteur('purger', 'vignettes', invalideur_session($Cache, self()))), 'ajax') . '
' . boite_fermer() . '
') : '';
    return analyse_resultat_skel('html_65c161fa3974dab7ff9b5b08fa07491e', $Cache, $page, '../prive/squelettes/inclure/admin_vider_images.html');
}
예제 #27
0
function glossar_tags($id)
{
    global $set, $db, $apx, $user;
    $tagdata = array();
    $tagids = array();
    $tags = array();
    $data = $db->fetch("\n\t\tSELECT t.tagid, t.tag, count(nt.id) AS weight\n\t\tFROM " . PRE . "_glossar_tags AS nt\n\t\tLEFT JOIN " . PRE . "_tags AS t ON nt.tagid=t.tagid\n\t\tLEFT JOIN " . PRE . "_glossar_tags AS nt2 ON nt.tagid=nt2.tagid\n\t\tWHERE nt.id=" . intval($id) . "\n\t\tGROUP BY nt.tagid\n\t\tORDER BY t.tag ASC\n\t");
    if (count($data)) {
        $maxweight = 1;
        foreach ($data as $res) {
            if ($res['weight'] > $maxweight) {
                $maxweight = $res['weight'];
            }
        }
        foreach ($data as $res) {
            $tags[] = $res['tag'];
            $tagids[] = $res['tagid'];
            $tagdata[] = array('ID' => $res['tagid'], 'NAME' => replace($res['tag']), 'WEIGHT' => $res['weight'] / $maxweight);
        }
    }
    return array($tagdata, $tagids, implode(', ', $tags));
}
 /**
  *
  * @param string $file <p>Chemin vers le fichier XML</p>
  * @param string $sl <p>Langue d'origine (2 lettres)</p>
  * @param string $tl <p>Langue à traduire (2 lettres)</p>
  */
 public function __construct($file, $sl, $tl)
 {
     $xml = file_get_contents($file);
     $original = array();
     $traduct = array();
     $tags = array();
     preg_match_all('|<[^>]+>([^<>]+)<\\/[^>]+>|', $xml, $tags, PREG_SET_ORDER);
     foreach ($tags as $tag) {
         $text = trim($tag[1]);
         if ($text != '') {
             $original[] = trim($tag[0]);
             $url = 'https://translate.google.fr/translate_a/single?client=t&sl=' . $sl . '&tl=' . $tl . '&hl=' . $sl . '&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&dt=at&ie=UTF-8&oe=UTF-8&srcrom=0&ssel=5&tsel=4&kc=0&tk=111930.495949&q=' . rawurlencode($text);
             $json = file_get_contents($url);
             $json = replace(',,', ',"",', $json);
             $json = replace('[,', '["",', $json);
             $json = json_decode($json, true);
             $traduct[] = str_replace($text, $json[0][0][0], $tag[0]);
             usleep(500);
         }
     }
     return str_replace($original, $traduct, $xml);
 }
function BOUCLE_lien_webfontshtml_f7a72f7c15527e9fefe562fecb18cf87(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'mots';
        $command['id'] = '_lien_webfonts';
        $command['from'] = array('mots' => 'spip_mots');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("mots.descriptif");
        $command['orderby'] = array();
        $command['where'] = array(array('=', 'mots.titre', "'polices'"));
        $command['join'] = array();
        $command['limit'] = '';
        $command['having'] = array();
    }
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-meta.html', 'html_f7a72f7c15527e9fefe562fecb18cf87', '_lien_webfonts', 1, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            $t0 .= interdire_scripts(replace($Pile[$SP]['descriptif'], '&', '%26'));
        }
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_lien_webfonts @ squelettes/inc/inc-meta.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
예제 #30
0
function contentNameSort($content, $sType)
{
    $splStr = '';
    $arrayStr = aspArray(99);
    $fileName = '';
    $isOther = '';
    $otherStr = '';
    $id = '';
    $c = '';
    $s = '';
    $i = '';
    $left1 = '';
    $splStr = aspSplit($content, vbCrlf());
    foreach ($splStr as $key => $s) {
        if ($s != '') {
            $fileName = getStrFileName($s);
            $isOther = true;
            $left1 = left($fileName, 1);
            if (inStr($fileName, '、') > 0) {
                $id = replace(left($fileName, 2), '、', '');
                if (isNumber($id)) {
                    $arrayStr[$id] = $arrayStr[$id] . $s . vbCrlf();
                    $isOther = false;
                }
            }
            if (inStr($sType, $left1) == false && $isOther == true) {
                $otherStr = $otherStr . $s . vbCrlf();
            }
        }
    }
    for ($i = 0; $i <= uBound($arrayStr); $i++) {
        $c = $c . $arrayStr[$i];
    }
    $contentNameSort = $c . $otherStr;
    return @$contentNameSort;
}