Exemplo n.º 1
0
/*
	drydock imageboard script (http://code.573chan.org/)
	File:			recentpics.php (aka ThornLight)
	Description:	Show the most recent posted pictures for moderator use
	
	Unless otherwise stated, this code is copyright 2008 
	by the drydock developers and is released under the
	Artistic License 2.0:
	http://www.opensource.org/licenses/artistic-license-2.0.php
*/
require_once "config.php";
require_once "common.php";
if (!$_SESSION['admin'] && !$_SESSION['moderator']) {
    THdie("Sorry, you do not have the proper permissions set to be here, or you are not logged in.");
} else {
    $db = new ThornToolsDBI();
    // Init some stuff
    if (isset($_GET['board'])) {
        $board_folder = trim($_GET['board']);
        //trim the board name from get
    } else {
        $board_folder = "";
    }
    $boardid = 0;
    $boardlink = "";
    $offset = 0;
    $offsetback = 0;
    $offsetfwd = 0;
    $count = 0;
    // We just append this to the end of all the SQL queries/links.  Makes things simpler because we only have to do it once.
    if ($board_folder != "" && $db->getboardnumber($board_folder)) {
Exemplo n.º 2
0
                }
            }
        }
    }
    $sm = sminit("popup.tpl");
    $sm->assign("text", $message);
    $sm->assign("timeout", $timeout);
    $sm->assign("title", "Post reporting form");
    $sm->display("popup.tpl");
    die;
} elseif (strtolower($_POST['report']) == "report2") {
    $message = "what";
    if (!isset($_POST['board']) || $_POST['board'] == "") {
        $message = "No board provided!";
    } else {
        $db = new ThornToolsDBI();
        if ($db->checkban()) {
            THdie("PObanned");
        }
        $board = $db->getboardnumber($_POST['board']);
        // verify that the board is correct
        if ($board == null) {
            $message = "Invalid board provided!";
        } else {
            if ($_POST['post'] <= 0 || isset($_POST['post']) == false) {
                $message = "No valid post to report!";
            } else {
                if (isset($_POST['category'])) {
                    $category = intval($_POST['category']);
                    if ($category > 0 && $category < 4) {
                        if ($db->checkreportpost($_POST['post'], $board) == 0) {
Exemplo n.º 3
0
    }
    $db = new ThornDBI();
    $archivelink .= $db->getboardname(THnewsboard) . '">Full News Archive</a>';
    //make our link
    ?>
		</div>
	</div>
</div>
<?php 
    include "menu.php";
    ?>

<?php 
    if ($archivelink) {
        echo '<div style="text-align: center;" style="font-family:verdana,century;font-size:10px;padding-bottom: 10px;">- ' . $archivelink . " -</div>\n";
    }
    //Otherwise, we'll use static pages
} else {
    $db = new ThornToolsDBI();
    $pagedata = $db->getstaticpage("FrontPage");
    if ($pagedata == null) {
        $pagedata = "<br />This site is powered by the drydock image board script.";
    }
    // Caching ID format: p<pageid>
    $cid = "p" . $pagedata['id'];
    // Initialize the Smarty object, display the object, and go
    $sm = sminit("staticpage.tpl", $cid, THtplset);
    $sm->assign_by_ref("page", $pagedata);
    $sm->display("staticpage.tpl", $cid);
    $sm->display("bottombar.tpl", null);
}
Exemplo n.º 4
0
/*
	drydock imageboard script (http://code.573chan.org/)
	File:			recentposts.php (aka ThornQuasiLight)
	Description:	Show the most recent posts for moderator use
	
	Unless otherwise stated, this code is copyright 2008 
	by the drydock developers and is released under the
	Artistic License 2.0:
	http://www.opensource.org/licenses/artistic-license-2.0.php
*/
require_once "config.php";
require_once "common.php";
if (!$_SESSION['admin'] && !$_SESSION['moderator']) {
    THdie("Sorry, you do not have the proper permissions set to be here, or you are not logged in.");
} else {
    $db = new ThornToolsDBI();
    function comp_post_ids($a, $b)
    {
        $first = $a['id'];
        $second = $b['id'];
        if ($first == $second) {
            //This should never happen, but whatever.
            return 0;
        }
        return $first < $second ? 1 : -1;
    }
    // Init some stuff
    if (isset($_GET['board'])) {
        $board_folder = trim($_GET['board']);
        //trim the board name from get
    } else {
Exemplo n.º 5
0
/**
 * Rebuild the RSS feed associated with the news board (at rss.xml)
 */
function rebuild_rss()
{
    if (THnewsboard) {
        $sidelinks = fopen("rss.xml", "w") or die("Could not open rss.xml for writing.");
        fwrite($sidelinks, "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n");
        fwrite($sidelinks, "<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n");
        fwrite($sidelinks, "\t<channel>\n");
        fwrite($sidelinks, "\t" . '<atom:link href="' . THurl . 'rss.xml" rel="self" type="application/rss+xml" />' . "\n");
        fwrite($sidelinks, "\t\t<title>" . THname . "</title>\n");
        fwrite($sidelinks, "\t\t<description>" . THname . " drydock RSS feeder - " . THurl . "</description>\n");
        fwrite($sidelinks, "\t\t<language>en</language>\n");
        fwrite($sidelinks, "\t\t<link>" . THurl . "</link>\n");
        fwrite($sidelinks, "\t\t<generator>drydock rss feed generator</generator>\n");
        fwrite($sidelinks, "\t\t<copyright>tyam/ordog/kchan devs - http://573chan.org / http://drydock.googlecode.com/</copyright>\n");
        //pull everything from the news page
        $db = new ThornToolsDBI();
        $posts = $db->getnewsthreads();
        $newsboard = $db->getboardname(THnewsboard);
        //get the name of the board
        foreach ($posts as $news_post) {
            //set up our variables so we're not using raws
            if ($news_post['name']) {
                if ($news_post['trip']) {
                    $author = $news_post['name'] . "!" . $news_post['trip'];
                } else {
                    $author = $news_post['name'];
                }
                //tripcode check
            } else {
                $author = "Anonymous";
            }
            //name check
            $text = $news_post['body'];
            //no filters
            if ($news_post['title'] != NULL) {
                $subject = $news_post['title'];
            } else {
                $subject = "News post";
            }
            if (THuserewrite) {
                $link = THurl . $newsboard . '/thread/' . $news_post['globalid'];
            } else {
                $link = THurl . 'drydock.php?b=' . $newsboard . '&amp;i=' . $news_post['globalid'];
            }
            $guid = $news_post['globalid'];
            $body = replacewedge(nl2br($text)) . '&lt;br/&gt;~' . $author;
            //post template
            fwrite($sidelinks, "\n");
            fwrite($sidelinks, "\t\t<item>\n");
            fwrite($sidelinks, "\t\t<guid isPermaLink=\"false\">news {$guid}</guid>\n");
            fwrite($sidelinks, "\t\t\t<title>{$subject}</title>\n");
            fwrite($sidelinks, "\t\t\t<description>{$body}</description>\n");
            fwrite($sidelinks, "\t\t\t<link>{$link}</link>\n");
            fwrite($sidelinks, "\t\t\t<pubDate>" . date(DATE_RSS, $news_post['time']) . "</pubDate>\n");
            fwrite($sidelinks, "\t\t</item>\n");
            fwrite($sidelinks, "\n");
        }
        fwrite($sidelinks, "\t</channel>\n");
        fwrite($sidelinks, "</rss>\n");
        fclose($sidelinks);
    }
}