Example #1
0
function _vereinteammatchlist($vid, $show = 'home')
{
    global $dbi;
    // step 1 collect the teams for this verein
    // step 2 for each team we collect the schedule and create click-rows to the matchsheet
    echo '<h3>Alle Vereins Teams und ihre Heim Spiele</h3>';
    $RS = DB_listTeams($dbi, 0, 0, "", 1, "", $vid);
    foreach ($RS as $row) {
        if ($show == 'home') {
            $MATCHLIST = DB_listMatches($dbi, 1, 0, $row[4], "", "", 1);
        } elseif ($show = 'away') {
            $MATCHLIST = DB_listMatches($dbi, 1, 0, $row[4], "", "", 0);
        } elseif ($show = 'all') {
            // this doesn't work ...
            $MATCHLIST = DB_listMatches($dbi, 1, 0, $row[4], "", "", "", "", "logic");
        }
        $aTH = array("Runde", "Datum", "Spielort", "Status", "", "Sets", "Legs", "Team", "Teamname");
        echo "<div class=\"sectionhead\">Team {$row['5']} in {$row['2']} (" . sizeof($MATCHLIST) . " Matches)</div><br/>";
        echo '<div class="child">';
        OpenTable();
        echo ArrayToTableHead($aTH);
        echo RecordsetToClickTable($MATCHLIST, 4, "ls_system.php?func=showmatch&vmkey=%P1%&eventid=%P2%", 3, 0);
        CloseTable();
        echo '</div><br/>';
    }
}
Example #2
0
function fc_wrap($id)
{
    global $xoopsDB, $xoopsConfig, $xoopsTheme, $xoopsOption;
    OpenTable();
    //query Database (returns an array)
    $fc_item = fc_query_db_on_id($id);
    //$id exists?
    if (isset($fc_item['adress']) && $fc_item['adress'] != "") {
        // include content
        $fc_include = XOOPS_ROOT_PATH . "/modules/cjaycontent/content/" . $fc_item['adress'];
        if (file_exists($fc_include)) {
            include $fc_include;
            // increment hitcounter (hits)
            $res = $xoopsDB->queryF("UPDATE " . $xoopsDB->prefix() . "_cjaycontent SET hits=hits+1 WHERE id=\"" . $id . "\"");
        } else {
            echo _CC_FILENOTFOUND . $fc_include;
        }
    } else {
        $fc_include = XOOPS_ROOT_PATH . "/modules/cjaycontent/content/DO_NOT_DELETE.php";
        if (file_exists($fc_include)) {
            include $fc_include;
            // increment hitcounter (hits)
            $res = $xoopsDB->queryF("UPDATE " . $xoopsDB->prefix() . "_cjaycontent SET hits=hits+1 WHERE id=\"" . $id . "\"");
        } else {
            echo _CC_FILENOTFOUND . $fc_include;
        }
    }
    CloseTable();
    return 1;
}
Example #3
0
function viewdownloadeditorial()
{
    global $downloadsprefix, $db;
    $lid = intval($_GET['lid']);
    include "header.php";
    downl_menu_tpl(1);
    $result = $db->sql_query("SELECT adminid, editorialtimestamp, editorialtext, editorialtitle FROM " . $downloadsprefix . "_editorials WHERE downloadid = {$lid}");
    $recordexist = $db->sql_numrows($result);
    $displaytitle = ereg_replace("_", " ", $ttitle);
    echo '<br />';
    OpenTable();
    echo "<center><font class=\"option\"><b>" . _DOWNLOADPROFILE . ": {$displaytitle}</b></font><br />";
    downl_infomenu_tpl($lid, $ttitle);
    if ($recordexist != 0) {
        while (list($adminid, $editorialtimestamp, $editorialtext, $editorialtitle) = $db->sql_fetchrow($result)) {
            ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $editorialtimestamp, $editorialtime);
            $editorialtime = strftime("%F", mktime($editorialtime[4], $editorialtime[5], $editorialtime[6], $editorialtime[2], $editorialtime[3], $editorialtime[1]));
            $date_array = explode("-", $editorialtime);
            $timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]);
            $formatted_date = date("F j, Y", $timestamp);
            echo "<br /><br />";
            OpenTable2();
            echo "<center><font class=\"option\"><b>'{$editorialtitle}'</b></font></center>" . "<center><font class=\"tiny\">" . _EDITORIALBY . " {$adminid} - {$formatted_date}</font></center><br /><br />" . "{$editorialtext}";
            CloseTable2();
        }
    } else {
        echo "<br /><br /><center><font class=\"option\"><b>" . _NOEDITORIAL . "</b></font></center>";
    }
    echo "<br /><br /><center>";
    downloadfooter($lid);
    echo "</center>";
    CloseTable();
    include "footer.php";
}
Example #4
0
 function hreferer()
 {
     global $bgcolor2, $prefix, $db, $admin_file;
     include "header.php";
     GraphicAdmin();
     OpenTable();
     echo "<center><font class=\"title\"><b>" . _HTTPREFERERS . "</b></font></center>";
     CloseTable();
     echo "<br>";
     OpenTable();
     echo "<center><b>" . _WHOLINKS . "</b></center><br><br>" . "<table border=\"0\" width=\"100%\">";
     $row = $db->sql_fetchrow($db->sql_query("SELECT httprefmode from " . $prefix . "_config"));
     $httprefmode = intval($row['httprefmode']);
     $result = $db->sql_query("SELECT rid, url from " . $prefix . "_referer");
     while ($row = $db->sql_fetchrow($result)) {
         $rid = intval($row['rid']);
         $url = filter($row['url'], "nohtml");
         $url2 = urlencode($url);
         $title = $url;
         if ($httprefmode == 1) {
             $url = explode("/", $url);
             $url = "http://{$url['2']}";
         }
         echo "<tr><td bgcolor=\"{$bgcolor2}\"><font class=\"content\">{$rid}</td>" . "<td bgcolor=\"{$bgcolor2}\"><font class=\"content\"><a href=\"index.php?url={$url2}\" target=\"_new\" title=\"{$title}\">{$url}</a></td></tr>";
     }
     echo "</table>" . "<form action=\"" . $admin_file . ".php\" method=\"post\">" . "<input type=\"hidden\" name=\"op\" value=\"delreferer\">" . "<center><input type=\"submit\" value=\"" . _DELETEREFERERS . "\"></center>";
     CloseTable();
     include "footer.php";
 }
Example #5
0
function show($mode, $tablelist, $query)
{
    global $db, $bgcolor2, $bgcolor3, $type, $dbname;
    require_once 'header.php';
    GraphicAdmin('_AMENU0');
    OpenTable();
    if ($query === null) {
        echo 'Mode: <b>' . $mode . '</b> not available yet';
        return;
    }
    if (count($tablelist)) {
        $result = $db->sql_query($query);
        $numfields = $db->sql_numfields($result);
        echo '<span class="genmed"><strong>' . _DATABASE . ':</strong> ' . $dbname . '</span><br /><br />Here are the results of your ' . strtolower($type) . '<br /><br />
		<table border="0" cellpadding="2"><tr bgcolor="' . $bgcolor2 . '">';
        for ($j = 0; $j < $numfields; $j++) {
            echo '<td><strong>' . $db->sql_fieldname($j, $result) . '</strong></td>';
        }
        echo '</tr>';
        $bgcolor = $bgcolor3;
        while ($row = $db->sql_fetchrow($result)) {
            $bgcolor = $bgcolor == '' ? ' bgcolor="' . $bgcolor3 . '"' : '';
            echo '<tr' . $bgcolor . '>';
            for ($j = 0; $j < $numfields; $j++) {
                echo '<td>' . $row[$j] . '</td>';
            }
            echo '</tr>';
        }
        echo '</table>';
    }
    CloseTable();
}
Example #6
0
function showfooter()
{
    echo '</td><td valign="top" align="right" width="150">
	<a href="' . URL::admin('&amp;mode=edit') . '">' . _EDITUSER . '</a><br />
	<a href="' . URL::admin('&amp;mode=add') . '">' . _ADDUSER . '</a>
	</td></tr></table>';
    CloseTable();
}
Example #7
0
function Choice()
{
    global $xoopsModule;
    xoops_cp_header();
    OpenTable();
    echo "<a href='" . XOOPS_URL . "/modules/system/admin.php?fct=preferences&op=showmod&mod=" . $xoopsModule->getVar('mid') . "'>" . _IMP_Edit . "</a><br />";
    CloseTable();
    xoops_cp_footer();
}
Example #8
0
function SiteSent($fname)
{
    include 'header.php';
    $fname = stripslashes(FixQuotes(check_html(removecrlf($fname))));
    OpenTable();
    echo "<center><font class=\"content\">" . _FREFERENCE . " {$fname}...<br><br>" . _THANKSREC . "</font></center>";
    CloseTable();
    include 'footer.php';
}
Example #9
0
function StorySent($title, $fname)
{
    include "header.php";
    $title = htmlspecialchars(urldecode(check_html($title, "nohtml")));
    $fname = htmlspecialchars(urldecode($fname));
    OpenTable();
    echo "<center><font class=\"content\">" . _FSTORY . " <b>{$title}</b> " . _HASSENT . " {$fname}... " . _THANKS . "</font></center>";
    CloseTable();
    include "footer.php";
}
function error_halt($msg)
{
    global $xoopsLogger;
    xoops_cp_header();
    include './mymenu.php';
    echo $xoopsLogger->dumpQueries();
    OpenTable();
    echo $msg;
    CloseTable();
    xoops_cp_footer();
}
Example #11
0
/**
 * Bayonet Content Management System
 * Copyright (C) 2008  Joseph Hunkeler
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
function ListModules()
{
    global $db;
    $result = $db->Query("SELECT dir_name, weight, status FROM bayonet_modules ORDER BY status DESC, weight ASC");
    $modules = $db->Fetch($result);
    OpenTable("50%");
    echo "<tr><th>Directory Name</th><th>Weight</th><th>Status</th></tr>";
    foreach ($modules as $module) {
        echo "<tr><td>" . $module['dir_name'] . "</td><td>" . $module['weight'] . "</td><td>" . $module['status'] . "</td></tr>";
    }
    CloseTable();
}
Example #12
0
function dropcomment($username, $onwhat, $mtime, $ndate)
{
    global $module_name;
    echo "<br>";
    OpenTable();
    echo "<div align=center class=title>" . _LEAVECOMMENT . "</div><br><br>";
    echo "<form action='modules.php?name={$module_name}&file=commentsave' method='post'><input type='hidden' name='rid' value='{$onwhat}'>";
    echo "<div align=center>" . _COMMENTBOX . ":<br><textarea name=\"comment\" wrap=virtual cols=55 rows=10></textarea><br><br><input type='submit' name='submit' value='" . _POSTCOMMENT . "'></div>";
    echo "</form><br>";
    echo "<center>" . _COMMENTSNOTE . "</center>";
    CloseTable();
}
Example #13
0
function ShowBlocks()
{
    echo "<td width=3></td>";
    echo "<td width=260>";
    OpenBlTable("Литература");
    include "blocks/bl-books.php";
    CloseTable();
    OpenBlTable("Статьи");
    include "blocks/articles.php";
    CloseTable();
    echo "</center>";
    echo "</td>";
}
Example #14
0
function f2go()
{
    include "header.php";
    OpenTable();
    echo "Addon Sample File (f2.php) CALLED FROM Sand_Journey Theme<br>";
    echo "<ul>";
    echo "<li><a href=\"modules.php?name=Addon_Sample&amp;file=f2&amp;func=f2one\">Function f2one</a>";
    echo "<li><a href=\"modules.php?name=Addon_Sample&amp;file=index&amp;func=dos\">Go to index.php</a>";
    echo "</ul>";
    echo "As you can see now, this page doesn't show the Right Blocks, this is because at the begining " . "of this file we set \$index variable to \"0\"";
    CloseTable();
    include "footer.php";
}
Example #15
0
function AddonSample()
{
    include "header.php";
    OpenTable();
    echo "Addon Sample File (index.php) CALLED FROM Sand_Journey Theme<br><br>";
    echo "<ul>";
    echo "<li><a href=\"modules.php?name=Addon_Sample&amp;file=index&amp;func=one\">Function One</a>";
    echo "<li><a href=\"modules.php?name=Addon_Sample&amp;file=index&amp;func=two\">Function Two</a>";
    echo "<li><a href=\"modules.php?name=Addon_Sample&amp;file=f2\">Call to file f2.php</a>";
    echo "</ul>";
    echo "You can now use Administration interface to activate or deactivate any module. As an Admin you can always " . "access to your Inactive modules for testing purpouses.";
    CloseTable();
    include "footer.php";
}
Example #16
0
function page_footer()
{
    echo "              </form>\n";
    echo "            </table>\n";
    echo "          </td>\n";
    echo "        </tr>\n";
    echo "      </table>\n";
    echo "    </td>\n";
    echo "  </tr>\n";
    echo "</table>\n";
    CloseTable();
    /* include ('footer.php'); */
    return;
}
Example #17
0
function viewdownloadcomments($lid, $ttitle)
{
    global $prefix, $dbi, $admin, $bgcolor2, $module_name;
    include "header.php";
    include "modules/{$module_name}/d_config.php";
    menu(1);
    echo "<br>";
    $result = sql_query("SELECT ratinguser, rating, ratingcomments, ratingtimestamp FROM " . $prefix . "_downloads_votedata WHERE ratinglid = {$lid} AND ratingcomments != '' ORDER BY ratingtimestamp DESC", $dbi);
    $totalcomments = sql_num_rows($result, $dbi);
    $transfertitle = ereg_replace("_", " ", $ttitle);
    $transfertitle = stripslashes($transfertitle);
    $displaytitle = $transfertitle;
    OpenTable();
    echo "<center><font class=\"option\"><b>" . _DOWNLOADPROFILE . ": {$displaytitle}</b></font><br><br>";
    downloadinfomenu($lid, $ttitle);
    echo "<br><br><br>" . _TOTALOF . " {$totalcomments} " . _COMMENTS . "</font></center><br>" . "<table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"450\">";
    $x = 0;
    while (list($ratinguser, $rating, $ratingcomments, $ratingtimestamp) = sql_fetch_row($result, $dbi)) {
        $ratingcomments = stripslashes($ratingcomments);
        ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $ratingtimestamp, $ratingtime);
        $ratingtime = strftime("%F", mktime($ratingtime[4], $ratingtime[5], $ratingtime[6], $ratingtime[2], $ratingtime[3], $ratingtime[1]));
        $date_array = explode("-", $ratingtime);
        $timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]);
        $formatted_date = date("F j, Y", $timestamp);
        /* Individual user information */
        $result2 = sql_query("SELECT rating FROM " . $prefix . "_downloads_votedata WHERE ratinguser = '******'", $dbi);
        $usertotalcomments = sql_num_rows($result2, $dbi);
        $useravgrating = 0;
        while (list($rating2) = sql_fetch_row($result2, $dbi)) {
            $useravgrating = $useravgrating + $rating2;
        }
        $useravgrating = $useravgrating / $usertotalcomments;
        $useravgrating = number_format($useravgrating, 1);
        echo "<tr><td bgcolor=\"{$bgcolor2}\">" . "<font class=\"content\"><b> " . _USER . ": </b><a href=\"{$nukeurl}/modules.php?name=Your_Account&amp;op=userinfo&amp;username={$ratinguser}\">{$ratinguser}</a></font>" . "</td>" . "<td bgcolor=\"{$bgcolor2}\">" . "<font class=\"content\"><b>" . _RATING . ": </b>{$rating}</font>" . "</td>" . "<td bgcolor=\"{$bgcolor2}\" align=\"right\">" . "<font class=\"content\">{$formatted_date}</font>" . "</td>" . "</tr>" . "<tr>" . "<td valign=\"top\">" . "<font class=\"tiny\">" . _USERAVGRATING . ": {$useravgrating}</font>" . "</td>" . "<td valign=\"top\" colspan=\"2\">" . "<font class=\"tiny\">" . _NUMRATINGS . ": {$usertotalcomments}</font>" . "</td>" . "</tr>" . "<tr>" . "<td colspan=\"3\">" . "<font class=\"content\">";
        if (is_admin($admin)) {
            echo "<a href=\"admin.php?op=DownloadsModDownload&amp;lid={$lid}\"><img src=\"modules/{$module_name}/images/editicon.gif\" border=\"0\" alt=\"" . _EDITTHISDOWNLOAD . "\"></a>";
        }
        echo " {$ratingcomments}</font>" . "<br><br><br></td></tr>";
        $x++;
    }
    echo "</table><br><br><center>";
    downloadfooter($lid, $ttitle);
    echo "</center>";
    CloseTable();
    include "footer.php";
}
Example #18
0
/**
 * Bayonet Content Management System
 * Copyright (C) 2008  Joseph Hunkeler
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
function ListAdmins()
{
    global $db;
    $result = $db->Query("SELECT `user_id`, `username`, `level` FROM `bayonet_users` ORDER BY `level` DESC, `username` ASC");
    $admins = $db->fetch($result);
    $num = 1;
    OpenTable("300px");
    echo "<tr><th></th><th style=\"text-align:left;\">Username</th><th style=\"text-align:left;\">Level</th></tr>";
    foreach ($admins as $admin) {
        if ($admin['level'] != $level) {
            $level = $admin['level'];
            echo "<tr><td colspan=\"3\"><hr /></td></tr>";
        }
        echo "<tr><td>{$num}.</td><td><a href=\"?op=admins&edit={$admin['user_id']}\">{$admin['username']}</a></td><td>{$admin['level']}</td></tr>";
        $num++;
    }
    CloseTable();
}
Example #19
0
function downl_menu_tpl($maindownload)
{
    global $user_adddownload, $module_name;
    OpenTable();
    $ThemeSel = get_theme();
    if (file_exists("themes/{$ThemeSel}/images/down-logo.gif")) {
        echo "<br /><div align=\"center\"><a href=\"" . getlink() . "\"><img src=\"themes/{$ThemeSel}/images/down-logo.gif\" border=\"0\" alt=\"\" /></a><br /><br />";
    } else {
        echo "<br /><div align=\"center\"><a href=\"" . getlink() . "\"><img src=\"modules/{$module_name}/images/down-logo.gif\" border=\"0\" alt=\"\" /></a><br /><br />";
    }
    echo "<form action=\"" . getlink("&amp;d_op=search") . "\" method=\"post\"><input type=\"text\" size=\"25\" name=\"query\" /> <input type=\"submit\" value=\"" . _SEARCH . "\" /></form>" . "<font class=\"content\">[ ";
    if ($maindownload > 0) {
        echo "<a href=\"" . getlink() . "\">" . _DOWNLOADSMAIN . "</a> | ";
    }
    if ($user_adddownload) {
        echo "<a href=\"" . getlink("&amp;d_op=AddDownload") . "\">" . _ADDDOWNLOAD . "</a> | ";
    }
    echo "<a href=\"" . getlink("&amp;d_op=NewDownloads") . "\">" . _NEW . "</a>" . " | <a href=\"" . getlink("&amp;d_op=MostPopular") . "\">" . _POPULAR . "</a>" . " | <a href=\"" . getlink("&amp;d_op=TopRated") . "\">" . _TOPRATED . "</a> ]" . "</font></div>";
    CloseTable();
}
Example #20
0
function foot()
{
    global $prefix, $user_prefix, $db, $index, $user, $cookie, $storynum, $user, $cookie, $Default_Theme, $foot1, $foot2, $foot3, $foot4, $home, $module, $name;
    if ($home == 1) {
        blocks(Down);
    }
    if ($module == 1 and file_exists("modules/{$name}/copyright.php")) {
        $cpname = ereg_replace("_", " ", $name);
        echo "<div align=\"right\"><a href=\"javascript:openwindow()\">{$cpname} &copy;</a></div>";
    }
    if ($module == 1 and file_exists("modules/{$name}/admin/panel.php")) {
        echo "<br>";
        OpenTable();
        include "modules/{$name}/admin/panel.php";
        CloseTable();
    }
    themefooter();
    echo "</body>\n" . "</html>";
    die;
}
function viewdownloadeditorial($lid, $ttitle)
{
    global $prefix, $dbi, $admin, $module_name;
    include "header.php";
    include "modules/{$module_name}/d_config.php";
    menu(1);
    $result = sql_query("SELECT adminid, editorialtimestamp, editorialtext, editorialtitle FROM " . $prefix . "_downloads_editorials WHERE downloadid = {$lid}", $dbi);
    $recordexist = sql_num_rows($result, $dbi);
    $transfertitle = ereg_replace("_", " ", $ttitle);
    $transfertitle = stripslashes($transfertitle);
    $displaytitle = $transfertitle;
    echo "<br>";
    OpenTable();
    echo "<center><font class=\"option\"><b>" . _DOWNLOADPROFILE . ": {$displaytitle}</b></font><br>";
    downloadinfomenu($lid, $ttitle);
    if ($recordexist != 0) {
        while (list($adminid, $editorialtimestamp, $editorialtext, $editorialtitle) = sql_fetch_row($result, $dbi)) {
            $editorialtitle = stripslashes($editorialtitle);
            $editorialtext = stripslashes($editorialtext);
            ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $editorialtimestamp, $editorialtime);
            $editorialtime = strftime("%F", mktime($editorialtime[4], $editorialtime[5], $editorialtime[6], $editorialtime[2], $editorialtime[3], $editorialtime[1]));
            $date_array = explode("-", $editorialtime);
            $timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]);
            $formatted_date = date("F j, Y", $timestamp);
            echo "<br><br>";
            OpenTable2();
            echo "<center><font class=\"option\"><b>'{$editorialtitle}'</b></font></center>" . "<center><font class=\"tiny\">" . _EDITORIALBY . " {$adminid} - {$formatted_date}</font></center><br><br>" . "{$editorialtext}";
            CloseTable2();
        }
    } else {
        echo "<br><br><center><font class=\"option\"><b>" . _NOEDITORIAL . "</b></font></center>";
    }
    echo "<br><br><center>";
    downloadfooter($lid, $ttitle);
    echo "</center>";
    CloseTable();
    include "footer.php";
}
Example #22
0
function foot()
{
    global $prefix, $user_prefix, $db, $index, $user, $cookie, $storynum, $user, $cookie, $Default_Theme, $foot1, $foot2, $foot3, $foot4, $home, $name, $admin, $commercial_license;
    if (defined('HOME_FILE')) {
        blocks("Down");
    }
    if (basename($_SERVER['PHP_SELF']) != "index.php" and defined('MODULE_FILE') and file_exists("modules/{$name}/copyright.php") && $commercial_license != 1) {
        $cpname = str_replace("_", " ", $name);
        echo "<div align=\"right\"><a href=\"javascript:openwindow()\">{$cpname} &copy;</a></div>";
    }
    if (basename($_SERVER['PHP_SELF']) != "index.php" and defined('MODULE_FILE') and file_exists("modules/{$name}/admin/panel.php") && is_admin($admin)) {
        echo "<br>";
        OpenTable();
        include "modules/{$name}/admin/panel.php";
        CloseTable();
    }
    themefooter();
    if (file_exists("includes/custom_files/custom_footer.php")) {
        include_secure("includes/custom_files/custom_footer.php");
    }
    echo "</body>\n</html>";
    ob_end_flush();
    die;
}
function startjournal($sitename, $user)
{
    global $module_name;
    if (is_user($user)) {
        $j_user1 = "<center>[ <a href=\"modules.php?name={$module_name}\">" . _JOURNALDIR . "</a> | <a href=\"modules.php?name={$module_name}&file=edit\">" . _YOURJOURNAL . "</a> ]</center>";
        $j_user2 = "";
    } else {
        $j_user1 = "<center>[ <a href=\"modules.php?name={$module_name}\">" . _JOURNALDIR . "</a> | <a href=\"modules.php?name=Your_Account&op=new_user\">" . _CREATEACCOUNT . "</a> ]</center>";
        $j_user2 = "<br><center><font class=\"tiny\">" . _MEMBERSCAN . "</font></center>";
    }
    title("{$sitename}: " . _USERSJOURNAL . "");
    if (is_user($user)) {
        include "modules/Your_Account/navbar.php";
        OpenTable();
        nav();
        CloseTable();
        echo "<br>";
    }
    OpenTable();
    echo "<center><img src=modules/{$module_name}/images/bgimage.gif><br><font class=title><b>" . _USERSJOURNAL . "</b></font></center>";
    echo "{$j_user1}";
    echo "{$j_user2}";
    CloseTable();
}
Example #24
0
            $reads = $reads + $ccounter;
        }
        title($topictext);
        echo "<table border=\"1\" width=\"100%\" align=\"center\" cellpadding=\"2\">\n" . "<tr><td valign=\"top\" width='25%'>\n" . "<a href=\"modules.php?name=News&amp;new_topic={$topicid}\"><img src=\"{$t_image}\" border=\"0\" alt=\"{$topictext}\" title=\"{$topictext}\" hspace='5' vspace='5'></a><br><br>\n" . "<font class=\"content\">\n" . "<big><strong>&middot;</strong></big>&nbsp;<b>" . _TOPIC . ":</b> {$topictext}<br>\n" . "<big><strong>&middot;</strong></big>&nbsp;<b>" . _TOTNEWS . ":</b> {$numrows}<br>\n" . "<big><strong>&middot;</strong></big>&nbsp;<b>" . _TOTREADS . ":</b> {$reads}</font>\n" . "</td>\n" . "<td valign='top'>";
        $result2 = $db->sql_query("SELECT sid, catid, title FROM " . $prefix . "_stories WHERE topic='{$topicid}' ORDER BY sid DESC LIMIT 0,10");
        $num = $db->sql_numrows($result2);
        if ($num != 0) {
            while ($row2 = $db->sql_fetchrow($result2)) {
                $sid = intval($row2['sid']);
                $catid = intval($row2['catid']);
                $title = stripslashes(check_html($row2['title'], "nohtml"));
                $row3 = $db->sql_fetchrow($db->sql_query("SELECT title FROM " . $prefix . "_stories_cat WHERE catid='{$catid}'"));
                $rtitle = stripslashes(check_html($row3['title'], "nohtml"));
                if ($catid == 0) {
                    $cat_link = "";
                } else {
                    $cat_link = "<a href='modules.php?name=News&file=categories&op=newindex&catid={$catid}'><b>{$rtitle}</b></a>: ";
                }
                echo "<img src='modules/{$module_name}/images/arrow.gif' border='0' alt='' title=''>&nbsp;&nbsp;{$cat_link}<a href='modules.php?name=News&file=article&sid={$sid}{$r_options}'>{$title}</a><br>";
            }
            if ($num == 10) {
                echo "<div align='right'><big><strong>&middot;</strong></big>&nbsp;<a href='modules.php?name=News&new_topic={$topicid}'><b>" . _MORE . " --></b></a>&nbsp;&nbsp;</div>";
            }
        } else {
            echo "<i>" . _NONEWSYET . "</i>";
        }
        echo "</td></tr></table><br><br>";
    }
}
CloseTable();
include "footer.php";
Example #25
0
function ratedownload()
{
    global $userinfo;
    $lid = intval($_REQUEST['lid']);
    include "header.php";
    downl_menu_tpl(1);
    echo '<br />';
    OpenTable();
    $displaytitle = ereg_replace("_", " ", $ttitle);
    $ip = $_SERVER["REMOTE_HOST"];
    if (empty($ip)) {
        $ip = $_SERVER["REMOTE_ADDR"];
    }
    echo "<b>{$displaytitle}</b>" . "<ul><font class=\"content\">" . "<li>" . _RATENOTE1 . "<li>" . _RATENOTE2 . "<li>" . _RATENOTE3 . "<li>" . _DRATENOTE4 . "<li>" . _RATENOTE5;
    if (is_user()) {
        echo "<li>" . _YOUAREREGGED . "<li>" . _FEELFREE2ADD;
        $auth_name = $userinfo['username'];
    } else {
        echo "<li>" . _YOUARENOTREGGED . "<li>" . _IFYOUWEREREG;
        $auth_name = $anonymous;
    }
    echo "</ul>" . "<form method=\"post\" action=\"" . getlink() . "\">" . "<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" width=\"100%\">" . "<tr><td width=\"25\" nowrap></td>" . "<tr><td width=\"25\" nowrap></td><td width=\"550\">" . "<input type=\"hidden\" name=\"ratinglid\" value=\"{$lid}\" />" . "<input type=\"hidden\" name=\"ratinguser\" value=\"{$auth_name}\" />" . "<input type=\"hidden\" name=\"ratinghost_name\" value=\"{$ip}\" />" . "<font class=content>" . _RATETHISSITE . "" . "<select name=\"rating\">" . "<option>--</option>" . "<option>10</option>" . "<option>9</option>" . "<option>8</option>" . "<option>7</option>" . "<option>6</option>" . "<option>5</option>" . "<option>4</option>" . "<option>3</option>" . "<option>2</option>" . "<option>1</option>" . "</select></font>" . "<font class=\"content\"><input type=\"submit\" value=\"" . _RATETHISSITE . "\" /></font>" . "<br /><br />";
    if (is_user()) {
        echo "<b>" . _SCOMMENTS . ":</b><br /><textarea wrap=\"virtual\" cols=\"50\" rows=\"10\" name=\"ratingcomments\"></textarea><br /><br /><br /></font>";
    } else {
        echo "<input type=\"hidden\" name=\"ratingcomments\" value=\"\" />";
    }
    echo "</td></tr></table></form>";
    echo "<center>";
    downloadfooterchild($lid);
    echo "</center>";
    CloseTable();
    include "footer.php";
}
Example #26
0
function client_report($cid, $bid)
{
    global $prefix, $db, $module_name, $client, $sitename;
    if (!is_client($client)) {
        Header("Location: modules.php?name={$module_name}&op=client");
        die;
    } else {
        $client = base64_decode($client);
        $client = addslashes($client);
        $client = explode(":", $client);
        $client_id = $client[0];
        if ($cid != $client_id) {
            include "header.php";
            title("{$sitename}: " . _ADSYSTEM . "");
            OpenTable();
            echo "<center>" . _FUNCTIONSNOTALLOWED . "<br><br>" . _GOBACK . "</center>";
            CloseTable();
            themenu();
            include "footer.php";
            die;
        } else {
            include "header.php";
            title("{$sitename}: " . _ADSYSTEM . "");
            OpenTable();
            $bid = intval($bid);
            $cid = intval($cid);
            $sql = "SELECT name, email FROM " . $prefix . "_banner_clients WHERE cid='{$cid}'";
            $result = $db->sql_query($sql);
            $row = $db->sql_fetchrow($result);
            $name = htmlentities($row['name']);
            $email = $row['email'];
            if ($email == "") {
                echo "<center><br><br>" . "<b>" . _STATSNOTSEND . "</b><br><br>" . "<a href=\"javascript:history.go(-1)\">" . _GOBACK . "</a>";
                CloseTable();
                themenu();
                include "footer.php";
                die;
            } else {
                $sql2 = "SELECT bid, name, imptotal, impmade, clicks, imageurl, clickurl, date, ad_class FROM " . $prefix . "_banner WHERE bid='{$bid}' AND cid='{$cid}'";
                $result2 = $db->sql_query($sql2);
                $row2 = $db->sql_fetchrow($result2);
                $bid = $row2['bid'];
                $bid = intval($bid);
                $imptotal = $row2['imptotal'];
                $imptotal = intval($imptotal);
                $impmade = $row2['impmade'];
                $impmade = intval($impmade);
                $clicks = $row2['clicks'];
                $clicks = intval($clicks);
                $imageurl = $row2['imageurl'];
                $clickurl = $row2['clickurl'];
                $date = $row2['date'];
                if ($impmade == 0) {
                    $percent = 0;
                } else {
                    $percent = substr(100 * $clicks / $impmade, 0, 5);
                }
                if ($imptotal == 0) {
                    $left = _UNLIMITED;
                    $imptotal = _UNLIMITED;
                } else {
                    $left = $imptotal - $impmade;
                }
                $fecha = date("F jS Y, h:iA.");
                $subject = "" . _YOURSTATS . " {$sitename}";
                if (empty($row2['ad_class']) || $row2['ad_class'] == "image") {
                    $message = "" . _FOLLOWINGSTATS . " {$sitename}:\n\n\n" . _CLIENTNAME . ": {$name}\n" . _BANNERID . ": {$bid}\n" . _BANNERNAME . ": " . $row['name'] . "\n" . _BANNERIMAGE . ": {$imageurl}\n" . _BANNERURL . ": {$clickurl}\n\n" . _IMPPURCHASED . ": {$imptotal}\n" . _IMPREMADE . ": {$impmade}\n" . _IMPRELEFT . ": {$left}\n" . _RECEIVEDCLICKS . ": {$clicks}\n" . _CLICKSPERCENT . ": {$percent}%\n\n\n" . _GENERATEDON . ": {$fecha}";
                } elseif ($row2['ad_class'] == "flash") {
                    $message = "" . _FOLLOWINGSTATS . " {$sitename}:\n\n\n" . _CLIENTNAME . ": {$name}\n" . _BANNERID . ": {$bid}\n" . _BANNERNAME . ": " . $row['name'] . "\n" . _FLASHMOVIE . ": {$imageurl}\n\n" . _IMPPURCHASED . ": {$imptotal}\n" . _IMPREMADE . ": {$impmade}\n" . _IMPRELEFT . ": {$left}\n" . _RECEIVEDCLICKS . ": N/A\n" . _CLICKSPERCENT . ": N/A\n\n\n" . _GENERATEDON . ": {$fecha}";
                } elseif ($row2['ad_class'] == "code") {
                    $message = "" . _FOLLOWINGSTATS . " {$sitename}:\n\n\n" . _CLIENTNAME . ": {$name}\n" . _BANNERID . ": {$bid}\n" . _BANNERNAME . ": " . $row['name'] . "\n\n" . _IMPPURCHASED . ": {$imptotal}\n" . _IMPREMADE . ": {$impmade}\n" . _IMPRELEFT . ": {$left}\n" . _RECEIVEDCLICKS . ": N/A\n" . _CLICKSPERCENT . ": N/A\n\n\n" . _GENERATEDON . ": {$fecha}";
                }
                $from = "{$sitename}";
                mail($email, $subject, $message, "From: {$from}\nX-Mailer: PHP/" . phpversion());
                echo "<center><br><br><br>" . "<b>" . _STATSSENT . " {$email}</b><br><br>" . "[ <a href=\"javascript:history.go(-1)\">" . _GOBACK . "</a> ]";
                CloseTable();
                themenu();
                include "footer.php";
            }
        }
    }
}
Example #27
0
 function module_edit($mid)
 {
     global $prefix, $db;
     $main_m = $db->sql_fetchrow($db->sql_query("SELECT main_module from " . $prefix . "_main"));
     $main_module = $main_m['main_module'];
     $mid = intval($mid);
     $row = $db->sql_fetchrow($db->sql_query("SELECT title, custom_title, view, inmenu, mod_group from " . $prefix . "_modules where mid='{$mid}'"));
     $title = $row['title'];
     $custom_title = $row['custom_title'];
     $view = intval($row['view']);
     $inmenu = intval($row['inmenu']);
     $mod_group = intval($row['mod_group']);
     include "header.php";
     GraphicAdmin();
     title("" . _MODULEEDIT . "");
     OpenTable();
     if ($view == 0) {
         $sel1 = "selected";
         $sel2 = "";
         $sel3 = "";
         $sel4 = "";
     } elseif ($view == 1) {
         $sel1 = "";
         $sel2 = "selected";
         $sel3 = "";
         $sel4 = "";
     } elseif ($view == 2) {
         $sel1 = "";
         $sel2 = "";
         $sel3 = "selected";
         $sel4 = "";
     } elseif ($view == 3) {
         $sel1 = "";
         $sel2 = "";
         $sel3 = "";
         $sel4 = "selected";
     }
     if ($title == $main_module) {
         $a = " - " . _INHOME . "";
     } else {
         $a = "";
     }
     if ($inmenu == 1) {
         $insel1 = "checked";
         $insel2 = "";
     } elseif ($inmenu == 0) {
         $insel1 = "";
         $insel2 = "checked";
     }
     echo "<center><b>" . _CHANGEMODNAME . "</b><br>({$title}{$a})</center><br><br>" . "<form action=\"admin.php\" method=\"post\">" . "<table border=\"0\"><tr><td>" . "" . _CUSTOMMODNAME . "</td><td>" . "<input type=\"text\" name=\"custom_title\" value=\"{$custom_title}\" size=\"50\"></td></tr>";
     if ($title == $main_module) {
         echo "<input type=\"hidden\" name=\"view\" value=\"0\">" . "<input type=\"hidden\" name=\"inmenu\" value=\"{$inmenu}\">" . "</table><br><br>";
     } else {
         echo "<tr><td>" . _VIEWPRIV . "</td><td><select name=\"view\">" . "<option value=\"0\" {$sel1}>" . _MVALL . "</option>" . "<option value=\"1\" {$sel2}>" . _MVUSERS . "</option>" . "<option value=\"2\" {$sel3}>" . _MVADMIN . "</option>" . "<option value=\"3\" {$sel4}>" . _SUBUSERS . "</option>" . "</select></td></tr>";
         $numrow = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_groups"));
         if ($numrow > 0) {
             echo "<tr><td>" . _UGROUP . "</td><td><select name=\"mod_group\">";
             $result2 = $db->sql_query("SELECT id, name FROM " . $prefix . "_groups");
             while ($row2 = $db->sql_fetchrow($result2)) {
                 if ($row2[id] == $mod_group) {
                     $gsel = "selected";
                 } else {
                     $gsel = "";
                 }
                 if ($dummy != 1) {
                     if ($mod_group == 0) {
                         $ggsel = "selected";
                     } else {
                         $ggsel = "";
                     }
                     echo "<option value=\"0\" {$ggsel}>" . _NONE . "</option>";
                     $dummy = 1;
                 }
                 echo "<option value=\"{$row2['id']}\" {$gsel}>{$row2['name']}</option>";
                 $gsel = "";
             }
             echo "</select>&nbsp;<i>(" . _VALIDIFREG . ")</i></td></tr>";
         } else {
             echo "<input type=\"hidden\" name=\"mod_group\" value=\"0\">";
         }
         echo "<tr><td>" . _SHOWINMENU . "</td><td>" . "<input type=\"radio\" name=\"inmenu\" value=\"1\" {$insel1}> " . _YES . " &nbsp;&nbsp; <input type=\"radio\" name=\"inmenu\" value=\"0\" {$insel2}> " . _NO . "" . "</td></tr></table><br><br>";
     }
     if ($title != $main_module) {
     }
     echo "<input type=\"hidden\" name=\"mid\" value=\"{$mid}\">" . "<input type=\"hidden\" name=\"op\" value=\"module_edit_save\">" . "<input type=\"submit\" value=\"" . _SAVECHANGES . "\">" . "</form>" . "<br><br><center>" . _GOBACK . "</center>";
     CloseTable();
     include "footer.php";
 }
Example #28
0
function show_all($min)
{
    global $prefix, $user_prefix, $db, $bgcolor1, $bgcolor2, $user, $cookie, $sitename, $multilingual, $language, $module_name;
    if (!isset($min)) {
        $min = 0;
    }
    $max = 250;
    include "header.php";
    title("" . _STORIESARCHIVE . "");
    title("{$sitename}: " . _ALLSTORIESARCH . "");
    if (isset($cookie[4])) {
        $r_options .= "&amp;mode={$cookie['4']}";
    }
    if (isset($cookie[5])) {
        $r_options .= "&amp;order={$cookie['5']}";
    }
    if (isset($cookie[6])) {
        $r_options .= "&amp;thold={$cookie['6']}";
    }
    OpenTable();
    echo "<table border=\"0\" width=\"100%\"><tr>" . "<td bgcolor=\"{$bgcolor2}\" align=\"left\"><b>" . _ARTICLES . "</b></td>" . "<td bgcolor=\"{$bgcolor2}\" align=\"center\"><b>" . _COMMENTS . "</b></td>" . "<td bgcolor=\"{$bgcolor2}\" align=\"center\"><b>" . _READS . "</b></td>" . "<td bgcolor=\"{$bgcolor2}\" align=\"center\"><b>" . _USCORE . "</b></td>" . "<td bgcolor=\"{$bgcolor2}\" align=\"center\"><b>" . _DATE . "</b></td>" . "<td bgcolor=\"{$bgcolor2}\" align=\"center\"><b>" . _ACTIONS . "</b></td></tr>";
    $result = $db->sql_query("SELECT sid, catid, title, time, comments, counter, topic, alanguage, score, ratings from " . $prefix . "_stories order by sid DESC limit {$min},{$max}");
    $numrows = $db->sql_numrows($db->sql_query("select * from " . $prefix . "_stories"));
    while ($row = $db->sql_fetchrow($result)) {
        $sid = intval($row['sid']);
        $catid = intval($row['catid']);
        $title = stripslashes(check_html($row['title'], "nohtml"));
        $time = $row['time'];
        $comments = stripslashes($row['comments']);
        $counter = intval($row['counter']);
        $topic = intval($row['topic']);
        $alanguage = $row['alanguage'];
        $score = intval($row['score']);
        $ratings = intval($row['ratings']);
        $time = explode(" ", $time);
        $actions = "<a href=\"modules.php?name=News&amp;file=print&amp;sid={$sid}\"><img src=\"images/print.gif\" border=0 alt=\"" . _PRINTER . "\" title=\"" . _PRINTER . "\" width=\"15\" height=\"11\"></a>&nbsp;<a href=\"modules.php?name=News&amp;file=friend&amp;op=FriendSend&amp;sid={$sid}\"><img src=\"images/friend.gif\" border=0 alt=\"" . _FRIEND . "\" title=\"" . _FRIEND . "\" width=\"15\" height=\"11\"></a>";
        if ($score != 0) {
            $rated = substr($score / $ratings, 0, 4);
        } else {
            $rated = 0;
        }
        if ($catid == 0) {
            $title = "<a href=\"modules.php?name=News&amp;file=article&amp;sid={$sid}{$r_options}\">{$title}</a>";
        } elseif ($catid != 0) {
            $row_res = $db->sql_fetchrow($db->sql_query("SELECT title from " . $prefix . "_stories_cat where catid='{$catid}'"));
            $cat_title = stripslashes($row_res['title']);
            $title = "<a href=\"modules.php?name=News&amp;file=categories&amp;op=newindex&amp;catid={$catid}\"><i>{$cat_title}</i></a>: <a href=\"modules.php?name=News&amp;file=article&amp;sid={$sid}{$r_options}\">{$title}</a>";
        }
        if ($multilingual == 1) {
            if ($alanguage == "") {
                $alanguage = $language;
            }
            $alt_language = ucfirst($alanguage);
            $lang_img = "<img src=\"images/language/flag-{$alanguage}.png\" border=\"0\" hspace=\"2\" alt=\"{$alt_language}\" title=\"{$alt_language}\">";
        } else {
            $lang_img = "<strong><big><b>&middot;</b></big></strong>";
        }
        echo "<tr>" . "<td bgcolor=\"{$bgcolor1}\" align=\"left\">{$lang_img} {$title}</td>" . "<td bgcolor=\"{$bgcolor1}\" align=\"center\">{$comments}</td>" . "<td bgcolor=\"{$bgcolor1}\" align=\"center\">{$counter}</td>" . "<td bgcolor=\"{$bgcolor1}\" align=\"center\">{$rated}</td>" . "<td bgcolor=\"{$bgcolor1}\" align=\"center\">{$time['0']}</td>" . "<td bgcolor=\"{$bgcolor1}\" align=\"center\">{$actions}</td></tr>";
    }
    echo "</table>" . "<br><br><br>";
    if ($numrows > 250 and $min == 0) {
        $min = $min + 250;
        $a++;
        echo "<center>[ <a href=\"modules.php?name={$module_name}&amp;sa=show_all&amp;min={$min}\">" . _NEXTPAGE . "</a> ]</center><br>";
    }
    if ($numrows > 250 and $min >= 250 and $a != 1) {
        $pmin = $min - 250;
        $min = $min + 250;
        $a++;
        echo "<center>[ <a href=\"modules.php?name={$module_name}&amp;sa=show_all&amp;min={$pmin}\">" . _PREVIOUSPAGE . "</a> | <a href=\"modules.php?name={$module_name}&amp;sa=show_all&amp;min={$min}\">" . _NEXTPAGE . "</a> ]</center><br>";
    }
    if ($numrows <= 250 and $a != 1 and $min != 0) {
        $pmin = $min - 250;
        echo "<center>[ <a href=\"modules.php?name={$module_name}&amp;sa=show_all&amp;min={$pmin}\">" . _PREVIOUSPAGE . "</a> ]</center><br>";
    }
    echo "<hr size=\"1\" noshade>" . "<font class=\"content\">" . _SELECTMONTH2VIEW . "</font><br>";
    $result2 = $db->sql_query("SELECT time from " . $prefix . "_stories order by time DESC");
    echo "<ul>";
    while ($row2 = $db->sql_fetchrow($result2)) {
        $time = $row2['time'];
        ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $getdate);
        if ($getdate[2] == "01") {
            $month = _JANUARY;
        } elseif ($getdate[2] == "02") {
            $month = _FEBRUARY;
        } elseif ($getdate[2] == "03") {
            $month = _MARCH;
        } elseif ($getdate[2] == "04") {
            $month = _APRIL;
        } elseif ($getdate[2] == "05") {
            $month = _MAY;
        } elseif ($getdate[2] == "06") {
            $month = _JUNE;
        } elseif ($getdate[2] == "07") {
            $month = _JULY;
        } elseif ($getdate[2] == "08") {
            $month = _AUGUST;
        } elseif ($getdate[2] == "09") {
            $month = _SEPTEMBER;
        } elseif ($getdate[2] == "10") {
            $month = _OCTOBER;
        } elseif ($getdate[2] == "11") {
            $month = _NOVEMBER;
        } elseif ($getdate[2] == "12") {
            $month = _DECEMBER;
        }
        if ($month != $thismonth) {
            $year = $getdate[1];
            echo "<li><a href=\"modules.php?name={$module_name}&amp;sa=show_month&amp;year={$year}&amp;month={$getdate['2']}&amp;month_l={$month}\">{$month}, {$year}</a>";
            $thismonth = $month;
        }
    }
    echo "</ul><br><br><center>" . "<form action=\"modules.php?name=Search\" method=\"post\">" . "<input type=\"text\" name=\"query\" size=\"30\">&nbsp;" . "<input type=\"submit\" value=\"" . _SEARCH . "\">" . "</form>" . "[ <a href=\"modules.php?name={$module_name}\">Stories Archive Index</a> ]</center>";
    CloseTable();
    include "footer.php";
}
Example #29
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();
}
Example #30
0
/**
	# this calculates the ranking points of all players who belong
	# to a specific LEAGUE-Group $fedagroup FEDA (MIXED or DAMEN)
	# a) retrieve all legs belonging to this listnumber form all events for the specified period
	# b) check on legacy table and include data
	# v2.6 incl current league in report
	*	v3 changed to fit into ls_statsadmin - produce minimal output ...
	*	v4 changed and removed the team - event strings ...
	*			includes all events of this statgroup not only active events
	* v5  extended by the API_RS model
	* v5 reM: works only on 501 legs !!
	**/
function generateStaticFEDAStatisticEntries($feda_stat_group, $indexdate, $writeToDB = 'no')
{
    global $user, $dbi;
    $fromdate = fnc_date_calc($indexdate, -365);
    /*
     * Rangliste berechnet aus allen Spielen von $fromdate bis $indexdate
     * we query after all players from all events belonging to this statgroup ...
     * this returns really ALL players who have ever played in this group (active + non-active events ..)
     * No sense to include the teams+events here, since there could be multiple ...
     * this returns multiple records for each player ....
     */
    $RS = DB_listEventStatGroupPlayers($dbi, $feda_stat_group);
    $aTH = array("Vorname", "Nachname", "Scorezahl", "Checkzahl", "Gesamtzahl", "Legs", "Spiele");
    debug("Calculating actual stat values for " . count($RS) . " Players");
    OpenTable();
    echo ArrayToTableHead($aTH);
    foreach ($RS as $p) {
        #
        # get legs per player - calc - and sum up, att. here we can have multiple player entries
        #	the recordset is sorted by PID ...
        #
        $sumScore = 0;
        $sumCheck = 0;
        $CountScore = 0;
        $CountCheck = 0;
        $scoreindex = 0;
        $checkindex = 0;
        #######################
        # LEGACY data from pre system times
        #######################
        $legqry = "select lxid,lxdate,lxrscore,lxrest,lxrcheck from tbllegx where lxpid={$p['0']} and lxevlist={$feda_stat_group} and lxdate<'{$indexdate}' and lxdate>'{$fromdate}' and lxrscore>0 order by lxdate asc";
        $Lrecord = sql_query($legqry, $dbi);
        while (list($lxid, $lxdate, $lxrscore, $lxrest, $lxrcheck) = sql_fetch_row($Lrecord, $dbi)) {
            $idx = "";
            $idx = retFEDAIndexZahlperLeg(501, $lxrscore, $lxrest, $lxrcheck, $iTEST);
            list($a, $b, $c) = split(":", $idx);
            # values of -1 indicate failure
            if ($a > -1) {
                $sumScore = $sumScore + $a;
                $CountScore = $CountScore + 1;
            }
            if ($b > -1) {
                $sumCheck = $sumCheck + $b;
                $CountCheck = $CountCheck + 1;
            }
        }
        #######################
        # structured data from League-System
        #######################
        $LEGS = DB_listLegsFromPeriod($dbi, 0, 0, $feda_stat_group, $fromdate, $indexdate, $p[0]);
        #debug(count($LEGS));
        # lid,lroundscore,lscore,lroundcheck,gid,mid,mround,mdate ##
        $gamecount = 0;
        $lastgid = 0;
        foreach ($LEGS as $L) {
            if ($lastgid != $L[4]) {
                $gamecount = $gamecount + 1;
            }
            $idx = "";
            $idx = retFEDAIndexZahlperLeg(501, $L[1], 501 - $L[2], $L[3]);
            list($a, $b, $c) = split(":", $idx);
            # values of -1 indicate failure
            if ($a > -1) {
                $sumScore = $sumScore + $a;
                $CountScore = $CountScore + 1;
            }
            if ($b > -1) {
                $sumCheck = $sumCheck + $b;
                $CountCheck = $CountCheck + 1;
            }
            $lastgid = $L[4];
        }
        /*
         * calculate index by division with countvalues
         */
        if ($CountScore > 0) {
            $scoreindex = $sumScore / $CountScore;
        }
        if ($CountCheck > 0) {
            $checkindex = $sumCheck / $CountCheck;
        }
        /*
         * Finally Output into TABLEROW or OUTVAR
         */
        /*
         * V3.1 change, since we have ALL players here we have a lot of cases where no actual statval is compiled in this case its zero and
         * we cont store anything ..
         */
        if ($gamecount > 0) {
            echo "<tr><td>{$p['1']}</td><td>{$p['2']}</td><td>" . number_format($scoreindex, 2, '.', '') . "</td><td>" . number_format($checkindex, 2, '.', '') . "</td><td>" . number_format($scoreindex + $checkindex, 2, '.', '') . "</td><td>{$CountScore}</td><td>{$gamecount}</td></tr>";
            if ($writeToDB == 'yes') {
                $qry = "insert into tblstat(statid,statdate,statcode,statval,statpid,statgames,statlegs) values(0,'{$indexdate}',{$feda_stat_group}," . number_format($scoreindex + $checkindex, 2, '.', '') . ",{$p['0']},{$gamecount},{$CountScore})";
                $res = sql_query($qry, $dbi);
            }
        } else {
            echo "<tr style=\"color:#ff0000;\"><td>{$p['1']}</td><td>{$p['2']}</td><td>NO DATA</td><td>NO DATA</td><td>NO DATA</td><td></td><td></td></tr>";
        }
    }
    #//  END FOR EACH PLAYER
    CloseTable();
}