예제 #1
0
function deleteposting($uid)
{
    global $dbcon, $board;
    $id = getid($uid);
    if (!$id) {
        $reply = "Your posting is not in the system";
    } else {
        $getuid = $dbcon->Execute("Delete from {$board} where id = " . $dbcon->qstr($id));
        $reply = "Your posting has been removed from the board. <a href=\"{$PHP_SELF}\">Return to {$board} board</a><P>";
    }
    echo $reply;
}
예제 #2
0
파일: search.php 프로젝트: exts/nab145
function search()
{
    global $logged;
    if (!isset($_POST['submit'])) {
        $Temp = new Template();
        $Temp->dir = $logged['dskin'];
        $Temp->file = "search_find.tpl";
        $Temp->tp(__LINE__, __FILE__);
        return $Temp->html;
    } else {
        $t = $_POST['s'] == 2 ? 1 : 2;
        $type = $_POST['s'] == 2 ? '`topics`' : '`replies`';
        $type_ = $_POST['s'] == 2 ? '`title`' : '`post`';
        $query = htmlspecialchars($_POST['query']);
        $sql = mysql_query("SELECT * FROM " . $type . " WHERE " . $type_ . " LIKE '%" . $query . "%'");
        if (empty($query) || $query == "") {
            pageerror("Search Error", "Something was blank.", "Looks like you left the search field blank, please go back and try again.");
        }
        if (mysql_num_rows($sql) <= 0) {
            pageerror("Search Error", "Not found", "Looks like there wasn't post or topic in the database that matched your query.");
        }
        $content = "";
        while ($row = mysql_fetch_array($sql)) {
            switch ($t) {
                case 1:
                    if (getFP($row['fid'], 1)) {
                        $Temp = new Template();
                        $Temp->dir = $logged['dskin'];
                        $Temp->file = "search_msg.tpl";
                        $Temp->tp(__LINE__, __FILE__);
                        $Temp->tr(array('TID' => $row['id'], 'TNAME' => $row['title'], 'UID' => getid($row['username']), 'DATE' => !empty($row['date']) ? date("m-d-y", $row['date']) : 'unknown', 'MESSAGE' => nl2br(bbcode_format(getFirstPost($row['id']))), 'POSTER' => $row['username']));
                        $content .= $Temp->html;
                    }
                    break;
                case 2:
                    if (getFP(topic_parent_($row['id']), 1)) {
                        $Temp = new Template();
                        $Temp->dir = $logged['dskin'];
                        $Temp->file = "search_msg.tpl";
                        $Temp->tp(__LINE__, __FILE__);
                        $Temp->tr(array('TID' => $row['tid'], 'TNAME' => topicName($row['title']), 'UID' => getid($row['username']), 'DATE' => !empty($row['date']) ? date("m-d-y", $row['date']) : 'unknown', 'MESSAGE' => nl2br(bbcode_format($row['post'])), 'POSTER' => $row['username']));
                        $content .= $Temp->html;
                    }
                    break;
            }
        }
        if (empty($content) || $content == "") {
            pageerror("Search Error", "Not found", "Looks like there wasn't post or topic in the database that matched your query.");
        }
        return $content;
    }
}
예제 #3
0
function emailadd($email)
{
    global $dbcon;
    $MM_insert = 1;
    mt_srand((double) microtime() * 1000000);
    $randval = mt_rand();
    $MM_editTable = "phplist_user_user";
    $MM_fieldsStr = "email|value|confirmed|value|randval|value|htmlemail|value|entered|value";
    $MM_columnsStr = "email|',none,''|confirmed|none,1,1|uniqid|',none,''|htmlemail|none,1,1|entered|',none,now()";
    require "Connections/insetstuff.php";
    require "Connections/dataactions.php";
    $emailid = getid($email);
    return $emailid;
}
예제 #4
0
파일: wrappers.php 프로젝트: exts/nab145
 function users_online()
 {
     $all_users = "";
     echo "<b>Users Online:</b><br />";
     $time = time() - 300;
     $users = mysql_query("SELECT `level`,`username` FROM users WHERE online >= '{$time}' ORDER BY online DESC");
     $USZ = mysql_num_rows($users);
     if ($USZ == 0) {
         echo "There hasn't been anyone online in the past 5 minutes.";
     } else {
         while ($uzas = mysql_fetch_array($users)) {
             $all_users .= "<a style='text-decoration:none;' href='?act=profile&amp;profile;id=" . getid($uzas['username']) . "' title=\"View " . $uzas['username'] . "'s Profile\">" . legend($uzas['level'], $uzas['username']) . "</a>,";
         }
     }
     echo substr($all_users, 0, strlen($all_users) - 1);
 }
예제 #5
0
<?
    require_once '../lib/util.php';
    if (isset($_POST['newuser'])) {
        sql("SELECT uid FROM users WHERE username='******'username']}';");
        if (getrow()) {
            $message = 'Username already taken';
        } else {
            sql("INSERT INTO users (username, password) VALUES ('{$_POST['username']}', '{$_POST['password']}');");
            session_start();
            $_SESSION['uid'] = getid();
            redirect($_POST['redirect']);
            die("You are now logged in (for some reason the redirect didn't work)");
        }
    } else {
        sql("SELECT uid FROM users WHERE username='******'username']}' AND password='******'password']}';");
        if ($row = getrow()) {
            session_start();
            $_SESSION['uid'] = $row['uid'];
            redirect($_POST['redirect']);
            die("You are now logged in (for some reason the redirect didn't work)");
        }
    }
?>
<html>
    <head><title>Login</title></head>
    <body>
        <h1> DISCLAIMER: <font color=red>Do not use your real password</font></h1>
        <hr>
        Log in:
        <form method='POST'>
            <? hiddenInputs($_GET) ?>
예제 #6
0
<!DOCTYPE html>

<?php 
include "includes/app_top.php";
$getid = getid('rid');
checkUserLogin();
include "includes/styles.php";
include "../includes/colorbox.php";
?>
<script type="text/javascript">  
function validatefilter() {	
if(document.getElementById('keyword').value=='') {
alert("Enter keyword");
document.getElementById('keyword').focus();
return false;
}
} 
</script>

<link rel="stylesheet" href="../css/styles.css" type="text/css" />
    
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">

</head>
<body>
<?php 
include "includes/header.php";
?>
<div class="division-1">
<h1>LEADERBOARDS</h1>
예제 #7
0
 <?php 
require_once 'include/db_connect.php';
session_start();
if (!$_SESSION['name']) {
    header("Location:index.php");
}
?>
       
<?php 
require_once 'include/db_connect.php';
require_once 'functions.php';
$lname = $_SESSION['name'];
$pid1 = getid($lname, 'user_id');
#echo $pid1;
?>




