[
and ]
which lie between the prefix in the page title in the browserCode: Select all
/**
* Get the parsed prefix for the current topic, output it to the template
* Also gets a plaintext version for the browser page title
*
* @param Event $event Event object
* @return null
*/
public function get_viewtopic_topic_prefix($event)
{
$event['page_title'] = $this->load_prefixes_topic($event, 'topic_data') . $event['page_title'];
}
Code: Select all
$event['page_title'] = '[' . $this->load_prefixes_topic($event, 'topic_data') . ']' . $event['page_title'];
What version of phpBB are you using? I have no trouble installing the extension.Hartenheer wrote:I have tried installing on test forum
For a beginner impossible
understand little of the explanation
I download programs, and Extensions Manager read this
Getting the latest version failed.
The requested file, prefix.json, could not be found
What version of phpBB are you using? I have no trouble installing the extension.[/quote]Hartenheer wrote:I have tried installing on test forum
For a beginner impossible
understand little of the explanation
I download programs, and Extensions Manager read this
Getting the latest version failed.
The requested file, prefix.json, could not be found
Hi, David!imkingdavid wrote:SalazarAG,
Yes, if you change the line to look like this it should work:
Code: Select all
$event['page_title'] = '[' . $this->load_prefixes_topic($event, 'topic_data') . ']' . $event['page_title'];
What version of phpBB are you using? I have no trouble installing the extension.Hartenheer wrote:I have tried installing on test forum
For a beginner impossible
understand little of the explanation
I download programs, and Extensions Manager read this
Getting the latest version failed.
The requested file, prefix.json, could not be found
Code: Select all
$prefixes_array = array();
foreach ($topic_prefixes as $instance)
{
$vars = [];
// A URL to a viewforum view filtered by the prefix
if ($this->request->variable('f', 0))
{
$vars['URL'] = append_sid($this->root_path . 'viewforum.php', ['f' => $this->request->variable('f', 0), 'prefix' => $instance['prefix']]);
}
$prefixes_array[] = $instance->parse($block, $vars, $return_parsed) . ' ';
}
$return_string = implode(' ', $prefixes_array);
If you go to the ACP and look under the Posting tab, you don't see anything about Topix Prefixes on the left navigation?Hartenheer wrote:I install, activate
Then see nothing
It is difficult to work
imkingdavid wrote:@SalazarAG - It's because of this line: https://github.com/imkingdavid/prefixed ... r.php#L255
You may be able to fix it by changing the code block from 246-256 in that file to this:I'll try to remember to fix that in the next commit.Code: Select all
$prefixes_array = array(); foreach ($topic_prefixes as $instance) { $vars = []; // A URL to a viewforum view filtered by the prefix if ($this->request->variable('f', 0)) { $vars['URL'] = append_sid($this->root_path . 'viewforum.php', ['f' => $this->request->variable('f', 0), 'prefix' => $instance['prefix']]); } $prefixes_array[] = $instance->parse($block, $vars, $return_parsed) . ' '; } $return_string = implode(' ', $prefixes_array);
If you go to the ACP and look under the Posting tab, you don't see anything about Topix Prefixes on the left navigation?Hartenheer wrote:I install, activate
Then see nothing
It is difficult to work
$event['page_title'] = '[' . $this->load_prefixes_topic($event, 'topic_data') . ']' . $event['page_title'];
Code: Select all
$topic_prefixes = $this->load_prefixes_topic($event, 'topic_data');
if (!empty($topic_prefixes))
{
$event['page_title'] = '[' . $topic_prefixes . ']' . $event['page_title'];
}
It worked!!!imkingdavid wrote:Oh, my mistake.
For this code:
$event['page_title'] = '[' . $this->load_prefixes_topic($event, 'topic_data') . ']' . $event['page_title'];
You should change it to this:Let me know if that works.Code: Select all
$topic_prefixes = $this->load_prefixes_topic($event, 'topic_data'); if (!empty($topic_prefixes)) { $event['page_title'] = '[' . $topic_prefixes . ']' . $event['page_title']; }
It's simpleHartenheer wrote:I give up.
Deleted extension on my test forum.
Do not understand how it works