- ชื่อ: SMF Trader System
- ผู้เขียน: vbgamer45
- นำเสนอโดย: DexMoreGroup
- ประเภท: New Feature
- รองรับ: SMF 1.1.x, 2.0.x
- ปรับปรุงล่าสุด: 12 มิถุนายน 2554
- ต้นฉบับ: SMF Trader System
รายละเอียด เป็นระบบให้ความน่าเชื่อถือสำหรับผู้ขาย ผู้ซื้อ หรือผู้ประกอบการ เหมาะสำหรับฟอรั่มที่เปิดให้มีการซื้อ-ขายภายในบอร์ด มีการให้คะแนน แสดงความคิดเห็น แต่ดูจะไม่ค่อยสมบูรณ์นักเพราะนาย vbgamer45 คนนี้เขาทำ mod มาเพื่อขาย ส่วนที่นำมาให้ใช้กันฟรีๆ ก็ดูยังมีอะไรที่กั๊กๆ อยู่ และจะต้องใช้การผสานกับอีกหลายๆ mod แต่ท่านใดต้องการใช้ mod ประเภทนี้หากต้องการความสามารถเต็มก็ลองติดต่อนายคนนี้ดูนะครับ อุดหนุนเขาหน่อยก็ดี
ตัวอย่าง
สำหรับ SMF 1.1.xแก้ไขไฟล์:file $boarddir/index.php
ค้นหา -->>
'trackip' => array('Profile.php', 'trackIP'),
เพิ่มไว้หลัง -->>
'trader' => array('Trader.php', 'tradermain'),
file $sourcedir/ManagePermissions.php
ค้นหา -->>
'pm' => array(
'pm_read' => false,
'pm_send' => false,
)
เพิ่มไว้หลัง -->>
'smftrader' => array(
'smftrader_feedback' => false,
'smftrader_deletefeed' => false,
'smftrader_autorating' => false,
),
file $sourcedir/Subs.php
ค้นหา -->>
'edit_settings' => '<a href="' . $scripturl . '?action=serversettings;sesc=' . $sc . '">' . $txt[222] . '</a>',
เพิ่มไว้หลัง -->>
'trader_settings' => '<a href="' . $scripturl . '?action=trader;sa=admin;sesc=' . $sc . '">' . $txt['smftrader_admin'] . '</a>',
file $themedir/Display.template.php
ค้นหา -->>
global $context, $settings, $options, $txt, $scripturl, $modSettings;
เพิ่มไว้หลัง -->>
global $db_prefix;
ค้นหา -->>
// Show the member's primary group (like 'Administrator') if they have one.
if (isset($message['member']['group']) && $message['member']['group'] != '')
echo '
', $message['member']['group'], '<br />';
เพิ่มไว้หลัง -->>
//Start SMF Trader System
global $sourcedir;
include_once $sourcedir . '/Trader.php';
GetTraderInformation($message['member']['id']);
$context['neturalcount'] = 0;
$context['pcount'] = 0;
$context['ncount'] = 0;
foreach($context['trader_mem_data'] as $row)
{
if ($row['salevalue'] == 0)
{
$context['pcount'] = $row['total'];
}
else if ($row['salevalue'] == 2)
{
$context['ncount'] = $row['total'];
}
else if ($row['salevalue'] == 1)
{
$context['neturalcount'] = $row['total'];
}
}
if ($modSettings['trader_use_pos_neg'])
$tradecount = ($context['pcount'] - $context['ncount']);
else
$tradecount = $context['pcount'] + $context['ncount'] + $context['neturalcount'];
// Show the trader info
echo '
<b>' . $txt['smftrader_profile'] . ' </b>
(<a href="' . $scripturl . '?action=trader&id=' . $message['member']['id'] . '">', $modSettings['trader_use_pos_neg'] ? ($tradecount > 0 ? '+' . $tradecount : $tradecount) : $tradecount , '</a>)<br />';
//END SMF Trader System
file $themedir/Profile.template.php
ค้นหา -->>
global $context, $settings, $options, $scripturl, $modSettings, $txt;
// First do the containing table and table header.
แก้เป็น -->>
global $context, $settings, $options, $scripturl, $modSettings, $txt, $db_prefix;
// First do the containing table and table header.
ค้นหา -->>
echo '
<td colspan="2"><hr size="1" width="100%" class="hrcolor" /></td>
</tr>';
// Show the users signature.
เพิ่มไว้ก่อน -->>
// Start SMF Trader System
global $sourcedir;
include_once $sourcedir . '/Trader.php';
$tradecount = GetTraderCount($context['member']['id']);
GetTraderInformation($context['member']['id']);
$context['neturalcount'] = 0;
$context['pcount'] = 0;
$context['ncount'] = 0;
foreach($context['trader_mem_data'] as $row)
{
if ($row['salevalue'] == 0)
{
$context['pcount'] = $row['total'];
}
else if ($row['salevalue'] == 2)
{
$context['ncount'] = $row['total'];
}
else if ($row['salevalue'] == 1)
{
$context['neturalcount'] = $row['total'];
}
}
$context['tradecount_nonetural'] = ($context['pcount'] + $context['ncount']);
if ($modSettings['trader_use_pos_neg'])
$tradecount = ($context['pcount'] -$context['ncount']);
echo '<tr><td colspan="2"><hr size="1" width="100%" class="hrcolor" /></td></tr>
<tr><td><b>' . $txt['smftrader_title'] . '</b></td></tr>
<tr><td><b>' . $txt['smftrader_profile'] . '</b></td><td><b>(<a href="' . $scripturl . '?action=trader&id=' . $context['member']['id'] . '">' . ($modSettings['trader_use_pos_neg'] ? ($tradecount > 0 ? '+' . $tradecount : $tradecount) : $tradecount) . '</a>)</b></td></tr>
<tr><td><b>' . $txt['smftrader_positivefeedbackpercent'] . '</b></td><td><b>' , $context['tradecount_nonetural'] != 0 ? round(($context['pcount'] / $context['tradecount_nonetural']) * 100, 2) : 0 , '%</b></td></tr>
<tr><td>' . $txt['smftrader_positivefeedback'] . '</td><td>' . $context['pcount'] . ' <img src="' . $modSettings['smileys_url'] . '/default/smiley.gif" alt="positive" /></td></tr>
<tr><td>' . $txt['smftrader_neutralfeedback'] . '</td><td>' . $context['neturalcount'] . ' <img src="' . $modSettings['smileys_url'] . '/default/undecided.gif" alt="neutral" /></td></tr>
<tr><td>' . $txt['smftrader_negativefeedback'] . '</td><td>' . $context['ncount'] . ' <img src="' . $modSettings['smileys_url'] . '/default/angry.gif" alt="negative" /></td></tr>
<tr><td>' . $txt['smftrader_totalfeedback'] . '</td><td>' . ($context['pcount'] - $context['ncount']) . '</td></tr>';
global $ID_MEMBER;
if ($ID_MEMBER != $context['member']['id'])
echo '
<tr><td colspan="2"><br /><a href="' . $scripturl . '?action=trader&sa=submit&id=' . $context['member']['id'] . '">' . $txt['smftrader_submitfeedback'] . $context['member']['name'] . '</a></td></tr>';
// END SMF Trader System
file $languagedir/Modifications.thai-utf8.php
เพิ่ม -->>
//Begin SMF Trader System Text Strings
$txt['smftrader_title'] = 'SMF Trader System';
$txt['smftrader_version'] = '1.1';
$txt['smftrader_admin'] = 'Trader Settings';
$txt['smftrader_guest'] = 'Guest';
//Display text strings
$txt['smftrader_profile'] = 'Trade Count: ';
//Profile text strings
$txt['smftrader_submitfeedback'] = 'Submit feedback for ';
$txt['smftrader_totalfeedback'] = 'Total Positive Feedback: ';
$txt['smftrader_positivefeedbackpercent'] = 'Positive Feedback: ';
$txt['smftrader_positivefeedback'] = '<span style="color: #006400;">Positive Feedback: </span>';
$txt['smftrader_neutralfeedback'] = 'Neutral Feedback: ';
$txt['smftrader_negativefeedback'] = '<span style="color: #FF0000;">Negative Feedback: </span>';
//Start trader.template
//Submit Transaction Rating
$txt['smftrader_whoareu'] = 'You were the:';
$txt['smftrader_buyer'] = 'Buyer';
$txt['smftrader_seller'] = 'Seller';
$txt['smftrader_trade'] = 'Trade';
$txt['smftrader_transaction'] = 'Transaction Rating:';
$txt['smftrader_positive'] = 'Positive';
$txt['smftrader_neutral'] = 'Neutral';
$txt['smftrader_negative'] = 'Negative';
$txt['smftrader_shortcomment_small'] = 'Short Comment';
$txt['smftrader_shortcomment'] = 'Short comment on your transaction:';
$txt['smftrader_shortcommentnote'] = 'Max: 100 characters';
$txt['smftrader_topicurl'] = 'Topic URL:';
$txt['smftrader_longcomment'] = 'Long comment on your transaction:';
//Rating Overview
$txt['smftrader_allfeedback'] = 'View All Feedback';
$txt['smftrader_sellerfeedback'] = 'View Seller Feedback';
$txt['smftrader_buyerfeedback'] = 'View Buyer Feedback';
$txt['smftrader_tradefeedback'] = 'View Trade Feedback';
//Page Titles
$txt['smftrader_feedbacktitle'] = 'SMF Trader System - Trader Overview';
$txt['smftrader_submittitle'] = 'SMF Trader System - Submit Feedback';
$txt['smftrader_reporttitle'] = 'SMF Trader System - Report Bad Feedback';
$txt['smftrader_contact'] = 'Contact';
$txt['smftrader_viewprofile'] = 'View full profile.';
$txt['smftrader_sendpm'] = 'Send this user a personal message.';
//End trader.template
//Permissions
$txt['permissiongroup_smftrader'] = 'SMF Trader';
$txt['permissionname_smftrader_feedback'] = 'Allow submit feedback';
$txt['permissionhelp_smftrader_feedback'] = 'Allows the user to submit trader rating feedback.';
$txt['permissionname_smftrader_deletefeed'] = 'Allow delete ANY feedback by ANY user.';
$txt['permissionhelp_smftrader_deletefeed'] = 'Allows the user to delete feedback by anyone or anybody.';
$txt['cannot_smftrader_feedback'] = 'You are not allowed to submit feedback.';
$txt['cannot_smftrader_deletefeed'] = 'You are not allowed to delete feedback.';
$txt['permissionname_smftrader_autorating'] = 'Auto Approve Ratings';
$txt['permissionhelp_smftrader_autorating'] = 'Ratings do not need to wait for approval if this permission is given.';
//END SMF Trader System Text Strings
file $languagedir/Help.thai-utf8.php
เพิ่ม -->>
//Begin SMF Trader System Text Strings
$helptxt['trader_approval'] = "
When checked: All ratings require approval before being posted unless they are in an autoapproved group found in permissions
<br /><br />
When unchecked: All ratings are auto approved since the ratings do not require approval.";
$helptxt['trader_use_pos_neg'] = "When enabled changes the trading count number to be a positive or negative figure based on the number of positive feedback minus the negative feedback. If it is a positive feedback number it results in a + (plus) in front of the number. If it is a negative feedback number results in a - (minus) in front the number.";
//END SMF Trader System Text Strings
ดาวน์โหลด: smftradersystem1.rar
ขออภัย! ส่วนนี้สงวนไว้เฉพาะสมาชิกเท่านั้น กรุณา เข้าสู่ระบบ หรือ ลงทะเบียนแตกไฟล์แล้วอัพโหลดไปไว้ที่
file Trader.php -->> $sourcedir
file Trader.template.template.php -->> $themesdir/default
file Trader.english.php -->> $languagedir
file Trader.Trader.thai-utf8.php -->> $languagedir
สร้างไฟล์: smftraderinstall.php เพื่อสร้างฐานข้อมูล ไว้ใน $boarddir (ที่เดียวกับไฟล์ SSI.php) รัน http://www.your_url.xxx/$boarddir/smftraderinstall.php -->> Enter เสร็จแล้วลบทิ้ง
<?php
/*
SMF Trader System: 1.2
http://www.smfhacks.com
smftraderinstall.php - SMF Trader System
Purpose - Installs the database tables for SMF Trader System
*/
if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF'))
require_once(dirname(__FILE__) . '/SSI.php');
// Hmm... no SSI.php and no SMF?
elseif (!defined('SMF'))
die('<b>Error:</b> Cannot install - please verify you put this in the same place as SMF\'s index.php.');
db_query("CREATE TABLE IF NOT EXISTS {$db_prefix}feedback
(feedbackid int(11) NOT NULL auto_increment,
ID_MEMBER mediumint(8) unsigned NOT NULL default '0',
comment_short tinytext NOT NULL,
comment_long text, topicurl tinytext,
saletype tinyint(4) NOT NULL default '0',
salevalue tinyint(4) NOT NULL default '0',
saledate int(11) NOT NULL default '0',
FeedBackMEMBER_ID mediumint(8) unsigned NOT NULL default '0',
approved tinyint(4) NOT NULL default '1',
ID_LISTING int(11) NOT NULL default '0',
KEY ID_LISTING (ID_LISTING),
KEY ID_MEMBER (ID_MEMBER),
PRIMARY KEY (feedbackid))", __FILE__, __LINE__);
$dbresult = db_query("SHOW COLUMNS FROM {$db_prefix}feedback", __FILE__, __LINE__);
$approved = 1;
$ID_LISTING = 1;
while ($row = mysql_fetch_row($dbresult))
{
if($row[0] == 'approved')
$approved =0;
if($row[0] == 'ID_LISTING')
$ID_LISTING =0;
}
mysql_free_result($dbresult);
if ($approved)
db_query("ALTER TABLE {$db_prefix}feedback ADD approved tinyint(4) NOT NULL default '1'", __FILE__, __LINE__);
if ($ID_LISTING)
db_query("ALTER TABLE {$db_prefix}feedback ADD ID_LISTING int(11) NOT NULL default '0'", __FILE__, __LINE__);
// Other Settings
db_query("INSERT IGNORE INTO {$db_prefix}settings
(variable, value)
VALUES
('trader_approval', '0'),
('trader_feedbackperpage', '10'),
('trader_use_pos_neg', '0'),
('trader_membergroupspm', '1')
", __FILE__, __LINE__);
?>
ลิงค์หัวข้อ:
http://dexmore.com/topic/7479