<?php 
require_once 'include/db_connect.php';
require_once 'functions.php';
$my_id = $pid1;
$action = mysql_real_escape_string($_GET['action']);
$user = mysql_real_escape_string($_GET['user']);
if ($action == 'send') {
    $in = mysql_query("insert into frnd_req(from1,to1) values('{$my_id}','{$user}')");
}
if ($action == 'cancel') {
    $in = mysql_query("delete from frnd_req where from1='{$my_id}' and to1='{$user}'");
}
예제 #8
0
파일: faqs.php 프로젝트: AamAadmiParty/emc3
<?php

include "includes/app_top.php";
$pcat = "Website";
$pagetitle = "FAQS";
$getid = getid('id');
$pid = getid('pid');
$t = get('t');
checkAdminLogin();
checkState();
if ($action == "addvideo") {
    $orderno = $_POST['orderno'] != '' ? cleanQuery($_POST['orderno']) : 20;
    $query = "insert into videos(heading,state_id,  orderno, youtube, datemodified) VALUE ('" . cleanQuery($_POST['heading']) . "','" . cleanQuery($_POST['stateid']) . "', " . $orderno . ",'" . cleanQuery($_POST['videoid']) . "','{$date}')";
    mysqli_query($mysqli, $query);
    // echo $query;
    tep_redirect(tep_href_link($pagename, 'action1=add&action=add'));
}
if ($action == "change") {
    $orderno = $_POST['orderno2'] != '' ? cleanQuery($_POST['orderno2']) : 20;
    $query = "update videos set heading='" . cleanQuery($_POST['heading2']) . "',state_id='" . cleanQuery($_POST['stateid']) . "', orderno=" . $orderno . ", youtube='" . cleanQuery($_POST['videoid2']) . "', datemodified='{$date}'  where id=" . $getid;
    mysqli_query($mysqli, $query);
    tep_redirect(tep_href_link($pagename, 'action1=update'));
}
?>
 
<?php 
include "includes/styles.php";
include "includes/colorbox.php";
?>
<script type="text/javascript">
function validate1(form){
    if (!($r % 2)) {
        echo '
      <tr>
        <td>&nbsp;</td>
        <td>
		<div class="card">
        ' . getid($_REQUEST["sel_students"][$r]) . '
        </div>
		</td>
				';
    } else {
        echo '
        <td ' . setput($spaceb) . '>&nbsp;</td>
        <td>
        <div class="card">
        ' . getid($_REQUEST["sel_students"][$r]) . '
        </div>
        </td>
        <td>&nbsp;</td>
      </tr>
				';
        $tr_close = 1;
    }
    ?>
		
    <?php 
}
//End ::: for($r = 0; $r < count($_REQUEST["sel_students"]); $r++)
if (!$tr_close) {
    echo "</tr>\n";
}
<?php

require_once 'include/db_connect.php';
require_once 'functions.php';
$uname = $_POST['uname'];
$sname = $_POST['sname'];
$hsname = $_POST['hsname'];
$gname = $_POST['gname'];
$pgname = $_POST['pgname'];
$i1 = $_POST['i1'];
$i2 = $_POST['i2'];
$s1 = $_POST['s1'];
$s2 = $_POST['s2'];
$gender = $_POST['sex'];
$you = $_POST['you'];
$uid1 = getid($uname, 'user_id');
$category;
if ($gname !== "null") {
    $ghash = rand(1004545, 44646546464.0);
} else {
    $ghash = 1004546;
    gnone();
}
$shash = rand(205, 546844);
if ($hsname !== "null") {
    $hhash = rand(141, 541654165465.0);
} else {
    $hhash = 142;
    inone();
}
if ($pgname !== "null") {
예제 #11
0
<?php

include "includes/app_top.php";
$pcat = "Members";
$pagetitle = "Send Mail";
checkAdminLogin();
checkState();
$getid = getid('id');
$mid = getid('mid');
$aid = getid('aid');
$aa = "";
if ($action == 'send') {
    $email = cleanQuery($_POST['emailfrom']);
    $esubject = $_POST['subject2'];
    $emailtext = "<div style='font-family:Trebuchet MS; font-size:13px;'>" . $_POST['description'] . "</div>";
    $text = $_POST['emails'];
    $list = split("[\n\t\r,]+", $text);
    # This sends the email to the addresses entered
    $no = count($list);
    $emailtext = str_replace("'", "\\'", $emailtext);
    $emailtext = str_replace('\\"', '"', $emailtext);
    require 'includes/mailer.php';
    for ($i = 0; $i < $no; $i++) {
        sendmail($email, "Aam Aadmi Party", $list[$i], $esubject, $emailtext);
        //$aa=@mail("$list[$i]", $esubject, $emailtext, "From: $email\r\nReply-to: $email\r\nContent-type: text/html; charset=utf-8");
    }
    //if($aa)
    tep_redirect(tep_href_link($pagename, 'action1=success'));
    //else
    //tep_redirect(tep_href_link($pagename,'action1=err'));
    //echo $esubject.'<br/>'.$emailtext;
 function TicketMessageCreate()
 {
     Server::InitCacheManager();
     $message = new TicketMessage();
     $params = ApiV2::GetObjectFields("TicketMessage");
     if ($message = $this->CreateFromJSON($params, json_decode($_POST["p_data"]), $message, "TicketMessage")) {
         $ticket = new Ticket($message->TicketId, true);
         $ticket->LoadMessages();
         if (count($ticket->Messages) == 0) {
             $message->Id = $ticket->Id;
         } else {
             $message->Id = getid(32);
         }
         if (!empty($message->SenderId)) {
             if (Operator::GetSystemId($message->SenderId) != null) {
                 $message->SenderUserId = Operator::GetSystemId($message->SenderId);
             }
         }
         if (is_array($message->Customs)) {
             $message->Customs = ApiV2::ToNameBasedArray($message->Customs);
             $message->Customs = DataInput::ToIndexBased($message->Customs);
         }
         if (is_array($message->Comments)) {
             foreach ($message->Comments as $comar) {
                 $message->AddComment($comar[0], $ticket->Id, $comar[1]);
             }
         }
         if (empty($message->ChannelId)) {
             $message->ChannelId = getId(32);
         }
         $message->Hash = $ticket->GetHash();
         $message->Save($ticket->Id);
         if (!empty($_POST["p_sendemailreply"])) {
             $ticket->Load();
             $ticket->SendEditorReply($message->Id, !empty($_POST["p_quotemessageid"]) ? $_POST["p_quotemessageid"] : "");
         }
         if (!empty($_POST["p_sendemailresponder"])) {
             $ticket->Load();
             $ticket->SendAutoresponder(null, null, $message);
         }
         $ticket->SetLastUpdate(time());
         $this->JSONOutput = APIV2::Encode(array("TicketMessage" => ApiV2::ClearObject($params, $message)), $this->JSONParams);
     }
 }
예제 #13
0
 function TicketMessageCreate()
 {
     $message = new TicketMessage();
     $params = ApiV2::GetObjectFields("TicketMessage");
     if ($message = $this->CreateFromJSON($params, json_decode($_POST["p_data"]), $message, "TicketMessage")) {
         $ticket = new Ticket($message->TicketId, true);
         $ticket->LoadMessages();
         if (count($ticket->Messages) == 0) {
             $message->Id = $ticket->Id;
         } else {
             $message->Id = getid(32);
         }
         if (is_array($message->Customs)) {
             $message->Customs = ApiV2::ToNameBasedArray($message->Customs);
             $message->Customs = DataInput::ToIndexBased($message->Customs);
         }
         if (is_array($message->Comments)) {
             foreach ($message->Comments as $comar) {
                 $message->AddComment($comar[0], $ticket->Id, $comar[1]);
             }
         }
         if (empty($message->ChannelId)) {
             $message->ChannelId = getId(32);
         }
         $message->Hash = $ticket->GetHash();
         $message->Save($ticket->Id);
         $this->JSONOutput = APIV2::Encode(array("TicketMessage" => ApiV2::ClearObject($params, $message)), $this->JSONParams);
     }
 }
예제 #14
0
function doid($file)
{
    return str_replace("../", "", $file) . ": <br>&nbsp; &nbsp; ID[" . getid($file) . "] MD5[" . getmd5($file) . "]<br>";
}
예제 #15
0
 $HUSERLIST = new Hashmap();
 $user_id = $facebook->getUser();
 $H1 = getid($facebook, $user_id);
 //1st time get user's
 // echo array_sum($H->values());
 //print_r ($H);
 $H->putAll($H1);
 $one = $H1->keys();
 $HUSERLIST->put($user_id, $one);
 //print_r ($one);
 echo "</br>";
 for ($i = 0; $i < count($one); $i++) {
     //2nd get user's 1st
     //echo ($one[$i])."</br>";
     // echo $i."</br>";
     $H2 = getid($facebook, $one[$i]);
     $f1 = $H1->get($one[$i]);
     $H->mulAll($H2, 0.7 + 0.2 * $f1);
     $one2 = $H2->keys();
     $HUSERLIST->put($one[$i], $one2);
 }
 $H->putAll($H1);
 $H->remove($user_id);
 //echo "H:".array_sum($H->values());
 $H->Hsort();
 // print_r ($H);
 $endk = $H->keys();
 $enflist = array_diff($endk, $flist);
 $eflist = array_diff($endk, $enflist);
 //print_r ($endk);
 $ecou = count($endk);
예제 #16
0
        ?>
</option>
            <?php 
    }
    ?>
        </select><br />
    Rang : <input type="text" name="rang"/><br />
    Points : <input type="text" name="points"/><br />
    nbMatchs : <input type="text" name="nbMatchs"/><br />
    <input type="submit" name="Envoyer">
    </form>
<?php 
}
if (isset($_POST['Envoyer'])) {
    if (!empty($_POST["nom"]) && !empty($_POST["prenom"]) && !empty($_POST["rang"]) && !empty($_POST["points"]) && !empty($_POST['nbMatchs'])) {
        $id = getid();
        $nom = $_POST['nom'];
        $prenom = $_POST['prenom'];
        $cp = $_POST['cp'];
        $rang = $_POST['rang'];
        $points = $_POST['points'];
        $nbMatchs = $_POST['nbMatchs'];
        $query = $pdo->prepare("insert into joueur values(:id,:nom,:prenom,:cp)");
        $query->bindValue(':id', $id);
        $query->bindValue(':nom', $nom);
        $query->bindValue(':prenom', $prenom);
        $query->bindValue(':cp', $cp);
        $query->execute();
        $query = $pdo->prepare("insert into classement values(:id,now(),:rang,:points,0,:nbMatchs)");
        $query->bindValue(':id', $id);
        $query->bindValue(':rang', $rang);
예제 #17
0
<?php

include "includes/app_top.php";
$pcat = "Contacts";
$getid = getid('id');
checkAdminLogin();
checkState();
$cid = getid('cid');
$t = getid('t');
$w = getid('w');
if ($t != '') {
    $_SESSION['t'] = $t;
}
if ($page != "") {
    $t = $_SESSION['t'];
}
$pagetitle = "Contacted";
if ($t == 0) {
    $pagetitle = "Not " . $pagetitle;
}
if ($cid != '' && $cid != 0) {
    $_SESSION['cid'] = $cid;
}
if ($cid == '' && isset($_SESSION['cid'])) {
    $cid = $_SESSION['cid'];
}
include "includes/styles.php";
?>
 
</head>
<body>
예제 #18
0
include realpath(dirname(__FILE__) . "/" . "resources_util.php");
if ($_SERVER['REQUEST_METHOD'] == "POST") {
    $cmd = $_POST['cmd'];
    $tgt = $_POST['tgt'];
    $scconf = "/tmp/" . $_POST['cfg'] . ".sc";
    $known = array();
    $types = array();
    $results = array();
    $myresults = array();
    //  file_put_contents("testout", "get_clusters cmd ".$cmd."\n", FILE_APPEND);
    //  file_put_contents("testout", "get_clusters tgt ".$tgt."\n", FILE_APPEND);
    if ($cmd == "s3bucket") {
        switch ($tgt) {
            case 0:
                // aws
                $tmp = getid($cmd, $results, $scconf);
                break;
            case 1:
                // local
                $results[0] = "local";
        }
    } elseif ($cmd == "cluster") {
        switch ($tgt) {
            case 0:
                // aws
                // get fully configured sc clusters
                // $tmp = getid2($cmd, $known, $scconf);
                // get known cluster types
                $tmp = getawstypes($types);
                $clustdb = array();
                $k = 0;
예제 #19
0
<?php

include "includes/app_top.php";
$pcat = "Members";
$pagetitle = "Members";
checkAdminLogin();
checkState();
$getid = getid('id');
$uid = getid('uid');
if ($action == "statusconfirm") {
    $count = (int) $_POST['count'];
    $pstatus = $_POST['pstatus2'];
    for ($i = 1; $i <= $count; $i++) {
        $cb = 'checkbox' . $i;
        $userid = $_POST[$cb];
        if ($userid != "") {
            $query = "update users set status2={$pstatus} where id=" . $userid;
            mysqli_query($mysqli, $query);
        }
    }
    tep_redirect(tep_href_link($pagename, 'action1=success6'));
}
if ($action == "delete2") {
    $count = (int) $_POST['count'];
    for ($i = 1; $i <= $count; $i++) {
        $cb = 'checkbox' . $i;
        $ppid = $_POST[$cb];
        if ($ppid != "") {
            $query = "delete from users where id=" . $ppid;
            mysqli_query($mysqli, $query);
        }
예제 #20
0
파일: import.php 프로젝트: onyxnz/quartzpos
        $brn = array('brand' => $brandn, 'code' => $brand);
        upins('brands', $brn, '', $db);
        $table = 'brands';
        $data['col'] = 'brand';
        $data['val'] = $brandn;
        $id = getid($table, $data, $db);
        $arr['brand_id'] = $id;
    }
    if (!empty($supplier)) {
        $suppliern = getbrcat($supplier, $db);
        $sup = array('supplier' => $suppliern, 'code' => $supplier);
        upins('suppliers', $sup, '', $db);
        $table = 'suppliers';
        $data['col'] = 'supplier';
        $data['val'] = $suppliern;
        $id = getid($table, $data, $db);
        $arr['supplier_id'] = $id;
    }
    upins('items', $arr, '', $db);
}
echo "<br><h3>Import completed of {$counter} items</h3><br><br>";
echo "<input type='button' value='Close' onclick='window.close();'>";
echo "</div></body>";
//CREATE TABLE IF NOT EXISTS `items` (
//  `id` int(8) NOT NULL AUTO_INCREMENT,
//  `item_name` varchar(30) NOT NULL,
//  `item_number` varchar(20) DEFAULT NULL,
//  `description` tinytext,
//  `brand_id` int(8) NOT NULL,
//  `category_id` int(8) NOT NULL,
//  `supplier_id` int(8) NOT NULL,
예제 #21
0
function emailadd($email)
{
    global $dbcon;
    mt_srand((double) microtime() * 1000000);
    $randval = mt_rand();
    $MM_editTable = "phplist_user_user";
    $MM_fieldsStr = "email|value|confirmed|value|randval|value|htmlemail|value|entered|value";
    $MM_columnsStr = "email|',none,''|confirmed|none,1,1|uniqid|',none,''|htmlemail|none,1,1|entered|',none,now()";
    insert_record($MM_editTable, $MM_fieldsStr, $MM_columnsStr);
    $emailid = getid($email);
    return $emailid;
}
예제 #22
0
 public function view()
 {
     $params = App::getRouter()->getParams();
     if (isset($params[0])) {
         $res = $this->model->getList(false, $params[0]);
         // проверим а не свой ли товар пользователь хочет купить.
         if ($res[0]['user_id'] != getid()) {
             $this->data['mainlist'] = $this->model->getDetail($params);
             // товар не свой... все ок.
         } else {
             Router::redirect('/');
             // свой товар низзя покупать.
         }
     }
 }
예제 #23
0
파일: main.php 프로젝트: GloriaShen/Gwork
        $url = $auth_url;
        $auth = true;
    } else {
        $url = "error.html?2";
        $auth = false;
    }
} else {
    $url = "error.html?3";
    $auth = false;
}
if (!auth) {
    header("Location:{$url}");
}
$wecha_id = $auth_data[1];
$id = getid();
$string1 = "gj|" . $wecha_id . "|" . getid() . "|2";
$auth_url1 = hx_auth_urlgj($string1, "/index.php?g=Wap&m=Hxsd&a=index");
$url1 = $auth_url1;
if (!auth) {
    header("Location:{$url}");
}
setcookie('wecha_id', $wecha_id, time() + 365 * 24 * 60 * 60);
require_once "wxshare.php";
?>


<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <title>千万感恩•华西盛点</title>
예제 #24
0
파일: index.php 프로젝트: papay007/sap
         for ($i = 4; $i < count($items) - 1; $i++) {
             $equation_items[] = $items[$i];
         }
         $equations[] = array('result' => $items[2], 'items' => $equation_items);
     }
 }
 if ($line[0] == '>') {
     $table = false;
     echo "</table>";
 }
 if ($table) {
     $items = explode('|', $line);
     echo "<tr>";
     foreach ($items as $td) {
         if ($td[0] == '(') {
             $id = getid($td);
             echo "<td style='padding:8px 6px 0px 6px; width:60px'><input style='width:60px' id='" . $id . "' type='text' placeholder='" . $id . "' /></td>";
         } else {
             echo "<td>" . $td . "</td>";
         }
     }
     echo "</tr>";
 }
 if ($line[0] == '<') {
     $table = true;
     echo "<table class='table table-bordered'>";
 }
 // Parse monthly table automatically
 if ($line[0] == 'm' && !$table) {
     $tag = substr($line, 3, -1);
     $d = '';
예제 #25
0
<?php

include "includes/app_top.php";
$pcat = "Website";
$pagetitle = "Inner Pages";
$getid = getid('id');
$stateid = getid('stateid');
if ($stateid != '') {
    $_SESSION['stateid'] = $stateid;
}
checkAdminLogin();
checkState();
include "includes/styles.php";
?>
</head>
<body>
<?php 
include "includes/header.php";
include "includes/side-bar.php";
?>

        
        <div class="pageHeadingBlock ">
        	<div class="grayBackground">
            <div class="fR t-r spcT_c">
            <a href="manage-innerpage.php" class="btn btn-primary coursesMenu">Add  Page</a>
            </div>
        	<h3 class="title">Inner Pages</h3>
            <div class="sectionTabNav">
            	<?php 
echo $tab_website;
예제 #26
0
<?php

require_once 'include/db_connect.php';
require_once 'functions.php';
$ser = $_POST['ser'];
echo $ser1 = getid($ser, 'user_id');
header("location:profile.php?user={$ser1}");
예제 #27
0
/**
* Handles the actual XML between the <template/> tags.
*
* Recognises the different tags, access the different functions to process each individual tag. Notes by the original developer: <br/>
* Why isn't this a huge switch statement? Because it has to do more comlicated checking than just string comparison to figure out what it should do. <br/>
* How can I organize this better? Good question.
*
* @todo It seems to me that this function could modelled similarly to the custom tag system. Where there is a seperate function for each tag.
*
* @uses getid()
* @uses getfdate()
* @uses getsize()
* @uses upperkeysarray()
* @uses debugger()
* @uses recursechildren()
* @uses respond()
* @uses botget()
* @uses gender()
* @uses getinput()
* @uses bset()
* @uses insertgossip()
* @uses firstthird()
* @uses firstsecond()
* @uses getthat()
* @uses realchild()
*
* @param mixed $xmlnode               Getting either a string or an array from recursechildren() func.
* @param array $inputstar             If a matched pattern includes *'s then what is covere by the * is found here.
* @param array $thatstar              if a used that contains a star, then what is covered by the * is found here.
* @param array $topicstar             if a used topic contains a star, then what is covered by the * is found here.
*
* @return string                      The bot's response.
*/
function handlenode($xmlnode, $inputstar, $thatstar, $topicstar)
{
    if (!is_array($xmlnode)) {
        return $xmlnode;
    } elseif (strtoupper($xmlnode["tag"]) == "ID") {
        return getid();
    } elseif (strtoupper($xmlnode["tag"]) == "DATE") {
        //		return getfdate(); // deprecated
        $mynode = upperkeysarray($xmlnode["attributes"]);
        // Get the value of an attribute
        $date_format = $mynode["FORMAT"];
        return getfdate($date_format);
    } elseif (strtoupper($xmlnode["tag"]) == "VERSION") {
        return PROGRAMEVERSION;
    } elseif (strtoupper($xmlnode["tag"]) == "SIZE") {
        return getsize();
    } elseif (strtoupper($xmlnode["tag"]) == "STAR") {
        $mynode = upperkeysarray($xmlnode["attributes"]);
        //$starindex=$xmlnode["attributes"]["INDEX"];
        if (!(is_array($mynode) && isset($mynode["INDEX"]))) {
            $mynode["INDEX"] = "";
        }
        $starindex = $mynode["INDEX"];
        if ($starindex == "") {
            $starindex = "1";
        }
        debugger("starindex: {$starindex}", 3);
        //print_r($inputstar);
        return $inputstar[$starindex - 1];
    } elseif (strtoupper($xmlnode["tag"]) == "THATSTAR") {
        $mynode = upperkeysarray($xmlnode["attributes"]);
        //$starindex=$xmlnode["attributes"]["INDEX"];
        if (!(is_array($mynode) && isset($mynode["INDEX"]))) {
            $mynode["INDEX"] = "";
        }
        $starindex = $mynode["INDEX"];
        if ($starindex == "") {
            $starindex = "1";
        }
        debugger("starindex: {$starindex}", 3);
        //print_r($inputstar);
        return $thatstar[$starindex - 1];
    } elseif (strtoupper($xmlnode["tag"]) == "TOPICSTAR") {
        $mynode = upperkeysarray($xmlnode["attributes"]);
        //$starindex=$xmlnode["attributes"]["INDEX"];
        if (!(is_array($mynode) && isset($mynode["INDEX"]))) {
            $mynode["INDEX"] = "";
        }
        $starindex = $mynode['INDEX'];
        if ($starindex == "") {
            $starindex = "1";
        }
        debugger("starindex: {$starindex}", 3);
        //print_r($inputstar);
        return $topicstar[$starindex - 1];
    } elseif (strtoupper($xmlnode["tag"]) == "SRAI") {
        // Build up a new response inside of here (using recursechildren function and then call response with it.
        $newresponse = recursechildren(realchild($xmlnode), $inputstar, $thatstar, $topicstar);
        debugger("newresponts: {$newresponse}", 3);
        return respond($newresponse);
    } elseif (strtoupper($xmlnode["tag"]) == "SR") {
        return respond($inputstar[0]);
    } elseif (strtoupper($xmlnode["tag"]) == "RANDOM") {
        $liarray = array();
        $children = $xmlnode["children"];
        for ($randomc = 0; $randomc < sizeof($children); $randomc++) {
            if (strtoupper($children[$randomc]["tag"]) == "LI") {
                $liarray[] = $randomc;
            }
        }
        // Pick a random number from 0 to sizeof($liarray)-1
        mt_srand((double) microtime() * 1000000);
        $lirandom = mt_rand(0, sizeof($liarray) - 1);
        return recursechildren(realchild($children[$liarray[$lirandom]]), $inputstar, $thatstar, $topicstar);
    } elseif (strtoupper($xmlnode["tag"]) == "THINK") {
        recursechildren(realchild($xmlnode), $inputstar, $thatstar, $topicstar);
        return "";
    } elseif (strtoupper($xmlnode["tag"]) == "BOT") {
        $mynode = upperkeysarray($xmlnode["attributes"]);
        //$name=$xmlnode["attributes"]["NAME"];
        $name = $mynode["NAME"];
        return botget($name);
    } elseif (strtoupper($xmlnode["tag"]) == "GET") {
        $mynode = upperkeysarray($xmlnode["attributes"]);
        //$name=$xmlnode["attributes"]["NAME"];
        $name = $mynode["NAME"];
        return bget($name);
    } elseif (strtoupper($xmlnode["tag"]) == "SET") {
        //$name=$xmlnode["attributes"]["NAME"];
        $mynode = upperkeysarray($xmlnode["attributes"]);
        $name = $mynode["NAME"];
        $value = recursechildren(realchild($xmlnode), $inputstar, $thatstar, $topicstar);
        bset($name, $value);
        return $value;
    } elseif (strtoupper($xmlnode["tag"]) == "UPPERCASE") {
        $value = recursechildren(realchild($xmlnode), $inputstar, $thatstar, $topicstar);
        return strtoupper($value);
    } elseif (strtoupper($xmlnode["tag"]) == "FORMAL") {
        $nvalue = "";
        $value = recursechildren(realchild($xmlnode), $inputstar, $thatstar, $topicstar);
        $value = strtolower($value);
        $words = split(" ", $value);
        for ($x = 0; $x < sizeof($words); $x++) {
            if ($x != 0) {
                $nvalue .= " ";
            }
            $nvalue .= ucfirst($words[$x]);
        }
        return $nvalue;
    } elseif (strtoupper($xmlnode["tag"]) == "LOWERCASE") {
        $value = recursechildren(realchild($xmlnode), $inputstar, $thatstar, $topicstar);
        return strtolower($value);
    } elseif (strtoupper($xmlnode["tag"]) == "GENDER") {
        $value = recursechildren(realchild($xmlnode), $inputstar, $thatstar, $topicstar);
        return gender($value);
    } elseif (strtoupper($xmlnode["tag"]) == "SENTENCE") {
        $value = recursechildren(realchild($xmlnode), $inputstar, $thatstar, $topicstar);
        return ucfirst($value);
    } elseif (strtoupper($xmlnode["tag"]) == "INPUT") {
        $mynode = upperkeysarray($xmlnode["attributes"]);
        //$index = $xmlnode["attributes"]["INDEX"];
        if (!(is_array($mynode) && isset($mynode["INDEX"]))) {
            $mynode["INDEX"] = "";
        }
        $index = $mynode["INDEX"];
        if ($index == "") {
            $index = 1;
        }
        $index = $index - 1;
        return getinput($index);
    } elseif (strtoupper($xmlnode["tag"]) == "GOSSIP") {
        $value = recursechildren(realchild($xmlnode), $inputstar, $thatstar, $topicstar);
        insertgossip($value);
        return $value;
    } elseif (strtoupper($xmlnode["tag"]) == "PERSON") {
        $value = recursechildren(realchild($xmlnode), $inputstar, $thatstar, $topicstar);
        if ($value == "") {
            $value = $inputstar[0];
        }
        return firstthird($value);
    } elseif (strtoupper($xmlnode["tag"]) == "PERSON2") {
        $value = recursechildren(realchild($xmlnode), $inputstar, $thatstar, $topicstar);
        if ($value == "") {
            $value = $inputstar[0];
        }
        return firstsecond($value);
    } elseif (strtoupper($xmlnode["tag"]) == "THAT") {
        $mynode = upperkeysarray($xmlnode["attributes"]);
        //$indexes = $xmlnode["attributes"]["INDEX"];
        if (is_array($mynode) && isset($mynode["INDEX"])) {
            $indexes = $mynode["INDEX"];
        } else {
            $indexes = "";
        }
        $indexes = split(",", $indexes);
        if (sizeof($indexes) < 2) {
            $indexes = array();
            $indexes[] = 1;
            $indexes[] = 1;
        }
        return getthat($indexes[0], $indexes[1]);
    } elseif (strtoupper($xmlnode["tag"]) == "CONDITION") {
        $mynode = upperkeysarray($xmlnode["attributes"]);
        // First do multi condition name=value
        if (is_array($mynode) && isset($mynode["NAME"])) {
            $condname = $mynode["NAME"];
        } else {
            $condname = "";
        }
        if (is_array($mynode) && isset($mynode["VALUE"])) {
            $condvalue = $mynode["VALUE"];
        } else {
            $condvalue = "";
        }
        if (is_array($mynode) && isset($mynode["CONTAINS"])) {
            $condcontains = $mynode["CONTAINS"];
        } else {
            $condcontains = "";
        }
        if (is_array($mynode) && isset($mynode["EXISTS"])) {
            $condexists = $mynode["EXISTS"];
        } else {
            $condexists = "";
        }
        /*
        		$condname=$mynode["NAME"];
        		$condvalue=$mynode["VALUE"];
        		$condcontains=$mynode["CONTAINS"];
        		$condexists=$mynode["EXISTS"];
        */
        // If this is a multi condition
        if ($condname != "" && $condvalue != "") {
            if ($condvalue != "") {
                $condtype = "VALUE";
            } elseif ($condcontains != "") {
                $condtype = "CONTAINS";
            } elseif ($condexists != "") {
                $condtype = "EXISTS";
            }
            if ($condtype == "VALUE") {
                $condvalue = "^" . str_replace("*", "(.*)", $condvalue);
                //if ((bget($condname))==$condvalue){
                #				if (eregi($condvalue,bget($condname))){
                if (stripos(bget($condname), $condvalue) !== false) {
                    return recursechildren(realchild($xmlnode), $inputstar, $thatstar, $topicstar);
                }
            }
        } elseif ($condname != "" && $condvalue == "") {
            $children = $xmlnode["children"];
            $checkval = bget($condname);
            // After a match break. If no match then execute last if no name or val
            for ($randomc = 0; $randomc < sizeof($children); $randomc++) {
                if (strtoupper($children[$randomc]["tag"]) == "LI") {
                    $mynode = upperkeysarray($children[$randomc]["attributes"]);
                    //$condvalue=$children[$randomc]["attributes"]["VALUE"];
                    if (!(is_array($mynode) && isset($mynode["VALUE"]))) {
                        $mynode["VALUE"] = "";
                    }
                    $condvalue = $mynode["VALUE"];
                    $condvalue = "^" . str_replace("*", "(.*)", $condvalue) . "\$";
                    #					if ((eregi($condvalue,$checkval))||($condvalue=="^\$")){
                    if (preg_match("/" . $condvalue . "/i", $checkval) || $condvalue == "^\$") {
                        return recursechildren(realchild($children[$randomc]), $inputstar, $thatstar, $topicstar);
                    }
                }
            }
        } elseif ($condname == "" && $condvalue == "") {
            $children = $xmlnode["children"];
            // After a match break. If no match then execute last if no name or val
            for ($randomc = 0; $randomc < sizeof($children); $randomc++) {
                if (strtoupper($children[$randomc]["tag"]) == "LI") {
                    $mynode = upperkeysarray($children[$randomc]["attributes"]);
                    if (is_array($mynode) && isset($mynode["NAME"])) {
                        $condname = $mynode["NAME"];
                    } else {
                        $condname = "";
                    }
                    if (is_array($mynode) && isset($mynode["VALUE"])) {
                        $condvalue = $mynode["VALUE"];
                    } else {
                        $condvalue = "";
                    }
                    $condvalue = "^" . str_replace("*", "(.*)", $condvalue) . "\$";
                    #					if ((eregi($condvalue,bget($condname))) || (($condvalue=="^\$")&&($condname==""))){
                    if (preg_match("/" . $condvalue . "/i", bget($condname)) || $condvalue == "^\$" && $condname == "") {
                        return recursechildren(realchild($children[$randomc]), $inputstar, $thatstar, $topicstar);
                    }
                }
            }
        }
    } elseif (strtoupper($xmlnode["tag"]) == "SYSTEM") {
        $command = recursechildren(realchild($xmlnode), $inputstar, $thatstar, $topicstar);
        exec($command, $execoutput);
        for ($x = 0; $x < sizeof($execoutput); $x++) {
            $allout = $allout . $execoutput[$x];
        }
        return $allout;
    } elseif (strtoupper($xmlnode["tag"]) == "PHP") {
        $phpcode = recursechildren(realchild($xmlnode), $inputstar, $thatstar, $topicstar);
        ob_start();
        eval($phpcode);
        $evaled = ob_get_contents();
        ob_end_clean();
        return $evaled;
    } elseif (strtoupper($xmlnode["tag"]) == "JUSTBEFORETHAT") {
        $indexes = array();
        $indexes[] = 2;
        $indexes[] = 1;
        return getthat($indexes[0], $indexes[1]);
    } elseif (strtoupper($xmlnode["tag"]) == "JUSTTHAT") {
        $index = 2;
        $index = $index - 1;
        return getinput($index);
    } elseif (strtoupper($xmlnode["tag"]) == "BEFORETHAT") {
        $index = 3;
        $index = $index - 1;
        return getinput($index);
    } elseif (strtoupper($xmlnode["tag"]) == "GET_IP") {
        return getid();
    } elseif (strtoupper($xmlnode["tag"]) == "GETNAME") {
        $name = "NAME";
        return bget($name);
    } elseif (strtoupper($xmlnode["tag"]) == "GETSIZE") {
        return getsize();
    } elseif (strtoupper($xmlnode["tag"]) == "GETTOPIC") {
        $name = "TOPIC";
        return bget($name);
    } elseif (strtoupper($xmlnode["tag"]) == "GETVERSION") {
        return PROGRAMEVERSION;
    } elseif (substr(strtoupper($xmlnode["tag"]), 0, 4) == "GET_") {
        $name = substr($xmlnode["tag"], 4);
        return bget($name);
    } elseif (strtoupper($xmlnode["tag"]) == "SETNAME") {
        $name = "NAME";
        $value = recursechildren(realchild($xmlnode), $inputstar, $thatstar, $topicstar);
        bset($name, $value);
        return $value;
    } elseif (strtoupper($xmlnode["tag"]) == "SETTOPIC") {
        $name = "TOPIC";
        $value = recursechildren(realchild($xmlnode), $inputstar, $thatstar, $topicstar);
        bset($name, $value);
        return $value;
    } elseif (substr(strtoupper($xmlnode["tag"]), 0, 4) == "SET_") {
        $name = substr($xmlnode["tag"], 4);
        $value = recursechildren(realchild($xmlnode), $inputstar, $thatstar, $topicstar);
        bset($name, $value);
        return $value;
    } elseif (isdeprecated(strtoupper($xmlnode["tag"]), $ttag)) {
        $name = $ttag;
        return botget($name);
    } elseif (iscustomtag(strtoupper($xmlnode["tag"]), $ctfunction)) {
        return $ctfunction($xmlnode, $inputstar, $thatstar, $topicstar);
    } else {
        $name = $xmlnode["tag"];
        $atts = $xmlnode["attributes"];
        $atttext = "";
        if ($atts != NULL) {
            foreach ($atts as $key => $value) {
                $atttext .= " {$key}=\"{$value}\"";
            }
        }
        $value = "<{$name}" . $atttext;
        if (isset($xmlnode["children"]) || strcmp($xmlnode["value"], "") != 0) {
            $value .= ">" . recursechildren(realchild($xmlnode), $inputstar, $thatstar, $topicstar) . "</{$name}>";
        } else {
            $value .= "/>";
        }
        return $value;
    }
}
예제 #28
0
<?php

include "includes/app_top.php";
$pcat = "Members";
$pagetitle = "Day Contacts";
$getid = getid('id');
$mid = getid('mid');
checkAdminLogin();
checkState();
include "includes/styles.php";
include "includes/colorbox.php";
?>
  
</head>
<body>
<?php 
include "includes/header.php";
include "includes/side-bar.php";
?>
 <div class="pageHeadingBlock ">
        	<div class="grayBackground">
            <div class="fR t-r p_b">
            <a href="export-members.php">Export Details to Excel</a>
            </div>
        	<h3 class="title">Day Contacts</h3>
            <div class="sectionTabNav">
            	<?php 
echo $tab_website;
?>
            </div>
        	</div>
예제 #29
0
<?php

include "includes/app_top.php";
$pcat = "Website";
$pagetitle = "Report Problem";
$getid = getid('id');
checkAdminLogin();
checkState();
include "includes/styles.php";
?>
 
<?php 
include "includes/colorbox.php";
?>
  
</head>
<body>
<?php 
include "includes/header.php";
include "includes/side-bar.php";
?>
 <div class="pageHeadingBlock ">
        	<div class="grayBackground">
        	<h3 class="title">Report Problem</h3>
            <div class="sectionTabNav">
            	<?php 
echo $tab_website;
?>
            </div>
        	</div>
        </div>
예제 #30
0
파일: forums.php 프로젝트: exts/nab145
function RUN_Forums()
{
    global $logged;
    if (is_numeric($_GET['id'])) {
        $id = intval(htmlspecialchars($_GET['id']));
        //finish checking
    } else {
        pageerror("Forum Error", "", "Sorry, but there wasn't a forum id present.");
    }
    //Show Subforums here
    $SubForums = mysql_query("SELECT * FROM `forums` WHERE `sid` = '" . $id . "'");
    if (mysql_num_rows($SubForums) > 0) {
        $Temp = new Template();
        $Temp->dir = $logged['dskin'];
        $Temp->file = "category_header.tpl";
        $Temp->tp();
        $Temp->tr(array("CAT_NAME" => "SubForums"));
        echo $Temp->html;
        while ($SubForum = mysql_fetch_array($SubForums)) {
            //select the total replies for each forum
            $total_replies = mysql_query("SELECT topics.id,replies.tid FROM `topics`,`replies` WHERE `fid` = '" . $SubForum['id'] . "' AND topics.id = replies.tid") or die(mysql_error());
            $total_replies_ = mysql_num_rows($total_replies);
            //select topic data from the database from these forums
            $nlastpost = mysql_query("SELECT `id`,`title`,`username` FROM `topics` WHERE `fid` ='" . $SubForum['id'] . "' ORDER BY timestamp DESC") or die(mysql_error());
            $nlastpost1 = mysql_fetch_array($nlastpost);
            $topicid = $nlastpost1['id'];
            $topicuser = $nlastpost1['username'];
            $topicnumber = mysql_num_rows($nlastpost);
            //get latest replies from current forum
            $allreplies = mysql_query("SELECT * FROM `replies` WHERE `tid` = '" . $topicid . "' ORDER BY `id` DESC ") or die(mysql_error());
            $all_replies = mysql_fetch_array($allreplies);
            if ($f['lastvisited'] == "") {
                $no_new_post = $total_topics_f_2 != 0 ? "<img src='styles/default/New.png' alt='New' />" : "<img src='styles/default/No%20New.png' alt='No-New' />";
            } else {
                $lID = $logged['id'];
                $last_vdata = unserialize($f['lastvisited']);
                $no_new_post = $last_vdata[$lID] < $total_topics_f_2 ? "<img src='styles/default/New.png' alt='New' />" : "<img src='styles/default/No%20New.png' alt='No-New' />";
            }
            //check if there we're any replies
            if (empty($nlastpost1['title'])) {
                $IN = "No Topics Here.";
            } else {
                $IN = "<a href=\"index.php?act=topicshow&id=" . $nlastpost1['id'] . "\">" . $nlastpost1['title'] . "</a>";
            }
            if ($all_replies['username'] == "") {
                $BY = $topicuser;
            } else {
                $BY = $all_replies['username'];
            }
            if (getFP($SubForum['id'])) {
                $Temp = new Template();
                $Temp->dir = $logged['dskin'];
                $Temp->file = "idxforum.tpl";
                $Temp->tp();
                $Temp->tr(array('NEWPOST' => $no_new_post, 'FORUM_ID' => $SubForum['id'], 'FORUM_NAME' => $SubForum['title'], 'FORUM_DESC' => $SubForum['description'], 'TOPICS' => $topicnumber, 'REPLIES' => $total_replies_, 'LASTPOSTER' => $BY, 'TOPIC_LINK' => $IN, 'SUBFORUMS' => ''));
                echo $Temp->html;
            }
        }
        echo "</table><br /><br /><br />";
    }
    //End Subforums here.
    //total replies pagination limit
    $ppt = mysql_query("SELECT `topicsperforum` FROM `boardstatus` LIMIT 1;");
    $p_p_t = mysql_fetch_array($ppt);
    $total_limit = intval($p_p_t['topicsperforum']);
    if (!isset($_GET['p']) || empty($_GET['p']) || $_GET['p'] == 0) {
        $page = 1;
    } else {
        if (!is_numeric($_GET['p'])) {
            pageerror("Page Error", "", "Didn't specify a correct page id.");
        } else {
            $page = intval(mysql_real_escape_string($_GET['p']));
        }
    }
    $limit_start = $page * $total_limit - $total_limit;
    //do topic stuff with pagination
    $topics = mysql_query("SELECT * FROM `topics` WHERE `fid` = '" . $id . "' AND `sticky` = '1' ORDER BY `timestamp` DESC LIMIT {$limit_start},{$total_limit}") or die(mysql_error());
    $TTtopics = mysql_query("SELECT * FROM `topics` WHERE `fid` = '" . $id . "' ");
    $has_topics = mysql_num_rows($TTtopics);
    $forum_title = mysql_query("SELECT `locked`,`title`,`lastvisited` FROM `forums` WHERE `id` = '" . $id . "' ") or die("Couldn't fetch forum info");
    $forum = mysql_fetch_array($forum_title);
    if (!getFP($id, 0)) {
        pageerror("Permission Error", "", "Sorry, but you don't have permissions viewing this forum.");
    }
    topic_pagination($id, $total_limit, 0);
    echo "<br /><br />";
    if ($forum['locked'] == 't') {
        echo "\n\t\t\t\t\t\t\t<img src='styles/" . $logged['dskin'] . "/Lockd.png' /><br />\n\t\t\t\t\t\t";
    } else {
        echo "\n\t\t\t\t\t\t\t<a href=\"index.php?act=newtopic&id=" . $id . "\"><img src=\"styles/" . $logged['dskin'] . "/New%20topic.png\" alt='New Topic' style='border:1px solid black;margin-bottom:1px;' /></a>\n\t\t\t\t\t\t";
    }
    if ($has_topics == 0) {
        $Temp = new Template();
        $Temp->dir = $logged['dskin'];
        $Temp->file = "forums_none.tpl";
        $Temp->tp();
        $Temp->tr(array('FORUM_NAME' => $forum['title']));
        echo $Temp->html;
    } else {
        $Temp = new Template();
        $Temp->dir = $logged['dskin'];
        $Temp->file = "forums_header.tpl";
        $Temp->tp();
        $Temp->tr(array('FORUM_NAME' => $forum['title']));
        echo $Temp->html;
        //do a check to see if topics are stickied
        $pinned_t = mysql_query("SELECT * FROM `topics` WHERE `fid` = '" . $id . "' AND `sticky` = '0' ORDER BY `timestamp` DESC");
        $totalpins = mysql_num_rows($pinned_t);
        //show pinned topics
        if ($totalpins != 0) {
            echo '
				                <tr>
				                    <td width="100%" class="small_title" colspan="4"><span>Pinned Topics</span></td>
				                </tr>
							';
            $totalrepliesever = 0;
            while ($pinned = mysql_fetch_array($pinned_t)) {
                $replizS = mysql_query("SELECT * FROM `replies` WHERE `tid` = '" . $pinned['id'] . "' ");
                $replizS = mysql_num_rows($replizS);
                $lastS = mysql_query("SELECT `username`,`date` FROM `replies` WHERE tid='" . $topic_info['id'] . "' ORDER BY `id` DESC");
                $lastpS = mysql_fetch_array($lastS);
                ($lastposterS = mysql_num_rows($lastS)) != 0 ? $ltpS = $lastpS['username'] and $ltpdS = date("m-d-y", $lastpS['date']) : ($ltpS = $pinned['username']) and $ltpdS = date("m-d-y", $pinned['timestamp']);
                $totalrepliesever += $replizS;
                //Output pinned topics
                $Temp = new Template();
                $Temp->dir = $logged['dskin'];
                $Temp->file = "forums_content.tpl";
                $Temp->tp();
                $Temp->tr(array('VIEWS' => $pinned['views'], 'REPLIES' => $replizS, 'TID' => $pinned['id'], 'TNAME' => $pinned['title'], 'AUTHOR' => $pinned['username'], 'UID' => getid($pinned['username']), 'DESC' => $pinned['description'], 'LASTP' => $ltpS, 'UID_2' => getid($ltpS), 'DATE' => $ltpdS));
                echo $Temp->html;
            }
            if (mysql_num_rows($topics) > 0) {
                echo '
					                <tr>
					                    <td width="100%" class="small_title" colspan="4"><span>Normal Topics</span></td>
					                </tr>
								';
            }
        }
        while ($topic_info = mysql_fetch_array($topics)) {
            $repliz = mysql_query("SELECT * FROM `replies` WHERE `tid` = '" . $topic_info['id'] . "' ");
            $repliz = mysql_num_rows($repliz);
            $totalrepliesever = $totalrepliesever + $repliz;
            $last = mysql_query("SELECT `username`,`date` FROM `replies` WHERE `tid` = '" . $topic_info['id'] . "' ORDER BY `id` DESC");
            $lastp = mysql_fetch_array($last);
            ($lastposter = mysql_num_rows($last)) != 0 ? $ltp = $lastp['username'] and $ltpd = date("m-d-y", $lastp['date']) : ($ltp = $topic_info['username']) and $ltpd = date("m-d-y", $topic_info['timestamp']);
            //output normal topics
            $Temp = new Template();
            $Temp->dir = $logged['dskin'];
            $Temp->file = "forums_content.tpl";
            $Temp->tp();
            $Temp->tr(array('VIEWS' => $topic_info['views'], 'REPLIES' => $repliz, 'TID' => $topic_info['id'], 'TNAME' => $topic_info['title'], 'AUTHOR' => $topic_info['username'], 'UID' => getid($topic_info['username']), 'DESC' => $topic_info['description'], 'LASTP' => $ltp, 'UID_2' => getid($ltp), 'DATE' => $ltpd));
            echo $Temp->html;
        }
        $lfvisit = $forum['lastvisited'];
        $lID = $logged['id'];
        if ($lfvisit == "") {
            $user_lv = serialize(array($logged['id'] => $totalrepliesever));
            $up_lfv = mysql_query("UPDATE `forums` SET `lastvisited` ='" . $user_lv . "' WHERE `id` = '" . $id . "' ") or die("error updating last visited");
        } else {
            $lfvi = unserialize($lfvisit);
            if ($lfvi[$lID] < $totalrepliesever || $lfvi[$lID] == "") {
                $lfvi[$lID] = $totalrepliesever;
                $up_lfv = mysql_query("UPDATE `forums` SET `lastvisited` ='" . serialize($lfvi) . "' WHERE `id` = '" . $id . "' ") or die("error updating last visited");
            }
        }
        echo '
							</table>
						';
    }
}