OGra_XH

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

olape
Posts: 2713
Joined: Fri Mar 13, 2015 8:47 am
Contact:

OGra_XH

Post by olape » Tue Dec 12, 2017 7:10 pm

The PlugIn creates the OG tags for Facebook, XING and LinkedIn according to the Open Graph Protocol.

!!It's a first draft!!

https://olaf.penschke.net/?CMSimple_XH/Plugins/OGra_XH

- no help-file is included

Above the editor there is an additional tab, which can currently only be used for specifying an image.
Images must be stored in the folder userfiles/images/ogra_XH/ using the XH file manager.
If there is an og_default.jpg image in this folder, it will be used for all pages without separate specification.
All other information is currently generated from the existing meta tags.

Here can you check the OG-Tags

http://opengraphcheck.com/

http://smo.knowem.com/
Gruß Olaf, Plugins for CMSimple_XH

Ich habe schon lange den Verdacht, dass so viele so eifrig auf Gender, Trans und Queer machen:
Weil sie für das Fachliche ganz einfach zu doof sind.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: OGra_XH

Post by cmb » Wed Dec 13, 2017 2:08 pm

olape wrote:The PlugIn creates the OG tags for Facebook, XING and LinkedIn according to the Open Graph Protocol.
Great!

Some notes:
  • I'm not sure whether $sl is sufficient for og:locale. The spec claims it should be language_TERRITORY. It occurs to me that CMSimple_XH should provide a language setting for the territory/country (some other plugins require that as well).
  • You can use $pth['folder']['images'] instead of $cf['folders']['userfiles'] . $cf['folders']['images'].
  • Code: Select all

        $hjs .= '<meta property="og:url" content="' 
                . CMSIMPLE_URL 
                . (($su != '') 
                    ? ('?' . $su) 
                    : (((substr_count($_SERVER['QUERY_STRING'], 'sitemap') > 0 || substr_count($_SERVER['QUERY_STRING'], 'mailform') > 0) && ($su == '')) 
                        ? ('?' . $_SERVER['QUERY_STRING']) 
                        : (''))) 
                . '"></meta>' . "\n"; 
    Isn't URL construction in CMSimple_XH fun!? ;)
Christoph M. Becker – Plugins for CMSimple_XH

olape
Posts: 2713
Joined: Fri Mar 13, 2015 8:47 am
Contact:

Re: OGra_XH

Post by olape » Wed Dec 13, 2017 2:36 pm

cmb wrote:The spec claims it should be language_TERRITORY.
Yes, that's correct. I already have it in todo.
cmb wrote:You can use $pth['folder']['images'] instead of $cf['folders']['userfiles'] . $cf['folders']['images'].
Thanks. In the next version.
cmb wrote: Isn't URL construction in CMSimple_XH fun!? ;)
:mrgreen:
Gruß Olaf, Plugins for CMSimple_XH

Ich habe schon lange den Verdacht, dass so viele so eifrig auf Gender, Trans und Queer machen:
Weil sie für das Fachliche ganz einfach zu doof sind.

SiNiTaSa
Posts: 114
Joined: Tue Jan 03, 2017 10:33 am
Location: BW|GERMANY

Re: OGra_XH

Post by SiNiTaSa » Thu Jan 04, 2018 2:23 pm

The PlugIn creates the OG tags for Facebook, XING and LinkedIn according to the Open Graph Protocol.

!!It's a first draft!!

Für den ersten Entwurf super Klasse
aka smaxle | plugin_XH 1.7

olape
Posts: 2713
Joined: Fri Mar 13, 2015 8:47 am
Contact:

Re: OGra_XH

Post by olape » Tue Jan 09, 2018 11:55 am

New Version is online now (1.0 beta 1)

https://olaf.penschke.net/?CMSimple_XH/Plugins/OGra_XH

- path adjustments for second languages
- created metaconfig
- localization adjusted
- language files adjusted
- created language file for DE
- version.nfo adjusted for hi_updatecheck
- default image for OG can be defined now
- new standard image
- help file created
- manual input for description and title possible
- various changes
Gruß Olaf, Plugins for CMSimple_XH

Ich habe schon lange den Verdacht, dass so viele so eifrig auf Gender, Trans und Queer machen:
Weil sie für das Fachliche ganz einfach zu doof sind.

olape
Posts: 2713
Joined: Fri Mar 13, 2015 8:47 am
Contact:

Re: OGra_XH

Post by olape » Wed Jan 10, 2018 3:02 pm

New Version is online (1.0 beta 2) :cry: Sorry :cry:

https://olaf.penschke.net/?CMSimple_XH/Plugins/OGra_XH

- error when saving the configuration on beta1

Thanks to frase for reporting

PHP 5.3 - 7.1
XH 1.7.0 - 1.7.2
Gruß Olaf, Plugins for CMSimple_XH

Ich habe schon lange den Verdacht, dass so viele so eifrig auf Gender, Trans und Queer machen:
Weil sie für das Fachliche ganz einfach zu doof sind.

olape
Posts: 2713
Joined: Fri Mar 13, 2015 8:47 am
Contact:

Re: OGra_XH

Post by olape » Wed Jan 24, 2018 7:02 pm

New Version is online (1.0 beta 3)

https://olaf.penschke.net/?CMSimple_XH/Plugins/OGra_XH

- fixed error with encoded URLs (%2F)
- fixed path error when index. php in URL
- fixed bug with additional parameters
- Google+
- Twitter
- various code changes

PHP 5.3 - 7.2
XH 1.7.0 - 1.7.2

Thanks to cmb for help

I've read a lot of websites. There were just as many different specifications for the required tags and image sizes.
I hope I have found and adopted the right information.
But, it's a beta version.

Feedback is welcome.
Gruß Olaf, Plugins for CMSimple_XH

Ich habe schon lange den Verdacht, dass so viele so eifrig auf Gender, Trans und Queer machen:
Weil sie für das Fachliche ganz einfach zu doof sind.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: OGra_XH

Post by cmb » Thu Jan 25, 2018 2:40 pm

olape wrote:
Wed Jan 24, 2018 7:02 pm
- fixed error with encoded URLs (%2F)
Das dürfte allerdings nur funktionieren, wenn der User die Voreinstellung von $cf['uri']['seperator'] nicht geändert hat – ich gehe davon aus, dass einige noch immer einen Doppelpunkt statt des Slashes (oder auch andere Trenner) verwenden. Wollte man das berücksichtigen, so könnte man wohl index.php:82 ändern (nicht getestet!):

Code: Select all

$op_tmp_query_string = preg_replace('#%(25)*' . bin2hex($cf['uri']['seperator']) . '#i', $cf['uri']['seperator'], $_SERVER['QUERY_STRING']);
Auf der Projektseite schreibst du:
Würde ich grundsätzlich auch empfehlen, aber es ist zu beachten, dass die unterstützten Versionen nur die eigentliche php.net Distribution betreffen. Viele Linux-Distros enthalten aber Forks, und da kann es durchaus sein, dass auch ältere PHP-Versionen noch mit Sicherheitspatches (und vielleicht sogar Bugfixes) versorgt werden. Prominentes Beispiel ist das noch gepflegte CentOS 6, welches aktuell ein php-5.3.3-49 liefert.
Christoph M. Becker – Plugins for CMSimple_XH

olape
Posts: 2713
Joined: Fri Mar 13, 2015 8:47 am
Contact:

Re: OGra_XH

Post by olape » Thu Jan 25, 2018 2:55 pm

cmb wrote:
Thu Jan 25, 2018 2:40 pm
Das dürfte allerdings nur funktionieren, wenn der User die Voreinstellung von $cf['uri']['seperator'] nicht geändert hat – ich gehe davon aus, dass einige noch immer einen Doppelpunkt statt des Slashes (oder auch andere Trenner) verwenden. Wollte man das berücksichtigen, so könnte man wohl index.php:82 ändern (nicht getestet!):
CODE: ALLES AUSWÄHLEN

$op_tmp_query_string = preg_replace('#%(25)*' . bin2hex($cf['uri']['seperator']) . '#i', $cf['uri']['seperator'], $_SERVER['QUERY_STRING']);
Da hast du Recht (schon wieder ;) ), ich setze es auf todo. Danke dir.
Aber bin2hex? Sollte da nicht eher urlencode hin?
cmb wrote:
Thu Jan 25, 2018 2:40 pm
Würde ich grundsätzlich auch empfehlen, aber es ist zu beachten, dass die unterstützten Versionen nur die eigentliche php.net Distribution betreffen. Viele Linux-Distros enthalten aber Forks, und da kann es durchaus sein, dass auch ältere PHP-Versionen noch mit Sicherheitspatches (und vielleicht sogar Bugfixes) versorgt werden.
Das ist mir schon klar, aber ich kann ja nur vom Standard ausgehen. Bei einer solchen Empfehlung ist es schwierig bis unmöglich individuelle Gegebenheiten zu berücksichtigen. Im Zweifel muss man da den Provider befragen.
Gruß Olaf, Plugins for CMSimple_XH

Ich habe schon lange den Verdacht, dass so viele so eifrig auf Gender, Trans und Queer machen:
Weil sie für das Fachliche ganz einfach zu doof sind.

olape
Posts: 2713
Joined: Fri Mar 13, 2015 8:47 am
Contact:

Re: OGra_XH

Post by olape » Wed Feb 07, 2018 7:44 pm

New Version is online (1.0 beta 4)

https://olaf.penschke.net/?CMSimple_XH/Plugins/OGra_XH

- tabs only when activated in configuration
- extended setting options in configuration
- extended setting options in the tabs
- activate and deactivate for individual pages possible
- for encoded URLs only / (%2F) has been considered as URL separator, now also others (thanks to cmb)
- output not in print version
- image selection by dropdown

- help file revised
- recommendations for image sizes and text lengths adjusted

- Google switched to JSON-LD --> (itemscope itemtype="http://schema.org/WebPage) in the html tag is no longer needed
- Google JSON-LD logo possible
- additional own Google JSON-LD possible (quick and dirty)

Sorry, no update possible. There are too many changes.
The individual settings in pages (pagedata) are retained, but may need to be supplemented because of new dependencies.
Gruß Olaf, Plugins for CMSimple_XH

Ich habe schon lange den Verdacht, dass so viele so eifrig auf Gender, Trans und Queer machen:
Weil sie für das Fachliche ganz einfach zu doof sind.

Post Reply