Example #1
0
    </div>

    <div class="inputblock">
      <label for="type">Type of follow-up</label>
      <br>
      <select name="type" id="type">
        <option value="finding" <?php 
sv('type', 'finding');
?>
>Finding</option>
        <option value="status" <?php 
sv('type', 'status');
?>
>Status Update</option>
        <option value="hotlist" <?php 
sv('type', 'hotlist');
?>
>Hotlist Addition</option>
      </select>
    </div>
 
    <div class="inputblock">
      <label for="body">Body</label>
      <br>
      <textarea cols="80" rows="10" name="body" id="body"><?php 
dv('body');
?>
</textarea>
    </div>

    <div class="inputblock">
Example #2
0
function generate()
{
    global $edit, $langmessage, $set, $pagenum, $menu, $templatepath, $selected, $LNEversion, $prefix, $out;
    $edit = 0;
    $count = 0;
    $go_sm = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset\n\t\n      xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\n\t\n      xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\t\n      xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9\n            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\">\n\n\t<url>\n\n\t<loc>http://" . sv(SERVER_NAME) . "/</loc>\n\n\t<priority>0.6</priority>\n\n\t<lastmod>" . date('Y-m-d') . "</lastmod>\n\n\t<changefreq>daily</changefreq>\n</url>\n";
    while ($menu[$count][0] != "") {
        $result1 = dbquery("SELECT * FROM " . $prefix . "paginas WHERE page=\"" . str_replace("_", "", $menu[$count][3]) . "\"");
        $row1 = fetch_array($result1);
        if ($row1['template'] != "") {
            $template2 = $row1['template'];
        } else {
            $template2 = $set['template'];
        }
        $row1['description'] = decode($row1['description']);
        $out = "";
        $pagenum = str_replace("''", "'", $menu[$count][3]);
        $pagenum = str_replace("_", "", $pagenum);
        if (!strval(strstr($menu[$count][3], "*"))) {
            $selected['index'] = $menu[$count][0];
            $selected['name'] = $menu[$count][4];
            $selected['link'] = $menu[$count][3];
            //query page record for template
            $page = "<?php \$pagenum=\"" . $pagenum . "\"; require_once \"./LightNEasy/runtime.php\"; ?>\n";
            $page .= file_get_contents("templates/" . $template2 . "/template.php");
            $go_sm .= "<url>\n\n\t\t\t<loc>http://" . sv(SERVER_NAME) . dirname(sv(REQUEST_URI)) . $menu[$count][3] . ".php</loc>\n\n\t\t\t<priority>0.5</priority>\n\n\t\t\t<lastmod>" . date('Y-m-d') . "</lastmod>\n\n\t\t\t<changefreq>daily</changefreq>\n\n\t\t\t</url>\n";
            if (!($fp = fopen($pagenum . ".php", "w"))) {
                die($langmessage[110] . $pagenum . ".php");
            }
            $contnt = html_entity_decode(stripslashes($row1['content']));
            //Look in the content for header modules
            while ($page != "") {
                if ($pagearray = explode($set['openfield'], $page, 2)) {
                    $out .= $pagearray[0];
                    $page = $pagearray[1];
                    if ($pagearray = explode($set['closefield'], $page, 2)) {
                        $command = trim($pagearray[0]);
                        $page = $pagearray[1];
                        switch ($command) {
                            case "content":
                                contentmarkers($contnt);
                                $out .= "<?php content(\"" . $pagenum . "\"); ?>";
                                break;
                            case "header":
                                $out .= printheader(1, $selected['name'], $row1['description'], $template2);
                                break;
                            case "footer":
                                $out .= "<?php print footer(); ?>";
                                break;
                            case "search":
                                $out .= "<?php print searchform(); ?>";
                                break;
                            case "homelink":
                                $out .= "<a href=\"" . $set['homepath'] . "\">{$langmessage['111']}</a>";
                                break;
                            case "image":
                                $out .= "templates/" . $set['template'] . "/images/";
                                break;
                            case "extra":
                                $out .= "<?php print extra(\"" . $selected['link'] . "\"); ?>\n";
                                break;
                            case "login":
                                $out .= "<?php print loginout(); ?>\n";
                                break;
                            case "loginform":
                                $out .= "<?php print loginform(); ?>\n";
                                break;
                            case "mainmenu":
                                $out .= "<?php print mainmenu(1); ?>\n";
                                break;
                            case "mainmenu1":
                                $out .= "<?php print mainmenu(1,1); ?>\n";
                                break;
                            case "mainmenu2":
                                $out .= "<?php print mainmenu(1,2); ?>\n";
                                break;
                            case "mainmenu3":
                                $out .= "<?php print mainmenu(1,3); ?>\n";
                                break;
                            case "treemenu":
                                $out .= "<?php print treemenu(1); ?>\n";
                                break;
                            case "fullmenu":
                                $out .= "<?php print fullmenu(1); ?>\n";
                                break;
                            case "expmenu":
                                $out .= "<?php print expmenu(1); ?>\n";
                                break;
                            case "submenu":
                                $out .= "<?php print submenu(1); ?>\n";
                                break;
                            case "selected":
                                $out .= $selected['name'];
                                break;
                            case "sitemap":
                                $out .= sitemap(1);
                                break;
                            case "subtitle":
                                $out .= $set['subtitle'];
                                break;
                            case "title":
                                $out .= '<a href="' . $set['homepath'] . '">' . $set['title'] . '</a>';
                                break;
                            default:
                                if (strpos($command, "plugin") !== false) {
                                    $aa = explode(" ", $command, 2);
                                    $pluginpath = "plugins/" . trim($aa[1]);
                                    if (file_exists($pluginpath . "/first.mod")) {
                                        $out = file_get_contents($pluginpath . "/first.mod") . $out;
                                    }
                                    if (file_exists($pluginpath . "/header.mod")) {
                                        $out = str_replace("</head>", file_get_contents($pluginpath . "/header.mod") . "\n</head>", $out);
                                    }
                                    if (file_exists($pluginpath . "/onload.mod")) {
                                        $out = str_replace("<body", "<body onload=\"" . file_get_contents($pluginpath . "/onload.mod") . "\"", $out);
                                    }
                                    if (file_exists($pluginpath . "/include.mod")) {
                                        $out .= "<?php include \"plugins/" . trim($aa[1]) . "/include.mod\"; ?>\n";
                                    }
                                    if (file_exists($pluginpath . "/place.mod")) {
                                        $out .= file_get_contents("{$pluginpath}/place.mod");
                                    }
                                } elseif (strpos($command, "extra") !== false) {
                                    $aa = explode(" ", $command, 2);
                                    $out .= "<?php print extra(\"" . $selected['link'] . "\"," . $aa[1] . "); ?>";
                                } else {
                                    $found = false;
                                    $addons = fetch_all(dbquery("SELECT * FROM " . $prefix . "addons WHERE active=1"));
                                    foreach ($addons as $addon) {
                                        if ($command == $addon['name']) {
                                            $out .= "<?php require_once \"addons/" . $addon['name'] . "/main.php\"; print " . $addon['fname'] . "(); ?>";
                                            $found = true;
                                            break;
                                        } elseif (substr($command, 0, strlen($addon['name'])) == $addon['name']) {
                                            $found = true;
                                            $out .= "<?php require_once \"addons/" . $addon['name'] . "/main.php\"; ";
                                            $bb = trim(substr($command, strlen($addon['name'])));
                                            $aa = explode(" ", $bb);
                                            if ($aa[3] != "") {
                                                $out .= "print " . $addon['fname'] . "('{$aa['0']}','{$aa['1']}','{$aa['2']}','{$aa['3']}')";
                                            } elseif ($aa[2] != "") {
                                                $out .= "print " . $addon['fname'] . "('{$aa['0']}','{$aa['1']}','{$aa['2']}')";
                                            } elseif ($aa[1] != "") {
                                                $out .= "print " . $addon['fname'] . "('{$aa['0']}','{$aa['1']}')";
                                            } else {
                                                $out .= "print " . $addon['fname'] . "('{$aa['0']}')";
                                            }
                                            $out .= "; ?>";
                                            break;
                                        }
                                    }
                                    if (!$found) {
                                        $out .= $command;
                                    }
                                }
                        }
                    } else {
                        break;
                    }
                } else {
                    break;
                }
            }
            if ($page != "") {
                $out .= $page;
            }
            fwrite($fp, $out);
            fclose($fp);
            @chmod($menu[$count][3] . ".php", 0755);
            if (file_exists($menu[$count][3] . ".html")) {
                unlink($menu[$count][3] . ".html");
            }
        }
        $count++;
    }
    $go_sm .= "</urlset>\n";
    $fp_go = fopen('sitemap.xml', 'w');
    fwrite($fp_go, $go_sm);
    fclose($fp_go);
    unset($_SESSION[$set['password']]);
    setcookie('userpass', "", time() - 60);
    setcookie('userhandle', "", time() - 60);
    session_destroy();
    unset($_GET['do']);
    header("Location: index.php");
}
Example #3
0
    }
} else {
    if (!($sqldbdb = new SQLite3("./data/{$databasename}.db"))) {
        die("Couldn't open SQLite 3 database");
    }
}
readsetup();
$newspage = $set['newspage'];
$pathtonews = "/" . $newspage . ".php?";
// for the news page inside LightNEasy, if you can't generate pages: uncomment the line below and comment the line above.
//$pathtonews="/LightNEasy.php?page=".$newspage."&amp;";
header('Content-type: application/rss+xml; charset=utf-8');
$out = "<?xml version=\"1.0\" ?>\n";
$out .= "<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/RSS\">\n";
$out .= "<channel>\n";
$out .= "<atom:link href=\"http://" . sv('SERVER_NAME') . sv('PHP_SELF') . "\" rel=\"self\" type=\"application/rss+xml\" />\n";
$out .= "<title>" . $set['title'] . "</title>\n";
$out .= "<description>" . $set['description'] . "</description>\n";
$out .= "<link>http://" . sv('SERVER_NAME') . sv('PHP_SELF') . "</link>\n";
$query = "SELECT titulo,data,noticia,autor,email,visto, reg FROM " . $prefix . "noticias ORDER BY reg DESC LIMIT 0, 5";
$roww = fetch_all(dbquery($query));
foreach ($roww as $row) {
    $out .= "<item>\n<title>" . sanitize(stripslashes(decode($row[0]))) . "</title>\n";
    $descr = str_replace("&", "&amp;", substr(strip_tags(stripslashes(decode($row[2]))), 0, 120));
    $out .= "<description>" . $descr . "...\n</description>\n";
    $out .= "<link>" . "http://" . sv('SERVER_NAME') . $pathtonews . "id=" . $row[6] . "</link>\n";
    $out .= "<guid>" . "http://" . sv('SERVER_NAME') . $pathtonews . "id=" . $row[6] . "</guid>\n";
    $out .= "</item>\n";
}
$out .= "</channel>\n</rss>\n";
print $out;
Example #4
0
$myserver = $_SERVER['SERVER_NAME'];
// Installs the common functions
require_once "LightNEasy/common.php";
// Opens the database
$sqldbdb = opendb();
// Reads the setup to the global array $set
$set = array();
readsetup();
if ($set['language'] == "") {
    $set['language'] = "en_US";
}
if ($set['langeditor'] == "") {
    $set['langeditor'] = "en";
}
// Checks if this file is not called remotely
if (!eregi($set['indexfile'], sv('PHP_SELF')) && !eregi('index.php', sv('PHP_SELF'))) {
    die('Access Denied!');
}
// Reads the language file
require_once "./languages/lang_" . $set['language'] . ".php";
// Checks if there was a login attempt or a login cookie exists
login();
// Disables $_GET and $_POST if the user is not logged in, except for the allowed posts
// Disables $_GET except for login and sitemap
if ($_GET['do'] != "profile" && $_GET['do'] != "login" && $_GET['do'] != "sitemap" && $_GET['do'] != "search" && $_GET['do'] != "register" && $_SESSION['adminlevel'] < 4) {
    unset($_GET['do']);
}
// Disables $_POST['submit'] except for login, save profile, save registration, send message and send comment
if ($_POST['submit'] != "enterregister" && $_POST['submit'] != "Send message" && $_POST['submit'] != "sendcomment" && $_POST['submit'] != "saveprofile" && $_SESSION[$set['password']] != "1") {
    unset($_POST['submit']);
}
Example #5
0
//-------------------Pull from DB-----------------
$query = "SELECT titulo,data,noticia,autor,email,visto,reg,cat FROM " . $prefix . "noticias ORDER BY reg DESC LIMIT 0, 5";
$roww = fetch_all(dbquery($query));
foreach ($roww as $row) {
    $catquery = "SELECT nome FROM " . $prefix . "newscat WHERE id=" . $row[7];
    $catid = fetch_array(dbquery($catquery));
    $out .= "<entry>\n\t<title>" . sanitize(stripslashes(decode($row[0]))) . "</title>\n";
    $out .= "\t<link rel=\"alternate\" type=\"text/html\" href=\"http://" . sv(SERVER_NAME) . $pathtonews . "id=" . $row[6] . "\" />\n";
    $out .= "\t<id>tag:" . sv(SERVER_NAME) . "," . date("Y-m-d", $row[1]) . ":" . date("YmdHis", $row[1]) . "</id>\n";
    $out .= "\t<published>" . date(DATE_ATOM) . "</published>\n";
    $out .= "\t<updated>" . date(DATE_ATOM, $row[1]) . "</updated>\n";
    $summ = sanitize(substr(strip_tags(stripslashes(decode($row[2]))), 0, 70));
    $summ = str_replace("&nbsp;", "  ", $summ);
    $out .= "\t<summary>" . $summ . "...</summary>\n";
    $out .= "\t<author>\n\t\t<name>" . $row[3] . "</name>\n";
    $out .= "\t\t<uri>http://" . sv(SERVER_NAME) . "</uri>\n\t</author>\n";
    $out .= "\t<category term=\"" . $catid . "\" />\n";
    $out .= "\t<content type=\"html\" xml:lang=\"en\" xml:base=\"http://www.krakerjak.com/content/\">\n";
    $out .= "\t<![CDATA[" . stripslashes(decode($row[2]));
    //-------------------Show the comments if selected-----------------
    if ($showcomments == true) {
        $comquery = "SELECT * FROM " . $prefix . "comments WHERE newsid=" . $row[6] . " ORDER BY time DESC";
        $comments = fetch_all(dbquery($comquery));
        //-------------------Show the comments if there are any-----------------
        if (num_rows(dbquery($comquery)) > 0) {
            $out .= "</br><strong>Comments:</strong><hr>";
            foreach ($comments as $comment) {
                $out .= "<blockquote><strong>" . decode($comment['poster']) . " said:</strong>  ";
                $out .= stripslashes(decode($comment['text'])) . "</blockquote></br>";
            }
        }