Yes that's true, it will list them all the time which will make it a bit slower when loading up the profile page. It's a bit weird that the code &thankslist=1 doesn't bring up the Thanked Listing. Hmm, try changing the last isset to $HTTP_POST_VARS['thankedlist']. I think I forgot to change that...cavallino wrote:Thanks alexi,
the second solution (removing completely the line, along with the end braket) works, but I believe that in this way, the "Thanked Listing" are always showing up when you open a user's profile, and you can't hide them, am I correct? So if for example a user get 100 thanks in different posts, the profile page is gonna be very very long... hmmm maybe I will try to study if i can put somehow a toggle to hide/show the thanked listing field...
Sure is. It's pretty much the same kind of thing.cavallino wrote:Anyway, would be possible to do the same way to show a "Given Thanks listing"?
Code: Select all
$thanks_given = $user_row['user_thanks_given'];
Code: Select all
$temp_url = "profile.$phpEx?mode=viewprofile&u=" . $profiledata['user_id'] . "&thankedlist=1";
$thanks_given = '<a href="' . $temp_url . '">' . $user_row['user_thanks_given'] . '</a>';
Code: Select all
else {
$thanks_given = "";
$thanks_received = "";
}
//
// End Thank Post by User Mod
//
Code: Select all
// Thanked Listing
if ( isset($HTTP_GET_VARS['thankedlist']) || isset($HTTP_GET_VARS['thankedlist']) ) {
// Thanked Listing SQL
$sql = "SELECT thanks_from_user_id, topic_id, post_id, poster_id
FROM " . POSTS_TABLE . "
WHERE thanks_count <> 0";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain posts information", '', __LINE__, __FILE__, $sql);
}
$thanks_listing = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$thanks_listing_count = count($thanks_listing);
$thanked_post = 0;
for ($i = 0; $i < $thanks_listing_count; $i++) {
$thanks_users = explode("|",$thanks_listing[$i]['thanks_from_user_id']);
$thanks_count = count($thanks_users);
// Loop through all users who thanked the post
for ($x = 0; $x < $thanks_count; $x++) {
if ($profiledata['user_id'] == $thanks_users[$x]) {
$thanked_post = 1;
// Users SQL
$sql = "SELECT user_id, username
FROM " . USERS_TABLE . "
WHERE user_id = " . $thanks_listing[$i]['poster_id'];
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}
$user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Add user to thanked by list
$temp_url = "profile.$phpEx?mode=viewprofile&u=" . $user_row['user_id'];
$thanks_compiled = '<a href="' . $temp_url . '">' . $user_row['username'] . '</a>';
}
}
if ($thanked_post == 1) {
// Topic SQL
$sql = "SELECT topic_title
FROM " . TOPICS_TABLE . "
WHERE topic_id = '" . $thanks_listing[$i]['topic_id'] . "'";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}
$topic_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$temp_url_post = "viewtopic.$phpEx?p=" . $thanks_listing[$i]['post_id'] . "#" . $thanks_listing[$i]['post_id'];
$temp_url_topic = "viewtopic.$phpEx?t=" . $thanks_listing[$i]['topic_id'];
$thanked_post = '<a href="' . $temp_url_post . '"> (Post #' . $thanks_listing[$i]['post_id'] . ')</a>';
$thanked_topic = '<a href="' . $temp_url_topic . '">' . $topic_row['topic_title'] . '</a>';
$thanked_listing .= "Thanked $thanks_compiled in $thanked_topic - $thanked_post<br/>";
$thanks_compiled = '';
$thanked_post = 0;
}
}
$template->assign_block_vars('thankedlist', array(
'THANKED_LISTING' => $thanked_listing,
'L_THANKED_LISTING' => 'Thanks Listing')
);
}
I'll post back in a few minutes with v0.2.6 which will deincrement thanks given and received by 1 in the function delete_post.cavallino wrote:Also I noticed that if for somewhat reason an admin/moderator deletes a post or topic in which a user gave or received a post thank, then the counters in the profile or viewtopic are not going back...
Code: Select all
includes/functions_post.php
Code: Select all
function delete_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id)
{
global $board_config, $lang, $db, $phpbb_root_path, $phpEx;
global $userdata, $user_ip;
Code: Select all
//
// Start Thank Post by User Mod
//
// Thanked Listing SQL
$sql = "SELECT thanks_from_user_id, thanks_count, poster_id
FROM " . POSTS_TABLE . "
WHERE post_id = '$post_id'";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain posts information", '', __LINE__, __FILE__, $sql);
}
$post_thanks = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// If this post was thanked, then continue
if ($post_thanks['thanks_from_user_id']) {
$thanked_users = explode("|", $post_thanks['thanks_from_user_id']);
// Loop through all users who thanked the post
for ($i = 0; $i < count($thanked_users); $i++) {
$from_user = $thanked_users[$i];
$to_user = $post_thanks['poster_id'];
// Remove 1 from the user who thanked the post
$sql = "SELECT user_thanks_given
FROM " . USERS_TABLE . "
WHERE user_id = " . $from_user;
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}
$from_user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$thanks_given = $from_user_row['user_thanks_given'] - 1;
// Update DB with the new thanks given
$update_sql = "UPDATE " . USERS_TABLE . "
SET user_thanks_given = '" . $thanks_given . "'
WHERE user_id = " . $from_user;
if ( !($result = $db->sql_query($update_sql)) ) {
message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $update_sql);
}
// Remove 1 from the user who was thanked
$sql = "SELECT user_thanks_received
FROM " . USERS_TABLE . "
WHERE user_id = " . $to_user;
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}
$to_user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$thanks_received = $to_user_row['user_thanks_received'] - 1;
// Update DB with the new thanks given
$update_sql = "UPDATE " . USERS_TABLE . "
SET user_thanks_received = '" . $thanks_received . "'
WHERE user_id = " . $to_user;
if ( !($result = $db->sql_query($update_sql)) ) {
message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $update_sql);
}
}
}
//
// End Thank Post by User Mod
//
Code: Select all
$temp_url = "profile.$phpEx?mode=viewprofile&u=" . $profiledata['user_id'] . "&thankslist=1";
$temp_url = "profile.$phpEx?mode=viewprofile&u=" . $profiledata['user_id'] . "&thankedlist=1";
$thanks_given = '<a href="' . $temp_url . '">' . $user_row['user_thanks_given'] . '</a>';
$thanks_received = '<a href="' . $temp_url . '">' . $user_row['user_thanks_received'] . ' ' . $lang['Thanks_thanked_2'] . ' ' . $thanked_post_count['thanks_count'] . ' ' . $lang['Thanks_thanked_3'] . '</a>';
Code: Select all
$temp_url = "profile.$phpEx?mode=viewprofile&u=" . $profiledata['user_id'] . "&thankedlist=1";
$thanks_given = '<a href="' . $temp_url . '">' . $user_row['user_thanks_given'] . '</a>';
$temp_url = "profile.$phpEx?mode=viewprofile&u=" . $profiledata['user_id'] . "&thankslist=1";
$thanks_received = '<a href="' . $temp_url . '">' . $user_row['user_thanks_received'] . ' ' . $lang['Thanks_thanked_2'] . ' ' . $thanked_post_count['thanks_count'] . ' ' . $lang['Thanks_thanked_3'] . '</a>';
}
else {
$thanks_given = "";
$thanks_received = "";
}
//
// End Thank Post by User Mod
//
// Thanked Listing
if ( isset($HTTP_GET_VARS['thankedlist']) || isset($HTTP_POST_VARS['thankedlist']) ) {
// Thanked Listing SQL
$sql = "SELECT thanks_from_user_id, topic_id, post_id, poster_id
FROM " . POSTS_TABLE . "
WHERE thanks_count <> 0";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain posts information", '', __LINE__, __FILE__, $sql);
}
$thanks_listing = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$thanks_listing_count = count($thanks_listing);
$thanked_post = 0;
for ($i = 0; $i < $thanks_listing_count; $i++) {
$thanks_users = explode("|",$thanks_listing[$i]['thanks_from_user_id']);
$thanks_count = count($thanks_users);
// Loop through all users who thanked the post
for ($x = 0; $x < $thanks_count; $x++) {
if ($profiledata['user_id'] == $thanks_users[$x]) {
$thanked_post = 1;
// Users SQL
$sql = "SELECT user_id, username
FROM " . USERS_TABLE . "
WHERE user_id = " . $thanks_listing[$i]['poster_id'];
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}
$user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Add user to thanked by list
$temp_url = "profile.$phpEx?mode=viewprofile&u=" . $user_row['user_id'];
$thanks_compiled = '<a href="' . $temp_url . '">' . $user_row['username'] . '</a>';
}
}
if ($thanked_post == 1) {
// Topic SQL
$sql = "SELECT topic_title
FROM " . TOPICS_TABLE . "
WHERE topic_id = '" . $thanks_listing[$i]['topic_id'] . "'";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}
$topic_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$temp_url_post = "viewtopic.$phpEx?p=" . $thanks_listing[$i]['post_id'] . "#" . $thanks_listing[$i]['post_id'];
$temp_url_topic = "viewtopic.$phpEx?t=" . $thanks_listing[$i]['topic_id'];
$thanked_post = '<a href="' . $temp_url_post . '"> (Post #' . $thanks_listing[$i]['post_id'] . ')</a>';
$thanked_topic = '<a href="' . $temp_url_topic . '">' . $topic_row['topic_title'] . '</a>';
$thanked_listing .= "Thanked $thanks_compiled in $thanked_topic - $thanked_post<br/>";
$thanks_compiled = '';
$thanked_post = 0;
}
}
$template->assign_block_vars('thankedlist', array(
'THANKED_LISTING' => $thanked_listing,
'L_THANKED_LISTING' => 'Thanks Listing')
);
}
// Thanks Listing
if ( isset($HTTP_GET_VARS['thankslist']) || isset($HTTP_POST_VARS['thankslist']) ) {
// Thanked Listing SQL
$sql = "SELECT thanks_from_user_id, thanks_count, topic_id, post_id
FROM " . POSTS_TABLE . "
WHERE poster_id = " . $profiledata['user_id'] . " AND thanks_count <> 0";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain posts information", '', __LINE__, __FILE__, $sql);
}
$thanked_listing = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$thanked_listing_count = count($thanked_listing);
for ($i = 0; $i < $thanked_listing_count; $i++) {
$thanked_users = explode("|",$thanked_listing[$i]['thanks_from_user_id']);
$thanked_count = $thanked_listing[$i]['thanks_count'];
// Loop through all users who thanked the post
for ($x = 0; $x < $thanked_count; $x++) {
// Users SQL
$sql = "SELECT user_id, username
FROM " . USERS_TABLE . "
WHERE user_id = " . $thanked_users[$x];
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}
$user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($x >= 1) { $thanks_compiled .= ", "; }
// Add user to thanked by list
$temp_url = "profile.$phpEx?mode=viewprofile&u=" . $user_row['user_id'];
$thanks_compiled .= '<a href="' . $temp_url . '">' . $user_row['username'] . '</a>';
}
// Topic SQL
$sql = "SELECT topic_title
FROM " . TOPICS_TABLE . "
WHERE topic_id = " . $thanked_listing[$i]['topic_id'];
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}
$topic_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$temp_url_post = "viewtopic.$phpEx?p=" . $thanked_listing[$i]['post_id'] . "#" . $thanked_listing[$i]['post_id'];
$temp_url_topic = "viewtopic.$phpEx?t=" . $thanked_listing[$i]['topic_id'];
$thanks_post = '<a href="' . $temp_url_post . '"> (Post #' . $thanked_listing[$i]['post_id'] . ')</a>';
$thanks_topic = '<a href="' . $temp_url_topic . '">' . $topic_row['topic_title'] . '</a>';
$thanks_listing .= "Thanked by $thanks_compiled in $thanks_topic - $thanks_post<br/>";
$thanks_compiled = '';
}
$template->assign_block_vars('thankslist', array(
'THANKS_LISTING' => $thanks_listing,
'L_THANKS_LISTING' => $lang['Thanks_listing'])
);
}
Code: Select all
<!-- BEGIN thankedlist -->
<tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen">{thankedlist.L_THANKED_LISTING}:</span></td>
<td> <span class="gen">{thankedlist.THANKED_LISTING}</span></td>
</tr>
<!-- END thankedlist -->
<!-- BEGIN thankslist -->
<tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen">{thankslist.L_THANKS_LISTING}:</span></td>
<td> <span class="gen">{thankslist.THANKS_LISTING}</span></td>
</tr>
<!-- END thankslist -->
Code: Select all
Thanked Listing: ArrayThanked by ............ in ..... - post...
Thanked by ............ in ..... - post....
Thanked by ............ in ..... - post...
Code: Select all
Could not obtain user information
DEBUG MODE
SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3
SELECT user_thanks_given FROM phpbb_users WHERE user_id =
Line : 491
File : functions_post.php
Code: Select all
echo "SQL = " . $sql . "<br/> Post Thanks = " . $post_thanks['thanks_from_user_id'] . "<br/> Thanked Users = " . $thanked_users . "<br/> Thanked Users Element1 = " . $thanked_users[1];
Code: Select all
// Remove 1 from the user who thanked the post
$sql = "SELECT user_thanks_given
FROM "
Code: Select all
SQL = SELECT thanks_from_user_id, thanks_count, poster_id FROM phpbb_posts WHERE post_id = '408'
Post Thanks =
Thanked Users = Array
Thanked Users Element1 =
Warning: Cannot modify header information - headers already sent by (output started at /home/hash86/public_html/includes/functions_post.php:486) in /home/hash86/public_html/includes/page_header.php on line 662
Warning: Cannot modify header information - headers already sent by (output started at /home/hash86/public_html/includes/functions_post.php:486) in /home/hash86/public_html/includes/page_header.php on line 664
Warning: Cannot modify header information - headers already sent by (output started at /home/hash86/public_html/includes/functions_post.php:486) in /home/hash86/public_html/includes/page_header.php on line 665
Code: Select all
Could not obtain user information
DEBUG MODE
SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3
SELECT user_thanks_given FROM phpbb_users WHERE user_id =
Line : 493
File : functions_post.php
Code: Select all
//
// Start Thank Post by User Mod
//
// Thanked Listing SQL
$sql = "SELECT thanks_from_user_id, thanks_count, poster_id
FROM " . POSTS_TABLE . "
WHERE post_id = '$post_id'";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain posts information", '', __LINE__, __FILE__, $sql);
}
$post_thanks = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// If this post was thanked, then continue
if ($post_thanks['thanks_from_user_id']) {
$thanked_users = explode("|", $post_thanks['thanks_from_user_id']);
// Loop through all users who thanked the post
for ($i = 0; $i < count($thanked_users); $i++) {
$from_user = $thanked_users[$i];
$to_user = $post_thanks['poster_id'];
// Remove 1 from the user who thanked the post
$sql = "SELECT user_thanks_given
FROM " . USERS_TABLE . "
WHERE user_id = " . $from_user;
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}
$from_user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$thanks_given = $from_user_row['user_thanks_given'] - 1;
// Update DB with the new thanks given
$update_sql = "UPDATE " . USERS_TABLE . "
SET user_thanks_given = '" . $thanks_given . "'
WHERE user_id = " . $from_user;
if ( !($result = $db->sql_query($update_sql)) ) {
message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $update_sql);
}
// Remove 1 from the user who was thanked
$sql = "SELECT user_thanks_received
FROM " . USERS_TABLE . "
WHERE user_id = " . $to_user;
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}
$to_user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$thanks_received = $to_user_row['user_thanks_received'] - 1;
// Update DB with the new thanks given
$update_sql = "UPDATE " . USERS_TABLE . "
SET user_thanks_received = '" . $thanks_received . "'
WHERE user_id = " . $to_user;
if ( !($result = $db->sql_query($update_sql)) ) {
message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $update_sql);
}
}
}
//
// End Thank Post by User Mod
//
Code: Select all
//
// Start Thank Post by User Mod
//
// Thanked Listing SQL
$sql = "SELECT thanks_from_user_id, thanks_count, poster_id
FROM " . POSTS_TABLE . "
WHERE post_id = '$post_id'";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain posts information", '', __LINE__, __FILE__, $sql);
}
$post_thanks = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$thanked_users = explode("|", $post_thanks['thanks_from_user_id']);
// Loop through all users who thanked the post
for ($i = 0; $i < count($thanked_users); $i++) {
$from_user = $thanked_users[$i];
$to_user = $post_thanks['poster_id'];
// Remove 1 from the user who thanked the post
$sql = "SELECT user_thanks_given
FROM " . USERS_TABLE . "
WHERE user_id = " . $from_user;
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}
$from_user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$thanks_given = $from_user_row['user_thanks_given'] - 1;
// Update DB with the new thanks given
$update_sql = "UPDATE " . USERS_TABLE . "
SET user_thanks_given = '" . $thanks_given . "'
WHERE user_id = " . $from_user;
if ( !($result = $db->sql_query($update_sql)) ) {
message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $update_sql);
}
// Remove 1 from the user who was thanked
$sql = "SELECT user_thanks_received
FROM " . USERS_TABLE . "
WHERE user_id = " . $to_user;
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}
$to_user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$thanks_received = $to_user_row['user_thanks_received'] - 1;
// Update DB with the new thanks given
$update_sql = "UPDATE " . USERS_TABLE . "
SET user_thanks_received = '" . $thanks_received . "'
WHERE user_id = " . $to_user;
if ( !($result = $db->sql_query($update_sql)) ) {
message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $update_sql);
}
}
//
// End Thank Post by User Mod
//
Code: Select all
//
// Start Thank Post by User Mod
//
// Thanked Listing SQL
$sql = "SELECT thanks_from_user_id, thanks_count, poster_id
FROM " . POSTS_TABLE . "
WHERE post_id = '$post_id'";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain posts information", '', __LINE__, __FILE__, $sql);
}
$post_thanks = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// If this post was thanked, then continue
if ($post_thanks['thanks_from_user_id']) {
$thanked_users = explode("|", $post_thanks['thanks_from_user_id']);
// Loop through all users who thanked the post
for ($i = 0; $i < count($thanked_users); $i++) {
$from_user = $thanked_users[$i];
$to_user = $post_thanks['poster_id'];
// Remove 1 from the user who thanked the post
$sql = "SELECT user_thanks_given
FROM " . USERS_TABLE . "
WHERE user_id = " . $from_user;
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}
$from_user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$thanks_given = $from_user_row['user_thanks_given'] - 1;
// Update DB with the new thanks given
$update_sql = "UPDATE " . USERS_TABLE . "
SET user_thanks_given = '" . $thanks_given . "'
WHERE user_id = " . $from_user;
if ( !($result = $db->sql_query($update_sql)) ) {
message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $update_sql);
}
// Remove 1 from the user who was thanked
$sql = "SELECT user_thanks_received
FROM " . USERS_TABLE . "
WHERE user_id = " . $to_user;
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}
$to_user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$thanks_received = $to_user_row['user_thanks_received'] - 1;
// Update DB with the new thanks given
$update_sql = "UPDATE " . USERS_TABLE . "
SET user_thanks_received = '" . $thanks_received . "'
WHERE user_id = " . $to_user;
if ( !($result = $db->sql_query($update_sql)) ) {
message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $update_sql);
}
}
}
//
// End Thank Post by User Mod
//
Code: Select all
if ( ($userdata['session_logged_in']) && ($userdata['user_id'] != $poster_id) ) {
Code: Select all
if ($i == 0 && ($userdata['session_logged_in']) && ($userdata['user_id'] != $poster_id) ) {