function listarRamos($curso) { $class_ramos = new ramo(); $aux_mes = date("m"); //dpr($aux_mes); $periodo = $aux_mes >= 8 ? "2S" : "1S"; if ($aux_mes >= 8) { $ramos = $class_ramos->obtenerRamos($curso); } if (count($ramos) > 0) { foreach ($ramos as $nom_ramo => $datos_ramo) { $html .= "<li id='" . encoding($nom_ramo) . "'>\r\n\t\t\t\t\t\t<a href='notas/NOTA-ramos.php?periodo={$periodo}&curso={$curso}&ramo=" . encoding($nom_ramo) . "'>\r\n\t\t\t\t\t\t\t<font size='2'>" . encoding($nom_ramo) . "</font>\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t</li>"; } } print "<ul>" . $html . "</ul>"; }
<?php page_section("shf_class", "Shift instructions"); ?> The shift instructions provide for logical shift left, logical shift right, arithmetic shift right and rotate right. Additionally a 33-bit rotation is supported, and this is performed if a ROR Rn, #0 instruction is issued. <?php encoding_start(4, "Mnemonic"); encoding("lsl", "00", "Rd,SHF,P = Op1 << Op2"); encoding("lsr", "01", "Rd,SHF,P = Op1 >> Op2"); encoding("asr", "10", "Rd,SHF,P = Op1 >>> Op2"); encoding("ror", "11", "Rd,SHF,P = Op1 >><< Op2 (immediate not zero)"); encoding("rrx", "11", "Rd,SHF,P = P,Op1 >><< (33)1 (immediate of zero)"); encoding_end(); ?> The native shift instruction is mapped to a shift instruction. If not extended then the conditional is derived in the standard way, and the registers are mapped in the standard way with the Rn specified in the instruction mapping both for Rn and Rd. If extended then the extended mappings are used. <p> <?php mapping_start("Native", "Internal"); mapping("lsl", "ILSLccs Rn, Rm -> Rd"); mapping("lsr", "ILSRccs Rn, Rm -> Rd"); mapping("asr", "IASRccs Rn, Rm -> Rd"); mapping("ror", "IRORccs Rn, Rm -> Rd"); mapping("rrx", "IROR33ccs Rn -> Rd"); mapping_end();
function get_title() { global $dir, $lang, $mn_categories, $mn_users; if (isset($_GET['mn_post'])) { if (is_numeric($_GET['mn_post']) && file_exists(MN_ROOT . $dir['posts'] . 'post_' . $_GET['mn_post'] . '.php')) { $mn_post_id = $_GET['mn_post']; } else { $post_slugs = get_post_slugs(); if (in_array(check_text($_GET['mn_post'], true), $post_slugs)) { $mn_post_id = array_search(check_text($_GET['mn_post'], true), $post_slugs); } else { $mn_post_id = 0; } } $p = get_post_data($mn_post_id); return encoding($p['title']); } elseif (isset($_GET['mn_page'])) { if (is_numeric($_GET['mn_page']) && file_exists(MN_ROOT . $dir['pages'] . 'page_' . $_GET['mn_page'] . '.php')) { $mn_page_id = $_GET['mn_page']; } else { $pages_dir = dir(MN_ROOT . $dir['pages']); $mn_page_id = ''; while ($p_file = $pages_dir->read()) { if (!is_file(MN_ROOT . $dir['pages'] . $p_file)) { continue; } else { $temp_var = get_page_data($p_file, false); if ($temp_var['friendly_url'] == $_GET['mn_page']) { $mn_page_id = $temp_var['id']; } else { continue; } } } } $p = get_page_data($mn_page_id); return encoding($p['title']); } elseif (isset($_GET['mn_cat']) && !empty($_GET['mn_cat'])) { return encoding($lang['cats_category'] . ': ' . $mn_categories[$_GET['mn_cat']]['name']); } elseif (isset($_GET['mn_user']) && !empty($_GET['mn_user'])) { return encoding($lang['users_user'] . ': ' . $mn_users[$_GET['mn_user']]); } else { return encoding($lang['posts_posts']); } }
/** * Realiza la compra del contenido * * @param int $id_contenido * @param varchar $user_agent * @return boolean */ function comprarContenido($id_contenido, $user_agent) { array_push($this->_debug, "Iniciando..."); $this->id_contenido = $id_contenido; $this->user_agent = $user_agent; $sql = "SELECT * FROM vivaBolivia.ventas_wap_billing WHERE "; $sql .= " descarga=$this->id_contenido "; $sql .= " AND celular='$this->numero_celular' "; $sql .= " AND useragent='$this->user_agent' "; $sql .= " AND CONCAT(fecha, ' ', hora) >= DATE_SUB(NOW(), INTERVAL 1 HOUR) "; $sql .= " AND cobrado=1 "; array_push($this->_debug, "(DBG) - [$this->id_transaccion] $sql"); $rs = mysql_query($sql, $this->db); if ($row = mysql_fetch_array($rs)) { $this->id_transaccion = $row["pk_ventas_wap_billing"]; array_push($this->_debug, "(DBG) - [$this->id_transaccion] DOBLE-CLICK Detected! Returning =)"); if (DEBUG_LVL) $this->dump_debug(); return true; } $cobrado = false; $err_msg = ""; $sql = "SELECT * FROM Web.contenidos"; $sql .= " WHERE id=$id_contenido"; $rs = mysql_query($sql, $this->db); array_push($this->_debug, "(DBG) - [$this->id_transaccion] $sql"); $row = mysql_fetch_array($rs); $this->nombre_contenido = encoding($row["nombre"]); $tipo = $row["tipo"]; switch ($row["proveedor"]) { default: $this->provider = "0"; } $this->tariff_code = $this->get_Tariff($tipo); if ($this->tariff_code == "0") { // error en shortcode array_push($this->_debug, "(CRIT) - SHORTCODE NO EXISTE PARA EL id_contenido=$id_contenido"); if (DEBUG_LVL) $this->dump_debug(); return mensajeError(); } else { // shortcode ok $sql = "INSERT INTO vivaBolivia.ventas_wap_billing SET "; $sql .= "descarga=$this->id_contenido, ". "celular='$this->numero_celular', ". "useragent='$this->user_agent', ". "id_cobro='$this->tariff_code',". "fecha=CURDATE(), ". "hora=CURTIME(), ". "error_msg='$err_msg' "; array_push($this->_debug, "(DBG) - [$this->id_transaccion] $sql"); $rs = mysql_query($sql, $this->db); $pk_ventas_wap_billing = mysql_insert_id($this->db); $this->id_transaccion = $pk_ventas_wap_billing; array_push($this->_debug, "(DBG) - ID_TRANSACCION: $pk_ventas_wap_billing"); if ($this->nombre_wap !== FALSE) { $sql = "UPDATE vivaBolivia.ventas_wap_billing SET nombre_wap='{$this->nombre_wap}'"; $sql .= " WHERE pk_ventas_wap_billing={$this->id_transaccion} "; mysql_query($sql, $this->db); } if ($this->id_transaccion == "0") { // error sql array_push($this->_debug, "(CRIT) - BAD_ID_TRANSACCION :: Posible error en SQL."); if (DEBUG_LVL) $this->dump_debug(); return mensajeError(); } else { // todo bien return $this->comprar(); } } }
$worksheet->write($jj, 24, '', $format_cell_b_2_al); $worksheet->write($jj, 25, '', $format_cell_b_2_al); $worksheet->write($jj, 26, '', $format_cell_b_2_al); $worksheet->write($jj, 27, '', $format_cell_b_2_al); $worksheet->write($jj, 28, '', $format_cell_b_2_al); $worksheet->write($jj, 29, '', $format_cell_b_2_al); $worksheet->write($jj, 30, '', $format_cell_b_2_al); $worksheet->write($jj, 31, '', $format_cell_b_2_al); $worksheet->write($jj, 32, '', $format_cell_b_2_al); $worksheet->write($jj, 33, '', $format_cell_b_2_al); $worksheet->write($jj, 34, '', $format_cell_b_2_al); $worksheet->write($jj, 35, '备注:出勤不记', $format_cell_b_2_al); $worksheet->write($jj, 36, '', $format_cell_b_2_al); $worksheet->write($jj, 37, '', $format_cell_b_2_al); $worksheet->write($jj, 38, '', $format_cell_b_2_al); $worksheet->write($jj, 39, '', $format_cell_b_2_al); $worksheet->write($jj, 40, '', $format_cell_b_2_al); $worksheet->mergeCells($jj, 2, $jj, 5); $worksheet->mergeCells($jj, 6, $jj, 10); $worksheet->mergeCells($jj, 11, $jj, 15); $worksheet->mergeCells($jj, 16, $jj, 20); $worksheet->mergeCells($jj, 21, $jj, 34); $worksheet->mergeCells(1, 0, 1, 40); //$worksheet->write(3, 1, 0); if ($_SESSION['type'] == 'education') { $workbook->send('记录表_' . $ncou . '_' . $ntea . '_' . encoding($termnow) . '.xls'); } else { $workbook->send('记录表_' . $ncou . '_' . encoding($_SESSION['name']) . '_' . encoding($termnow) . '.xls'); } unset($ntea); $workbook->close();
encoding("BITR", "1100", "BITR"); encoding("BYTR", "1101", "BYTR"); encoding_end(); ?> <?php page_section("shift_subclass", "Shift instruction subclasses"); ?> <?php encoding_start(4, "Subclass"); encoding("LSL", "0000", "LSL"); encoding("LSR", "0001", "LSR"); encoding("ASR", "0010", "ASR"); encoding("ROR", "0011", "ROR"); encoding("ROR33", "0100", "Rotate right 33-bit value (33rd bit comes from carry flag)"); encoding_end(); ?> <?php page_section("memory_subclass", "Memory (load/store) instruction subclasses"); ?> encoding_start( 4, "Subclass" ); encoding( "Preindex", "1xxx", "The transaction adds/subtracts the offset to the index and uses the result as the address" ); encoding( "Postindex", "0xxx", "The transaction adds/subtracts the offset to the index in the ALU but uses the 'Rn' value as the address" ); encoding( "Sub", "x0xx", "The transaction subtracts the offset from the index" ); encoding( "Add", "x1xx", "The transaction adds the offset from the index" ); encoding( "Word", "xx00", "Perform a word access" ); encoding( "Half", "xx01", "Perform a 16-bit access" ); encoding( "Byte", "xx10", "Perform a byte access" );
//echo('<p>'.$re1[0]); //array_push($term,$ret[0]); $ii = 0; $sql = "select cou_name,cou_credit,cou_stu_mark,cou_type from before_cou where cou_choose_stu='{$num}' and cou_term='{$re1['0']}'"; //echo $sql; //$vv1=str_replace('第二学期','-2',$re1[0]); //$vv1=str_replace('第一学期','-1',$vv1); $query = mysql_query($sql); while ($re = mysql_fetch_assoc($query)) { $re['cou_name'] = encoding($re['cou_name']); $re['cou_credit'] = encoding($re['cou_credit']); $re['cou_stu_mark'] = encoding($re['cou_stu_mark']); $re['cou_type'] = encoding($re['cou_type']); if ($kk < 40) { if ($ii == 0) { $worksheet->write($kk, 0, encoding($re1[0]), $format_border); $worksheet->write($kk, 3, '', $format_border_o_l); $worksheet->write($kk, 4, '', $format_border); $worksheet->write($kk, 5, '', $format_border); $worksheet->write($kk, 6, '', $format_border); $worksheet->write($kk, 7, '', $format_border); $worksheet->write($kk, 8, '', $format_border_l_1); $worksheet->write($kk, 9, '', $format_border); $worksheet->write($kk, 10, '', $format_border); $worksheet->write($kk, 11, '', $format_border); $ii = 1; $kk++; } $worksheet->write($kk, 0, $re['cou_name'], $format_border_l); $worksheet->write($kk, 1, '', $format_border_l); $worksheet->write($kk, 2, '', $format_border_l);
function json_encode_esp($arr) { $json_str = ""; if (is_array($arr)) { $pure_array = true; $array_length = count($arr); for ($i = 0; $i < $array_length; $i++) { if (!isset($arr[$i])) { $pure_array = false; break; } } if ($pure_array) { $json_str = "["; $temp = array(); for ($i = 0; $i < $array_length; $i++) { $temp[] = sprintf("%s", json_encode_esp($arr[$i])); } $json_str .= implode(",", $temp); $json_str .= "]"; } else { $json_str = "{"; $temp = array(); foreach ($arr as $key => $value) { $temp[] = sprintf("\"%s\":%s", $key, json_encode_esp($value)); } $json_str .= implode(",", $temp); $json_str .= "}"; } } else { if (is_string($arr)) { $json_str = "\"" . encoding($arr) . "\""; } else { if (is_numeric($arr)) { $json_str = $arr; } else { $json_str = "\"" . encoding($arr) . "\""; } } } return $json_str; }
function listarRamos($curso) { $html = null; $class_ramos = new ramo(); $ramos = $class_ramos->obtenerRamos($curso); if (count($ramos) > 0) { foreach ($ramos as $nom_ramo => $datos_ramo) { $html .= "<li id='" . encoding($nom_ramo) . "'>\r\t\t\t\t\t\t<a href='../notas/NOTA-ramo.php?curso={$curso}&ramo=" . $datos_ramo['ramo_ID'] . "'>\r\t\t\t\t\t\t\t<font size='2'>" . encoding($nom_ramo) . "</font>\r\t\t\t\t\t\t</a>\r\t\t\t\t\t</li>"; } } print "<ul>" . $html . "</ul>"; }
$stu = $re['stu_id']; $worksheet->write($cs + $nn, 0, $nn, $format_cell_1); $worksheet->write($cs + $nn, 1, $re['stu_id'], $format_text); $worksheet->write($cs + $nn, 2, $re['user_name'], $format_cell_1); $worksheet->write($cs + $nn, 3, $class, $format_cell_1); if ($ak == array()) { $cou_nn++; array_push($cou_ar, $re['cou_id']); $worksheet->write($cs, $cou_nn + $csline, $re['cou_name'], $format_cell_1); $worksheet->write($cs + $nn, $cou_nn + $csline, $re['cou_stu_mark'], $format_cell_1); } else { $worksheet->write($cs + $nn, $ak[0] + $csline + 1, $re['cou_stu_mark'], $format_cell_1); } } else { if ($ak == array()) { $cou_nn++; array_push($cou_ar, $re['cou_id']); $worksheet->write($cs, $cou_nn + $csline, $re['cou_name'], $format_cell_1); $worksheet->write($cs + $nn, $cou_nn + $csline, $re['cou_stu_mark'], $format_cell_1); } else { $worksheet->write($cs + $nn, $ak[0] + $csline + 1, $re['cou_stu_mark'], $format_cell_1); } } } //for($ww=4;$ww<=$cou_nn+$csline;$ww++){ $worksheet->setColumn(4, $cou_nn + $csline, 8); //} $worksheet->mergeCells(0, 0, 0, $cou_nn + $csline); //$worksheet->mergeCells(1,0,1,$cou_nn+$csline); $workbook->send("烟台大学" . $class . "班级成绩" . encoding($_SESSION['term_now']) . '.xls'); $workbook->close();
echo encoding($lang['comm_msg_login']); if ($conf['users_registration']) { echo ' (<a href="' . $conf['admin_url'] . '/mn-login.php?action=register">' . encoding($lang['login_register']) . '</a>)'; } ?> </p> <input type="text" name="user_login" id="user_login" value="<?php echo check_text(@$_COOKIE['mn_user_name']); ?> " /> <label for="comment_author"><?php echo encoding($lang['login_user_login']); ?> *</label><br /> <input type="password" name="user_pass" id="user_pass" value="" /> <label for="comment_pass"><?php echo encoding($lang['login_user_password']); ?> *</label><br /> <input type="hidden" name="action" value="login" /> <input type="hidden" name="redir" value="<?php echo trim('http://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'], '?') . '#mn-comment-form'; ?> " /> <input type="submit" name="submit" id="mn-login-submit" value="<?php echo encoding($lang['login_log_in']); ?> " /> </fieldset> </form>
<input type="hidden" name="action" value="add-comment" /> <input type="hidden" name="post_id" value="<?php echo $post_id; ?> " /> <?php if ($conf['comments_field_preview']) { ?> <input type="submit" name="preview" id="mn-comment-preview" class="mn-submit" value="<?php echo encoding($lang['comm_preview']); ?> " /><?php } ?> <input type="submit" name="submit" id="mn-comment-submit" class="mn-submit" value="<?php echo encoding($lang['comm_add_comment']); ?> " /> </div> </fieldset> </form> <script type="text/javascript"> document.getElementById('spam-input').value='<?php echo $conf['comments_antispam']; ?> '; document.getElementById('spam-span').style.display = 'none'; </script>
/** * Realiza la compra del contenido * * @param int $id_contenido * @param varchar $user_agent * @return boolean */ function comprar_contenido($id_contenido, $user_agent) { $this->content_id = $id_contenido; $this->ua = $user_agent; $this->billing_type = "wap"; $this->debug->add("INITIALIZING comprar_contenido...\n\tua: " . var_export($this->ua, TRUE) . "\n\tid contenido: " . var_export($this->content_id, TRUE) . "\n\tbilling type: " . var_export($this->billing_type, TRUE)); // busco contenido $sql = "SELECT * FROM Web.contenidos WHERE id={$this->content_id} "; $rs = mysql_query($sql, $this->dbc->db); if (!$rs) { $this->debug->add("COULDN'T GET CONTENT DATA!!\n\tsql: {$sql}\n\terror: " . mysql_error($this->dbc->db)); $this->error_msg = "No se pudo procesar la compra."; //contenido no encontrado self::update_billing_status("ERROR"); $this->debug->send("***** PROCESS ABORTED :( *****"); return FALSE; } else { $this->debug->add("CONTENT DATA LOADED...\n\tsql: {$sql}"); // obtengo datos del contenido $obj = mysql_fetch_object($rs); $this->content_name = substr(encoding($obj->nombre), 0, 29); $this->content_type = $obj->tipo; $this->provider = $obj->proveedor; if ($this->provider == "27") { $this->provider_name = "universal"; } else { $this->provider_name = "wazzup"; } // guardo datos del contenido a comprar $sql = "INSERT INTO claroArgentina.billing_wap SET\r\n\t\t\t\tbilling_id='{$this->operation_id}',\r\n\t\t\t\tid_contenido='{$this->content_id}',\r\n\t\t\t\tuseragent='{$this->ua}',\r\n\t\t\t\tnombre_wap='{$this->nombre_wap}',\r\n\t\t\t\tproveedor='{$this->provider}' "; $rs = mysql_query($sql, $this->dbc->db); if (!$rs) { $this->debug->add("ERROR SAVING CONTENT DATA!!\n\tsql: {$sql}\n\terror: " . mysql_error($this->dbc->db)); $this->error_msg = "No se pudo procesar la compra."; //contenido no encontrado self::update_billing_status("ERROR"); $this->debug->send("***** PROCESS ABORTED :( *****"); return FALSE; } else { $this->debug->add("BILLING CONTENT DATA SAVED...\n\tsql: {$sql}"); // actualizo billing $sql = "UPDATE claroArgentina.billing SET\r\n\t\t\t\t\tstatus='PENDING',\r\n\t\t\t\t\torigin='wap',\r\n\t\t\t\t\tapplication_id='{$this->application_id}',\r\n\t\t\t\t\tprovider_id='{$this->get_provider_id()}',\r\n\t\t\t\t\torigin_id='{$this->get_origin_id()}',\r\n\t\t\t\t\tservice_id='{$this->get_service_id()}',\r\n\t\t\t\t\ttime=CURTIME(),\r\n\t\t\t\t\tdate=CURDATE()\r\n\t\t\t\t\tWHERE id='{$this->operation_id}' "; $rs = mysql_query($sql, $this->dbc->db); if (!$rs) { $this->debug->add("ERROR UPDATING BILLING INFORMATION!!\n\tsql: {$sql}\n\terror: " . mysql_error($this->dbc->db)); self::update_billing_status("ERROR"); $this->debug->send("***** PROCESS ABORTED :( *****"); return FALSE; } else { $this->debug->add("WAP BILLING INFORMATION UPDATED...\n\tsql: {$sql}"); return $this->comprar(); } } } }
$worksheet->write($kk, 0, $re['cou_name'], $format_border_l); $worksheet->write($kk, 1, '', $format_border_l); $worksheet->write($kk, 2, '', $format_border_l); $worksheet->write($kk, 3, '', $format_border); $worksheet->write($kk, 4, $re['cou_credit'], $format_border); $worksheet->write($kk, 5, $re['cou_stu_mark'], $format_border); $worksheet->write($kk, 6, $re['cou_type'], $format_border); $worksheet->write($kk, 7, '', $format_border); $worksheet->write($kk, 8, '', $format_border_l_1); $worksheet->write($kk, 9, '', $format_border); $worksheet->write($kk, 10, '', $format_border); $worksheet->write($kk, 11, '', $format_border); $kk++; } else { if ($ii == 0) { $worksheet->write($hh, 7, encoding($re1[0]), $format_border_l_1); $worksheet->write($hh, 8, '', $format_border_l_1); $worksheet->write($hh, 9, '', $format_border); $worksheet->write($hh, 10, '', $format_border); $worksheet->write($hh, 11, '', $format_border); $ii = 1; $hh++; } $worksheet->write($hh, 7, $re['cou_name'], $format_border_l_1); $worksheet->write($hh, 8, '', $format_border_l_1); $worksheet->write($hh, 9, $re['cou_credit'], $format_border); $worksheet->write($hh, 10, $re['cou_stu_mark'], $format_border); $worksheet->write($hh, 11, $re['cou_type'], $format_border); $hh++; } if ((int) $re['cou_stu_mark'] >= 60) {
$worksheet->write(2, 5, "国籍", $format_bold_1); $worksheet->write(2, 6, "英文姓名", $format_bold_1); $worksheet->write(2, 7, "出生年月", $format_bold_1); $worksheet->write(2, 8, "护照号码", $format_bold_1); $worksheet->write(2, 9, "现住所", $format_bold_1); $worksheet->write(2, 10, "国外家庭住址", $format_bold_1); $worksheet->write(2, 11, "家长姓名", $format_bold_1); $worksheet->write(2, 12, "本人电话号码", $format_bold_1); $ii = 1; $jj = 3; while ($re = mysql_fetch_assoc($query)) { $worksheet->write($jj, 0, $ii, $format_cell_1); $ii++; $worksheet->write($jj, 1, $re['stu_id'], $format_text); $worksheet->write($jj, 2, encoding($re['user_name']), $format_cell_1); $worksheet->write($jj, 3, encoding($re['stu_sex']), $format_cell_1); $worksheet->write($jj, 4, encoding($re['nature']), $format_cell_1); $worksheet->write($jj, 5, encoding($re['stu_nation']), $format_cell_1); $worksheet->write($jj, 6, encoding($re['en_name']), $format_cell_1); $worksheet->write($jj, 7, encoding($re['stu_bir']), $format_cell_1); $worksheet->write($jj, 8, encoding($re['passport_id']), $format_cell_1); $worksheet->write($jj, 9, encoding($re['stu_address2']), $format_cell_1); $worksheet->write($jj, 10, encoding($re['stu_address1']), $format_cell_1); $worksheet->write($jj, 11, '', $format_cell_1); $worksheet->write($jj, 12, $re['contact_way'], $format_cell_1); $jj++; } //$worksheet->mergeCells(1,0,1,40); //$worksheet->write(3, 1, 0); $workbook->send('信息表_' . $class . '_' . encoding($_SESSION['term_now']) . '.xls'); $workbook->close();
function printXML($arr) { foreach ($arr as $key => $val) { if (is_array($val)) { $folder_title = substr($key, $omit_folder_chars); ksort($val); printXML($val); } else { $file = $val; if (substr($file, -3) == 'mp3' || substr($file, -3) == 'MP3') { $file_title = substr($file, 0, strlen($file) - 4); // ID3v1 and ID3v2 tags parser $nome_arq = $file; $myId3 = new ID3($nome_arq); if ($myId3->getInfo()) { $f_title = $myId3->getTitle(); $f_artist = $myId3->getArtist(); } if (!$myId3->getArtist()) { $id3 = new MP3_Id(); $result = $id3->read($file); $f_title = $id3->getTag('name'); $f_artist = $id3->getTag('artists'); } if ($f_artist == '0' && $f_title == '0') { $arr_names = explode('/', strrev($nome_arq)); $substr = substr($arr_names[0], 4, strlen($arr_names[0])); $arr_names_last = explode('_', strrev($substr)); $f_artist = ''; $f_title = strrev($substr); } if ($f_artist == '0') { $f_artist = ''; } $f_id = str_replace("/", "", $file_title); $f_id = str_replace(".", "", $f_id); $f_id = str_replace(">", "", $f_id); $f_id = str_replace("<", "", $f_id); $f_id = str_replace("=", "", $f_id); $f_id = str_replace("(", "", $f_id); $f_id = str_replace(")", "", $f_id); $f_id = str_replace("\"", "", $f_id); if ($sEncoding = mb_detect_encoding($f_title, 'auto', true) != 'UTF-8') { $f_title = mb_convert_encoding($f_title, 'UTF-8', $sEncoding); } if ($sEncoding = mb_detect_encoding($f_artist, 'auto', true) != 'UTF-8') { $f_artist = mb_convert_encoding($f_artist, 'UTF-8', $sEncoding); } $f_title = conv($f_title); $f_artist = conv($f_artist); if (substr($f_title, 0, 4) == 'ÿþ') { $f_title = substr($f_title, 4); } if (substr($f_artist, 0, 4) == 'ÿþ') { $f_artist = substr($f_artist, 4); } $f_title = str_replace(">", "", $f_title); $f_title = str_replace("<", "", $f_title); $f_artist = str_replace(">", "", $f_artist); $f_artist = str_replace("<", "", $f_artist); $f_id = encoding($f_id); $path = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; $path = dirname($path); $defaul_dir = substr($val, 0, strrpos($val, '/')); $file_name_ = substr(strrchr($val, '/'), 1); $url_dec = rawurlencode($file_name_); $val = $defaul_dir . '/' . $url_dec; $file = $val; $file = 'http://' . $path . '/' . $file; // Writing in XML print ' <song id="' . $f_id . '" title="' . $f_title . '" artist="' . $f_artist . '" src="' . $file . '" />'; } } } }
function login_screen($title, $info_text = '', $info = '') { global $conf, $lang, $languages, $lng, $var; $info_image = array('error' => 'cross', 'info' => 'information', 'main' => 'blank', 'ok' => 'tick', 'warning' => 'exclamation'); $info_message = empty($info_text) ? '<div class="login-msg"> </div>' : '<div class="login-msg msg-' . $info . '"><img src="./stuff/img/icons/' . $info_image[$info] . '.png" alt="-" /> ' . $info_text . '</div>'; $delimiter = isset($conf['users_registration']) && $conf['users_registration'] ? ' | ' : ''; if (isset($_COOKIE['mn_user_name']) && preg_match('/^[_ a-zA-Z0-9\\.\\-]+$/', $_COOKIE['mn_user_name'])) { $reg_link = '<a href="./mn-login.php?action=logout&redir=referer">' . $lang['login_delete_cookies'] . '</a>'; } elseif (isset($conf['users_registration']) && $conf['users_registration']) { $reg_link = '<a href="./mn-login.php?action=register">' . $lang['login_register'] . '</a>'; } else { $reg_link = ''; } $lost_pass_link = isset($_REQUEST['action']) && $_REQUEST['action'] == 'lost-pass' ? '<a href="./mn-login.php">' . $lang['login_log_in'] . '</a>' : '<a href="./mn-login.php?action=lost-pass">' . $lang['login_lost_pass'] . '</a>'; if (isset($_POST['user_login']) && preg_match('/^[_ a-zA-Z0-9\\.\\-]+$/', $_POST['user_login'])) { $user_login_value = $_POST['user_login']; } elseif (isset($_COOKIE['mn_user_name']) && preg_match('/^[_ a-zA-Z0-9\\.\\-]+$/', $_COOKIE['mn_user_name'])) { $user_login_value = $_COOKIE['mn_user_name']; } else { $user_login_value = ''; } if ($var['hide_form']) { $reg_link = ''; $lost_pass_link = ''; $checkbox = ''; $action = ''; $button = ''; if (isset($_GET['install-file'])) { $inputs = '<p class="c">' . $lang['login_text_install_file1'] . '</p>'; $inputs .= '<p class="c">' . $lang['login_text_install_file2'] . ' <a href="./"><img src="./stuff/img/icons/refresh-gray.png" alt="" /></a></p>'; } } elseif (isset($_REQUEST['action']) && $_REQUEST['action'] == 'lost-pass') { $inputs = '<div id="login-lostpass"><label for="user_login">' . $lang['login_user_login'] . '</label> <input type="text" name="user_login" id="user_login" class="text" autocomplete="off" /> <label for="user_mail">' . $lang['login_user_email'] . '</label> <input type="text" name="user_mail" id="user_mail" class="text" autocomplete="off" /></div>'; $button = '<input type="hidden" name="action" value="lost-pass" /><button type="submit"><img src="./stuff/img/icons/email-go.png" alt="-" /> ' . $lang['login_send_pass'] . '</button>'; $checkbox = ''; $action = 'lost-pass'; } elseif (isset($_REQUEST['action']) && $_REQUEST['action'] == 'register' && $conf['users_registration']) { $inputs = '<div id="login-register">'; $inputs .= '<label for="username">' . $lang['login_user_login_short'] . '</label> <input type="text" name="username" id="username" class="text" value="' . $var['username'] . '" autocomplete="off" /> <img src="./stuff/img/icons/help.png" class="tooltip" alt="?" width="16" height="16" title="' . $lang['users_help_username'] . '" /><br />'; $inputs .= '<label for="email">' . $lang['login_user_email'] . '</label> <input type="text" name="email" id="email" class="text" value="' . $var['email'] . '" autocomplete="off" /> <img src="./stuff/img/icons/help.png" class="tooltip" alt="?" width="16" height="16" title="' . $lang['users_help_email'] . '" /><br />'; $inputs .= '<label for="pass1">' . $lang['login_user_password'] . '</label> <input type="password" name="pass1" id="pass1" class="text" autocomplete="off" /> <img src="./stuff/img/icons/help.png" class="tooltip" alt="?" width="16" height="16" title="' . $lang['users_help_pass1'] . '" /><br />'; $inputs .= '<label for="pass2">' . $lang['login_user_password_verify'] . '</label> <input type="password" name="pass2" id="pass2" class="text" autocomplete="off" /> <img src="./stuff/img/icons/help.png" class="tooltip" alt="?" width="16" height="16" title="' . $lang['users_help_pass2'] . '" />'; $inputs .= '</div>'; $button = '<span id="spam-span">' . str_replace('%n%', '<strong>' . $lang['num'][$conf['comments_antispam']] . '</strong>', encoding($lang['comm_antispam'])) . ': <input type="text" name="robot" id="spam-input" style="width:20px;" value="" /><br /></span>'; $button .= '<input type="hidden" name="action" value="register" /><button type="submit"><img src="./stuff/img/icons/user-go.png" alt="-" /> ' . $lang['login_register'] . '</button>'; $button .= '<script type="text/javascript">document.getElementById(\'spam-input\').value=\'' . $conf['comments_antispam'] . '\'; document.getElementById(\'spam-span\').style.display = \'none\';</script>'; $checkbox = ''; $action = 'register'; $reg_link = '<a href="./mn-login.php">' . $lang['login_log_in'] . '</a>'; } else { $inputs = '<div id="login-login"><label for="user_login" id="label_login">' . $lang['login_user_login'] . '</label> <input type="text" name="user_login" id="user_login" class="text" value="' . $user_login_value . '" autocomplete="off" /> <label for="user_pass">' . $lang['login_user_password'] . '</label> <input type="password" name="user_pass" id="user_pass" class="text" autocomplete="off" /></div>'; $button = '<input type="hidden" name="action" value="login" /><button type="submit"><img src="./stuff/img/icons/key-go.png" alt="»" /> ' . $lang['login_log_in'] . '</button>'; $checkbox = $conf['users_perm_login'] ? '<p class="pl"><input type="checkbox" class="checkbox" name="perm_login" id="perm_login" value="true" ' . (isset($_POST['perm_login']) && $_POST['perm_login'] == 'true' ? ' checked="checked"' : '') . ' /> <label for="perm_login" class="perm-login">' . $lang['login_permanent_login'] . '</label></p>' : '<p class="pl"> </p>'; $action = 'login'; } $theme = isset($conf['admin_theme']) && !empty($conf['admin_theme']) && is_dir(MN_ROOT . DIR_THEMES . $conf['admin_theme']) ? $conf['admin_theme'] : 'bluedee'; $lang_select = '<ul id="lang-select" class="hide">'; foreach ($languages as $lang_abbr => $lang_name) { if (!file_exists(MN_ROOT . 'stuff/lang/lang_' . $lang_abbr . '.php')) { continue; } elseif ($lang_abbr == $lng) { $lang_select .= '<li><span class="act"><img src="./stuff/lang/lang_' . $lang_abbr . '-gray.gif" alt="' . $lang_abbr . '" /> <span>' . $lang_name . '</span></span></li>'; } else { $lang_select .= '<li><a href="./mn-login.php?l=' . $lang_abbr . '" class="round"><img src="./stuff/lang/lang_' . $lang_abbr . '.gif" alt="' . $lang_abbr . '" /> <span>' . $lang_name . '</span></a></li>'; } } $lang_select .= '</ul>'; $meta_tags = '<meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="author" content="all: Milan Nemčík, mailto: milan@nemcik.sk" /> <link rel="stylesheet" type="text/css" href="./stuff/etc/style.php" media="all" /> <link rel="shortcut icon" href="./stuff/img/favicon.png" /> <script type="text/javascript" src="./stuff/etc/jquery-min.js"></script> <script type="text/javascript" src="./stuff/etc/jquery-scripts.js"></script>'; $login_screen_search = array('{ACTION}', '{CHECKBOX}', '{COPYRIGHT}', '{DELIMITER}', '{INFO_MESSAGE}', '{INPUTS}', '{LANG_ABBR}', '{LANG_SELECT_BAR}', '{LINK_BACK_TO_WEB}', '{LINK_LOST_PASS}', '{LINK_REGISTER}', '{META_TAGS}', '{BUTTON}', '{THEME}', '{TITLE}', '{WEB_TITLE}'); $login_screen_replace = array($action, $checkbox, '© <a href="http://mnewscms.com/">MNews</a> 2008–' . date('Y') . ' | mineo <a href="http://mineo.sk/">webdesign</a>', $delimiter, $info_message, $inputs, $lng, $lang_select . '<img src="./stuff/lang/lang_' . $lng . '-gray.gif" alt="" id="lang-img" class="tooltip" title="Change language" />', '<a href="../">« ' . $lang['login_back_to_web'] . '</a>', $lost_pass_link, $reg_link, $meta_tags, $button, $theme, $title, $conf['web_title']); $login_screen_tmpl = file_get_contents(MN_ROOT . DIR_THEMES . $theme . '/login-screen.html'); $login_screen_tmpl_result = str_ireplace($login_screen_search, $login_screen_replace, $login_screen_tmpl); echo $login_screen_tmpl_result; }