vReportBoard Mod

Started by Valodim, August 21, 2006, 07:58:17 PM

Previous topic - Next topic

SONSiVRi

Waiting for hearing from you.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

Cal O'Shaw

I have taken the latest version (1.03), edited the xml file to install and uninstall on 1.1.7.  The MOD is only partially operational.

The Report to Moderator flags the offending post, opens a new topic in the correct board, and deposits the report.

It does NOT send any alerts.  Even with the board set to notify when a new topic is created, no alert is sent out.

I suspect corruption of the php file, but don't know what is wrong.  I get alerts from other boards I have set to Notify, and if I go to the newly created topic, I can request Notify from it.

Any help would be welcome, as we like the MOD, and having a way to track responses to a report, but not getting notified is causing response issues.

Grazie!

Cal

themortalgod

Hey I have read threw most of this topic and to change who can set topics as solved it seems that I just have to change a permission? What permission do I need to allow? I don't seem to have any in my permissions list that seem to have anything to do with vReport? I am using v1.03 with SMF 1.1.6, could there be a problem with the installation?

any direction would be fantastic

thx

Kimmie

Quote from: SONSiVRi on November 23, 2008, 12:41:31 PM
Waiting for hearing from you.

Sorry it has taken me so long to get back with you on this, I have been under the weather alot lately.

IT WORKS IT WORKS YIPPPPEEEE IT WORKS!!!  hhehehe

Just one thing I noticed - when a report gets marked as solved, its now adding a reply to that thread automatically stating who locked it.



This is a VERY NICE addition to the mod. Should a thread happen to not get moved (archived) before a new report is made on that same post, it lets you know exactly where the new report starts if there are alot of replies that have been made up to that point. THANK YOU for all your work on this. You are my HERO!!    :D

SONSiVRi

Ahh I forgot to delete that part I improved. I added this because sometimes wrong solutions can made and you should know who made it without checking modlog. And you can see which moderator works hard. Seems you found it nice too. If anything goes wrong or you may different actions, just tell and I may handle if I have time to do it.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

Mo786

Quote from: SONSiVRi on November 20, 2008, 05:03:53 AM
"Kimmie"

The problem was on you. You also deleted SolveTopic() function within ReportToModerator2(). I added BoardID control mechanism and its now checking topic located in which board. With this control you can delete reports or move it in another board. In this situation there will be fresh new report topic. But if you save solved reports in report board, it will be unsolved and pumped up if someone reports it again.

I am attaching implemented file here, you can check what differences made.
So does that mean the modification you posted earlier works?

Quote from: SONSiVRi on November 13, 2008, 05:59:43 AM
"Kimmie"
It's ready. But its not same as you wanted. I didn't changed the working style, reports goes under as repply in already created topics. But this time you can freely delete those topics.

Here is the story of how it's work;
If new report has arrives, system checks already made it before and if its then it passes through second check routine (that I included). This additional routine checks original topic exist or not. If it doesn't exist anymore (because you deleted) system adds fresh new topic. But if exist and solved, it bumps up that topic and change it's situation into "unsolved" and you can do whatever you want. This way is better because you can see how many times a topic is reported and you may take extra actions.

Find in SendTopic.php
// Report to the report board.
function ReportToModerator2()
{
bla bla bla
}


Replace with
// Report to the report board.
function ReportToModerator2()
{

global $txt, $scripturl, $db_prefix, $topic, $board, $board_info, $user_info, $ID_MEMBER, $modSettings, $sourcedir, $language;

// Check their session... don't want them redirected here without their knowledge.
checkSession();

// You must have the proper permissions!
isAllowedTo('report_any');

include_once($sourcedir . '/Subs-Post.php');

if(empty($modSettings['report_board']))
fatal_lang_error('rtm_noboard');

if($board == $modSettings['report_board'])
fatal_lang_error('rtm_reportboard');

// Get the basic topic information, and make sure they can see it.
$_POST['msg'] = (int) $_POST['msg'];

// fetch quote and stuff
$request = db_query("
SELECT m.ID_MEMBER, IFNULL(lr.ID_TOPIC, 0), m.posterName, mem.realName, m.posterTime, m.subject, m.body
FROM {$db_prefix}messages AS m
LEFT JOIN {$db_prefix}members AS mem ON (m.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN {$db_prefix}log_reports AS lr ON (m.ID_MSG = lr.ID_MSG)
WHERE m.ID_MSG = $_POST[msg]
AND m.ID_TOPIC = $topic
LIMIT 1", __FILE__, __LINE__);
if (mysql_num_rows($request) == 0)
fatal_lang_error('smf232');
list ($member, $oldtopic, $posterName, $realName, $mdate, $form_subject, $form_message) = mysql_fetch_row($request);
mysql_free_result($request);

// Check report topic exist anymore. Returns 0 if its not.
$request = db_query("
SELECT IFNULL(ID_TOPIC, 0)
FROM {$db_prefix}topics
WHERE ID_TOPIC = $oldtopic
LIMIT 1", __FILE__, __LINE__);
list ($oldtopic_exist) = mysql_fetch_row($request);
mysql_free_result($request);

// if "report topic" isn't exist anymore.
if ($oldtopic_exist == 0)
{
// delete report entry in database
db_query("
DELETE FROM {$db_prefix}log_reports
WHERE ID_TOPIC = $oldtopic
LIMIT 1", __FILE__, __LINE__);
// and make $oldtopic = 0 so new topic can be created instead of posting repply in old one
$oldtopic = 0;
}

if ($member == $ID_MEMBER)
fatal_lang_error('rtm_not_own', false);

$form_message = preg_replace('~<br(?: /)?' . '>~i', "\n", $form_message);

// Remove any nested quotes, if necessary.
if (!empty($modSettings['removeNestedQuotes']))
$form_message = preg_replace(array('~\n?\[quote.*?\].+?\[/quote\]\n?~is', '~^\n~', '~\[/quote\]~'), '', $form_message);
// and replace all img tgs by url tags
$form_message = preg_replace('/\[img\](.+?)\[\/img\]/is', '[url]\1[/url]', $form_message);
// Add a quote string on the front and end.
$form_message = '[quote author=' . $posterName . ' link=topic=' . $topic . '.msg' . $_POST['msg'] . '#msg' . $_POST['msg'] . ' date=' . $mdate . ']' . "\n" . $form_message . "\n" . '[/quote]';

// some parsing
$message = htmlspecialchars($_POST['comment'], ENT_QUOTES) . "\n\n" . $form_message;
preparsecode($message);

// we need to know :)
$query = db_query("
SELECT countPosts
FROM {$db_prefix}boards
WHERE ID_BOARD = $modSettings[report_board]", __FILE__, __LINE__);
if(mysql_num_rows($query) > 0)
list($countPosts) = mysql_fetch_row($query);
    else
        fatal_lang_error('rtm_notexist');

// set up all options
$msgOptions = array(
'id' => 0,
'subject' => '[' . addslashes($board_info['name']) . '] ' . addslashes($form_subject),
'body' => addslashes($message),
'icon' => 'unsolved',
'smileys_enabled' => true,
'attachments' => array(),
);
$topicOptions = array(
'id' => $oldtopic,
'board' => $modSettings['report_board'],
'poll' => null,
'lock_mode' => null,
'sticky_mode' => null,
'mark_as_read' => false,
);
$posterOptions = array(
'id' => $ID_MEMBER,
'name' => $user_info['username'],
'email' => $user_info['email'],
// do reports count as posts?
'update_post_count' => !empty($countPosts),
);

// and post!
createPost($msgOptions, $topicOptions, $posterOptions);

    // insert into report log
    if($oldtopic == 0)
        db_query("INSERT INTO {$db_prefix}log_reports (ID_MSG, ID_TOPIC, solved) VALUES ($_POST[msg], $topicOptions[id], 0)", __FILE__, __LINE__);

// If this message already reported (and may solved later), then make it UNSOLVED again because its reported for some reasons again.
if($oldtopic != 0)
{
// This is "reported" entry appears red/green in posts
db_query("
UPDATE {$db_prefix}log_reports
SET solved = 0
WHERE ID_TOPIC = $oldtopic
LIMIT 1", __FILE__, __LINE__);

// Get first message of "report topic"
$request = db_query("
SELECT m.ID_MSG
FROM {$db_prefix}topics AS t, {$db_prefix}messages AS m
WHERE t.ID_TOPIC = $oldtopic
AND m.ID_MSG = t.ID_FIRST_MSG
LIMIT 1", __FILE__, __LINE__);
list ($first_msg) = mysql_fetch_row($request);
mysql_free_result($request);

// Set first message of report topic's icon UNSOLVED
db_query("
UPDATE {$db_prefix}messages
SET icon = 'unsolved'
WHERE ID_MSG = $first_msg
LIMIT 1", __FILE__, __LINE__);
}

// Back to the board!
redirectexit('board=' . $board . '.0');
}

Does this work without any errors since you said the problem was on that guy's end.

SONSiVRi

"Mo786"

Forget earlier edits I posted. You may just take a look at this: http://www.simplemachines.org/community/index.php?topic=107556.msg1806785#msg1806785
I attached file there and compare with yours, so you can see what differences made.
And this code also makes "reported by xxx" post when who solves it. You may delete that part.
Screenshot posted 3-4 posts above.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

klra

Will an updated version be posted at the Mod site, oe possibly here in this topic?

Kimmie

I have been trying to get this feature to work for months now:

Added option (by permission) to show a marker of reported posts in message view, and their solve status

But unless I am blind it doesnt work. Can anyone show me where exactly in the message that is shows this to the member?

SONSiVRi

Quote from: Kimmie on December 21, 2008, 02:10:03 AM
I have been trying to get this feature to work for months now:

Added option (by permission) to show a marker of reported posts in message view, and their solve status

But unless I am blind it doesnt work. Can anyone show me where exactly in the message that is shows this to the member?

Is this what you are talking about http://www.simplemachines.org/community/index.php?topic=107556.msg1745915#msg1745915 ?
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

HR

Appreciated to be sure but this FTP garbage on install bugs me something serious. I cant ever get past the thing

I can explain this as simply as possible.. If I do it & implement I guarantee it.
If I do it and you implement it its a crap shoot.

KadirX

It works with 1.1.7 :)
I just installed a clean smf, then installed this package ;)
It works.

phpMyTony


HR

Quote from: KadirX on December 26, 2008, 02:19:52 PM
It works with 1.1.7 :)
I just installed a clean smf, then installed this package ;)
It works.
Never said it didnt work, did say I couldnt get it installed via package manager due to FTP window.

I can explain this as simply as possible.. If I do it & implement I guarantee it.
If I do it and you implement it its a crap shoot.

foempspeedy

#494
Quote from: KadirX on December 26, 2008, 02:19:52 PM
It works with 1.1.7 :)
I just installed a clean smf, then installed this package ;)
It works.
I want this mod too ,but the info says it isnt compatible for 1.1.7
Or what i do to get it working if ..change codes?..

SONSiVRi

foempspeedy
what info, just dont say "its not wroking....." give us proper informations, which steps you have taken.

damn, this is like solving puzzle.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

SONSiVRi

Quote from: HR on December 26, 2008, 03:16:21 PM
Quote from: KadirX on December 26, 2008, 02:19:52 PM
It works with 1.1.7 :)
I just installed a clean smf, then installed this package ;)
It works.
Never said it didnt work, did say I couldnt get it installed via package manager due to FTP window.
Is it asking ftp informations?
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

