Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-12-21 15:02:13

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

pat-article-social

Created on 9th December 2013, before arc_social_share plugin by Sheffield (http://forum.textpattern.com/viewtopic.php?id=40319), here is my pat-article-social plugin:

http://pat-article-social.cara-tm.com

Last edited by Pat64 (2013-12-21 15:03:52)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#2 2013-12-22 13:04:55

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: pat-article-social

There was a bug into the lite version (I haven’t tested it).
Please, download the new one available.
Sorry for inconvenience.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#3 2014-02-15 10:13:50

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: pat-article-social

New version 0.3.0 with catching for article share counts in order to preserve your website speed. Default catch delay (3 hours) can be set. No external javascript used:

http://pat-article-social.cara-tm.com/

Last edited by Pat64 (2014-02-15 10:14:33)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#4 2015-03-20 07:33:02

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: pat-article-social

Hi,
Thanks for your work, the plugin works well!
However, there’s a nesting problem which made bad things a my error pages…
Here is the tiny fix :

- <meta property="twitter:title" content="<txp:if_article_list>{$title}<txp:else /><txp:title no_widow="0" /></txp:if_article_list>">
+ <meta property="twitter:title" content='<txp:if_article_list>{$title}<txp:else /><txp:title no_widow="0" /></txp:if_article_list>'>
    
- <meta property="og:title" content="<txp:if_article_list>{$title}<txp:else /><txp:title no_widow="0" /></txp:if_article_list>">
+ <meta property="og:title" content='<txp:if_article_list>{$title}<txp:else /><txp:title no_widow="0" /></txp:if_article_list>'>
    
- <meta itemprop="title" content="<txp:if_article_list>{$title}<txp:else /><txp:title no_widow="0" /></txp:if_article_list>">
+ <meta itemprop="title" content='<txp:if_article_list>{$title}<txp:else /><txp:title no_widow="0" /></txp:if_article_list>'>

Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#5 2015-03-20 12:14:20

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: pat-article-social

Hi Nicolas.

Thanks.

Which plugin version do you use?

Try a more recent one: https://github.com/cara-tm/pat_article_social


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#6 2015-03-20 16:15:39

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: pat-article-social

Ok… sorry I’m still using 0.4.5. :-/


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#7 2015-03-22 15:21:11

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: pat-article-social


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#8 2015-03-28 11:12:06

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: pat-article-social

I get this error with 0.4.6, 0.4.7 and 0.4.8:

Parse error: syntax error, unexpected T_FUNCTION in /home/site/www/textpattern/lib/txplib_misc.php(812) : eval()'d code on line 62 Les erreurs ci-dessus ont été causées par le plugin :pat_article_social

Any idea?

Edit: last release works fine after switiching to PHP5.5

Last edited by NicolasGraph (2015-03-28 13:16:00)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#9 2015-03-28 13:48:37

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: pat-article-social

With 0.4.5 I used to turn off the icons to use my owns but after upgrading to 0.4.8 the same tags and attributes display the first letter of the social site name after my icons. Is there a way to turn it off or should I edit the plugin to remove that?


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#10 2015-03-29 06:26:08

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: pat-article-social

NicolasGraph wrote #289527:

I get this error with 0.4.6, 0.4.7 and 0.4.8:

Parse error: syntax error, unexpected T_FUNCTION in /home/site/www/textpattern/lib/txplib_misc.php(812) : eval()'d code on line 62 Les erreurs ci-dessus ont été causées par le plugin :pat_article_social

Any idea?

Edit: last release works fine after switiching to PHP5.5

Thanks Nicolas for this report. I will check today a solution to avoid this error message.

NicolasGraph wrote #289529:

With 0.4.5 I used to turn off the icons to use my owns but after upgrading to 0.4.8 the same tags and attributes display the first letter of the social site name after my icons. Is there a way to turn it off or should I edit the plugin to remove that?

No. Not actually. This is a fallback for old browsers that don’t support SVG format.

You can use this tiny script (I use in my Alison CSS framework project) in order to check CSS3 browsers support:

/*! Simple CSS3 support detector */
var Detect=(function(){var props="borderRadius,svg,columns,flex".split(","),CSSprefix="Webkit,Moz,O,ms,Khtml".split(","),d=document.createElement("detect"),test=[],p,pty;function TestPrefixes(prop){var Uprop=prop.charAt(0).toUpperCase()+prop.substr(1),All=(prop+' '+CSSprefix.join(Uprop+' ')+Uprop).split(' ');for(var n=0,np=All.length;n<np;n++){if(d.style[All[n]]==="") return true}return false}for(p in props){pty=props[p];test[pty]=TestPrefixes(pty);}return test;}());var html=document.getElementsByTagName('html')[0];for(t in Detect){if(Detect[t]) html.className+=' '+t.toLowerCase()};

You’ve got 4 classes in your <html> tag: borderRadius, svg, columns and flex.

Now, add this in your CSS rules:

/* Hide SVG fallback */
.svg .social span {
  display: none;}

Another solution for the upcoming 0.4.9 version: do you prefer a new “fallback” attribute for hiding or not these first letters?

Last edited by Pat64 (2015-03-29 07:17:57)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#11 2015-03-29 08:19:53

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: pat-article-social

Hi Patrick,
Thanks for replying.

Pat64 wrote #289534:

This is a fallback for old browsers that don’t support SVG format.

I’m not sure to understand; my browser (FF36) supports SVG format, I wouldn’t expect to see any fallback.

You can use this tiny script in order to check CSS3 browsers support.

Honestly when I use this kind of plugin it’s to avoid me to add scripts.

Do you prefer a new “fallback” attribute for hiding or not these first letters?

As I’m using FontAwesome in the project I’m working on, I manage my icons with the title attribute and turn the icon attribute off. As icon is set to 0 I wouldn’t expect any fallback, but in other cases, when users use custom SVG icons, it would be useful probably…


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#12 2015-03-29 08:36:23

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: pat-article-social

First of all. Error message will never occur now: https://github.com/cara-tm/pat_article_social/commit/3c54887b375a5969f4c1e0722298020adc60735f

NicolasGraph wrote #289536:

Hi Patrick,
Thanks for replying.

You’re welcome

I’m not sure to understand; my browser (FF36) supports SVG format, I wouldn’t expect to see any fallback.

So, you’ve got the SVG icons and the first letters. Right? In this case, it’s normal ;)

Honestly when I use this kind of plugin it’s to avoid me to add scripts.

You’re right. That’s why this plugin exists ;)

So “fallback” attribute added: https://github.com/cara-tm/pat_article_social/commit/a162d63cda94cd6642eed1aa2f7d837eb7ef5a3c

Default: true (first letters are shown). So, if you set this attribute to 0 value, no first letters are shown.

You can download the 0.4.9 version today when I finish to add support for Instagram service (I need to register the plugin to have a key API ).

As I’m using FontAwesome in the project I’m working on, I manage my icons with the title attribute and turn the icon attribute off. As icon is set to 0 I wouldn’t expect any fallback, but in other cases, when users use custom SVG icons, it would be useful probably…

Interesting. This is what I thing to add in the plugin (as a fallback for SVG icons). Could you tell me how you make?

Last edited by Pat64 (2015-03-29 08:37:10)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

Board footer

Powered by FluxBB