Customizing SMF > Modifications and Packages
SMF Trader System (1.6 Released) Now Supports SMF 2.0!
MadTogger:
--- Quote from: hcfwesker on March 13, 2012, 03:24:58 PM ---Very nice. And, my issue with the name not appearing the details page was fixed by help from a good friend.
--- End quote ---
How did you get it to work in the end then?
hcfwesker:
In Sources/Trader2.php
under the ViewDetail functio of the code ...
Find
--- Code: --- $dbresult = $smcFunc['db_query']('', $result);
$row = $smcFunc['db_fetch_assoc']($dbresult);
$smcFunc['db_free_result']($dbresult);
$context['trading_detail'] = $row;
--- End code ---
Replace with
--- Code: --- $dbresult = $smcFunc['db_query']('', $result);
$row = $smcFunc['db_fetch_assoc']($dbresult);
global $memberContext;
if (!isset($memberContext[$row['ID_MEMBER']])) {
loadMemberData(array($row['ID_MEMBER']));
loadMemberContext($row['ID_MEMBER']);
}
$row['member_one'] = $memberContext[$row['ID_MEMBER']];
$smcFunc['db_free_result']($dbresult);
$context['trading_detail'] = $row;
$context['tradername'] = $row['real_name'];
--- End code ---
To make the names appear, For the member that sent the feedback, in trader2.template.php use
--- Code: ---',$context['tradername'], '
--- End code ---
for the owner, that received the feedback, use ...
--- Code: ---',$context['trading_detail']['member_one']['name'], '
--- End code ---
hcfwesker:
Not expecting a reply for this, but gonna take a shot. I've made a menu button for the Trader, and have a sub menu link for Unapproved Feedback. Is there a way for a number count to show on the button for unapproved feedback waiting to be approved?
vbgamer45:
You could do it with a mysql query to fetch from trader ratings table and get a count of the number of items that are not approved.
hcfwesker:
Got another issue. Trying to let other staff members approve feedback. I've made a custom permission, tested and it works when testing it with other permission features on the site. but for some reason it won't use the permission setting on Trader Admin page.
yhe ONLY way a member can get into the trader admin page is with the permission "allow to admin the forum and database"
This is the permission I made, 'trader_mod'
and these are the locations I tried changing every listing of 'admin_forum' to 'trader_mod' from Trader2.php
--- Code: ---function AdminSettings()
{
global $context, $txt, $mbname, $smcFunc, $scripturl;
isAllowedTo('admin_forum');
@$context[$context['admin_menu_name']]['tab_data'] = array(
'title' => $txt['smftrader_admin'],
'description' => '',
'tabs' => array(
'admin' => array(
'description' => '',
),
),
);
--- End code ---
--- Code: ---function AdminSettings2()
{
isAllowedTo('admin_forum');
$trader_approval = isset($_REQUEST['trader_approval']) ? 1 : 0;
$trader_use_pos_neg = isset($_REQUEST['trader_use_pos_neg']) ? 1 : 0;
$trader_feedbackperpage = (int) $_REQUEST['trader_feedbackperpage'];
updateSettings(
array(
'trader_approval' => $trader_approval,
'trader_feedbackperpage' => $trader_feedbackperpage,
'trader_use_pos_neg' => $trader_use_pos_neg,
));
redirectexit('action=admin;area=trader;sa=admin');
}
--- End code ---
--- Code: ---function ApproveRating()
{
isAllowedTo('admin_forum');
$id = (int) $_REQUEST['id'];
ApproveByID($id);
redirectexit('action=admin;area=trader;sa=admin');
}
--- End code ---
--- Code: ---function BulkActions()
{
isAllowedTo('admin_forum');
if (isset($_REQUEST['ratings']))
{
$baction = $_REQUEST['doaction'];
foreach ($_REQUEST['ratings'] as $value)
{
if ($baction == 'approve')
ApproveByID($value);
if ($baction == 'delete')
DeleteByID($value);
}
}
// Redirect to approval list
redirectexit('action=admin;area=trader;sa=admin');
}
--- End code ---
And, to take it a step further i tried adding it in the Admin.php settings as well
--- Code: --- // Define all the menu structure - see Subs-Menu.php for details!
$admin_areas = array(
'forum' => array(
'title' => $txt['admin_main'],
'permission' => array('admin_forum', 'manage_permissions', 'moderate_forum', 'manage_membergroups', 'manage_bans', 'send_mail', 'edit_news', 'manage_boards', 'manage_smileys', 'manage_attachments','manage_shop', 'trader_mod'),
--- End code ---
Doing all of these didnt change anything. How would i make it so other staff can use the trader admin page to approve/delete feedback, without having to have the 'admin_forum' permission.
Thanx.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version