Ejemplo n.º 1
0
    public function index()
    {
        $NumPerPage = 10;
        $page = ForceIntFrom('p', 1);
        $search = ForceStringFrom('s');
        $groupid = ForceStringFrom('g');
        if (IsGet('s')) {
            $search = urldecode($search);
        }
        $start = $NumPerPage * ($page - 1);
        SubMenu('记录列表', array(array('记录列表', 'messages', 1)));
        TableHeader('搜索及快速删除');
        TableRow('<center><form method="post" action="' . BURL('messages') . '" name="searchmessages" style="display:inline-block;*display:inline;"><label>关键字:</label>&nbsp;<input type="text" name="s" size="18">&nbsp;&nbsp;&nbsp;<label>分类:</label>&nbsp;<select name="g"><option value="0">全部</option><option value="1" ' . Iif($groupid == '1', 'SELECTED') . ' class=red>客人的发言</option><option value="2" ' . Iif($groupid == '2', 'SELECTED') . '>客服的发言</option></select>&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="搜索记录" class="cancel"></form>

		<form method="post" action="' . BURL('messages/fastdelete') . '" name="fastdelete" style="display:inline-block;margin-left:80px;*display:inline;"><label>快速删除记录:</label>&nbsp;<select name="days"><option value="0">请选择 ...</option><option value="360">12个月前的对话记录</option><option value="180">&nbsp;6 个月前的对话记录</option><option value="90">&nbsp;3 个月前的对话记录</option><option value="30">&nbsp;1 个月前的对话记录</option></select>&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="快速删除" class="save" onclick="var _me=$(this);showDialog(\'确定删除所选记录吗?\', \'确认操作\', function(){_me.closest(\'form\').submit();});return false;"></form></center>');
        TableFooter();
        if ($search) {
            if (preg_match("/^[1-9][0-9]*\$/", $search)) {
                $s = ForceInt($search);
                $searchsql = " WHERE mid = '{$s}' OR fromid = '{$s}' OR toid = '{$s}' ";
                //按ID搜索
                $title = "搜索ID号为: <span class=note>{$s}</span> 的记录";
            } else {
                $searchsql = " WHERE (fromname LIKE '%{$search}%' OR toname LIKE '%{$search}%' OR msg LIKE '%{$search}%') ";
                $title = "搜索: <span class=note>{$search}</span> 的记录列表";
            }
            if ($groupid) {
                if ($groupid == 1 or $groupid == 2) {
                    $searchsql .= " AND type = " . Iif($groupid == 1, 0, 1) . " ";
                    $title = "在 <span class=note>" . Iif($groupid == 1, '客人的发言', '客服的发言') . "</span> 中, " . $title;
                }
            }
        } else {
            if ($groupid) {
                if ($groupid == 1 or $groupid == 2) {
                    $searchsql .= " WHERE type = " . Iif($groupid == 1, 0, 1) . " ";
                    $title = "全部 <span class=note>" . Iif($groupid == 1, '客人的发言', '客服的发言') . "</span> 列表";
                }
            } else {
                $searchsql = '';
                $title = '全部记录列表';
            }
        }
        $getmessages = APP::$DB->query("SELECT * FROM " . TABLE_PREFIX . "msg " . $searchsql . " ORDER BY mid DESC LIMIT {$start},{$NumPerPage}");
        $maxrows = APP::$DB->getOne("SELECT COUNT(mid) AS value FROM " . TABLE_PREFIX . "msg " . $searchsql);
        echo '<form method="post" action="' . BURL('messages/updatemessages') . '" name="messagesform">
		<input type="hidden" name="p" value="' . $page . '">';
        TableHeader($title . '(' . $maxrows['value'] . '个)');
        TableRow(array('ID', '发送人', '对话内容', '接收人', '记录时间', '<input type="checkbox" id="checkAll" for="deletemids[]"> <label for="checkAll">删除</label>'), 'tr0');
        if ($maxrows['value'] < 1) {
            TableRow('<center><BR><font class=redb>未搜索到任何记录!</font><BR><BR></center>');
        } else {
            while ($msg = APP::$DB->fetch($getmessages)) {
                TableRow(array($msg['mid'], "<a title=\"编辑\" href=\"" . Iif($msg['type'], BURL('users/edit?aid=' . $msg['fromid']), BURL('guests/edit?gid=' . $msg['fromid'])) . "\">{$msg['fromname']}</a>", getSmile($msg['msg']), "<a title=\"编辑\" href=\"" . Iif($msg['type'], BURL('guests/edit?gid=' . $msg['toid']), BURL('users/edit?aid=' . $msg['toid'])) . "\">{$msg['toname']}</a>", DisplayDate($msg['time'], '', 1), '<input type="checkbox" name="deletemids[]" value="' . $msg['mid'] . '">'));
            }
            $totalpages = ceil($maxrows['value'] / $NumPerPage);
            if ($totalpages > 1) {
                TableRow(GetPageList(BURL('messages'), $totalpages, $page, 10, 's', urlencode($search), 'g', $groupid));
            }
        }
        TableFooter();
        PrintSubmit('删除记录', '', 1, '确定删除所选记录吗?');
    }
Ejemplo n.º 2
0
            } else {
                if ($ugender == 2) {
                    $disgen = "{$loc_female_gender}";
                } else {
                    $disgen = "{$loc_no_gender}";
                }
            }
            echo "<br>Gender: {$disgen}<br />\n\tYouTube: <a href='http://www.youtube.com/c/{$ytc}'>{$ytc}</a><br>\n      <br>Last post: ";
            if ($ulastpdate == 0) {
                echo "{$loc_no_posts_made}";
            } else {
                echo date($dateF . ', ' . $timeF, $ulastpdate * $timezone);
            }
            echo "<br>{$loc_last_view}: ";
            if ($uontime == 0) {
                echo "{$loc_never}";
            } else {
                echo date($dateF . ', ' . $timeF, $uontime * $timezone);
            }
            echo "<br /><img src='assets/flags/{$country}.png' /></td>";
        }
        echo "<td class='b n2 mainbar{$uid}' id='post_'>{$uheader}<blockquote><span class='quotedby'><small><i><a href=http://" . $_SERVER['HTTP_HOST'] . "/forum.php?mode=thread&pid=2#2>{$loc_posted_by} someone</a></i></small></span><hr><a href='/#fakelink'><b>The</b> sample link.</a> <blockquote><span class='quotedby'><small><i><a href=http://" . $_SERVER['HTTP_HOST'] . "/forum.php?mode=thread&pid=1#1>{$loc_posted_by} another someone</a></i></small></span><hr><blockquote><span class='quotedby'><i>{$loc_posted_by} 'someone else'</i></span><hr>Sample nested quote.<hr></blockquote><span class='spoiler1'><span class='spoiler2'>Sample spoiler, but I guess I ruined that for you hehe</span></span><hr></blockquote>^Sample <u>sarcasm</u><hr></blockquote><br>How about some code: <br><table cellspacing='0' style='width: 90%; min-width: 90%;'><tr><td class='b n3'><code class='prettyprint' style='font-size:9pt;'>&lt;?php<br>if (\$a &#x3D;= \$b&#41; // I was here.... <br>{<br>   print &quot;Sample code.&quot;; #oops you just missed him!<br>}<br>?&gt;</code></table><br><i>Sample</i> message.<br /><br />";
        echo getSmile(getBBCode(cLink($ufooter)));
        echo "</td>\n</table>\n\n           <br>";
    }
    if ($val) {
        echo "<table cellspacing='0' class='c1'>\n             <tr class='h'>\n               <td class='b n2'><a href='http://" . $_SERVER['HTTP_HOST'] . "/forum.php?mode=forum&user={$uid}'>{$loc_view_threads}</a>\n                       | <a href='http://" . $_SERVER['HTTP_HOST'] . "/forum.php?mode=thread&user={$uid}'>{$loc_show_posts}</a>\n           </table>";
    }
}
$stmt->close();
$mysqli->close();
Ejemplo n.º 3
0
    // Load Data
    if (isset($_GET["page"])) {
        $page = $_GET["page"];
    } else {
        $page = 1;
    }
    $start_from = ($page - 1) * 10;
    $sql = "SELECT `id`, `title`, `message`, `privacy` FROM `{$app}` WHERE `message` LIKE '%{$query}%' ORDER BY '{$sort}' DESC LIMIT {$start_from}, 10";
    $stmt = $mysqli->prepare($sql);
    $stmt->execute();
    $stmt->bind_result($id, $title, $body, $priv);
    while ($stmt->fetch()) {
        if ($priv == 0 || $admin) {
            if ($appli == "Blog") {
                echo "<div id='BlogTitle'><a href='?mode=post&id={$id}'>{$title}</a></div><br />";
            } else {
                if ($appli == "Pages") {
                    echo "<div id='BlogTitle'><a href='?mode=page&id={$id}'>{$title}</a></div><br />";
                }
            }
            echo "<div id='BlogData'>Something like this?</div>";
            if ($appli == "Blog") {
                echo "<div id='BlogBody'>" . ReadMore(getBBCode(getSmile($body))) . "... (<a href='?mode=post&id={$id}'>{$loc_read_more}</a>)</div><br /><br />";
            } else {
                if ($appli == "Pages") {
                    echo "<div id='BlogBody'>" . ReadMore(getBBCode(getSmile($body))) . "... (<a href='?mode=page&id={$id}'>{$loc_read_more}</a>)</div><br /><br />";
                }
            }
        }
    }
}
Ejemplo n.º 4
0
        if ($admin) {
            echo "<div id='AddButton' class='AddButton'><a href='{$protocol}://" . $_SERVER['HTTP_HOST'] . "/index.php?mode=postedit&id={$bid}'>{$loc_edit}</a> | <a href='{$protocol}://" . $_SERVER['HTTP_HOST'] . "/index.php?mode=postdel&id={$bid}'>{$loc_delete}</a></div>";
        }
        echo "<div id='BlogTitle'><a href='{$protocol}://" . $_SERVER['HTTP_HOST'] . "/index.php?mode=post&id={$bid}'>" . $btitle . "</a></div><br /><div id='BlogData'><img src='{$uava}' height=25 /> <a href='{$protocol}://" . $_SERVER['HTTP_HOST'] . "/user.php?mode=profile&uid={$uuid}'>";
        //$uuname
        if (empty($unamecol)) {
            echo GenderName($ugroup, $ugender);
        } else {
            echo "<span style='{$unamecol}'>";
        }
        if (empty($udis)) {
            echo "{$uuname}";
        } else {
            echo "{$udis}";
        }
        if (empty($unamecol)) {
            echo "</font>";
        } else {
            echo "</span>";
        }
        echo "</a> {$loc_made_post} " . date($dateF . ', ' . $timeF, $bdate) . " | {$loc_category}: <a href='{$protocol}://" . $_SERVER['HTTP_HOST'] . "/index.php?mode=category&id={$tid}'>{$ttitle}</a></div>";
        echo "<div id='BlogBody'>";
        if (!empty($bthumb)) {
            echo "<img src='{$bthumb}' style='max-width: 200px; max-height: 200px;' align='left' hspace='10' vspace='10' />";
        }
        echo getSmile(getBBCode($bbody));
        echo "</div><br /><br />";
    }
}
$stmt->close();
$mysqli->close();
Ejemplo n.º 5
0
    echo "<br>{$loc_posts}: {$total_posts}\n      <br>\n      <br>{$loc_since}: " . date($dateF, $reg_date * $timezone) . "\n      <br>{$loc_from}: {$ulocation}";
    $disgen = "";
    if ($ugender == 1) {
        $disgen = "{$loc_male_gender}";
    } else {
        if ($ugender == 2) {
            $disgen = "{$loc_female_gender}";
        } else {
            $disgen = "{$loc_no_gender}";
        }
    }
    echo "<br>{$loc_gender}: {$disgen}<br />\n        {$loc_yt_channel}: <a href='http://www.youtube.com/c/{$uchannel}'>{$uchannel}</a>\n      <br>\n      <br>{$loc_last_post}: " . date($dateF . ', ' . $timeF, $ulastdate * $timezone) . "\n      <br>{$loc_last_view}: " . date($dateF . ', ' . $timeF, $ontime * $timezone) . "\n\t<br /><img src='assets/flags/{$ucountry}.png' />\n    </td>\n    <td class='b n2 mainbar{$uid}'>";
    if ($mnolay == 0) {
        echo "{$uheader}";
    }
    echo getSmile(getBBCode(cLink($mmess))) . "\n<br>\n<br>" . getSmile(getBBCode(cLink($ufooter))) . "</small></td>";
    //}
    echo "</table><br />";
}
//$stmt->close();
?>

<br>

<?php 
$row = mysqli_fetch_row(mysqli_query($mysqli, "SELECT COUNT(message) FROM usr_private_messages WHERE mes_id = {$mid}"));
$total_records = $row[0];
$total_pages = ceil($total_records / 10);
echo "<span style='font-size:20px'>";
echo "{$loc_pages}: ";
for ($i = 1; $i <= $total_pages; $i++) {
Ejemplo n.º 6
0
}
if (empty($aid) && empty($ati)) {
    $sql = "SELECT id, title, slug, message, javascript, css, privacy FROM {$blogp} WHERE id = " . $hoppa;
} else {
    if (empty($ati)) {
        $sql = "SELECT id, title, slug, message, javascript, css, privacy FROM {$blogp} WHERE id = " . $aid;
    } else {
        if (empty($aid)) {
            $sql = "SELECT id, title, slug, message, javascript, css, privacy FROM {$blogp} WHERE slug = '{$ati}'";
        } else {
            echo "Invalid URL.";
            exit;
        }
    }
}
$stmt = $mysqli->prepare($sql);
$stmt->execute();
$stmt->bind_result($pid, $ptitle, $pslug, $pbody, $pjs, $pcss, $ppriv);
while ($stmt->fetch()) {
    echo "<script>{$pjs}</script>";
    echo "<style>{$pcss}</style>";
    if ($ppriv <= 1 || $admin) {
        if ($admin) {
            echo "<div id='AddButton' class='AddButton'><a href='{$protocol}://" . $_SERVER['HTTP_HOST'] . "/index.php?mode=pageedit&id={$pid}'>{$loc_edit}</a> | <a href='{$protocol}://" . $_SERVER['HTTP_HOST'] . "/index.php?mode=pagedel&id={$pid}'>{$loc_delete}</a></div>";
        }
        echo "<div id='BlogTitle'>{$ptitle}</div><br /><div id='BlogBody'>" . getBBCode(getSmile($pbody));
        echo "</div><br /><br />";
    }
}
$stmt->close();
$mysqli->close();
Ejemplo n.º 7
0
            }
            if (empty($unamecol)) {
                echo "</font>";
            } else {
                echo "</span>";
            }
            echo "</a> {$loc_made_post} " . date($dateF . ', ' . $timeF, $bdate);
            if ($admin) {
                echo "<div id='AddButton' class='AddButton'><a href='{$protocol}://" . $_SERVER['HTTP_HOST'] . "/index.php?mode=postedit&id={$bid}'>{$loc_edit}</a> | <a href='{$protocol}://" . $_SERVER['HTTP_HOST'] . "/index.php?mode=postdel&id={$bid}'>{$loc_delete}</a></div>";
            }
            echo " | {$loc_category}: <a href='{$protocol}://" . $_SERVER['HTTP_HOST'] . "/index.php?mode=category&id={$tid}'>{$ttitle}</a></div>";
            echo "<div id='BlogBody'>";
            if (!empty($bthumb)) {
                echo "<img src='{$bthumb}' style='max-width: 200px; max-height: 200px;' align='left' hspace='10' vspace='10' />";
            }
            echo ReadMore(getSmile(getBBCode($bbody)));
            if (strpos($bbody, '[rm]') !== false) {
                if ($urltype == 0) {
                    echo " (<a href='{$protocol}://" . $_SERVER['HTTP_HOST'] . "/index.php?mode=post&id={$bid}'>{$loc_read_more}</a>)";
                } else {
                    echo " (<a href='{$protocol}://" . $_SERVER['HTTP_HOST'] . "/post/{$bslug}'>{$loc_read_more}</a>)";
                }
            }
            echo "</div><br /><br />";
        }
    }
}
$row = mysqli_fetch_row(mysqli_query($mysqli, "SELECT COUNT(title) FROM {$blogl}"));
$total_records = $row[0];
$total_pages = ceil($total_records / 10);
for ($i = 1; $i <= $total_pages; $i++) {
Ejemplo n.º 8
0
 public function index()
 {
     $myid = $this->admin['aid'];
     $NumPerPage = 10;
     $page = ForceIntFrom('p', 1);
     $search = ForceStringFrom('s');
     $groupid = ForceStringFrom('g');
     if (IsGet('s')) {
         $search = urldecode($search);
     }
     $start = $NumPerPage * ($page - 1);
     SubMenu('我的对话记录', array(array('记录列表', 'mymessages', 1)));
     TableHeader('搜索对话记录');
     TableRow('<center><form method="post" action="' . BURL('mymessages') . '" name="search" style="display:inline-block;"><label>关键字:</label>&nbsp;<input type="text" name="s" size="18">&nbsp;&nbsp;&nbsp;<label>分类:</label>&nbsp;<select name="g"><option value="0">全部</option><option value="1" ' . Iif($groupid == '1', 'SELECTED') . ' class=red>客人的发言</option><option value="2" ' . Iif($groupid == '2', 'SELECTED') . '>我的发言</option></select>&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="搜索记录" class="cancel"></form></center>');
     TableFooter();
     if ($search) {
         if (preg_match("/^[1-9][0-9]*\$/", $search)) {
             $s = ForceInt($search);
             $searchsql = " WHERE (mid = '{$s}' OR fromid = '{$s}' OR toid = '{$s}') ";
             //按ID搜索
             $title = "搜索ID号为: <span class=note>{$s}</span> 的记录";
         } else {
             $searchsql = " WHERE (fromname LIKE '%{$search}%' OR toname LIKE '%{$search}%' OR msg LIKE '%{$search}%') ";
             $title = "搜索: <span class=note>{$search}</span> 的记录列表";
         }
         if ($groupid) {
             if ($groupid == 1 or $groupid == 2) {
                 $searchsql .= " AND (" . Iif($groupid == 1, "type = 0 AND toid = '{$myid}'", "type = 1 AND fromid = '{$myid}'") . ") ";
                 $title = "在 <span class=note>" . Iif($groupid == 1, '客人的发言', '我的发言') . "</span> 中, " . $title;
             }
         } else {
             $searchsql .= " AND ((type = 1 AND fromid = '{$myid}') OR (type = 0 AND toid = '{$myid}')) ";
         }
     } else {
         if ($groupid) {
             if ($groupid == 1 or $groupid == 2) {
                 $searchsql .= " WHERE " . Iif($groupid == 1, "type = 0 AND toid = '{$myid}' ", "type = 1 AND fromid = '{$myid}' ");
                 $title = "全部 <span class=note>" . Iif($groupid == 1, '客人的发言', '我的发言') . "</span> 列表";
             }
         } else {
             $searchsql = " WHERE (type = 1 AND fromid = '{$myid}') OR (type = 0 AND toid = '{$myid}') ";
             $title = '全部记录列表';
         }
     }
     $getmy = APP::$DB->query("SELECT * FROM " . TABLE_PREFIX . "msg " . $searchsql . " ORDER BY mid DESC LIMIT {$start},{$NumPerPage}");
     $maxrows = APP::$DB->getOne("SELECT COUNT(mid) AS value FROM " . TABLE_PREFIX . "msg " . $searchsql);
     TableHeader($title . '(' . $maxrows['value'] . '个)');
     TableRow(array('ID', '发送人', '对话内容', '接收人', '记录时间'), 'tr0');
     if ($maxrows['value'] < 1) {
         TableRow('<center><BR><font class=redb>未搜索到任何记录!</font><BR><BR></center>');
     } else {
         while ($msg = APP::$DB->fetch($getmy)) {
             TableRow(array($msg['mid'], $msg['fromname'], getSmile($msg['msg']), $msg['toname'], DisplayDate($msg['time'], '', 1)));
         }
         $totalpages = ceil($maxrows['value'] / $NumPerPage);
         if ($totalpages > 1) {
             TableRow(GetPageList(BURL('mymessages'), $totalpages, $page, 10, 's', urlencode($search), 'g', $groupid));
         }
     }
     TableFooter();
 }
Ejemplo n.º 9
0
                 echo " | <a href='index.php?mode=commentdel&id={$cid}'>{$loc_remove}</a>";
             }
             if ($admin || $owner == $uuname) {
                 echo "</div>";
             }
         } else {
             if ($admin) {
                 echo "<div id='AddButton' class='AddButton'><a href='index.php?mode=commentdel&id={$cid}'>{$loc_unremove}</a></div>";
             }
         }
         if ($admin || $owner == $uuname) {
             echo " ({$cip})";
         }
         echo " <a href='index.php?mode=post&id={$cpid}'>{$loc_comment_made}</a> " . date($dateF . ', ' . $timeF, $cdate);
         if ($cdel == 0) {
             echo "<tr><td valign='top' height=90px>" . getSmile(getBBCode($cmessage));
             if ($cle != 0) {
                 echo "<br /><br /><i>{$loc_edit_last}: " . date($dateF . ', ' . $timeF, $cle) . "</i>";
             }
         } else {
             echo "</strong></td></tr>";
             echo "<tr><td valign='top' height=90px><i>{$loc_removed}</i>";
         }
         echo "</td></tr>";
     }
     echo "</table>";
 } else {
     if ($url == 'meta') {
         echo "<h1>{$loc_man_site_info}</h1>";
         if ($powza == 3) {
             if ($_POST['Submit']) {
Ejemplo n.º 10
0
function GetAll($message)
{
    return getSmile(getBBCode(strip_tags($message)));
}