function installmod() { section('Após baixar um módulo no <a href="http://soclwap.sourceforge.net" target="_blank">website oficial do SoclWAP</a>, você deve descompactá-lo e movê-lo para o diretório "mods/".<br> Alguns módulos podem precisar de tarefas manuais. Neste caso, procure entre os arquivos do módulo um arquivo do tipo "leia-me". Pode não existir (não ser necessário).<br> Após tudo estar certo, abra seu painel administrativo e instale o módulo.<br> ' . infobox("<b>AVISO:</b> Sempre verifique seus módulos por códigos maléficos e vulnerabilidades.", false), 'Instalando módulos'); }
function index() { global $timeformat, $home; if (is_logged()) { $output = '<p><form method="post" action="' . $home . 'shoutbox/escrevepost"> <textarea rows="8" cols="25" name="message"></textarea><br/> <input type="submit" value="' . t("Enviar") . '"> </form></p><hr size="1">'; } $qry = mysql_query("SELECT s.id AS d, s.text AS t, s.time AS i, a.login AS l FROM shoutbox s LEFT JOIN accounts a ON s.owner=a.id ORDER BY s.id DESC LIMIT 10"); if (mysql_numrows($qry) != 0) { $response = true; while ($row = mysql_fetch_array($qry)) { $output .= '<p><h3>' . $row['t'] . '</h3><br/><h6>' . t("postado por") . ' ' . url("user/profile/{$row['l']}", $row['l']) . ' ' . t("em") . ' ' . date($timeformat, $row['i']); if (is_admin()) { $output .= '<br>' . url("shoutbox/del/{$row['d']}", t("[excluir]")); } $output .= '</p><hr size="1">'; } } else { $output .= infobox(t("Não há mensagens na shoutbox."), false); } if ($response) { section(substr($output, 0, -13), t("Shoutbox")); } else { section($output, t("Shoutbox")); } }
function remove($id) { requirelogin(); $id = protect($id); $owner = $_SESSION['id']; mysql_query("DELETE FROM videos WHERE `id`='{$id}' AND `owner`='{$owner}'"); infobox("Vídeo excluído com sucesso!"); }
function msgdelete($id) { requirelogin(); $account = $_SESSION['id']; $id = mysql_real_escape_string($id); mysql_query("DELETE FROM messages WHERE `id`='{$id}' AND `to`='{$account}'"); infobox(t("Mensagem excluída com sucesso.")); }
function resolvegroup($group) { $group = protect($group); $qry = mysql_query("SELECT * FROM groups WHERE `url`='{$group}'"); if (mysql_numrows($qry) != 0) { return mysql_fetch_array($qry); } else { infobox(t("Grupo inexistente."), true, true); } }
function admin() { global $home; onlyadmin(); section('<form method="post" action="' . $home . 'chat/createroompost"> <p><label for="nome">' . t('Nome da sala') . ':</label><br/> <input type="text" name="nome"></p> <p><input type="submit" value="' . t("Criar sala") . '"> </form>', t("Criar uma nova sala")); $output = null; $qry = mysql_query("SELECT * FROM chat_rooms"); if (mysql_numrows($qry) == 0) { $output .= infobox(t("Você não configurou o chat."), false, false); } else { while ($row = mysql_fetch_array($qry)) { $output .= url("chat/sala/{$row['id']}", $row['nome']) . ' - ' . url("chat/deleteroom/{$row['id']}", t("[remover]")) . ' <br>'; } } section($output, t("Chat")); }
function post() { global $url; requirelogin(); $me = $_SESSION['id']; $query = substr(protect($_POST['query']), 0, 16); if (strlen($query) < 3) { # isso não é um coração... infobox(t("Termos de busca muito pequenos.", true, true)); } if ($_POST['usuarios']) { $qry = mysql_query("SELECT `foto`,`login` FROM accounts WHERE `login` LIKE '%{$query}%' OR `nome` LIKE '%{$query}%'"); if (mysql_numrows($qry) == 0) { $usuarios = t("Nenhum resultado!"); } else { $usuarios = null; while ($row = mysql_fetch_array($qry)) { $usuarios .= "\n" . '<p><div class="row"> <img src="' . $url . '/upload/' . thumb($row['foto']) . '"><br> ' . url("user/profile/{$row['login']}", $row['login']) . ' </div></p>'; } } section($usuarios, t("Buscando usuários.")); } if ($_POST['grupos']) { $qry = mysql_query("SELECT `title`,`url` FROM groups WHERE `title` LIKE '%{$query}%' OR `desc` LIKE '%{$query}%'"); if (mysql_numrows($qry) == 0) { $grupos = t("Nenhum resultado!"); } else { $grupos = null; while ($row = mysql_fetch_array($qry)) { $grupos .= "\n" . '<p><div class="row"> ' . url("groups/view/{$row['url']}", $row['title']) . ' </div></p>'; } } section($grupos, t("Buscando grupos.")); } }
function index() { global $home; requirelogin(); freesection('<script language="javascript"> function maxLength(textAreaField, limit) { var ta = document.getElementById(textAreaField); if (ta.value.length >= limit) { ta.value = ta.value.substring(0, limit-1); } } </script>'); // mostrar formulário $output = '<form method="post" action="' . $home . 'dashboard/post"> <textarea rows="5" cols="25" name="content" id="content" placeholder="' . t("O que está em sua mente?") . '" onKeyDown="maxLength(\'content\', 140);" onKeyUp="maxLength(\'content\'. 140);" maxlength="140" /></textarea> <br/> <input type="submit" value="' . t("Postar") . '"> </form>'; section($output, t("Postar atualização")); // receber atualizações $output = null; $me = $_SESSION['id']; $receive = array(); // id's a receber $receive[] = $me; $friends = mysql_query("SELECT `id1` FROM friends WHERE `id2`='{$me}'"); if (mysql_numrows($friends) != 0) { while ($f = mysql_fetch_array($friends)) { $receive[] = $f['id1']; } } $receive = implode(",", $receive); $qry = mysql_query("SELECT a.login AS login,n.content AS content,n.account AS id,n.id AS fid FROM notes n LEFT JOIN accounts a ON n.account=a.id WHERE n.account IN ({$receive}) ORDER BY n.id DESC LIMIT 50"); if (mysql_numrows($qry) < 1) { $output .= infobox(t("Você não possui atualizações."), false); } else { while ($row = mysql_fetch_array($qry)) { //$output .= "\n".'<p><div class="row">'.url("user/profile/".$row['login'], $row['login']).' '.bbcode($row['content']); $output .= "\n" . '<p><div class="row"><a href="' . $home . '/user/profile/' . $row['login'] . '" title="note_' . $row['fid'] . '" id="note_' . $row['fid'] . '">' . $row['login'] . '</a> ' . bbcode($row['content']); if ($row['id'] === $_SESSION['id'] or is_admin()) { $output .= '<br>' . url("dashboard/remove/{$row['fid']}", t("[remover]")); } $output .= '<a href="javascript:void(0);" onClick="javascript:document.getElementById(\'com' . $row['fid'] . '\').style.display=\'block\'">' . t("[comentar]") . '</a>'; $output .= '<div id="com' . $row['fid'] . '" style="display:none;"> <form action="' . $home . '/dashboard/commentpost" method="post" onReset="javascript:document.getElementById(\'com' . $row['fid'] . '\').style.display=\'none\'"> <textarea rows="2" cols="25" name="text"></textarea> <input type="hidden" name="stream" value="' . $row['fid'] . '"><br> <input type="submit" value="' . t("Comentar") . '"><input type="reset" value="' . t("Cancelar") . '"> </form> </div>'; $commentsqry = mysql_query("SELECT a.login,c.text FROM comments c LEFT JOIN accounts a ON a.id=c.owner WHERE c.id_recebe='{$row['fid']}' ORDER BY c.id DESC LIMIT 100"); if (mysql_numrows($commentsqry) != 0) { while ($rw = mysql_fetch_array($commentsqry)) { $output .= '<p><a href="' . $home . '/user/profile/' . $rw['login'] . '">' . $rw['login'] . ':</a> ' . $rw['text'] . '</p>'; } } $output .= '</div></p>'; } } section($output, t("Atualizações")); }
function info($param) { global $object_elements; global $priority_chapter; if(!$this->read_data()) return; $param["info_noshow"]=explode(",", $param["info_noshow"]); $ret="<div class='object'>\n"; $name_lang=$this->tags->get_lang("name"); $name =$this->tags->get("name"); if($name_lang!=$name) $ret.="<h1>$name_lang ($name)</h1>\n"; else $ret.="<h1>$name_lang</h1>\n"; $ret.="<div class='obj_actions'>\n"; $ret.="<a class='zoom' href='#' onClick='redraw()'>".lang("info_back")."</a>\n"; $ret.="<a class='zoom' href='javascript:zoom_to_feature()'>".lang("info_zoom")."</a>\n"; $ret.="</div>\n"; $data=array(); call_hooks("info", &$data, $this, $param); $chapter=array(); foreach($data as $d) { $chapter[$d[0]].=$d[1]; } foreach($chapter as $title=>$content) { $chapter_list[$priority_chapter[$title]][]=$title; } ksort($chapter_list); $ret.="<form id='info' action='javascript:info_change()'>\n"; foreach($chapter_list as $title_list) { foreach($title_list as $title) { $content=$chapter[$title]; if($content) { // $ret.="<div class=\"object_chapter\" id=\"object_$title\">\n"; if(in_array($title, $param['info_noshow'])) $ret.=infobox_closed($title); else $ret.=infobox($title, $content); // $ret.="<h2>".lang("head_$title")."</h2>\n"; // $ret.=$content; // $ret.="</div>\n"; } } } $ret.="</form>\n"; $ret.="</div>\n"; return $ret; }
public function get_map() { global $javo_tso; $lang = $_POST['lang'] != "" ? $_POST['lang'] : "en"; // Post Types $post_type = $_POST['post_type']; // Taxonomy $tax = $_POST['tax']; // Terms $term = $_POST['term']; // Taxonomy2 $tax2 = isset($_POST['tax2']) ? $_POST['tax2'] : null; // Terms2 $term2 = isset($_POST['term2']) ? $_POST['term2'] : null; // Pagination $page = isset($_POST['page']) ? $_POST['page'] : 1; // City Parent $parent = isset($_POST['parent']) ? $_POST['parent'] : null; // Location Area $location = isset($_POST['location']) ? $_POST['location'] : null; // Keywords $keyword = !empty($_POST['keyword']) ? $_POST['keyword'] : null; // Posts per page $ppp = $_POST['ppp'] ? $_POST['ppp'] : 10; // Get City terms id if (isset($_POST['city'])) { $args = array("parent" => $term, "hide_empty" => false); $terms = get_terms($tax, $args); $content = ""; foreach ($terms as $item) { $content .= "<option value=" . $item->term_id . ">" . $item->name . "</option>"; } $result = array("result" => "success", "options" => $content); echo json_encode($result); exit; } // Category list output function javo_get_p_cate($post_id = NULL, $tax = NULL, $default = "None") { if ($post_id == NULL && $tax == NULL) { return; } // Output Initialize $output = ""; // Get Terms $terms = wp_get_post_terms($post_id, $tax); // Added string foreach ($terms as $item) { $output .= $item->name . ", "; } $output = substr(trim($output), 0, -1); return $output != "" ? $output : $default; } // Google map infoWindow Body function infobox($post = NULL) { if ($post == NULL) { return; } global $javo_tso; $javo_list_str = new get_char($post); // HTML in var ob_start(); ?> <div class="javo_somw_info"> <div class="des"> <ul> <li><?php printf('%s : %s', __('Type', 'javo_fr'), $javo_list_str->__cate('item_category', 'No type', true)); ?> </li> <li> <?php if ($javo_tso->get('hidden_lister_email') != 'hidden') { echo $javo_list_str->author->user_email; } ?> </li> </ul> <hr /> <div class="lister"> <span class="thumb"> <?php printf("<a href='%s'>%s</a>", $javo_list_str->lister_page, $javo_list_str->get_avatar()); ?> </span> <ul> <li><?php echo $javo_list_str->author_name; ?> </li> <li><?php echo $javo_list_str->a_meta('phone'); ?> </li> <li><?php echo $javo_list_str->a_meta('mobile'); ?> </li> </ul> </div> <!-- lister --> </div> <!-- des --> <div class="pics"> <div class="thumb"> <a href="<?php echo get_permalink($post->ID); ?> " target="_blank"><?php echo get_the_post_thumbnail($post->ID, "javo-map-thumbnail"); ?> </a> </div> <!-- thumb --> <div class="img-in-text"><?php echo $javo_list_str->price; ?> </div> <div class="javo-left-overlay"> <div class="javo-txt-meta-area"><?php echo $javo_list_str->__hasStatus(); ?> </div> <!-- price-text --> <div class="corner-wrap"> <div class="corner"></div> <div class="corner-background"></div> </div> <!-- corner-wrap --> </div> <!-- javo-left-overlay --> </div> <!-- pic --> <div class="row"> <div class="col-md-12"> <div class="btn-group btn-group-justified pull-right"> <a href="javascript:" class="btn btn-accent btn-sm javo-item-brief" data-id="<?php echo $post->ID; ?> " onclick="javo_show_brief(this);"><i class="fa fa-user"></i> <?php _e("Brief", "javo_fr"); ?> </a> <a href="<?php echo get_permalink($post->ID); ?> " class="btn btn-accent btn-sm"><i class="fa fa-group"></i> <?php _e("Detail", "javo_fr"); ?> </a> <a href="javascript:" onclick="javo_show_contact(this);" class="btn btn-accent btn-sm javo-lister-contact" data-to="<?php echo $javo_list_str->author->user_email; ?> "> <?php _e("Contact", "javo_fr"); ?> </a> </div><!-- btn-group --> </div> <!-- col-md-12 --> </div> <!-- row --> </div> <!-- javo_somw_info --> <?php return ob_get_clean(); } // Posts Query Args $args = array("post_type" => $post_type, "post_status" => "publish", "posts_per_page" => -1); // Set category if ($tax && $term) { $args['tax_query'] = array(array("taxonomy" => $tax, "field" => "term_id", "terms" => $term)); } if ($tax2 && $term2) { $args['tax_query']['relation'] = "AND"; $args['tax_query'][] = array("taxonomy" => $tax2, "field" => "term_id", "terms" => $term2); } if (!empty($_POST['tax3']) && !empty($_POST['term3'])) { $args['tax_query']['relation'] = "AND"; $args['tax_query'][] = array("taxonomy" => $_POST['tax3'], "field" => "term_id", "terms" => $_POST['term3']); } if (!empty($location)) { $args['tax_query']['relation'] = "AND"; $args['tax_query'][] = array("taxonomy" => $_POST['tax4'], "field" => "term_id", "terms" => $location); } if (!empty($_POST['tax5']) && !empty($_POST['term5'])) { $args['tax_query']['relation'] = "AND"; $args['tax_query'][] = array("taxonomy" => $_POST['tax5'], "field" => "term_id", "terms" => $_POST['term5']); } if (!empty($_POST['tax6']) && !empty($_POST['term6'])) { $args['tax_query']['relation'] = "AND"; $args['tax_query'][] = array("taxonomy" => $_POST['tax6'], "field" => "term_id", "terms" => $_POST['term6']); } if (!empty($_POST['tax7']) && !empty($_POST['term7'])) { $args['tax_query']['relation'] = "AND"; $args['tax_query'][] = array("taxonomy" => $_POST['tax7'], "field" => "term_id", "terms" => $_POST['term7']); } if ($keyword) { $args['s'] = $keyword; } if ((int) $javo_tso->get('date_filter') > 0) { $args['date_query'] = array(array('column' => 'post_date_gmt', 'after' => '30 day ago')); } // Post List HTML $output = array(); global $wp_query; //$posts = query_posts($args); $posts = new wp_query($args); $posts_count = $posts->post_count; // Results Json encode ob_start(); ?> <div class=''> <?php while ($posts->have_posts()) { $posts->the_post(); $post = get_post(get_the_ID()); if (isset($_POST['latlng'])) { $latlng = get_post_meta($post->ID, $_POST['latlng'], true); $add = ""; $latlng = @unserialize($latlng); } $javo_map_str = new get_char($post); $javo_marker_term_id = wp_get_post_terms($post->ID, "item_location"); wp_reset_query(); $javo_set_icon = $javo_tso->get('map_marker', ''); if (!empty($javo_marker_term_id[0])) { $javo_set_icon = get_option('javo_item_location_' . $javo_marker_term_id[0]->term_id . '_marker', ''); } $output[] = array("post_id" => $post->ID, "ibox" => infobox($post), "lat" => $latlng['lat'] ? $latlng['lat'] : "", "lng" => $latlng['lng'] ? $latlng['lng'] : "", "icon" => $javo_set_icon); printf("\n\t\t\t<div class='row javo_somw_list_inner'>\n\t\t\t\t<div class='col-md-3 thumb-wrap'>\n\t\t\t\t\t%s\n\t\t\t\t</div><!-- col-md-3 thumb-wrap -->\n\n\t\t\t\t<div class='cols-md-9 meta-wrap'>\n\t\t\t\t\t<div class='javo_somw_list'><a href='%s' data-lat='%s' data-lng='%s'>%s</a></div>\n\t\t\t\t</div><!-- col-md-9 meta-wrap -->\n\t\t\t</div><!-- row -->", get_the_post_thumbnail($post->ID, array(50, 50)), get_permalink($post->ID), $latlng['lat'], $latlng['lng'], $post->post_title); } ?> </div> <?php $big = 999999999; // need an unlikely integer echo paginate_links(array('base' => "%_%", 'format' => '?page=%#%', 'current' => max(1, get_query_var('paged')), 'prev_text' => __('< Prev', 'javo_fr'), 'next_text' => __('Next >', 'javo_fr'), 'total' => $wp_query->max_num_pages)); // Reset Wordpress Query wp_reset_query(); $content = ob_get_clean(); // Post List HTML end // Result Json $args = array("result" => "succress", "marker" => $output, "html" => $content, "count" => $posts_count); // Output results echo json_encode($args); exit(0); }
function admin() { global $home; onlyadmin(); $output = '<form method="post" action="' . $home . 'forum/createcatpost"> <p><label for="title">' . t("Título") . '</label><br/> <input type="text" name="title"></p> <p><label for="desc">' . t("Descrição") . '</label><br/> <textarea rows="4" cols="25" name="desc"></textarea></p> <p><input type="submit" value="Criar categoria"></p> </form>'; $output .= '<hr size="1">'; $qry = mysql_query("SELECT * FROM forum_categorias"); if (mysql_numrows($qry) == 0) { $output .= infobox(t("Você ainda não criou categorias."), false, false); } else { while ($row = mysql_fetch_array($qry)) { $output .= "\n<div class=\"row\"><p>" . url("forum/topics/{$row['id']}", $row['title']) . '<br> <i>' . bbcode($row['desc']) . '</i><hr size="1"> ' . url("forum/removecat/{$row['id']}", t("[remover]")) . ' </p></div>'; } } section($output, t("Administração do fórum")); }
<?php require_once "includes/config.php"; session_start(); if ($_SESSION["valid"] != true) { header("Location: index.php"); } if ($_POST["action"] == "update") { $fp = fopen("includes/config.php", "w"); $file_text = "<?\r\n\t\$admin_name = '{$_POST['admin_name']}';\r\n\t\$admin_email = '{$_POST['admin_email']}';\r\n\t\$unsubscribe_link = '{$_POST['unsubscribe_link']}';\r\n\t\$site_url = '{$_POST['site_url']}';\r\n\t\$db_file = '{$_POST['db_file']}';\r\n\t\$sub_file = '{$_POST['sub_file']}';\r\n\t\$unsub_file = '{$_POST['unsub_file']}';\r\n\t\$deactivated = '{$_POST['active']}';\r\n\trequire('functions.php');\r\n?>"; fwrite($fp, $file_text); fclose($fp); $msg = infobox("Settings Updated!", "All configuration changes have been saved."); } if ($unsubscribe_link == 'on') { $un = 'checked'; } if ($deactivated == 'on') { $de = 'checked'; } $main .= "\r\n\t\t\t<div class=page_heading>Settings</div>\r\n\t\t\t{$msg}\r\n\t\t\t<form name=form action='settings.php' method='post'>\r\n\t\t\t Name (Emails are sent as this)<br>\r\n\t\t\t <input class=textField type=text name='admin_name' value='{$admin_name}' title='Please enter name.'>\r\n\t\t\t <br>\r\n\t\t\t <span class=error_text id=label_admin_name></span>\r\n\t\t\t <br>\r\n\t\t\t Email (Emails are sent as this)<br>\r\n\t\t\t <input class=textField type=text name='admin_email' value='{$admin_email}' title='Please enter a valid email address.'>\r\n\t\t\t <br>\r\n\t\t\t <span class=error_text id=label_admin_email></span>\r\n\t\t\t <br>\r\n\t\t\t Site URL<br>\r\n\t\t\t <input class=textField type=text name='site_url' value='{$site_url}' title='Please enter a valid URL for site.'>\r\n\t\t\t <br>\r\n\t\t\t <span class=error_text id=label_site_url></span>\r\n\t\t\t <br>\r\n\t\t\t Database File<br>\r\n\t\t\t <input type=hidden name=old_db_file value={$db_file}>\r\n\t\t\t <input class=textField type=text name='db_file' value='{$db_file}' title='Please enter a valid db file name.'>\r\n\t\t\t <br>\r\n\t\t\t <span class=error_text id=label_db_file></span>\r\n\t\t\t <br>\r\n\t\t\t New Subscriptions Database File<br>\r\n\t\t\t <input type=hidden name=old_sub_db_file value={$sub_file}>\r\n\t\t\t <input class=textField type=text name='sub_file' value='{$sub_file}' title='Please enter a valid db file name.'>\r\n\t\t\t <br>\r\n\t\t\t <span class=error_text id=label_sub_db_file></span>\r\n\t\t\t <br>\r\n\t\t\t Unsubscriptions Database File<br>\r\n\t\t\t <input type=hidden name=old_unsub_db_file value={$unsub_file}>\r\n\t\t\t <input class=textField type=text name='unsub_file' value='{$unsub_file}' title='Please enter a valid db file name.'>\r\n\t\t\t <br>\r\n\t\t\t <span class=error_text id=label_unsub_db_file></span>\r\n\t\t\t <br>\r\n\t\t\t Send Unsubscribe Link<br>\r\n\t\t\t <input class=textField type=checkbox {$un} name='unsubscribe_link' title='Please enter a valid Newsletter Charset.'>\r\n\t\t\t <br>\r\n\t\t\t Deactivate Subscriptions<br>\r\n\t\t\t <input class=textField type=checkbox {$de} name='active' title='Deactivate Subscriptions?'>\r\n\t\t\t <br><br>\r\n\t\t\t <input type=hidden name=action value=update>\r\n\t\t\t <input class=button type=submit value=Update>\r\n\t\t\t </form>\r\n\t\t\t <script language=javascript>\r\n\t\t\t\tvar validator = new Validator('form');\r\n\t\t\t\tvalidator.addValidation('admin_username','req','');\r\n\t\t\t\tvalidator.addValidation('admin_name','req','');\r\n\t\t\t\tvalidator.addValidation('admin_email','req','');\r\n\t\t\t\tvalidator.addValidation('admin_email','email','');\r\n\t\t\t\tvalidator.addValidation('site_url','req','');\r\n\t\t\t\tvalidator.addValidation('db_file','req','');\r\n\t\t\t</script>\r\n\t\t\t "; $page = "settings"; require_once "includes/template.php";
function newmodulepost() { requirelogin(); $_POST = array_map('protect', $_POST); $nome = $_POST['nome']; $descricao = nl2br($_POST['descricao']); $imagem = imageupload($_FILES['imagem']); $imagem = $imagem['full']; $link = $_POST['link']; if (!preg_match("/^(htt|ft)(p|ps):\\/\\/(.*)\\.(zip|tar\\.gz)\$/", $link) and !preg_match("/(rapidshare|masteruploading|easy-share|sourceforge|uploading|megaupload|share|upload)/", $link)) { infobox("Erro: O link de download apresentou erros.<br/>\n Ele deve ter as extensões \".zip\" ou \".tar.gz\" e estar nos seguintes protocolos:\n <br/>HTTP ou FTP, com ou sem SSL.<br/>\n <a href=\"#\" onClick=\"javascript:history.back();\">Voltar</a>", true, true); } $user = mysql_fetch_array(mysql_query("SELECT login FROM accounts WHERE `id`='{$_SESSION['id']}'")); $user = $user['login']; mysql_query("INSERT INTO comunidade VALUES ('', 'm', '{$nome}', '{$descricao}', '{$imagem}', '{$link}', '{$user}')"); redir("comu/modules"); }
function remove($id) { requirelogin(); $id = protect($id); $owner = $_SESSION['id']; $qry = mysql_query("SELECT `foto` FROM photos WHERE `id`='{$id}' AND `owner`='{$owner}'"); if (mysql_numrows($qry) == 1) { $qry = mysql_fetch_array($qry); unlink("upload/" . $qry['foto']); mysql_query("DELETE FROM photos WHERE `id`='{$id}'"); } infobox(t("Foto excluída com sucesso.")); }
function recoverfour() { $_POST = array_map('protect', $_POST); $novasenha = $_POST['novasenha']; $novasenha2 = $_POST['novasenha2']; $email = $_POST['email']; $login = $_POST['login']; $code = $_POST['code']; //$qry = mysql_query("SELECT id FROM accounts WHERE login='******' AND email='$email'"); $qry = mysql_query("SELECT a.id AS conta,r.id AS recovcod FROM accounts a LEFT JOIN recover r ON r.account=a.id WHERE a.login='******' AND a.email='{$email}' AND r.code='{$code}'") or die(mysql_error()); if (mysql_num_rows($qry) != 1) { infobox(t("Código, login e/ou e-mail estão incorretos.")); } else { $row = mysql_fetch_array($qry); setcookie("atempts", 0); mysql_query("UPDATE accounts SET ultimo_login='******' WHERE id='{$row['conta']}'"); mysql_query("DELETE FROM recover WHERE code='{$row['recovcod']}'"); $_SESSION['id'] = $row['conta']; redir("home"); } }
<h1><?php echo '<b>' . htmlentities($conf['Header']) . '</b>' . ($conf['ShowDateTime'] ? ' :: ' . date($conf['DateTimeFormat']) : ''); ?> </h1> <?php // InfoBox; parse comments away and evaluate if ($conf['InfoBox']) { $ibContent = file_get_contents($resdir . '/infobox.php'); infobox('info1', $ibContent); } // Same as above, but for a per-directory info box if ($conf['DirInfoBox'] && file_exists($sInfoBox = $dir_s . '/' . $conf['DirInfoBoxFile'])) { $sIbContent = file_get_contents($sInfoBox); infobox('info2', $sIbContent); } ?> <div id="files"> <div id="nav"> <?php // Create the path display echo '<div id="path">' . construct_path_links($dir_c, $conf['DirectoryLabel']) . '</div>' . NL; // File count if ($conf['ShowFileCount']) { echo '<span id="filecount">' . NL; echo htmlentities(sprintf($lang['Nav']['FileCount'], $count['dir'], $count['dir'] == 1 ? $lang['Nav']['DirsSingular'] : $lang['Nav']['DirsPlural'], $count['file'], $count['file'] == 1 ? $lang['Nav']['FilesSingular'] : $lang['Nav']['FilesPlural'])); if ($conf['ShowSizes'] && $conf['ShowDirTotalSize']) { echo '<span id="totalsize">';
echo "\t<link type='text/css' rel='stylesheet' href=\"{$baseref}/jquery/1.11.2-ui/jquery-ui.structure.css\">\n"; echo "\t<link type='text/css' rel='stylesheet' href=\"{$baseref}/jquery/1.11.2-ui/jquery-ui.theme.css\">\n"; echo "\t<script src='{$baseref}/jquery/1.11.2/jquery-1.11.2.js'></script>\n"; echo "\t<script src='{$baseref}/jquery/1.11.2-ui/jquery-ui.js'></script>\n"; echo "\t<link type='text/css' rel='stylesheet' href=\"{$baseref}/css/activecss/activecss.css\">\n"; setstyle('/', true, false, $activetheme); echo "</head>\n"; echo "<body class='activebody'>\n"; echo "\t<form name='accform' id='accform' action=\"{$scriptname}\" method=\"POST\">\n"; echo "\t\t<input type=hidden name='nextact' id='nextact' value=\"{$nextact}\">\n"; echo "\t\t<input type=hidden name='elaps' id='elaps' value=\"{$elaps}\">\n"; echo "\t\t<input type=hidden name='activebrowser' id='activebrowser' value=\"{$activebrowser}\">\n"; echo "\t\t<input type=hidden name='activetheme' id='activetheme' value=\"{$activetheme}\">\n"; echo "\t\t<input type=hidden name='activepage' id='activepage' value=\"{$activepage}\">\n"; echo "\t\t<input type=hidden name='activesection' id='activesection' value=\"{$activesection}\">\n"; infobox(); browserspot(); themedrop(); pagebox(); sectionbox(); showstyles(); echo "\t</form>\n"; topjava(); morejava($start); echo "</body>\n"; echo "</html>\n"; ////////////////////////////////////////////////////////////////////////// function topjava() { $baseref = $_SESSION["baseref"]; echo "\t<script type='text/javascript'>\n";
function createpost() { requirelogin(); $_POST = array_map('protect', $_POST); $owner = $_SESSION['id']; $title = $_POST['title']; $url = cleanstring($title); $desc = $_POST['desc']; $qry = mysql_query("SELECT `id` FROM groups WHERE `url`='{$url}'"); if (mysql_numrows($qry) == 1) { infobox(t("Um grupo com este nome já existe."), true, true); } mysql_query("INSERT INTO groups (`owner`, `title`, `url`, `desc`) VALUES ('{$owner}', '{$title}', '{$url}', '{$desc}');"); $group_id = resolvegroup($url); mysql_query("INSERT INTO groups_join (`account`, `group`) VALUES ('{$owner}', '{$group_id}');"); note(t("criou um grupo."), $_SESSION['id']); redir("groups/view/{$url}"); }
function editapost() { requirelogin(); $_POST = array_map('protect', $_POST); $title = is_null($_POST['title']) ? t("Sem título") : $_POST['title']; $content = $_POST['text']; $post = $_POST['post']; $post = protect($post); $qry = mysql_query("SELECT * FROM blog WHERE `id`='{$post}' AND `owner`='{$_SESSION['id']}'"); if (mysql_numrows($qry) == 0) { redir("error"); } mysql_query("UPDATE blog SET `title`='{$title}', `text`='{$content}' WHERE `id`='{$post}'"); if ($_POST['modifydate']) { $now = time(); mysql_query("UPDATE blog SET `date`='{$now}' WHERE `id`='{$post}'"); } infobox(t("Atualizado com sucesso.")); }
echo '</table>'; } } } } echo '<input type="submit" value="把指定的字段编码转换为'.$maincharset.'" name="repairsubmit" onclick="javascript:if(confirm(\'Tools工具箱只是尝试帮你修复数据库字段字符集,修复前请先备份你的数据库,以免造成不必要的损失,如果因为你没有备份数据库造成的损失与本程序无关\'));else return false;"></form>'; echo '<br /><br /><br /></div> </div>'; } else { errorpage('MySQL数据库版本在4.1以下,没有字符集设定,无需检测', '', 0, 0); } htmlfooter(); } elseif($action == 'dz_filecheck') {//搜索未知文件 htmlheader(); if($begin != 1) { echo '<h4>文件校验</h4>'; infobox('文件校验是针对 Discuz! 官方发布的文件为基础进行核对,点击下面按钮开始进行校验。','tools.php?action=dz_filecheck&begin=1'); htmlfooter(); exit; } $md5data = array(); if(!$dz_files = @file(TOOLS_ROOT.'./admin/discuzfiles.md5')) { errorpage('没有找到md5文件'); } checkfiles('./', '\.php', 0, 'config.inc.php'); checkfiles('api/', '\.php'); checkfiles('admin/', '\.php'); checkfiles('archiver/', '\.php'); checkfiles('include/', '\.php|\.js|\.htm'); checkfiles('modcp/', '\.php'); checkfiles('plugins/', '\.php');
function mod($mod, $act) { // $act = en/dis (enable/disable) if ($act == 'en') { // enable if (file_exists("mods/{$mod}/{$mod}.sys.php")) { include "mods/{$mod}/{$mod}.sys.php"; if (function_exists($mod . '_install')) { eval($mod . '_install();'); } } } elseif ($act == 'dis') { // disable if (file_exists("mods/{$mod}/{$mod}.sys.php")) { include "mods/{$mod}/{$mod}.sys.php"; if (function_exists($mod . '_uninstall')) { eval($mod . '_uninstall();'); } } } infobox(t("Operação realizada com sucesso.")); }