vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Add-On Releases - v3 Arcade Add To Favourites In Game Play Area (https://vborg.vbsupport.ru/showthread.php?t=262861)

Gemma 04-28-2011 10:00 PM

v3 Arcade Add To Favourites In Game Play Area
 
1 Attachment(s)
I've noticed that there is no way of adding a game to your favourites whilst playing the game, at present you can only add via the category list or when submitting a score. Personally I think adding when playing makes more sense.

To do this, open your arcade.php file and find:

Code:

// ############################################################################
// Play a game
// ############################################################################
if ($_REQUEST['do'] == 'play')
{
    $vbulletin->input->clean_array_gpc('r', array(
        'challengeid' => TYPE_UINT,
        'gameid' => TYPE_UINT,
        'resolution' => TYPE_INT,
        'tid' => TYPE_UINT
    ));

Below that add:

Code:

$favcache = unserialize($vbulletin->userinfo['favcache']);
    $show['fav'] = ($favcache[$vbulletin->GPC['gameid']]);

// set favorites
    $favcache = unserialize($vbulletin->userinfo['favcache']);
    if (!is_array($favcache))
    {
        $favcache = array();
    }

Save the file and re-upload

In your v3ARCADE_PLAY template search for:

Code:

<div class="blockrow" align="center">
                        <vb:if condition="!$show['challenge'] AND !$show['tournament']">
                            <img src="{vb:raw vboptions.arcadeimages}/backtip.gif" border="0" alt="" />
                        <vb:else />
                            {vb:rawphrase challenge_warning}
                        </vb:if>
                    </div>

Below that add:

Code:

<!-- favorites -->
                <div class="blockrow" align="center">
                            <vb:if condition="$show['fav']">
                                <img src="{vb:raw vboptions.arcadeimages}/subfav.gif" id="fav_{vb:raw game.gameid}" class="point" onclick="dofav({vb:raw game.gameid})" alt="{vb:rawphrase sub_favorite}" border="0" />
                            <vb:else />
                                <img src="{vb:raw vboptions.arcadeimages}/addfav.gif" id="fav_{vb:raw game.gameid}" class="point" onclick="dofav({vb:raw game.gameid})" alt="{vb:rawphrase add_favorite}" border="0" />
                            </vb:if>
                            <span id="favlabel" onclick="dofav({vb:raw game.gameid})" style="cursor:pointer; text-decoration: underline">
                                <vb:if condition="$show['fav']">{vb:rawphrase sub_favorite}<vb:else />{vb:rawphrase add_favorite}</vb:if>
                            </span>
                        </div>
                                <!-- end of favorites -->

If anyone wants to further develop any of my addons, you are free to do so.

Rckcrwlr 04-30-2011 09:09 AM

Tagged

MortysTW 05-02-2011 05:22 PM

Nice!

TEMPESTADE 05-03-2011 07:38 AM

very nice!!

CK 05-30-2011 04:08 PM

Added great, thanks.

I wonder if anyone will be picking any of this up in Gemmas absence?

nacaruncr 05-31-2011 02:21 AM

Could you do it for ibProArcade?
It's awesome modification :D thanks :D

Gemma 05-31-2011 05:42 PM

Quote:

Originally Posted by nacaruncr (Post 2201927)
Could you do it for ibProArcade?

No but I'm sure someone who uses IbProArcade could do something similar

nacaruncr 05-31-2011 07:39 PM

ok thank you :D
I going to try it... I only stand don't destroy it XD jajajajaa

thank you ;)

steve1966 08-17-2011 07:06 PM

working perfect thank you

doubleclick 05-23-2012 07:55 PM

I added this, and you're right, this is exactly where it should be!

I'm having one issue with this in that the phrase never changes from "Add to Favorites" This is whether I click the icons or the words. The icons switch back and forth as they should, and so does the alt text. But the phrase stays the same.

I just upgraded to 4.2.0 so I don't know if this is just a coincidence or not, but worth mentioning.

---just noticed that the words actually staying the same no matter what the phrase is, depending on where it starts after a page load. When page refreshes, the icon, words, and alt text all match and correct. However, from then on, clicking doesn't change the words.

Gemma 05-23-2012 09:09 PM

Quote:

Originally Posted by doubleclick (Post 2332076)
I added this, and you're right, this is exactly where it should be!

I'm having one issue with this in that the phrase never changes from "Add to Favorites" This is whether I click the icons or the words. The icons switch back and forth as they should, and so does the alt text. But the phrase stays the same.

I just upgraded to 4.2.0 so I don't know if this is just a coincidence or not, but worth mentioning.


---just noticed that the words actually staying the same no matter what the phrase is, depending on where it starts after a page load. When page refreshes, the icon, words, and alt text all match and correct. However, from then on, clicking doesn't change the words.

It works as it was designed to work. That's how it is throughout the arcade, the link doesn't change dynamically, it will only change between the two phrases once you revisit the page or another page where favourites can be added or removed.

I guess when the arcade was designed they weren't expecting someone being indecisive about whether a game was a favourite or not and rapidly clicking between adding and removing a game.

doubleclick 05-23-2012 10:32 PM

Thanks for the explanation. I don't think people are indecisive as to whether they want a game to be a favorite. Having a link that says one thing yet means the opposite can be confusing to the users. Creating a workaround is easy enough, which is to simply create a button image that says add or remove favorite, then get rid of the text. I just thought it was a mistake that you weren't aware of and would want to correct. Your "it's a feature not a bug" explanation is good enough for me.

Please understand that I wasn't criticizing you free contribution, your coding skills, or the v3arcade design overall. Just bringing information to the discussion.

(That and the fact that after fooling around with the if statements for almost an hour today with no luck, I was very curious as to how it was possible to make it work that way just from a sheer intellectual level. I was feeling defeated by a few lines of code.)

doubleclick 05-24-2012 10:16 AM

1 Attachment(s)
On the off chance that someone else wants this change, I've attached a couple of replacement images I whipped up for my install. Just remove the portion of code below from Gemma's, then upload the two gifs.

Code:

<span id="favlabel" onclick="dofav({vb:raw game.gameid})" style="cursor:pointer; text-decoration: underline">
<vb:if condition="$show['fav']">{vb:rawphrase sub_favorite}<vb:else />{vb:rawphrase add_favorite}</vb:if>
                            </span>



All times are GMT. The time now is 06:05 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01484 seconds
  • Memory Usage 1,750KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete