• Welcome to Simple Machines Community Forum. Please login or sign up.
January 19, 2022, 04:42:19 AM

News:

Join the Facebook Fan Page.


SMF Trader System

Started by SMFHacks.com Team, July 12, 2006, 12:35:09 AM

Previous topic - Next topic

MadTogger

Quote from: hcfwesker on March 12, 2012, 12:35:30 PM
Once I figure out my problem on this mod, I'll try and take a look at it.  But, for those, I was just use the fatal_error, so they have the Back key to click and all information should still be there

Hi hcfwesker,

cheers for all your help, hopefully I can return the favour.

Where you are trying to add the persons name that feedback was sent to, isn't their ID stored in:

$traderid

maybe you can utilise this variable in the same way as:

<td align="left">' . parse_bbc($context['trading_detail']['comment_long']) . '<br />',$txt['smftrader_COMMENTTO'],'<a href="',$scripturl, '?action=profile;u=', $context['trading_detail'] . $traderid . '">',$context['trading_detail']['real_name'],  '</a><br /></td>

The code above may need a little playing with and you would need to add:

$txt['smftrader_COMMENTTO']

to the language file.

Hopefully you can see what I am getting at.  ;)

Regards..,


hcfwesker

March 12, 2012, 05:23:05 PM #621 Last Edit: March 12, 2012, 05:26:22 PM by hcfwesker
I've tried that as well as every other angle where both names appear, like in the admin approval page.

Problem is, the database value it pulls in the function_Detail part, it only pulls the m.real_name once , and assigns the FeedBackMEMBER_ID to it ( the one who sent it)

Where in the admin function, it pulls it twice, once as m.real_name , and u.real_name mainName

Thing is, I can't replicate that call in the Detail function Tader2.php


MadTogger

Quote from: hcfwesker on March 12, 2012, 05:23:05 PM
I've tried that as well as every other angle where both names appear, like in the admin approval page.

Problem is, the database value it pulls in the function_Detail part, it only pulls the m.real_name once , and assigns the FeedBackMEMBER_ID to it ( the one who sent it)

Where in the admin function, it pulls it twice, once as m.real_name , and u.real_name mainName

Thing is, I can't replicate that call in the Detail function Tader2.php

Cheers, i'll have a play around with that. ;)

MadTogger

Well, I got it working somewhat, not exactly pretty but it does do the trick.

In Trader2.template.php I changed my previous code:

echo isset($_REQUEST['noshrtcomm']) ? '<div id="profile_error" style="border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px;"><strong>Information Missing:</strong> ' . $txt['smftrader_errshortcoment'] . '</div>' : '';

echo isset($_REQUEST['notpcurl']) ? '<div id="profile_error" style="border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px;"><strong>Information Missing:</strong> ' . $txt['smftrader_errnourl'] . '</div>' : '';


to:

echo isset($_REQUEST['noshrtcomm']) ? '<div id="profile_error" style="border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px;"><center><strong><u>Information Missing:</u> ' . $txt['smftrader_errshortcoment'] . '</strong></center></br>Please correct this error by returning to the previous screen <a href="javascript:history.back();">HERE</a>.</div>' :'';

echo isset($_REQUEST['notpcurl']) ? '<div id="profile_error" style="border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px;"><center><strong><u>Information Missing:</u> ' . $txt['smftrader_errnourl'] . '</strong></center></br>Please correct this error by returning to the previous screen <a href="javascript:history.back();">HERE</a>.</div>' : '';


Changing the code to the above adds the 'history.back()' link where the user is easily able to navigate to the previous state of the feedback submission form, thus retaining any already entered data.

Like I said, not pretty but working.

hcfwesker

Very nice.  And,  my issue with the name not appearing the details page was fixed by help from a good friend.

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.

How did you get it to work in the end then?

hcfwesker

In Sources/Trader2.php

under the ViewDetail functio of the code ...

Find
$dbresult = $smcFunc['db_query']('', $result);
$row = $smcFunc['db_fetch_assoc']($dbresult);
$smcFunc['db_free_result']($dbresult);

$context['trading_detail'] = $row;


Replace with
$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'];


To make the names appear, For the member that sent the feedback, in trader2.template.php use

',$context['tradername'], '

for the owner, that received the feedback, use ...

',$context['trading_detail']['member_one']['name'], '



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.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

hcfwesker

April 11, 2012, 08:46:10 PM #629 Last Edit: April 12, 2012, 02:28:02 AM by 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

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' => '',
),


),
);


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');
}


function ApproveRating()
{

isAllowedTo('admin_forum');

$id = (int) $_REQUEST['id'];


ApproveByID($id);

redirectexit('action=admin;area=trader;sa=admin');
}


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');
}


And, to take it a step further i tried adding it in the Admin.php settings as well

// 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'),


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.


SMFHacks.com Team

hcfwesker having one my developers to look over this topic and see what features/ideas to incorporate in the next versions.
Disclaimer: SMFHacks.com Team is not affiliated with the SMF Team or the SimpleMachines NPO.

http://ForumRankings.net - Get Forum Ranked!
SMFHacks.com -  Paid Modifications for SMF
Latest Mods:
Community Suite
Newsletter Pro SMF Gallery Pro SMF Classifieds SMF Store

Stun

Hello,
I have maybe a newbie question, but I can't find an answer for this.
I have moved out my SMF forum to another hosting company and after that I can't see trader points from a user. When I try to access the trader link on his profile (under his name) (eg. hxxp:myforum.com/index.php?action=trader&id=2250 [nonactive]), it loads the index page on the forum.
I use SMF 2.0.2 and Trader System 1.6. Is there some permissions that I have to work on?

Thank you in advance!

vbgamer45

Is it still installed? Can you access it via the admin panel?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Stun

Hello vbgamer45,
Yes, it's installed and I can access it from admin panel.

vbgamer45

Attach your main index.php and will see if trader is listed as an action.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Stun

Trader array ( 'trader' => array('Trader2.php', 'tradermain'), ) was missing. Now I saw that.
It seems now it works!
Thank you for giving me this idea!

Cheers mate!

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Maxtor

The submition form does not contain any hashing parametres, and therefore I asume it does not check where the form was submited from or its validity. This would enable the form to be sumbited from other websites, which could be used to create fake reviews about trades from other forum users without them knowing.

how to fix this?

Paracelsus

I've tried installing this MOD (SMF 1.1.16) and got no fails on test install but afterwards all my profile pages returned a 404 error. Has anyone had this problem before? Can it be because of Ultimate Profile I have installed?

vbgamer45

Could be you would have to see the forum error logs or apache error logs.

Could just be a file permission issue. Or a mod_security issue.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Advertisement: