Jump to content

Recommended Posts

Here's the code I was supposed to insert into viewforum.php:

 

 

 

// Check if user is allowed to bypass the requirements

$postcount_bypass = FALSE;

$sql = "SELECT b.group_bypass_post_req AS requirement FROM " . USER_GROUP_TABLE . " a, " . GROUPS_TABLE . " b WHERE user_id = " . $user->data['user_id'] . " AND a.group_id = b.group_id";

$result = $db->sql_query($sql);

while ($membership = $db->sql_fetchrow($result))

{

if ($membership['requirement'] == 1)

{

$postcount_bypass = TRUE;

break;

}

}

$db->sql_freeresult($result);

 

// Check if the user has the required post count to view the forum

if (check_post_count_requirement($forum_id,'view') == FALSE && $postcount_bypass == FALSE)

{

$user->setup('common');

$post1 = ($forum_data['forum_postcount_view'] == 1) ? $user->lang['POSTREQ_POST'] : $user->lang['POSTREQ_POSTS'];

$remaining = ($forum_data['forum_postcount_view'] - $user->data['user_posts']);

$post2 = ($remaining == 1) ? $user->lang['POSTREQ_POST'] : $user->lang['POSTREQ_POSTS'];

$accesserror = sprintf($user->lang['POSTREQ_NOACCESS_VIEW'], $forum_data['forum_postcount_view'], $post1);

if ($user->data['user_id'] != ANONYMOUS)

{

$neededposts = "<br /><br />" . sprintf($user->lang['POSTREQ_NOACCESS_MORE'], $remaining, $post2);

}

trigger_error($accesserror . $neededposts);

}

 

 

The red line is supposedly where the error is located.

Link to comment
https://forums.phpfreaks.com/topic/110942-solved-please-help/#findComment-569165
Share on other sites

Ok, I was installing the Post Count Requirement MOD, and when opening a forum, I get this error:

 

Fatal error: Call to undefined function check_post_count_requirement()

 

Any help would be appreciated.

 

it means, your function doesnt exist. or is not included in that page your attempting to execute..

 

quick test:

<?
if(function_exists("check_post_count_requirement")){
print "YES";
}else{
print "NO"
}
?>

Link to comment
https://forums.phpfreaks.com/topic/110942-solved-please-help/#findComment-569212
Share on other sites

Ok, I was installing the Post Count Requirement MOD, and when opening a forum, I get this error:

 

Fatal error: Call to undefined function check_post_count_requirement()

 

Any help would be appreciated.

 

it means, your function doesnt exist. or is not included in that page your attempting to execute..

 

quick test:

<?
if(function_exists("check_post_count_requirement")){
print "YES";
}else{
print "NO"
}
?>

 

 

So I put:

 

<?
if(function_exists("check_post_count_requirement")){
print "YES";
}else{
print "NO"
}
?>

 

In a .php file, go to it and see what it says?

Link to comment
https://forums.phpfreaks.com/topic/110942-solved-please-help/#findComment-569222
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.