22 พฤษภาคม 2555, 16:33:32
ยินดีต้อนรับผู้เยี่ยมชม
  • noavata
  • ยินดีต้อนรับคุณ, ผู้เยี่ยมชม กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน
    เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น
Page Rank

ทำเว็บไซต์ | แต่งบอร์ด | ออกแบบ | SMF | Joomla | Drupal | WordPress | JQuery | CMS | ECommerce | Tel. +668-08577477

ส่งหัวข้อนี้พิมพ์ หน้า: 1 
icon message ผู้เขียน หัวข้อ: User Attachment Quota จัดสรรไฟล์แนบให้กับกลุ่มสมาชิก  (อ่าน 823 ครั้ง)
0 สมาชิก และ 1 ผู้เยี่ยมชม กำลังดูหัวข้อนี้
*
*


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
  • ชื่อ: User Attachment Quota
  • ผู้เขียน: CiQ
  • นำเสนอโดย: DexMoreGroup
  • ประเภท: Attachments
  • รองรับ: SMF 1.1.xx
  • ปรับปรุงล่าสุด: 2 ธันวาคม 2552
  • ต้นฉบับ: User Attachment Quota

รายละเอียด
      จัดสรรขนาดพื้นที่ไฟล์แนบให้กับกลุ่มสมาชิก ซึ่งสามารถจัดการการอนุญาตให้สมาชิกกลุ่มต่างๆ จัดการไฟล์แนบของตัวเองผ่านข้อมูลส่วนตัวของตัวเองและของผู้อื่นได้ เช่นอนุญาตให้ผู้ดูแลกลุ่มใดกลุ่มหนึ่งสามารถจัดการลบไฟล์แนบของสมาชิกได้

ตัวอย่าง






แก้ไขไฟล์:

file $sourcedir/Profile.php

ค้นหา -->>
โค๊ด: [Select]
'deleteAccount' => array(array('profile_remove_any', 'profile_remove_own'), array('profile_remove_any')),

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'viewattachments' => array(array('profile_viewattachments_own', 'profile_viewattachments_any'), array('profile_viewattachments_any')),
'RemoveAtt' => array(array('profile_removeattachment_own', 'profile_removeattachment_any'), array('profile_removeattachment_any')),

ค้นหา -->>
โค๊ด: [Select]
fatal_error($txt[453] . ' - ' . $memID, false);

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
// AttQuota 1.3.2
$request = db_query("
SELECT SUM(a.size) AS totalsize
FROM {$db_prefix}attachments as a
LEFT JOIN {$db_prefix}messages as m ON (a.ID_MSG = m.ID_MSG)
WHERE m.ID_MEMBER = ".$memID."
AND a.attachmentType != 3
AND a.ID_MSG != 0
", __FILE__, __LINE__);
list($row) = mysql_fetch_row($request);
$context['user_attach']['size'] = (int) $row;
mysql_free_result($request);

$groups = (!empty($user_profile[$memID]['additionalGroups']) ? $user_profile[$memID]['additionalGroups'] . ',' : '') . (!empty($user_profile[$memID]['ID_POST_GROUP']) ? $user_profile[$memID]['ID_POST_GROUP'] . ',' : '') . $user_profile[$memID]['ID_GROUP'];
$context['can_view_attachments'] = ((allowedTo('profile_viewattachments_own') || allowedTo('profile_viewattachments_any')) && $context['user']['is_owner']) || allowedTo('profile_viewattachments_any');

$getquota = db_query("
SELECT attquota
FROM {$db_prefix}membergroups
WHERE ID_GROUP IN ($groups)
", __FILE__, __LINE__);
while ($row2 = mysql_fetch_assoc($getquota))
$quotas[] = (int) $row2['attquota'];
if (min($quotas)==0)
$context['attquota'] = 0;
else
$context['attquota'] = max($quotas);
mysql_free_result($getquota);
// end AttQuota 1.3.2

ค้นหา -->>
โค๊ด: [Select]
'can_have_buddy' => allowedTo('profile_identity_own') && !empty($modSettings['enable_buddylist']),

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'show_attachment_quota' => !empty($context['attquota']) && (!empty($user_profile[$memID]['additionalGroups']) ? !in_array(1, explode(',', $user_profile[$memID]['additionalGroups'])) : true),

ค้นหา -->>
โค๊ด: [Select]
?>

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
function viewattachments($memID)
{
global $context, $db_prefix, $txt, $scripturl, $options, $modSettings;

$context['page_title'] = $txt['va_att'];
$context['sub_template'] = 'viewattachments';
$context['browse_type'] = 'attachments';
$context['can_delete_attachments'] = ((allowedTo('profile_removeattachment_own') || allowedTo('profile_removeattachment_any')) && $context['user']['is_owner']) || allowedTo('profile_removeattachment_any');

// Get the number of attachments.
$context['num_attachments'] = 0;
$request = db_query("
SELECT COUNT(*) AS num_attach
FROM {$db_prefix}attachments as a
LEFT JOIN {$db_prefix}messages as m ON (a.ID_MSG = m.ID_MSG)
WHERE m.ID_MEMBER = ".$memID."
AND a.attachmentType != 3
AND a.ID_MSG != 0
", __FILE__, __LINE__);
list ($context['num_attachments']) = mysql_fetch_row($request);
mysql_free_result($request);

// Allow for sorting of each column...
$sort_methods = array(
'name' => 'a.filename',
'date' => 'm.ID_MSG',
'size' => 'a.size',
);

// Set up the importantant sorting variables... if they picked one...
if (!isset($_GET['sort']) || !isset($sort_methods[$_GET['sort']]))
{
$_GET['sort'] = 'date';
$descending = !empty($options['view_newest_first']);
}
// ... and if they didn't...
else
$descending = isset($_GET['desc']);

$context['sort_by'] = $_GET['sort'];
$_GET['sort'] = $sort_methods[$_GET['sort']];
$context['sort_direction'] = $descending ? 'down' : 'up';

// Get the page index ready......
if (!isset($_REQUEST['start']) || $_REQUEST['start'] < 0)
$_REQUEST['start'] = 0;

$context['page_index'] = constructPageIndex($scripturl . '?action=profile;u=' . $memID . ';sa=' . $_REQUEST['sa'] . ';sort=' . $context['sort_by'] . ($context['sort_direction'] == 'down' ? ';desc' : ''), $_REQUEST['start'], $context['num_attachments'], $modSettings['defaultMaxMessages']);
$context['start'] = $_REQUEST['start'];

// Choose a query depending on what we are viewing.
$request = db_query("
SELECT
m.ID_MSG, m.posterTime, m.ID_TOPIC,
a.ID_ATTACH, a.filename, a.attachmentType, a.size, a.width, a.height, a.downloads, mf.subject, t.ID_BOARD
FROM ({$db_prefix}attachments AS a, {$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}messages AS mf)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
WHERE a.ID_MSG = m.ID_MSG
AND a.attachmentType = 0
AND m.ID_MEMBER = ".$memID."
AND t.ID_TOPIC = m.ID_TOPIC
AND mf.ID_MSG = t.ID_FIRST_MSG
ORDER BY $_GET[sort] " . ($descending ? 'DESC' : 'ASC') . "
LIMIT $context[start], $modSettings[defaultMaxMessages]", __FILE__, __LINE__);
$context['posts'] = array();
while ($row = mysql_fetch_assoc($request))
$context['posts'][] = array(
'id' => $row['ID_MSG'],
'time' => empty($row['posterTime']) ? $txt['never'] : timeformat($row['posterTime']),
'timestamp' => forum_time(true, $row['posterTime']),
'attachment' => array(
'id' => $row['ID_ATTACH'],
'size' => round($row['size'] / 1024, 2),
'width' => $row['width'],
'height' => $row['height'],
'name' => htmlspecialchars($row['filename']),
'downloads' => $row['downloads'],
'href' => $scripturl . '?action=dlattach;topic=' . $row['ID_TOPIC'] . '.0;id=' . $row['ID_ATTACH'],
'link' => '<a href="' . $scripturl . '?action=dlattach;topic=' . $row['ID_TOPIC'] . '.0;id=' . $row['ID_ATTACH'] . '"' . (empty($row['width']) || empty($row['height']) ? '' : ' onclick="return reqWin(this.href + \';image\', ' . ($row['width'] + 20) . ', ' . ($row['height'] + 20) . ', true);"') . '>' . htmlspecialchars($row['filename']) . '</a>'
),
'topic' => $row['ID_TOPIC'],
'subject' => $row['subject'],
'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0">' . $row['subject'] . '</a>'
);
mysql_free_result($request);
}

function RemoveAtt($memID)
{
global $db_prefix, $modSettings, $txt;

checkSession('post');

if (!empty($_POST['remove']))
{
$attachments = array();
// There must be a quicker way to pass this safety test??
foreach ($_POST['remove'] as $removeID => $dummy)
$attachments[] = (int) $removeID;

if (!empty($attachments))
{
$messages = delAtt('a.ID_ATTACH IN (' . implode(', ', $attachments) . ')', 'messages', true);

// And change the message to reflect this.
if (!empty($messages))
db_query("
UPDATE {$db_prefix}messages
SET body = CONCAT(body, '<br /><br />" . addslashes($txt['attachment_del']) . "')
WHERE ID_MSG IN (" . implode(', ', $messages) . ")
LIMIT " . count($messages), __FILE__, __LINE__);
}
}

$_GET['sort'] = isset($_GET['sort']) ? $_GET['sort'] : 'date';
redirectexit('action=profile;u=' . $memID . ';sa=viewattachments;sort=' . $_GET['sort'] . (isset($_GET['desc']) ? ';desc' : '') . ';start=' . $_REQUEST['start']);
}

function delAtt($condition, $query_type = '', $return_affected_messages = false, $autoThumbRemoval = true)
{
global $db_prefix, $modSettings;

// Delete it only if it exists...
$msgs = array();
$attach = array();
$parents = array();

// Get all the attachment names and ID_MSGs.
$request = db_query("
SELECT
a.filename, a.attachmentType, a.ID_ATTACH, a.ID_MEMBER" . ($query_type == 'messages' ? ', m.ID_MSG' : ', a.ID_MSG') . ",
IFNULL(thumb.ID_ATTACH, 0) AS ID_THUMB, thumb.filename AS thumb_filename, thumb_parent.ID_ATTACH AS ID_PARENT
FROM ({$db_prefix}attachments AS a" .($query_type == 'members' ? ", {$db_prefix}members AS mem" : ($query_type == 'messages' ? ", {$db_prefix}messages AS m" : '')) . ")
LEFT JOIN {$db_prefix}attachments AS thumb ON (thumb.ID_ATTACH = a.ID_THUMB)
LEFT JOIN {$db_prefix}attachments AS thumb_parent ON (a.attachmentType = 3 AND thumb_parent.ID_THUMB = a.ID_ATTACH)
WHERE $condition" . ($query_type == 'messages' ? '
AND m.ID_MSG = a.ID_MSG' : '') . ($query_type == 'members' ? '
AND mem.ID_MEMBER = a.ID_MEMBER' : ''), __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
{
// Figure out the "encrypted" filename and unlink it ;).
if ($row['attachmentType'] == 1)
@unlink($modSettings['custom_avatar_dir'] . '/' . $row['filename']);
else
{
$filename = getAttachmentFilename($row['filename'], $row['ID_ATTACH']);
@unlink($filename);

// If this was a thumb, the parent attachment should know about it.
if (!empty($row['ID_PARENT']))
$parents[] = $row['ID_PARENT'];

// If this attachments has a thumb, remove it as well.
if (!empty($row['ID_THUMB']) && $autoThumbRemoval)
{
$thumb_filename = getAttachmentFilename($row['thumb_filename'], $row['ID_THUMB']);
@unlink($thumb_filename);
$attach[] = $row['ID_THUMB'];
}
}

// Make a list.
if ($return_affected_messages && empty($row['attachmentType']))
$msgs[] = $row['ID_MSG'];
$attach[] = $row['ID_ATTACH'];
}
mysql_free_result($request);

// Removed attachments don't have to be updated anymore.
$parents = array_diff($parents, $attach);
if (!empty($parents))
db_query("
UPDATE {$db_prefix}attachments
SET ID_THUMB = 0
WHERE ID_ATTACH IN (" . implode(', ', $parents) . ")
LIMIT " . count($parents), __FILE__, __LINE__);

if (!empty($attach))
db_query("
DELETE FROM {$db_prefix}attachments
WHERE ID_ATTACH IN (" . implode(', ', $attach) . ")
LIMIT " . count($attach), __FILE__, __LINE__);

if ($return_affected_messages)
return array_unique($msgs);
}

file $sourcedir/ManagePermissions.php

ค้นหา -->>
โค๊ด: [Select]
'profile_remote_avatar' => false,

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'profile_viewattachments' => true,
'profile_removeattachment' => true,

ค้นหา -->>
โค๊ด: [Select]
$non_guest_permissions = array(

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'profile_viewattachments',
'profile_removeattachment',

file $sourcedir/ManageMembergroups.php

ค้นหา -->>
โค๊ด: [Select]
ID_GROUP, groupName, minPosts, stars, onlineColor

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
, attquota

ค้นหา -->>
โค๊ด: [Select]
VALUES ($ID_GROUP, SUBSTRING('$_POST[group_name]', 1, 80), " . ($postCountBasedGroup ? (int) $_POST['min_posts'] : '-1') . ", '1#star.gif', ''

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
, ''

ค้นหา -->>
โค๊ด: [Select]
$_POST['stars'] = (empty($_POST['star_count']) || $_POST['star_count'] < 0) ? '' : min((int) $_POST['star_count'], 99) . '#' . $_POST['star_image'];

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
$_POST['attquota'] = isset($_POST['attquota']) ? (int) $_POST['attquota'] : 0;

ค้นหา -->>
โค๊ด: [Select]
maxMessages = $_POST[max_messages], minPosts = $_POST[min_posts], stars = '$_POST[stars]'

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
, attquota = '$_POST[attquota]'

ค้นหา -->>
โค๊ด: [Select]
SELECT groupName, minPosts, onlineColor, maxMessages, stars

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
, attquota

ค้นหา -->>
โค๊ด: [Select]
'min_posts' => $row['minPosts'],

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'attquota' => $row['attquota'],

file $sourcedir/Post.php

ค้นหา -->>
โค๊ด: [Select]
$context['show_spellchecking'] = !empty($modSettings['enableSpellChecking']) && function_exists('pspell_new');

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
// AttQuota 1.3.2
if (!$user_info['is_guest'])
{
$request = db_query("
SELECT SUM(a.size) AS totalsize
FROM {$db_prefix}attachments as a
LEFT JOIN {$db_prefix}messages as m ON (a.ID_MSG = m.ID_MSG)
WHERE m.ID_MEMBER = ".$ID_MEMBER."
AND a.attachmentType != 3
AND a.ID_MSG != 0
", __FILE__, __LINE__);
list($row) = mysql_fetch_row($request);
$context['user_attach']['size'] = (int) $row;
mysql_free_result($request);

$getquota = db_query("
SELECT attquota
FROM {$db_prefix}membergroups
WHERE ID_GROUP IN (" . implode(',', $user_info['groups']) .")
", __FILE__, __LINE__);
while ($row2 = mysql_fetch_assoc($getquota))
$quotas[] = (int) $row2['attquota'];
if (min($quotas)==0)
$context['attquota'] = 0;
else
$context['attquota'] = max($quotas);
mysql_free_result($getquota);
};
// end AttQuota 1.3.2


ค้นหา -->>
โค๊ด: [Select]
$attachmentOptions = array(
'post' => isset($_REQUEST['msg']) ? $_REQUEST['msg'] : 0

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
// AttQuota 1.3.2
if (!$user_info['is_guest'])
{
$request = db_query("
SELECT SUM(a.size) AS totalsize
FROM {$db_prefix}attachments as a
LEFT JOIN {$db_prefix}messages as m ON (a.ID_MSG = m.ID_MSG)
WHERE m.ID_MEMBER = ".$ID_MEMBER."
AND a.attachmentType != 3
AND a.ID_MSG != 0
", __FILE__, __LINE__);
list($row) = mysql_fetch_row($request);
$context['user_attach']['size'] = (int) $row;
mysql_free_result($request);

$getquota = db_query("
SELECT attquota
FROM {$db_prefix}membergroups
WHERE ID_GROUP IN (" . implode(',', $user_info['groups']) .")
", __FILE__, __LINE__);
while ($row2 = mysql_fetch_assoc($getquota))
$quotas[] = (int) $row2['attquota'];
if (min($quotas)==0)
$context['attquota'] = 0;
else
$context['attquota'] = max($quotas);
mysql_free_result($getquota);

$summa = $context['user_attach']['size'] + $_FILES['attachment']['size'][$n];
if (!empty($context['attquota']) && $summa > $context['attquota'] * 1024)
fatal_lang_error('quota_reached', false, array($context['attquota']));
};
// end AttQuota 1.3.2


file $themedir/Profile.template.php

ค้นหา -->>
โค๊ด: [Select]
// Is this member requiring activation and/or banned?

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
// AttQuota 1.3.2
echo '
<tr>
<td colspan="2"><hr size="1" width="100%" class="hrcolor" /></td>
</tr>
<tr>
<td valign="top"><b>', $txt['attachmentQuota'] ,':</b></td>
<td>';
$context['user_attach']['sizeKb']=round($context['user_attach']['size']/1024,2);
if ($context['show_attachment_quota']){
$percent=round($context['user_attach']['sizeKb']/$context['attquota'],2);
$percent2=$percent=$percent*100;
if ($percent2 > 100) $percent2=100;
echo '
<table width="175" cellspacing="1" cellpadding="2" border="0" class="bordercolor">
<tr>
<td colspan="3" width="100%" class="windowbg">
<table cellspacing="1" cellpadding="1" border="0" width="', $percent2 ,'%">
<tr>
<td height="2px" bgcolor="#000000"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="33%" align="left" bgcolor="#AAFFBF"><small>0%</small></td>
<td width="34%" align="center" bgcolor="#FFFFAA"><small>50%</small></td>
<td width="33%" align="right" bgcolor="#FFB3B3"><small>100%</small></td>
</tr>
</table><small>
', $percent > 100 ? $txt['used'].'<span style="color:#FF0000">&nbsp;'.$percent.'</span>%' : $txt['used'].'&nbsp;'.$percent.'%', '<br />
', $txt['attachmentQuota'] ,' ', $context['attquota'] ,' ', $txt['UQ_KB'] ,'<br /></small>';
}
echo '
<small>', $txt['useratt2'] ,' ', $context['user_attach']['sizeKb'] ,' ', $txt['UQ_KB'] ,
$context['can_view_attachments'] ? '<br /><a href="' . $scripturl . '?action=profile;u=' . $context['member']['id'] . ';sa=viewattachments">' . $txt['viewattachments'] . '</a>' : '', '
</small>
</td>
</tr>';
// end AttQuota 1.3.2


ค้นหา -->>
โค๊ด: [Select]
?>

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
function template_viewattachments()
{
global $context, $settings, $options, $scripturl, $txt;

if ($context['num_attachments'] == "0")
echo '
<table border="0" width="95%" cellspacing="1" cellpadding="4" class="bordercolor" align="center">
<tr class="titlebg">
<td align="center">', $txt['empty_attachments'], '</td>
</tr>
</table>
';
else
{
echo '
<form action="', $scripturl, '?action=profile;u=', $context['member']['id'], ';sort=', $context['sort_by'], $context['sort_direction'] == 'down' ? ';desc' : '', ';sa=RemoveAtt" method="post" accept-charset="', $context['character_set'], '" onsubmit="return confirm(\'', $txt['ra_confirm'], '\');">
<table border="0" width="95%" cellspacing="1" cellpadding="4" class="bordercolor" align="center">
<tr class="titlebg">
<td nowrap="nowrap"><a href="', $scripturl, '?action=profile;u=', $context['member']['id'], ';sa=viewattachments;', $context['browse_type'], ';sort=name', $context['sort_by'] == 'name' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['va_name'], $context['sort_by'] == 'name' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></td>
<td nowrap="nowrap"><a href="', $scripturl, '?action=profile;u=', $context['member']['id'], ';sa=viewattachments;', $context['browse_type'], ';sort=size', $context['sort_by'] == 'size' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['va_size'], $context['sort_by'] == 'size' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></td>
<td nowrap="nowrap"><a href="', $scripturl, '?action=profile;u=', $context['member']['id'], ';sa=viewattachments;', $context['browse_type'], ';sort=date', $context['sort_by'] == 'date' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[317], $context['sort_by'] == 'date' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></td>
', $context['can_delete_attachments'] ? '<td nowrap="nowrap" align="center"><input type="checkbox" onclick="invertAll(this, this.form);" class="check" /></td>' : '', '
</tr>';
$alternate = false;
foreach ($context['posts'] as $post)
{
echo '
<tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
<td>', $post['attachment']['link'], empty($post['attachment']['width']) || empty($post['attachment']['height']) ? '' : ' <span class="smalltext">' . $post['attachment']['width'] . 'x' . $post['attachment']['height'] . '</span>', '</td>
<td align="right">', $post['attachment']['size'], $txt['smf211'], '</td>
<td class="smalltext">', $post['time'], '<br />' . $txt['smf88'] . ' ' . $post['link'], '</td>
', $context['can_delete_attachments'] ? '<td align="center"><input type="checkbox" name="remove[' . $post['attachment']['id'] . ']" class="check" /></td>' : '', '
</tr>';
$alternate = !$alternate;
}
if ($context['can_delete_attachments'])
echo '
<tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
<td align="right" colspan="5">
<input type="submit" name="remove_submit" value="', $txt['smf138'], '" />
<input type="hidden" name="sc" value="', $context['session_id'], '" />
<input type="hidden" name="start" value="', $context['start'], '" />
</td>
</tr>';
echo '
<tr class="catbg">
<td align="left" colspan="5" style="padding: 5px;"><b>', $txt[139], ':</b> ', $context['page_index'], '</td>
</tr>
</table>
</form>';
}

}

file $themedir/ManageMembergroups.template.php

ค้นหา -->>
โค๊ด: [Select]
<img id="star_preview" src="', $settings['images_url'], '/', $context['group']['star_image'] == '' ? 'blank.gif' : $context['group']['star_image'], '" alt="*" />
</td>
</tr>

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
<tr class="windowbg2">
<th align="right" style="padding-top: 1em>
<label for="attquota">', $txt['attachmentQuota'] ,':</label>
<div class="smalltext" style="font-weight: normal">', $txt['attachmentQuotaNote'] ,'</div>
</th>
<td>
<input type="text" name="attquota" id="attquota" value="', $context['group']['attquota'], '" size="10" />', $txt['smf211'], '
</td>
</tr>

file $themedir/Post.template.php

ค้นหา -->>
โค๊ด: [Select]
if ($context['can_post_attachment'])
{

แก้เป็น -->>
โค๊ด: [Select]
if ($context['can_post_attachment'])
// AttQuota 1.3.2
if (!empty($context['attquota']) && $context['user_attach']['size'] > $context['attquota'] * 1024)
echo '
<tr id="postAttachment2">
<td align="center" valign="top" colspan="2">
', $txt['full_quota'], '
</td>
</tr>';
else
// end AttQuota 1.3.2
{

file $languagedir/Modifications.thai-utf8.php

เพิ่ม -->>
โค๊ด: [Select]
// AttQuota 1.3
$txt['attachmentQuota'] = 'Attachment quota';
$txt['attachmentQuotaNote'] = '0 = disable';
$txt['quota_reached'] = 'Sorry, your attachment quota has been reached. The total size of your files should not exceed %d KB.';
$txt['full_quota'] = '<b>Your attachment quota has been reached.</b> You cannot attach files to the message.';
$txt['useratt2'] = 'Uploaded:';
$txt['used'] = 'Usage:';
$txt['UQ_KB'] = 'KB';

// browse attachments
$txt['empty_attachments'] = 'No files';
$txt['attachment_del'] = '[attachment deleted by user]';
$txt['viewattachments'] = 'View attachments';
$txt['ra_confirm'] = 'Are you sure you want to delete the selected attachments?';
$txt['va_name'] = 'Attachment Name';
$txt['va_size'] = 'File Size';
$txt['va_att'] = 'Attachments';

// permissions
$txt['permissionname_profile_viewattachments'] = 'View attachments via profile';
$txt['permissionname_profile_removeattachment'] = 'Remove attachments via profile';
$txt['permissionhelp_profile_viewattachments'] = 'Allows users to view all attachments via profile.';
$txt['permissionhelp_profile_removeattachment'] = 'Allows users to delete the files when viewing of all attachments via profile.';
$txt['permissionname_profile_viewattachments_own'] = 'Own profile';
$txt['permissionname_profile_viewattachments_any'] = 'Any profile';
$txt['permissionname_profile_removeattachment_own'] = 'Own profile';
$txt['permissionname_profile_removeattachment_any'] = 'Any profile';
$txt['cannot_profile_viewattachments_own'] = 'You cannot view atachments in own profile';
$txt['cannot_profile_viewattachments_any'] = 'You cannot view atachments in any profile';
$txt['cannot_profile_removeattachment_own'] = 'You cannot remove atachments in own profile';
$txt['cannot_profile_removeattachment_any'] = 'You cannot remove atachments in any profile';
// end AttQuota 1.3

สร้างไฟล์: install.php เพื่อสร้างฐานข้อมูล ไว้ใน $boarddir (ที่เดียวกับไฟล์ SSI.php) รัน http://www.your_url.xxx/$boarddir/install.php -->> Enter เสร็จแล้วลบทิ้ง
โค๊ด: [Select]
<?php
$result 
db_query("
ALTER TABLE {$db_prefix}membergroups
ADD attquota int(10) NOT NULL DEFAULT '0'"
__FILE____LINE__);

if (
$result === false)
echo '<b>Error:</b> Database modifications failed!';
?>

ลิงค์หัวข้อ: http://dexmore.com/topic/2255
Windows XP    Firefox 3.6.6   see ip บันทึกการเข้า
ดูรายการสิ่งของสำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  สำหรับติดหมุดกระทู้ของคุณ!  เพิ่มเวลาที่อยู่ในระบบอีก 12 ชั่วโมง  น้องหมี..เอาไว้กอดนอนแทนกิ๊ก  สำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  
ส่งหัวข้อนี้พิมพ์ หน้า: 1 
กระโดดไป:  

Creative Commons License

SMF Thai Translation Powered by SMF © 2006–2012, Simple Machines LLC

WordPress Google เข้าเยี่ยมชมหน้านี้ล่าสุดเมื่อ : 18 พฤษภาคม 2555, 07:28:41

jQuery Plugin Copyright © 2551-2555 Themes Design & Hosting by DexMoreGroup

Sitemap | Thai Simple Machines Forum support SMF Thai

Web Begining | SMF Modifications | SMF Thai Translation Web Begining

Drupal | WordPress | CMS Joomla | jQuery Plugin | Web Graphics CMS Joomla