Bump a Thread [Paid] [Deleted]

@Rigel Kentaurus

How about making it so a user can bump more than once for a particular forum/thread? Say I have a post in Forum A and a post in Forum B that I need to bump. This add-on will currently only allow me to bump one or the other.
 
Is there any way to stylize the "Bump" button apart from the rest of the buttons?

EDIT: Figured it out on my own. For anyone else interested, just add this to your EXTRA.css file.

Code:
/* BUMP BUTTON */
.privateControls a.item.control.Bump
{
background-color: #6BC945;
color: #FFF !important;
border: 1px solid black;
border-radius: 4px;
padding: 4px;
}

Expanding on this... how would I go about adding a font awesome icon in front of the "bump" postbit link? :)

Figured it out. To add a font awesome icon in front of your "bump" postbit link, just replace the xfa_bump_thread_option template with this:

Code:
<a href="{xen:link threads/bump, $thread}" class="item control Bump"><i class="fa fa-arrow-up"></i>{xen:phrase xfa_bump_thread_bump}</a>
 
Last edited:
Rigel Kentaurus updated Bump a Thread with a new update entry:

1.2.0 Modernized the add-on for XenForo 1.3: Template modifications

This add-on was first developed during the XenForo 1.0 times, and was using the old template hooks. On XenForo 1.2, template modifications were introduced, which deprecated to a certain extent the template hooks.

The add-on now uses template modifications, which also enables better positioning of the "Bump Thread" option. Instead of the first post, it is now localized INSIDE the Thread Tools options (the one that has edit title).

Also, every time a user a thread is bumped, it will be added to...

Read the rest of this update entry...
 
I believe that there is a bug in an older version of this addon. I found a solution and am posting it here for the benefit of anyone else who might be in the same bind.

Originally, I thought that the problem was mine rather than with the addon, so I drafted a post about it in a general forum rather than here. I'm pasting that draft here:
Hello,

Everything seems to be working well on my forum, but when I recently tried to uninstall an addon I got a server error. I checked the specific line of code where the error was and I believe that the fault is mine rather than with the addon author, as the code being called is quite elementary.

Specifically, it looks like a security issue due to a misconfigured MySQL on my server. I recently migrated to a new server, and I bet that whatever script brought everything over didn't set things up properly.

I know that convention dictates that I am supposed to blame the addon developer for everything and try to get them solve all of my problems, but I really suspect the problem is on my end. ;) I hope I put this in the right subforum.

Anyway, here is the error from the XF error log:
Code:
Server Error Log
Error Info
ErrorException: Fatal Error: Call to a member function query() on a non-object - library/XfAddOns/BumpThread/Install/Install.php:31
Generated By: Forest, 57 minutes ago
Stack Trace

#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}

Request State

array(3) {
  ["url"] => string(69) "http://www.myforum.org/forum/admin.php?add-ons/xfa_bump_thread/delete"
  ["_GET"] => array(1) {
    ["add-ons/xfa_bump_thread/delete"] => string(0) ""
  }
  ["_POST"] => array(2) {
    ["_xfConfirm"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
  }
}
Line 31 of Install.php is the one that does "$db->query("DROP TABLE xfa_bump_thread");" :
Code:
        /**
         * Deletes the privacy fields
         */
        public static function uninstall()
        {
                $db->query("DROP TABLE xfa_bump_thread");
        }
Pretty tame stuff, eh? The table in question also seems quite harmless:
Code:
mysql> select * from xfa_bump_thread;
+---------+------------------+----------------+
| user_id | last_bump_thread | last_bump_date |
+---------+------------------+----------------+
|       6 |             7030 |     1421249747 |
|     555 |             3711 |     1396631521 |
|     177 |             4711 |     1403167016 |
+---------+------------------+----------------+
3 rows in set (0.00 sec)
For the record, the addon in question worked very well. I just don't need it any more because AndyB's Change Date addon provides essentially the same functionality for my purposes.

Wait a second.... hmmm....

Why isn't there a "$db = XenForo_Application::getDb();" line in the uninstall method?
UPDATE: I added the getDb() line above and was able to uninstall the addon with no problem.​

The bottom line is that I updated a PHP file and was able to uninstall with no problem. I'll paste the PHP file that I used below, but it comes with no warranties at all. It seems to have worked for a charm like me, but your mileage may vary. Hopefully the developer can investigate and provide a definitive answer.

Here is what I did. I replaced library/XfAddOns/BumpThread/Install/Install.php with the following:
Code:
<?php

class XfAddOns_BumpThread_Install_Install
{

        /**
         * Create the tables as needed by this hack
         */
        public static function install($installedAddon)
        {
                $version = is_array($installedAddon) ? $installedAddon['version_id'] : 0;
                if ($version < 110)
                {
                        $db = XenForo_Application::getDb();
                        $db->query("
                                CREATE TABLE xfa_bump_thread
                                (
                                        user_id int not null primary key,
                                        last_bump_thread int not null,
                                        last_bump_date int not null
                                )
                        ");
                }
        }

        /**
         * Deletes the privacy fields
         */
        public static function uninstall()
        {
                $db = XenForo_Application::getDb();
                $db->query("DROP TABLE xfa_bump_thread");
        }

}
After that, the addon uninstalled like a charm. Hopefully, there won't be problems down the road, but the line that I added, "$db = XenForo_Application::getDb();" seems "pretty tame." Famous last words...
 
I believe that there is a bug in an older version of this addon. I found a solution and am posting it here for the benefit of anyone else who might be in the same bind.

Originally, I thought that the problem was mine rather than with the addon, so I drafted a post about it in a general forum rather than here. I'm pasting that draft here:
Hello,

Everything seems to be working well on my forum, but when I recently tried to uninstall an addon I got a server error. I checked the specific line of code where the error was and I believe that the fault is mine rather than with the addon author, as the code being called is quite elementary.

Specifically, it looks like a security issue due to a misconfigured MySQL on my server. I recently migrated to a new server, and I bet that whatever script brought everything over didn't set things up properly.

I know that convention dictates that I am supposed to blame the addon developer for everything and try to get them solve all of my problems, but I really suspect the problem is on my end. ;) I hope I put this in the right subforum.

Anyway, here is the error from the XF error log:
Code:
Server Error Log
Error Info
ErrorException: Fatal Error: Call to a member function query() on a non-object - library/XfAddOns/BumpThread/Install/Install.php:31
Generated By: Forest, 57 minutes ago
Stack Trace

#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}

Request State

array(3) {
  ["url"] => string(69) "http://www.myforum.org/forum/admin.php?add-ons/xfa_bump_thread/delete"
  ["_GET"] => array(1) {
    ["add-ons/xfa_bump_thread/delete"] => string(0) ""
  }
  ["_POST"] => array(2) {
    ["_xfConfirm"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
  }
}
Line 31 of Install.php is the one that does "$db->query("DROP TABLE xfa_bump_thread");" :
Code:
        /**
         * Deletes the privacy fields
         */
        public static function uninstall()
        {
                $db->query("DROP TABLE xfa_bump_thread");
        }
Pretty tame stuff, eh? The table in question also seems quite harmless:
Code:
mysql> select * from xfa_bump_thread;
+---------+------------------+----------------+
| user_id | last_bump_thread | last_bump_date |
+---------+------------------+----------------+
|       6 |             7030 |     1421249747 |
|     555 |             3711 |     1396631521 |
|     177 |             4711 |     1403167016 |
+---------+------------------+----------------+
3 rows in set (0.00 sec)
For the record, the addon in question worked very well. I just don't need it any more because AndyB's Change Date addon provides essentially the same functionality for my purposes.

Wait a second.... hmmm....

Why isn't there a "$db = XenForo_Application::getDb();" line in the uninstall method?
UPDATE: I added the getDb() line above and was able to uninstall the addon with no problem.​

The bottom line is that I updated a PHP file and was able to uninstall with no problem. I'll paste the PHP file that I used below, but it comes with no warranties at all. It seems to have worked for a charm like me, but your mileage may vary. Hopefully the developer can investigate and provide a definitive answer.

Here is what I did. I replaced library/XfAddOns/BumpThread/Install/Install.php with the following:
Code:
<?php

class XfAddOns_BumpThread_Install_Install
{

        /**
         * Create the tables as needed by this hack
         */
        public static function install($installedAddon)
        {
                $version = is_array($installedAddon) ? $installedAddon['version_id'] : 0;
                if ($version < 110)
                {
                        $db = XenForo_Application::getDb();
                        $db->query("
                                CREATE TABLE xfa_bump_thread
                                (
                                        user_id int not null primary key,
                                        last_bump_thread int not null,
                                        last_bump_date int not null
                                )
                        ");
                }
        }

        /**
         * Deletes the privacy fields
         */
        public static function uninstall()
        {
                $db = XenForo_Application::getDb();
                $db->query("DROP TABLE xfa_bump_thread");
        }

}
After that, the addon uninstalled like a charm. Hopefully, there won't be problems down the road, but the line that I added, "$db = XenForo_Application::getDb();" seems "pretty tame." Famous last words...
Thanks, that uninstall routine has been fixed in the most recent version

And yes, that table can be deleted, it's just history of what has been bumped. I intentionally prefix all my tables with "xfa" so it is clear that they are not the XenForo "xf" tables
 
Top Bottom