Jump to content

sulervo

Clients
  • Posts

    113
  • Joined

  • Last visited

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Forums

Events

Store

Gallery

Posts posted by sulervo

  1. Type of advertisement: Supply HTML Code 
    Show the advertisement: Just below the page header
    HTML code:

    <script type="text/javascript">
    
    if(window.innerWidth > 1019)
    {
        var forums = ["83", "84", "85", "86"];
        var forum_id = request.id;
        if (forums.includes(forum_id)
        {
            // Desktop tag/code 1
        }
        else
        {
            // Desktop tag/code 2
        }
    }
    else
    {
        var forums = ["83", "84", "85", "86"];
        var forum_id = request.id;
        if (forums.includes(forum_id))
        {
            // Mobile tag/code 1
        }
        else
        {
            // Mobile tag/code 2
        }
    }
    </script>

    There is JavaScript in the field of HTML code.. not even know if it's working but it's the best I can make.

    1. The first "if" = Desktop or mobile.
    2. The second "if" = Two tags available and the forum id defines which one is in use.

    Now I don't know how to get "request.id" so do you have an idea how to solve this? Maybe Extra Condition field would work better?

    @newbie LAC

    Fixed version:

    <script type="text/javascript">
    
    if(window.innerWidth > 1019)
    {
        var forums = [83, 84, 85, 86];
        var forum_id = {expression="(request.app == 'forums' and request.module == 'forums'and request.controller == 'forums' and isset(request.id)) ? request.id : 0"};
        if (forums.includes(forum_id))
        {
            // Desktop tag/code 1
        }
        else
        {
            // Desktop tag/code 2
        }
    }
    else
    {
        var forums = [83, 84, 85, 86];
        var forum_id = {expression="(request.app == 'forums' and request.module == 'forums'and request.controller == 'forums' and isset(request.id)) ? request.id : 0"};
        if (forums.includes(forum_id))
        {
            // Mobile tag/code 1
        }
        else
        {
            // Mobile tag/code 2
        }
    }
    </script>

     

  2. If topic view looks like this it would be nice to have an option to hide sold items. (MYYTY = Sold).

    Would be also nice if users can select hiding only once and it works in every forum. Maybe slide switch above topics or under account settings? So users can also see/unhide sold items.

    Capture.JPG

  3. Is there some trick to hide sold topics without hiding them permanently? Like in topic list view or in search results?

    Maybe a button with a link filter(?) would be good..?

  4. On 24.3.2017 at 7:06 AM, newbie LAC said:

    Use the setting "Extra condition"

    
    {{if \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'topic'}}
        {{$forumId = 0; try { $topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id ); $forumId = $topic->forum_id; } catch( \Exception $e ) {};}}
    {{endif}}
    {{if in_array($forumId, array(3, 4))}}
    1
    {{endif}}

     

    If system select ad which condition is false it shows nothing? Is there possible to determine backup ad which shows if condition doesn't match?

  5. Like this way?

    {{if \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'topic'}}
        {{$forumId = 0; try { $topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id ); $forumId = $topic->forum_id; } catch( \Exception $e ) {};}}
    {{endif}}
    {{if in_array($forumId, array(3, 4))}}
    code
    {{endif}}

    4 hours ago, sulervo said:

    And how I solve category ID? www.foo.bar/forum/2-common/ Thought it's "2" but it's not..

    Actually this number is category ID?

×
×
  • Create New...