[DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Suggested Hosts
Locked
User avatar
ameisez
Registered User
Posts: 1166
Joined: Sun Nov 04, 2007 7:04 am

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by ameisez »

Is this still in active development or nearly ABD?
PHPBB on HOSTGATOR SERVER. MY PERSONAL CHOICE ;)
Need phpBB images and buttons? HIRE ME
my MOD: BB3 Media Player | a phpbb based media player
User avatar
MartectX
Registered User
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by MartectX »

ameisez wrote:Is this still in active development or nearly ABD?
I asked Mahony on the German support forums and he promised he'd join all bugfixes and improvements into a new version once he finds the time.
User avatar
ameisez
Registered User
Posts: 1166
Joined: Sun Nov 04, 2007 7:04 am

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by ameisez »

OK.. got to hang on to that :)

Thanks for the info.
PHPBB on HOSTGATOR SERVER. MY PERSONAL CHOICE ;)
Need phpBB images and buttons? HIRE ME
my MOD: BB3 Media Player | a phpbb based media player
User avatar
gara
Registered User
Posts: 40
Joined: Wed Mar 12, 2008 4:10 am
Location: Colombia
Contact:

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by gara »

Great mod, thank you =)
Nueva Comunidad

PaginaLatinos.Com Aqui
PaginaLatinos.Com Aqui
Vitaliy21
Registered User
Posts: 11
Joined: Mon Mar 30, 2009 4:45 pm

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by Vitaliy21 »

Hello! You may like to make a button thanks to work without reloading the page? Ie at javasript
User avatar
Mahoney
Registered User
Posts: 196
Joined: Sun Mar 16, 2008 4:07 pm
Contact:

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by Mahoney »

Hello
MartectX wrote:
ameisez wrote:Is this still in active development or nearly ABD?
I asked Mahony on the German support forums and he promised he'd join all bugfixes and improvements into a new version once he finds the time.
for your information
I will, once i finds the time, the MOD update.

best regards Mahony
User avatar
ameisez
Registered User
Posts: 1166
Joined: Sun Nov 04, 2007 7:04 am

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by ameisez »

Will wait for that.. thanks for the info ;)
PHPBB on HOSTGATOR SERVER. MY PERSONAL CHOICE ;)
Need phpBB images and buttons? HIRE ME
my MOD: BB3 Media Player | a phpbb based media player
User avatar
Mahoney
Registered User
Posts: 196
Joined: Sun Mar 16, 2008 4:07 pm
Contact:

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by Mahoney »

Hello
spaceace wrote:found a small problem...

when a user has been deleted from the board and all posts are kept and you view one of that users posts, this error comes up
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1486: Undefined index: thanks
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1487: Undefined index: thanked
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1487: Undefined index: thanked
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1488: Undefined index: thanks_post
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1488: Undefined index: thanks_post
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3840: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3842: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3843: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3844: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)
Open includes/functions_user.php

Search

Code: Select all

function user_delete($mode, $user_id, $post_username = false)
{
    global $cache, $config, $db, $user, $auth;
    global $phpbb_root_path, $phpEx; 
Add after

Code: Select all

//Begin Thanks Post MOD
    $sql = 'DELETE
        FROM ' . THANKS_TABLE . '
    WHERE thanks_from = ' . $user_id;
    $db->sql_query($sql);
    //End Thanks Post MOD
Thus, the entries of a user in the table phpbb_thanks removed when the user is deleted.
Hello! You may like to make a button thanks to work without reloading the page? Ie at javasript
No, this is not planned.


best regards Mahoney
User avatar
spaceace
Registered User
Posts: 1999
Joined: Wed Jan 30, 2008 8:50 pm
Contact:

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by spaceace »

Mahoney wrote:Hello
Open includes/functions_user.php

Search

Code: Select all

function user_delete($mode, $user_id, $post_username = false)
{
    global $cache, $config, $db, $user, $auth;
    global $phpbb_root_path, $phpEx; 
Add after

Code: Select all

//Begin Thanks Post MOD
    $sql = 'DELETE
        FROM ' . THANKS_TABLE . '
    WHERE thanks_from = ' . $user_id;
    $db->sql_query($sql);
    //End Thanks Post MOD
Thus, the entries of a user in the table phpbb_thanks removed when the user is deleted.
thanks. one more question about this issue. the user that had been deleted, was deleted before i even had this mod installed, so that username would have never been in the thanks mod table. will this fix still correct that issue?
User avatar
Mahoney
Registered User
Posts: 196
Joined: Sun Mar 16, 2008 4:07 pm
Contact:

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by Mahoney »

Hello
If the user has been deleted before you installed the fix, then manually delete the records of the user (in the table phpbb_thanks).

best regards Mahoney
User avatar
spaceace
Registered User
Posts: 1999
Joined: Wed Jan 30, 2008 8:50 pm
Contact:

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by spaceace »

Mahoney wrote:Hello
If the user has been deleted before you installed the fix, then manually delete the records of the user (in the table phpbb_thanks).

best regards Mahoney
that's not what i mean :lol:

the member was removed almost 6 months prior to installing the mod "[DEV] Thank Post Mod (hide MOD compatible ) 0.2.0". that is what i meant ;)

unfortunately i have changed the author of all of that members posts, so now i can't even test the fix :roll:
AquariusPL
Registered User
Posts: 16
Joined: Mon Aug 25, 2008 10:31 am

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by AquariusPL »

Mahoney, would you look in code for a while?
the problem is, that post_id and topic_id are defined from var

Code: Select all

// Initial var setup
$forum_id	= request_var('f', 0);
$topic_id	= request_var('t', 0);
$post_id	= request_var('p', 0);
so... if someone gave a 'thanks' will see hidden message
but... when he comes to the topic later and look up hidden message - is still hidden, cause
var is like:

Code: Select all

viewtopic.php?f=163&t=3538&view=unread#unread
there's no post_id in there

and we get 'thanks' like this:

Code: Select all

$sql = 'SELECT thanks_from
   FROM ' . THANKS_TABLE . '
   WHERE post_id = ' . $post_id . '
	 AND thanks_from = '. $user->data['user_id'];
do you have any solution to this? I've tried, but couldn't find any
User avatar
Garettyrox
Registered User
Posts: 94
Joined: Mon Feb 18, 2008 9:28 pm
Location: Missouri, USA
Contact:

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by Garettyrox »

I have enabled this MOD on all of my forums. I still cannot see the Thank Post image or anything.
User avatar
Mahoney
Registered User
Posts: 196
Joined: Sun Mar 16, 2008 4:07 pm
Contact:

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by Mahoney »

Hello
AquariusPL wrote:so... if someone gave a 'thanks' will see hidden message
but... when he comes to the topic later and look up hidden message - is still hidden, cause
Try this
  • SQL:

    Code: Select all

    ALTER TABLE `phpbb_thanks` ADD `topic_id` mediumint(8) unsigned NOT NULL DEFAULT '0';
  • open viewtopic.php
    • Search:

      Code: Select all

      // Check if the topic viewer has posted in a topic
      $unhide = false;
      $sql = 'SELECT post_thanked
         FROM ' . POSTS_TABLE . '
         WHERE post_id = ' . $post_id;
      $result = $db->sql_query($sql);
      $post_thanked = $db->sql_fetchfield('post_thanked');
      $db->sql_freeresult($result);
      if ($user->data['user_id'] != ANONYMOUS)
      {
         // If moderator or admin, skip reply check, auto unhide
         if ($auth->acl_get('m_', $forum_id))
         {
            $unhide = true;
         }
         
         else if ($post_thanked > 0)
         {
            $unhide = true;
         }
         else
         {
         $sql = "SELECT poster_id, topic_id
            FROM " . POSTS_TABLE . "
            WHERE topic_id = $topic_id
            AND poster_id = " . $user->data['user_id'];
      
         $result = $db->sql_query($sql);
         $unhide = $db->sql_affectedrows($result) ? true : false;
         $db->sql_freeresult($result);
         }
      }
      Replace with

      Code: Select all

      // Unhide Check
      $unhide = false;
      if ($user->data['user_id'] != ANONYMOUS)
      {
         // If moderator or admin, skip reply check, auto unhide
         if ($auth->acl_get('m_', $forum_id))
         {
            $unhide = true;
         }
         else
         {
      	   // Check if the topic viewer has said thanks in that topic
      	   $sql = "SELECT topic_id, thanks_from
      		  FROM " . THANKS_TABLE . "
      		  WHERE topic_id = $topic_id
      		  AND thanks_from = " . $user->data['user_id'];
      
      	   $result = $db->sql_query($sql);
      	   $unhide = $db->sql_affectedrows($result) ? true : false;
      	   $db->sql_freeresult($result);
      
      	   // Check if the topic viewer has posted in that topic
      	   if ($unhide == false) 
      	   {
      	      $sql = "SELECT poster_id, topic_id
      		     FROM " . POSTS_TABLE . "
      		     WHERE topic_id = $topic_id
      		     AND poster_id = " . $user->data['user_id'];
      
      	      $result = $db->sql_query($sql);
      	      $unhide = $db->sql_affectedrows($result) ? true : false;
      	      $db->sql_freeresult($result);
             }
         }
      }
    • Search:

      Code: Select all

      'U_THANKS'			=> (!$give_thanks) ? append_sid("{$phpbb_root_path}thanks.$phpEx", 'p=' . $row['post_id'] . '&mode=thanks') : append_sid("{$phpbb_root_path}thanks.$phpEx", 'p=' . $row['post_id'] . '&mode=remove'),
      Replace with:

      Code: Select all

      'U_THANKS'			=> (!$give_thanks) ? append_sid("{$phpbb_root_path}thanks.$phpEx", 'p=' . $row['post_id'] . '&t=' . $topic_id .'&mode=thanks') : append_sid("{$phpbb_root_path}thanks.$phpEx", 'p=' . $row['post_id'] . '&mode=remove'),
  • thanks.php öffnen.
    • Search:

      Code: Select all

      $post_id	= request_var('p', 0);
      Add after:

      Code: Select all

      $topic_id	= request_var('t', 0);
    • Search:

      Code: Select all

      'post_id'		=> $post_id,
      Add after:

      Code: Select all

      'topic_id'		=> $topic_id,
I have enabled this MOD on all of my forums. I still cannot see the Thank Post image or anything.
Clear the cache.


best regards Mahoney
Chrissylynn1993
Registered User
Posts: 14
Joined: Thu Mar 26, 2009 10:48 pm

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by Chrissylynn1993 »

Is there any word on when all of this will be in an update? I have found it quite daunting to try and go through this entire thread and make sure that I have all of the code changes changed a second or third time.
Locked

Return to “[3.0.x] MODs in Development”