Re: [Release] Meta Tags Administration
Hey Garciat have you got time now to check it and fix it please?
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.3 extensions → [Release] Meta Tags Administration
Hey Garciat have you got time now to check it and fix it please?
It should work... it definitely does for me.
Main Page
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="Forum zrzeszające komputerowców. Zajmujemy sie diagnostyką, naprawą, modami, overclockingiem i nie tylko." />
<meta name="keywords" content="Forum Komputerowe, Hardware, Software, Overclocking, Podkręcanie, Sterowniki, Bios, Modding, Diagnostyka" />
<meta name="robots" content="all, index, follow" />
If checked, the meta description tag won't be used.
That works, just hide description tag on main page, on forums doesnt hide and does not show
Forums
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ROBOTS" content="NOINDEX, FOLLOW" />
If checked, every topic's meta description tag will be the first 160 characters of its first post.
DOES NOT CHANGE ANYTHING FOR ME.
Changing "If checked, the meta description tag won't be used." does not work for forums too
Anyone have same problem?
That's really weird... try changing line 58 on the extension's manifest.xml to:
if(true)
then reinstall the extension.
Now inside of forums it shows:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="NOINDEX, FOLLOW" />
<meta name="description" content="" />
<meta name="keywords" content="Forum Komputerowe, Hardware, Software, Overclocking, Podkręcanie, Sterowniki, Bios, Modding, Diagnostyka" />
On main there is no change, on main it works properly.
EDIT:
I've found that this line:
$first_post = htmlentities(str_replace("\n", "", $first_post));
Clean my $first_post variable.
EDIT2:
Temporarily fixed it.
Replaced
$first_post = htmlentities(str_replace("\n", "", $first_post));
With:
// $first_post = htmlentities($first_post);
$first_post = str_replace("\n", " ", $first_post);
It works good.
Htmlenities makes my variable clean dunno why.
What about this replacing?
if(defined('FORUM_ALLOW_INDEX'))
With
if(true)
What does it do?
EDIT3:
FOUND OUT THAT PHP 5.2.5 IS BUGGED.
htmlentities
returns empty string.
Holy fuck...
EDIT4:
Its problem with coding, this code works.
$first_post = htmlentities($first_post, ENT_QUOTES,'UTF-8');
I dont know how its with different version of PHP.
Ok, something had to be wrong on your side, because, like it said b4, it works for me.
OK Garciat so tell me only, what does this code do?
if(defined('FORUM_ALLOW_INDEX'))
I replaced it as you said with:
if(true)
...now the desc meta is showing in topics, but is the way to fix?
Change it back. Then, if it works that way, leave it like that.
Is this updated by automatic last time?
You have to download it if there is a new version.
where can I check which is the new version?
On the first post... http://punbb.informer.com/forums/post/119284/#p119284
I have nothing on my setup, that means I don't have it installed?
Right.
If First Post Meta Description Tag is checked and non-latin characters are used in the post, then the Description tag looks like this:
&ETH;�&Ntilde;�&ETH;&micro;
If First Post Meta Description Tag is checked and non-latin characters are used in the post, then the Description tag looks like this:
&ETH;�&Ntilde;�&ETH;&micro;
To fix, change in hook hd_head by meta_tags_admin in line 25:
from:
$first_post = htmlentities(str_replace("\n", "", $first_post));
to
$first_post = htmlentities(str_replace("\n", "", $first_post), ENT_QUOTES, "UTF-8", false);
Thanks much!
Hm... that's odd: I have two forums running punbb1.3.2, one works fine with suggested correction, while the other one gives the following error at the top of topic view page:
Warning: htmlentities() expects at most 3 parameters, 4 given in d:\hst\saabnet-ru_d2d222f5\http\classif\header.php(133) : eval()'d code on line 76
Hm... that's odd: I have two forums running punbb1.3.2, one works fine with suggested correction, while the other one gives the following error at the top of topic view page:
Warning: htmlentities() expects at most 3 parameters, 4 given in d:hstsaabnet-ru_d2d222f5httpclassifheader.php(133) : eval()'d code on line 76
Different PHP versions perhaps?
Hm... now it's the same error on both forums. Looks like I made a mistake when testing.
P.S. PHP version is 4.3.11.
P.P.S. Apparently the fourth parameter was added in 5.2.3, so the fix doesn't work in PHP 4.x
Just ditch that fourth parameter from the code. It obviously does nothing anyhow, if the option isn't available. I believe changing the character set was probably the prime change needed, so that last option should be fairly moot.
Just ditch that fourth parameter from the code. It obviously does nothing anyhow, if the option isn't available. I believe changing the character set was probably the prime change needed, so that last option should be fairly moot.
This ^.
According to PHP.net, the fourth parameter (double_encode) was added in PHP v5.2.3. The last parameter is false and is defaulted as false, so you don't need it there.
Seems to work now, thanks.
Hello,
i tryed this extension but i get empty description :
<meta name="description" content="" />
anyone can tell me why? in setup a checked "First Post Meta Description Tag"
please help
PunBB Forums → PunBB 1.3 extensions → [Release] Meta Tags Administration
Powered by PunBB, supported by Informer Technologies, Inc.