foempspeedy

Quote from: SONSiVRi on December 27, 2008, 05:53:31 AM
foempspeedy
what info, just dont say "its not wroking....." give us proper informations, which steps you have taken.

damn, this is like solving puzzle.
I didn say that..i see on mod info it isnt compatible for 1.1.7 but some posted here they installed.
I rather ask then install and get my some files messed up or unable to install.
Just asking if install with packager works or i have to manual edit/add still

HR

Quote from: SONSiVRi on December 27, 2008, 05:55:15 AM
Quote from: HR on December 26, 2008, 03:16:21 PM
Quote from: KadirX on December 26, 2008, 02:19:52 PM
It works with 1.1.7 :)
I just installed a clean smf, then installed this package ;)
It works.
Never said it didnt work, did say I couldnt get it installed via package manager due to FTP window.
Is it asking ftp informations?
Yes, and I know for certain all my files have the proper permissions.. just an annoyance really.

I can explain this as simply as possible.. If I do it & implement I guarantee it.
If I do it and you implement it its a crap shoot.

foempspeedy

Quote from: foempspeedy on December 27, 2008, 07:15:51 AM
Quote from: SONSiVRi on December 27, 2008, 05:53:31 AM
foempspeedy
what info, just dont say "its not wroking....." give us proper informations, which steps you have taken.

damn, this is like solving puzzle.
I didn say that..i see on mod info it isnt compatible for 1.1.7 but some posted here they installed.
I rather ask then install and get my some files messed up or unable to install.
Just asking if install with packager works or i have to manual edit/add still
and whoever said it installs from package manager on 1.1.7 impossible
"The package you are trying to download or install is either corrupt or not compatible with this version of SMF."

Advertisement: