コード例 #1
0
    $SQLQuery2 = "SELECT count(msg.hash) as num FROM {$SNAME}_reply as msg {$NickTable} where visibile = '1' and {$where}";
    $SQLQuery = "select sum(num) as num from (({$SQLQuery1}) UNION ({$SQLQuery2})) as result_num";
    if ($riga = $db->get_var($SQLQuery)) {
        $num = $riga;
    } else {
        $num = 0;
    }
    echo "Sono stati trovati <b>{$num}</b> post che soddisfano la ricerca.<br><br>";
    $SQLQuery1 = "SELECT msg.hash, msg.edit_of as rep_of, msg.sez, msg.edit_of, msg.date, msg.title, msg.subtitle, msg.body FROM {$SNAME}_newmsg as msg {$NickTable} where visibile = '1' and {$where}";
    $SQLQuery2 = "SELECT msg.hash, msg.rep_of, 0 as sez, msg.edit_of, msg.date, msg.title, '' as subtitle, msg.body FROM {$SNAME}_reply as msg {$NickTable} where visibile = '1' and {$where}";
    $SQLQuery = "select distinct rep_of from (({$SQLQuery1}) UNION ({$SQLQuery2})) as result_msg order by `" . $_REQUEST["sort_key"] . "` " . $_REQUEST["sort_order"];
    //  $SQLQuery = "select * from (($SQLQuery1) UNION ($SQLQuery2)) as result_msg order by `".$_REQUEST["sort_key"]."` ".$_REQUEST["sort_order"];
    //  $risultato=mysql_query($SQLQuery) or Muori ("Query non valida: " . mysql_error());
    $query = "SELECT msghe.HASH as 'HASH',newmsg.title AS 'title', (last_reply_time+" . GMT_TIME . ") as last_reply_time,membri.AUTORE as nick,membri.HASH AS 'nickhash'," . " repau.AUTORE as dnick, repau.HASH as dnickhash, (msghe.DATE+" . GMT_TIME . ") AS 'write_date', reply_num, read_num,newmsg.SUBTITLE as 'subtitle' " . " FROM {$SNAME}_msghe AS msghe,{$SNAME}_newmsg AS newmsg,{$SNAME}_membri AS membri,{$SNAME}_membri AS repau " . " WHERE newmsg.EDIT_OF=msghe.HASH" . " AND membri.HASH=msghe.AUTORE " . " AND repau.HASH=msghe.last_reply_author" . " AND msghe.HASH IN ({$SQLQuery})";
    //  ." LIMIT ".($CurrPag*$ThreadXPage).",$ThreadXPage;";
    $risultato = mysql_query($query) or Muori("Query non valida: " . mysql_error());
    ?>
<div class="borderwrap">
  <div class="maintitle">
    <p class="expand"></p>
    <?php 
    echo "<p>" . $SEZ_DATA->SEZ_NAME . "</p>";
    ?>
  </div>
  <table cellspacing="1">
   <tr>
    <th align="center" width="1%">&nbsp;</th>
    <th align="center" width="1%">&nbsp;</th>
    <th align="left" width="57%" class='titlemedium'><?php 
    echo $lang['topic_title'];
    ?>
コード例 #2
0
        $_SESSION[$SNAME]['sess_password'] = $rawpasswd;
        $_SESSION[$SNAME]['logged_since'] = time();
        $_SESSION[$SNAME]['sess_auth'] = 1;
        echo $lang['login_succ'];
        $SEZ_ID = $_REQUEST["SEZID"];
        if ($SEZ_ID) {
            $THR_ID = $_REQUEST["THR_ID"];
            if ($THR_ID) {
                $url = "showmsg.php?SEZID={$SEZ_ID}&THR_ID={$THR_ID}";
            } else {
                $url = "sezioni.php?SEZID={$SEZ_ID}";
            }
        } else {
            $url = "index.php";
        }
        $db->query($query) or Muori($lang['inv_query'] . $db->debug());
        echo "<br><center>" . $lang['login_back'] . "</center><script  type='text/javascript' language=\"javascript\">setTimeout('delayer()', 2000);\nfunction delayer(){ window.location='{$url}';}</script>";
    } else {
        //SHOW FORM
        ?>
    <br><br><center>
    <form method="post" action="login.php">
    <input type="hidden" name="SEZID" value="<?php 
        echo $_REQUEST["SEZID"];
        ?>
">
    <input type="hidden" name="THR_ID" value="<?php 
        echo $_REQUEST["THR_ID"];
        ?>
">
    <table border="0" cellspacing="0" cellpadding="0">