Re: [Release] Meta Tags Administration

Hey Garciat have you got time now to check it and fix it please?

27

Re: [Release] Meta Tags Administration

It should work... it definitely does for me.

28 (edited by Reactor 2009-01-05 12:18)

Re: [Release] Meta Tags Administration

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?

29

Re: [Release] Meta Tags Administration

That's really weird... try changing line 58 on the extension's manifest.xml to:

if(true)

then reinstall the extension.

30 (edited by Reactor 2009-01-05 14:38)

Re: [Release] Meta Tags Administration

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.

31

Re: [Release] Meta Tags Administration

Ok, something had to be wrong on your side, because, like it said b4, it works for me.

Re: [Release] Meta Tags Administration

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?

33 (edited by User33 2009-01-05 15:06)

Re: [Release] Meta Tags Administration

Change it back. Then, if it works that way, leave it like that.

34

Re: [Release] Meta Tags Administration

Is this updated by automatic last time?

35

Re: [Release] Meta Tags Administration

You have to download it if there is a new version.

36

Re: [Release] Meta Tags Administration

where can I check which is the new version?

37

Re: [Release] Meta Tags Administration

On the first post... http://punbb.informer.com/forums/post/119284/#p119284

38

Re: [Release] Meta Tags Administration

I have nothing on my setup, that means I don't have it installed?

39

Re: [Release] Meta Tags Administration

Right.

40

Re: [Release] Meta Tags Administration

If First Post Meta Description Tag is checked and non-latin characters are used in the post, then the Description tag looks like this:

&amp;ETH;�&amp;Ntilde;�&amp;ETH;&amp;micro;

Re: [Release] Meta Tags Administration

8k84 wrote:

If First Post Meta Description Tag is checked and non-latin characters are used in the post, then the Description tag looks like this:

&amp;ETH;�&amp;Ntilde;�&amp;ETH;&amp;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);

42

Re: [Release] Meta Tags Administration

Thanks much!

43

Re: [Release] Meta Tags Administration

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

44

Re: [Release] Meta Tags Administration

8k84 wrote:

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?

If you need any PunBB 1.2.* mods done, feel free to send me a PM; we can work out a price [if need be].

45 (edited by 8k84 2009-04-16 22:17)

Re: [Release] Meta Tags Administration

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

46

Re: [Release] Meta Tags Administration

Just ditch that fourth parameter from the code. It obviously does nothing anyhow, if the option isn't available. big_smile I believe changing the character set was probably the prime change needed, so that last option should be fairly moot.

47

Re: [Release] Meta Tags Administration

MattF wrote:

Just ditch that fourth parameter from the code. It obviously does nothing anyhow, if the option isn't available. big_smile 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.

If you need any PunBB 1.2.* mods done, feel free to send me a PM; we can work out a price [if need be].

48

Re: [Release] Meta Tags Administration

Seems to work now, thanks.

49 (edited by kook 2009-10-25 20:59)

Re: [Release] Meta Tags Administration

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 smile