コード例 #1
0
function writeSearchBar()
{
    writeSectionHeader("Search The Nerdery");
    $frm = new Form("field", "searchForm", "search.php", "runSearch");
    $frm->addFormElement("search_term", "text", "Search For", "", true);
    $frm->method = "get";
    $frm->draw();
}
コード例 #2
0
    writeUtf8("TWOHANDS=" . $DB->f('twohands'));
    //	writeUtf8("TEVENTS=".$DB->f('tevents'));
    writeMultiLine("TEVENTS", $DB->f('tevents'));
    writeUtf8("");
    writeUtf8("ON=@CREATE");
    writeUtf8("COLOR=" . $DB->f('color'));
    writeMultiLine("", $DB->f('create'));
    writeUtf8("");
}
require "mysql.php";
$DB = new cMySql();
$DB->Database = "mytserver";
$category = "";
$section = "";
$cnt = 0;
$fp = 0;
$DB->query("SELECT *, FORMAT(weight/10,1) AS weight FROM itemforge WHERE valid=1 ORDER BY category,subsection,name");
fileOpen();
writeFileHeader();
while ($DB->next_record()) {
    if ($DB->f('category') != $category || $DB->f('subsection') != $section) {
        $category = $DB->f('category');
        $section = $DB->f('subsection');
        writeSectionHeader($category, $section);
    }
    writeItem($DB);
    $cnt++;
}
writeln("[EOF]");
fileClose();
//echo "$cnt items exportados";
コード例 #3
0
ファイル: galleries.php プロジェクト: kirvin/the-nerdery
            writeCP();
            $sh = new SectionHeader("Picture Galleries", true);
            $sh->start();
            $sh->end();
            echo '<table border="0" cellpadding="2" cellspacing="0" width="700">';
            $each = getGalleries();
            $i = 0;
            while ($g = $each[$i]) {
                //print_r ($g);
                if (strtotime($g->lastModified) > strtotime($_SESSION["PrevVisit"])) {
                    $classname = "modifiedLink";
                } else {
                    $classname = "unmodifiedLink";
                }
                echo "<tr><td colspan=\"2\"><a href=\"galleries.php?gid=" . $g->id . "\"><span class=\"" . $classname . "\">" . $g->name . "</span></a></td></tr><tr><td width=\"20\"></td><td width=\"680\"><span class=\"itemText\">" . $g->description . " (" . strtotime($g->lastModified) . " - " . strtotime($_SESSION["PrevVisit"]) . " - " . (strtotime($g->lastModified) > strtotime($_SESSION["PrevVisit"])) . ")</span></td></tr>";
                $i++;
            }
            echo '</table><br>';
            writeSectionHeader("Create a Gallery");
            $frm = new Form("field", "createGallery", "galleries.php", "addGallery");
            $frm->addDescription("All users can add pictures to public galleries.");
            $frm->addFormElement("is_public", "checkbox", "Public", true, true);
            $frm->addFormElement("gallery_name", "text", "Name", "", true);
            $frm->addFormElement("gallery_description", "textarea", "Description", "", true);
            $frm->method = "post";
            $frm->draw();
        }
    }
}
writeFooter();
$application->save();
コード例 #4
0
ファイル: search.php プロジェクト: kirvin/the-nerdery
 echo "<table border=\"0\" cellpadding=\"2\" cellspacing=\"2\" width=\"700\">";
 if (mysql_num_rows($rs) > 0) {
     $class = "evenCell";
     $count = 0;
     while ($row = mysql_fetch_array($rs)) {
         $class = $class == "evenCell" ? "oddCell" : "evenCell";
         echo "<tr>" . "<td class=\"{$class}\"><b>" . ++$count . ".</b>&nbsp;" . "<a href=\"view_thread.php?d=" . $row["DiscussionID"] . "&t=" . floor($row["CommentID"]) . "&p=1\">" . highlightText(strip_tags($row["CommentSubject"]), $_GET["search_term"], true) . "</a>" . "</td>" . "</tr>";
     }
 } else {
     echo "<tr>" . "<td align=\"center\">" . "No discussion comments matched your search." . "</td>" . "</tr>";
 }
 echo "</table>";
 //search news items
 $sql = "SELECT * FROM JournalEntries WHERE JournalEntryText LIKE '%" . $_GET["search_term"] . "%' OR JournalEntrySubject LIKE '%" . $_GET["search_term"] . "%'";
 $rs = mysql_query($sql) or die("ERROR: " . mysql_error() . "<br>SQL: " . $sql);
 writeSectionHeader("News and News Discussions");
 echo "<table border=\"0\" cellpadding=\"2\" cellspacing=\"2\" width=\"700\">";
 if (mysql_num_rows($rs) > 0) {
     $class = "evenCell";
     $count = 0;
     while ($row = mysql_fetch_array($rs)) {
         $class = $class == "evenCell" ? "oddCell" : "evenCell";
         //http://nerderydev.theirvins.net/view_news_item.php?j=8&e=211
         echo "<tr>" . "<td class=\"{$class}\"><b>" . ++$count . ".</b>&nbsp;" . "<a href=\"view_news_item.php?j=" . $row["JournalID"] . "&e=" . $row["JournalEntryID"] . "\">" . highlightText(strip_tags($row["JournalEntryText"]), $_GET["search_term"], true) . "</a>" . "</td>" . "</tr>";
     }
 } else {
     echo "<tr>" . "<td align=\"center\">" . "No news items matched your search." . "</td>" . "</tr>";
 }
 $sql = "SELECT C.*, E.*, J.* FROM Journals AS J, JournalEntries AS E, JournalEntryComments AS C WHERE CommentText LIKE '%" . $_GET["search_term"] . "%' AND J.JournalID=E.JournalID AND E.JournalEntryID=C.JournalEntryID";
 $rs = mysql_query($sql) or die("ERROR: " . mysql_error() . "<br>SQL: " . $sql);
 if (mysql_num_rows($rs) > 0) {