Section: Extra info / Online advanced info menu by TheMadMonk / Forums


  • There are those parts:

    updated
    birthday
    lastvisitors  FIXED
    topvisits
    toppost
    toppoststarter
    toppostreplier
    topratedmember
    counter
     

  • lastvisitors

    - old sql didn't work, fixed, updated to new user profile url 

    marked as FIXED

    Moved to new plugin

    Relative time ago:

    $seen_ago = e107::getDateConvert()->convert_date($user['user_currentvisit'], 'relative');

    correct link to user profile:

    $user_id = $user['user_id'];
    $user_name = $user['user_name'];
    $uparams = array(
    'id' => $user_id,
    'name' => $user_name
    );
    $userurl = e107::getUrl()->create('user/profile/view', $uparams);

    Updated a bit functions.php too.

     

  • toppoststarter

    Original query:

    $query="SELECT FLOOR(thread_user) as t_user, COUNT(FLOOR(ft.thread_user)) AS ucount, u.user_name, u.user_id FROM #forum_t as ft
    LEFT JOIN #user AS u ON FLOOR(ft.thread_user) = u.user_id
    WHERE ft.thread_parent=0
    GROUP BY t_user
    ORDER BY ucount DESC
    LIMIT 0,".$extrarecords."";

    replaced by

    $query = "
    SELECT FLOOR(thread_user) as t_user, COUNT(FLOOR(ft.thread_user)) AS ucount, u.user_name, u.user_id FROM #forum_thread as ft
    LEFT JOIN #user AS u ON FLOOR(ft.thread_user) = u.user_id
    LEFT JOIN #forum AS f ON f.forum_id = ft.thread_forum_id
    WHERE ft.thread_active > 0
    AND f.forum_class IN (".USERCLASS_LIST.")
    GROUP BY t_user
    ORDER BY ucount DESC
    LIMIT 0,".$extrarecords."";

    forum_stats.php use way to complicate to understand (all statistics are counted at once, not separated queries)

    At the end removed visibility check:

        $query = "
    SELECT FLOOR(thread_user) as t_user, COUNT(FLOOR(ft.thread_user)) AS ucount, u.user_name, u.user_id FROM #forum_thread as ft
            LEFT JOIN #user AS u ON FLOOR(ft.thread_user) = u.user_id
            WHERE ft.thread_active > 0
    GROUP BY t_user
            ORDER BY ucount DESC
    LIMIT 0," . $extrarecords . "";
    to have the same results as core - including active:
    SELECT FLOOR(thread_user) as t_user, COUNT(FLOOR(ft.thread_user)) AS ucount, u.user_name, u.user_id FROM #forum_thread as ft
    LEFT JOIN #user AS u ON FLOOR(ft.thread_user) = u.user_id
    GROUP BY t_user
    ORDER BY ucount DESC
    LIMIT 0," . $extrarecords . "";
     

  • toppostreplier

    Original:

    $query = "
    SELECT FLOOR(thread_user) as t_user, COUNT(FLOOR(ft.thread_user)) AS ucount, u.user_name, u.user_id FROM #forum_thread as ft
    LEFT JOIN #user AS u ON FLOOR(ft.thread_user) = u.user_id
    WHERE ft.thread_parent!=0
    GROUP BY t_user
    ORDER BY ucount DESC
    LIMIT 0,".$extrarecords."";

    Replaced (not sure if this is correct, too easy)

    $query = "
    SELECT FLOOR(post_user) as t_user, COUNT(FLOOR(ft.post_user)) AS ucount, u.user_name, u.user_id FROM #forum_post as ft
    LEFT JOIN #user AS u ON FLOOR(ft.post_user) = u.user_id
    GROUP BY t_user
    ORDER BY ucount DESC
    LIMIT 0," . $extrarecords . "";

     

  • toppost

    if (!$sql->db_Select("user", "*", "ORDER BY user_forums DESC LIMIT 0, ".$extrarecords."", "no_where"))

    - this returns values because after update this field is still in user table. 

    Correct fix is:

    $query = "SELECT *, ue.user_plugin_forum_posts AS post_count FROM #user AS u
    LEFT JOIN #user_extended AS ue ON ue.user_extended_id = u.user_id
    ORDER BY post_count DESC LIMIT 0, ".$extrarecords ."";

    $user_forums = $row['post_count'];

    but this way Top forum posters is the same as Top forum repliers. 

    I created issue 

     

  • FOR NOW:

    - I removed Top posters section. 

    Reason:

    Top Posters and Top repliers are the same, because in user extended field is post counts. 

    Core Top repliers are not correct either (you can see it on this site too in forum statistics)

    Until I get answers to my question about this.

     

  • Help from rica-carv, but it needs to replace 3 files with one.. it means completly rewrite forum stats in menu

    It's a ugly query, but it gives all the thread_count (tcount), post_count (ucount) and reply_count (rcount)....
    SELECT FLOOR(post_user) as t_user,
    COUNT(FLOOR(fp.post_user)) AS ucount, u.user_name, u.user_id
    , (SELECT COUNT(FLOOR(thread_user)) AS ucount
    FROM e107_forum_thread WHERE thread_user = t_user
    ) as tcount,
    COUNT(FLOOR(fp.post_user))-(SELECT COUNT(FLOOR(thread_user)) AS ucount
    FROM e107_forum_thread WHERE thread_user = t_user
    ) as rcount
    FROM e107_forum_post as fp
    LEFT JOIN e107_user AS u ON FLOOR(fp.post_user) = u.user_id
    GROUP BY fp.post_user
    ORDER BY ucount DESC
    LIMIT 0,10

     

Moderator(s):
Search just forum
Chatbox
You must be logged in to post comments on this site - please either log in from the Login box or from here.If you are not registered click here to signup.


  • Jimako
    Jimako  3 weeks ago

    I just notice on contact form GDPR agreement. Funny thing is that site doesn't store any submitted information.

  • Jimako
    Jimako  1 month ago

    I tried to update forum templates (remove custom things) but hit next issue. So unfinished again,

  • Jimako
    Jimako  1 month ago

    Updated Recaptcha plugin 1.2.1 posted on e107.org

  • Jimako
    Jimako  2 months ago

    Switched to bbcodes in forum. Now you can have it separate from rest of site. (I think that it's there longer time, just nobody told me this)

  • Jimako
    Jimako  3 months ago

    removed facebook comments support (both ways were available, removed workaround to do this)