Community Features!

Статус
В этой теме нельзя размещать новые ответы.

byEvanthe

Интересующийся
Участник
Сообщения
103
Розыгрыши
0
Решения
1
Репутация
0
Реакции
6
Баллы
380
Hello, it is possible to put in Community Board link and when i press on it, to open browser ?

Thank you !
 
Решение
Locate your CommunityBoard handler (under whichever name it is constructed on your files, I am not familiar with Sunrise), add a new bypass allowance where your other bypasses are registered:


Java:
/** Should be looking similar to the below override **/
@Override
    public String[] getBypassCommands()
    {
        return new String[]
        {
                "_bbshome", "_bbsabout", "_bbspage", "_bbslink" // <- example
        };
    }

Then add a functionality to this bypass action:


Java:
/** again, you should be looking at a something similar (might need adjustments as per your sources) but the general idea is the same **/
else if (command.startsWith("_bbslink"))
        {
            final var st = new StringTokenizer(command...
Java:
import java.awt.Desktop;
...

if (Desktop.isDesktopSupported())
{
    Desktop desktop = Desktop.getDesktop();

        if (desktop.isSupported(Desktop.Action.BROWSE))
        }
            desktop.browse(new URI("https://google.com"));
        }
}
 
Java:
import java.awt.Desktop;
...

if (Desktop.isDesktopSupported())
{
    Desktop desktop = Desktop.getDesktop();

        if (desktop.isSupported(Desktop.Action.BROWSE))
        }
            desktop.browse(new URI("https://google.com"));
        }
}
и нафига ему пример того как это можно сделать в AWT?
 
Последнее редактирование:
Потому что юзать
Код:
[url=][/url]
— это слишком мейнстримно. Kappa))
 
Оверпостинг
I wanted to ask if it's possible in Community Board. The link to be specifyed in html...:/

My project it is based on L2jSunrise ( High Five ).
 
Последнее редактирование модератором:
To be shortly. What i have to do?
 
Locate your CommunityBoard handler (under whichever name it is constructed on your files, I am not familiar with Sunrise), add a new bypass allowance where your other bypasses are registered:


Java:
/** Should be looking similar to the below override **/
@Override
    public String[] getBypassCommands()
    {
        return new String[]
        {
                "_bbshome", "_bbsabout", "_bbspage", "_bbslink" // <- example
        };
    }

Then add a functionality to this bypass action:


Java:
/** again, you should be looking at a something similar (might need adjustments as per your sources) but the general idea is the same **/
else if (command.startsWith("_bbslink"))
        {
            final var st = new StringTokenizer(command, ":");
            st.nextToken();
            final var url_link = st.nextToken();
            if (Desktop.isDesktopSupported())
            {
                Desktop desktop = Desktop.getDesktop();

                   if (desktop.isSupported(Desktop.Action.BROWSE))
                   }
                    desktop.browse(new URI("https://" + url_link));
                   }
            }
        }

Usage:

HTML:
<a action="bypass _bbslink:yoursite.com">Your Link Name</a>
 
Решение
Everything it's working! Thank you very very much all of you !
 
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху Снизу