Skip to content

Commit

Permalink
fixes #324
Browse files Browse the repository at this point in the history
  • Loading branch information
SvePu committed Dec 28, 2022
1 parent 8707d1f commit 4b72cdb
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions upload/inc/plugins/thankyoulike.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function thankyoulike_info()

$info_desc = '';

if(is_array($plugins_cache) && is_array($plugins_cache['active']) && $plugins_cache['active'][$codename])
if(is_array($plugins_cache) && is_array($plugins_cache['active']) && isset($plugins_cache['active'][$codename]))
{
$msg = "<a href=\"".htmlspecialchars_uni($changelog_url)."\">".$lang->tyl_view_changelog."</a>";
if(!empty($admin_session['data']['tyl_plugin_info_upgrade_message']))
Expand Down Expand Up @@ -1208,6 +1208,10 @@ function tyl_get_installed_version()
global $db;
$prefix = 'g33k_thankyoulike_';

$options = array(
"limit" => 1
);

$query = $db->simple_select($prefix."stats", "*", "title='version'", $options);
$version = $db->fetch_array($query);
if ($version)
Expand Down Expand Up @@ -2049,6 +2053,8 @@ function tyl_build_post_likers_display(&$post, $tyls, $tyled, $count) {

$prefix = 'g33k_thankyoulike_';

$unapproved_shade = '';

// Are we using thanks or like? Setup titles
if($count == 1)
{
Expand Down Expand Up @@ -2137,6 +2143,8 @@ function tyl_build_post_likers_display(&$post, $tyls, $tyled, $count) {

$forbidden_due_to_first_thread_post_restriction = tyl_is_forbidden_due_to_first_thread_post_restriction($post['fid'], $thread, $post['pid']);
$is_member_of_hidden_group = (is_member($mybb->settings[$prefix.'hidelistforgroups']) || $mybb->settings[$prefix.'hidelistforgroups'] == "-1");

$post['thankyoulike'] = "";
if($count>0 && !$forbidden_due_to_first_thread_post_restriction && !$is_member_of_hidden_group)
{
// We have thanks/likes to show
Expand Down Expand Up @@ -2168,6 +2176,8 @@ function thankyoulike_postbit(&$post)

$lang->load("thankyoulike");

$unapproved_shade = '';

if ($mybb->settings[$prefix.'enabled'] == "1")
{
// Set up stats in postbit
Expand Down Expand Up @@ -2204,6 +2214,10 @@ function thankyoulike_postbit(&$post)
}

if (!tyl_build_post_likers_display($post, $tyls, $tyled, $count)) {
$tyl_title_display = "";
$tyl_title_display_collapsed = "display: none;";
$tyl_data_display = "";
$tyl_expcol = "";
$lang->tyl_title = '';
$lang->tyl_title_collapsed = '';
$post['tyl_display'] = "display: none;";
Expand Down Expand Up @@ -3338,10 +3352,10 @@ function thankyoulike_delete_user()

function thankyoulike_wol_activity($user_activity)
{
global $user;
global $user, $location;

$split_loc = explode(".php", $user_activity['location']);
if($split_loc[0] == $user['location'])
if(isset($user['location']) && $split_loc[0] == $user['location'])
{
$filename = '';
}
Expand Down

0 comments on commit 4b72cdb

Please sign in to comment.