Dont show edit by staff

Started by ErikZown, August 11, 2012, 05:16:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mindless

Ah never knew that - thought that was added lol.

ErikZown

But it already was a query there from the beginning, and then it looks like this
        if (is_valid_id($arr['editedby']))
        {
          $res2 = mysql_query("SELECT username FROM users WHERE id={$arr['editedby']}");
          if (mysql_num_rows($res2) == 1)
          {
            $arr2 = mysql_fetch_assoc($res2);
            $body .= "<p><font size='1' class='small'>{$lang['forum_topic_view_edit_by']}<a href='userdetails.php?id={$arr['editedby']}'><b>{$arr2['username']}</b></a> on ".get_date( $arr['editedat'],'')."</font></p>\n";
          }
        }


So adding class cant do so much

MJF

Honestly, ask your coder why did he add a new query?

What you asked is a basic coding stuff which you should know about and if you never did something like that then you should have looked on a other file, like userdetails.php. The Edit User Section there is also only for Moderators or above so you could open the file and tried to figure out how it has been done there and do the same on forums.php  :)

Like mindless said, the more queries , the more loading time for a tracker with many users and many torrents on a small server!  ;)

Mindless

#5
Your coder fixed it - its only basic logic, your coder actually added a query when there is no need, see theres ways of doing things without adding yet more mysql querys, they all add up and when you have a busy tracker and a server on its arse you will understand what i just said.

ErikZown

comment? Then you removing it...
Anyway, my coder fixed it. So when mods or higher edits a post in forums that "Latest edit by..." text is not shown.

Here is the code for it:
    if (is_valid_id($arr['editedby'])) {
        $res2 = mysql_query("SELECT username, class FROM users WHERE id={$arr['editedby']}");
        if (mysql_num_rows($res2) == 1) {
            $arr2 = mysql_fetch_assoc($res2);
            if ($arr2['class'] < UC_MODERATOR)
                $body .= "<p><font size='1' class='small'>{$lang['forum_topic_view_edit_by']}<a class='black' href='userdetails.php?id={$arr['editedby']}'><b>{$arr2['username']}</b></a> on " . get_date($arr['editedat'], '') . "</font></p>\n";
        }
    }


Its in /forums/forum_topicview.php

xamalis

commenttable fuction at tbdev09 is on /include/torrentable.php (end of file).
Just comment these lines!
    if ($row["editedby"])
    
	
$text .= "<p><font size='1' class='small'>".$lang["commenttable_last_edited_by"]." <a href='userdetails.php?id={$row['editedby']}'><b>{$row['username']}</b></a> ".$lang["commenttable_last_edited_at"]." ".get_date($row['editedat'],'DATE')."</font></p>\n";


ErikZown

No one?  :'(
It should be a simple mod... its gotta be somewhere..

ErikZown

I know this function is somewhere but i cant find it.
Its to the forum.
I dont want, when mods or higher edits a post, this text "Latest edit by xxx on Today.."

Thanks