Jump to content

[SOLVED] PLEASE HELP!


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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.