function pane_base($url, $suj, $frm, $day, $img, $msg, $alx) { static $id; $id++; //$msg=ereg_replace('width='."^[_a-zA-Z0-9.]+$","",$msg);//([[:digit:]]*) $ara = array("<![CDATA[", "]]>"); $suj = str_replace($ara, " ", $suj); $url = str_replace($ara, " ", $url); $msg = str_replace($ara, " ", $msg); if ($img != "") { $gmi = '<img src="' . $img . '" class="imgl" border="0" height="72">'; } $id_art = recognize_article($url, clean_title($suj), $alx); //already_exists if ($id_art) { $opt .= popart($id_art); } elseif ($_SESSION["USE"] == $_SESSION["qb"] or $_SESSION["auth"] > 3) { $purl = ajx($url, ''); $opt .= ljb('txtx', 'SaveJ', 'popup_addArt___' . $purl . '_1', "save") . ' '; //$opt.=ljb('txtbox','SaveIf',$purl,'save').' '; $opt .= btd('btc' . $id, lj('txtx', 'btc' . $id . '_batch__xd_' . $purl . '_p', '+')) . ' '; $opt .= ljb('txtx', 'Close', 'art' . $id, 'x'); } $panout = array('sty' => 'tab', 'id' => $id, 'suj' => $suj, 'date' => $day, 'tag' => " ", 'opt' => $opt, 'thumb' => $gmi, 'msg' => $msg, 'url' => $url); $ret = template_build(template_rss(), $panout); return divd('article', $ret); }
public function Name($id = 0) { $id = $id ? $id : $this->id; $sql = "SELECT title_es as `name`\n FROM {$this->table}\n\n WHERE id_service = '{$id}'"; $query = $this->db->query($sql); $row = $query->row(); return clean_title($row->name); }
public function Name($id = 0) { $id = $id ? $id : $this->id; $sql = "SELECT name, lastname\n FROM {$this->table}\n\n WHERE id_author = '{$id}'"; $query = $this->db->query($sql); $row = $query->row(); return clean_title($row->name . ' ' . $row->lastname); }
public function Name($id = 0) { $id = $id ? $id : $this->id; $sql = "SELECT function as name\n FROM {$this->table}\n WHERE id_submenu = '{$id}'"; $query = $this->db->query($sql); $row = $query->row(); return clean_title($row->name); }
public function Name($id = 0) { $id = $id ? $id : $this->id; $sql = "SELECT id_cart as `name`\n FROM {$this->table}\n WHERE id_cart = '{$id}'"; $query = $this->db->query($sql); $row = $query->row(); return clean_title(str_pad($row->name, 6, "0", STR_PAD_LEFT)); }
public function Name($id = 0) { $id = $id ? $id : $this->id; $sql = "SELECT title as `name`, identification , num\n FROM {$this->table}\n WHERE id_trial = '{$id}'"; $query = $this->db->query($sql); $row = $query->row(); return clean_title(($row->identification ? $row->identification : $row->name) . ($row->num ? ' - Ensayo ' . $row->num : '')); }
function sugg_import($f, $o = '', $res = '') { list($f, $o) = ajxp($res, $f, $o); if (substr($f, 0, 4) != 'http') { return; } req('tri,pop'); $_GET['urlsrc'] = $f; list($suj, $msg) = vacuum($f, ''); $msg = format_txt($msg, '', ''); $ret = balc('h2', '', clean_title($suj)) . br() . $msg; return $ret; }
function prep_app_title($title = array(), $html = true) { if (!is_array($title)) { return clean_title($title); } $implode = ' | '; if ($html) { $implode = '<i class="fa fa-arrow-right"></i>'; } $title = implode($implode, $title); if (!$html) { $title = clean_title($title); } return $title; }
update_atom('topic', $topic_id); if ($mode == 'reply' && $post_info['topic_status'] == TOPIC_LOCKED) { $locked_warn = ' <div class="warnColor1"> <b>' . $lang['LOCKED_WARN'] . '</b> </div> <br /><hr /><br /> '; $return_message = $locked_warn . $return_message; } bb_die($return_message); } } if ($refresh || $error_msg || $submit && $topic_has_new_posts) { $username = !empty($_POST['username']) ? clean_username($_POST['username']) : ''; $subject = !empty($_POST['subject']) ? clean_title($_POST['subject']) : ''; $message = !empty($_POST['message']) ? prepare_message($_POST['message']) : ''; if ($preview) { $preview_subject = $subject; $preview_username = $username; $preview_message = htmlCHR($message, false, ENT_NOQUOTES); $preview_message = bbcode2html($preview_message); $template->assign_vars(array('TPL_PREVIEW_POST' => true, 'TOPIC_TITLE' => wbr($preview_subject), 'POST_SUBJECT' => $preview_subject, 'POSTER_NAME' => $preview_username, 'POST_DATE' => bb_date(TIMENOW), 'PREVIEW_MSG' => $preview_message)); } } else { // User default entry point if ($mode == 'newtopic') { $username = $userdata['session_logged_in'] ? $userdata['username'] : ''; $subject = $message = ''; } elseif ($mode == 'reply') { $username = $userdata['session_logged_in'] ? $userdata['username'] : '';
public function Name($id = 0) { $id = $id ? $id : $this->id; $dataItem = $this->DataElement($id); $title = $dataItem['client_code'] . "_" . $dataItem['instrument_id'] . "_" . date('dmy', mysql_to_unix($dataItem['date'])) . "_" . $dataItem['version']; return clean_title($title); }
$id = explode(UNDERSCORE, $cPath); $new_path = EMPTY_STRING; while (list($key, $value) = each($id)) { unset($prev_id); unset($first_id); $categories_query_sql = str_replace(HASH, $value, $categories_query_sql0); $categories_query = olc_db_query($categories_query_sql); if (olc_db_num_rows($categories_query) > 0) { $new_path .= $value; while ($row = olc_db_fetch_array($categories_query)) { $name = $row[$categories_name]; $title = $row[$categories_heading_title]; if ($title == EMPTY_STRING) { $title = $name; } $title = clean_title($title); $foo[$row[$categories_id]] = array($name_text => $name, $parent_text => $row[$parent_id_text], $title_text => $title, $level_text => $key + 1, $path_text => $new_path . UNDERSCORE . $row[$categories_id], $next_id_text => false); if (isset($prev_id)) { $foo[$prev_id][$next_id_text] = $row[$categories_id]; } $prev_id = $row[$categories_id]; if (!isset($first_id)) { $first_id = $row[$categories_id]; } $last_id = $row[$categories_id]; } $foo[$last_id][$next_id_text] = $foo[$value][$next_id_text]; $foo[$value][$next_id_text] = $first_id; $new_path .= UNDERSCORE; } else { break;
$status = (int) $this->request['status']; // Валидность статуса if (!isset($lang['TOR_STATUS_NAME'][$status])) { $this->ajax_die($lang['STATUS_DOES_EXIST'] . $new_status); } $topic_ids = DB()->fetch_rowset("SELECT attach_id FROM " . BB_BT_TORRENTS . " WHERE topic_id IN({$topics})", 'attach_id'); foreach ($topic_ids as $attach_id) { change_tor_status($attach_id, $status); } $this->response['status'] = $bb_cfg['tor_icons'][$status]; $this->response['topics'] = explode(',', $topics); break; case 'edit_topic_title': $topic_id = (int) $this->request['topic_id']; $topic_title = (string) $this->request['topic_title']; $new_title = clean_title($topic_title); if (!$topic_id) { $this->ajax_die($lang['INVALID_TOPIC_ID']); } if ($new_title == '') { $this->ajax_die($lang['DONT_MESSAGE_TITLE']); } if (!($t_data = DB()->fetch_row("SELECT forum_id FROM " . BB_TOPICS . " WHERE topic_id = {$topic_id} LIMIT 1"))) { $this->ajax_die($lang['INVALID_TOPIC_ID_DB']); } $this->verify_mod_rights($t_data['forum_id']); $topic_title_sql = DB()->escape($new_title); DB()->query("UPDATE " . BB_TOPICS . " SET topic_title = '{$topic_title_sql}' WHERE topic_id = {$topic_id} LIMIT 1"); // Обновление кеша новостей на главной $news_forums = array_flip(explode(',', $bb_cfg['latest_news_forum_id'])); if (isset($news_forums[$t_data['forum_id']]) && $bb_cfg['show_latest_news']) {
} if (!$contents) { exit('<div class="error_msg">' . $lang_check_cantLocate . '</div>'); } if (ob_get_level() == 0) { ob_start(); } foreach ($contents as $value) { if (in_array($value, $garbage)) { continue; } $dirPath = str_replace($prefix, '', $value); $onlyFileName = strrchr($value, '/'); $file_date = date("m/d/Y H:i:s", filectime($value)); $file_type = file_type($onlyFileName); $clean_title = clean_title($onlyFileName); $datafile = $prefix . 'data' . $onlyFileName . '.txt'; if (file_exists($datafile)) { continue; } debugWrite('[DEBUG] <b>Name:</b>' . $clean_title . ' <b>File:</b>' . $onlyFileName . ' <b>Type:</b>' . $file_type); if ($settings_data['imdb_mode'] == 'false') { touch($datafile); continue; } debugWrite(' [' . $lang_check_debugCreateFile . ']<BR>'); $fh = fopen($datafile, 'a') or die($lang_check_notWritable); $movieArray = $imdb->getMovieInfo($clean_title, 2); $genres = implode(',', $movieArray['genres']); $stringData = $file_date . PHP_EOL . $movieArray['title'] . PHP_EOL . $file_type . PHP_EOL . $movieArray['title_id'] . PHP_EOL . $genres . PHP_EOL . $movieArray['rating'] . PHP_EOL . $dirPath . PHP_EOL . $movieArray['movie_rating'] . PHP_EOL . $movieArray['plot']; fwrite($fh, $stringData);
function save_tits_j($id) { $qda = $_SESSION['qda']; if ($ib = getjx('ib')) { $sq['ib'] = $ib; cache_value($id, 10, $ib); } if ($cat = getjx('frm1')) { $sq['frm'] = $cat; cache_value($id, 1, $cat); } if ($suj = clean_title(getjx('suj'))) { $sq['suj'] = $suj; cache_value($id, 2, $suj); } if ($img = getjx('img')) { $sq['img'] = $img; cache_value($id, 3, $img); } if ($src = getjx('src')) { $sq['mail'] = $src; cache_value($id, 9, $src); } if ($sq) { msquery('update ' . $qda . ' set ' . implode(',', atmrup($sq)) . ' where id=' . $id); } $r = $_SESSION['art_options']; $rdata = sql('val,msg', 'qdd', 'kv', 'ib="' . $id . '"'); if ($r) { foreach ($r as $k => $v) { $val = $rdata[$v]; $gv = ajx($_GET[$v], 1); if ($v == "related" or $v == "float_img" or $v == "template" or $v == "folder") { $vrf = ' '; } if ($v == "authlevel") { if (rstr(21)) { $vrf = "1"; } else { $vrf = "all"; } } if ($v == "tracks") { if (rstr(1)) { $vrf = 'true'; } else { $vrf = 'false'; } $gv = $gv == 1 ? 'true' : 'false'; } if ($v == "2cols") { if (rstr(17)) { $vrf = 'true'; } else { $vrf = 'false'; } $gv = $gv == 1 ? 'true' : 'false'; } if ($v == "fav") { if (rstr(52)) { $vrf = 'true'; } else { $vrf = 'false'; } $gv = $gv == 1 ? 'true' : 'false'; } if ($v == "like") { if (rstr(90)) { $vrf = 'true'; } else { $vrf = 'false'; } $gv = $gv == 1 ? 'true' : 'false'; } if ($v == "poll") { if (rstr(91)) { $vrf = 'true'; } else { $vrf = 'false'; } $gv = $gv == 1 ? 'true' : 'false'; } if ($v == "lang") { $vrf = prmb(25); $arr = explode(' ', prmb(26)); if ($arr) { foreach ($arr as $ka => $va) { $valb = $rdata['lang' . $va]; if ($_GET['lang' . $va] == $vrf && $val) { $_GET['lang' . $va] = ' '; } if ($_GET['lang' . $va] && $_GET['lang' . $va] != $valb && $_GET['lang' . $va] != 'undefined') { utag_sav($id, 'lang' . $va, $_GET['lang' . $va]); } } } } if (!$val) { $val = $vrf; } //permut value with global setting if ($gv == $vrf && $val) { $gv = ' '; } //erase if not usefull if ($gv && $gv != $val) { utag_sav($id, $v, $gv); } } } }
function parsedtemplatepath($templatetitle) { global $config; return $config['dir_parsed'] . clean_title($templatetitle) . ".html"; }
function recognize_article($f, $d, $alx) { $d = clean_title($d); if (@isset($alx[$f])) { return $alx[$f]; } elseif (isset($alx[$d])) { return $alx[$d]; } elseif ($alx[substr($f, 7)]) { return $alx[substr($f, 7)]; } $id = sql('id', 'qda', 'v', 'nod="' . ses('qb') . '" and mail="' . $f . '" LIMIT 1'); if (!$id) { $id = sql('id', 'qda', 'v', 'nod="' . ses('qb') . '" and suj like "%' . $d . '%" LIMIT 1'); } return $id; }
if ($post_id_sql && $split) { $sql = "SELECT post_id, poster_id, topic_id, post_time\n\t\t\t\tFROM " . BB_POSTS . "\n\t\t\t\tWHERE post_id IN ({$post_id_sql})\n\t\t\t\tORDER BY post_time ASC"; if (!($result = DB()->sql_query($sql))) { bb_die('Could not get post information'); } if ($row = DB()->sql_fetchrow($result)) { $first_poster = $row['poster_id']; $topic_id = $row['topic_id']; $post_time = $row['post_time']; $user_id_sql = ''; $post_id_sql = ''; do { $user_id_sql .= ($user_id_sql != '' ? ', ' : '') . intval($row['poster_id']); $post_id_sql .= ($post_id_sql != '' ? ', ' : '') . intval($row['post_id']); } while ($row = DB()->sql_fetchrow($result)); $post_subject = clean_title($_POST['subject']); if (empty($post_subject)) { bb_die($lang['EMPTY_SUBJECT']); } $new_forum_id = intval($_POST['new_forum_id']); $topic_time = TIMENOW; $sql = 'SELECT forum_id FROM ' . BB_FORUMS . ' WHERE forum_id = ' . $new_forum_id; if (!($result = DB()->sql_query($sql))) { bb_die('Could not select from forums table'); } if (!DB()->sql_fetchrow($result)) { bb_die('New forum does not exist'); } DB()->sql_freeresult($result); $first_post_id = min(explode(',', $post_id_sql)); $sql = "INSERT INTO " . BB_TOPICS . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_first_post_id)\n\t\t\t\t\tVALUES ('" . DB()->escape($post_subject) . "', {$first_poster}, " . $topic_time . ", {$new_forum_id}, " . TOPIC_UNLOCKED . ", " . POST_NORMAL . ", {$first_post_id})";
} else { if ($mode == 'edit') { $post_a = $lang['EDIT_MESSAGE']; } } } $s_hidden_fields = '<input type="hidden" name="folder" value="' . $folder . '" />'; $s_hidden_fields .= '<input type="hidden" name="mode" value="' . $mode . '" />'; if ($mode == 'edit') { $s_hidden_fields .= '<input type="hidden" name="' . POST_POST_URL . '" value="' . $privmsg_id . '" />'; } // // Send smilies to template // generate_smilies('inline'); $privmsg_subject = clean_title($privmsg_subject); $template->assign_vars(array('SUBJECT' => htmlCHR($privmsg_subject), 'USERNAME' => $to_username, 'MESSAGE' => $privmsg_message, 'FORUM_NAME' => $lang['PRIVATE_MESSAGE'], 'BOX_NAME' => $l_box_name, 'INBOX' => $inbox_url, 'SENTBOX' => $sentbox_url, 'OUTBOX' => $outbox_url, 'SAVEBOX' => $savebox_url, 'POSTING_TYPE_TITLE' => $post_a, 'S_HIDDEN_FORM_FIELDS' => $s_hidden_fields, 'S_POST_ACTION' => PM_URL, 'U_SEARCH_USER' => "search.php?mode=searchuser", 'U_VIEW_FORUM' => PM_URL)); } else { // // Reset PM counters // $userdata['user_new_privmsg'] = 0; $userdata['user_unread_privmsg'] = $userdata['user_new_privmsg'] + $userdata['user_unread_privmsg']; $userdata['user_last_privmsg'] = $userdata['session_start']; // // Update unread status // db_update_userdata($userdata, array('user_unread_privmsg' => 'user_unread_privmsg + user_new_privmsg', 'user_new_privmsg' => 0, 'user_last_privmsg' => $userdata['session_start'])); $sql = "UPDATE " . BB_PRIVMSGS . "\n\t\tSET privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . "\n\t\tWHERE privmsgs_type = " . PRIVMSGS_NEW_MAIL . "\n\t\t\tAND privmsgs_to_userid = " . $userdata['user_id']; if (!DB()->sql_query($sql)) { bb_die('Could not update private message new / read status (2) for user');
public function mobileEpisodeLists() { global $garbage; if (!file_exists($_GET['raw'])) { return; } //error $files = sortSeasonsList($_GET['raw']); $episodes = ''; $episodeList = array(); foreach ($files as $folder) { $path = $_GET['raw'] . '/' . $folder; if (is_dir($path) == true) { if ($handle = opendir($path)) { $episodes .= '<h3>' . $folder . '</h3>'; //put episodes in array, filter garbage, sort array while (false !== ($entry = readdir($handle))) { if (in_array($entry, $garbage)) { continue; } $episodeList[] = $entry; } $episodeFiles = sortEpisodesList($handle, $episodeList); foreach ($episodeFiles[0] as $episodeFile) { $episodes .= '<a href="play.php?video=' . urlencode($_GET['raw']) . '/' . urlencode($folder) . '/' . urlencode($episodeFile) . '" onClick="return playvideo(\'play.php?video=' . urlencode($_GET['raw']) . '/' . urlencode($folder) . '/' . urlencode($episodeFile) . '\')">' . clean_title($episodeFile) . '</a><br>'; } unset($episodeList); } closedir($handle); } else { //outside files. Filter garbage, sort array, print after loop $extras[] = str_replace($_GET['raw'] . '/', '', $path); } } if (!empty($extras)) { $extraFiles = sortEpisodesList($handle, $extras); foreach ($extraFiles[0] as $extraFile) { $episodes .= '<p><a href="play.php?video=' . urlencode($_GET['raw']) . '/' . $extraFile . '" onClick="return playvideo(\'play.php?video=' . urlencode($_GET['raw']) . '/' . $extraFile . '\')">' . clean_title($extraFile) . '</a></p>'; } } return $episodes; }
} }; // func $mn->getByTitle('raw', $P); $mn->wikitextTpl_tokenize(TRUE); $mn->wikitextTpl_normalize_tpls(TRUE); // // // // // // // // // // BEGIN:ANALYSIS ksort($wikitext_pk); $csv_rows = array(); //$txt = file_get_contents($csvFile); $row = 0; if (($handle = fopen($csvFile, "r")) !== FALSE) { while (($data = fgetcsv($handle, 2000, "\t")) !== FALSE) { //0prj 1local 2autoridade 3tipo 4Ano 5cod 6Norma status viavel Nota Tags Ementa $pk = clean_title($data[6], $data[4]); if ($row++) { if ($DEBUG) { print "\n--csv-{$row}= {$pk}"; } if (isset($csv_rows[$pk])) { die("\n--- REPETIU linha '{$pk}' ----\n"); } elseif ($pk) { $csv_rows[$pk] = $data; } } else { $csv_rows['#header'] = $data; } } //while fclose($handle);
function art_import($res) { $f = ajx(trim($res), 1); $f = utmsrc($f); $f = http($f); $_GET['urlsrc'] = $f; $fb = nohttp($f); if (!$_GET['ti']) { list($sujb, $msg, $rec, $current, $defid) = vacuum($f, $suj); $msg = embed_links($msg); $ret = $msg; $_SESSION['vacti'][$f] = $sujb; } else { $ret = clean_title($_SESSION['vacti'][$f]); $_SESSION['vacti'][$f] = ''; } if ($_GET['import'] && $sujb) { $wh = 'WHERE id = "' . $_GET['import'] . '" LIMIT 1;'; $sq = 'suj="' . clean_title($sujb) . '", mail="' . $f . '", img="" '; //ib="0", msquery('UPDATE ' . $_SESSION['qda'] . ' SET ' . $sq . $wh . ''); req('sav,pop'); modif_art($_GET['import'], $msg); } if ($_SESSION['vacuum'][$fb]) { unset($_SESSION['vacuum'][$fb]); } return $ret; }
function vacuum($f, $sj = '') { $f = https($f); $f = http($f); $f = utmsrc($f); $reb = vaccum_ses($f); if (!$reb) { $_SESSION['vacuum'][nohttp($f)] = ''; return array('nothing'); } if ($_POST['see']) { eco($reb, 1); } $enc = embed_detect(strtolower($reb), 'charset=', '"'); if (!$enc) { $enc = mb_detect_encoding($reb); } list($defid, $defs) = verif_defcon($f); //defcons if (!$defs) { $defs = known_defcon($reb); } if (!$defs) { $defs = recognize_defcon($reb); } $auv = auto_video($f, 'pop'); if (!$defs && !$auv) { add_defcon($f); return array('Title', $f, $f, '', '', ''); } if (strtolower($enc) == 'utf-8' or $_POST['utf'] or $defs[5]) { $reb = utf8_decode_b($reb); } if ($defs[2]) { if (!$defs[3]) { $suj = embed_detect_c($reb, $defs[2]); } elseif ($defs[3]) { $suj = embed_detect($reb, $defs[2], $defs[3]); } $suj = trim(del_n($suj)); $suj = interpret_html($suj, "ok"); } if ($defs[0]) { if (!$defs[1]) { $rec = embed_detect_c($reb, $defs[0]); } elseif ($defs[1]) { $rec = embed_detect($reb, $defs[0], $defs[1]); } } else { $rec = embed_detect_c($reb, '<body'); } if ($defs[8]) { if (!$defs[9]) { $opt = embed_detect_c($reb, $defs[8]); } elseif ($defs[9]) { $opt = embed_detect($reb, $defs[8], $defs[9]); } if ($opt) { $opt .= br() . br(); } } if ($defs[4] && $defs[4] != 1) { if (strpos($reb, $defs[4]) !== false) { $end = embed_detect_c($reb, $defs[4]); } if ($end) { $end = br() . br() . $end; } } if ($auv) { $ret = $auv; } elseif (strpos($f, 'twitter.com')) { //twit list($suj, $ret, $day) = plugin_func('twit', 'twit_vacuum', $f); } else { $ret = converthtml($opt . $rec . $end); } //foot if ($suj) { $title = clean_title($suj); } else { $title = clean_internaltag(pre_clean($sj ? $sj : 'Title')); } if ($defs[6]) { $ret = post_treat_batch($ret, $title, $defs[6]); } //post_treat if ($_SESSION['sugm']) { $sug = sugnote(); } if (!$auv) { $ret .= "\n\n" . $sug . '[' . $f . ']'; } //eco($rec,1); return array($title, $ret, $rec, $defid, $defs); }
function save_art() { $dayx = $_SESSION['dayx']; $frm = $_SESSION['frm']; $qb = $_SESSION['qb']; $base = $_SESSION['qda']; $qdm = $_SESSION['qdm']; $USE = $_SESSION['USE']; if (!$frm or $frm == "Home" or $frm == "user") { $frm = "public"; } $suj = clean_title($_POST['suj']); $suj = etc($suj, 240); $msg = nl2br($_POST['msg']); $name = $_POST['name']; $mail = $_POST['mail']; $ib = trim($_POST['ib']); $pdat = $_POST['postdat']; $urlsrc = $_POST['urlsrc']; if ($_POST['pub']) { $re = 1; } if ($urlsrc) { $mail = https($urlsrc); } $mail = utmsrc($mail); if (!$ib) { $ib = '/'; } //!$_POST['sub'] or if (!$name or $name == nms(38)) { alert("empty_name {$name}"); $stoop = "ok"; } if ($mail == "mail" or $mail == "url") { $mail = ''; $urlsrc = ''; } $msg = str_replace(array("<br />", "<br/>", "<br>", "<BR>"), "\n", $msg); $msg = str_replace("\n", "", $msg); $msg = str_replace("\r", "\n", $msg); if (!$msg && $urlsrc) { list($suj, $msg) = vacuum($mail, $suj); } $msg = html_entity_decode_b($msg); $msg = embed_links($msg); $msg = unescape($msg); $msg = clean_br_lite($msg); $msg = clean_punct($msg); if ($pdat != date("y-m-d-H-i", $dayx) && $pdat) { $rdat = explode('-', $pdat); $pdt = mktime($rdat[3], $rdat[4], 0, $rdat[1], $rdat[2], $rdat[0]); } else { $pdt = $dayx; } if (empty($suj)) { $suj = "forbidden title"; } if (empty($msg)) { alert('msg forbidden'); $stoop = 'ok'; } if ($stoop == "") { $msg = mysql_real_escape_string(stripslashes($msg)); $siz = strlen($msg); $suj = mysql_real_escape_string(stripslashes($suj)); $frm = mysql_real_escape_string(stripslashes($frm)); $nid = msquery("INSERT INTO {$base} VALUES ('','{$ib}','{$name}','{$mail}','{$pdt}','{$qb}','{$frm}','{$suj}','{$re}','{$lu}','{$img}','{$kywk}','{$siz}')"); $nid = msquery("INSERT INTO {$qdm} VALUES ('{$nid}','{$msg}')"); } if ($nid && $USE != $qb && $_SESSION["auth"] < 6) { mail($_SESSION['qbin']["adminmail"], 'new article: ' . stripslashes($suj), ' ' . host() . '/' . $nid . ', auth_level: ' . $_SESSION["auth"] . "\n", 'From: ' . $USE); } if ($_SESSION['vacuum'][nohttp($urlsrc)]) { unset($_SESSION['vacuum'][nohttp($urlsrc)]); } if ($nid) { $_SESSION['rqt'][$nid] = array($pdt, stripslashes($frm), stripslashes($suj), '', $qb, '', '', '', $siz, $urlsrc, $ib, $re); $msg = correct_txt($msg, $nid, 'savimg'); $exp_out = $nid; $_GET['read'] = $nid; deductions_from_read($nid, ''); $_POST = ''; } $_SESSION['daya'] = $_SESSION['dayx']; return $exp_out; }
function save_tits_j($id) { $qda = $_SESSION['qda']; $wh = 'id=' . $id . ''; if ($ib = getjx('ib')) { $sql .= 'ib="' . $ib . '", '; cache_value($id, 10, $ib); } if ($cat = getjx('frm1')) { $sql .= 'frm="' . $cat . '", '; cache_value($id, 1, $cat); } if ($suj = clean_title(getjx('suj'))) { $sql .= 'suj="' . $suj . '", '; cache_value($id, 2, $suj); } if ($img = getjx('img')) { $sql .= 'img="' . $img . '", '; cache_value($id, 3, $img); } if ($src = getjx('src')) { $sql .= 'mail="' . $src . '", '; cache_value($id, 9, $src); } if ($sql) { msquery('update ' . $qda . ' set ' . substr($sql, 0, -2) . ' where ' . $wh . ';'); } $r = $_SESSION['art_options']; $rdata = sql('val,msg', 'qdd', 'kv', 'ib="' . $id . '"'); if ($r) { foreach ($r as $k => $v) { $val = $rdata[$v]; $gv = ajx($_GET[$v], 1); if ($v == "related" or $v == "float_img" or $v == "template" or $v == "folder") { $vrf = ' '; } if ($v == "authlevel") { if (rstr(21)) { $vrf = "1"; } else { $vrf = "all"; } } if ($v == "tracks") { if (rstr(1)) { $vrf = 'true'; } else { $vrf = 'false'; } $gv = $gv == 1 ? 'true' : 'false'; } if ($v == "2cols") { if (rstr(17)) { $vrf = 'true'; } else { $vrf = 'false'; } $gv = $gv == 1 ? 'true' : 'false'; } if ($v == "lang") { $vrf = prmb(25); $arr = explode(' ', prmb(26)); if ($arr) { foreach ($arr as $ka => $va) { $valb = $rdata['lang' . $va]; if ($_GET['lang' . $va] == $vrf && $val) { $_GET['lang' . $va] = ' '; } if ($_GET['lang' . $va] && $_GET['lang' . $va] != $valb) { utag_sav($id, 'lang' . $va, $_GET['lang' . $va]); } } } } if (!$val) { $val = $vrf; } //permut value with global setting if ($gv == $vrf && $val) { $gv = " "; } //erase if not usefull if ($gv && $gv != $val) { utag_sav($id, $v, $gv); } } } }
function admin_set_edit() { // Require admin login if(!(isset($_SESSION['active_user']) && $_SESSION['active_user']['type'] == 'admin')) redirect_to('/'); $this->load_outer_template('admin'); if(!isset($this->params[2]) || (!is_numeric($this->params[2]))) throw new exception("No set specified"); $item = $this->params[2]; $m_categories = instance_model('member_categories'); $m_set = instance_model('gallery_set'); $set = $m_set->get_by_id($item); $user = $set[0]['Owner']; if($set == array()) throw new exception("Set does not exist"); if(isset($_POST['Submit'])) { $title = $_POST['title']; $old_title = $_POST['old_title']; $category = $_POST['category']; $error = false; if($title == '') { $error = true; new_flash('Please enter a title',1); } if($title != $old_title) { $t_set = $m_set->get_by_title($title, $user); if($t_set != array()) { $error = true; new_flash('A set with that name already exsits',1); } } $chack_exists = $m_categories->get_by_id($category); if($category !=0 && $chack_exists == array()) { $error = true; new_flash('Category does not exist',1); } if($error == false) { $set = $m_set->get_by_id($item); $set[0]['Title'] = $title; $clean_title = clean_title($title); $set[0]['Clean_title'] = $clean_title; $set[0]['Category'] = $category; $m_set->update_table('gallery_set', 'ID', $set[0]); redirect_to(make_url('members', 'admin_gallery_set', $user)); } if(file_exists($tmppath)) unlink($tmppath); } { $title = $set[0]['Title']; $category = $set[0]['Category']; } $categories = $m_categories->get_all(); $view = instance_view('gallery/admin/edit_set'); $view = $view->parse_to_variable(array( 'form_url' => make_url('members', 'admin_set_edit', $item), 'back_url' => make_url('members', 'admin_gallery_set', $user), 'title' => $title, 'otitle' => $set[0]['Title'], 'categories' => $categories, 'member_category' => $category )); $this->set_template_paramiters(array( 'content' => $view )); }
<?php include_once "includes/functions.inc.php"; $imdb = new Imdb(); $file = cleanWAMP(getDataFileName("{$_GET['raw']}")); if (!file_exists($dataFolder . $file)) { exit; } //error $handle = fopen($dataFolder . $file, "r"); $cleanTitle = clean_title($file); if (isset($_GET['tab']) && $_GET['tab'] == "photos") { $movieArray = $imdb->getMovieInfo($cleanTitle, 3); } else { if ($settings_data['imdb_mode'] == 'false') { $movieArray = arrayFile("{$dataFolder}/{$file}"); } else { $movieArray = $imdb->getMovieInfo($cleanTitle, 2); } } if ($handle) { $videodata = explode("\n", file_get_contents("{$dataFolder}/{$file}")); $toggle = cleanWAMP($videodata[2]); } ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title><?php echo $template->videoTitle($movieArray['title'], $movieArray['year']);
function admin_pages_edit() { // Require admin login if(!(isset($_SESSION['active_user']) && $_SESSION['active_user']['type'] == 'admin')) redirect_to('/'); $this->load_outer_template('admin'); if(!isset($this->params[2]) || (!is_numeric($this->params[2]))) throw new exception("No page specified"); $item = $this->params[2]; $m_page = instance_model('page'); $page = $m_page->get_by_id($item); if($page == array()) throw new exception("Page does not exist"); if(isset($_POST['Submit'])) { $title = $_POST['title']; $old_title = $_POST['old_title']; $content = $_POST['content']; $error = false; if($title == '') { $error = true; new_flash('Please enter a title',1); } if($title != $old_title) { $t_page = $m_page->get_page_by_title($title); if($t_page != array()) { $error = true; new_flash('A page with that name already exsits',1); } } /* if($content == '') { $error = true; new_flash('Please enter some content',1); } */ if($error == false) { $page = $m_page->get_by_id($item); $page[0]['Title'] = $title; // Maintain naming on internal pages to prevent unfound page errors. if($page[0]['Internal'] == 0) { $clean_title = clean_title($title); $page[0]['Clean_title'] = $clean_title; } $page[0]['Content'] = $content; $m_page->update_table('pages', 'ID', $page[0]); redirect_to(make_url('page', 'admin_pages')); } } { $title = $page[0]['Title']; $content = $page[0]['Content']; } $view = instance_view('page/admin/edit_page'); $view = $view->parse_to_variable(array( 'form_url' => make_url('page', 'admin_pages_edit', $item), 'back_url' => make_url('page', 'admin_pages'), 'title' => $title, 'content' => $content )); $this->set_template_paramiters(array( 'content' => $view )); }