News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

vReportBoard Mod

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

Previous topic - Next topic

kitun

#380
Where are plugin options? I've installed it on SMF 1.1.5 and I can't find them under Features and Options...

Also, I can't uninstall plugin, it shows me failed on all files...

SONSiVRi

Quote from: kitun on August 29, 2008, 04:42:59 AM
Where are plugin options? I've installed it on SMF 1.1.5 and I can't find them under Features and Options...

Also, I can't uninstall plugin, it shows me failed on all files...

It means you didnt install it. Forum said its installed but probably your CHMOD settings didnt allowed to edit those files. Just uninstall even forum says "failed". Then install it but this time CHMOD 0777 your files before installation. Dont forget to turn CHMOD 0644 back after installation.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

Ozman69

#382
Just installed this to a heavily modified 1.1.5 and had no real problems.  Only thing I can't seem to find is a way to change the unsolved image to solved when I've read the reported post in my sub-forum.  I'm not sure which file gets changed in the non-default theme I'm running since package parser keeps telling me this mod won't work with 1.1.5 (even though it did).  I figured it would be just a matter of clicking modify on the post that has the initial report and changing it to solved, but neither solver or unsolved appears in the options.

Any help would be appreciated.

Oz

edit:  changing to the default theme doesn't seem to solve the problem either.

SlammedDime

Who can and can't solve topics is permission based in SMF's permission system.  The edit for where the solve icon is shown should be in Display.template.php.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Ozman69

Quote from: SlammedDime on September 04, 2008, 08:15:36 PM
Who can and can't solve topics is permission based in SMF's permission system.  The edit for where the solve icon is shown should be in Display.template.php.

I understand about the permissions, but not sure what I've done wrong.  If anyone gets bored, I've included a copy of my Display.template.php file.  If you see my mistake, feel free to point it out for me.   :P

Oz

SONSiVRi

#385
I added new behaviour.
When you solved / unsolved the report, system reply Solved by SONSiVRi in your behalf.
This can clear the situation of who did wrong solution.
Check the attached image of working screenshot.

And I will add who solved more statistics soon.

Make this changing in SendTopic.php

Code ("Find") Select

// Solves/Unsolves a topic.
function SolveTopic()
{
global $context, $db_prefix, $modSettings, $board, $topic, $sourcedir;

    // I did NOT include a session check here. It's just... not risky. Duh.

// make sure they may do this!
isAllowedTo('report_solve');

// solving only in the report board! we don't need a permission check, everyone who has access here can solve.
if($board != $modSettings['report_board'] && $board != $modSettings['report_board_pm']) {
        if(isset($_REQUEST['xml'])) {
            header('Content-Type: text/xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
        echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>
<message>error</message>
</smf>';
            die();
        }

        fatal_lang_error('rtm_solveoutside');
}

// Just quit if there's no topic to lock.
if (empty($topic)) {
        if(isset($_REQUEST['xml'])) {
            header('Content-Type: text/xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
        echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>
<message>error</message>
</smf>';
            die();
        }

        fatal_lang_error(472, false);
    }

// It's a toggle action, so get current status
$request = db_query("
SELECT m.ID_MSG, m.icon
FROM {$db_prefix}topics as t, {$db_prefix}messages as m
WHERE t.ID_TOPIC = $topic
AND m.ID_MSG = t.ID_FIRST_MSG
LIMIT 1", __FILE__, __LINE__);
list ($msg, $icon) = mysql_fetch_row($request);
mysql_free_result($request);

$solved = ($icon == 'unsolved') ? 1 : 0;
$icon = ($icon == 'unsolved') ? 'solved' : 'unsolved';

// Actually lock the topic in the database with the new value.
db_query("
UPDATE {$db_prefix}messages
SET icon = '$icon'
WHERE ID_MSG = $msg
LIMIT 1", __FILE__, __LINE__);

    // and update log
    db_query("
            UPDATE {$db_prefix}log_reports
            SET solved = $solved
            WHERE ID_TOPIC = $topic
            LIMIT 1", __FILE__, __LINE__);

// Always log this.
logAction('solve', array('topic' => $topic));

    // xml? just report!
if(isset($_REQUEST['xml'])) {
        header('Content-Type: text/xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
        echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>
<message>', $solved ? 'solved' : 'unsolved', '</message>
</smf>';

        die();
}

// Else, back to the board!
redirectexit('board=' . $board . '.0');

}


Code ("Replace") Select

// Solves/Unsolves a topic.
function SolveTopic()
{
global $context, $db_prefix, $modSettings, $board, $topic, $sourcedir;
global $user_info;

    // I did NOT include a session check here. It's just... not risky. Duh.

// make sure they may do this!
isAllowedTo('report_solve');

// solving only in the report board! we don't need a permission check, everyone who has access here can solve.
if($board != $modSettings['report_board'] && $board != $modSettings['report_board_pm']) {
        if(isset($_REQUEST['xml'])) {
            header('Content-Type: text/xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
        echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>
<message>error</message>
</smf>';
            die();
        }

        fatal_lang_error('rtm_solveoutside');
}

// Just quit if there's no topic to lock.
if (empty($topic)) {
        if(isset($_REQUEST['xml'])) {
            header('Content-Type: text/xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
        echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>
<message>error</message>
</smf>';
            die();
        }

        fatal_lang_error(472, false);
    }

// It's a toggle action, so get current status
$request = db_query("
SELECT m.ID_MSG, m.icon
FROM {$db_prefix}topics as t, {$db_prefix}messages as m
WHERE t.ID_TOPIC = $topic
AND m.ID_MSG = t.ID_FIRST_MSG
LIMIT 1", __FILE__, __LINE__);
list ($msg, $icon) = mysql_fetch_row($request);
mysql_free_result($request);

$solved = ($icon == 'unsolved') ? 1 : 0;
$icon = ($icon == 'unsolved') ? 'solved' : 'unsolved';

// Actually lock the topic in the database with the new value.
db_query("
UPDATE {$db_prefix}messages
SET icon = '$icon'
WHERE ID_MSG = $msg
LIMIT 1", __FILE__, __LINE__);

    // and update log
    db_query("
            UPDATE {$db_prefix}log_reports
            SET solved = $solved
            WHERE ID_TOPIC = $topic
            LIMIT 1", __FILE__, __LINE__);

// Always log this.
logAction('solve', array('topic' => $topic));

include_once($sourcedir . '/Subs-Post.php');
$message = ($icon == 'unsolved') ? 'Unsolved' : 'Solved';
$message = $message . ' by ' . $user_info['name'] . '.';

// 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' => '[' . $icon . ']',
'body' => addslashes($message),
'icon' => $icon,
'smileys_enabled' => true,
'attachments' => array(),
);
$topicOptions = array(
'id' => $topic,
'board' => $modSettings['report_board'],
'poll' => null,
'lock_mode' => null,
'sticky_mode' => null,
'mark_as_read' => true,
);
$posterOptions = array(
'id' => 0,
'name' => $user_info['name'],
'email' => '',
// do reports count as posts?
'update_post_count' => !empty($countPosts),
);

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

    // xml? just report!
if(isset($_REQUEST['xml'])) {
        header('Content-Type: text/xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
        echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>
<message>', $solved ? 'solved' : 'unsolved', '</message>
</smf>';

        die();
}

// Else, back to the board!
redirectexit('board=' . $board . '.0');

}
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

klra

Any plans on releasing a 1.1.5 version?

SONSiVRi

Quote from: klra on September 05, 2008, 09:07:35 AM
Any plans on releasing a 1.1.5 version?

You can modify package-info.xml

Search
<install for="1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1, 1.1 RC3">

Replace
<install for="1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1, 1.1 RC3">

It should install w/o problem.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

Kimmie

Quote from: SONSiVRi on September 05, 2008, 09:48:22 AM
Quote from: klra on September 05, 2008, 09:07:35 AM
Any plans on releasing a 1.1.5 version?

You can modify package-info.xml

Search
<install for="1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1, 1.1 RC3">

Replace
<install for="1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1, 1.1 RC3">

It should install w/o problem.

you also need to add 1.1.5 to the UNINSTALL line as well or you will have to manually uninstall it from every file if you ever decide to get rid of it.

warmachine

#389
I have to manually edit display.php and am having issues.

This is a new install with a few mods (SMF Garage, Staff page, trader system, and ignore user)

I have to find this:
ID_MSG, icon, subject, posterTime, posterIP, ID_MEMBER, modifiedTime, modifiedName, body, smileysEnabled, posterName, posterEmail,
ID_MSG_MODIFIED < $topicinfo[new_from] AS isRead
FROM {$db_prefix}messages
WHERE ID_MSG IN (" . implode(',', $messages) . ")
ORDER BY ID_MSG" . (empty($options['view_newest_first']) ? '' : ' DESC'), __FILE__, __LINE__);


When found, this is what I have:

m.ID_MSG, m.icon, m.subject, m.posterTime, m.posterIP, m.ID_MEMBER, m.modifiedTime, m.modifiedName, m.body,
                m.smileysEnabled, m.posterName, m.posterEmail,
                m.ID_MSG_MODIFIED < $topicinfo[new_from] AS isRead,
                uv.vehicle, uv.vid
            FROM {$db_prefix}messages AS m
            LEFT OUTER JOIN (
                    SELECT CONCAT_WS(' ', v.made_year, mk.make, md.model) AS vehicle, v.id AS vid, v.user_id
                    FROM {$db_prefix}garage_vehicles AS v, {$db_prefix}garage_makes AS mk, {$db_prefix}garage_models AS md
                    WHERE v.make_id = mk.id
                        AND v.model_id = md.id
                        AND v.main_vehicle = 1
                        AND mk.pending != '1'
                        AND md.pending != '1'
                        AND v.pending != '1'
                    ) AS uv ON uv.user_id = m.ID_MEMBER
            WHERE m.ID_MSG IN (" . implode(',', $messages) . ")
            ORDER BY m.ID_MSG" . (empty($options['view_newest_first']) ? '' : ' DESC'), __FILE__, __LINE__);


This is what I am supposed to replace it with:

m.ID_MSG, m.icon, m.subject, m.posterTime, m.posterIP, m.ID_MEMBER, m.modifiedTime, m.modifiedName, m.body,
m.smileysEnabled, m.posterName, m.posterEmail,
m.ID_MSG_MODIFIED < $topicinfo[new_from] AS isRead,
IFNULL(lr.ID_TOPIC, 0) as reporttopic, IFNULL(lr.solved, -1) as reportsolved
FROM {$db_prefix}messages as m
LEFT JOIN {$db_prefix}log_reports as lr ON (lr.ID_MSG = m.ID_MSG)
WHERE m.ID_MSG IN (" . implode(',', $messages) . ")
ORDER BY m.ID_MSG" . (empty($options['view_newest_first']) ? '' : ' DESC'), __FILE__, __LINE__);


The extra code that is there is from SMF Garage. Every time I try to put the following 2 lines of code where they should be (the only 2 that need to be there for this mod to work), I get errors.

IFNULL(lr.ID_TOPIC, 0) as reporttopic, IFNULL(lr.solved, -1) as reportsolved

and

LEFT JOIN {$db_prefix}log_reports as lr ON (lr.ID_MSG = m.ID_MSG)

Where do those go? The error I get is this:
QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'uv.vehicle, uv.vid
FROM smf_messages AS m
LEFT OUTER J' at line 6
File: /home/tgpforum/public_html/Sources/Display.php
Line: 758

Thanks for any help.
SMF Forum Admin/Owner:
W-body.com [nofollow]
TGPforums.com [nofollow]

SONSiVRi

warmachine,
What is your mixed code at last?
You said "Every time I try to put the following 2 lines" but where you put it?
It seems you having problem with 2 LEFT JOIN same time.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

warmachine

I compared the code that I am supposed to replace, with the code that I was supposed to find. Those 2 separate code lines I have in my post above are the changes to the code that the mod makes. Does that make sense? I'm trying to explain this as best as I can.

I tried putting those 2 lines of code where the mod was supposed to put them, but both of them caused errors like the one in the quote box in my post above to appear. This is why I'm asking where I need to put these, because with out them the mod is pretty much useless.
SMF Forum Admin/Owner:
W-body.com [nofollow]
TGPforums.com [nofollow]

SONSiVRi


m.ID_MSG, m.icon, m.subject, m.posterTime, m.posterIP, m.ID_MEMBER, m.modifiedTime, m.modifiedName, m.body,
                m.smileysEnabled, m.posterName, m.posterEmail,
                m.ID_MSG_MODIFIED < $topicinfo[new_from] AS isRead,
                IFNULL(lr.ID_TOPIC, 0) as reporttopic, IFNULL(lr.solved, -1) as reportsolved,
                uv.vehicle, uv.vid
               FROM {$db_prefix}messages AS m
            LEFT JOIN {$db_prefix}log_reports as lr ON (lr.ID_MSG = m.ID_MSG)
            LEFT JOIN (
                    SELECT CONCAT_WS(' ', v.made_year, mk.make, md.model) AS vehicle, v.id AS vid, v.user_id
                    FROM {$db_prefix}garage_vehicles AS v, {$db_prefix}garage_makes AS mk, {$db_prefix}garage_models AS md
                    WHERE v.make_id = mk.id
                        AND v.model_id = md.id
                        AND v.main_vehicle = 1
                        AND mk.pending != '1'
                        AND md.pending != '1'
                        AND v.pending != '1'
                    ) AS uv ON uv.user_id = m.ID_MEMBER
            WHERE m.ID_MSG IN (" . implode(',', $messages) . ")
            ORDER BY m.ID_MSG" . (empty($options['view_newest_first']) ? '' : ' DESC'), __FILE__, __LINE__);


Maybe this one helps.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

warmachine

That worked!! Thank you so much!  :)
SMF Forum Admin/Owner:
W-body.com [nofollow]
TGPforums.com [nofollow]

JoshieDaMan

I really need this for 1.1.6 version of SMF. Please update if you don't mind doing so.

SONSiVRi

Quote from: JoshieDaMan on October 03, 2008, 03:58:34 AM
I really need this for 1.1.6 version of SMF. Please update if you don't mind doing so.

Did you edited <install for="1.1.6"> in package-info.xml ? (same as uninstall)
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

JoshieDaMan

Quote from: SONSiVRi on October 04, 2008, 04:56:53 PM
Quote from: JoshieDaMan on October 03, 2008, 03:58:34 AM
I really need this for 1.1.6 version of SMF. Please update if you don't mind doing so.

Did you edited <install for="1.1.6"> in package-info.xml ? (same as uninstall)
No sir/ma'am. I will try that.

Sabre™

Hi peeps. :)
After youve solved the report, is there a way to make the text  [ Reported ]  in the original thread, disappear?
It continues sitting next to "quote"

Thank You in advance :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


SONSiVRi

Quote from: Sabre™ on October 07, 2008, 08:18:02 AM
Hi peeps. :)
After youve solved the report, is there a way to make the text  [ Reported ]  in the original thread, disappear?
It continues sitting next to "quote"

Thank You in advance :)

Good idea, I will let you know result from here.
My Mods - IP View Permission - Recycle Bin Cleaner - Ip to Country
www.sonsivri.com - microcontrollers
- Houston, we have a problem.

Sabre™

Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Advertisement: