Exemplo n.º 1
2
function lista($user)
{
    global $dateformat;
    $user = protect($user);
    requirelogin();
    $title = "Mensagens de {$user}";
    include "libs/accounts.php";
    // listar todas as mensagens de $user onde hidden = 'n' (para outro user ver)
    $output = menu($user) . url("message/send/{$user}", "[enviar mensagem]") . "<br>\n";
    $usr = resolveuser($user);
    $qry = mysql_query("SELECT `from`,`content`,`data` FROM messages WHERE `to`='{$usr}' AND `hidden`='n' ORDER BY id DESC LIMIT 30");
    if (mysql_numrows($qry) == 0) {
        $output .= 'Nenhuma mensagem!';
    } else {
        while ($row = mysql_fetch_array($qry)) {
            $user = mysql_query("SELECT login,foto FROM accounts WHERE id='{$row['from']}'");
            $user = mysql_fetch_array($user);
            $output .= '<p class="row">' . t("De") . ': ' . url("user/profile/{$user['login']}", $user['login']) . '<br/>';
            $output .= '<blockquote>
                 ' . bbcode($row['content']) . '
                  </blockquote>
                  <hr size="1"><i>' . date($dateformat, $row['data']) . '</i>
                  </p>';
        }
    }
    section($output, $title);
}
Exemplo n.º 2
0
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"));
    }
}
Exemplo n.º 3
0
function main_content()
{
    global $graph;
    global $uri;
    $doc = new DOMDocument();
    $header = $doc->createElement("h1");
    $header->nodeValue = "Overview";
    $doc->appendChild($header);
    $p = $doc->createElement("p");
    $p->nodeValue = $graph->resource($uri)->get("dct:description");
    $doc->appendChild($p);
    section($doc, "Projects", "http://eprints.org/ontology/Project");
    section($doc, "People", "foaf:Person");
    section($doc, "Papers", "bibo:AcademicArticle");
    section($doc, "Conferences", "bibo:Conference");
    section($doc, "Presentations", "bibo:Presentation");
    section($doc, "Datasets", "bibo:Dataset");
    section($doc, "Websites", "http://eprints.org/ontology/Website");
    section($doc, "Code", "bibo:Code");
    return $doc->saveHtml();
}
Exemplo n.º 4
0
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"));
}
Exemplo n.º 5
0
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."));
    }
}
Exemplo n.º 6
0
function lista($user)
{
    requirelogin();
    include "libs/video.php";
    include "libs/accounts.php";
    $user = protect($user);
    $output = menu($user) . '<br>';
    $id = resolveuser($user);
    $qry = mysql_query("SELECT * FROM videos WHERE id='{$id}'");
    if (mysql_num_rows($qry) == 0) {
        $output .= infobox($user . ' ' . t("ainda não possui vídeos."), true);
    } else {
        while ($row = mysql_fetch_array($qry)) {
            $video = youtube($row['video']);
            $output .= '<div class="row">
              <h3>' . protect($video['title']) . '</h3>
              <p><i>' . protect($video['desc']) . '</i><br/>
              ' . $video['code'] . '</p>
            </div><br>';
        }
    }
    section($output, t("Vídeos de") . ' ' . $user);
}
Exemplo n.º 7
0
<?php

if ($page['found']) {
    if (isset($_POST['Submit'])) {
        $page_id = mysql_real_escape_string($page['page_id']);
        $title = mysql_real_escape_string($_POST['title']);
        $content = mysql_real_escape_string($_POST['content']);
        $order = mysql_do_query("SELECT count(*) as `c` FROM `cms_sections` WHERE `page_id` = '{$page_id}'");
        $order = mysql_fetch_assoc($order);
        $order = mysql_real_escape_string($order['c']);
        mysql_do_query("INSERT INTO `cms_sections`\n                            SET `page_id`='{$page_id}', \n                                `order`='{$order}', \n                                `section_title`='{$title}',\n                                `section_text`='{$content}'");
        header("location: " . $page['parent_path'] . $page['page_key']);
        die;
    }
    $c = "<form action=\"{$page['parent_path']}{$page['page_key']}.createsection\" method=\"POST\">";
    $c .= "Section title:<br><input type=\"text\" name=\"title\" size=\"95\"><br><br>";
    $c .= "Content:<br><textarea name=\"content\" cols=\"80\" rows=\"10\"></textarea><br>";
    $c .= "<input type=\"Submit\" name=\"Submit\" value=\"Submit\"></form>";
    $content .= section("Create section...", $c);
}
Exemplo n.º 8
0
<?php

/*
    Main content body PHP script
    Chip Cuccio <http://chip.cuccio.us>
    $Id: body_inc.php 3272 2007-12-20 12:41:17Z chipster $
*/
?>
    <div id="main-body">
<?php 
// default main landing page
if ($op == "index" && !eregi("news", $_SERVER['REQUEST_URI'])) {
    include_once 'content/intro.html';
    print "      <h2 id=\"news\">News and Announcements:</h2>\n";
    include_once 'common/news_inc.php';
    // if in news sections, omit "intro" item
} elseif ($op == "index" && eregi("news", $_SERVER['REQUEST_URI'])) {
    print "      <h2 id=\"news\">News and Announcements:</h2>\n";
    include_once 'common/news_inc.php';
} else {
    // Section selector - BODY - rest of site sections
    section($op, $news, $errno, $errdesc, $SERVER_NAME, $HTTP_REFERER, $SERVER_SIGNATURE, $REQUEST_URI, $REDIRECT_URL, $mode, $gsb_bin_update_ver, $slack_ver, $dir, $path, $ver, $gsb_bin_stable_ver, $gsb_source_ver, $cl_ver, $ports, $stable, $gsb_bin_unstable_ver, $gsb_bin_current_ver, $gsb_bin_stable, $slack_unstable_ver, $gsb_bin_64_ver, $gsb_slax_ver, $slax_ver, $slapt_get_ver, $cl_uri, $slapt_get_ver_noarch);
}
?>
</div>

Exemplo n.º 9
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"));
}
Exemplo n.º 10
0
 */
if ($showpage && $page["page_include"]) {
    $showpage = 0;
    include $page["page_include"];
}
/*****************************************************************************************************
 * Render the page if required.
 */
if ($showpage) {
    $mysections = mysql_do_query("SELECT *\n                                  FROM `cms_sections`\n                             LEFT JOIN `cms_template_section_config` ON `template_section_id` = `section_id`\n                                 WHERE `page_id`='" . mysql_real_escape_string($page['page_id']) . "'\n                                   AND ( `template_name` IS NULL\n                                      OR `template_name` = '" . mysql_real_escape_string($site_config['template']) . "'\n                                       )\n                              ORDER BY `order` ASC");
    if (mysql_num_rows($mysections) == 0) {
        $content .= "This page appears to be empty...";
    } else {
        // $links = "&nbsp;&nbsp;&nbsp;Content list:<br><br>";
        $links = "";
        $body = "";
        $last = mysql_num_rows($mysections) - 1;
        while ($section = mysql_fetch_assoc($mysections)) {
            // $links .= '<a class="contentmenuitem" href="#s'.$section['order'].'">'.($section['order']+1).'. '.$section['section_title'].'</a>';
            $body .= section('<a name="s' . $section['order'] . '"/>' . $section['section_title'] . ($user['editcontent'] == 1 ? '<div style="float:right;position:relative;top:-' . ($section['section_title'] ? '1.2' : '0.5') . 'em;">(Move ' . ($section['order'] > 0 ? '<a href="' . $page['path'] . '.swap.' . ($section['order'] - 1) . '.' . $section['order'] . '">Up</a>' : 'Up') . ' or ' . ($section['order'] != $last ? '<a href="' . $page['path'] . '.swap.' . $section['order'] . '.' . ($section['order'] + 1) . '">Down</a>' : 'Down') . ', <a href="' . $page['path'] . '.edit.' . $section['section_id'] . '">Edit</a>' . ', <a href="' . $page['path'] . '.del.' . $section['section_id'] . '">Del</a>)</div>' : ''), nl2br($section['section_text']), $section['template_data']);
        }
        $content .= $links . $body;
    }
}
/*****************************************************************************************************
 * We should have some content, render it then close the database.
 */
require_once select_header();
echo $content;
require_once select_footer();
dbclose();
Exemplo n.º 11
0
        break;
}
if ($A->count() > 0) {
    while ($A->fetch()) {
        ?>
<tr>
<td><?php 
        echo $A->element("serial");
        ?>
</td>
<td><?php 
        echo str_replace("-", "/", $A->element("date"));
        ?>
</td>
<td><?php 
        echo section($A->element("section"));
        ?>
</td>
<td><?php 
        echo floorname($A->element("floor")) . " - " . $A->element("room") . "室";
        ?>
</td>
<td><?php 
        echo username($A->element("name"));
        ?>
</td>
<td>
<form action="editreserve.php" method="post">
<input type="submit" value="取消">
<input type="hidden" name="delete" value="1">
<input type="hidden" name="id" value="<?php 
Exemplo n.º 12
0
function notes($user)
{
    global $url;
    $output = null;
    $id_user = resolveuser($user);
    $qry = mysql_query("SELECT content FROM notes WHERE account='{$id_user}'");
    $output = menu($user);
    if (mysql_num_rows($qry) == 0) {
        $output .= 'Nenhuma notificação!';
    } else {
        while ($row = mysql_fetch_array($qry)) {
            $output .= "\n" . '<p class="note">
' . url("user/profile/{$user}", $user) . ' ' . $row['content'] . '
</p>';
        }
    }
    section($output, "Notificações de {$user}");
}
Exemplo n.º 13
0
<?php

require_once 'config.php';
?>
	
	<div class="section">
		<div class="wrapper narrow">
			<div class="column-100">
				<h1>Footer Page</h1>
				<p>To edit this page, open <code>/page.php</code> in your code editor of choice. To remove this page from the footer menu, open <code>/system/sections/footer.php</code>.</p>
				<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec id felis scelerisque, scelerisque risus sed, pellentesque augue. Ut elit sapien, vulputate vitae lacus in, ullamcorper rutrum libero. Nulla vel tellus leo. Mauris nisl odio, porta vel magna et, malesuada vestibulum erat. Sed nec enim augue. Donec mollis massa magna, auctor lacinia erat bibendum at.</p>
				<p>Maecenas eget augue magna. Duis lorem velit, tempus suscipit finibus ac, aliquet in mi. Etiam semper ac tellus vitae commodo. Phasellus venenatis sem non odio convallis, nec accumsan tortor scelerisque. Nulla et nisl aliquam, ornare enim eu, pellentesque augue.</p>
			</div>
		</div>
	</div>

<?php 
section('footer');
Exemplo n.º 14
0
function viewalbum($aid)
{
    global $home, $url;
    requirelogin();
    $aid = protect($aid);
    $qry = mysql_query("SELECT * FROM photos WHERE `album`='{$aid}'");
    if (mysql_numrows($qry) == 0) {
        $output .= infobox(t("Este álbum está vazio."), false);
    } else {
        while ($row = mysql_fetch_array($qry)) {
            $output .= '<div class="row">
  <img src="' . $url . '/upload/' . $row['foto'] . '" width="320"><br/>
  </div><br/>';
        }
    }
    section($output, t("Vendo álbum"));
}
Exemplo n.º 15
0
<?php

include 'router.php';
include 'request.php';
require 'helper.php';
//clear();
$curTime = microtime(true);
$uri = "/data/4";
//$uri = "/users";
section("Original URI: {$uri}");
$request = new Request($uri);
$router = new Router($request);
$router->GET('/', function ($req, $res) {
    $res->send("root");
});
$router->GET('/data/{id}', function ($req, $res) {
    $res->send("f**k data " . $req->params->id);
});
$router->GET('/users', function ($req, $res) {
    echo "users root\r\n";
});
$router->GET('/users/{id}', function ($req, $res) {
    $res->send("f**k user " . $req->params->id);
});
getElapsed($curTime);
Exemplo n.º 16
0
<?php

if (isset($_POST['submit']) && $_POST['submit'] == "Submit") {
    $site_name = mysql_real_escape_string($_POST['site_name']);
    $footer = mysql_real_escape_string($_POST['footer']);
    mysql_do_query("UPDATE `cms_config` \n                     SET `site_name`='{$site_name}',\n                         `footer` = '{$footer}'");
    die('setHTML("footerDiv","' . $footer . '");window.top.document.title = "' . $site_name . ' - Admin Interface";');
}
$c = '<form action="/lp-admin.config" method="POST" id="config">';
$c .= "Site name: <input type=\"text\" name=\"site_name\" size=\"95\" value=\"{$site_config['site_name']}\"><br/><br/>";
$c .= "Site footer: <input type=\"text\" name=\"footer\" size=\"95\" value=\"{$site_config['footer']}\"><br/><br/>";
$c .= "<input type=\"button\" name=\"submit\" value=\"Submit\" onClick=\"postForm('config')\"></form>";
$content .= section("General Config", $c);
Exemplo n.º 17
0
function section($val, $key)
{
    if (is_array($val[$key])) {
        printf("<tr><td colspan=\"6\"><img src=\"../img/%s/%s-128.png\">\n\t\t\t<span style=\"font-size:larger\">%s</span>", strtolower($key), $val["{$key}-Hint"][0][0], $key);
        foreach ($val["{$key}-Hint"] as $v) {
            echo "<tr><td>" . join("<td>", $v);
        }
        echo "\n";
    }
}
reset($host);
while (list($addr, $val) = each($host)) {
    echo "<tr><td>Address<td colspan=\"4\">{$addr}";
    section($val, "Dev");
    section($val, "Role");
    section($val, "OS");
}
?>

</table>

<pre>
<?php 
print_r($host);
?>
</pre>

</body>
</html>

Exemplo n.º 18
0
        print "<TR>" . colorTD($fakultaet, "left", 0.9, 0.9, 0.9) . "\n";
    }
    print colorTD("<B>{$nummer}</B>" . (isset($stimmen) ? " ({$stimmen})" : " &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"), "left", $red, $green, $blue) . "\n";
    if ($fakultaet_) {
        print "</TR>\n";
    }
}
function set_chart($row, &$chart)
{
    extract($row);
    array_push($chart, $sum, $red, $green, $blue);
}
function show_legende($row)
{
    extract($row);
    print colorTD("{$name}", "center", $red, $green, $blue) . "\n";
}
section("Status der Urnen");
print "<TABLE border=0 cellpadding=3>\n";
do_query("SELECT fakultaet, nummer, stimmen, " . "urne_status.name AS status_name, " . "red, green, blue FROM urne, urne_status " . "WHERE urne.status = urne_status.id " . "ORDER BY fakultaet, nummer", show_urnen);
print "</TABLE><BR>\n";
section("Status der Stimmen");
$chart = array();
do_query_pass("SELECT sum(stimmen) AS sum, red, green, blue " . "FROM urne, urne_status " . "WHERE urne.status = urne_status.id " . "GROUP BY urne_status.id " . "ORDER BY urne_status.id ", set_chart, $chart);
barchart(400, 20, $chart, "stimmenstatus.png");
image("stimmenstatus.png");
print "<BR><TABLE border=0 cellpadding=3><TR>\n";
print colorTD("Legende:", "left", 0.9, 0.9, 0.9) . "\n";
do_query("SELECT * FROM urne_status ORDER BY id", show_legende);
print "</TR></TABLE><BR>\n";
foot();
Exemplo n.º 19
0
        $section = get("section");
        $floor = get("floor");
        $room = get("room");
        $name = getsession("id");
        $A->query("insert into reserves values ('','{$serial}','{$date}','{$section}','{$floor}','{$room}','{$name}')") ?: $A->error();
        ?>
    <fieldset><legend>已新增以下預約單</legend>
     <table border=2>
    <tr><th>使用日期<br>(年/月/日)</th><th>使用時段</th><th>會議室號碼</th></tr>
    <tr>
    <td><?php 
        echo str_replace("/", "-", get("date"));
        ?>
</td>
    <td><?php 
        echo section(get("section"));
        ?>
</td>
    <td><a href="search.php?step=4&floor=<?php 
        echo get("floor");
        ?>
&date=<?php 
        echo get("date");
        ?>
&section=<?php 
        echo get("section");
        ?>
"><?php 
        echo floorname(get("floor")) . "</a> - " . get("room") . "室";
        ?>
</td>
Exemplo n.º 20
0
            $pages = mysql_num_rows($results);
            if ($pages != 0) {
                die("alert('A page already exists at that location.');");
            }
            $results = mysql_do_query("SELECT * FROM `cms_categories` WHERE `cat_key` = '" . $location . "' AND `cat_parent` = '" . $category . "'");
            $pages = mysql_num_rows($results);
            if ($pages != 0) {
                die("alert('A folder already exists at that location.');");
            }
            mysql_do_query("UPDATE `cms_categories` SET `cat_key` = '" . $location . "', `cat_parent` = '" . $category . "' WHERE `cat_id`='{$cat_id}'");
            die('reloadCats(); showCat(' . $cat_id . ');');
        case "titleCat":
            $cat_id = mysql_real_escape_string($vfile[3]);
            $results = mysql_do_query("SELECT * FROM `cms_categories` WHERE `cat_id` = '" . $cat_id . "'");
            if (mysql_num_rows($results) != 1) {
                die;
            }
            $title = mysql_real_escape_string($_POST['title']);
            mysql_do_query("UPDATE `cms_categories` SET `cat_title` = '" . $title . "' WHERE `cat_id`='{$cat_id}'");
            die('reloadCats(); showCat(' . $cat_id . ');');
            $f = str_replace("\n", " ", print_r($_POST, true));
            die('alert(\'' . addslashes($f) . '\');');
        case "catList":
            die(makeCatListDiv($tree['tree']));
        default:
            die(makePagesDiv($tree['ids'][$vfile[2]]));
    }
}
$content .= section("Site Structure", '<div style="float: left; width: 190px; border: 1px solid #999; padding: 5px;">' . '[<a href="javascript:showAllCats()">Expand all</a>] ' . '[<a href="javascript:hideAllCats()">Collapse all</a>]<br/><br/><div id="catsDiv">' . makeCatListDiv($tree['tree'], true) . '</div></div>' . '<div id="pagesDiv" style="margin: 0px 0px 0px 210px; border: 1px solid #999; padding: 5px 20px 20px 20px;">' . makePagesDiv($tree['tree']) . '</div>' . '<div style="clear: both">&nbsp;</div>');
//$content .= '<script type="text/javascript">'.$js.'</script>';
//$content .= "<br/><br/><pre>".print_r($tree['tree'],true)."</pre>";
Exemplo n.º 21
0
</fieldset>
</form>
<?php 
}
if (get("date")) {
    $C = new db();
    ?>
<br>
<fieldset><legend>請選擇時段</legend>
<table border=2 style="border-collapse:collapse;">
<tr><th width=130>時段</th><th width=130>是否可預約</th></tr>
<?php 
    for ($j = 0; $j < 4; $j++) {
        ?>
<tr><td><?php 
        echo section($j);
        ?>
</td>
<?php 
        $date = get("date");
        $room = get("room");
        $floor = get("floor");
        $C->query("select * from reserves where date='{$date}' and room='{$room}' and floor = '{$floor}' and section = '{$j}'");
        ?>
<td><?php 
        if ($C->count() > 0) {
            ?>
已被預約<?php 
        } else {
            ?>
 <a href="search.php?date=<?php 
Exemplo n.º 22
0
function newmodule()
{
    global $home;
    requirelogin();
    section('<form method="post" enctype="multipart/form-data" action="' . $home . 'comu/newmodulepost">
  <p><label for="nome">Nome do tema</label><br/>
  <input type="text" name="nome" id="nome"></p>
  <p><label for="descricao">Descrição</label><br/>
  <textarea rows="8" cols="25" name="descricao" id="descricao"></textarea></p>
  <p><label for="imagem">Imagem de previsualização</label><br/>
  <input type="file" name="imagem" id="imagem"></p>
  <p><label for="link">Link de download (formato ZIP ou TAR.GZ)</label><br/>
  <input type="text" name="link" id="link"></p>
  <p><input type="submit" value="Enviar"></p>', 'Novo tema');
}
Exemplo n.º 23
0
<?php

require_once "templates/" . $site_config['template'] . "/template_config.php";
if (isset($_POST['submit']) && $_POST['submit'] == "Submit") {
    $template_data = template_global_config_post($_POST);
    if (is_array($template_data)) {
        $content .= $template_data['error'];
    } else {
        if ($template_data != $site_config['template_data']) {
            if ($template_data == "") {
                mysql_do_query("DELETE FROM `cms_template_config` \r\n                              WHERE `template_name` = '" . mysql_real_escape_string($site_config['template']) . "'");
            } else {
                mysql_do_query("UPDATE `cms_template_config` \r\n                           SET `template_data`='" . mysql_real_escape_string($template_data) . "'\r\n                         WHERE `template_name` = '" . mysql_real_escape_string($site_config['template']) . "'");
                if (mysql_affected_rows() == 0) {
                    mysql_do_query("INSERT INTO `cms_template_config` \r\n                             SET `template_data`='" . mysql_real_escape_string($template_data) . "',\r\n                                 `template_name` = '" . mysql_real_escape_string($site_config['template']) . "'");
                }
            }
        }
        #<link rel="stylesheet" href="/style.css" type="text/css"/>
        die('$("link[rel*=\'style\'][href^=\'/style.css\']").replaceWith(\'<link rel="stylesheet" href="/style.css?fr=' . time() . '" type="text/css"/>\');');
    }
}
$c = '<form action="/lp-admin.template" method="POST" id="config">';
$c .= template_global_config_form();
$c .= "<input type=\"button\" name=\"submit\" value=\"Submit\" onClick=\"postForm('config')\"></form>";
$content .= section("Global Template Config", $c);
Exemplo n.º 24
0
            $c .= "<a href=\"{$page['path']}.sidebar.swap." . ($item['item_order'] - 1) . ".{$item['item_order']}\">Move up</a> / ";
        } else {
            $c .= "Move up / ";
        }
        if ($item['item_order'] < $length) {
            $c .= "<a href=\"{$page['path']}.sidebar.swap.{$item['item_order']}." . ($item['item_order'] + 1) . "\">Move down</a> / ";
        } else {
            $c .= "Move down / ";
        }
        $c .= "<a href=\"{$page['path']}.sidebar.edit.{$item['item_id']}\">Edit</a> / ";
        $c .= "<a href=\"{$page['path']}.sidebar.delete.{$item['item_id']}\">Delete</a>";
    }
    $c .= "</table>";
    /*---------------
     * New sidebar entry
     */
    $c .= "<br/><br/><b>New Entry</b>";
    $c .= "<form action=\"{$page['path']}.sidebar.add\" method=\"POST\">";
    $c .= '<table border="0" cellpadding="5" cellspacing="0">';
    $c .= "<tr><td>Category:</td>";
    $c .= "<td><select name=\"mcategory\" size=\"1\"/>" . return_cat_tree_select($tree['tree']) . "</select></td>";
    $c .= "<td>-- Category to display in.  Used for all three sidebar entry types.</td></tr>";
    $c .= "<tr><td>Menu text:</td>";
    $c .= "<td><input type=\"text\" name=\"mtext\" size=\"50\"/></td>";
    $c .= "<td>-- The text displayed for this entry.  Used for links and headers.</td></tr>";
    $c .= "<tr><td>Menu link:</td>";
    $c .= "<td><input type=\"text\" name=\"murl\" size=\"50\"/></td>";
    $c .= "<td>-- The location the link points to.  Only used for links.</td></tr>";
    $c .= "<tr><td colspan=\"3\"><input type=\"submit\" name=\"separator\" value=\"Add as separator\"/>\n                               <input type=\"submit\" name=\"header\" value=\"Add as header\"/>\n                               <input type=\"submit\" name=\"link\" value=\"Add as link\"/>\n      </td></tr></table></form>";
    $content .= section("Sidebar config", $c);
}
Exemplo n.º 25
0
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"));
}
Exemplo n.º 26
0
echo section('groupstatistics');
?>
					<?php 
echo section('groupcloud');
?>
					<?php 
echo section('popular');
?>
					<?php 
echo section('groupsbyposts');
?>
					<?php 
echo section('featuredusers');
?>
					<?php 
echo section('groupsbymembers');
?>
					</div>
				</div>
			<div id="footer">
				<?php 
echo section('secondarynav');
?>
				<?php 
echo section('licenses');
?>
			</div>
			</div>
		</body>
	</html>
Exemplo n.º 27
0
function crystal()
{
    section('<table border="0" bgcolor="#000000" cellspacing="0" cellpadding="3">
  <tr>
    <td width="100%">
<p><font size="4" color="#FFFF00">Crystal Ball</font></p>
<font color="#CCCCFF">
<p>Please enter a yes/no question and it will respond</p>
<p>Warning: the crystal ball has a tendency to be sarcastic!</p>
<table width="40%" border="0">
<tr>
<td>
<form name="input1">
<input name="textfield" size=63>
</form>
</td>
</tr>
</table>
<table width="8%" border="0">
<tr>
<td>
<form>
<input type="button" name="button1" value="Ask Me!"
onClick="getAnswers()">
</form>
</td>
</tr>
</table>

<script language="JavaScript">

//Crystal Ball Script - By Michael McDermott (mcdemf1@wfu.edu)
//http://www.wfu.edu/~mcdemf1
//Visit JavaScript Kit (http://javascriptkit.com) for script


function getAnswers() {

time = new Date()
randominteger = time.getSeconds()

if (document.input1.textfield.value == "") { 
alert("You dummy! You didn\'t enter anything into the Crystal Ball!!!")
return
}

if (randominteger <= 3) answer="Did you really think so? Hahaha, I\'m laughing now at your pitiful chances."
if ((randominteger >= 4) && (randominteger <= 6)) answer ="Yeah, it it\'s got a 65% chance of happening."
if ((randominteger >= 7) && (randominteger <= 9)) answer ="Oh come on! No way!"
if ((randominteger >= 10) && (randominteger <= 12)) answer ="As sure as I\'m made of glass, this is likely to happen."
if ((randominteger >= 13) && (randominteger <= 15)) answer ="Why are you asking A CRYSTAL BALL? Do you really believe the answers?"
if ((randominteger >= 16) && (randominteger <= 18)) answer ="Give me a break, give me a break, break me off a piece of that NO!"
if ((randominteger >= 19) && (randominteger <= 21)) answer ="Good chances lie on the horizon."
if ((randominteger >= 22) && (randominteger <= 24)) answer ="Ask me again, I am restless and overworked."
if ((randominteger >= 25) && (randominteger <= 27)) answer ="Do you know how the Crystal Ball works? There\'s your answer."
if ((randominteger >= 28) && (randominteger <= 30)) answer ="As the sun is hot, your answer is YES."
if ((randominteger >= 31) && (randominteger <= 33)) answer ="Did you get drunk last weekend? There\'s your answer."
if ((randominteger >= 34) && (randominteger <= 36)) answer ="Forget about it"
if ((randominteger >= 37) && (randominteger <= 39)) answer ="Yeah, it could happen. 80% chance."
if ((randominteger >= 40) && (randominteger <= 42)) answer ="Hitler has a better chance of raising from the dead."
if ((randominteger >= 43) && (randominteger <= 45)) answer ="If you really think so, then it shall be."
if ((randominteger >= 46) && (randominteger <= 48)) answer ="Who said ambiguous answers were bad? Not me, so YES!"
if ((randominteger >= 49) && (randominteger <= 51)) answer ="You think I\'m going to answer that after a day of hard work? Ask again later."
if ((randominteger >= 52) && (randominteger <= 54)) answer ="If you own a pet, yes. Otherwise, no."
if ((randominteger >= 55) && (randominteger <= 57)) answer ="The sun will rise in the east and set in the west. Thank you Captain Obvious. YES!"
if ((randominteger >= 58) && (randominteger <= 60)) answer ="I\'m laughing hard, very hard. You\'d better ask again."

var newWindow = window.open("","Results","width=300,height=300")
newWindow.document.write("<html><body bgcolor=\'#000000\' text=\'#FFFFCC\' link=\'#00FFFF\' alink=\'#000066\' vlink=\'#6666FF\'>")
newWindow.document.write("<P align=\'center\'><font size=\'4\' color=\'#FFFF00\'>Your Question:</P><P></P><font size=\'3\' color=\'#FFFFCC\'>")
newWindow.document.write("<P align=\'center\'>" + document.input1.textfield.value + "</P>")
newWindow.document.write("<P></P><P></P><P></P><P align=\'center\'><font size=\'4\' color=\'#FFFF00\'>The Great Crystal Ball Has Answered:</P><P></P>")
newWindow.document.write("<font size=\'3\' color=\'#FFFFCC\'>")
newWindow.document.write("<P align=\'center\'>" + answer + "</P>")
newWindow.document.write("<P></P><P></P><P align=\'center\'><A HREF=\'javascript:window.close()\'>Close Me</A></P>")
}
</script>
</font>
</td>
  </tr>
</table>', t("Crystal"));
}
Exemplo n.º 28
0
    die;
}
$section = mysql_fetch_assoc($section);
if (isset($_POST['Submit']) && $_POST['Submit'] == "Submit" && isset($page['params'][1])) {
    $page_id = mysql_real_escape_string($page['page_id']);
    $title = mysql_real_escape_string($_POST['title']);
    $content = mysql_real_escape_string($_POST['content']);
    mysql_do_query("UPDATE `cms_sections` SET `section_title`='{$title}', `section_text`='{$content}' \n                   WHERE `section_id`='" . mysql_real_escape_string($page['params'][1]) . "'");
    $template_data = template_section_config_post($_POST);
    if (!is_array($template_data)) {
        if ($template_data != $section['template_data']) {
            if ($template_data == "") {
                mysql_do_query("DELETE FROM `cms_template_section_config` \n                              WHERE `template_name` = '" . mysql_real_escape_string($site_config['template']) . "'\n                                AND `template_section_id` = '" . mysql_real_escape_string($section['section_id']) . "'");
            } else {
                mysql_do_query("UPDATE `cms_template_section_config` \n                          SET `template_data`='" . mysql_real_escape_string($template_data) . "'\n                        WHERE `template_name` = '" . mysql_real_escape_string($site_config['template']) . "'\n                          AND `template_section_id` = '" . mysql_real_escape_string($section['section_id']) . "'");
                if (mysql_affected_rows() == 0) {
                    mysql_do_query("INSERT INTO `cms_template_section_config` \n                                  SET `template_data`='" . mysql_real_escape_string($template_data) . "',\n                                      `template_section_id` = '" . mysql_real_escape_string($section['section_id']) . "',\n                                      `template_name` = '" . mysql_real_escape_string($site_config['template']) . "'");
                }
            }
        }
    }
    header("location: " . $page['path']);
    die;
}
$foo = "<form action=\"{$page['path']}.edit.{$page['params'][1]}\" method=\"POST\">";
$foo .= "Section title:<br><input type=\"text\" name=\"title\" size=\"95\" value=\"{$section['section_title']}\"><br><br/>";
$foo .= "Content:<br><textarea name=\"content\" cols=\"80\" rows=\"10\">{$section['section_text']}</textarea><br/><br/>";
$foo .= template_section_config_form($section);
$foo .= "<input type=\"Submit\" name=\"Submit\" value=\"Submit\"></form>";
$content .= section("Edit...", $foo);
if (isset($_GET["verbose"])) {
    $GLOBALS["VERBOSE"] = true;
}
include_once dirname(__FILE__) . "/ressources/class.templates.inc";
include_once dirname(__FILE__) . "/ressources/class.users.menus.inc";
include_once dirname(__FILE__) . "/ressources/class.miniadm.inc";
include_once dirname(__FILE__) . "/ressources/class.user.inc";
include_once dirname(__FILE__) . "/ressources/class.squid.inc";
include_once dirname(__FILE__) . "/ressources/class.squid.reverse.inc";
$PRIV = GetPrivs();
if (!$PRIV) {
    header("location:miniadm.index.php");
    die;
}
if (isset($_GET["section"])) {
    section();
    exit;
}
if (isset($_GET["group-search"])) {
    group_search();
    exit;
}
if (isset($_GET["js-group"])) {
    group_js();
    exit;
}
if (isset($_GET["group-section"])) {
    group_section();
    exit;
}
if (isset($_GET["group-popup"])) {
Exemplo n.º 30
0
    header("location: " . $page['path']);
    die;
}
if (isset($_POST['template']) && $_POST['template'] == "Submit") {
    $template_data = template_page_config_post($_POST);
    if (is_array($template_data)) {
        $content .= $template_data['error'];
    } else {
        if ($template_data != $page['template_data']) {
            if ($template_data == "") {
                mysql_do_query("DELETE FROM `cms_template_page_config` \n                              WHERE `template_name` = '" . mysql_real_escape_string($site_config['template']) . "'\n                                AND `template_page_id` = '" . mysql_real_escape_string($page['page_id']) . "'");
            } else {
                mysql_do_query("UPDATE `cms_template_page_config` \n                           SET `template_data`='" . mysql_real_escape_string($template_data) . "'\n                         WHERE `template_name` = '" . mysql_real_escape_string($site_config['template']) . "'\n                           AND `template_page_id` = '" . mysql_real_escape_string($page['page_id']) . "'");
                if (mysql_affected_rows() == 0) {
                    mysql_do_query("INSERT INTO `cms_template_page_config` \n                                  SET `template_data`='" . mysql_real_escape_string($template_data) . "',\n                                      `template_page_id` = '" . mysql_real_escape_string($page['page_id']) . "',\n                                      `template_name` = '" . mysql_real_escape_string($site_config['template']) . "'");
                }
            }
        }
        header("location: " . $page['path'] . ".pageconfig");
        die;
    }
}
$c = "<form action=\"{$page['path']}.pageconfig\" method=\"POST\">";
$c .= "Page title:<br><input type=\"text\" name=\"title\" size=\"95\" value=\"{$page['page_title']}\"><br>";
$c .= "<input type=\"Submit\" name=\"Submit\" value=\"Submit\"></form>";
$content .= section("Edit title...", $c);
$c = "<form action=\"{$page['path']}.pageconfig\" method=\"POST\">";
$c .= template_page_config_form($page);
$c .= "<input type=\"Submit\" name=\"template\" value=\"Submit\"></form>";
$content .= section("Page Template Config", $c);