Advertisement:

Author Topic: Good Post/Bad Post Mod  (Read 154376 times)

Offline NEOne15

  • Newbie
  • *
  • Posts: 2
Re: Good Post/Bad Post Mod
« Reply #520 on: May 05, 2014, 06:53:44 PM »
'// Good Post/Bad Post: it may be nice to let users know of this. $txt['whotopic_gpbp'] = 'Voting a message from "%s".';'

This appears at the top of my Administrative Panel index, but on no other pages.

Online margarett

  • Support Specialist
  • SMF Super Hero
  • *
  • Posts: 12,984
  • Gender: Male
Re: Good Post/Bad Post Mod
« Reply #521 on: May 05, 2014, 06:58:52 PM »
Check for that text in Modifications.english.php after the final ?>
Bruno Alves a.k.a "margarett"

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

Quote
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline Moniker

  • Newbie
  • *
  • Posts: 2
Re: Good Post/Bad Post Mod
« Reply #522 on: May 12, 2014, 11:31:48 AM »
rik300, this module works on SMF 2.0.7 8)

I have tried changing the versions as described previously and I am not able to get it to install. I'm running 2.0.7.

Anyone get it going in 2.0.7? Is there a fix or modification to the files that I missed?

If anyone can help, I would really appreciate it.

Edit: I got it working by emulating version 2.0.4 - see: http://wiki.simplemachines.org/smf/How_can_I_install_a_mod_that_doesn%27t_work_in_my_SMF_version
« Last Edit: May 13, 2014, 04:29:48 AM by Moniker »

Offline Moniker

  • Newbie
  • *
  • Posts: 2
Re: Good Post/Bad Post Mod
« Reply #523 on: May 16, 2014, 04:20:01 AM »
'// Good Post/Bad Post: it may be nice to let users know of this. $txt['whotopic_gpbp'] = 'Voting a message from "%s".';'

This appears at the top of my Administrative Panel index, but on no other pages.
I am getting this very same thing and can't find the cause.

Check for that text in Modifications.english.php after the final ?>
I looked here and found nothing that resolved the problem.




Anyone else experiencing this? Anyone know if a fix?

Online margarett

  • Support Specialist
  • SMF Super Hero
  • *
  • Posts: 12,984
  • Gender: Male
Re: Good Post/Bad Post Mod
« Reply #524 on: May 16, 2014, 06:15:23 AM »
Check Who.english.php
According the manual installation instructions, that's where that text is.
Bruno Alves a.k.a "margarett"

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

Quote
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline ExSpirit

  • Jr. Member
  • **
  • Posts: 187
Re: Good Post/Bad Post Mod
« Reply #525 on: May 27, 2014, 03:10:14 AM »
Currently each user had total "Respect" shown, but I would like to show number of "Good posts" and number of "Bad posts". Can someone help me where I can get those numbers from?

It would also be great if we could specific in permissions page who can vote up and who can vote down (not it's only 1 permission for both), this way normal members can only vote up, and special members also down...
« Last Edit: May 27, 2014, 06:28:34 AM by ExSpirit »

Offline DDDD11

  • Newbie
  • *
  • Posts: 7
Re: Good Post/Bad Post Mod
« Reply #526 on: July 07, 2014, 04:48:16 PM »
I just did the mod installation and it said successful. I can click on the basic and advanced configuration settings but when I click on GPBP Tools it gives this error:

Table 'forums.smf_log_gpbp' doesn't exist
File: /var/www/html/forums/Sources/GoodPostBadPost.php
Line: 505

Also, if I enable GP / BP on any board I get his error when clicking on a post:

Table 'forums.smf_log_gpbp' doesn't exist
File: /var/www/html/forums/Sources/Display.php
Line: 1161

Here is partial log from the mysql.

140707 13:37:26   127 Connect   root@localhost on
                 
                  127 Query     CREATE TABLE smf_log_gpbp
(
        `id_msg` int(10) unsigned NOT NULL ,
        `id_member` mediumint(8) unsigned NOT NULL ,
        `score` smallint(2) NOT NULL ,
        `id_poster` mediumint(8) unsigned NOT NULL ,
        `log_time` int(10) unsigned NOT NULL ,
        KEY id_member (id_member),
        KEY id_poster (id_poster),
        PRIMARY KEY (id_msg,id_member)) TYPE=MyISAM
                  127 Query     SHOW FIELDS
                FROM `smf_messages`
                  127 Query     ALTER TABLE smf_messages
                        ADD `gpbp_score` smallint(6) NOT NULL default '0'
140707 13:37:28   127 Query     SHOW FIELDS
                FROM `smf_members`
                 
It looks like the tables are removed: here is the smf_log_packages log:

 a:4:{i:0;a:2:{i:0;s:12:"remo
ve_table";i:1;s:12:"smf_log_gpbp";}i:1;a:3:{i:0;s:13:"remove_column";i:1;s:10:"smf_boards";i:2;s:11:"enable_gpbp";}i:2;a:3:{i:0;s:13:"remove_colu
mn";i:1;s:12:"smf_messages";i:2;s:10:"gpbp_score";}i:3;a:3:{i:0;s:13:"remove_column";i:1;s:11:"smf_members";i:2;s:12:"gpbp_respect";

So what is going on with this?
« Last Edit: July 08, 2014, 03:30:06 PM by DDDD11 »

Offline DDDD11

  • Newbie
  • *
  • Posts: 7
Re: Good Post/Bad Post Mod
« Reply #527 on: July 08, 2014, 03:30:26 PM »
I just did the mod installation and it said successful. I can click on the basic and advanced configuration settings but when I click on GPBP Tools it gives this error:

Table 'forums.smf_log_gpbp' doesn't exist
File: /var/www/html/forums/Sources/GoodPostBadPost.php
Line: 505

Also, if I enable GP / BP on any board I get his error when clicking on a post:

Table 'forums.smf_log_gpbp' doesn't exist
File: /var/www/html/forums/Sources/Display.php
Line: 1161

Here is partial log from the mysql.

140707 13:37:26   127 Connect   root@localhost on
                 
                  127 Query     CREATE TABLE smf_log_gpbp
(
        `id_msg` int(10) unsigned NOT NULL ,
        `id_member` mediumint(8) unsigned NOT NULL ,
        `score` smallint(2) NOT NULL ,
        `id_poster` mediumint(8) unsigned NOT NULL ,
        `log_time` int(10) unsigned NOT NULL ,
        KEY id_member (id_member),
        KEY id_poster (id_poster),
        PRIMARY KEY (id_msg,id_member)) TYPE=MyISAM
                  127 Query     SHOW FIELDS
                FROM `smf_messages`
                  127 Query     ALTER TABLE smf_messages
                        ADD `gpbp_score` smallint(6) NOT NULL default '0'
140707 13:37:28   127 Query     SHOW FIELDS
                FROM `smf_members`
                 
It looks like the tables are removed: here is the smf_log_packages log:

 a:4:{i:0;a:2:{i:0;s:12:"remo
ve_table";i:1;s:12:"smf_log_gpbp";}i:1;a:3:{i:0;s:13:"remove_column";i:1;s:10:"smf_boards";i:2;s:11:"enable_gpbp";}i:2;a:3:{i:0;s:13:"remove_colu
mn";i:1;s:12:"smf_messages";i:2;s:10:"gpbp_score";}i:3;a:3:{i:0;s:13:"remove_column";i:1;s:11:"smf_members";i:2;s:12:"gpbp_respect";

So what is going on with this?

Okay so I just manually added the table back into the database without the "TYPE=MyISAM" and it works.

Can we get an updated version that replace

TYPE=MyISAM

with

ENGINE=MyISAM

due to MySQL updates? Also, if anyone knows which file this is defines I would appreciate it, searching each one is proving a pain.

I'm thinking this is edited in the MySQL file. Hmm, I will get back.
« Last Edit: July 08, 2014, 04:03:02 PM by DDDD11 »

Offline DDDD11

  • Newbie
  • *
  • Posts: 7
Re: Good Post/Bad Post Mod
« Reply #528 on: July 11, 2014, 05:39:53 PM »
I just did the mod installation and it said successful. I can click on the basic and advanced configuration settings but when I click on GPBP Tools it gives this error:

Table 'forums.smf_log_gpbp' doesn't exist
File: /var/www/html/forums/Sources/GoodPostBadPost.php
Line: 505

Also, if I enable GP / BP on any board I get his error when clicking on a post:

Table 'forums.smf_log_gpbp' doesn't exist
File: /var/www/html/forums/Sources/Display.php
Line: 1161

Here is partial log from the mysql.

140707 13:37:26   127 Connect   root@localhost on
                 
                  127 Query     CREATE TABLE smf_log_gpbp
(
        `id_msg` int(10) unsigned NOT NULL ,
        `id_member` mediumint(8) unsigned NOT NULL ,
        `score` smallint(2) NOT NULL ,
        `id_poster` mediumint(8) unsigned NOT NULL ,
        `log_time` int(10) unsigned NOT NULL ,
        KEY id_member (id_member),
        KEY id_poster (id_poster),
        PRIMARY KEY (id_msg,id_member)) TYPE=MyISAM
                  127 Query     SHOW FIELDS
                FROM `smf_messages`
                  127 Query     ALTER TABLE smf_messages
                        ADD `gpbp_score` smallint(6) NOT NULL default '0'
140707 13:37:28   127 Query     SHOW FIELDS
                FROM `smf_members`
                 
It looks like the tables are removed: here is the smf_log_packages log:

 a:4:{i:0;a:2:{i:0;s:12:"remo
ve_table";i:1;s:12:"smf_log_gpbp";}i:1;a:3:{i:0;s:13:"remove_column";i:1;s:10:"smf_boards";i:2;s:11:"enable_gpbp";}i:2;a:3:{i:0;s:13:"remove_colu
mn";i:1;s:12:"smf_messages";i:2;s:10:"gpbp_score";}i:3;a:3:{i:0;s:13:"remove_column";i:1;s:11:"smf_members";i:2;s:12:"gpbp_respect";

So what is going on with this?

Okay so I just manually added the table back into the database without the "TYPE=MyISAM" and it works.

Can we get an updated version that replace

TYPE=MyISAM

with

ENGINE=MyISAM

due to MySQL updates? Also, if anyone knows which file this is defines I would appreciate it, searching each one is proving a pain.

I'm thinking this is edited in the MySQL file. Hmm, I will get back.

Okay so I can't find the SQL file in the Mod that is setting this. Anyone know anything  :'(

Offline Uardo

  • Newbie
  • *
  • Posts: 8
Good Post/Bad Post simple modification
« Reply #529 on: November 29, 2014, 11:06:36 AM »
Hey Guys

I couldn't request this modification on mod topic where it was posted because it was locked.

I would like to know if someone can make this mod " Good Post/Bad Post " so at the message of the week that displays in the Info center at the board index, including the most voted messages of the past few days will not display messages from topics that has been locked. So i am not a scripter nor i have any knowledge how php works, if anyone willing to make it please add a code that will ignore locked topic from displaying in messages of the week.

Sorry if sometimes i explain myself bad, so if I'm confusing or not clear... tell me.

-Thanks

Offline Uardo

  • Newbie
  • *
  • Posts: 8
Re: Good Post/Bad Post simple modification
« Reply #530 on: December 05, 2014, 11:31:37 AM »
None willing to help?  :-X

Online margarett

  • Support Specialist
  • SMF Super Hero
  • *
  • Posts: 12,984
  • Gender: Male
Re: Good Post/Bad Post simple modification
« Reply #531 on: December 05, 2014, 02:22:57 PM »
Gave a quick look at the code, it's not a direct task...

The function that gathers that content isn't checking, in any point, the "topics" table, which is the only place where you know a topic is locked.
In order to do that, you would need to join both the messages and topics tables to the first query and then exclude locked topics. I'm not sure about the performance implications on that...
Bruno Alves a.k.a "margarett"

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

Quote
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline Uardo

  • Newbie
  • *
  • Posts: 8
Re: Good Post/Bad Post simple modification
« Reply #532 on: December 05, 2014, 05:14:46 PM »
Thank you for replying,
but as i said above i have no idea how scripting stuffs work, if it is possible please write the code that you already explained above and tell me where i should exactly add it. If you believe you can do it, please do it, it's not an issue the performance implication for me.

Thank You in Advance!

Online margarett

  • Support Specialist
  • SMF Super Hero
  • *
  • Posts: 12,984
  • Gender: Male
Re: Good Post/Bad Post Mod
« Reply #533 on: December 10, 2014, 01:57:45 PM »
I merged this into the MOD's support topic.

So, you can do this by editing Sources/GoodPostBadPost.php, find:
Code: [Select]
$request = $smcFunc['db_query']('','
SELECT SUM(score) AS score, id_msg AS msg
FROM {db_prefix}log_gpbp
WHERE log_time >= {int:weekago}
GROUP BY msg
ORDER BY score DESC
LIMIT {int:limit}',
array(
'weekago' => $aWeekAgo,
'limit' => $modSettings['gpbp_show_best_topics']
)
);
And replace with this:
Code: [Select]
$request = $smcFunc['db_query']('','
SELECT SUM(log.score) AS score, log.id_msg AS msg
FROM {db_prefix}log_gpbp AS log
JOIN {db_prefix}messages AS mess ON (mess.id_msg = log.id_msg)
JOIN {db_prefix}topics AS top ON (mess.id_topic = top.id_topic)
WHERE log.log_time >= {int:weekago}
AND top.locked = 0
GROUP BY msg
ORDER BY score DESC
LIMIT {int:limit}',
array(
'weekago' => $aWeekAgo,
'limit' => $modSettings['gpbp_show_best_topics']
)
);
It worked here in my short tests.

Anyway, do note that this information isn't cached and will be loaded on every page load of your board index. It's not a pretty query :P

Keep a backup of your original file before you mess it, will you? :P
Bruno Alves a.k.a "margarett"

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

Quote
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 64,280
Re: Good Post/Bad Post Mod
« Reply #534 on: December 10, 2014, 02:20:05 PM »
Are you intending INNER or LEFT joins there?
And his eyes have all the seeming of a demon's that is dreaming,
And the lamp-light o'er him streaming throws his shadow on the floor


Before you send me a PM for support...

Online margarett

  • Support Specialist
  • SMF Super Hero
  • *
  • Posts: 12,984
  • Gender: Male
Re: Good Post/Bad Post Mod
« Reply #535 on: December 10, 2014, 02:22:46 PM »
INNER. All fields have to exist in every table ;)
Bruno Alves a.k.a "margarett"

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

Quote
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 64,280
Re: Good Post/Bad Post Mod
« Reply #536 on: December 10, 2014, 02:36:50 PM »
That's what I thought, but it's always best to clarify... we didn't have a debate about this in one of the other boards today about this :P
And his eyes have all the seeming of a demon's that is dreaming,
And the lamp-light o'er him streaming throws his shadow on the floor


Before you send me a PM for support...

Offline vallejo

  • Jr. Member
  • **
  • Posts: 119
Re: Good Post/Bad Post Mod
« Reply #537 on: Today at 11:52:36 AM »
Buenas me pueden colaborar, porque no puedo instalar este MOD, mi SMF es V 2.0.9 trato de emularlo a la 2.0.4 e inferior y me dice que puede estar dañado el archivo gracias..!