File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed
Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -49,12 +49,24 @@ public function __get($name)
4949 public function getFromProviders ($ name )
5050 {
5151 $ method = 'get ' .$ name ;
52+ $ values = array ();
53+ $ current = null ;
5254
5355 foreach ($ this ->providers as $ Provider ) {
5456 if (($ value = $ Provider ->$ method ())) {
55- return $ value ;
57+ if (isset ($ values [$ value ])) {
58+ ++$ values [$ value ];
59+ } else {
60+ $ values [$ value ] = 1 ;
61+ }
62+
63+ if ($ current === null || $ values [$ current ] > $ values [$ value ]) {
64+ $ current = $ value ;
65+ }
5666 }
5767 }
68+
69+ return $ current ;
5870 }
5971
6072 public function getUrlFromProviders ($ name )
Original file line number Diff line number Diff line change @@ -59,6 +59,14 @@ public function getDescription()
5959 return $ this ->get ('description ' );
6060 }
6161
62+ public function getType ()
63+ {
64+ switch ($ this ->get ('type ' )) {
65+ case 'article ' :
66+ return 'link ' ;
67+ }
68+ }
69+
6270 public function getImage ()
6371 {
6472 if (($ imgs = $ this ->get ('image ' )) && isset ($ imgs [0 ]['url ' ])) {
Original file line number Diff line number Diff line change @@ -63,6 +63,9 @@ public function getType()
6363 case 'link ' :
6464 case 'rich ' :
6565 return $ type ;
66+
67+ case 'article ' :
68+ return 'link ' ;
6669 }
6770
6871 if ($ this ->has ('video ' )) {
You can’t perform that action at this time.
0 commit comments