mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
r489
Add draft script git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@489 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
f7cc97c670
commit
b4d0834deb
3 changed files with 45 additions and 3 deletions
44
upload/includes/ucp/usercp_viewdraft.php
Normal file
44
upload/includes/ucp/usercp_viewdraft.php
Normal file
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
if (!defined('BB_ROOT')) die(basename(__FILE__));
|
||||
|
||||
if (empty($_GET[POST_USERS_URL]) || $_GET[POST_USERS_URL] == ANONYMOUS)
|
||||
{
|
||||
bb_die($lang['NO_USER_ID_SPECIFIED']);
|
||||
}
|
||||
if (!$profiledata = get_userdata($_GET[POST_USERS_URL]))
|
||||
{
|
||||
bb_die($lang['NO_USER_ID_SPECIFIED']);
|
||||
}
|
||||
|
||||
if (!$userdata['session_logged_in'])
|
||||
{
|
||||
redirect("login.php?redirect={$_SERVER['REQUEST_URI']}");
|
||||
}
|
||||
|
||||
if($profiledata["user_id"] != $userdata["user_id"] && !IS_ADMIN) {
|
||||
bb_die("Нельзя смотреть чужие черновики");
|
||||
}
|
||||
|
||||
$sql = "SELECT * FROM ". BB_TOPICS." WHERE topic_poster = ".$profiledata["user_id"]." AND is_draft = 1";
|
||||
|
||||
$rows = DB()->fetch_rowset($sql);
|
||||
|
||||
$i = 0;
|
||||
foreach ($rows as $row) {
|
||||
$template->assign_block_vars("DRAFT", array(
|
||||
"ROW_CLASS" => ($i % 2) ? 2 : 1,
|
||||
"TITLE" => $row["topic_title"],
|
||||
"T_ID" => $row["topic_id"],
|
||||
"DT_CREATE" => date("d-m-Y (H:i:s)", $row["topic_time"]),
|
||||
"POST_FIRST_ID" => $row["topic_first_post_id"]
|
||||
));
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
"USERNAME" => $profiledata["username"]
|
||||
));
|
||||
|
||||
print_page('usercp_viewdraft.tpl');
|
|
@ -120,8 +120,6 @@ $template->assign_vars(array(
|
|||
|
||||
'USER_ACTIVE' => $profiledata['user_active'],
|
||||
'COUNT_DRAFT' => $count_draft,
|
||||
'SEE_I' => ($profiledata['user_id'] == $userdata['user_id'] || IS_ADMIN) ? true : false,
|
||||
|
||||
'OCCUPATION' => $profiledata['user_occ'],
|
||||
'INTERESTS' => $profiledata['user_interests'],
|
||||
'SKYPE' => $profiledata['user_skype'],
|
||||
|
|
|
@ -403,7 +403,7 @@ ajax.callback.gen_passkey = function(data){
|
|||
<td id="ignore_srv_load">{L_ACCESS_SRV_LOAD}: <b class="editable">{IGNORE_SRV_LOAD}</b></td>
|
||||
</tr>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF SEE_I -->
|
||||
<!-- IF PROFILE_USER || IS_ADMIN -->
|
||||
<tr>
|
||||
<th>{L_DRAFTS}</th>
|
||||
<td><a href="./profile.php?mode=viewdraft&u={PROFILE_USER_ID}"><b>{COUNT_DRAFT}</b></a></td>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue