Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 277
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 279
Total: 280

Author Topic: SMF Trader System for RC1  (Read 4848 times)

0 Members and 1 Guest are viewing this topic.

Offline C4G-tk

  • Member
  • *
  • Posts: 2
    • View Profile
SMF Trader System for RC1
« on: March 25, 2009, 03:05:39 pm »
as posted on SMF site...

I am using V2 RC1 and I installed this manually with two failed tests.  Profile.template.php & Display.template.php.  I made one little change for the Display.template in order to have it show the rating lower inside the post, but otherwise I thought I did it correctly.  In the profile, I need to tweak it a little because it spans the entire width of the screen to show the feedback, but otherwise it looks to be working correctly.

My problem arises when I went into my Error Log.  (Like I said, I did have the two errors listed above, but I thought I did them correctly despite making the change noted.)

I've attached the three errors that it is pulling in the Error Log and the two edits I did that showed as Failed Tests prior to doing them manually.

Display.template edit here:

Code: [Select]
// Is karma display enabled?
if ($modSettings['karmaMode'] != '0'){
echo '
<li class="margintop">', $txt['karma_power'], ': ', $message['member']['karma']['power'], '</li>
<li class="margintop repbars">
';
foreach($message['member']['karma']['bars'] as $karma_bar)
echo '<img src="', $settings['images_url'], '/karma_', $karma_bar['type'], '.gif" title="', $message['member']['name'], ' ', $karma_bar['desc'], '" alt="', $message['member']['name'], ' ', $karma_bar['desc'], '" />';
echo '
</li>';
}

// Show online and offline buttons?
if (!empty($modSettings['onlineEnable']))
echo '
<li>', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $message['member']['online']['image_href'] . '" alt="' . $message['member']['online']['text'] . '" border="0" style="margin-top: 2px;" />' : $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $message['member']['online']['text'] . '</span>' : '', '</li>';

//Start SMF Trader System
//First do the query for the number of ratings
global $smcFunc;
$result = $smcFunc['db_query']('', "
SELECT
COUNT(*) AS total,salevalue
FROM {db_prefix}feedback
WHERE approved = 1 AND ID_MEMBER = " . $message['member']['id'] . " GROUP BY salevalue");
$context['neturalcount'] = 0;
$context['pcount'] = 0;
$context['ncount'] = 0;
while($row = $smcFunc['db_fetch_assoc']($result))
{
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'];
}

}
$smcFunc['db_free_result']($result);



if ($modSettings['trader_use_pos_neg'])
$tradecount = ($context['pcount'] - $context['ncount']);
else
$tradecount = $context['pcount'] + $context['ncount'] + $context['neturalcount'];



// Show the trader info
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>';

//END SMF Trader System



// Show the member's gender icon?

Profile.template edit here:

Code: [Select]
if (!empty($modSettings['userLanguage']) && !empty($context['member']['language']))
echo '
<dt>', $txt['language'], ':</dt>
<dd>', $context['member']['language'], '</dd>';

// Start SMF Trader System
// First do the query for the number of ratings
global $smcFunc;

$smcFunc['db_query']('', "SELECT feedbackid FROM {db_prefix}feedback WHERE approved = 1 AND ID_MEMBER =" . $context['member']['id']);
$tradecount = $smcFunc['db_affected_rows']();



$result = $smcFunc['db_query']('', "
SELECT
COUNT(*) AS total,salevalue
FROM {db_prefix}feedback
WHERE approved = 1 AND ID_MEMBER = " . $context['member']['id'] . " GROUP BY salevalue");
$context['neturalcount'] = 0;
$context['pcount'] = 0;
$context['ncount'] = 0;
while($row = $smcFunc['db_fetch_assoc']($result))
{
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'];
}

}
$smcFunc['db_free_result']($result);

$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'] . '&nbsp;<img src="' .  'Smileys/default/smiley.gif" alt="positive" /></td></tr>
<tr><td>' . $txt['smftrader_neutralfeedback']  . '</td><td>' .  $context['neturalcount'] . '&nbsp;<img src="' . 'Smileys/default/undecided.gif" alt="neutral" /></td></tr>
<tr><td>' . $txt['smftrader_negativefeedback']  . '</td><td>' .  $context['ncount'] . '&nbsp;<img src="' .  'Smileys/default/angry.gif" alt="negative" /></td></tr>
<tr><td>' . $txt['smftrader_totalfeedback']  . '</td><td>' .  ($context['pcount'] - $context['ncount']) . '</td></tr>
<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


echo '
</dl>';

Update:
Whenever I go into the Admin Panel for Trader System, I receive the LINE 278 error.  Did I not do the edits correctly above?  and/or is this just a different error?

Attached the Error Log
« Last Edit: March 29, 2009, 12:18:02 pm by C4G-tk »

Offline C4G-tk

  • Member
  • *
  • Posts: 2
    • View Profile
Re: SMF Trader System for RC1
« Reply #1 on: March 29, 2009, 12:24:55 pm »
Went back and looked at my edits.  Don't see where they are causing the errors in the log.  Errors are still generated when I go into the admin panel for the Trader System.

???

(I guess I don't have permissions to see attached images on this site cause I've attached the error log inside my other post, but don't see it showing.)

 

Related Topics

  Subject / Started by Replies Last post
2 Replies
5620 Views
Last post December 12, 2008, 06:57:09 am
by SMFHacks
2 Replies
4892 Views
Last post September 02, 2009, 11:36:18 am
by GamingTrend
1 Replies
5140 Views
Last post December 08, 2009, 10:06:53 pm
by SMFHacks
3 Replies
5676 Views
Last post October 12, 2010, 02:55:05 pm
by vkot
2 Replies
2539 Views
Last post February 11, 2017, 10:18:41 am
by snowball

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal