Skip to main content
Topic: New question about links (developer's perspective) (Read 13489 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

New question about links (developer's perspective)

Hi everybody!

I wonder: from developer's point of view can I create a module, which make weblinks visible only for topic starter and moderations for specified topics?

I prefer to make a workaround and use nginx webserver secure link module in order to make a temp weblinks, but want to know more about ElkArter internals either  :D

Re: New question about links (developer's perspective)

Reply #1

You can create a module which hooks in to the bbcode parser. Then have a permission which allows what you want and check on that or return an empty string if no permission.

Re: New question about links (developer's perspective)

Reply #2

Where in the sources can I get example of BBCodes parser? Point me the right way, please.

Re: New question about links (developer's perspective)

Reply #3

Quote from: Twissell – Where in the sources can I get example of BBCodes parser? Point me the right way, please.

Probably better looking at an addon. https://addons.elkarte.net/bbc/BBC-Move.html

That one is a simple example.

Re: New question about links (developer's perspective)

Reply #4

Hi @tino!

Is there a function to check that some user is topicstarter of topic?
The topic ID might be passed as an argument to that function for example.
The last is just my suggestion. Would you like to advice me?

Re: New question about links (developer's perspective)

Reply #5

You can run a sql query and get the data. That’s probably the most reliable way. The topic id should be available on the bbc parser section either in the $topic global or in context

Re: New question about links (developer's perspective)

Reply #6

Make raw SQL requests inside the modules considered a good practice in ElkArte or you've SQL-wrappers for that?
Unfortunately, I don't see much in the dev documentation.

Re: New question about links (developer's perspective)

Reply #7

Quote from: Twissell – Make raw SQL requests inside the modules considered a good practice in ElkArte or you've SQL-wrappers for that?
Unfortunately, I don't see much in the dev documentation.

You generally put them in the subs files and use the database() instance. Or you can just use the database() instance in the controller if you’re lazy.

Re: New question about links (developer's perspective)

Reply #8

Allow me first of all, @tino, to express heartfelt thanks about your  willingness to help and pretty quick replies :-)

Although all seems to be doable, but I've already changed my approach to the problem.
Details placed below.

Give me please starting point how to implement following idea: I want to attach viewing post content capability of certain post to user speficified in the post's properties or list of users.
I need RTFM-kick.

Re: New question about links (developer's perspective)

Reply #9

I’m not sure I follow?

You can use the permissions to only allow people to view certain boards, is this what you’re looking to do?

Re: New question about links (developer's perspective)

Reply #10

Quote from: tino – I’m not sure I follow?

You can use the permissions to only allow people to view certain boards, is this what you’re looking to do?
Yep, closely to what I want to achieve. Is it possible to implement "view post content" capability to single user or list of them?
And this "viewable" capability links the users to selected post.
Or it's not allowed due to DB schema?

Re: New question about links (developer's perspective)

Reply #11

Could I rewrite the permissions system to get wanted result, couldn't I ?

Re: New question about links (developer's perspective)

Reply #12

I've sent an example in PM, tino