• Welcome to Simple Machines Community Forum. Please login or sign up.
January 19, 2022, 04:35:22 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

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

Kindred

just added the trader info as a block in the ultimate profile mod (without this block, there is not good way to access the trader details)

Code (Add to the end of UltimateProfile.template.php) Select

function up_block_trader() {
  global $context, $settings, $options, $scripturl, $modSettings, $txt, $user_info, $sourcedir;

   // Start SMF Trader System
   include_once $sourcedir . '/Trader2.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 '
    <div id="up_trader">
      <h3 class="catbg">
        <span class="left"></span>
        ', $txt['smftrader_title'] ,'
      </h3>
      <div class="windowbg creator">
        <span class="topslice"><span></span></span>
      <div class="content">
      <dl>
          <dt><strong>' . $txt['smftrader_profile'] . ' :</strong> </dt>
          <dd>(<a href="' . $scripturl .  '?action=trader&id=' . $context['member']['id'] . '">' . ($modSettings['trader_use_pos_neg'] ? ($tradecount > 0 ? '+' . $tradecount : $tradecount)  : $tradecount) . '</a>)</dd>
          <dt><strong>' . $txt['smftrader_positivefeedbackpercent']  . ' :</strong> </dt>
          <dd>' , $context['tradecount_nonetural'] != 0 ? round(($context['pcount'] / $context['tradecount_nonetural']) * 100, 2) : 0 , '%</dd>
          <dt><strong>' . $txt['smftrader_positivefeedback'] . ' :</strong> </dt>
          <dd>' . $context['pcount'] . '&nbsp;<img src="' .  $modSettings['smileys_url'] . '/default/smiley.gif" alt="positive" /></dd>
          <dt><strong>' . $txt['smftrader_neutralfeedback']  . ' :</strong> </dt>
          <dd>' .  $context['neturalcount'] . '&nbsp;<img src="' . $modSettings['smileys_url'] . '/default/undecided.gif" alt="neutral" /></dd>
          <dt><strong>' . $txt['smftrader_negativefeedback']  . ' :</strong> </dt>
          <dd>' .  $context['ncount'] . '&nbsp;<img src="' .  $modSettings['smileys_url'] . '/default/angry.gif" alt="negative" /></dd>
          <dt><strong>' . $txt['smftrader_totalfeedback']  . ' :</strong> </dt>
          <dd>' .  ($context['pcount'] - $context['ncount']) . '</dd>';
            if ($user_info['id'] != $context['member']['id'])
            echo '
              <br /><dt class="clear"><a href="' . $scripturl .  '?action=trader&sa=submit&id=' . $context['member']['id'] . '">' . $txt['smftrader_submitfeedback'] . $context['member']['name'] . '</a></dt>';
  echo '
    </dl>
        </div>
        <span class="botslice"><span></span></span>
      </div>
    </div>';
   
    return true;
  //  } else
  //  return false;
   
   // END SMF Trader System

}


and then, add the line
     'trader',
to any of the ultimate profile column definition lists (at the top of the file)
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Game.ruler

Please help me.
I have "Broken Links List" mod installed. Now when i am installing this mod and opening then getting this error:
"Fatal error: Cannot redeclare delete() (previously declared in /home/******/public_html/Sources/Trader2.php:481) in /home/*******/public_html/Sources/BrokenLinksList.php on line 353".

Kindred

looks like both mods are using the same function name. You probably won't be able to run both mods together unless one of the authors is willing to re-write it.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Game.ruler

hi kindred, if there is any way i can rename function name to something else, i just need some guidence to do this.

hcfwesker

Quote from: Game.ruler on February 24, 2013, 04:25:01 AM
hi kindred, if there is any way i can rename function name to something else, i just need some guidence to do this.

maybe try this ...


Sources/Trader2.php

Find
$context['sub_template']  = 'delete';
Replace with
$context['sub_template']  = 'deletetr';

default/Trader2.template.php

Find
function template_delete()
Replace with
function template_deletetr()

Game.ruler

Hi hcfwesker, thanks for reply. But these changes dint work. Then i changed only "function Delete()" to "function Deleter()" , then it worked fine. Is this change is good, or will it cause some problems?
Because i dont know their effects after renaming some function.
Thanks.

Arantor

You can't just rename the function you have to rename the places where it calls that function so it's calling the *right* one.
No good deed goes unpunished
All helpful urges should be circumvented

Game.ruler

oh, i thought its fine. Coz after renaming i was able to open SMFTrader tab in admin panel.
I will check all codes and rename the function wherever its called.

Arantor

You can't just blindly rename *all* of them, you have to rename all of them in only one mod ;)
No good deed goes unpunished
All helpful urges should be circumvented

hcfwesker

Quote from: Game.ruler on February 25, 2013, 04:40:38 AM
Hi hcfwesker, thanks for reply. But these changes dint work. Then i changed only "function Delete()" to "function Deleter()" , then it worked fine. Is this change is good, or will it cause some problems?
Because i dont know their effects after renaming some function.
Thanks.

I went with those cause your error you posted showed delete() , so i went with the lower cased one.  For the capitol Delete() , there's only two locations in the Trader MOD where they're listed.

Sources/Trader2.php

find
'delete' => 'Delete',
Replace with
'delete' => 'Deleter',

Find
function Delete()
Replace with
function Deleter()


Skaty

Quote from: Game.ruler on February 23, 2013, 03:42:59 PM
Please help me.
I have "Broken Links List" mod installed. Now when i am installing this mod and opening then getting this error:
"Fatal error: Cannot redeclare delete() (previously declared in /home/******/public_html/Sources/Trader2.php:481) in /home/*******/public_html/Sources/BrokenLinksList.php on line 353".

i'm using them both, and i didn't do customization for it. if help i was installed broken link list first.

Skaty

Hi, i want to do something usefull, can you help me guys ? i want to shown member's trader reliability in his trader post. in post background or aroung the post with a little graphic. it have to shown only in trader board. can we do such a thing ? is it to inconvenient ?


Neo_TE

How to prevent guests from viewing the actual feedback list?

As of now, the trading feedback of each user is listed in all posts.

I made the following edit in "display.template.php" to hide the trader feedback from posts.


// Show the trader info
if(!$context['user']['is_guest'])                <= I added this line to check if the user is guest
echo '<li>
<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>)</li>';



But still, anyone who knows the link to the actual feedback, i.e.

hxxp://www.----.com/community/index.php?action=trader&id=[USER_ID]

So the guest can access the feedback of any user if they know the user id (which will be displayed in each post).

I don't want guests to view the feedback list of any user. Only users who have logged-in should be able to view the feedback list.


Could someone please help. Thanks.

vbgamer45

You would need to edit the Sources/Trader.php

And add the command
is_not_guest();

To functions in that file.
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

Neo_TE


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

1) what if only one admin have to approve 1k of approvals? will need a lot of time to check each one if its legit of fake.
2) also there is no antispam protection (1 feedback each 2 hours example, like karma mod) , currently a membergroup can easily abuse feedback and leave thousands of feedbacks to their friends . (if set to autoaproval) .

ps. you have great mods, but when its on big forums, some more problems occur.

my idea is to add thes permissions:

1) auto accept feedbacks (if set to enabled , this membergroup will auto accept feedbacks without need of aproval)
2) can approve feedbacks (access to approval page) simple moderators will help admins in approvals.


vbgamer45

Good ideas but I would have to write code for them.
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

Quote from: vbgamer45 on July 26, 2013, 04:07:38 PM
Good ideas but I would have to write code for them.
make a Trader System pro version and i will buy it :D

Advertisement: