Welcome to Geeklog, Anonymous Friday, March 29 2024 @ 05:07 am EDT

Geeklog Forums

Customize admin's searchmenu


Status: offline

OMAL

Forum User
Regular Poster
Registered: 12/06/17
Posts: 107
Article.php under admin displays select menu.
Text Formatted Code
<form action="{form_url}" method="post" class="uk-form">
  <div class="admin-list-search">
    <div class="search-part">
      {filter}
    </div>

I want to customize this parameter, "filter". Because the website has hundreds topics and thousand of stories, default behavior is not suitable for the situation.

1. When admin is logged-in, the specific topic that is used most by admin, should be placed first of the drop-down list.
2 . When other members are logged-in, only the topic of the logged-in member should be listed.

How can I do that?
I tried to customize TOPIC_getTopicListSelect() function, but I coudn't understand it enough and didn't worked.

 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
Location:Canada
1. When admin is logged-in, the specific topic that is used most by admin, should be placed first of the drop-down list.

How is that to be decided?

2 . When other members are logged-in, only the topic of the logged-in member should be listed.

It should only list topics they have access to. I have a feeling this includes both read and edit access.
One of the Geeklog Core Developers.
 Quote

Status: offline

OMAL

Forum User
Regular Poster
Registered: 12/06/17
Posts: 107
Quote by: Laugh

1. When admin is logged-in, the specific topic that is used most by admin, should be placed first of the drop-down list.

How is that to be decided?


In my situation, every active admin frequently uses only one topic, topic A, for posting articles. It doesn't change, it is always topic A. But select options for topics are more than 500 hundreds, so every time they have to search to select topic A from the hundreds of list. What I want to do is to place the topic A at the top of the list. So I want some advice to do that.

I think I could do that with dirty hack like picking up topic A from $_TOPIC and array shifting it. But I want to know easier way, if possible.


2 . When other members are logged-in, only the topic of the logged-in member should be listed.

It should only list topics they have access to. I have a feeling this includes both read and edit access.[/p]

I just want to know if you have some way to list options for topics the member have access to.

Thanks.
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
Location:Canada
It does only list topics that the user has access too, Topics that the user has read only (with no edit) access and topics that they have Edit (that includes read) access. If the user does not have access to the topic at all, it will not be displayed.

That being said (and maybe a feature request here for a checkbox in the search to toggle this option), if you only want to show topics for the filter that the user has edit access only

then try changing the line found in the file \admin\article.php and the function liststories (around line 122)

Text Formatted Code
$seltopics = TOPIC_getTopicListSelect($current_topic, 2);


changing it to:

Text Formatted Code
$seltopics = TOPIC_getTopicListSelect($current_topic, 2, false, '', false, 0, 2);


should show only topics they have edit access to. I think this will help since your writers should only have edit access to the topics they write for.

Let me know if this works as I cannot test it at the moment.
One of the Geeklog Core Developers.
 Quote

Status: offline

OMAL

Forum User
Regular Poster
Registered: 12/06/17
Posts: 107
Thanks. I'm sorry to replay late.
I'll try it.
 Quote

Status: offline

OMAL

Forum User
Regular Poster
Registered: 12/06/17
Posts: 107

Let me know if this works as I cannot test it at the moment.[/p]

It didn't work, because your solution has 6 arguments, even though the function defines 6 arguments.

Anyway, I customized article.php and my problem is solved.
Thanks.
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
Location:Canada
Sound good. BTW I did add a feature request for this as well.

https://github.com/Geeklog-Core/geeklog/issues/971

One of the Geeklog Core Developers.
 Quote

All times are EDT. The time is now 05:07 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content