PDA

View Full Version : [#GDT-419942]: Error in Tags Plugin



Pete Young
February 12, 2019, 10:10 AM
[#GDT-419942]: Error in Tags Plugin - Wed 30/01/2019 9:22 PM

/\ I have sent this in almost 2 weeks ago, also sent a follow up on - Fri 8/02/2019 11:00 PM and have still not heard anything back from anyone, are we able to check if it is in the system or should I start again with a new ticket ?


regards
Pete

Bahram Soltanirad
February 22, 2019, 01:52 PM
Pete, may I know the problem and result.
By the way, what does /\ mean?

Pete Young
February 22, 2019, 09:19 PM
[#GDT-419942]: Error in Tags Plugin - Wed 30/01/2019 9:22 PM

/\ I have sent this in almost 2 weeks ago, also sent a follow up on - Fri 8/02/2019 11:00 PM and have still not heard anything back from anyone, are we able to check if it is in the system or should I start again with a new ticket ?


regards
Pete

/\ Points above

The error was that the meta title did not resolve properly and it did not show the title of the tag, resulting in poor / zero results in search as none of the tags would have indexed correctly, I have deleted the video of the error that I made but I can whip up another to show you where there error was if you need it.


Pete

Bahram Soltanirad
February 23, 2019, 06:26 AM
Yes, i found some problems in tag cloud plugin include title problem you mentioned.

If you go to Basic settings>tag cloud , you'll see two important parameters.

1. Tag minimum length. default value is 3

It means the minimum tag length for using by the plugin is 3 characters.
Tag example : Sell car in sydney

The plugin gathers all listings which contain these words: sell,car,sydney
It should not gathers listings with 'in' word because minimum tag length is 3
But unfortunately plugin does not work properly with this parameter and you can imagine what will happen.

Solution: Go to plugins/tag_cloud/rlTagCloud.class.php

Find: tc_tag_min_symbols
Replace with: tc_tag_min_length

2. Banned words

If you add words like 'the,this,that,what,which,who,...' and your tag cloud is 'the best car price'
So it prevents gathering listings which contain 'the' word.
It seems, this part of code work properly, but do not forget to use this parameter.

3. Missing title as you mentioned. Go to plugins/tag_cloud/tags.inc.php

Find:


if( $tag_info['title'] )
{
$page_info['name'] = $tag_info['title'];
}elseif( $default_info['title'])
{
$page_info['name'] = str_replace('{tag}', $tag_info['Tag'], $default_info['title']);
}
else
{
$page_info['name'] = str_replace(array('{number}', '{type}'), array($pInfo['calc'], $lang['listings']), $lang['listings_found']);
}

Replace with:


if( $tag_info['title'] )
{
$page_info['title'] = $page_info['name'] = $tag_info['title'];
}elseif( $default_info['title'])
{
$page_info['title'] = $page_info['name'] = str_replace('{tag}', $tag_info['Tag'], $default_info['title']);
}
else
{
$page_info['name'] = str_replace(array('{number}', '{type}'), array($pInfo['calc'], $lang['listings']), $lang['listings_found']);
}


I think tag cloud needs a whole investigation.

Pete Young
February 23, 2019, 06:56 AM
appreciate the tips, thank you

also added this link here for others as a sidenote to tags

https://forum.flynax.com/showthread.php?4377-change-search-order-in-tags

Pete Young
February 23, 2019, 11:38 AM
for your number 3 option I have this added to the bottom as the fix ?

[QUOTE]// by XXX

$bread_crumbs[0] = array(
'name' => $tag_info['Tag']
);

$page_info['meta_title'] = $bread_crumbs[0]['name'] . '

yours seems a simpler fix ?

Bahram Soltanirad
February 23, 2019, 12:34 PM
for your number 3 option I have this added to the bottom as the fix ?

[QUOTE]// by XXX

$bread_crumbs[0] = array(
'name' => $tag_info['Tag']
 );

$page_info['meta_title'] = $bread_crumbs[0]['name'] . '

yours seems a simpler fix ?

Well done! yours is good , but i usually try with minimum changes to the main code.

Pete Young
February 23, 2019, 09:08 PM
[QUOTE=Pete Young;25052]for your number 3 option I have this added to the bottom as the fix ?



Well done! yours is good , but i usually try with minimum changes to the main code.

That is not my code so do not take credit that as it was a support fix

Bahram Soltanirad
February 24, 2019, 04:48 AM
[QUOTE=Bahram Soltanirad;25053]

That is not my code so do not take credit that as it was a support fix
Ok, then thanks for sharing it.

Pete Young
October 6, 2020, 03:37 AM
This coding has changed in 4.7.2 and now no longer works properly and the default flynax code is still broken, could flynax please give a correct edit to the code to show the title please ?

Rudi
October 6, 2020, 11:56 AM
Hello,

Could you detail on how the meta title should look on tag page ?

Pete Young
October 7, 2020, 01:07 AM
Hello,

Could you detail on how the meta title should look on tag page ?

Hello Rudi Please see Image below (tag name is missing from page title), Bahrams fix did fix this in an earlier version but the coding has since changed and fix no longer works? thanks pete


https://forum.flynax.com/attachment.php?attachmentid=3884&d=1602032777

Rudi
October 7, 2020, 07:24 AM
Ok,

Here is the solution:

go to plugins > tag_cloud > tags.inc.php

below:


$bread_crumbs[] = array(
'name' => $tag_info['Tag']
);


add:


if (!$default_info['title']) {
$page_info['title'] = $page_info['title'] . ' ' . $tag_info['Tag'];
}

Pete Young
October 8, 2020, 03:30 AM
Ok,

Here is the solution:

go to plugins > tag_cloud > tags.inc.php

below:


$bread_crumbs[] = array(
'name' => $tag_info['Tag']
);


add:


if (!$default_info['title']) {
$page_info['title'] = $page_info['title'] . ' ' . $tag_info['Tag'];
}

$page_info['name'] .= ' ' . $lang['for'] . ' ' . $tag_info['Tag'];


Thanks Rudi, that works even better than I hoped for as it also covers the H1, Thank You for your help.

Pete Young
October 8, 2020, 03:41 AM
Edit. I did find one error, if there is only only one item found it repeats the title rather than count ?

copywriting for copywriting < 1 i item found

4 Listing(s) Found. for dating < more than 1 item found

Rudi
October 8, 2020, 04:29 AM
Ok, use the code below without the second line (Corrected)

Pete Young
October 8, 2020, 05:03 AM
Ok thanks Rudi Will try that out.

Pete Young
October 8, 2020, 09:08 AM
That sort of fixed the H1 / web page but what I did not notice is in the title it also repeats as well if there is a single listing found.


With the last line removed

(with one listing found)
Page Title > copywriting copywriting <<< Shows double in title, so still an error here ?
H1 > copywriting

More than one listing found
Page Title > Search For relationships
H1 > 8 Listing(s) Found.

With the last line included

(with one listing found)
Page Title > copywriting copywriting <<< Shows double in title, so still an error here / Same as no bottom line so an error regardless if one listing?
H1 > copywriting for copywriting <<< as before

More than one listing found
Page Title > Search For relationships << stays the same OK
H1 > 8 Listing(s) Found. for relationships << the best outcome and very good.


---

With the bottom line works better all round but problems if one listing found both with or without the bottom line (with one listing) as title is still wrong.

Would like to keep the bottom line but fix the single problem ? if possible.

Rudi
October 8, 2020, 05:42 PM
I've corrected it on your end

replaced:


if ($tag_info['title']) {
$page_info['name'] = $tag_info['title'];
$page_info['title'] = str_replace('{tag}', $tag_info['Tag'], $tag_info['title']);
} elseif ($default_info['title']) {
$page_info['name'] = str_replace('{tag}', $tag_info['Tag'], $default_info['title']);
$page_info['title'] = str_replace('{tag}', $tag_info['Tag'], $default_info['title']);
} else {
$page_info['name'] = str_replace(
['{number}', '{type}'],
[$pInfo['calc'], $lang['listings']],
$lang['listings_found']
);
}


with:


if ($tag_info['title']) {
$page_info['name'] = $tag_info['title'];
$page_info['title'] = str_replace('{tag}', $tag_info['Tag'], $page_info['title']. ' ' .$tag_info['title']);
} elseif ($default_info['title']) {
$page_info['name'] = str_replace('{tag}', $tag_info['Tag'], $default_info['title']);
$page_info['title'] = str_replace('{tag}', $tag_info['Tag'], $default_info['title']);
} else {
$page_info['name'] = str_replace(
['{number}', '{type}'],
[$pInfo['calc'], $lang['listings']],
$lang['listings_found']
);

$page_info['name'] .= ' ' . $lang['for'] . ' ' . $tag_info['Tag'];
$page_info['title'] = $page_info['title'] . ' ' . $tag_info['Tag'];
}

Pete Young
October 8, 2020, 11:23 PM
Spot on thank you Rudi, that is perfect, appreciate your time.

Pete