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

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

ส่งหัวข้อนี้พิมพ์ หน้า: 1 
icon message ผู้เขียน หัวข้อ: Yet Another Global Announcements Mod (YAGAM) หัวข้อประกาศ  (อ่าน 1980 ครั้ง)
0 สมาชิก และ 1 ผู้เยี่ยมชม กำลังดูหัวข้อนี้
*
*


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
icon message
general เมื่อ: 12 กรกฎาคม 2553, 19:19:04
  • ชื่อ: Yet Another Global Announcements Mod (YAGAM)
  • ผู้เขียน: Nibogo
  • นำเสนอโดย: DexMoreGroup
  • ประเภท: New Feature
  • รองรับ: SMF 2.0.xx
  • ปรับปรุงล่าสุด: 5 กรกฏาคม 2553
  • ต้นฉบับ: Yet Another Global Announcements Mod (YAGAM)

รายละเอียด
      สร้างหัวข้อประกาศเป็นหัวข้อสำคัญให้สมาชิกทราบ
  • คุณสามารถสร้างหัวข้อประกาศได้โดยไม่จำกัด
  • รองรับ BBCode, สัญลักษณ์แสดงอารมณ์ และ SMF WYSIWYG Editor
  • สามารถจัดการอนุญาตหัวข้อประกาศทุกหัวข้อได้อย่างอิสระ
  • เลือกให้แสดงเฉพาะบอร์ด หรือแสดงในบอร์ดทั้งหมด
  • อนุญาตให้สมาชิกเฉพาะกลุ่มหรือทั้งหมด
  • แสดงผลแบบหัวปกติ หรือหัวข้อประกาศ
  • แสดงตัวอย่างก่อนใช้งานจริง
  • สามารถเปิด/ปิดการใช้งานได้ทันที
  • อนุญาตให้กลุ่มสมาชิกจัดการกับหัวข้อประกาศหรือความคิดเห็นหัวข้อประกาศ
  • สามารถแปลงหัวข้อติดหมุดเป็นหัวข้อประกาศ
  • แปลงความคิดเห็นเป็นการตอบกระทู้
  • เก็บบันทึกรายละเอียดในการกระทำกับหัวข้อประกาศ
  • มีลิงค์ทรีให้ด้วย
  • สนับสนุนใครบ้างที่ออนไลน์ "กำลังดูหัวข้อประกาศ"
  • แยกเค้าโครงระหว่างหัวข้อปกติ/หัวข้อติดหมุด และหัวข้อประกาศ
  • เลือกจัดเรียงตามวันที่เริ่มหรือจัดเรียงตามความคิดเห็น จากบนลงล่าง หรือล่างขึ้นบน
  • กำหนดให้สมาชิกต้องอ่านเมื่อเข้าสู่ระบบ
  • สนับสนุน Member Color Link Mod
  • มี SSI Functions สำหรับนำไปแสดงแบบกำหนดจำนวน หรือแบบสุ่ม
  • อื่นๆ อีกหลายอย่างอยากรู้ลองใช้ดูแล้วกัน

ตัวอย่าง


แก้ไขไฟล์:

file $boarddir/index.php

ค้นหา -->>
โค๊ด: [Select]
'announce' => array('Post.php', 'AnnounceTopic'),

แก้เป็น -->>
โค๊ด: [Select]
'announcements' => array('Announcements.php', 'AnnouncementsMain'),
        'announcement' => array('AnnouncementView.php', 'announcements_view'),

file $boarddir/SSI.php

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

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
// YAGAM SSI Function
function ssi_announcement($announcement = null)
{
global $scripturl, $smcFunc, $txt, $settings, $modSettings, $context;

loadLanguage('Stats');

if ($announcement !== null)
$announcement = (int) $announcement;
elseif (isset($_GET['aid']))
$announcement = (int) $_GET['aid'];

$request = $smcFunc['db_query']('', '
SELECT
a.title, a.content, a.author, a.date, mem.id_member, mem.member_name
FROM {db_prefix}announcements AS a
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = a.author)
WHERE a.id_announcement = {int:announcement_id}',
array(
   'announcement_id' => $announcement,
)
);
$return = array();

if ($smcFunc['db_num_rows']($request) == 0)
{
die($txt['smf_news_error2']);
}

$row = $smcFunc['db_fetch_assoc']($request);

censorText($row['title']);
censorText($row['content']);

$global[] = array(
'title' => '<a href="' . $scripturl . '?action=announcements;aid=' . $announcement . '">'.$row['title'].'</A>',
'date' => timeformat($row['date']),
'content' => $row['content'],
'link' => ''.$txt['read_more'].'</a>',
'poster' => array(
'id' => $row['author'],
'name' => $row['member_name'],
'href' => !empty($row['author']) ? $scripturl . '?action=profile;u=' . $row['author'] : '',
'link' => !empty($row['author']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['author'] . '">' . $row['member_name'] . '</a>' : $row['member_name']
),
 );
$smcFunc['db_free_result']($request);

foreach ($global as $global_announcement)
echo '<table border="0" width="100%" align="center" class="smfNews">
<tr>
<td><b>', $global_announcement['title'], '</b><span class="smaller"><br />', $global_announcement['date'], ' '.$txt['by'].' ', $global_announcement['poster']['link'], '<br /><br /></span>
</td>
</tr>
<tr>
<td>', $global_announcement['content'], '<br /><br />
</td>
</tr>
<tr>
<td>', $global_announcement['link'], '
</td>
</tr>
</table>';
}

// Random Announcement
function ssi_random_announcement()
{
   global $scripturl, $smcFunc;

$request = $smcFunc['db_query']('', '
SELECT
title, id_announcement
FROM {db_prefix}announcements
WHERE enable = {int:is_approved}
ORDER BY RAND()
LIMIT {int:is_approved}',
array(
  'is_approved' => 1,
)
);

$row = $smcFunc['db_fetch_assoc']($request);
censorText($row['title']);
    $row['title'] = '<a href="' . $scripturl . '?action=announcements;aid=' . $row['id_announcement'] . '">'.$row['title'].'</a>';
$smcFunc['db_free_result']($request);
echo $row['title'];
}

file $boarddir/ssi_examples.shtml

ค้นหา -->>
โค๊ด: [Select]
<!--#include virtual="./SSI.php?ssi_function=recentEvents" -->

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
<hr />
<h3>Return a random global announcement: &lt;!--#include virtual="./SSI.php?ssi_function=ssi_random_announcement" --&gt;</h3>
<!--#include virtual="./SSI.php?ssi_function=ssi_random_announcement" -->

<hr />

file $sourcedir/Display.php

ค้นหา -->>
โค๊ด: [Select]
$context['can_mark_notify'] &= !$context['user']['is_guest'];

แก้เป็น -->>
โค๊ด: [Select]
$context['can_mark_notify'] &= !$context['user']['is_guest'];
$context['can_manage_announcements'] = allowedTo('yagam_manage');

file $sourcedir/ManagePermissions.php

ค้นหา -->>
โค๊ด: [Select]
$groupLevels['global']['standard'] = array_merge($groupLevels['global']['restrict'], array(

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

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

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

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

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

'yagam_comment' => array(false, 'general', 'view_basic_info'),

ค้นหา -->>
โค๊ด: [Select]
'access_mod_center' => array(false, 'maintenance', 'moderate_general'),

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'yagam_manage' => array(false, 'maintenance', 'administrate'),

file $sourcedir/MessageIndex.php

ค้นหา -->>
โค๊ด: [Select]
// If there are children, but no topics and no ability to post topics...
$context['no_topic_listing'] = !empty($context['boards']) && empty($context['topics']) && !$context['can_post_new'];

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
   
// YAGAM Start's Here
// First add some sort options subject,replies,views or ID .Yep with the topics sort (Pretty Cool Right? :p)
if (isset($_REQUEST['sort']) && ($_REQUEST['sort'] == 'mf.subject'))
  $ysort = 'title';
elseif (isset($_REQUEST['sort']) && ($_REQUEST['sort'] == 't.num_replies'))
  $ysort = 'comment_total';
elseif (isset($_REQUEST['sort']) && ($_REQUEST['sort'] == 't.num_views'))
  $ysort = 'views';
else
  $ysort = 'id_announcement';

// Now define DESC or ASC for the Sort Options
if (isset($_REQUEST['desc']))
  $ydesc = 'DESC';
else
  $ydesc = 'ASC';

// Give me the Announcement , Author and the Author Color!
    $dbresult = $smcFunc['db_query']('', '
SELECT
a.id_announcement, a.enable, a.date, a.author, m.real_name, a.permissions, a.title, a.views, a.id_boards, a.can_comment, a.comment_total
FROM {db_prefix}announcements AS a
   LEFT JOIN {db_prefix}members AS m  ON (a.author = m.ID_MEMBER)
    WHERE a.enable = {int:is_approved}      
ORDER BY {text:sort} {text:desc}',
array(
        'is_approved' => 1,
'sort' => $ysort,
'desc' => $ydesc,
        )
);

    // Load the Announcements
$context['announcements'] = array();
while ($row = $smcFunc['db_fetch_assoc']($dbresult))
$context['announcements'][] = $row;
$smcFunc['db_free_result']($dbresult);

file $sourcedir/LogInOut.php

ค้นหา -->>
โค๊ด: [Select]
// Just log you back out if it's in maintenance mode and you AREN'T an admin.
if (empty($maintenance) || allowedTo('admin_forum'))
redirectexit('action=login2;sa=check;member=' . $user_info['id'], $context['server']['needs_login_fix']);
else
redirectexit('action=logout;' . $context['session_var'] . '=' . $context['session_id'], $context['server']['needs_login_fix']);

แก้เป็น -->>
โค๊ด: [Select]
// YAGAM Force the Normal Users - Based on the Blue Dream Code on  Tips and Tricks
if (!empty($modSettings['yagam_force_id']) && is_numeric($modSettings['yagam_force_id']))
{    
  // Verify if he saw the Announcement
  $request = $smcFunc['db_query']('', '
 SELECT id_announcement, id_member
 FROM {db_prefix}announcements_log
 WHERE id_announcement = {int:announcement_id}
AND id_member = {int:user_id}
 LIMIT 1',
     array(
            'announcement_id' => $modSettings['yagam_force_id'],
'user_id' => $user_info['id'],
)
);
  list ($read) = $smcFunc['db_fetch_row']($request);
  $smcFunc['db_free_result']($request);
 
  // Just log you back out if it's in maintenance mode and you AREN'T an admin.
  if((empty($maintenance) || allowedTo('admin_forum')) && (empty($read)))
     redirectexit('action=announcement;aid='.$modSettings['yagam_force_id']);
  elseif ((empty($maintenance) || allowedTo('admin_forum')) && ((!empty($read)) || empty($exists)))
 redirectexit('action=login2;sa=check;member=' . $user_info['id'], $context['server']['needs_login_fix']);
  else
     redirectexit('action=logout;' . $context['session_var'] . '=' . $context['session_id'], $context['server']['needs_login_fix']);
   }
   else
   {
// Just log you back out if it's in maintenance mode and you AREN'T an admin.
if (empty($maintenance) || allowedTo('admin_forum'))
redirectexit('action=login2;sa=check;member=' . $user_info['id'], $context['server']['needs_login_fix']);
else
redirectexit('action=logout;' . $context['session_var'] . '=' . $context['session_id'], $context['server']['needs_login_fix']);
}

file $sourcedir/Admin.php

ค้นหา -->>
โค๊ด: [Select]
'postsettings' => array(
'label' => $txt['manageposts'],
'file' => 'ManagePosts.php',
'function' => 'ManagePostSettings',

แก้เป็น -->>
โค๊ด: [Select]
     'announcements' => array(
'label' => $txt['yagam_admin'],
'file' => 'Announcements.php',
'function' => 'AnnouncementsMain',
'custom_url' => $scripturl . '?action=admin;area=announcements;sa=admin;sesc=' . $sc,
'icon' => 'yagam.gif',
                    'subsections' => array(
   'admin' => array($txt['yagam_admin'], 'admin_forum'),
   'add' => array($txt['yagam_admin_add'], 'admin_forum'),
                        'settings' => array($txt['yagam_admin_settings'], 'admin_forum'),
                        'version' => array($txt['yagam_version'], 'admin_forum'),
),
),
'postsettings' => array(
'label' => $txt['manageposts'],
'file' => 'ManagePosts.php',
'function' => 'ManagePostSettings',

file $themedir/Display.template.php

ค้นหา -->>
โค๊ด: [Select]
'print' => array('text' => 'print', 'image' => 'print.gif', 'lang' => true, 'custom' => 'rel="new_win nofollow"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'),

แก้เป็น -->>
โค๊ด: [Select]
'print' => array('text' => 'print', 'image' => 'print.gif', 'lang' => true, 'custom' => 'rel="new_win nofollow"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'),
   'make_announcement' => array('test' => 'can_manage_announcements', 'text' => 'yagam_convert', 'image' => 'announcements.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\''. $txt['yagam_confirm_convert']. '\');"', 'url' => $scripturl . '?action=announcements;sa=convert;topic=' . $context['current_topic']),

file $themedir/MessageIndex.template.php

ค้นหา -->>
โค๊ด: [Select]
global $context, $settings, $options, $scripturl, $modSettings, $txt;

แก้เป็น -->>
โค๊ด: [Select]
global $context, $settings, $options, $scripturl, $modSettings, $txt, $user_info, $board_info;

ค้นหา -->>
โค๊ด: [Select]
foreach ($context['topics'] as $topic)
{
// Is this topic pending approval, or does it have any posts pending approval?
if ($context['can_approve_posts'] && $topic['unapproved_posts'])
$color_class = !$topic['approved'] ? 'approvetbg' : 'approvebg';
// We start with locked and sticky topics.
elseif ($topic['is_sticky'] && $topic['is_locked'])
$color_class = 'stickybg locked_sticky';
// Sticky topics should get a different color, too.
elseif ($topic['is_sticky'])
$color_class = 'stickybg';
// Locked topics get special treatment as well.
elseif ($topic['is_locked'])
$color_class = 'lockedbg';
// Last, but not least: regular topics.
else
$color_class = 'windowbg';

// Some columns require a different shade of the color class.
$alternate_class = $color_class . '2';

แก้เป็น -->>
โค๊ด: [Select]
// YAGAM starts here with the bars
   $announcement_bar = false;
        $normal_bar = false;
   $sticky_bar = (isset($modSettings['yagam_admin_sticky_bar'])) ? false : true;

        if (!empty($context['announcements'])){
foreach($context['announcements']  as $announcement)
       {      
// Check permission and current board
$permission_groups = explode(',',$announcement['permissions']);        
            $allowed_boards = explode(',', $announcement['id_boards']);
   
// Lets Add the Global Announcement Bar only with the permission and the board = 0 or current board
if ((in_array($board_info['id'], $allowed_boards) || $announcement['id_boards'] == 0) && ((count(array_intersect($user_info['groups'], $permission_groups)) !== 0) || $context['user']['is_admin']) && !$announcement_bar){
            echo'<tr class="titlebg"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '" style="padding:6px 4px;"><b>'.$txt['yagam_admin'].'</b></td></tr>';
            $announcement_bar = true;
            }

   // You can see this if you have permission , the right board or admin
            if (((in_array($board_info['id'], $allowed_boards)) || $announcement['id_boards'] == 0) && ((count(array_intersect($user_info['groups'], $permission_groups)) !== 0) || $context['user']['is_admin']))
                {
echo '
<tr>
<td class="windowbg2 icon1 yagam">
<img src="', $settings['images_url'], '/topic/normal_post.gif" alt="" />
</td>
<td class="windowbg2 icon2 yagam">
<img src="', $settings['images_url'], '/post/exclamation.gif" alt="" />
</td>
<td  class="subject windowbg yagam">
   <a href="',$scripturl,'?action=announcements;aid=',$announcement['id_announcement'],'"><strong>',$announcement['title'], '</strong></a>
   <p class="smalltext">', $txt['started_by'], ' <a href="'.$scripturl.'?action=profile;u=',$announcement['author'], '" ', (!empty($modSettings['MemberColorLinkInstalled'])) ? 'style="color: '.$announcement['online_color'].';"' : '', '>',$announcement['real_name'], '</a></p>
</td>
<td class="stats yagam">
   ', ($announcement['can_comment'] == '1') ? ''.$announcement['comment_total'].' ' . $txt['replies'] : '--', '<br />
',$announcement['views'], ' ' . $txt['views']. '
   </td>
<td class="windowbg2 lastpost yagam">
'.$txt['yagam_created'].' : ',timeformat($announcement['date']), '
</td>';
if (allowedTo('yagam_manage') && !empty($options['display_quick_mod']))
echo '<td class="windowbg2 moderate yagam" width="5%"><a href="',$scripturl,'?action=announcements;sa=edit;aid=',$announcement['id_announcement'],'" title="'.$txt['yagam_edit'].'"><img src="'.$settings['images_url'].'/buttons/modify.gif" alt="',$txt['yagam_edit2'], '"></a>
<a href="',$scripturl,'?action=announcements;sa=deleteverify;aid=',$announcement['id_announcement'],'" title="'.$txt['yagam_remove'].'" onclick="return confirm(\''.$txt['yagam_remove_verify'].'\')"><img src="'.$settings['images_url'].'/buttons/delete.gif" alt="',$txt['yagam_remove2'], '"></a>
</td>';
echo'</tr>';      
}
}
}

foreach ($context['topics'] as $topic)
{
// Is this topic pending approval, or does it have any posts pending approval?
if ($context['can_approve_posts'] && $topic['unapproved_posts'])
$color_class = !$topic['approved'] ? 'approvetbg' : 'approvebg';
// We start with locked and sticky topics.
elseif ($topic['is_sticky'] && $topic['is_locked'])
$color_class = 'stickybg locked_sticky';
// Sticky topics should get a different color, too.
elseif ($topic['is_sticky'])
$color_class = 'stickybg';
// Locked topics get special treatment as well.
elseif ($topic['is_locked'])
$color_class = 'lockedbg';
// Last, but not least: regular topics.
else
$color_class = 'windowbg';

// Some columns require a different shade of the color class.
$alternate_class = $color_class . '2';

// Add the sticky bar
if ($topic['is_sticky'] && !$sticky_bar && (!empty($modSettings['yagam_admin_sticky_bar']))){
            echo'<tr class="titlebg"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '" style="padding:8px 4px;"><b>'.$txt['yagam_sticky_bar'].'</b></td></tr>';
            $sticky_bar = true;
            }

// The Normal Bar Added by YAGAM
            if (!$normal_bar && ((($announcement_bar || $sticky_bar) && !$topic['is_sticky']) || ($announcement_bar && !$topic['is_sticky'] && !empty($modSettings['yagam_admin_sticky_bar'])) || ($announcement_bar && !$sticky_bar && empty($modSettings['yagam_admin_sticky_bar'])) || ($announcement_bar && !$sticky_bar))){
            echo'<tr class="titlebg"><td colspan="', empty($options['display_quick_mod']) ? '7' : '8', '" style="padding:8px 4px;"><b>'.$txt['yagam_topics'].'</b></td></tr>';
            $normal_bar = true;
            }

file $themedir/css/index.css

ค้นหา -->>
โค๊ด: [Select]
/* Posts and personal messages displayed throughout the forum. */

แก้เป็น -->>
โค๊ด: [Select]
.yagam
{
    background: #EFC8B3;
}

/* Posts and personal messages displayed throughout the forum. */

file $languagedir/Modifications.thai-utf8.php

เพิ่ม -->>
โค๊ด: [Select]
// YAGAM - Admin and MessageIndex Strings
$txt['yagam_admin'] = 'Global Announcements';
$txt['yagam_sticky_bar'] = 'Important Topics';
$txt['yagam_topics'] = 'Normal Topics';
$txt['yagam_created'] = 'Created on';
$txt['yagam_remove_verify'] = 'Are you sure that you want to delete this announcement?';
$txt['whoall_announcements'] = 'Viewing a Global Announcement';
$txt['permissionname_yagam_manage'] = 'Manage Global Announcements';
$txt['permissionhelp_yagam_manage'] = 'Set if you wish to allow the user to manage global announcements.';
$txt['permissionname_yagam_comment'] = 'Comment Global Announcements';
$txt['permissionhelp_yagam_comment'] = 'Set if you wish to allow user comments on global announcements.';
$txt['yagam_edit2'] = 'Edit';
$txt['yagam_edit'] = 'Edit Announcement';
$txt['yagam_remove'] = 'Delete Announcement';
$txt['yagam_remove2'] = 'Remove';
$txt['yagam_admin_add'] = 'Add Global Announcement';
$txt['yagam_admin_settings'] = 'Global Announcements Settings';
$txt['yagam_version'] = 'Global Announcements Version';
$txt['yagam_confirm_convert'] = 'Are you Sure that you want to convert this topic? The topic will be deleted';
$txt['yagam_convert'] = 'Convert into Announcement';

ดาวน์โหลด: YAGAM.rar
ขออภัย! ท่านไม่สามารถเข้าถึงข้อมูลส่วนนี้ได้ กรุณาอ่าน เงื่อนไขการใช้งาน DexMore.Com

แตกไฟล์แล้วอัพโหลดไปไว้ที่
file Announcements.php -->> $sourcedir
file AnnouncementView.php -->> $sourcedir
file Subs-Announcements.php -->> $sourcedir      
file Announcements.template.php -->> $themedir
file AnnouncementView.template.php -->> $themedir
file Announcements.english.php -->> $languagedir
file Announcements.thai-utf8.php -->> $languagedir
file yagam.gif -->> $imagesdir/admin

สร้างไฟล์: db_yagam.php เพื่อสร้างฐานข้อมูล ไว้ใน $boarddir (ที่เดียวกับไฟล์ SSI.php) รัน http://www.your_url.xxx/$boarddir/db_yagam.php -->> Enter เสร็จแล้วลบทิ้ง
โค๊ด: [Select]
<?php

/**********************************************************************************
* db_yagam.php                                                                    *                                                                        
***********************************************************************************
*                                                                                 *                                                                            
* YAGAM - Yet Another Global Announcements Mod                                    *                                    
* Copyright (c) 2009 by NIBOGO. All rights reserved.                              *                                       
* Powered by www.smfpacks.com                                                     *                                                     
* Created by NIBOGO for SMFPacks.com                                              *                                            
*                                                                                 *                                                          
**********************************************************************************/
    
global $smcFunc$context$db_prefix;

// Define the Manual Installation Status
    
$manual_install false;

    if (
file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF')){
require_once(dirname(__FILE__) . '/SSI.php');
$manual_install true;
    }
    elseif (!
defined('SMF'))
die('The YAGAM installer wasn\'t able to connect to SMF! Make sure that you are either installing this via the Package Manager or the SSI.php file is in the same directory.');

    if (
$manual_install)
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title>YAGAM Database Installer</title>
     <link rel="stylesheet" type="text/css" href="Themes/default/css/index.css" />
</head>
<body>
<br /><br />'
;

db_extend('packages');   

$columns = array(
    array(
      
'name' => 'id_announcement',
      
'type' => 'int',
      
'size' => '11',
      
'null' => false,
  'auto' => true
    
),    
    array(
      
'name' => 'enable',
      
'type' => 'tinyint',
      
'size' => '1',
      
'null' => true,
      
'default' => '1'
    
),
array(
      
'name' => 'author',
      
'type' => 'int',
      
'null' => false
    
),
array(
      
'name' => 'can_comment',
      
'type' => 'tinyint',
  'size' => '1'
    
),
array(
      
'name' => 'date',
      
'type' => 'int',
  'size' => '10',
      
'null' => false,
  'default' => '0',
  'unsigned' => true
    
),
array(
      
'name' => 'comment_total',
      
'type' => 'int',
      
'null' => false,
  'default' => '0'
    
),
array(
      
'name' => 'title',
      
'type' => 'tinytext',
      
'null' => false
    
),
    array(
      
'name' => 'content',
      
'type' => 'text'
    
),
array(
      
'name' => 'views',
      
'type' => 'int',
  'size' => '10',
  'null' => false,
  'default' => '0'
    
),
array(
      
'name' => 'permissions',
      
'type' => 'text'
    
),
array(
      
'name' => 'id_boards',
      
'type' => 'text'
    
),
    );

    
// Set up the correct indexes for the table.
    
$indexes = array(
      array(
        
'type' => 'primary',
        
'columns' => array('id_announcement')
      ),
    ); 

  
$smcFunc['db_create_table']('{db_prefix}announcements'$columns$indexes);

$tables[] = $db_prefix 'announcements';

    
// The Announcements_Comments Table
$columns2 = array(
    array(
      
'name' => 'id_comment',
      
'type' => 'int',
      
'size' => '11',
      
'null' => false,
  'auto' => true
    
),
    array(
      
'name' => 'id_announcement',
      
'type' => 'int',
      
'size' => '11',
      
'null' => true
    
),
    array(
      
'name' => 'author',
      
'type' => 'tinytext'
    
),
array(
      
'name' => 'comment_body',
      
'type' => 'text'
    
),
array(
      
'name' => 'date',
      
'type' => 'int',
  'size' => '10',
      
'null' => false,
  'default' => '0'
    
),
array(
      
'name' => 'last_modified',
      
'type' => 'int',
  'size' => '10',
      
'null' => false,
  'default' => '0'
    
),
    );

    
// Set up the correct indexes for the table.
    
$indexes2 = array(
      array(
        
'type' => 'primary',
        
'columns' => array('id_comment')
      ),
    ); 
  
$smcFunc['db_create_table']('{db_prefix}announcements_comments'$columns2$indexes2);

// Maybe some people is updating from one of the first versions of YAGAM so Update!
$smcFunc['db_add_column'] ('{db_prefix}announcements_comments', array(
'name' => 'modified_name',
'type' => 'text',
'null' => false
));

    
$tables[] = $db_prefix 'announcements_comments';

    
// The Announcements_Log Table
$columns3 = array(
    array(
      
'name' => 'id_member',
      
'type' => 'int',
      
'size' => '11',
      
'null' => false
    
),
    array(
      
'name' => 'id_announcement',
      
'type' => 'int',
      
'size' => '11',
      
'null' => true
    
),
    );

    
// Set up the correct indexes for the table.
    
$indexes3 = array(
      array(
        
'type' => 'primary',
        
'columns' => array('id_member')
      ),
    ); 
  
$smcFunc['db_create_table']('{db_prefix}announcements_log'$columns3$indexes3);
$tables[] = $db_prefix 'announcements_log';   

// OK, time to report, output all the stuff to be shown to the user
if ($manual_install){
echo 
'
<div class="padding windowbg2" align="center" style="margin-right: auto; margin-left: auto; width: 800px;">
<h3 class="catbg"><span class="left"></span><span class="right"></span><b>YAGAM Database Installer</b></h3>
<table cellpadding="0" cellspacing="0" border="0" class="tborder" width="800" align="center"><tr><td>
<div style="padding: 2ex">
<b>Creating Tables:</b>
<br /><br />
<ul class="normallist">'
;
foreach (
$tables as $table_name)
echo '
<li>'
.$table_name.' table created.</li>';

echo 
'
<div style="padding-top:30px">
<b>Your database update has been completed successfully!</b>
<br /><br />The YAGAM Database was successfully installed.<br />
Now you should go to the <a href="'
$scripturl'?action=admin;area=announcements;sa=admin;sesc=' $context['session_id'] . '">YAGAM Admin Panel</a>.
<br /><br />'
;

if (
$manual_install && (is_writable(dirname(__FILE__)) || is_writable(__FILE__)))
echo '
<label for="delete_self"><input type="checkbox" id="delete_self" onclick="doTheDelete(this);" /> Delete this file.</label> <i>(doesn\'t work on all servers.)</i>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function doTheDelete(theCheck)
{
var theImage = document.getElementById ? document.getElementById("delete_upgrader") : document.all.delete_upgrader;
theImage.src = "'
$_SERVER['PHP_SELF'], '?delete=1&ts_" + (new Date().getTime());
theCheck.disabled = true;
}
// ]]></script>
<img src="'
$boardurl'/Themes/default/images/blank.gif" alt="" id="delete_upgrader" />';

echo 
'
</div>
</div>
</body></html>'
;
    }

?>


การตั้งค่า: ผู้ดูแล -->> หัวข้อประกาศ


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



Thailand   ชาย ออฟไลน์
icon message
general ความคิดเห็นที่ 1 เมื่อ: 22 กุมภาพันธ์ 2554, 16:40:59
กำลังหาอยู่พอดีเลยครับ

ลิงค์หัวข้อ: http://dexmore.com/topic/2369
Windows XP    Microsoft Internet Explorer 7.0   see ip บันทึกการเข้า
ดูรายการสิ่งของน้องหมี..เอาไว้กอดนอนแทนกิ๊ก  
โฮสต์ดีๆ บริการด้วยใจ
*
***



Thailand   ชาย ออฟไลน์ เว็บไซต์
icon message
general ความคิดเห็นที่ 2 เมื่อ: 27 มกราคม 2555, 22:16:01
ลองทำดูแล้วครับมัน เออเรอ เลยอัพอันเก่าคืน อิอิ

ลิงค์หัวข้อ: http://dexmore.com/topic/2369
Mac OS X    Safari   see ip บันทึกการเข้า
โฮสต์ดีๆ บริการด้วยใจ
ส่งหัวข้อนี้พิมพ์ หน้า: 1 
กระโดดไป:  

Creative Commons License

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

WordPress Google เข้าเยี่ยมชมหน้านี้ล่าสุดเมื่อ : 16 พฤษภาคม 2555, 19:34:08

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