[TH] Trophies [Deleted]

Waindigo updated Trophies by Waindigo with a new update entry:

Version 1.0.2 released

New features:
  • Trophy icons are now cached using image proxy introduced in XF 1.3.
  • Ability to display trophy icons in the user post-bit & on profile page.
  • Options in the ACP and UCP to manage trophy display settings, this can be based on maximum limits or trophy categories.
  • List of usernames detailing who has earned which trophies.
  • Caching of additional trophy data and ability to update this when rebuilding trophy cache in the ACP.
  • Ability to manually award a...

Read the rest of this update entry...
 
Newbie question?

how to get "your trophies" in my profile overview?

View attachment 65804
If you add:
Code:
<li><a href="{xen:link members/trophies, $visitor}" class="OverlayTrigger">{xen:phrase your_trophies}</a></li>
to the template navigation_visitor_tab this will put in a link for you. You will also need to add a phrase called your_trophies as this doesn't currently exist.
 
If you add:
Code:
<li><a href="{xen:link members/trophies, $visitor}" class="OverlayTrigger">{xen:phrase your_trophies}</a></li>
to the template navigation_visitor_tab this will put in a link for you. You will also need to add a phrase called your_trophies as this doesn't currently exist.

thanksalot Waindigo. Great!
 
Thanks for this update! The icons for trohpys doesn'twork for me. They are not visible in the trophy list.

There is also a problem with your new version and [bd] Social Share 1.4.1 when I try to give a specific user a trophy:

Undefined index: bdsocialshare_options

  1. XenForo_Application::handlePhpError() in bdSocialShare/XenForo/Model/Trophy.php at line 9
  2. bdSocialShare_XenForo_Model_Trophy->awardUserTrophy() in Waindigo/Trophies/Extend/XenForo/ControllerAdmin/Trophy.php at line 132
  3. Waindigo_Trophies_Extend_XenForo_ControllerAdmin_Trophy->actionManual() in XenForo/FrontController.php at line 347
  4. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  5. XenForo_FrontController->run() in /var/www/dev/forum.dev.scharesoft.de/admin.php at line 13

EDIT: The user receives the trophy, so I think this is more a problem of Social Share and not the trophy addon.
 
EDIT: The user receives the trophy, so I think this is more a problem of Social Share and not the trophy addon.
Yer, I think that add-on is going to have to fix this issue. If nothing else, @xfrocks should be able to put an extra check on that piece of code and stop the social share feature running in that instance.
 
Another error:
Code:
 ErrorException: Undefined index: trophy_combination_id - library/Waindigo/Trophies/Extend/XenForo/Model/Trophy.php:193

#0 /home/test/public_html/xenforo/library/Waindigo/Trophies/Extend/XenForo/Model/Trophy.php(193): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/test/publ...', 193, Array)
#1 /home/test/public_html/xenforo/library/Waindigo/Trophies/Extend/XenForo/ControllerPublic/Thread.php(20): Waindigo_Trophies_Extend_XenForo_Model_Trophy->prepareTrophyCacheForPosts(Array)
#2 /home/test/public_html/xenforo/library/bdCache/XenForo/ControllerPublic/Thread.php(7): Waindigo_Trophies_Extend_XenForo_ControllerPublic_Thread->actionIndex()
#3 /home/test/public_html/xenforo/library/PostComments/ControllerPublic/Thread.php(8): bdCache_XenForo_ControllerPublic_Thread->actionIndex()
#4 /home/test/public_html/xenforo/library/XenForo/FrontController.php(347): PostComments_ControllerPublic_Thread->actionIndex()
#5 /home/test/public_html/xenforo/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#6 /home/test/public_html/xenforo/index.php(13): XenForo_FrontController->run()
#7 {main}

array(3) {
  ["url"] => string(43) "https://test.org/threads/25546/page-5"
  ["_GET"] => array(1) {
    ["/threads/25546/page-5"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
 
I'm still getting it and just fixed it by using isset.
Code:
    public function prepareTrophyCacheForPosts(array $posts)
    {
        foreach ($posts as $post) {
            if (isset($post['trophy_combination_id']) && $post['trophy_combination_id'] != 0) {
                $trophyCache = unserialize($post['trophy_combination_cache_value']);
                $trophyCache = $this->prepareTrophies($trophyCache);
                $posts[$post['post_id']]['trophyCache'] = $trophyCache;
            }
        }
        return $posts;
    } /* END prepareTrophyCacheForPosts */
Wait couldn't we just use the isset part so it could be:
Code:
    public function prepareTrophyCacheForPosts(array $posts)
    {
        foreach ($posts as $post) {
            if (isset($post['trophy_combination_id'])) {
                $trophyCache = unserialize($post['trophy_combination_cache_value']);
                $trophyCache = $this->prepareTrophies($trophyCache);
                $posts[$post['post_id']]['trophyCache'] = $trophyCache;
            }
        }
        return $posts;
    } /* END prepareTrophyCacheForPosts */
 
In fairness it was set to isset before and that appeared to cause the error, I changed it to !=0 to solve the problem.
Have you rebuilt the trophy cache following installation/upgrading this version?
 
In fairness it was set to isset before and that appeared to cause the error, I changed it to !=0 to solve the problem.
Have you rebuilt the trophy cache following installation/upgrading this version?
I have not but putting both fixed it haha. I can revert it back, rebuild the cache and go back to the same page and see if it happens again.
I think what was causing it was the 'Anonymous' addon on the forum by darkmaster. I recoded it to unset all indexes and only use ones necessary, so I'm guessing it was that.
 
Back
Top Bottom