Advertisement:

Author Topic: Topic Solved Mod  (Read 210942 times)

Offline Grudge

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,742
  • Gender: Male
  • Unofficial nuisance
Topic Solved Mod
« on: March 07, 2004, 07:51:18 AM »
Link to Mod

This is the first version of my topic solved MOD for SMF. This MOD allows you to select boards as "topic solved" boards. These boards will allow the topic started to ask questions and accept/reject answers to them. This is most useful on support boards. There are many settings that can be set up. Including message icons to indicate acceptance/rejection, and changing the background colour of the message to reflect topic starter as well as accepted and rejected messages. All "solved" topics will be marked in the message index with the "solved" topic icon.
I'm only a half geek really...

Offline DoW Kid Rock

  • Jr. Member
  • **
  • Posts: 139
  • Gender: Male
    • Disciples of Wrestling
Re: Topic Solved Mod
« Reply #1 on: October 22, 2004, 02:39:58 PM »
I have installed this, but can't figure out where to change the options

Offline FaSan

  • Sophist Member
  • *****
  • Posts: 1,053
  • Gender: Male
  • http://www.smitaly.net
    • SMitaly - Supporto a SMF
Re: Topic Solved Mod
« Reply #2 on: October 24, 2004, 04:10:25 PM »
On "Manage Board" --> "Add Board"  ;)

Offline DoW Kid Rock

  • Jr. Member
  • **
  • Posts: 139
  • Gender: Male
    • Disciples of Wrestling
Re: Topic Solved Mod
« Reply #3 on: October 24, 2004, 07:22:20 PM »
tried that and there is nothing there in the options.....really weird

Offline FaSan

  • Sophist Member
  • *****
  • Posts: 1,053
  • Gender: Male
  • http://www.smitaly.net
    • SMitaly - Supporto a SMF
Re: Topic Solved Mod
« Reply #4 on: October 25, 2004, 05:28:28 AM »
What language you use ? If is not english, you require add language lines in your language fileĀ  :)

Offline DoW Kid Rock

  • Jr. Member
  • **
  • Posts: 139
  • Gender: Male
    • Disciples of Wrestling
Re: Topic Solved Mod
« Reply #5 on: October 25, 2004, 03:24:48 PM »
I am using english

Offline Grudge

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,742
  • Gender: Male
  • Unofficial nuisance
Re: Topic Solved Mod
« Reply #6 on: October 25, 2004, 07:40:17 PM »
Are you 100% sure the install actually took place? Look in Modifications.english.php and verify that some "topic Solved" strings have been added...
I'm only a half geek really...

Offline DoW Kid Rock

  • Jr. Member
  • **
  • Posts: 139
  • Gender: Male
    • Disciples of Wrestling
Re: Topic Solved Mod
« Reply #7 on: October 25, 2004, 07:50:37 PM »
I can't seem to find the file you have mentioned.  I have looked in each directory, but it doesn't seem to be there. ???

Offline DoW Kid Rock

  • Jr. Member
  • **
  • Posts: 139
  • Gender: Male
    • Disciples of Wrestling
Re: Topic Solved Mod
« Reply #8 on: October 25, 2004, 10:31:05 PM »
ok I re installed the board fresh and the mod now works.  not sure why it didn't install before, but it is working.

is changing the background colour the only way you can see that the topic is solved or is there something I missed?

Offline Grudge

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,742
  • Gender: Male
  • Unofficial nuisance
Re: Topic Solved Mod
« Reply #9 on: October 27, 2004, 05:53:23 AM »
the message icon should change to a tick too...
I'm only a half geek really...

Offline SVT242

  • Semi-Newbie
  • *
  • Posts: 31
  • Gender: Male
  • Dr. Zoidberg for President
    • LightningRodder.com - Online magazine for the SVT Lightning enthusiast
Re: Topic Solved Mod
« Reply #10 on: November 08, 2004, 01:08:37 PM »
When the topic is deemed solved, is the thumbs up and locked topic (if that option is selected of course) the only indication that a topic is "SOLVED"?

Or... is there an actual icon that says "SOLVED" or is the topic automatically re-written to include [SOLVED] ?



-Thanks,

Chris
-Chris

Offline Grudge

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,742
  • Gender: Male
  • Unofficial nuisance
Re: Topic Solved Mod
« Reply #11 on: November 08, 2004, 01:36:30 PM »
No, just the icon is changed. You can mod this yourself if you wish though, by changing the mod slightly. The subject could probably be done by doing something like
, subject = CONCAT('[SOLVED] ', subject)

In the icon update bit.
I'm only a half geek really...

Offline Pause

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,623
  • Official Cheesecake
Re: Topic Solved Mod
« Reply #12 on: November 12, 2004, 07:40:37 AM »
But which file would that be in  ???

Offline Grudge

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,742
  • Gender: Male
  • Unofficial nuisance
Re: Topic Solved Mod
« Reply #13 on: November 14, 2004, 11:24:21 AM »
In Post.php, replace this:
Code: [Select]
// Check user has permission to do this
$request = db_query("
SELECT m.ID_MSG, m.ID_MEMBER, m.topicSolved, m.subject
FROM {$db_prefix}topics AS t
LEFT JOIN {$db_prefix}messages AS m ON (m.ID_MSG = t.ID_FIRST_MSG)
WHERE t.ID_TOPIC = $topic
LIMIT 1", __FILE__, __LINE__);
list ($FIRST_MSG, $ID_MEMBER_POSTER, $firstSolved, $firstSubject) = mysql_fetch_row($request);
mysql_free_result($request);

if (strstr($firstSubject, '[SOLVED]') === false)
$firstSubject = '[SOLVED] ' . $firstSubject;

if ($ID_MEMBER != $ID_MEMBER_POSTER && !isset($user_info['is_admin']))
fatal_error("Hacker... ");

// If we are accepting
if ($accept == 1)
{
// Reset any previous accepts
db_query("
UPDATE {$db_prefix}messages
SET topicSolved = 0, icon = '$modSettings[topicsolvedIconOther]'
WHERE ID_TOPIC = $topic AND topicSolved = 1 AND ID_MEMBER != $ID_MEMBER_POSTER", __FILE__, __LINE__);
db_query("
UPDATE {$db_prefix}messages
SET topicSolved = 0, icon = '$modSettings[topicsolvedIconStarter]'
WHERE ID_TOPIC = $topic AND topicSolved = 1 AND ID_MEMBER = $ID_MEMBER_POSTER", __FILE__, __LINE__);
// Update top message
db_query("
UPDATE {$db_prefix}messages
SET topicSolved = 2, icon = '$modSettings[topicsolvedIconAccept]', subject = '$firstSubject'
WHERE ID_MSG = $FIRST_MSG", __FILE__, __LINE__);
}
With this:
Code: [Select]
// Check user has permission to do this
$request = db_query("
SELECT m.ID_MSG, m.ID_MEMBER, m.topicSolved
FROM {$db_prefix}topics AS t
LEFT JOIN {$db_prefix}messages AS m ON (m.ID_MSG = t.ID_FIRST_MSG)
WHERE t.ID_TOPIC = $topic
LIMIT 1", __FILE__, __LINE__);
list ($FIRST_MSG, $ID_MEMBER_POSTER, $firstSolved) = mysql_fetch_row($request);
mysql_free_result($request);

if ($ID_MEMBER != $ID_MEMBER_POSTER && !isset($user_info['is_admin']))
fatal_error("Hacker... ");

// If we are accepting
if ($accept == 1)
{
// Reset any previous accepts
db_query("
UPDATE {$db_prefix}messages
SET topicSolved = 0, icon = '$modSettings[topicsolvedIconOther]'
WHERE ID_TOPIC = $topic AND topicSolved = 1 AND ID_MEMBER != $ID_MEMBER_POSTER", __FILE__, __LINE__);
db_query("
UPDATE {$db_prefix}messages
SET topicSolved = 0, icon = '$modSettings[topicsolvedIconStarter]'
WHERE ID_TOPIC = $topic AND topicSolved = 1 AND ID_MEMBER = $ID_MEMBER_POSTER", __FILE__, __LINE__);
// Update top message
db_query("
UPDATE {$db_prefix}messages
SET topicSolved = 2, icon = '$modSettings[topicsolvedIconAccept]'
WHERE ID_MSG = $FIRST_MSG", __FILE__, __LINE__);
}

It won't unmark the subject if they mark the top as "unsolved" aftrwards, but I'm sure you can figure out how to do that if you need that (a strpos would do it), I'm too tired for that too :P
I'm only a half geek really...

Offline eFishie

  • The Anti-Llama
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,470
  • Gender: Male
  • Vibin' The Crook
    • The Abstraction Point
Re: Topic Solved Mod
« Reply #14 on: November 14, 2004, 06:35:08 PM »
Love the mod, Grudge.
--Jon

Abstraction Point Electronic Music Community - We don't bite! Really! I promise!

Check out my newest song: Alive

Offline Sixpack

  • Newbie
  • *
  • Posts: 8
  • Puckin' Stickhead
    • The Oscar Spot - A Cichlid Web Resource Community
Re: Topic Solved Mod
« Reply #15 on: November 25, 2004, 08:07:00 AM »
I couldn't find anything on this, but I have a couple quick questions.

1. Is the Approve and reject function only enabled for Admin and the tpoic starter?

2. Is there a way to change to allow Global Moderators to use this function on enabled boards if they are by default not permitted to do so?
hxxp:www.theoscarspot.com [nonactive]

Offline Grudge

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,742
  • Gender: Male
  • Unofficial nuisance
Re: Topic Solved Mod
« Reply #16 on: November 25, 2004, 01:34:30 PM »
I *think* I wrote it for admin permissions yes. To change this in Post.php (after install)
find:
Code: [Select]
if ($ID_MEMBER != $ID_MEMBER_POSTER && !isset($user_info['is_admin']))

To:
Code: [Select]
if ($ID_MEMBER != $ID_MEMBER_POSTER && !isset($user_info['is_admin']) && !isset($user_info['is_gmod']))

Then in display.template.php find:
Code: [Select]
if (($context['user']['started'] || $context['user']['is_admin']) && isset($context['topicSolved']))

and make:
Code: [Select]
if (($context['user']['started'] || $context['user']['is_gmod'] || $context['user']['is_admin']) && isset($context['topicSolved']))
I'm only a half geek really...

Offline oscar2001

  • Jr. Member
  • **
  • Posts: 201
  • Gender: Male
Re: Topic Solved Mod
« Reply #17 on: November 26, 2004, 04:14:07 AM »
Ive tried modifying the files as above but to no avail :(
Something Im overlooking maybe in admin,permissions perhaps?

My global moderators are called Senior Members if that has any possible bearing on the situation.. I did change the name back to Global Moderator just to see on the off chance but it was a no go..

Any help would be great :)

Offline Grudge

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,742
  • Gender: Male
  • Unofficial nuisance
Re: Topic Solved Mod
« Reply #18 on: November 26, 2004, 09:36:53 AM »
instead of $user_info['is_mod'] what about putting:
allowedTo('moderate_forum')
I'm only a half geek really...

Offline oscar2001

  • Jr. Member
  • **
  • Posts: 201
  • Gender: Male
Re: Topic Solved Mod
« Reply #19 on: November 26, 2004, 07:00:27 PM »
instead of $user_info['is_mod'] what about putting:
allowedTo('moderate_forum')

Sorry doesant do anything.