Need Help!

Discussion in 'PHP' started by Oreo Killa 225, Jun 19, 2008.

  1. #1
    Ok, I was installing the post count requirement MOD onto my forum. Well, when opening a forum, I get this error:

    Fatal error: Call to undefined function check_post_count_requirement()
    Code (markup):

    Any help would be appreciated.
     
    Oreo Killa 225, Jun 19, 2008 IP
  2. Danltn

    Danltn Well-Known Member

    Messages:
    679
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #2
    It can't find the function.

    Have you included it if it's already written in a file, otherwise, write it.

    Dan
     
    Danltn, Jun 19, 2008 IP
  3. rohan_shenoy

    rohan_shenoy Active Member

    Messages:
    441
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Which forum software?
    Which addon?
    Did you install it correctly into the desired directory?
    Have you activated the addon?

    Possibly, you have uploaded it to the wrong directory.
     
    rohan_shenoy, Jun 19, 2008 IP
  4. Oreo Killa 225

    Oreo Killa 225 Peon

    Messages:
    119
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    How do I know if it's already written?

    Here's what I was supposed to put in 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 = "

    " . sprintf($user->lang['POSTREQ_NOACCESS_MORE'], $remaining, $post2);
    }
    trigger_error($accesserror . $neededposts);
    }


    The red line is where the error supposedly is.
     
    Oreo Killa 225, Jun 19, 2008 IP
  5. Oreo Killa 225

    Oreo Killa 225 Peon

    Messages:
    119
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Anyone?

    My forum has been disabled for about 4 hours now because of this error. I really need help.
     
    Oreo Killa 225, Jun 19, 2008 IP
  6. Oreo Killa 225

    Oreo Killa 225 Peon

    Messages:
    119
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    nvm, I fixed it.

    I felt like a dumbass when I figured out I forgot to edit /includes/functions.php. -_-

    Then again, it was kind of obvious....
     
    Oreo Killa 225, Jun 19, 2008 IP
  7. Dannyboyonline

    Dannyboyonline Active Member

    Messages:
    602
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #7
    glad you figured it out...
     
    Dannyboyonline, Jun 19, 2008 IP