Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 344
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 258
Total: 258

Author Topic: Downloads on Thanks Given rather than Post Count  (Read 5741 times)

0 Members and 1 Guest are viewing this topic.

Offline elbeer

  • Downloads Pro Customer
  • Full Member
  • *****
  • Posts: 111
    • View Profile
Downloads on Thanks Given rather than Post Count
« on: May 07, 2014, 10:50:50 am »
Hi,

I am wanting to change the function in Sources/Downloads2.php where it checks the post count to the thanks given count.

This is the current function:
Code: [Select]
if ($user_info['posts'] < $postlimit)

{

// Show error message

if ($showError == true)

fatal_error(sprintf($txt['down_err_category_minposts'],$postlimit) );

else

return false;



}

I have already changed the text in the languages file to say you can not access this download unless you have 30 thanks from other members.

I just need to check the thanks count. I dont think it would be too hard but I am struggling. The thanks count is in the members tables under the column thank_you_post_became

I have tried adding this before the code to get the thanks count but it throws out a function error:

Code: [Select]
$request = $smcFunc['db_query']('', '
  SELECT thank_you_post_became
  FROM {db_prefix}members
  WHERE id_member = {int:member}',
  array(
    'member' => $user_info['id'],
  )
);
if ($smcFunc['db_num_rows']($request) != 0)
{
  list ($result) = $smcFunc['db_fetch_row']($request);
}
else
  $result = false;
$smcFunc['db_free_result']($request);

$thankscount = $result;

Any help would be appreciated

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Downloads on Thanks Given rather than Post Count
« Reply #1 on: May 07, 2014, 10:55:57 am »
What is the exact error?
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline elbeer

  • Downloads Pro Customer
  • Full Member
  • *****
  • Posts: 111
    • View Profile
Re: Downloads on Thanks Given rather than Post Count
« Reply #2 on: May 07, 2014, 10:58:48 am »
Fatal error: Function name must be a string in /home/XXXX/public_html/forum/Sources/Downloads2.php on line 15847


Also in error log:

Apply Filter: Only show the error messages of this URL
http://xxxxxx.com/forum/index.php?action=downloads;sa=view;id=100
Apply Filter: Only show the errors with the same message
8: Undefined variable: smcFunc
Apply Filter: Only show the errors from this file
File: /home/xxxxx/public_html/forum/Sources/Downloads2.php
Line: 15847
« Last Edit: May 07, 2014, 11:07:08 am by elbeer »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Downloads on Thanks Given rather than Post Count
« Reply #3 on: May 07, 2014, 11:08:52 am »
Add this before your code
Code: [Select]
global $smcFunc;
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline elbeer

  • Downloads Pro Customer
  • Full Member
  • *****
  • Posts: 111
    • View Profile
Re: Downloads on Thanks Given rather than Post Count
« Reply #4 on: May 07, 2014, 11:13:30 am »
Worked like a charm thanks.

The reason I have done this is because I put some downloads on minimum 30 posts to access and woke up one morning to find hundreds of crap posts from users.

So if I changed it to thanks from other members then this would ensure that the quality of the posts was good and not crap.

Thank you again for your excellent support.

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
4009 Views
Last post July 28, 2008, 06:44:00 pm
by Mysterium X Symbolum
0 Replies
3528 Views
Last post November 05, 2008, 08:24:50 pm
by Ronlx2
10 Replies
8686 Views
Last post September 06, 2013, 12:26:50 pm
by SMFHacks
2 Replies
4343 Views
Last post July 19, 2012, 03:07:36 pm
by SMFHacks
4 Replies
3229 Views
Last post February 06, 2015, 12:19:43 pm
by SMFHacks

+- Recent Topics

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

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

Powered by EzPortal