[ABD] [3.1] [pre]fixed - Topic Prefixes extension

Any abandoned Extensions will be moved to this forum.

WARNING: Extensions in this forum are not currently being supported or maintained by the original Extension author. Proceed at your own risk.
Forum rules
IMPORTANT: Extension Development Forum rules

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
Lunaus
Registered User
Posts: 8
Joined: Thu Oct 20, 2016 12:58 am

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by Lunaus »

Alright, works great!
User avatar
Hartenheer
Registered User
Posts: 780
Joined: Fri Jan 23, 2015 12:23 pm
Location: The Netherlands
Name: Willem Hartman
Contact:

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by Hartenheer »

Nice extension, I hope he will soon accommodate existing forums.

I use now trader-master, has been abandoned.
afraid not work in 3.2
Sorry English is not my native language :oops:
regards: Willem

https://bierfijnproevers.nl/bierforum
User avatar
Hartenheer
Registered User
Posts: 780
Joined: Fri Jan 23, 2015 12:23 pm
Location: The Netherlands
Name: Willem Hartman
Contact:

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by Hartenheer »

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
Sorry English is not my native language :oops:
regards: Willem

https://bierfijnproevers.nl/bierforum
User avatar
SalazarAG
Registered User
Posts: 677
Joined: Mon Mar 30, 2015 10:48 am

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by SalazarAG »

Hi imkingdavid ! =)


I know you do not intend to add this feature, but you can help me to add myself? Please.


I refer to the brackets [ and ] which lie between the prefix in the page title in the browser


I know I could add "[" and "]" to create a prefix but use black theme is showing the brackets and I just wanted them in the page title. I found this part of the code in listener.php, I think it is here that change. If it is not too difficult, you can help me with this?

Code: 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'];
	}


Good evening!
I'm sorry for my English. Google Translator does a bad job. :D
User avatar
imkingdavid
Former Team Member
Posts: 2673
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by imkingdavid »

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'];
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.
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
User avatar
Hartenheer
Registered User
Posts: 780
Joined: Fri Jan 23, 2015 12:23 pm
Location: The Netherlands
Name: Willem Hartman
Contact:

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by Hartenheer »

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]


I use 5.6.23
Sorry English is not my native language :oops:
regards: Willem

https://bierfijnproevers.nl/bierforum
User avatar
SalazarAG
Registered User
Posts: 677
Joined: Mon Mar 30, 2015 10:48 am

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by SalazarAG »

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'];
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.
Hi, David!

Thanks a lot for the help!

It worked.

Only one small thing I noticed: It is a blank space between the last bracket "]", see:

Image

It has some way to let the two brackets together the text prefix?
I'm sorry for my English. Google Translator does a bad job. :D
User avatar
Hartenheer
Registered User
Posts: 780
Joined: Fri Jan 23, 2015 12:23 pm
Location: The Netherlands
Name: Willem Hartman
Contact:

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by Hartenheer »

I install, activate
Then see nothing

It is difficult to work
Sorry English is not my native language :oops:
regards: Willem

https://bierfijnproevers.nl/bierforum
User avatar
imkingdavid
Former Team Member
Posts: 2673
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by imkingdavid »

@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:

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);
I'll try to remember to fix that in the next commit.
Hartenheer wrote:I install, activate
Then see nothing

It is difficult to work
If you go to the ACP and look under the Posting tab, you don't see anything about Topix Prefixes on the left navigation?
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
User avatar
Hartenheer
Registered User
Posts: 780
Joined: Fri Jan 23, 2015 12:23 pm
Location: The Netherlands
Name: Willem Hartman
Contact:

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by Hartenheer »

No idea how to run this extension.
Sorry English is not my native language :oops:
regards: Willem

https://bierfijnproevers.nl/bierforum
User avatar
SalazarAG
Registered User
Posts: 677
Joined: Mon Mar 30, 2015 10:48 am

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by SalazarAG »

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:

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);
I'll try to remember to fix that in the next commit.
Hartenheer wrote:I install, activate
Then see nothing

It is difficult to work
If you go to the ACP and look under the Posting tab, you don't see anything about Topix Prefixes on the left navigation?

David worked perfectly. :)

But now something strange has come up kkkkkkkk Now, on topics that do not have prefixes, the brackets appear anyway, see:

Image

This topic has no prefix assigned, so the brackets should not appear.


Hahaha how hard this
I'm sorry for my English. Google Translator does a bad job. :D
User avatar
imkingdavid
Former Team Member
Posts: 2673
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by imkingdavid »

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:

Code: Select all

$topic_prefixes = $this->load_prefixes_topic($event, 'topic_data');
if (!empty($topic_prefixes))
{
    $event['page_title'] = '[' . $topic_prefixes . ']' . $event['page_title'];
}
Let me know if that works.
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
User avatar
Hartenheer
Registered User
Posts: 780
Joined: Fri Jan 23, 2015 12:23 pm
Location: The Netherlands
Name: Willem Hartman
Contact:

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by Hartenheer »

I give up.
Deleted extension on my test forum.
Do not understand how it works
Sorry English is not my native language :oops:
regards: Willem

https://bierfijnproevers.nl/bierforum
User avatar
SalazarAG
Registered User
Posts: 677
Joined: Mon Mar 30, 2015 10:48 am

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by SalazarAG »

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:

Code: Select all

$topic_prefixes = $this->load_prefixes_topic($event, 'topic_data');
if (!empty($topic_prefixes))
{
    $event['page_title'] = '[' . $topic_prefixes . ']' . $event['page_title'];
}
Let me know if that works.
It worked!!!

Very, very, thank you David :)
I'm sorry for my English. Google Translator does a bad job. :D
User avatar
SalazarAG
Registered User
Posts: 677
Joined: Mon Mar 30, 2015 10:48 am

Re: [BETA][3.1] [pre]fixed - Topic Prefixes extension

Post by SalazarAG »

Hartenheer wrote:I give up.
Deleted extension on my test forum.
Do not understand how it works
It's simple

You install, then in the Posting tab you will find below "Manage Prefixes". You click on it in "New Prefix".

Image

Then you put the prefix, prefix name, id (number that is at the end of the url) of the forum, id of the groups that can use and id of the user that can use.

Image
I'm sorry for my English. Google Translator does a bad job. :D
Locked

Return to “Abandoned Extensions”