示例#1
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';
}
示例#2
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";
}
示例#3
0
 function view_login()
 {
     if (!isset($_SESSION['userName'])) {
         $error = isset($_GET['msg']) ? check_html($_GET['msg']) : "";
         $this->smarty->assign('error', $error);
         $this->smarty->display('login.htm');
     } else {
         $ref = empty($_GET['ref']) ? "" : rawurldecode($_GET['ref']);
         if (empty($ref)) {
             redirect_to(C('USER_GO_URL'));
         } else {
             redirect_to($ref);
         }
     }
 }
示例#4
0
function ShowFaqAll($id_cat)
{
    global $bgcolor2, $prefix, $db, $module_name;
    $id_cat = intval($id_cat);
    echo "<table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\" border=\"0\">" . "<tr bgcolor=\"{$bgcolor2}\"><td colspan=\"2\"><font class=\"option\"><b>" . _ANSWER . "</b></font></td></tr>";
    $id_cat = intval($id_cat);
    $result = $db->sql_query("SELECT id, id_cat, question, answer FROM " . $prefix . "_faqanswer WHERE id_cat='{$id_cat}'");
    while ($row = $db->sql_fetchrow($result)) {
        $id = intval($row['id']);
        $id_cat = intval($row['id_cat']);
        $question = stripslashes(check_html($row['question'], "nohtml"));
        $answer = stripslashes($row['answer']);
        echo "<tr><td><a name=\"{$id}\"></a>" . "<strong><big>&middot;</big></strong>&nbsp;&nbsp;<b>{$question}</b>" . "<p align=\"justify\">{$answer}</p>" . "[ <a href=\"#top\">" . _BACKTOTOP . "</a> ]" . "<br><br>" . "</td></tr>";
    }
    echo "</table><br><br>" . "<div align=\"center\"><b>[ <a href=\"modules.php?name={$module_name}\">" . _BACKTOFAQINDEX . "</a> ]</b></div>";
}
示例#5
0
function PrintPage($sid)
{
    global $site_logo, $nukeurl, $sitename, $datetime, $prefix, $db, $module_name;
    $sid = intval($sid);
    $row = $db->sql_fetchrow($db->sql_query("SELECT title, time, hometext, bodytext, topic, notes FROM " . $prefix . "_stories WHERE sid='{$sid}'"));
    $title = stripslashes(check_html($row['title'], "nohtml"));
    $time = $row['time'];
    $hometext = stripslashes($row['hometext']);
    $bodytext = stripslashes($row['bodytext']);
    $topic = intval($row['topic']);
    $notes = stripslashes($row['notes']);
    $row2 = $db->sql_fetchrow($db->sql_query("SELECT topictext FROM " . $prefix . "_topics WHERE topicid='{$topic}'"));
    $topictext = stripslashes($row2['topictext']);
    formatTimestamp($time);
    echo "<html>\n\t    <head><title>{$sitename} - {$title}</title></head>\n\t    <body bgcolor=\"#ffffff\" text=\"#000000\">\n\t    <table border=\"0\" align=\"center\"><tr><td>\n\t\n\t    <table border=\"0\" width=\"640\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#000000\"><tr><td>\n\t    <table border=\"0\" width=\"640\" cellpadding=\"20\" cellspacing=\"1\" bgcolor=\"#ffffff\"><tr><td>\n\t    <center>\n\t    <img src=\"images/{$site_logo}\" border=\"0\" alt=\"\"><br><br>\n\t    <font class=\"content\">\n\t    <b>{$title}</b></font><br>\n\t    <font class=tiny><b>" . _PDATE . "</b> {$datetime}<br><b>" . _PTOPIC . "</b> {$topictext}</font><br><br>\n\t    </center>\n\t    <font class=\"content\">\n\t    {$hometext}<br><br>\n\t    {$bodytext}<br><br>\n\t    {$notes}<br><br>\n\t    </font>\n\t    </td></tr></table></td></tr></table>\n\t    <br><br><center>\n\t    <font class=\"content\">\n\t    " . _COMESFROM . " {$sitename}<br>\n\t    <a href=\"{$nukeurl}\">{$nukeurl}</a><br><br>\n\t    " . _THEURL . "<br>\n\t    <a href=\"{$nukeurl}/modules.php?name={$module_name}&file=article&sid={$sid}\">{$nukeurl}/modules.php?name={$module_name}&file=article&sid={$sid}</a>\n\t    </font>\n\t    </td></tr></table>\n\t    </body>\n\t    </html>";
    die;
}
示例#6
0
 function view_login()
 {
     if (!isset($_SESSION['userName'])) {
         $error = isset($_GET['msg']) ? check_html($_GET['msg']) : "";
         //$res = TransOpenApiAct::act_getAuthCompanyList();//获取鉴权的公司列表
         //$this->smarty->assign('lists',$res);
         $this->smarty->assign('error', $error);
         $this->smarty->display('login.htm');
     } else {
         $ref = empty($_GET['ref']) ? "" : rawurldecode($_GET['ref']);
         if (empty($ref)) {
             redirect_to(C('USER_GO_URL'));
         } else {
             redirect_to($ref);
         }
     }
 }
示例#7
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";
}
示例#8
0
/******************************************************************************/
// common functions
require_once 'inc/functions/functions.common.php';
// to-user
$to_user = tfb_getRequestVar('to_user');
if (empty($to_user) or empty($cfg["user"])) {
    // the user probably hit this page direct
    @header("location: index.php?iid=index");
    exit;
}
// message
$message = tfb_getRequestVar('message');
if (!empty($message)) {
    $to_all_r = tfb_getRequestVar('to_all');
    $force_read_r = tfb_getRequestVar('force_read');
    $message = check_html($message, "nohtml");
    SaveMessage($to_user, $cfg["user"], htmlentities($message), empty($to_all_r) ? 0 : 1, !empty($force_read_r) && $cfg['isAdmin'] ? 1 : 0);
    @header("location: index.php?iid=readmsg");
    exit;
}
// rmid
if (isset($_REQUEST['rmid'])) {
    $rmid = tfb_getRequestVar('rmid');
    if (!empty($rmid)) {
        list($from_user, $message, $ip, $time) = GetMessage($rmid);
        $message = $cfg['_DATE'] . ": " . date($cfg['_DATETIMEFORMAT'], $time) . "\n" . $from_user . " " . $cfg['_WROTE'] . ":\n\n" . $message;
        $message = ">" . str_replace("\n", "\n>", $message);
        $message = "\n\n\n" . $message;
    }
}
// init template-instance
示例#9
0
function completevotefooter($lid, $ttitle, $ratinguser)
{
    global $prefix, $db, $sitename, $module_name;
    include "modules/{$module_name}/l_config.php";
    $lid = intval($lid);
    $row = $db->sql_fetchrow($db->sql_query("SELECT url FROM " . $prefix . "_links_links WHERE lid='{$lid}'"));
    $url = stripslashes($row['url']);
    echo "<font class=\"content\">" . _THANKSTOTAKETIME . " {$sitename}. " . _LETSDECIDE . "</font><br><br><br>";
    if ($ratinguser == "outside") {
        echo "<center><font class=\"content\">" . WEAPPREACIATE . " {$sitename}!<br><a href=\"{$url}\">" . _RETURNTO . " {$ttitle}</a></font><center><br><br>";
        $row2 = $db->sql_fetchrow($db->sql_query("SELECT title FROM " . $prefix . "_links_links where lid='{$lid}'"));
        $title = stripslashes(check_html($row2['title'], "nohtml"));
        $ttitle = ereg_replace(" ", "_", $title);
    }
    echo "<center>";
    linkinfomenu($lid, $ttitle);
    echo "</center>";
    CloseTable();
}
示例#10
0
 while ($row5 = $db->sql_fetchrow($result5)) {
     $sid = intval($row5['sid']);
     $aid = stripslashes($row5['aid']);
     $informant = filter($row5['informant'], "nohtml");
     $title = filter($row5['title'], "nohtml");
     $time = $row5['time'];
     $hometext = filter($row5['hometext']);
     $bodytext = filter($row5['bodytext']);
     $url = filter($row5['url'], "nohtml");
     $comments = intval($row5['comments']);
     $topic = intval($row5['topic']);
     $row6 = $db->sql_fetchrow($db->sql_query("SELECT topictext from " . $prefix . "_topics where topicid='{$topic}'"));
     $topictext = filter($row6['topictext'], "nohtml");
     $furl = "modules.php?name=News&file=article&sid={$sid}";
     $datetime = formatTimestamp($time);
     $query = stripslashes(check_html($query, "nohtml"));
     if (empty($informant)) {
         $informant = $anonymous;
     } else {
         $informant = "<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username={$informant}\">{$informant}</a>";
     }
     if (!empty($query) and $query != "*") {
         if (eregi(quotemeta($query), $title)) {
             $a = 1;
         }
         $text = "{$hometext}{$bodytext}";
         if (eregi(quotemeta($query), $text)) {
             $a = 2;
         }
         if (eregi(quotemeta($query), $text) and eregi(quotemeta($query), $title)) {
             $a = 3;
示例#11
0
function theindex($new_topic = 0)
{
    global $db, $storyhome, $topicname, $topicimage, $topictext, $datetime, $user, $cookie, $nukeurl, $prefix, $multilingual, $currentlang, $articlecomm, $sitename, $user_news;
    if ($multilingual == 1) {
        $querylang = "AND (alanguage='{$currentlang}' OR alanguage='')";
    } else {
        $querylang = "";
    }
    include "header.php";
    automated_news();
    if (isset($cookie[3]) and $user_news == 1) {
        $storynum = $cookie[3];
    } else {
        $storynum = $storyhome;
    }
    if ($new_topic == 0) {
        $qdb = "WHERE (ihome='0' OR catid='0')";
        $home_msg = "";
    } else {
        $qdb = "WHERE topic='{$new_topic}'";
        $result_a = $db->sql_query("SELECT topictext FROM " . $prefix . "_topics WHERE topicid='{$new_topic}'");
        $row_a = $db->sql_fetchrow($result_a);
        $numrows_a = $db->sql_numrows($result_a);
        $topic_title = stripslashes(check_html($row_a['topictext'], "nohtml"));
        OpenTable();
        if ($numrows_a == 0) {
            echo "<center><font class=\"title\">{$sitename}</font><br><br>" . _NOINFO4TOPIC . "<br><br>[ <a href=\"modules.php?name=News\">" . _GOTONEWSINDEX . "</a> | <a href=\"modules.php?name=Topics\">" . _SELECTNEWTOPIC . "</a> ]</center>";
        } else {
            echo "<center><font class=\"title\">{$sitename}: {$topic_title}</font><br><br>" . "<form action=\"modules.php?name=Search\" method=\"post\">" . "<input type=\"hidden\" name=\"topic\" value=\"{$new_topic}\">" . "" . _SEARCHONTOPIC . ": <input type=\"name\" name=\"query\" size=\"30\">&nbsp;&nbsp;" . "<input type=\"submit\" value=\"" . _SEARCH . "\">" . "</form>" . "[ <a href=\"index.php\">" . _GOTOHOME . "</a> | <a href=\"modules.php?name=Topics\">" . _SELECTNEWTOPIC . "</a> ]</center>";
        }
        CloseTable();
        echo "<br>";
    }
    $result = $db->sql_query("SELECT sid, catid, aid, title, time, hometext, bodytext, comments, counter, topic, informant, notes, acomm, score, ratings FROM " . $prefix . "_stories {$qdb} {$querylang} ORDER BY sid DESC limit {$storynum}");
    while ($row = $db->sql_fetchrow($result)) {
        $s_sid = intval($row['sid']);
        $catid = intval($row['catid']);
        $aid = stripslashes($row['aid']);
        $title = stripslashes(check_html($row['title'], "nohtml"));
        $time = $row['time'];
        $hometext = stripslashes($row['hometext']);
        $bodytext = stripslashes($row['bodytext']);
        $comments = stripslashes($row['comments']);
        $counter = intval($row['counter']);
        $topic = intval($row['topic']);
        $informant = stripslashes($row['informant']);
        $notes = stripslashes($row['notes']);
        $acomm = intval($row['acomm']);
        $score = intval($row['score']);
        $ratings = intval($row['ratings']);
        if ($catid > 0) {
            $row2 = $db->sql_fetchrow($db->sql_query("SELECT title FROM " . $prefix . "_stories_cat WHERE catid='{$catid}'"));
            $cattitle = stripslashes(check_html($row2['title'], "nohtml"));
        }
        getTopics($s_sid);
        formatTimestamp($time);
        $subject = stripslashes(check_html($subject, "nohtml"));
        $introcount = strlen($hometext);
        $fullcount = strlen($bodytext);
        $totalcount = $introcount + $fullcount;
        $c_count = $comments;
        $r_options = "";
        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']}";
        }
        $story_link = "<a href=\"modules.php?name=News&amp;file=article&amp;sid={$s_sid}{$r_options}\">";
        $morelink = "(";
        if ($fullcount > 0 or $c_count > 0 or $articlecomm == 0 or $acomm == 1) {
            $morelink .= "{$story_link}<b>" . _READMORE . "</b></a> | ";
        } else {
            $morelink .= "";
        }
        if ($fullcount > 0) {
            $morelink .= "{$totalcount} " . _BYTESMORE . " | ";
        }
        if ($articlecomm == 1 and $acomm == 0) {
            if ($c_count == 0) {
                $morelink .= "{$story_link}" . _COMMENTSQ . "</a>";
            } elseif ($c_count == 1) {
                $morelink .= "{$story_link}{$c_count} " . _COMMENT . "</a>";
            } elseif ($c_count > 1) {
                $morelink .= "{$story_link}{$c_count} " . _COMMENTS . "</a>";
            }
        }
        $sid = intval($s_sid);
        if ($catid != 0) {
            $row3 = $db->sql_fetchrow($db->sql_query("SELECT title FROM " . $prefix . "_stories_cat WHERE catid='{$catid}'"));
            $title1 = stripslashes(check_html($row3['title'], "nohtml"));
            $title = "<a href=\"modules.php?name=News&amp;file=categories&amp;op=newindex&amp;catid={$catid}\"><font class=\"storycat\">{$title1}</font></a>: {$title}";
            $morelink .= " | <a href=\"modules.php?name=News&amp;file=categories&amp;op=newindex&amp;catid={$catid}\">{$title1}</a>";
        }
        if ($score != 0) {
            $rated = substr($score / $ratings, 0, 4);
        } else {
            $rated = 0;
        }
        $morelink .= " | " . _SCORE . " {$rated}";
        $morelink .= ")";
        $morelink = str_replace(" |  | ", " | ", $morelink);
        themeindex($aid, $informant, $datetime, $title, $counter, $topic, $hometext, $notes, $morelink, $topicname, $topicimage, $topictext);
    }
    include "footer.php";
}
示例#12
0
function saveuser($realname, $user_email, $femail, $user_website, $user_icq, $user_aim, $user_yim, $user_msnm, $user_from, $user_occ, $user_interests, $newsletter, $user_viewemail, $user_allow_viewonline, $user_notify, $user_notify_pm, $user_popup_pm, $user_attachsig, $user_allowbbcode, $user_allowhtml, $user_allowsmile, $user_timezone, $user_dateformat, $user_sig, $bio, $user_password, $vpass, $username, $user_id, $usertype, $gradyear, $company, $designation, $specialization, $Company_Address_1, $Company_Address_2, $Company_Address_CITY, $Company_Address_STATE, $Company_Address_COUNTRY, $Company_Address_ZIP, $Company_Address_MOBILE, $Company_Address_PHONE, $Company_Address_FAX, $Company_Address_EMAIL, $PERMANENT_Address_1, $PERMANENT_Address_2, $PERMANENT_Address_CITY, $PERMANENT_Address_STATE, $PERMANENT_Address_COUNTRY, $PERMANENT_Address_ZIP, $PERMANENT_Address_MOBILE, $PERMANENT_Address_PHONE, $PERMANENT_Address_FAX, $PERMANENT_Address_EMAIL, $dasf_member, $guest_lectures_ok, $guest_lectures_topics, $summer_projects_ok, $placements_ok, $financial_help_ok, $sex, $dob, $is_married)
{
    global $user, $cookie, $userinfo, $EditedMessage, $user_prefix, $db, $module_name, $minpass;
    cookiedecode($user);
    $check = $cookie[1];
    $check2 = $cookie[2];
    $sql = "SELECT user_id, user_password FROM " . $user_prefix . "_users WHERE username='******'";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    $vuid = intval($row[user_id]);
    $ccpass = $row[user_password];
    $user_sig = htmlspecialchars($user_sig);
    $user_email = check_html($user_email, nohtml);
    $femail = check_html($femail, nohtml);
    $user_website = check_html($user_website, nohtml);
    $bio = check_html($bio, nohtml);
    $user_icq = check_html($user_icq, nohtml);
    $user_aim = check_html($user_aim, nohtml);
    $user_yim = check_html($user_yim, nohtml);
    $user_msnm = check_html($user_msnm, nohtml);
    $user_occ = check_html($user_occ, nohtml);
    $user_from = check_html($user_from, nohtml);
    $user_interests = check_html($user_interests, nohtml);
    $realname = check_html($realname, nohtml);
    $user_avatar = "{$user_avatar}";
    //FIX:DOMSNITT
    $company = check_html($company, nohtml);
    $designation = check_html($designation, nohtml);
    //END-OF-FIX
    if ($user_id == $vuid and $check2 == $ccpass) {
        if (!eregi("http://", $user_website)) {
            $user_website = "http://{$user_website}";
        }
        if (isset($user_password) && "{$user_password}" != "{$vpass}") {
            echo "<center>" . _PASSDIFFERENT . "</center>";
        } elseif ($user_password != "" && strlen($user_password) < $minpass) {
            echo "<center>" . _YOUPASSMUSTBE . " <b>{$minpass}</b> " . _CHARLONG . "</center>";
        } else {
            if ($bio) {
                filter_text($bio);
                $bio = $EditedMessage;
                $bio = FixQuotes($bio);
            }
            if ($user_password != "") {
                cookiedecode($user);
                $db->sql_query("LOCK TABLES " . $user_prefix . "_users WRITE");
                $user_password = md5($user_password);
                $newsletter = intval($newsletter);
                $user_allow_viewonline = intval($user_allow_viewonline);
                $user_notify = intval($user_notify);
                $user_notify_pm = intval($user_notify_pm);
                $user_popup_pm = intval($user_popup_pm);
                $user_allowbbcode = intval($user_allowbbcode);
                $user_allowhtml = intval($user_allowhtml);
                $user_allowsmile = intval($user_allowsmile);
                $user_id = intval($user_id);
                //FIX:DOMSNITT
                $gradyear = intval($gradyear);
                //$db->sql_query("UPDATE ".$user_prefix."_users SET name='$realname', user_email='$user_email', femail='$femail', user_website='$user_website', user_password='******', bio='$bio', user_icq='$user_icq', user_occ='$user_occ', user_from='$user_from', user_interests='$user_interests', user_sig='$user_sig', user_aim='$user_aim', user_yim='$user_yim', user_msnm='$user_msnm', newsletter='$newsletter', user_viewemail='$user_viewemail', user_allow_viewonline='$user_allow_viewonline', user_notify='$user_notify', user_notify_pm='$user_notify_pm', user_popup_pm='$user_popup_pm', user_attachsig='$user_attachsig', user_allowbbcode='$user_allowbbcode', user_allowhtml='$user_allowhtml', user_allowsmile='$user_allowsmile', user_timezone='$user_timezone', user_dateformat='$user_dateformat' WHERE user_id='$user_id'");
                $query = "UPDATE " . $user_prefix . "_users SET name='{$realname}', user_email='{$user_email}', femail='{$femail}', user_website='{$user_website}', user_password='******', bio='{$bio}', user_icq='{$user_icq}', user_occ='{$user_occ}', user_from='{$user_from}', user_interests='{$user_interests}', user_sig='{$user_sig}', user_aim='{$user_aim}', user_yim='{$user_yim}', user_msnm='{$user_msnm}', newsletter='{$newsletter}', user_viewemail='{$user_viewemail}', user_allow_viewonline='{$user_allow_viewonline}', user_notify='{$user_notify}', user_notify_pm='{$user_notify_pm}', user_popup_pm='{$user_popup_pm}', user_attachsig='{$user_attachsig}', user_allowbbcode='{$user_allowbbcode}', user_allowhtml='{$user_allowhtml}', user_allowsmile='{$user_allowsmile}', user_timezone='{$user_timezone}', user_dateformat='{$user_dateformat}',usertype='{$usertype}',gradyear={$gradyear},company='{$company}',designation='{$designation}',specialization='{$specialization}',Company_Address_1='{$Company_Address_1}',Company_Address_2='{$Company_Address_2}',Company_Address_CITY='{$Company_Address_CITY}',Company_Address_STATE='{$Company_Address_STATE}',Company_Address_COUNTRY='{$Company_Address_COUNTRY}',Company_Address_ZIP='{$Company_Address_ZIP}',Company_Address_MOBILE='{$Company_Address_MOBILE}',Company_Address_PHONE='{$Company_Address_PHONE}',Company_Address_FAX='{$Company_Address_FAX}',Company_Address_EMAIL='{$Company_Address_EMAIL}',PERMANENT_Address_1='{$PERMANENT_Address_1}',PERMANENT_Address_2='{$PERMANENT_Address_2}',PERMANENT_Address_CITY='{$PERMANENT_Address_CITY}',PERMANENT_Address_STATE='{$PERMANENT_Address_STATE}',PERMANENT_Address_COUNTRY='{$PERMANENT_Address_COUNTRY}',PERMANENT_Address_ZIP='{$PERMANENT_Address_ZIP}',PERMANENT_Address_MOBILE='{$PERMANENT_Address_MOBILE}',PERMANENT_Address_PHONE='{$PERMANENT_Address_PHONE}',PERMANENT_Address_FAX='{$PERMANENT_Address_FAX}',PERMANENT_Address_EMAIL='{$PERMANENT_Address_EMAIL}',dasf_member='{$dasf_member}',guest_lectures_ok='{$guest_lectures_ok}',guest_lectures_topics='{$guest_lectures_topics}',summer_projects_ok='{$summer_projects_ok}',placements_ok='{$placements_ok}',financial_help_ok='{$financial_help_ok}',sex='{$sex}',is_married='{$is_married}',dob=DATE_FORMAT('{$dob}', '%Y-%m-%d') WHERE user_id='{$user_id}'";
                $db->sql_query($query);
                //END-OF-FIX
                $sql = "SELECT user_id, username, user_password, storynum, umode, uorder, thold, noscore, ublockon, theme FROM " . $user_prefix . "_users WHERE username='******' AND user_password='******'";
                $result = $db->sql_query($sql);
                if ($db->sql_numrows($result) == 1) {
                    $userinfo = $db->sql_fetchrow($result);
                    docookie($userinfo[user_id], $userinfo[username], $userinfo[user_password], $userinfo[storynum], $userinfo[umode], $userinfo[uorder], $userinfo[thold], $userinfo[noscore], $userinfo[ublockon], $userinfo[theme], $userinfo[commentmax]);
                } else {
                    echo "<center>" . _SOMETHINGWRONG . "</center><br>";
                }
                $db->sql_query("UNLOCK TABLES");
            } else {
                //FIX:DOMSNITT
                $company = check_html($company, nohtml);
                $designation = check_html($designation, nohtml);
                $gradyear = intval($gradyear);
                //$db->sql_query("UPDATE ".$user_prefix."_users SET name='$realname', user_email='$user_email', 		femail='$femail', user_website='$user_website', bio='$bio', user_icq='$user_icq', user_occ='$user_occ', user_from='$user_from', user_interests='$user_interests', user_sig='$user_sig', user_aim='$user_aim', user_yim='$user_yim', user_msnm='$user_msnm', newsletter='$newsletter', user_viewemail='$user_viewemail', user_allow_viewonline='$user_allow_viewonline', user_notify='$user_notify', user_notify_pm='$user_notify_pm', user_popup_pm='$user_popup_pm', user_attachsig='$user_attachsig', user_allowbbcode='$user_allowbbcode', user_allowhtml='$user_allowhtml', user_allowsmile='$user_allowsmile', user_timezone='$user_timezone', user_dateformat='$user_dateformat' WHERE user_id='$user_id'");
                $query = "UPDATE " . $user_prefix . "_users SET name='{$realname}', user_email='{$user_email}', femail='{$femail}', user_website='{$user_website}', bio='{$bio}', user_icq='{$user_icq}', user_occ='{$user_occ}', user_from='{$user_from}', user_interests='{$user_interests}', user_sig='{$user_sig}', user_aim='{$user_aim}', user_yim='{$user_yim}', user_msnm='{$user_msnm}', newsletter='{$newsletter}', user_viewemail='{$user_viewemail}', user_allow_viewonline='{$user_allow_viewonline}', user_notify='{$user_notify}', user_notify_pm='{$user_notify_pm}', user_popup_pm='{$user_popup_pm}', user_attachsig='{$user_attachsig}', user_allowbbcode='{$user_allowbbcode}', user_allowhtml='{$user_allowhtml}', user_allowsmile='{$user_allowsmile}', user_timezone='{$user_timezone}', user_dateformat='{$user_dateformat}' ,usertype='{$usertype}',gradyear={$gradyear},company='{$company}',designation='{$designation}',specialization='{$specialization}',Company_Address_1='{$Company_Address_1}',Company_Address_2='{$Company_Address_2}',Company_Address_CITY='{$Company_Address_CITY}',Company_Address_STATE='{$Company_Address_STATE}',Company_Address_COUNTRY='{$Company_Address_COUNTRY}',Company_Address_ZIP='{$Company_Address_ZIP}',Company_Address_MOBILE='{$Company_Address_MOBILE}',Company_Address_PHONE='{$Company_Address_PHONE}',Company_Address_FAX='{$Company_Address_FAX}',Company_Address_EMAIL='{$Company_Address_EMAIL}',PERMANENT_Address_1='{$PERMANENT_Address_1}',PERMANENT_Address_2='{$PERMANENT_Address_2}',PERMANENT_Address_CITY='{$PERMANENT_Address_CITY}',PERMANENT_Address_STATE='{$PERMANENT_Address_STATE}',PERMANENT_Address_COUNTRY='{$PERMANENT_Address_COUNTRY}',PERMANENT_Address_ZIP='{$PERMANENT_Address_ZIP}',PERMANENT_Address_MOBILE='{$PERMANENT_Address_MOBILE}',PERMANENT_Address_PHONE='{$PERMANENT_Address_PHONE}',PERMANENT_Address_FAX='{$PERMANENT_Address_FAX}',PERMANENT_Address_EMAIL='{$PERMANENT_Address_EMAIL}',dasf_member='{$dasf_member}',guest_lectures_ok='{$guest_lectures_ok}',guest_lectures_topics='{$guest_lectures_topics}',summer_projects_ok='{$summer_projects_ok}',placements_ok='{$placements_ok}',financial_help_ok='{$financial_help_ok}' ,sex='{$sex}',is_married='{$is_married}',dob=DATE_FORMAT('{$dob}', '%Y-%m-%d')  WHERE user_id='{$user_id}'";
                $db->sql_query($query);
                //END-OF-FIX
            }
            Header("Location: modules.php?name={$module_name}");
        }
    }
}
示例#13
0
function filter($what, $strip = "", $save = "", $type = "")
{
    if ($strip == "nohtml") {
        $what = check_html($what, $strip);
        $what = htmlentities(trim($what), ENT_QUOTES);
        // If the variable $what doesn't comes from a preview screen should be converted
        if ($type != "preview" and $save != 1) {
            $what = html_entity_decode($what, ENT_QUOTES);
        }
    }
    if ($save == 1) {
        $what = check_words($what);
        $what = check_html($what, $strip);
        $what = addslashes($what);
    } else {
        $what = stripslashes(FixQuotes($what));
        $what = check_words($what);
        $what = check_html($what, $strip);
    }
    return $what;
}
示例#14
0
function list_themes()
{
    global $prefix, $db, $sitename, $admin, $multilingual, $module_name;
    include "header.php";
    title("{$sitename}: " . _ENCYCLOPEDIA . "");
    OpenTable();
    echo "<center><font class=\"content\">" . _AVAILABLEENCYLIST . " {$sitename}:</center><br><br>";
    $result = $db->sql_query("SELECT eid, title, description, elanguage FROM " . $prefix . "_encyclopedia WHERE active='1'");
    echo "<blockquote>";
    while ($row = $db->sql_fetchrow($result)) {
        $eid = intval($row['eid']);
        $title = stripslashes(check_html($row['title'], "nohtml"));
        $description = stripslashes($row['description']);
        $elanguage = $row['elanguage'];
        if ($multilingual == 1) {
            $the_lang = "<img src=\"images/language/flag-{$elanguage}.png\" hspace=\"3\" border=\"0\" height=\"10\" width=\"20\">";
        } else {
            $the_lang = "";
        }
        if ($subtitle != "") {
            $subtitle = "<br>({$description})<br><br>";
        } else {
            $subtitle = "";
        }
        if (is_admin($admin)) {
            echo "<strong><big>&middot;</big></strong> {$the_lang} <a href=\"modules.php?name={$module_name}&amp;op=list_content&amp;eid={$eid}\">{$title}</a><br>{$description}<br>[ <a href=\"admin.php?op=encyclopedia_edit&amp;eid={$eid}\">" . _EDIT . "</a> | <a href=\"admin.php?op=encyclopedia_change_status&amp;eid={$eid}&amp;active=1\">" . _DEACTIVATE . "</a> | <a href=\"admin.php?op=encyclopedia_delete&amp;eid={$eid}\">" . _DELETE . "</a> ]<br><br>";
        } else {
            echo "<strong><big>&middot;</big></strong> {$the_lang} <a href=\"modules.php?name={$module_name}&amp;op=list_content&amp;eid={$eid}\">{$title}</a><br> {$description}<br><br>";
        }
    }
    echo "</blockquote>";
    if (is_admin($admin)) {
        $result2 = $db->sql_query("SELECT eid, title, description, elanguage FROM " . $prefix . "_encyclopedia WHERE active='0'");
        echo "<br><br><center><b>" . _YOURADMININACTIVELIST . "</b></center><br><br>";
        echo "<blockquote>";
        while ($row2 = $db->sql_fetchrow($result2)) {
            $eid = intval($row2['eid']);
            $title = stripslashes(check_html($row2['title'], "nohtml"));
            $description = stripslashes($row2['description']);
            $elanguage = $row2['elanguage'];
            if ($multilingual == 1) {
                $the_lang = "<img src=\"images/language/flag-{$elanguage}.png\" hspace=\"3\" border=\"0\" height=\"10\" width=\"20\">";
            } else {
                $the_lang = "";
            }
            if ($subtitle != "") {
                $subtitle = " ({$subtitle}) ";
            } else {
                $subtitle = " ";
            }
            echo "<strong><big>&middot;</big></strong> {$the_lang} <a href=\"modules.php?name={$module_name}&amp;op=list_content&amp;eid={$eid}\">{$title}</a><br>{$description}<br>[ <a href=\"admin.php?op=encyclopedia_edit&amp;eid={$eid}\">" . _EDIT . "</a> | <a href=\"admin.php?op=encyclopedia_change_status&amp;eid={$eid}&amp;active=0\">" . _ACTIVATE . "</a> | <a href=\"admin.php?op=encyclopedia_delete&amp;eid={$eid}\">" . _DELETE . "</a> ]<br><br>";
        }
        echo "</blockquote>";
    }
    CloseTable();
    include "footer.php";
}
示例#15
0
 function modifyUser($chng_user)
 {
     global $prefix, $user_prefix, $db, $admin_file;
     include "header.php";
     GraphicAdmin();
     OpenTable();
     echo "<center><font class=\"title\"><b>" . _USERADMIN . "</b></font></center>";
     CloseTable();
     echo "<br>";
     $chng_user = stripslashes(check_html($chng_user, "nohtml"));
     $result = $db->sql_query("SELECT user_id, username, name, user_website, user_email, femail, user_icq, user_aim, user_yim, user_msnm, user_from, user_occ, user_interests, user_viewemail, user_avatar, user_sig, user_password, newsletter from " . $user_prefix . "_users where username='******'");
     $numrows = $db->sql_numrows($result);
     if ($numrows > 0) {
         $row = $db->sql_fetchrow($result);
         $chng_uid = intval($row['user_id']);
         $chng_uname = filter($row['username'], "nohtml");
         $chng_name = filter($row['name'], "nohtml");
         $chng_url = filter($row['user_website'], "nohtml");
         $chng_email = filter($row['user_email'], "nohtml");
         $chng_femail = filter($row['femail'], "nohtml");
         $chng_user_icq = intval($row['user_icq']);
         $chng_user_aim = filter($row['user_aim'], "nohtml");
         $chng_user_yim = filter($row['user_yim'], "nohtml");
         $chng_user_msnm = filter($row['user_msnm'], "nohtml");
         $chng_user_from = filter($row['user_from'], "nohtml");
         $chng_user_occ = filter($row['user_occ'], "nohtml");
         $chng_user_intrest = filter($row['user_interests'], "nohtml");
         $chng_user_viewemail = filter($row['user_viewemail'], "nohtml");
         $chng_avatar = filter($row['user_avatar'], "nohtml");
         $chng_user_sig = filter($row['user_sig']);
         $chng_pass = filter($row['user_password'], "nohtml");
         $chng_newsletter = intval($row['newsletter']);
         OpenTable();
         echo "<center><font class=\"option\"><b>" . _USERUPDATE . ": <i>{$chng_user}</i></b></font></center>" . "<form action=\"" . $admin_file . ".php\" method=\"post\">" . "<table border=\"0\">" . "<tr><td>" . _USERID . "</td>" . "<td><b>{$chng_uid}</b></td></tr>" . "<tr><td>" . _NICKNAME . "</td>" . "<td><input type=\"text\" name=\"chng_uname\" value=\"{$chng_uname}\"> <font class=\"tiny\">" . _REQUIRED . "</font></td></tr>" . "<tr><td>" . _NAME . "</td>" . "<td><input type=\"text\" name=\"chng_name\" value=\"{$chng_name}\"></td></tr>" . "<tr><td>" . _URL . "</td>" . "<td><input type=\"text\" name=\"chng_url\" value=\"{$chng_url}\" size=\"30\" maxlength=\"60\"></td></tr>" . "<tr><td>" . _EMAIL . "</td>" . "<td><input type=\"text\" name=\"chng_email\" value=\"{$chng_email}\" size=\"30\" maxlength=\"60\"> <font class=\"tiny\">" . _REQUIRED . "</font></td></tr>" . "<tr><td>" . _FAKEEMAIL . "</td>" . "<td><input type=\"text\" name=\"chng_femail\" value=\"{$chng_femail}\" size=\"30\" maxlength=\"60\"></td></tr>" . "<tr><td>" . _ICQ . "</td>" . "<td><input type=\"text\" name=\"chng_user_icq\" value=\"{$chng_user_icq}\" size=\"20\" maxlength=\"20\"></td></tr>" . "<tr><td>" . _AIM . "</td>" . "<td><input type=\"text\" name=\"chng_user_aim\" value=\"{$chng_user_aim}\" size=\"20\" maxlength=\"20\"></td></tr>" . "<tr><td>" . _YIM . "</td>" . "<td><input type=\"text\" name=\"chng_user_yim\" value=\"{$chng_user_yim}\" size=\"20\" maxlength=\"20\"></td></tr>" . "<tr><td>" . _MSNM . "</td>" . "<td><input type=\"text\" name=\"chng_user_msnm\" value=\"{$chng_user_msnm}\" size=\"20\" maxlength=\"20\"></td></tr>" . "<tr><td>" . _LOCATION . "</td>" . "<td><input type=\"text\" name=\"chng_user_from\" value=\"{$chng_user_from}\" size=\"25\" maxlength=\"60\"></td></tr>" . "<tr><td>" . _OCCUPATION . "</td>" . "<td><input type=\"text\" name=\"chng_user_occ\" value=\"{$chng_user_occ}\" size=\"25\" maxlength=\"60\"></td></tr>" . "<tr><td>" . _INTERESTS . "</td>" . "<td><input type=\"text\" name=\"chng_user_intrest\" value=\"{$chng_user_intrest}\" size=\"25\" maxlength=\"255\"></td></tr>" . "<tr><td>" . _OPTION . "</td>";
         if ($chng_user_viewemail == 1) {
             echo "<td><input type=\"checkbox\" name=\"chng_user_viewemail\" value=\"1\" checked> " . _ALLOWUSERS . "</td></tr>";
         } else {
             echo "<td><input type=\"checkbox\" name=\"chng_user_viewemail\" value=\"1\"> " . _ALLOWUSERS . "</td></tr>";
         }
         if ($chng_newsletter == 1) {
             echo "<tr><td>" . _NEWSLETTER . "</td><td><input type=\"radio\" name=\"chng_newsletter\" value=\"1\" checked>" . _YES . "&nbsp;&nbsp;" . "<input type=\"radio\" name=\"chng_newsletter\" value=\"0\">" . _NO . "</td></tr>";
         } elseif ($chng_newsletter == 0) {
             echo "<tr><td>" . _NEWSLETTER . "</td><td><input type=\"radio\" name=\"chng_newsletter\" value=\"1\">" . _YES . "&nbsp;&nbsp;" . "<input type=\"radio\" name=\"chng_newsletter\" value=\"0\" checked>" . _NO . "</td></tr>";
         }
         $subnum = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_subscriptions WHERE userid='{$chng_uid}'"));
         $content = "";
         if ($subnum == 0) {
             $content .= "<tr><td>" . _SUBUSERASK . "</td><td><input type='radio' name='subscription' value='1'> " . _YES . "&nbsp;&nbsp;&nbsp;<input type='radio' name='subscription' value='0' checked> " . _NO . "</td></tr>";
             $content .= "<tr><td>" . _SUBPERIOD . "</td><td><select name='subscription_expire'>";
             $content .= "<option value='0' selected>" . _NONE . "</option>";
             $content .= "<option value='1'>1 " . _YEAR . "</option>";
             $content .= "<option value='2'>2 " . _YEARS . "</option>";
             $content .= "<option value='3'>3 " . _YEARS . "</option>";
             $content .= "<option value='4'>4 " . _YEARS . "</option>";
             $content .= "<option value='5'>5 " . _YEARS . "</option>";
             $content .= "<option value='6'>6 " . _YEARS . "</option>";
             $content .= "<option value='7'>7 " . _YEARS . "</option>";
             $content .= "<option value='8'>8 " . _YEARS . "</option>";
             $content .= "<option value='9'>9 " . _YEARS . "</option>";
             $content .= "<option value='10'>10 " . _YEARS . "</option>";
             $content .= "</select><input type='hidden' name='reason' value='0'></td></tr>";
         } elseif ($subnum == 1) {
             $content .= "<tr><td>" . _UNSUBUSER . "</td><td><input type='radio' name='subscription' value='0'> " . _YES . "&nbsp;&nbsp;&nbsp;<input type='radio' name='subscription' value='1' checked> " . _NO . "</td></tr>";
             $content .= "<tr><td>" . _ADDSUBPERIOD . "</td><td><select name='subscription_expire'>";
             $content .= "<option value='0' selected>" . _NONE . "</option>";
             $content .= "<option value='1'>1 " . _YEAR . "</option>";
             $content .= "<option value='2'>2 " . _YEARS . "</option>";
             $content .= "<option value='3'>3 " . _YEARS . "</option>";
             $content .= "<option value='4'>4 " . _YEARS . "</option>";
             $content .= "<option value='5'>5 " . _YEARS . "</option>";
             $content .= "<option value='6'>6 " . _YEARS . "</option>";
             $content .= "<option value='7'>7 " . _YEARS . "</option>";
             $content .= "<option value='8'>8 " . _YEARS . "</option>";
             $content .= "<option value='9'>9 " . _YEARS . "</option>";
             $content .= "<option value='10'>10 " . _YEARS . "</option>";
             $content .= "</select></td></tr>";
             $content .= "<tr><td>" . _ADMSUBEXPIREIN . "</td><td>";
             $rows = $db->sql_fetchrow($db->sql_query("SELECT * FROM " . $prefix . "_subscriptions WHERE userid='{$chng_uid}'"));
             $diff = $rows['subscription_expire'] - time();
             $yearDiff = floor($diff / 60 / 60 / 24 / 365);
             $diff -= $yearDiff * 60 * 60 * 24 * 365;
             if ($yearDiff < 1) {
                 $diff = $rows['subscription_expire'] - time();
             }
             $daysDiff = floor($diff / 60 / 60 / 24);
             $diff -= $daysDiff * 60 * 60 * 24;
             $hrsDiff = floor($diff / 60 / 60);
             $diff -= $hrsDiff * 60 * 60;
             $minsDiff = floor($diff / 60);
             $diff -= $minsDiff * 60;
             $secsDiff = $diff;
             if ($yearDiff < 1) {
                 $rest = "{$daysDiff} " . _SBDAYS . ", {$hrsDiff} " . _SBHOURS . ", {$minsDiff} " . _SBMINUTES . ", {$secsDiff} " . _SBSECONDS . "";
             } elseif ($yearDiff == 1) {
                 $rest = "{$yearDiff} " . _SBYEAR . ", {$daysDiff} " . _SBDAYS . ", {$hrsDiff} " . _SBHOURS . ", {$minsDiff} " . _SBMINUTES . ", {$secsDiff} " . _SBSECONDS . "";
             } elseif ($yearDiff > 1) {
                 $rest = "{$yearDiff} " . _SBYEARS . ", {$daysDiff} " . _SBDAYS . ", {$hrsDiff} " . _SBHOURS . ", {$minsDiff} " . _SBMINUTES . ", {$secsDiff} " . _SBSECONDS . "";
             }
             $content .= "<font color='#FF0000'>{$rest}</font></td></tr>";
             $content .= "<tr><td>" . _SUBREASON . "</td><td><textarea name='reason' cols='70' rows='15'></textarea></td></tr>";
         }
         echo "{$content}";
         echo "<tr><td>" . _SIGNATURE . "</td>" . "<td><textarea name=\"chng_user_sig\" rows=\"15\" cols=\"70\">{$chng_user_sig}</textarea></td></tr>" . "<tr><td>" . _PASSWORD . "</td>" . "<td><input type=\"password\" name=\"chng_pass\" size=\"12\" maxlength=\"12\"></td></tr>" . "<tr><td>" . _RETYPEPASSWD . "</td>" . "<td><input type=\"password\" name=\"chng_pass2\" size=\"12\" maxlength=\"12\"> <font class=\"tiny\">" . _FORCHANGES . "</font></td></tr>" . "<input type=\"hidden\" name=\"chng_avatar\" value=\"{$chng_avatar}\">" . "<input type=\"hidden\" name=\"chng_uid\" value=\"{$chng_uid}\">" . "<input type=\"hidden\" name=\"op\" value=\"updateUser\">" . "<tr><td><input type=\"submit\" value=\"" . _SAVECHANGES . "\"></form></td></tr>" . "</table>";
         CloseTable();
     } else {
         OpenTable();
         echo "<center><b>" . _USERNOEXIST . "</b><br><br>" . "" . _GOBACK . "</center>";
         CloseTable();
     }
     include "footer.php";
 }
示例#16
0
function pollList()
{
    global $user, $cookie, $prefix, $multilingual, $currentlang, $admin, $dbi, $module_name, $db;
    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']}";
    }
    if ($multilingual == 1) {
        $querylang = "WHERE planguage='{$currentlang}' AND artid='0'";
    } else {
        $querylang = "WHERE artid='0'";
    }
    $result = sql_query("SELECT pollID, pollTitle, timeStamp, voters FROM " . $prefix . "_poll_desc {$querylang} ORDER BY timeStamp DESC", $dbi);
    $counter = 0;
    OpenTable();
    OpenTable();
    echo "<center><font class=\"title\"><b>" . _PASTSURVEYS . "</b></font></center>";
    CloseTable();
    echo "<table border=\"0\" cellpadding=\"8\"><tr><td>";
    while ($object = sql_fetch_object($result, $dbi)) {
        $resultArray[$counter] = array($object->pollID, $object->pollTitle, $object->timeStamp, $object->voters);
        $counter++;
    }
    for ($count = 0; $count < count($resultArray); $count++) {
        $id = $resultArray[$count][0];
        $id = intval($id);
        $i = intval($i);
        $pollTitle = $resultArray[$count][1];
        $voters = $resultArray[$count][3];
        for ($i = 0; $i < 12; $i++) {
            $result2 = sql_query("SELECT optionCount FROM " . $prefix . "_poll_data WHERE pollID='{$id}' AND voteID='{$i}'", $dbi);
            $object = sql_fetch_object($result2, $dbi);
            $optionCount = $object->optionCount;
            $sum = (int) $sum + $optionCount;
        }
        echo "<strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name={$module_name}&amp;pollID={$id}\">{$pollTitle}</a> ";
        if (is_admin($admin)) {
            $editing = " - <a href=\"admin.php?op=polledit&amp;pollID={$id}\">Edit</a>";
        } else {
            $editing = "";
        }
        echo "(<a href=\"modules.php?name={$module_name}&amp;op=results&amp;pollID={$id}{$r_options}\">" . _RESULTS . "</a> - {$sum} " . _LVOTES . "{$editing})<br>\n";
        $sum = 0;
    }
    echo "</td></tr></table>" . "<br>";
    OpenTable();
    echo "<center><font class=\"title\"><b>" . _SURVEYSATTACHED . "</b></font></center>";
    CloseTable();
    echo "<table border=\"0\" cellpadding=\"8\"><tr><td>";
    if ($multilingual == 1) {
        $querylang = "WHERE planguage='{$currentlang}' AND artid!='0'";
    } else {
        $querylang = "WHERE artid!='0'";
    }
    $counter = 0;
    $result3 = sql_query("SELECT pollID, pollTitle, timeStamp, voters FROM " . $prefix . "_poll_desc {$querylang} ORDER BY timeStamp DESC", $dbi);
    while ($object = sql_fetch_object($result3, $dbi)) {
        $resultArray2[$counter] = array($object->pollID, $object->pollTitle, $object->timeStamp, $object->voters);
        $counter++;
    }
    for ($count = 0; $count < count($resultArray2); $count++) {
        $id = $resultArray2[$count][0];
        $id = intval($id);
        $i = intval($i);
        $pollTitle = $resultArray2[$count][1];
        $voters = $resultArray2[$count][3];
        for ($i = 0; $i < 12; $i++) {
            $result4 = sql_query("SELECT optionCount FROM " . $prefix . "_poll_data WHERE pollID='{$id}' AND voteID='{$i}'", $dbi);
            $object = sql_fetch_object($result4, $dbi);
            $optionCount = $object->optionCount;
            $sum = (int) $sum + $optionCount;
        }
        echo "<strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name={$module_name}&amp;pollID={$id}\">{$pollTitle}</a> ";
        if (is_admin($admin)) {
            $editing = " - <a href=\"admin.php?op=polledit&amp;pollID={$id}\">Edit</a>";
        } else {
            $editing = "";
        }
        $res = $db->sql_query("select sid, title from " . $prefix . "_stories where pollID='{$id}'");
        list($sid, $title) = $db->sql_fetchrow($res);
        $sid = intval($sid);
        $title = stripslashes(check_html($title, "nohtml"));
        echo "(<a href=\"modules.php?name={$module_name}&amp;op=results&amp;pollID={$id}{$r_options}\">" . _RESULTS . "</a> - {$sum} " . _LVOTES . "{$editing})<br>\n" . "" . _ATTACHEDTOARTICLE . " <a href=\"modules.php?name=News&amp;file=article&amp;sid={$sid}{$r_options}\">{$title}</a><br><br>\n";
        $sum = "";
    }
    echo "</td></tr></table>";
    CloseTable();
}
示例#17
0
}
$modpath = '';
define('MODULE_FILE', true);
$_SERVER['PHP_SELF'] = "modules.php";
$row = $db->sql_fetchrow($db->sql_query("SELECT main_module from " . $prefix . "_main"));
$name = $row['main_module'];
define('HOME_FILE', true);
if (isset($url) and is_admin($admin)) {
    $url = urldecode($url);
    echo "<meta http-equiv=\"refresh\" content=\"0; url={$url}\">";
    die;
}
if ($httpref == 1) {
    if (isset($_SERVER['HTTP_REFERER'])) {
        $referer = $_SERVER['HTTP_REFERER'];
        $referer = check_html($referer, "nohtml");
        if (eregi("nuke_", $referer) && eregi("into", $referer) && eregi("from", $referer)) {
            $referer = "";
        }
    }
    if (!empty($referer) && !stripos_clone($referer, "unknown") && !stripos_clone($referer, "bookmark") && !stripos_clone($referer, $_SERVER['HTTP_HOST'])) {
        $result = $db->sql_query("INSERT INTO " . $prefix . "_referer VALUES (NULL, '" . $referer . "')");
    }
    $numrows = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_referer"));
    if ($numrows >= $httprefmax) {
        $result2 = $db->sql_query("DELETE FROM " . $prefix . "_referer");
    }
}
if (!isset($mop)) {
    $mop = "modload";
}
示例#18
0
$sql = "SELECT j.cid, j.rid, j.aid, j.comment, j.pdate, j.ptime, u.user_id FROM " . $prefix . "_journal_comments j, " . $user_prefix . "_users u WHERE j.aid=u.username and j.rid = '{$jid}'";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
    if ($row == 0) {
        $commentheader = "yes";
    } else {
        if ($commentheader == "no") {
            echo "<br>";
            if ($username == "" or $username == $anonymous) {
                $ann_co = "<br><div align=center class=tiny>" . _REGUSERSCOMM . "</div>";
            } else {
                $ann_co = "";
            }
            title("Posted Comments{$ann_co}");
            $commentheader = "yes";
        } elseif ($commentheader = "yes") {
            // Do not print comment header.
        }
    }
    openTable();
    //The following line had an incorrect uname entry.//
    printf("" . _COMMENTBY . ": <a href=\"modules.php?name=Your_Account&op=userinfo&username={$row['username']}\">%s</a> <div class=tiny>(" . _POSTEDON . " {$row['pdate']} @ {$row['ptime']})</div><br>", $row[aid], $row[aid], $row[pdate], $row[ptime]);
    $row[comment] = check_html($row[comment], $strip);
    printf("<strong>Comment:</strong> %s", $row[comment]);
    if ($username == $owner) {
        printf("<br><div align=center>[ <a href=\"modules.php?name={$module_name}&file=commentkill&onwhat=%s&ref={$jid}\">" . _DELCOMMENT . "</a> ]</div>", $row[cid], $row[jid]);
    }
    closeTable();
    print "<br><br>";
}
journalfoot();
示例#19
0
    die("You can't access this file directly...");
}
global $db, $prefix, $phpbb_root_path, $nuke_root_path, $nuke_file_path, $phpbb_root_dir, $module_name, $name, $file;
$module_name = "Forums";
$nuke_root_path = "modules.php?name=" . $module_name;
$nuke_file_path = "modules.php?name=" . $module_name . "&file=";
$phpbb_root_path = "modules/" . $module_name . "/";
$phpbb_root_dir = "./../";
require_once "mainfile.php";
get_lang($module_name);
if (isset($f)) {
    $f = intval($f);
    $sql = "SELECT forum_name  FROM " . $prefix . "_bbforums WHERE forum_id='{$f}' LIMIT 0,1";
    $result = $db->sql_query($sql);
    while ($row = $db->sql_fetchrow($result)) {
        $fname = check_html($row['forum_name'], "nohtml");
        $pagetitle = "{$name}-{$fname}";
        $pagetitle = check_html($pagetitle, "nohtml");
    }
}
if (isset($t)) {
    $t = intval($t);
    $sql = "SELECT topic_title FROM " . $prefix . "_bbtopics WHERE topic_id='{$t}' LIMIT 0,1";
    $result = $db->sql_query($sql);
    while ($row = $db->sql_fetchrow($result)) {
        $tname = check_html($row['topic_title'], "nohtml");
        $pagetitle = "{$name}-{$file}-{$tname}";
        $pagetitle = check_html($pagetitle, "nohtml");
    }
}
include "header.php";
示例#20
0
function replyPreview($pid, $pollID, $subject, $comment, $xanonpost, $mode, $order, $thold, $posttype)
{
    include "header.php";
    global $user, $cookie, $AllowableHTML, $anonymous, $module_name;
    cookiedecode($user);
    $subject = stripslashes(check_html($subject, "nohtml"));
    $comment = stripslashes($comment);
    $pid = intval($pid);
    $pollID = intval($pollID);
    if (!isset($pid) || !isset($pollID)) {
        echo "" . _NOTRIGHT . "";
        exit;
    }
    OpenTable();
    echo "<center><font class=\"title\"><b>" . _SURVEYCOMPRE . "</b></font></center>";
    CloseTable();
    echo "<br>";
    OpenTable();
    echo "<b>{$subject}</b><br>";
    echo "<font class=content>" . _BY . " ";
    if (is_user($user)) {
        echo "{$cookie['1']}";
    } else {
        echo "{$anonymous} ";
    }
    echo "" . _ONN . "</font><br><br>";
    if ($posttype == "exttrans") {
        echo nl2br(htmlspecialchars($comment));
    } elseif ($posttype == "plaintext") {
        echo nl2br($comment);
    } else {
        echo $comment;
    }
    CloseTable();
    echo "<br>";
    OpenTable();
    echo "<form action=\"modules.php?name={$module_name}&amp;file=comments\" method=\"post\">" . "<font class=\"content\"><B>" . _YOURNAME . ":</B></FONT> ";
    if (is_user($user)) {
        echo "<font class=\"content\"><a href=\"modules.php?name=Your_Account\">{$cookie['1']}</a> <font class=\"content\">[ <a href=\"modules.php?name=Your_Account&amp;op=logout\">" . _LOGOUT . "</a> ]</font>";
    } else {
        echo "<font class=\"content\">{$anonymous}</font>";
    }
    echo "<br><br><font class=\"content\"><B>" . _SUBJECT . ":</B></FONT><BR>" . "<INPUT TYPE=\"text\" name=\"subject\" size=\"50\" maxlength=\"85\" value=\"{$subject}\"><br><br>" . "<P><font class=\"content\"><B>" . _UCOMMENT . ":</B></FONT><BR>" . "<TEXTAREA wrap=\"virtual\" cols=\"50\" rows=\"10\" name=\"comment\">{$comment}</TEXTAREA><br>";
    echo "<font class=\"content\">" . _ALLOWEDHTML . "<br>";
    while (list($key, ) = each($AllowableHTML)) {
        echo " &lt;" . $key . "&gt;";
    }
    echo "<br>";
    if ($xanonpost and $anonpost == 1) {
        echo "<INPUT type=\"checkbox\" name=\"xanonpost\" checked> " . _POSTANON . "<br>";
    } elseif (is_user($user) and $anonpost == 1) {
        echo "<INPUT type=\"checkbox\" name=\"xanonpost\"> " . _POSTANON . "<br>";
    }
    echo "<INPUT type=\"hidden\" name=\"pid\" value=\"{$pid}\">" . "<INPUT type=\"hidden\" name=\"pollID\" value=\"{$pollID}\"><INPUT type=\"hidden\" name=\"mode\" value=\"{$mode}\">" . "<INPUT type=\"hidden\" name=\"order\" value=\"{$order}\"><INPUT type=\"hidden\" name=\"thold\" value=\"{$thold}\">" . "<br><INPUT type=submit name=op value=\"" . _PREVIEW . "\"> " . "<INPUT type=submit name=op value=\"" . _OK . "\"> <SELECT name=\"posttype\"><OPTION value=\"exttrans\"";
    if ($posttype == "exttrans") {
        echo " SELECTED";
    }
    echo ">" . _EXTRANS . "<OPTION value=\"html\"";
    if ($posttype == "html") {
        echo " SELECTED";
    }
    echo ">" . _HTMLFORMATED . "<OPTION value=\"plaintext\"";
    if ($posttype != "exttrans" && $posttype != "html") {
        echo " SELECTED";
    }
    echo ">" . _PLAINTEXT . "</SELECT></FORM>";
    CloseTable();
    include "footer.php";
}
示例#21
0
function search($query, $min, $orderby, $show)
{
    global $prefix, $dbi, $admin, $bgcolor2, $module_name;
    include "modules/{$module_name}/d_config.php";
    include "header.php";
    if (!isset($min)) {
        $min = 0;
    }
    if (!isset($max)) {
        $max = $min + $downloadsresults;
    }
    if (isset($orderby)) {
        $orderby = convertorderbyin($orderby);
    } else {
        $orderby = "title ASC";
    }
    if ($show != "") {
        $downloadsresults = $show;
    } else {
        $show = $downloadsresults;
    }
    $query = check_html($query, nohtml);
    $query = addslashes($query);
    $result = sql_query("SELECT lid, cid, title, url, description, date, hits, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $prefix . "_downloads_downloads WHERE title LIKE '%{$query}%' OR description LIKE '%{$query}%' ORDER BY {$orderby} LIMIT {$min},{$downloadsresults}", $dbi);
    $fullcountresult = sql_query("SELECT lid, title, description, date, hits, downloadratingsummary, totalvotes, totalcomments FROM " . $prefix . "_downloads_downloads WHERE title LIKE '%{$query}%' OR description LIKE '%{$query}%' ", $dbi);
    $totalselecteddownloads = sql_num_rows($fullcountresult, $dbi);
    $nrows = sql_num_rows($result, $dbi);
    $x = 0;
    $the_query = stripslashes($query);
    $the_query = str_replace("\\'", "'", $the_query);
    menu(1);
    echo "<br>";
    OpenTable();
    if ($query != "") {
        if ($nrows > 0) {
            echo "<font class=\"option\">" . _SEARCHRESULTS4 . ": <b>{$the_query}</b></font><br><br>" . "<table width=\"100%\" bgcolor=\"{$bgcolor2}\"><tr><td><font class=\"option\"><b>" . _USUBCATEGORIES . "</b></font></td></tr></table>";
            $result2 = sql_query("SELECT cid, title FROM " . $prefix . "_downloads_categories WHERE title LIKE '%{$query}%' ORDER BY title DESC", $dbi);
            while (list($cid, $stitle) = sql_fetch_row($result2, $dbi)) {
                $res = sql_query("SELECT * FROM " . $prefix . "_downloads_downloads WHERE cid={$cid}", $dbi);
                $numrows = sql_num_rows($res, $dbi);
                $result3 = sql_query("SELECT cid,title,parentid FROM " . $prefix . "_downloads_categories WHERE cid={$cid}", $dbi);
                list($cid3, $title3, $parentid3) = sql_fetch_row($result3, $dbi);
                if ($parentid3 > 0) {
                    $title3 = getparent($parentid3, $title3);
                }
                $title3 = ereg_replace($query, "<b>{$query}</b>", $title3);
                echo "<strong><big>·</big></strong>&nbsp;<a href=\"modules.php?name={$module_name}&d_op=viewdownload&amp;cid={$cid}\">{$title3}</a> ({$numrows})<br>";
            }
            echo "<br><table width=\"100%\" bgcolor=\"{$bgcolor2}\"><tr><td><font class=\"option\"><b>" . _UDOWNLOADS . "</b></font></td></tr></table>";
            $orderbyTrans = convertorderbytrans($orderby);
            echo "<center><font class=\"content\">" . _SORTDOWNLOADSBY . ": " . "" . _TITLE . " (<a href=\"modules.php?name={$module_name}&d_op=search&amp;query={$the_query}&amp;orderby=titleA\">A</a>\\<a href=\"modules.php?name={$module_name}&d_op=search&amp;query={$the_query}&amp;orderby=titleD\">D</a>) " . "" . _DATE . " (<a href=\"modules.php?name={$module_name}&d_op=search&amp;query={$the_query}&amp;orderby=dateA\">A</a>\\<a href=\"modules.php?name={$module_name}&d_op=search&amp;query={$the_query}&amp;orderby=dateD\">D</a>) " . "" . _RATING . " (<a href=\"modules.php?name={$module_name}&d_op=search&amp;query={$the_query}&amp;orderby=ratingA\">A</a>\\<a href=\"modules.php?name={$module_name}&d_op=search&amp;query={$the_query}&amp;orderby=ratingD\">D</a>) " . "" . _POPULARITY . " (<a href=\"modules.php?name={$module_name}&d_op=search&amp;query={$the_query}&amp;orderby=hitsA\">A</a>\\<a href=\"modules.php?name={$module_name}&d_op=search&amp;query={$the_query}&amp;orderby=hitsD\">D</a>)" . "<br>" . _RESSORTED . ": {$orderbyTrans}</center><br><br><br>";
            while (list($lid, $cid, $title, $url, $description, $time, $hits, $downloadratingsummary, $totalvotes, $totalcomments, $filesize, $version, $homepage) = sql_fetch_row($result, $dbi)) {
                $downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal);
                $title = stripslashes($title);
                $description = stripslashes($description);
                $transfertitle = str_replace(" ", "_", $title);
                $title = ereg_replace($query, "<b>{$query}</b>", $title);
                global $prefix, $dbi, $admin;
                if (is_admin($admin)) {
                    if (eregi("http", $url)) {
                        echo "<a href=\"admin.php?op=DownloadsModDownload&amp;lid={$lid}\"><img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>";
                    } else {
                        echo "<a href=\"admin.php?op=DownloadsModDownload&amp;lid={$lid}\"><img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>";
                    }
                } else {
                    if (eregi("http", $url)) {
                        echo "<img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"\">";
                    } else {
                        echo "<img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"\">";
                    }
                }
                echo "&nbsp;<a href=\"modules.php?name={$module_name}&d_op=getit&amp;lid={$lid}\" CLASS=\"title\" TARGET=\"_blank\">{$title}</a>";
                newdownloadgraphic($datetime, $time);
                popgraphic($hits);
                detecteditorial($lid, $transfertitle, 1);
                echo "<br>";
                $description = ereg_replace($query, "<b>{$query}</b>", $description);
                echo "<b>" . _DESCRIPTION . ":</b> {$description}<br>";
                setlocale(LC_TIME, $locale);
                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, $datetime);
                $datetime = strftime("" . _LINKSDATESTRING . "", mktime($datetime[4], $datetime[5], $datetime[6], $datetime[2], $datetime[3], $datetime[1]));
                $datetime = ucfirst($datetime);
                echo "<b>" . _VERSION . ":</b> {$version} <b>" . _FILESIZE . ":</b> " . CoolSize($filesize) . "<br>";
                echo "<b>" . _ADDEDON . ":</b> {$datetime} <b>" . _UDOWNLOADS . ":</b> {$hits}";
                /* voting & comments stats */
                if ($totalvotes == 1) {
                    $votestring = _VOTE;
                } else {
                    $votestring = _VOTES;
                }
                if ($downloadratingsummary != "0" || $downloadratingsummary != "0.0") {
                    echo " <b>" . _RATING . ":</b> {$downloadratingsummary} ({$totalvotes} {$votestring})";
                }
                echo "<br>";
                $result3 = sql_query("SELECT cid,title,parentid FROM " . $prefix . "_downloads_categories WHERE cid={$cid}", $dbi);
                list($cid3, $title3, $parentid3) = sql_fetch_row($result3, $dbi);
                if ($parentid3 > 0) {
                    $title3 = getparent($parentid3, $title3);
                }
                echo "<B>" . _CATEGORY . ":</B> <A HREF=\"modules.php?name=Downloads&d_op=viewdownload&cid={$cid}\">{$title3}</A>";
                if ($homepage == "") {
                    echo "<br>";
                } else {
                    echo "<br><a href=\"{$homepage}\" target=\"new\">" . _HOMEPAGE . "</a> | ";
                }
                echo "<a href=\"modules.php?name={$module_name}&d_op=ratedownload&amp;lid={$lid}&amp;ttitle={$transfertitle}\">" . _RATERESOURCE . "</a>";
                echo " | <a href=\"modules.php?name={$module_name}&d_op=viewdownloaddetails&amp;lid={$lid}&amp;ttitle={$transfertitle}\">" . _DETAILS . "</a>";
                if ($totalcomments != 0) {
                    echo " | <a href=\"modules.php?name={$module_name}&d_op=viewdownloadcomments&amp;lid={$lid}&amp;ttitle={$transfertitle}>" . _SCOMMENTS . " ({$totalcomments})</a>";
                }
                detecteditorial($lid, $transfertitle, 0);
                echo "<BR><BR>";
                $x++;
            }
            echo "</font>";
            $orderby = convertorderbyout($orderby);
        } else {
            echo "<br><br><center><font class=\"option\"><b>" . _NOMATCHES . "</b></font><br><br>" . _GOBACK . "<br></center>";
        }
        /* Calculates how many pages exist.  Which page one should be on, etc... */
        $downloadpagesint = $totalselecteddownloads / $downloadsresults;
        $downloadpageremainder = $totalselecteddownloads % $downloadsresults;
        if ($downloadpageremainder != 0) {
            $downloadpages = ceil($downloadpagesint);
            if ($totalselecteddownloads < $downloadsresults) {
                $downloadpageremainder = 0;
            }
        } else {
            $downloadpages = $downloadpagesint;
        }
        /* Page Numbering */
        if ($downloadpages != 1 && $downloadpages != 0) {
            echo "<br><br>" . "" . _SELECTPAGE . ": ";
            $prev = $min - $downloadsresults;
            if ($prev >= 0) {
                echo "&nbsp;&nbsp;<b>[ <a href=\"modules.php?name={$module_name}&d_op=search&amp;query={$the_query}&amp;min={$prev}&amp;orderby={$orderby}&amp;show={$show}\">" . " &lt;&lt; " . _PREVIOUS . "</a> ]</b> ";
            }
            $counter = 1;
            $currentpage = $max / $downloadsresults;
            while ($counter <= $downloadpages) {
                $cpage = $counter;
                $mintemp = $perpage * $counter - $downloadsresults;
                if ($counter == $currentpage) {
                    echo "<b>{$counter}</b> ";
                } else {
                    echo "<a href=\"modules.php?name={$module_name}&d_op=search&amp;query={$the_query}&amp;min={$mintemp}&amp;orderby={$orderby}&amp;show={$show}\">{$counter}</a> ";
                }
                $counter++;
            }
            $next = $min + $downloadsresults;
            if ($x >= $perpage) {
                echo "&nbsp;&nbsp;<b>[ <a href=\"modules.php?name={$module_name}&d_op=search&amp;query={$the_query}&amp;min={$max}&amp;orderby={$orderby}&amp;show={$show}\">" . " " . _NEXT . " &gt;&gt;</a> ]</b>";
            }
        }
        echo "<br><br><center><font class=\"content\">" . "" . _TRY2SEARCH . " \"{$the_query}\" " . _INOTHERSENGINES . "<br>" . "<a target=\"_blank\" href=\"http://www.altavista.com/cgi-bin/query?pg=q&amp;sc=on&amp;hl=on&amp;act=2006&amp;par=0&amp;q={$the_query}&amp;kl=XX&amp;stype=stext\">Alta Vista</a> - " . "<a target=\"_blank\" href=\"http://www.hotbot.com/?MT={$the_query}&amp;DU=days&amp;SW=web\">HotBot</a> - " . "<a target=\"_blank\" href=\"http://www.infoseek.com/Titles?qt={$the_query}\">Infoseek</a> - " . "<a target=\"_blank\" href=\"http://www.dejanews.com/dnquery.xp?QRY={$the_query}\">Deja News</a> - " . "<a target=\"_blank\" href=\"http://www.lycos.com/cgi-bin/pursuit?query={$the_query}&amp;maxhits=20\">Lycos</a> - " . "<a target=\"_blank\" href=\"http://search.yahoo.com/bin/search?p={$the_query}\">Yahoo</a>" . "<br>" . "<a target=\"_blank\" href=\"http://es.linuxstart.com/cgi-bin/sqlsearch.cgi?pos=1&amp;query={$the_query}&amp;language=&amp;advanced=&amp;urlonly=&amp;withid=\">LinuxStart</a> - " . "<a target=\"_blank\" href=\"http://search.1stlinuxsearch.com/compass?scope={$the_query}&amp;ui=sr\">1stLinuxSearch</a> - " . "<a target=\"_blank\" href=\"http://www.google.com/search?q={$the_query}\">Google</a> - " . "<a target=\"_blank\" href=\"http://www.linuxdownloads.com/cgi-bin/search.cgi?query={$the_query}&amp;engine=Downloads\">LinuxDownloads</a> - " . "<a target=\"_blank\" href=\"http://www.freshmeat.net/search/?q={$the_query}&amp;section=projects\">Freshmeat</a> - " . "<a target=\"_blank\" href=\"http://www.justlinux.com/bin/search.pl?key={$the_query}\">JustLinux</a>" . "</font>";
    } else {
        echo "<center><font class=\"option\"><b>" . _NOMATCHES . "</b></font></center><br><br>";
    }
    CloseTable();
    include "footer.php";
}
示例#22
0
function Stats_Main()
{
    global $prefix, $db, $startdate, $sitename, $ThemeSel, $user_prefix, $Version_Num, $module_name, $textcolor2;
    include "header.php";
    $result = $db->sql_query("SELECT type, var, count from " . $prefix . "_counter order by type desc");
    while ($row = $db->sql_fetchrow($result)) {
        $type = stripslashes(check_html($row['type'], "nohtml"));
        $var = stripslashes(check_html($row['var'], "nohtml"));
        $count = intval($row['count']);
        if ($type == "total" && $var == "hits") {
            $total = $count;
        } elseif ($type == "browser") {
            if ($var == "FireFox") {
                $firefox[] = $count;
                $firefox[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "Netscape") {
                $netscape[] = $count;
                $netscape[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "MSIE") {
                $msie[] = $count;
                $msie[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "Konqueror") {
                $konqueror[] = $count;
                $konqueror[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "Opera") {
                $opera[] = $count;
                $opera[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "Lynx") {
                $lynx[] = $count;
                $lynx[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "Bot") {
                $bot[] = $count;
                $bot[] = substr(100 * $count / $total, 0, 5);
            } elseif ($type == "browser" && $var == "Other") {
                $b_other[] = $count;
                $b_other[] = substr(100 * $count / $total, 0, 5);
            }
        } elseif ($type == "os") {
            if ($var == "Windows") {
                $windows[] = $count;
                $windows[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "Mac") {
                $mac[] = $count;
                $mac[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "Linux") {
                $linux[] = $count;
                $linux[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "FreeBSD") {
                $freebsd[] = $count;
                $freebsd[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "SunOS") {
                $sunos[] = $count;
                $sunos[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "IRIX") {
                $irix[] = $count;
                $irix[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "BeOS") {
                $beos[] = $count;
                $beos[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "OS/2") {
                $os2[] = $count;
                $os2[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "AIX") {
                $aix[] = $count;
                $aix[] = substr(100 * $count / $total, 0, 5);
            } elseif ($type == "os" && $var == "Other") {
                $os_other[] = $count;
                $os_other[] = substr(100 * $count / $total, 0, 5);
            }
        }
    }
    title("{$sitename} " . _STATS . "");
    OpenTable();
    OpenTable();
    echo "<center><font class=\"option\"><b>{$sitename} " . _STATS . "</b></font><br><br>" . _WERECEIVED . " <b>{$total}</b> " . _PAGESVIEWS . " {$startdate}<br><br>" . "[ <a href=\"modules.php?name={$module_name}&op=Stats\">" . _VIEWDETAILED . "</a> ]</center>";
    CloseTable();
    echo "<br><br>";
    $l_size = getimagesize("themes/{$ThemeSel}/images/leftbar.gif");
    $m_size = getimagesize("themes/{$ThemeSel}/images/mainbar.gif");
    $r_size = getimagesize("themes/{$ThemeSel}/images/rightbar.gif");
    OpenTable2();
    echo "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" align=\"center\"><tr><td colspan=\"2\">\n";
    echo "<center><font color=\"{$textcolor2}\"><b>" . _BROWSERS . "</b></font></center><br></td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/explorer.gif\" border=\"0\" alt=\"\">&nbsp;MSIE: </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Internet Explorer\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Internet Explorer\" height=\"{$m_size['1']}\" width=", $msie[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Internet Explorer\"> {$msie['1']} % ({$msie['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/firefox.gif\" border=\"0\" alt=\"\">&nbsp;FireFox: </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"FireFox\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"FireFox\" height=\"{$m_size['1']}\" width=", $firefox[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"FireFox\"> {$firefox['1']} % ({$firefox['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/netscape.gif\" border=\"0\" alt=\"\">&nbsp;Netscape: </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Netscape\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Netscape\" height=\"{$m_size['1']}\" width=", $netscape[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Netscape\"> {$netscape['1']} % ({$netscape['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/opera.gif\" border=\"0\" alt=\"\">&nbsp;Opera: </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Opera\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Opera\" height=\"{$m_size['1']}\" width=", $opera[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Opera\"> {$opera['1']} % ({$opera['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/konqueror.gif\" border=\"0\" alt=\"\">&nbsp;Konqueror: </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Konqueror\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Konqueror (KDE)\" height=\"{$m_size['1']}\" width=", $konqueror[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Konqueror\"> {$konqueror['1']} % ({$konqueror['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/lynx.gif\" border=\"0\" alt=\"\">&nbsp;Lynx: </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Lynx\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Lynx\" height=\"{$m_size['1']}\" width=", $lynx[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Lynx\"> {$lynx['1']} % ({$lynx['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/altavista.gif\" border=\"0\" alt=\"\">&nbsp;" . _SEARCHENGINES . ": </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Robots - Spiders - Buscadores\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Robots - Spiders - Buscadores\" height=\"{$m_size['1']}\" width=", $bot[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"" . _BOTS . "\"> {$bot['1']} % ({$bot['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/question.gif\" border=\"0\" alt=\"\">&nbsp;" . _UNKNOWN . ": </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Otros - Desconocidos\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Otros - Desconocidos\" height=\"{$m_size['1']}\" width=", $b_other[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"" . _OTHER . "\"> {$b_other['1']} % ({$b_other['0']})\n";
    echo "</td></tr></table>";
    CloseTable2();
    echo "<br><br>\n";
    OpenTable2();
    echo "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" align=\"center\"><tr><td colspan=\"2\">\n";
    echo "<center><font color=\"{$textcolor2}\"><b>" . _OPERATINGSYS . "</b></font></center><br></td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/windows.gif\" border=\"0\" alt=\"\">&nbsp;Windows:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Windows\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Windows\" height=\"{$m_size['1']}\" width=", $windows[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Windows\"> {$windows['1']} % ({$windows['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/linux.gif\" border=\"0\" alt=\"\">&nbsp;Linux:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Linux\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Linux\" height=\"{$m_size['1']}\" width=", $linux[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Linux\"> {$linux['1']} % ({$linux['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/mac.gif\" border=\"0\" alt=\"\">&nbsp;Mac/PPC:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Mac/PPC\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Mac - PPC\" height=\"{$m_size['1']}\" width=", $mac[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Mac/PPC\"> {$mac['1']} % ({$mac['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/bsd.gif\" border=\"0\" alt=\"\">&nbsp;FreeBSD:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"FreeBSD\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"FreeBSD\" height=\"{$m_size['1']}\" width=", $freebsd[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"FreeBSD\"> {$freebsd['1']} % ({$freebsd['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/sun.gif\" border=\"0\" alt=\"\">&nbsp;SunOS:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"SunOS\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"SunOS\" height=\"{$m_size['1']}\" width=", $sunos[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"SunOS\"> {$sunos['1']} % ({$sunos['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/irix.gif\" border=\"0\" alt=\"\">&nbsp;IRIX:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"SGI Irix\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"SGI Irix\" height=\"{$m_size['1']}\" width=", $irix[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"SGI Irix\"> {$irix['1']} % ({$irix['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/be.gif\" border=\"0\" alt=\"\">&nbsp;BeOS:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"BeOS\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"BeOS\" height=\"{$m_size['1']}\" width=", $beos[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"BeOS\"> {$beos['1']} % ({$beos['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/os2.gif\" border=\"0\" alt=\"\">&nbsp;OS/2:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"OS/2\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"OS/2\" height=\"{$m_size['1']}\" width=", $os2[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"OS/2\"> {$os2['1']} % ({$os2['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/aix.gif\" border=\"0\" alt=\"\">&nbsp;AIX:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"AIX\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"AIX\" height=\"{$m_size['1']}\" width=", $aix[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"AIX\"> {$aix['1']} % ({$aix['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/question.gif\" border=\"0\" alt=\"\">&nbsp;" . _UNKNOWN . ":</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Otros - Desconocidos\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" ALt=\"Otros - Desconocidos\" height=\"{$m_size['1']}\" width=", $os_other[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"" . _OTHER . "\"> {$os_other['1']} % ({$os_other['0']})\n";
    echo "</td></tr></table>\n";
    CloseTable2();
    echo "<br><br>\n";
    $unum = $db->sql_numrows($db->sql_query("select user_id from " . $user_prefix . "_users"));
    $anum = $db->sql_numrows($db->sql_query("select * from " . $prefix . "_authors"));
    $snum = $db->sql_numrows($db->sql_query("select sid from " . $prefix . "_stories"));
    $cnum = $db->sql_numrows($db->sql_query("select tid from " . $prefix . "_comments"));
    $subnum = $db->sql_numrows($db->sql_query("select * from " . $prefix . "_queue"));
    if (is_active("Topics")) {
        $tnum = $db->sql_numrows($db->sql_query("select * from " . $prefix . "_topics"));
    }
    if (is_active("Web_Links")) {
        $links = $db->sql_numrows($db->sql_query("select * from " . $prefix . "_links_links"));
        $cat = $db->sql_numrows($db->sql_query("select * from " . $prefix . "_links_categories"));
    }
    OpenTable2();
    echo "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" align=\"center\"><tr><td colspan=\"2\">\n";
    echo "<center><font color=\"{$textcolor2}\"><b>" . _MISCSTATS . "</b></font></center><br></td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/users.gif\" border=\"0\" alt=\"\">&nbsp;" . _REGUSERS . "</td><td><b>{$unum}</b></td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/authors.gif\" border=\"0\" alt=\"\">&nbsp;" . _ACTIVEAUTHORS . "</td><td><b>{$anum}</b></td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/news.gif\" border=\"0\" alt=\"\">&nbsp;" . _STORIESPUBLISHED . "</td><td><b>{$snum}</b></td></tr>\n";
    if (is_active("Topics")) {
        echo "<tr><td><img src=\"modules/{$module_name}/images/topics.gif\" border=\"0\" alt=\"\">&nbsp;" . _SACTIVETOPICS . "</td><td><b>{$tnum}</b></td></tr>\n";
    }
    echo "<tr><td><img src=\"modules/{$module_name}/images/comments.gif\" border=\"0\" alt=\"\">&nbsp;" . _COMMENTSPOSTED . "</td><td><b>{$cnum}</b></td></tr>\n";
    if (is_active("Web_Links")) {
        echo "<tr><td><img src=\"modules/{$module_name}/images/topics.gif\" border=\"0\" alt=\"\">&nbsp;" . _LINKSINLINKS . "</td><td><b>{$links}</b></td></tr>\n";
        echo "<tr><td><img src=\"modules/{$module_name}/images/sections.gif\" border=\"0\" alt=\"\">&nbsp;" . _LINKSCAT . "</td><td><b>{$cat}</b></td></tr>\n";
    }
    echo "</table>\n";
    CloseTable2();
    CloseTable();
    include "footer.php";
}
示例#23
0
function filter_text($Message, $strip = "")
{
    global $EditedMessage;
    check_words($Message);
    $EditedMessage = check_html($EditedMessage, $strip);
    return $EditedMessage;
}
示例#24
0
function list_pages_categories($cid)
{
    global $prefix, $db, $sitename, $admin, $multilingual, $module_name;
    include "header.php";
    title("{$sitename}: " . _PAGESLIST . "");
    OpenTable();
    echo "<center><font class=\"content\">" . _LISTOFCONTENT . " {$sitename}:</center><br><br>";
    $cid = intval($cid);
    $result = $db->sql_query("SELECT pid, title, subtitle, clanguage FROM " . $prefix . "_pages WHERE active='1' AND cid='{$cid}' ORDER BY date");
    echo "<blockquote>";
    while ($row = $db->sql_fetchrow($result)) {
        $pid = intval($row['pid']);
        $title = stripslashes(check_html($row['title'], "nohtml"));
        $subtitle = stripslashes(check_html($row['subtitle'], "nohtml"));
        $clanguage = $row['clanguage'];
        if ($multilingual == 1) {
            $the_lang = "<img src=\"images/language/flag-" . $clanguage . ".png\" hspace=\"3\" border=\"0\" height=\"10\" width=\"20\">";
        } else {
            $the_lang = "";
        }
        if ($subtitle != "") {
            $subtitle = " ({$subtitle})";
        } else {
            $subtitle = "";
        }
        if (is_admin($admin)) {
            echo "<strong><big>&middot;</big></strong> {$the_lang} <a href=\"modules.php?name={$module_name}&amp;pa=showpage&amp;pid={$pid}\">{$title}</a> {$subtitle} [ <a href=\"admin.php?op=content_edit&amp;pid={$pid}\">" . _EDIT . "</a> | <a href=\"admin.php?op=content_change_status&amp;pid={$pid}&amp;active=1\">" . _DEACTIVATE . "</a> | <a href=\"admin.php?op=content_delete&amp;pid={$pid}\">" . _DELETE . "</a> ]<br>";
        } else {
            echo "<strong><big>&middot;</big></strong> {$the_lang} <a href=\"modules.php?name={$module_name}&amp;pa=showpage&amp;pid={$pid}\">{$title}</a> {$subtitle}<br>";
        }
    }
    echo "</blockquote>";
    if (is_admin($admin)) {
        $result2 = $db->sql_query("SELECT pid, title, subtitle, clanguage FROM " . $prefix . "_pages WHERE active='0' AND cid='{$cid}' ORDER BY date");
        echo "<br><br><center><b>" . _YOURADMINLIST . "</b></center><br><br>";
        echo "<blockquote>";
        while ($row2 = $db->sql_fetchrow($result2)) {
            $pid = intval($row2['pid']);
            $title = stripslashes(check_html($row2['title'], "nohtml"));
            $subtitle = stripslashes(check_html($row2['subtitle'], "nohtml"));
            $clanguage = $row2['clanguage'];
            if ($multilingual == 1) {
                $the_lang = "<img src=\"images/language/flag-" . $clanguage . ".png\" hspace=\"3\" border=\"0\" height=\"10\" width=\"20\">";
            } else {
                $the_lang = "";
            }
            if ($subtitle != "") {
                $subtitle = " ({$subtitle}) ";
            } else {
                $subtitle = " ";
            }
            echo "<strong><big>&middot;</big></strong> {$the_lang} <a href=\"modules.php?name={$module_name}&amp;pa=showpage&amp;pid={$pid}\">{$title}</a> {$subtitle} [ <a href=\"admin.php?op=content_edit&amp;pid={$pid}\">" . _EDIT . "</a> | <a href=\"admin.php?op=content_change_status&amp;pid={$pid}&amp;active=0\">" . _ACTIVATE . "</a> | <a href=\"admin.php?op=content_delete&amp;pid={$pid}\">" . _DELETE . "</a> ]<br>";
        }
        echo "</blockquote>";
    }
    echo "<center>" . _GOBACK . "</center>";
    CloseTable();
    include "footer.php";
}
示例#25
0
    }
    $tmpl->setvar('from_user', $from_user);
    $tmpl->setvar('message', $message);
    $tmpl->setvar('mid', $mid);
} else {
    // read and display all messages in a list.
    $inx = 0;
    $sql = "SELECT mid, from_user, message, IsNew, ip, time, force_read FROM tf_messages WHERE to_user="******"user"]) . " ORDER BY time";
    $result = $db->Execute($sql);
    if ($db->ErrorNo() != 0) {
        dbError($sql);
    }
    $message_list = array();
    while (list($mid, $from_user, $message, $new, $ip, $time, $force_read) = $result->FetchRow()) {
        $mail_image = $new == 1 ? "themes/" . $cfg['theme'] . "/images/new_message.gif" : "themes/" . $cfg['theme'] . "/images/old_message.gif";
        $display_message = check_html($message, "nohtml");
        if (strlen($display_message) >= 40) {
            $display_message = substr($display_message, 0, 39) . "...";
        }
        // No, let them reply or delete it
        array_push($message_list, array('mid' => $mid, 'mail_image' => $mail_image, 'from_user' => $from_user, 'display_message' => $display_message, 'date2' => date($cfg['_DATETIMEFORMAT'], $time), 'force_read' => $force_read, 'IsUser2' => IsUser($from_user) ? 1 : 0));
        $inx++;
    }
    if ($inx == 0) {
        $tmpl->setvar('no_inx', 1);
        $tmpl->setvar('_NORECORDSFOUND', $cfg['_NORECORDSFOUND']);
    } else {
        $tmpl->setvar('no_inx', 0);
        $tmpl->setloop('message_list', $message_list);
    }
    $tmpl->setvar('_SENDMESSAGETO', $cfg['_SENDMESSAGETO']);
示例#26
0
function avatarsave($avatar, $category)
{
    global $user_prefix, $db, $module_name, $user, $cookie, $prefix;
    $sql = "SELECT * FROM " . $prefix . "_bbconfig WHERE config_name = 'allow_avatar_local'";
    $result = $db->sql_query($sql);
    if ($row = $db->sql_fetchrow($result)) {
        $allow_avatar_local = $row['config_value'];
    } else {
        $allow_avatar_local = 0;
    }
    if (is_user($user) and $allow_avatar_local) {
        getusrinfo($user);
        cookiedecode($user);
        include "header.php";
        title("Avatar Selection Successful!");
        OpenTable();
        nav();
        CloseTable();
        OpenTable();
        $category = stripslashes(check_html($category, "nohtml"));
        if (preg_match('/(\\.gif$|\\.png$|\\.jpg|\\.jpeg)$/is', $avatar) and file_exists("modules/Forums/images/avatars/{$category}/{$avatar}")) {
            $newavatar = $category . "/" . $avatar;
            $db->sql_query("UPDATE " . $user_prefix . "_users SET user_avatar='{$newavatar}', user_avatar_type='3' WHERE user_id = '" . intval($cookie[0]) . "'");
            echo "<center><font class=\"content\">Avatar for " . $cookie[1] . " Saved!</center></font><br><br>";
            if (ereg("(http)", $newavatar)) {
                echo "<center>Your New Avatar:<br><br><IMG alt=\"\" src=\"{$newavatar}\"><br><br> [ <a href=\"modules.php?name={$module_name}&amp;op=edituser\">Back to Profile</a> | <a href=\"modules.php?name={$module_name}\">Done</a> ]<br><br></center>";
            } elseif ($newavatar) {
                echo "<center>Your New Avatar:<br><br><IMG alt=\"\" src=\"modules/Forums/images/avatars/{$newavatar}\"><br><br>[ <a href=\"modules.php?name={$module_name}&amp;op=edituser\">Back to Profile</a> | <a href=\"modules.php?name={$module_name}\">Done</a> ]<br><br></center>";
            }
        } else {
            echo "<center><b>Error:</b> Wrong avatar format! Avatars can only be gif, jpg, or png format.<br />" . _GOBACK . "</center>";
        }
        CloseTable();
        include "footer.php";
    }
}
示例#27
0
function theindex($catid)
{
    global $storyhome, $httpref, $httprefmax, $topicname, $topicimage, $topictext, $datetime, $user, $cookie, $nukeurl, $prefix, $multilingual, $currentlang, $db, $articlecomm, $module_name;
    if ($multilingual == 1) {
        $querylang = "AND (alanguage='{$currentlang}' OR alanguage='')";
        /* the OR is needed to display stories who are posted to ALL languages */
    } else {
        $querylang = "";
    }
    include "header.php";
    if (isset($cookie[3])) {
        $storynum = $cookie[3];
    } else {
        $storynum = $storyhome;
    }
    $catid = intval($catid);
    $db->sql_query("update " . $prefix . "_stories_cat set counter=counter+1 where catid='{$catid}'");
    $result = $db->sql_query("SELECT sid, aid, title, time, hometext, bodytext, comments, counter, topic, informant, notes, acomm, score, ratings FROM " . $prefix . "_stories where catid='{$catid}' {$querylang} ORDER BY sid DESC limit {$storynum}");
    while ($row = $db->sql_fetchrow($result)) {
        $s_sid = intval($row['sid']);
        $aid = stripslashes($row['aid']);
        $title = stripslashes(check_html($row['title'], "nohtml"));
        $time = $row['time'];
        $hometext = stripslashes($row['hometext']);
        $bodytext = stripslashes($row['bodytext']);
        $comments = intval($row['comments']);
        $counter = intval($row['counter']);
        $topic = intval($row['topic']);
        $informant = stripslashes($row['informant']);
        $notes = stripslashes($row['notes']);
        $acomm = intval($row['acomm']);
        $score = intval($row['score']);
        $ratings = intval($row['ratings']);
        getTopics($s_sid);
        formatTimestamp($time);
        $subject = stripslashes(check_html($subject, "nohtml"));
        $introcount = strlen($hometext);
        $fullcount = strlen($bodytext);
        $totalcount = $introcount + $fullcount;
        $c_count = $comments;
        $r_options = "";
        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']}";
        }
        $story_link = "<a href=\"modules.php?name=News&amp;file=article&amp;sid={$s_sid}{$r_options}\">";
        $morelink = "(";
        if ($fullcount > 0 or $c_count > 0 or $articlecomm == 0 or $acomm == 1) {
            $morelink .= "{$story_link}<b>" . _READMORE . "</b></a> | ";
        } else {
            $morelink .= "";
        }
        if ($fullcount > 0) {
            $morelink .= "{$totalcount} " . _BYTESMORE . " | ";
        }
        if ($articlecomm == 1 and $acomm == 0) {
            if ($c_count == 0) {
                $morelink .= "{$story_link}" . _COMMENTSQ . "</a>";
            } elseif ($c_count == 1) {
                $morelink .= "{$story_link}{$c_count} " . _COMMENT . "</a>";
            } elseif ($c_count > 1) {
                $morelink .= "{$story_link}{$c_count} " . _COMMENTS . "</a>";
            }
        }
        if ($score != 0) {
            $rated = substr($score / $ratings, 0, 4);
        } else {
            $rated = 0;
        }
        $morelink .= " | " . _SCORE . " {$rated}";
        $morelink .= ")";
        $morelink = str_replace(" |  | ", " | ", $morelink);
        $sid = intval($s_sid);
        $row2 = $db->sql_fetchrow($db->sql_query("select title from " . $prefix . "_stories_cat where catid='{$catid}'"));
        $title1 = stripslashes(check_html($row2['title'], "nohtml"));
        $title = "{$title1}: {$title}";
        themeindex($aid, $informant, $datetime, $title, $counter, $topic, $hometext, $notes, $morelink, $topicname, $topicimage, $topictext);
    }
    if ($httpref == 1) {
        $referer = $_SERVER["HTTP_REFERER"];
        if ($referer == "" or ereg("unknown", $referer) or eregi($nukeurl, $referer)) {
        } else {
            $db->sql_query("insert into " . $prefix . "_referer values (NULL, '{$referer}')");
        }
        $numrows = $db->sql_numrows($db->sql_query("select * from " . $prefix . "_referer"));
        if ($numrows == $httprefmax) {
            $db->sql_query("delete from " . $prefix . "_referer");
        }
    }
    include "footer.php";
}
示例#28
0
 /**
  * PM a user
  *
  * @param $user, $message
  * @return $string
  */
 function _pm($sender, $recipient, $message)
 {
     global $cfg;
     //
     require_once "inc/functions/functions.common.message.php";
     check_html($message, "nohtml");
     SaveMessage($recipient, $sender, $message);
 }
示例#29
0
     $reads = 0;
     while ($counting = $db->sql_fetchrow($res)) {
         $ccounter = $counting[counter];
         $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>";
 }
示例#30
0
function head()
{
    global $index, $artpage, $topic, $hlpfile, $hr, $theme, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $bgcolor5, $textcolor1, $textcolor2, $textcolor3, $textcolor4, $forumpage, $thename, $postnuke_theme, $pntheme, $themename, $themeimages, $additional_header, $themeOverrideCategory, $themeOverrideStory;
    // modification mouzaia .71
    $cWhereIsPerso = WHERE_IS_PERSO;
    if (!empty($cWhereIsPerso)) {
        include "modules/NS-Multisites/head.inc.php";
    } else {
        global $themesarein;
        if (pnUserLoggedIn() && pnConfigGetVar('theme_change') != 1) {
            $thistheme = pnUserGetTheme();
            if (isset($theme)) {
                $thistheme = pnVarPrepForOs($theme);
            }
        } else {
            $thistheme = pnConfigGetVar('Default_Theme');
            if (isset($theme)) {
                $thistheme = pnVarPrepForOs($theme);
            }
        }
        // eugenio themeover 20020413
        // override the theme per category or story
        // precedence is story over category override
        if ($themeOverrideCategory != '' && file_exists("themes/{$themeOverrideCategory}")) {
            $thistheme = $themeOverrideCategory;
        }
        if ($themeOverrideStory != '' && file_exists("themes/{$themeOverrideStory}")) {
            $thistheme = $themeOverrideStory;
        }
        if (@file(WHERE_IS_PERSO . "themes/" . $thistheme . "/theme.php")) {
            $themesarein = WHERE_IS_PERSO;
        } else {
            $themesarein = "";
        }
    }
    // eugenio themeover 20020413
    pnThemeLoad($thistheme);
    /**
     * Simple XHTML Beginnings
     */
    if (pnConfigGetVar('supportxhtml')) {
        //include("includes/xhtml.php");
        xhtml_head_start(0);
        /* Transitional Support for now */
    } else {
        echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
        echo "<html>\n<head>\n";
        if (defined("_CHARSET") && _CHARSET != "") {
            echo "<meta http-equiv=\"Content-Type\" " . "content=\"text/html; charset=" . _CHARSET . "\">\n";
        }
    }
    if ($artpage == 1) {
        /**
         * article page output
         */
        global $info, $hometext;
        echo "<title>{$info['title']} :: " . pnConfigGetVar('sitename') . ' :: ' . pnConfigGetVar('slogan') . "</title>\n";
        if (pnConfigGetVar('dyn_keywords') == 1) {
            $htmlless = check_html($info['maintext'], $strip = 'nohtml');
            $symbolLess = trim(ereg_replace('("|\\?|!|:|\\.|\\(|\\)|;|\\\\)+', ' ', $htmlless));
            $keywords = ereg_replace('( |' . CHR(10) . '|' . CHR(13) . ')+', ',', $symbolLess);
            $metatags = ereg_replace(",+", ",", $keywords);
            echo "<meta http-equiv=\"Keywords\" content=\"{$metatags}\">\n";
        } else {
            echo "<meta name=\"KEYWORDS\" content=\"" . pnConfigGetVar('metakeywords') . "\">\n";
        }
    } else {
        /**
         * all other page output
         */
        echo '<title>' . pnConfigGetVar('sitename') . ' :: ' . pnConfigGetVar('slogan') . "</title>\n";
        echo '<meta name="KEYWORDS" content="' . pnConfigGetVar('metakeywords') . "\">\n";
    }
    echo '<meta name="DESCRIPTION" content="' . pnConfigGetVar('slogan') . "\">\n";
    echo "<meta name=\"ROBOTS\" content=\"INDEX,FOLLOW\">\n";
    echo "<meta name=\"resource-type\" content=\"document\">\n";
    echo "<meta http-equiv=\"expires\" content=\"0\">\n";
    echo '<meta name="author" content="' . pnConfigGetVar('sitename') . "\">\n";
    echo '<meta name="copyright" content="Copyright (c) 2003 by ' . pnConfigGetVar('sitename') . "\">\n";
    echo "<meta name=\"revisit-after\" content=\"1 days\">\n";
    echo "<meta name=\"distribution\" content=\"Global\">\n";
    echo '<meta name="generator" content="PostNuke ' . _PN_VERSION_NUM . " - http://postnuke.com\">\n";
    echo "<meta name=\"rating\" content=\"General\">\n";
    global $themesarein;
    echo "<link rel=\"StyleSheet\" href=\"" . $themesarein . "themes/" . $thistheme . "/style/styleNN.css\" type=\"text/css\">\n";
    echo "<style type=\"text/css\">";
    echo "@import url(\"" . $themesarein . "themes/" . $thistheme . "/style/style.css\"); ";
    echo "</style>\n";
    echo "<script type=\"text/javascript\" src=\"javascript/showimages.php\"></script>\n\n";
    /* Enable Wysiwyg editor configuration at seeting Added by bharvey42 edited by Neo */
    $pnWysiwygEditor = pnConfigGetVar('WYSIWYGEditor');
    if (is_numeric($pnWysiwygEditor) && $pnWysiwygEditor == 1) {
        $pnWSEditorPath = pnGetBaseURI();
        echo "<!--Visual Editor Plug-in-->" . "<script type=\"text/javascript\">QBPATH='" . $pnWSEditorPath . "/javascript'; VISUAL=0; SECURE=1;</script>" . "<script type=\"text/javascript\" src='" . $pnWSEditorPath . "/javascript/quickbuild.js'></script>" . "<script type=\"text/javascript\" src='" . $pnWSEditorPath . "/javascript/tabedit.js'></script>";
    } else {
    }
    echo "<script type=\"text/javascript\" src=\"javascript/openwindow.php?hlpfile={$hlpfile}\"></script>\n\n";
    if (isset($additional_header)) {
        echo @implode("\n", $additional_header);
    }
    themeheader();
}