コード例 #1
0
ファイル: index.php プロジェクト: emiel150/Marco-s-Corner
 * relayed trough this file.
 * 
 * Modified by DIRN on 09/06/2015, changelog 12341	
 */
session_start();
// set serverside cookie
require_once "conf/config.conf.php";
// System configuration also contains other require-statements
// set to the user defined error handler, see : lib/general.lib.php
$new_error_handler = set_error_handler("fcErrorHandler");
$db_conn = databaseConnect();
// Connect to DB
// Since every request or POST is routed via this PHP file
// we may need to process a submitted form. Depending on the action argument
// processCurrentAction does that.
//
// Avoid HTML output before this action. See for mapping of commands processing.lib.php
processCurrentAction();
// Functions that generate content to browser, see general.lib.php
displayHeader();
// Generate HTML header as well as the `top' of the page
displayNavigation();
// Generate navigation bar-menu
displaySearch();
//Generate search input
renderCurrentAction();
// Generate main content, basad upon action argument. See for mapping rendering.lib.php
displayFooter();
// Generate footer and HTML footer as well.
databaseDisconnect($db_conn);
// disconnect from DB
コード例 #2
0
function search($username, $bywhat, $forwhat, $sitename, $bgcolor2, $bgcolor3, $user)
{
    global $prefix, $user_prefix, $db, $module_name, $exact;
    echo "<br>";
    OpenTable();
    echo "<div align=center>";
    if ($exact == '1') {
        echo "<strong>" . _JOURNALFOR . ": \"{$forwhat}\"</strong><br><br>";
    } else {
        echo "<strong>" . _SEARCHRESULTS . ": \"{$forwhat}\"</strong><br><br>";
    }
    if ($forwhat == "naddaanythang") {
        displaySearch($sitename, $username, $bgcolor2, $bgcolor3, $bgcolor1);
    } else {
        echo "<table align=center width=\"90%\" border=2>";
        echo "<tr>";
        echo "<td align=center width=100><strong><div align=\"center\">" . _PROFILE . "</div></strong></td>";
        echo "<td align=center><strong>" . _TITLE . "</strong> " . _CLICKTOVIEW . "</td>";
        echo "<td align=center width=\"5%\"><strong>" . _VIEW . "</strong></td>";
        if ($exact == '1') {
            if ($forwhat == $username) {
                $editdel = 1;
            }
        } else {
            if (eregi($forwhat, $username)) {
                $editdel = 2;
            }
        }
        if ($editdel == '1') {
            echo "<td align=center width=\"5%\"><strong>" . _EDIT . "</strong></td>";
            echo "<td align=center width=\"5%\"><strong>" . _DELETE . "</strong></td>";
        } elseif ($editdel == '2') {
            echo "<td align=center width=\"5%\"><strong>" . _EDIT . "/<br>" . _PROFILE . "</strong></td>";
            echo "<td align=center width=\"5%\"><strong>" . _DELETE . "/<br>&nbsp;</strong></td>";
        } else {
            echo "<td align=center width=\"5%\"><strong>" . _PROFILE . "</strong></td>";
        }
        echo "</tr>";
        if ($bywhat == 'aid') {
            if ($exact == '1') {
                $sql = "SELECT j.jid, j.aid, j.title, j.pdate, j.ptime, j.mdate, j.mtime, u.user_id, u.username FROM " . $prefix . "_journal j, " . $user_prefix . "_users u WHERE u.username=j.aid and j.aid='{$forwhat}' order by j.jid DESC";
            } else {
                $sql = "SELECT j.jid, j.aid, j.title, j.pdate, j.ptime, j.mdate, j.mtime, u.user_id, u.username FROM " . $prefix . "_journal j, " . $user_prefix . "_users u WHERE u.username=j.aid and j.aid like '%{$forwhat}%' order by j.jid DESC";
            }
        } elseif ($bywhat == 'title') {
            $sql = "SELECT j.jid, j.aid, j.title, j.pdate, j.ptime, j.mdate, j.mtime, u.user_id, u.username FROM " . $prefix . "_journal j, " . $user_prefix . "_users u WHERE u.username=j.aid and j.title like '%{$forwhat}%' order by j.jid DESC";
        } elseif ($bywhat == 'bodytext') {
            $sql = "SELECT j.jid, j.aid, j.title, j.pdate, j.ptime, j.mdate, j.mtime, u.user_id, u.username FROM " . $prefix . "_journal j, " . $user_prefix . "_users u WHERE u.username=j.aid and j.bodytext LIKE '%{$forwhat}%' order by j.jid DESC";
        } elseif ($bywhat == 'comment') {
            $sql = "SELECT j.jid, j.aid, j.title, j.pdate, j.ptime, j.mdate, j.mtime, u.user_id, u.username FROM " . $prefix . "_journal j, " . $user_prefix . "_users u, " . $prefix . "_journal_comments c WHERE u.username=j.aid and c.rid=j.jid and c.comment LIKE '%{$forwhat}%' order by j.jid DESC";
        }
        $result = $db->sql_query($sql);
        while ($row = $db->sql_fetchrow($result)) {
            if ($row[status] == "no") {
                $dcount = $dcount + 0;
            } else {
                $dcount = $dcount + 1;
                print "<tr>";
                //The follwing line made reference to non-existing field uname.//
                printf("<td align=center bgcolor={$bgcolor2}><a href=\"modules.php?name=Your_Account&op=userinfo&username={$row['username']}\">%s</a></td>", $row[aid], $row[aid]);
                printf("<td align=left bgcolor={$bgcolor2}>&nbsp;<a href=\"modules.php?name={$module_name}&file=display&jid=%s\">%s</a> <span class=tiny>(%s @ %s)</span>", $row[jid], $row[title], $row[pdate], $row[ptime]);
                $sqlscnd = "SELECT cid from " . $prefix . "_journal_comments where rid={$row['jid']}";
                $rstscnd = $db->sql_query($sqlscnd);
                $scndcount = 0;
                while ($rowscnd = $db->sql_fetchrow($rstscnd)) {
                    $scndcount = $scndcount + 1;
                }
                if ($scndcount > 0) {
                    printf(" &#151&#151 {$scndcount} comments</td>");
                }
                printf("<td align=center bgcolor={$bgcolor2}><a href=\"modules.php?name={$module_name}&file=display&jid=%s\"><img src=\"modules/{$module_name}/images/read.gif\" border=0 alt=\"" . _READ . "\" title=\"" . _READ . "\"></a></td>", $row[jid], $row[title]);
                if ($row[aid] == $username) {
                    printf("<td align=center bgcolor={$bgcolor2}><a href=\"modules.php?name={$module_name}&file=modify&jid=%s\"><img src='modules/{$module_name}/images/edit.gif' border='0' alt=\"" . _EDIT . "\" title=\"" . _EDIT . "\"></a></td>", $row[jid], $row[title]);
                    printf("<td align=center bgcolor={$bgcolor2}><a href=\"modules.php?name={$module_name}&file=delete&jid=%s&forwhat={$forwhat}\"><img src='modules/{$module_name}/images/trash.gif' border='0' alt=\"" . _DELETE . "\" title=\"" . _DELETE . "\"></a></td>", $row[jid], $row[title]);
                } else {
                    //printf ("<td align=center bgcolor=$bgcolor2><a href=\"modules.php?name=$module_name&file=display&jid=%s\"><img src=\"modules/$module_name/images/read.gif\" border=0 alt=\""._READ."\" title=\""._READ."\"></a></td>", $row[jid], $row[title]);
                    //The follwing line made reference to non-existing field uname.//
                    printf("<td align=center bgcolor={$bgcolor2}><a href=\"modules.php?name=Your_Account&op=userinfo&username={$row['username']}\"><img src=\"modules/{$module_name}/images/nuke.gif\" border=\"0\" alt=\"" . _USERPROFILE2 . "\" title=\"" . _USERPROFILE2 . "\"></a></td>", $row[uid], $row[aid]);
                    /*
                    if ($username == "") {
                    			print ("<td align=center bgcolor=$bgcolor2><a href=\"modules.php?name=Your_Account\"><img src=\"modules/$module_name/images/folder.gif\" border=0 alt=\""._CREATEACCOUNT."\" title=\""._CREATEACCOUNT."\"></a></td>");
                    } elseif ($username != "" AND is_active("Private_Messages")) {
                    			printf ("<td align=center bgcolor=$bgcolor2><a href=\"modules.php?name=Private_Messages&mode=post&u=$row[user_id]\"><img src='modules/$module_name/images/chat.gif' border='0' alt='"._PRIVMSGJ2."'></a></td>", $row[aid], $row[aid]);
                    }
                    */
                }
            }
        }
        echo "</table>";
        if ($dcount == "") {
            $dcount = 0;
        }
        echo "<br><div align=center>{$dcount} " . _PUBLICFOR . " \"{$forwhat}\"</div>";
    }
    echo "</div>";
    CloseTable();
}
コード例 #3
0
        showAllThreadsUse();
    } elseif ($whatToDisplay == 1) {
        displayCategories($get);
    } elseif ($whatToDisplay == 2) {
        displayByViews();
    } elseif ($whatToDisplay == 3) {
        displayByRatings();
    } elseif ($whatToDisplay == 4) {
        removeOldLiveThreads();
        displayAllLiveThreads();
    } elseif ($whatToDisplay == 5) {
        displayViewsAndCategory($category);
    } elseif ($whatToDisplay == 6) {
        displayRateAndCategory($category);
    } elseif ($whatToDisplay == 7) {
        displaySearch($useTitle);
    }
    echo <<<_F
            
            
        </div>
    
        <script src='//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'></script>
        <script type='text/javascript' src='jquery.js'></script>
        <script src='menu.js'></script>
        <script src='filter.js'></script>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
        <script src='insideFilter.js'></script>
    </body>
    
</html>