Avatar

Devs is this normal behaviour? (General)

by Micha ⌂, Wednesday, December 09, 2020, 21:34 (1227 days ago) @ Chris T

Hi,

no that is not the intended behaviour. Can you check the following changes? Make a backup of the user.inc.php!

Open the user.inc.php and go to the 'show_posts'-case, i.e. line 285f. In line 285f there are two SQL statements (depending on the categories of the forum). Commend both lines and add/repalce the code by the following modified statement:

   if ($user_postings_count > 0) {
    //if ($categories == false) $result = @mysqli_query($connid, "SELECT id, pid, tid, user_id, UNIX_TIMESTAMP(time) AS time, UNIX_TIMESTAMP(time + INTERVAL ".$time_difference." MINUTE) AS disp_time, UNIX_TIMESTAMP(last_reply) AS last_reply, subject, category, marked, sticky FROM ".$db_settings['forum_table']." WHERE user_id = ". intval($id) ." ORDER BY time DESC LIMIT ". intval($ul) .", ". intval($settings['search_results_per_page']));
    //else $result = @mysqli_query($connid, "SELECT id, pid, tid, user_id, UNIX_TIMESTAMP(time) AS time, UNIX_TIMESTAMP(time + INTERVAL ".$time_difference." MINUTE) AS disp_time, UNIX_TIMESTAMP(last_reply) AS last_reply, subject, category, marked, sticky FROM ".$db_settings['forum_table']." WHERE user_id = ". intval($id) ." AND category IN (". $category_ids_query .") ORDER BY time DESC LIMIT ". intval($ul) .", ". intval($settings['search_results_per_page']));
 
    $categories_restriction = $categories == false ? "" : " AND category IN (". $category_ids_query .") ";
    $spam_restriction = !$isModOrAdmin ? " AND `id` NOT IN (SELECT `eid` FROM `" . $db_settings['b8_rating_table'] . "` WHERE `spam` = 1 AND `eid` = `id`) AND `id` NOT IN (SELECT `eid` FROM `" . $db_settings['akismet_rating_table'] . "` WHERE `spam` = 1 AND `eid` = `id`) " : "";
 
    $result = @mysqli_query($connid, "SELECT id, pid, tid, user_id, UNIX_TIMESTAMP(time) AS time, UNIX_TIMESTAMP(time + INTERVAL ".$time_difference." MINUTE) AS disp_time, 
              UNIX_TIMESTAMP(last_reply) AS last_reply, subject, category, marked, sticky 
              FROM `" . $db_settings['forum_table'] . "` 
              WHERE user_id = ". intval($id) . " " . $categories_restriction . " " . $spam_restriction . " 
              ORDER BY time DESC LIMIT ". intval($ul) .", ". intval($settings['search_results_per_page']));
 
    $i = 0;

Does it work as expected for you?

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences


Complete thread:

 RSS Feed of thread