Version Description
- Tested with the latest version for WordPress.
Download this release
Release Info
Developer | vivacityinfotech.jaipur |
Plugin | WP twitter feeds |
Version | 1.5 |
Comparing to | |
See all releases |
Code changes from version 1.4.4 to 1.5
- README.txt +136 -151
- README.txt~ +0 -151
- controller/twitter_widget.class.php +76 -68
- controller/twitteroauth/OAuth.php +35 -61
- controller/twitteroauth/twitteroauth.php +17 -7
- controller/widget_html.php +32 -34
- css/admin_style.min.css +1 -0
- css/fonts/wpltf_intents.dev.svg +12 -19
- css/fonts/wpltf_intents.svg +12 -19
- js/jquery.newsTicker.js +203 -0
- js/jquery.newsTicker.min.js +12 -0
- languages/viva-twitter-feed-fr_FR.mo +0 -0
- languages/viva-twitter-feed-fr_FR.po +124 -0
- libs/console.php +0 -44
- slider.php +0 -188
- twitter_usr_validation.php +4 -3
- views/dynamic_html.php +0 -82
- views/slider.php +6 -6
- wp-latest-twitter-tweets.php +45 -32
- wp-latest-twitter-tweets.php~ +0 -43
README.txt
CHANGED
@@ -1,151 +1,136 @@
|
|
1 |
-
===
|
2 |
-
Contributors: vivacityinfotech.jaipur
|
3 |
-
Donate link: http://
|
4 |
-
Tags: wp twitter feeds,twitter feeds, twitter timeline,twitter widget,twitter widget for wordpress,wp twitter feeds widget,live tweets, live twitter feeds, tweets, feeds, wp twitter feeds plugin, twitter user tweets, twitter 1.1, twitter api
|
5 |
-
Requires at least: 3.
|
6 |
-
Tested up to:
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
WP Twitter Feeds - A simple widget which lets you add your latest tweets in just a few clicks on your website.
|
12 |
-
|
13 |
-
== Description ==
|
14 |
-
|
15 |
-
An easy Twitter feeds widget that provides facility to display twitter tweets on your website using the latest Twitter 1.1 API. A simple widget which lets you add your latest tweets in widget areas. Get started in just a few clicks and use the provided Widget to easily display your Tweets on your website.
|
16 |
-
|
17 |
-
Now you don`t need to copy and paste the code from twitter with your settings anymore, just install the plugin and set the options.
|
18 |
-
By option page, you can define the duration of fade effect, the number of tweet to see and other things.
|
19 |
-
|
20 |
-
The "WP Twitter Feeds" Widget will never require your Twitter password, because it based on Open Authentication (OAuth) keys and secrets, that you will get by creating your application at Twitter. It gets all your required data from API. Incase you change your password, you
|
21 |
-
|
22 |
-
=
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
*
|
30 |
-
*
|
31 |
-
*
|
32 |
-
*
|
33 |
-
*
|
34 |
-
*
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
== Installation ==
|
54 |
-
|
55 |
-
Installation consists of following steps:
|
56 |
-
|
57 |
-
1. Upload "WP Twitter Tweets" to the /wp-content/plugins/ directory
|
58 |
-
2. Activate the plugin through the 'Plugins' menu in WordPress
|
59 |
-
3. Place the "WP Twitter Tweets" Widget on your sidebar and add twitter username with API details of Twitter.
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
1
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
1
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
= 1.
|
129 |
-
*
|
130 |
-
|
131 |
-
= 1.
|
132 |
-
*
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
= 1.3 =
|
138 |
-
* Added the feature to change tweets theme.
|
139 |
-
* Added the option to show/hide border arround the tweets.
|
140 |
-
|
141 |
-
= 1.2 =
|
142 |
-
* Improved Fornt-End UI design.
|
143 |
-
|
144 |
-
= 1.1 =
|
145 |
-
* Boxed layout for tweets.
|
146 |
-
* Improved Twitter username validation in the widget.
|
147 |
-
|
148 |
-
= 1.0 =
|
149 |
-
* Initial release
|
150 |
-
|
151 |
-
|
1 |
+
=== WP twitter feeds ===
|
2 |
+
Contributors: vivacityinfotech.jaipur,planet-interactive
|
3 |
+
Donate link: http://vivacityinfotech.net/paypal-donation/
|
4 |
+
Tags: wp twitter feeds,twitter feeds, twitter timeline,twitter widget,twitter widget for wordpress,wp twitter feeds widget,live tweets, live twitter feeds, tweets, feeds, wp twitter feeds plugin, twitter user tweets, twitter 1.1, twitter api
|
5 |
+
Requires at least: 3.5
|
6 |
+
Tested up to: 5.0.2
|
7 |
+
Stable tag: 1.5
|
8 |
+
License: GPLv2 or later
|
9 |
+
|
10 |
+
|
11 |
+
WP Twitter Feeds - A simple widget which lets you add your latest tweets in just a few clicks on your website.
|
12 |
+
|
13 |
+
== Description ==
|
14 |
+
|
15 |
+
An easy Twitter feeds widget that provides facility to display twitter tweets on your website using the latest Twitter 1.1 API. A simple widget which lets you add your latest tweets in widget areas. Get started in just a few clicks and use the provided Widget to easily display your Tweets on your website.
|
16 |
+
|
17 |
+
Now you don`t need to copy and paste the code from twitter with your settings anymore, just install the plugin and set the options.
|
18 |
+
By option page, you can define the duration of fade effect, the number of tweet to see and other things.
|
19 |
+
|
20 |
+
The "WP Twitter Feeds" Widget will never require your Twitter password, because it based on Open Authentication (OAuth) keys and secrets, that you will get by creating your application at Twitter. It gets all your required data from API. Incase you change your password, you don't need to update your Widget in your Blog. This plugin is basically fork of: [Planet Interactive](https://wordpress.org/plugins/simple-twitter-tweets/).
|
21 |
+
|
22 |
+
= Translators =
|
23 |
+
|
24 |
+
* English(US) (en_Us)
|
25 |
+
* French (fr_FR)
|
26 |
+
|
27 |
+
= Plugin Features =
|
28 |
+
|
29 |
+
*Easy install
|
30 |
+
*Very easy to configure.
|
31 |
+
*Display Tweets with a Widget.
|
32 |
+
*Choose to show a profile image, Tweets border, Tweets theme and much more.
|
33 |
+
*Multiple instance so you can use Twitter widget at multiple places.
|
34 |
+
*Different color Options.
|
35 |
+
*Lightweight and loading fast
|
36 |
+
*Set maximum number of tweets to display
|
37 |
+
*Turn on/off displaying avatar
|
38 |
+
*Supports v1.1 of the Twitter API
|
39 |
+
*Slider for Tweets
|
40 |
+
|
41 |
+
|
42 |
+
= Rate Us / Feedback =
|
43 |
+
|
44 |
+
Please take the time to let us and others know about your experiences by leaving a review, so that we can improve the plugin for you and other users.
|
45 |
+
|
46 |
+
If you like the plugin please [Donate here](http://vivacityinfotech.net/paypal-donation/).
|
47 |
+
|
48 |
+
= Want More? =
|
49 |
+
|
50 |
+
If You Want more functionality or some modifications, just drop us a line what you want and we will try to add or modify the plugin functions.
|
51 |
+
|
52 |
+
|
53 |
+
== Installation ==
|
54 |
+
|
55 |
+
Installation consists of following steps:
|
56 |
+
|
57 |
+
1. Upload "WP Twitter Tweets" to the /wp-content/plugins/ directory
|
58 |
+
2. Activate the plugin through the 'Plugins' menu in WordPress
|
59 |
+
3. Place the "WP Twitter Tweets" Widget on your sidebar and add twitter username with API details of Twitter.
|
60 |
+
|
61 |
+
Visit our <a href="http://vivacityinfotech.net/wordpress/plugins/wp-twitter-feeds-wordpress-plugin-by-vivacity/" target="_blank">demo page</a> for more information.
|
62 |
+
|
63 |
+
== Frequently Asked Questions ==
|
64 |
+
|
65 |
+
= How to create a Twitter Application =
|
66 |
+
|
67 |
+
1. Visit the Twitter Developers Site: The first thing you need to do is head on down to dev.twitter.com. In order to create an account, all you need to do is click on Sign In link at the top right.
|
68 |
+
|
69 |
+
2. Sign in with your Twitter Account: Next, sign in with the Twitter account you want to associate with your app. You do have a Twitter account don't you?!
|
70 |
+
|
71 |
+
3. Go to My Applications: Once you're logged in, click on the downward arrow to the right of your Twitter image and select "My Applications". This is where all your registered Twitter apps will appear.
|
72 |
+
|
73 |
+
4. Create a New Application: If you are new to the Developers site you won't see any applications registered. Either way, it's time to create our first application. To do this, click on the big "Create a new application" button.
|
74 |
+
|
75 |
+
5. Fill in your Application Details: It's been easy so far, but this screen often makes people confused. Don't worry, it's a lot easier than you think. First of all you need to give your app a unique name (one that no one else has used for their Twitter app). Since we're going to create an app for personal use and not for other people who can register and use, so just put your domain name in or perhaps even your name. You don't have to worry much about the descriptions you can change this later. I have put "a set of Twitter tools for personal use". Put your website in the website field– don't worry that it isn't (as Twitter ask) your application's publicly accessible home page. However, this website will be where your app is hosted.For now ignore the Callback URL field. If you are allowing users to log into your app to authenticate themselves, you'd enter the URL where they would be returned after they've given permission to Twitter to use your app. Once you've done this, make sure you've read the "Developer Rules Of The Road" blurb, check the "Yes, I agree" box, fill in the CAPTCHA (don't you just love them) and click the "create your Twitter Application" button. Hurrah!
|
76 |
+
|
77 |
+
6. Create Your Access Token.
|
78 |
+
|
79 |
+
7. Make a note of your OAuth Settings.
|
80 |
+
|
81 |
+
== Credits ==
|
82 |
+
* Thanks to [Rhodri George](News Ticker) for great help with the js file.
|
83 |
+
* Thanks to the [Twitter.com] for the great API.
|
84 |
+
|
85 |
+
== Screenshots ==
|
86 |
+
|
87 |
+
1. WP Twitter Feeds plugin installed and appears in the plugins menu.
|
88 |
+
2. WP Twitter Feeds widget under Appearance->Widgets.
|
89 |
+
3. WP Twitter Feeds widget under Appearance->Widgets.
|
90 |
+
4. WP Twitter Feeds widget under Appearance->Widgets.
|
91 |
+
5. WP Twitter Feeds widget under Appearance->Widgets.
|
92 |
+
6. WP Twitter Feeds widget on front End (Light Theme).
|
93 |
+
7. WP Twitter Feeds widget on front End (Dark Theme).
|
94 |
+
8. WP Twitter Feeds widget Slider feature under Appearance->Widgets.
|
95 |
+
|
96 |
+
|
97 |
+
== Changelog ==
|
98 |
+
= 1.5 =
|
99 |
+
* Tested with the latest version for WordPress.
|
100 |
+
|
101 |
+
= 1.4.9 =
|
102 |
+
* Added language support.
|
103 |
+
|
104 |
+
= 1.4.8 =
|
105 |
+
* Tested with the latest version for WordPress.
|
106 |
+
|
107 |
+
= 1.4.7 =
|
108 |
+
* Added support for displaying images in feeds in both list and slider view.
|
109 |
+
= 1.4.6 =
|
110 |
+
* Updated labels.
|
111 |
+
= 1.4.5 =
|
112 |
+
* Added jQuery Slider file.
|
113 |
+
= 1.4.4 =
|
114 |
+
* Fix bug and improve the code.
|
115 |
+
= 1.4.3 =
|
116 |
+
* Improvement the coding standard.
|
117 |
+
|
118 |
+
= 1.4.2 =
|
119 |
+
* Added the option to List/Slider for the tweets. Now from the Slider option tweets can be show as a slider. A single tweet shows at a time after few second it will fade up by the next tweet.
|
120 |
+
|
121 |
+
= 1.4.1 =
|
122 |
+
* Squashed some css style conflicts with wordpress theme.
|
123 |
+
|
124 |
+
= 1.3 =
|
125 |
+
* Added the feature to change tweets theme.
|
126 |
+
* Added the option to show/hide border around the tweets.
|
127 |
+
|
128 |
+
= 1.2 =
|
129 |
+
* Improved Fornt-End UI design.
|
130 |
+
|
131 |
+
= 1.1 =
|
132 |
+
* Boxed layout for tweets.
|
133 |
+
* Improved Twitter UserName validation in the widget.
|
134 |
+
|
135 |
+
= 1.0 =
|
136 |
+
* Initial release
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.txt~
DELETED
@@ -1,151 +0,0 @@
|
|
1 |
-
=== Plugin Name ===
|
2 |
-
Contributors: vivacityinfotech.jaipur
|
3 |
-
Donate link: http://tinyurl.com/owxtkmt
|
4 |
-
Tags: wp twitter feeds,twitter feeds, twitter timeline,twitter widget,twitter widget for wordpress,wp twitter feeds widget,live tweets, live twitter feeds, tweets, feeds, wp twitter feeds plugin, twitter user tweets, twitter 1.1, twitter api
|
5 |
-
Requires at least: 3.0
|
6 |
-
Tested up to: 3.9.1
|
7 |
-
License: GPLv2 or later
|
8 |
-
Stable tag: 1.4.4
|
9 |
-
|
10 |
-
|
11 |
-
WP Twitter Feeds - A simple widget which lets you add your latest tweets in just a few clicks on your website.
|
12 |
-
|
13 |
-
== Description ==
|
14 |
-
|
15 |
-
An easy Twitter feeds widget that provides facility to display twitter tweets on your website using the latest Twitter 1.1 API. A simple widget which lets you add your latest tweets in widget areas. Get started in just a few clicks and use the provided Widget to easily display your Tweets on your website.
|
16 |
-
|
17 |
-
Now you don`t need to copy and paste the code from twitter with your settings anymore, just install the plugin and set the options.
|
18 |
-
By option page, you can define the duration of fade effect, the number of tweet to see and other things.
|
19 |
-
|
20 |
-
The "WP Twitter Feeds" Widget will never require your Twitter password, because it based on Open Authentication (OAuth) keys and secrets, that you will get by creating your application at Twitter. It gets all your required data from API. Incase you change your password, you won’t need to update your Widget in your Blog.
|
21 |
-
|
22 |
-
= Plugin Features =
|
23 |
-
|
24 |
-
*Easy install
|
25 |
-
*Very easy to configure.
|
26 |
-
*Display Tweets with a Widget.
|
27 |
-
*Choose to show a profile image, Tweets border, Tweets theme and much more.
|
28 |
-
*Multiple instance so you can use Twitter widget multiple places.
|
29 |
-
*Different color Options.
|
30 |
-
*Lightweight and loading fast
|
31 |
-
*Set maximum number of tweets to display
|
32 |
-
*Turn on/off displaying avatar
|
33 |
-
*Supports v1.1 of the Twitter API
|
34 |
-
*Slider for Tweets
|
35 |
-
|
36 |
-
|
37 |
-
= Rate Us / Feedback =
|
38 |
-
|
39 |
-
Please take the time to let us and others know about your experiences by leaving a review, so that we can improve the plugin for you and other users.
|
40 |
-
|
41 |
-
If you like the plugin please [Donate here](http://bit.ly/1icl56K).
|
42 |
-
|
43 |
-
= Want More? =
|
44 |
-
|
45 |
-
If You Want more functionality or some modifications, just drop us a line what you want and We will try to add or modify the plugin functions.
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
== Available Languages ==
|
50 |
-
|
51 |
-
English
|
52 |
-
|
53 |
-
== Installation ==
|
54 |
-
|
55 |
-
Installation consists of following steps:
|
56 |
-
|
57 |
-
1. Upload "WP Twitter Tweets" to the /wp-content/plugins/ directory
|
58 |
-
2. Activate the plugin through the 'Plugins' menu in WordPress
|
59 |
-
3. Place the "WP Twitter Tweets" Widget on your sidebar and add twitter username with API details of Twitter.
|
60 |
-
|
61 |
-
== Frequently Asked Questions ==
|
62 |
-
|
63 |
-
= How to create a Twitter Application =
|
64 |
-
|
65 |
-
1. Visit the Twitter Developers Site: The first thing you need to do is head on down to dev.twitter.com. In order to create an account, all you need to do is click on the “Sign In” link at the top right.
|
66 |
-
|
67 |
-
2. Sign in with your Twitter Account: Next, sign in with the Twitter account you want to associate with your app. You do have a Twitter account don’t you?!
|
68 |
-
|
69 |
-
3. Go to “My Applications”: Once you’re logged in, click on the downwards arrow to the right of your Twitter image and select “My Applications”. This is where all your registered Twitter apps will appear.
|
70 |
-
|
71 |
-
4. Create a New Application: If you are new to the Developers site you won’t see any applications registered. Either way, it’s time to create our first application. To do this, click on the big “Create a new application” button.
|
72 |
-
|
73 |
-
5. Fill in your Application Details: It’s been easy so far, but this screen often makes people confused. Don’t worry, it’s a lot easier than you think. First of all you need to give your app a unique name (one that no one else has used for their Twitter app). Since we’re going to be an creating app for personal use and not one that other people can register and use, just put your domain name in or perhaps even your name. You don’t have to worry much about the description– you can change this later. I’ve put “a set of Twitter tools for personal use”.Put your website in the website field– don’t worry that it isn’t (as Twitter ask) your application’s publicly accessible home page. However, this website will be where your app is hosted.For now ignore the Callback URL field. If you are allowing users to log into your app to authenticate themselves, you’d enter the URL where they would be returned after they’ve given permission to Twitter to use your app.Once you’ve done this, make sure you’ve read the “Developer Rules Of The Road” blurb, check the “Yes, I agree” box, fill in the CAPTCHA (don’t you just love them) and click the “create your Twitter Application” button. Hurrah!
|
74 |
-
|
75 |
-
6. Create Your Access Token.
|
76 |
-
|
77 |
-
7. Make a note of your OAuth Settings.
|
78 |
-
|
79 |
-
== Screenshots ==
|
80 |
-
|
81 |
-
1. WP Twitter Feeds plugin installed and appears in the plugins menu.
|
82 |
-
2. WP Twitter Feeds widget under Appearence->Widgets.
|
83 |
-
3. WP Twitter Feeds widget under Appearence->Widgets.
|
84 |
-
4. WP Twitter Feeds widget under Appearence->Widgets.
|
85 |
-
5. WP Twitter Feeds widget under Appearence->Widgets.
|
86 |
-
6. WP Twitter Feeds widget on front End (Light Theme).
|
87 |
-
7. WP Twitter Feeds widget on front End (Dark Theme).
|
88 |
-
8. WP Twitter Feeds widget Slider feature under Appearence->Widgets.
|
89 |
-
|
90 |
-
Requires: 3.0 or higher
|
91 |
-
Compatible up to: 3.9.1
|
92 |
-
Last Updated: 2014-7-23
|
93 |
-
Downloads: 14,993
|
94 |
-
Ratings
|
95 |
-
4 stars
|
96 |
-
4.7 out of 5 stars
|
97 |
-
5 stars 2
|
98 |
-
4 stars 1
|
99 |
-
3 stars 0
|
100 |
-
2 stars 0
|
101 |
-
1 stars 0
|
102 |
-
|
103 |
-
Author
|
104 |
-
Team Vivacity
|
105 |
-
13 plugins
|
106 |
-
Donate to this plugin »
|
107 |
-
Support
|
108 |
-
|
109 |
-
1 of 10 support threads in the last two months have been resolved.
|
110 |
-
|
111 |
-
Got something to say? Need help?
|
112 |
-
View support forum
|
113 |
-
Compatibility
|
114 |
-
WordPress
|
115 |
-
+ Plugin
|
116 |
-
=
|
117 |
-
Not enough data
|
118 |
-
|
119 |
-
0 people say it works.
|
120 |
-
0 people say it's broken.
|
121 |
-
|
122 |
-
Log in to vote.
|
123 |
-
|
124 |
-
|
125 |
-
== Changelog ==
|
126 |
-
= 1.4.3 =
|
127 |
-
* Added Tweets Slider file.
|
128 |
-
= 1.4.3 =
|
129 |
-
* Added slider.php file.
|
130 |
-
|
131 |
-
= 1.4.2 =
|
132 |
-
* Added the option to List/Slider for the tweets. Now from the Slider option tweets can be show as a slider. A single tweet shows at a time after few second it will fade up by the next tweet.
|
133 |
-
|
134 |
-
= 1.4.1 =
|
135 |
-
* Squashed some css style conflicts with wordpress theme.
|
136 |
-
|
137 |
-
= 1.3 =
|
138 |
-
* Added the feature to change tweets theme.
|
139 |
-
* Added the option to show/hide border arround the tweets.
|
140 |
-
|
141 |
-
= 1.2 =
|
142 |
-
* Improved Fornt-End UI design.
|
143 |
-
|
144 |
-
= 1.1 =
|
145 |
-
* Boxed layout for tweets.
|
146 |
-
* Improved Twitter username validation in the widget.
|
147 |
-
|
148 |
-
= 1.0 =
|
149 |
-
* Initial release
|
150 |
-
|
151 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
controller/twitter_widget.class.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
-
<?php
|
|
|
|
|
2 |
|
3 |
/**
|
4 |
* Widget IDs using Slider display
|
@@ -8,25 +10,25 @@
|
|
8 |
static $slider_ids = array();
|
9 |
|
10 |
function form($instance){
|
11 |
-
$defaults=$this->
|
12 |
$instance = wp_parse_args( (array) $instance, $defaults );
|
13 |
$widget_title = $instance['title'];
|
14 |
$name = $instance['name'];
|
15 |
$tweets_count = $instance['tweets_cnt'];
|
16 |
$accessTokenSecret = trim($instance['accessTokenSecret']);
|
17 |
$replies_excl = $instance['replies_excl'];
|
|
|
18 |
$consumerSecret = trim($instance['consumerSecret']);
|
19 |
$accessToken = trim($instance['accessToken']);
|
20 |
$cache_transient = $instance['timeRef'];
|
21 |
$alter_ago_time = $instance['timeAgo'];
|
22 |
$twitterIntents = $instance['twitterIntents'];
|
23 |
-
//$dataShowCount = $instance['dataShowCount'];
|
24 |
$disp_screen_name = $instance['disp_scr_name'];
|
25 |
$timeto_store = $instance['store_time'];
|
26 |
$consumerKey = trim($instance['consumerKey']);
|
27 |
$intents_text = $instance['twitterIntentsText'];
|
28 |
$color_intents = $instance['intentColor'];
|
29 |
-
|
30 |
$showAvatar = $instance['showAvatar'];
|
31 |
$border_rad_avatar = $instance['border_rad'];
|
32 |
$tweet_border = $instance['tweet_border'];
|
@@ -34,10 +36,10 @@
|
|
34 |
if (!in_array('curl', get_loaded_extensions())) {
|
35 |
echo '<p style="background-color:pink;padding:10px;border:1px solid red;"><strong>cURL is not installed!</strong></p>';
|
36 |
}
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
$data = array(
|
42 |
'title' => 'Latest Tweets'
|
43 |
, 'name' => ''
|
@@ -59,11 +61,11 @@
|
|
59 |
, 'intentColor' => "#999999"
|
60 |
, 'showAvatar' => false
|
61 |
, 'border_rad' => false
|
62 |
-
|
63 |
);
|
64 |
return $data;
|
65 |
}
|
66 |
-
function
|
67 |
if( $hook != 'widgets.php' )
|
68 |
return;
|
69 |
|
@@ -81,7 +83,7 @@
|
|
81 |
wp_enqueue_script('user_validate', plugins_url( '/js/validate.js' , dirname(__FILE__) ), array('jquery'));
|
82 |
|
83 |
}
|
84 |
-
function
|
85 |
if(isset($tweet->retweeted_status)) {
|
86 |
$rt_section = current(explode(":", $tweet->text));
|
87 |
$text = $rt_section.": ";
|
@@ -90,8 +92,8 @@
|
|
90 |
$text = $tweet->text;
|
91 |
}
|
92 |
$text = preg_replace('/((http)+(s)?:\/\/[^<>\s]+)/i', '<a href="$0" target="_blank" rel="nofollow">$0</a>', $text );
|
93 |
-
$text = preg_replace('/[@]+([A-Za-z0-9-_]+)/', '<a href="
|
94 |
-
$text = preg_replace('/[#]+([A-Za-z0-9-_]+)/', '<a href="
|
95 |
return $text;
|
96 |
|
97 |
}
|
@@ -102,13 +104,12 @@
|
|
102 |
$instance['name'] = strip_tags( $new_instance['name'] );
|
103 |
$instance['tweets_cnt'] = $new_instance['tweets_cnt'];
|
104 |
$instance['store_time'] = $new_instance['store_time'];
|
105 |
-
//$instance['dataShowCount'] = $new_instance['dataShowCount'];
|
106 |
$instance['disp_scr_name'] = $new_instance['disp_scr_name'];
|
107 |
$instance['timeAgo'] = $new_instance['timeAgo'];
|
108 |
$instance['twitterIntents'] = $new_instance['twitterIntents'];
|
109 |
$instance['twitterIntentsText'] = $new_instance['twitterIntentsText'];
|
110 |
$instance['intentColor'] = strip_tags( $new_instance['intentColor'] );
|
111 |
-
|
112 |
$instance['consumerKey'] = trim($new_instance['consumerKey']);
|
113 |
$instance['consumerSecret'] = trim($new_instance['consumerSecret']);
|
114 |
$instance['accessToken'] = trim($new_instance['accessToken']);
|
@@ -122,22 +123,21 @@
|
|
122 |
return $instance;
|
123 |
}
|
124 |
function __construct() {
|
125 |
-
add_action('admin_enqueue_scripts', array(&$this, '
|
126 |
if(!is_admin())
|
127 |
-
add_action( 'wp_enqueue_scripts', array( &$this, '
|
128 |
-
$widget_data = array('classname' => '
|
129 |
-
|
130 |
}
|
131 |
|
132 |
-
function
|
133 |
if(!is_admin()){
|
134 |
-
wp_register_style( 'wptt_front', plugins_url( '
|
135 |
wp_enqueue_style( 'wptt_front' );
|
136 |
}
|
137 |
}
|
138 |
function widget($args, $instance){
|
139 |
extract($args, EXTR_SKIP);
|
140 |
-
// print_r($args);
|
141 |
echo $before_widget;
|
142 |
$this->widgetid=$args['widget_id'];
|
143 |
$wpltf_wdgt_title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
|
@@ -145,18 +145,18 @@
|
|
145 |
$wpltf_wdgt_consumerSecret = trim($instance['consumerSecret']);
|
146 |
$wpltf_wdgt_accessTokenSecret = trim($instance['accessTokenSecret']);
|
147 |
$widget_replies_excl = isset( $instance['replies_excl'] ) ? $instance['replies_excl'] : false;
|
|
|
148 |
$wpltf_wdgt_accessToken = trim($instance['accessToken']);
|
149 |
$wpltf_wdgt_tweets_cnt = $instance['tweets_cnt'];
|
150 |
$wpltf_wdgt_store_time = $instance['store_time'];
|
151 |
$wpltf_wdgt_consumerKey = trim($instance['consumerKey']);
|
152 |
-
//$wpltf_wdgt_dataShowCount = isset( $instance['dataShowCount'] ) ? $instance['dataShowCount'] : false;
|
153 |
$wpltf_wdgt_disp_scr_name = isset( $instance['disp_scr_name'] ) ? $instance['disp_scr_name'] : false;
|
154 |
$wpltf_wdgt_timeRef = isset( $instance['timeRef'] ) ? $instance['timeRef'] : false;
|
155 |
$wpltf_wdgt_timeAgo = isset( $instance['timeAgo'] ) ? $instance['timeAgo'] : false;
|
156 |
$wpltf_wdgt_twitterIntents = isset( $instance['twitterIntents'] ) ? $instance['twitterIntents'] : false;
|
157 |
$wpltf_wdgt_twitterIntentsText = isset( $instance['twitterIntentsText'] ) ? $instance['twitterIntentsText'] : false;
|
158 |
$wpltf_wdgt_intentColor = $instance['intentColor'];
|
159 |
-
|
160 |
$wpltf_wdgt_showAvatar = isset( $instance['showAvatar'] ) ? $instance['showAvatar'] : false;
|
161 |
$wpltf_wdgt_border_rad = isset( $instance['border_rad'] ) ? $instance['border_rad'] : false;
|
162 |
$wpltf_wdgt_tewwt_border = isset( $instance['tweet_border'] ) ? $instance['tweet_border'] : 'false';
|
@@ -186,8 +186,18 @@
|
|
186 |
?>
|
187 |
|
188 |
<ul class="fetched_tweets <?php echo $class;?>">
|
189 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
|
|
|
191 |
$tweets_count = $wpltf_wdgt_tweets_cnt;
|
192 |
$name = $wpltf_wdgt_name;
|
193 |
$timeto_store = $wpltf_wdgt_store_time;
|
@@ -195,12 +205,12 @@
|
|
195 |
$accessToken = trim($wpltf_wdgt_accessToken);
|
196 |
$accessTokenSecret = trim($wpltf_wdgt_accessTokenSecret);
|
197 |
$replies_excl = $widget_replies_excl;
|
|
|
198 |
$consumerKey = trim($wpltf_wdgt_consumerKey);
|
199 |
-
|
200 |
-
$disp_screen_name = ($wpltf_wdgt_disp_scr_name != "true") ? "false" : "true";
|
201 |
$intents_text = $wpltf_wdgt_twitterIntentsText;
|
202 |
$color_intents = $wpltf_wdgt_intentColor;
|
203 |
-
|
204 |
$cache_transient = $wpltf_wdgt_timeRef;
|
205 |
$alter_ago_time = $wpltf_wdgt_timeAgo;
|
206 |
$twitterIntents = $wpltf_wdgt_twitterIntents;
|
@@ -208,40 +218,42 @@
|
|
208 |
$border_rad_avatar = $wpltf_wdgt_border_rad;
|
209 |
$transName = 'list-tweets-'.$name;
|
210 |
$backupName = $transName . '-backup';
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
|
|
215 |
$consumerKey,
|
216 |
$consumerSecret,
|
217 |
$accessToken,
|
218 |
$accessTokenSecret
|
219 |
);
|
220 |
$totalToFetch = ($replies_excl) ? max(50, $tweets_count * 3) : $tweets_count;
|
221 |
-
|
222 |
$fetchedTweets = $api_call->get(
|
223 |
'statuses/user_timeline',
|
224 |
array(
|
225 |
'screen_name' => $name,
|
226 |
'count' => $totalToFetch,
|
227 |
-
'
|
228 |
)
|
229 |
);
|
230 |
-
|
231 |
if($api_call->http_code != 200) :
|
232 |
$tweets = get_option($backupName);
|
233 |
|
234 |
else :
|
235 |
$limitToDisplay = min($tweets_count, count($fetchedTweets));
|
236 |
-
|
237 |
for($i = 0; $i < $limitToDisplay; $i++) :
|
|
|
238 |
$tweet = $fetchedTweets[$i];
|
239 |
-
|
240 |
$screen_name = $tweet->user->screen_name;
|
241 |
-
$permalink = '
|
242 |
$tweet_id = $tweet->id_str;
|
243 |
$image = $tweet->user->profile_image_url;
|
244 |
-
$text = $this->
|
245 |
$time = $tweet->created_at;
|
246 |
$time = date_parse($time);
|
247 |
$uTime = mktime($time['hour'], $time['minute'], $time['second'], $time['month'], $time['day'], $time['year']);
|
@@ -256,14 +268,19 @@
|
|
256 |
'time' => $uTime,
|
257 |
'tweet_id' => $tweet_id
|
258 |
);
|
|
|
259 |
endfor;
|
260 |
set_transient($transName, $tweets, 60 * $timeto_store);
|
261 |
update_option($backupName, $tweets);
|
|
|
262 |
endif;
|
|
|
263 |
endif;
|
264 |
-
|
|
|
265 |
{
|
266 |
-
|
|
|
267 |
$diff = human_time_diff($from,$to);
|
268 |
$replace = array(
|
269 |
' hour' => 'h',
|
@@ -278,8 +295,11 @@
|
|
278 |
return strtr($diff,$replace);
|
279 |
}
|
280 |
}
|
|
|
281 |
if($tweets) : ?>
|
282 |
-
|
|
|
|
|
283 |
<li class="tweets_avatar">
|
284 |
<?php
|
285 |
echo '<div class="tweet_wrap"><div class="wdtf-user-card ltr">';
|
@@ -287,8 +307,8 @@
|
|
287 |
|
288 |
echo '<img ';
|
289 |
echo 'width="45px" height="45px"';
|
290 |
-
|
291 |
-
|
292 |
echo '"/>';
|
293 |
}
|
294 |
if(!isset($screen_name)){$screen_name = $name;}
|
@@ -310,10 +330,11 @@
|
|
310 |
<div class="times">
|
311 |
<em>
|
312 |
|
313 |
-
<a href="
|
314 |
<?php
|
315 |
if($cache_transient == "true"){
|
316 |
-
$timeDisplay =
|
|
|
317 |
}else{
|
318 |
$timeDisplay = human_time_diff($t['time'], current_time('timestamp'));
|
319 |
}
|
@@ -354,9 +375,9 @@
|
|
354 |
<div class="seperator_wpltf"></div>
|
355 |
<?php }?>
|
356 |
<ul class="tweet-actions " role="menu" >
|
357 |
-
<li><a href="
|
358 |
-
<li><a href="
|
359 |
-
<li><a href="
|
360 |
</ul>
|
361 |
</div>
|
362 |
<?php } ?>
|
@@ -378,7 +399,7 @@
|
|
378 |
wp_print_scripts('ticker_script');
|
379 |
|
380 |
}
|
381 |
-
add_action('wp_footer',array($this,'
|
382 |
}
|
383 |
|
384 |
|
@@ -387,24 +408,15 @@ wp_print_scripts('ticker_script');
|
|
387 |
}
|
388 |
|
389 |
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
*/
|
394 |
-
public function twitter_slider_script() {
|
395 |
-
|
396 |
-
}
|
397 |
-
function add_script_footer() { ?>
|
398 |
-
<?php //echo $this->widgetid; ?>
|
399 |
<script type="text/javascript">
|
400 |
jQuery(document).ready(function(){
|
401 |
jQuery(".fetched_tweets").removeClass("light");
|
402 |
|
403 |
});
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
var height_li= jQuery(".fetched_tweets li").height();
|
408 |
|
409 |
height_li=height_li+15;
|
410 |
var nt_example1 = jQuery('.fetched_tweets').newsTicker({
|
@@ -414,9 +426,5 @@ wp_print_scripts('ticker_script');
|
|
414 |
|
415 |
});</script> <?php
|
416 |
}
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
}
|
421 |
-
|
422 |
-
?>
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
3 |
+
class viwptf_TwitterTweets extends WP_Widget{
|
4 |
|
5 |
/**
|
6 |
* Widget IDs using Slider display
|
10 |
static $slider_ids = array();
|
11 |
|
12 |
function form($instance){
|
13 |
+
$defaults=$this->viwptf_get_defaults();
|
14 |
$instance = wp_parse_args( (array) $instance, $defaults );
|
15 |
$widget_title = $instance['title'];
|
16 |
$name = $instance['name'];
|
17 |
$tweets_count = $instance['tweets_cnt'];
|
18 |
$accessTokenSecret = trim($instance['accessTokenSecret']);
|
19 |
$replies_excl = $instance['replies_excl'];
|
20 |
+
|
21 |
$consumerSecret = trim($instance['consumerSecret']);
|
22 |
$accessToken = trim($instance['accessToken']);
|
23 |
$cache_transient = $instance['timeRef'];
|
24 |
$alter_ago_time = $instance['timeAgo'];
|
25 |
$twitterIntents = $instance['twitterIntents'];
|
|
|
26 |
$disp_screen_name = $instance['disp_scr_name'];
|
27 |
$timeto_store = $instance['store_time'];
|
28 |
$consumerKey = trim($instance['consumerKey']);
|
29 |
$intents_text = $instance['twitterIntentsText'];
|
30 |
$color_intents = $instance['intentColor'];
|
31 |
+
$slide_style = $instance['slide_style'];
|
32 |
$showAvatar = $instance['showAvatar'];
|
33 |
$border_rad_avatar = $instance['border_rad'];
|
34 |
$tweet_border = $instance['tweet_border'];
|
36 |
if (!in_array('curl', get_loaded_extensions())) {
|
37 |
echo '<p style="background-color:pink;padding:10px;border:1px solid red;"><strong>cURL is not installed!</strong></p>';
|
38 |
}
|
39 |
+
include( plugin_dir_path( __FILE__ ) . 'widget_html.php');
|
40 |
+
}
|
41 |
+
function viwptf_get_defaults()
|
42 |
+
{
|
43 |
$data = array(
|
44 |
'title' => 'Latest Tweets'
|
45 |
, 'name' => ''
|
61 |
, 'intentColor' => "#999999"
|
62 |
, 'showAvatar' => false
|
63 |
, 'border_rad' => false
|
64 |
+
, 'slide_style' => 'list'
|
65 |
);
|
66 |
return $data;
|
67 |
}
|
68 |
+
function viwptf_enqueue_js($hook) {
|
69 |
if( $hook != 'widgets.php' )
|
70 |
return;
|
71 |
|
83 |
wp_enqueue_script('user_validate', plugins_url( '/js/validate.js' , dirname(__FILE__) ), array('jquery'));
|
84 |
|
85 |
}
|
86 |
+
function viwptf_sanitize_links($tweet) {
|
87 |
if(isset($tweet->retweeted_status)) {
|
88 |
$rt_section = current(explode(":", $tweet->text));
|
89 |
$text = $rt_section.": ";
|
92 |
$text = $tweet->text;
|
93 |
}
|
94 |
$text = preg_replace('/((http)+(s)?:\/\/[^<>\s]+)/i', '<a href="$0" target="_blank" rel="nofollow">$0</a>', $text );
|
95 |
+
$text = preg_replace('/[@]+([A-Za-z0-9-_]+)/', '<a href="https://twitter.com/$1" target="_blank" rel="nofollow">@$1</a>', $text );
|
96 |
+
$text = preg_replace('/[#]+([A-Za-z0-9-_]+)/', '<a href="https://twitter.com/search?q=%23$1" target="_blank" rel="nofollow">$0</a>', $text );
|
97 |
return $text;
|
98 |
|
99 |
}
|
104 |
$instance['name'] = strip_tags( $new_instance['name'] );
|
105 |
$instance['tweets_cnt'] = $new_instance['tweets_cnt'];
|
106 |
$instance['store_time'] = $new_instance['store_time'];
|
|
|
107 |
$instance['disp_scr_name'] = $new_instance['disp_scr_name'];
|
108 |
$instance['timeAgo'] = $new_instance['timeAgo'];
|
109 |
$instance['twitterIntents'] = $new_instance['twitterIntents'];
|
110 |
$instance['twitterIntentsText'] = $new_instance['twitterIntentsText'];
|
111 |
$instance['intentColor'] = strip_tags( $new_instance['intentColor'] );
|
112 |
+
$instance['slide_style'] = $new_instance['slide_style'];
|
113 |
$instance['consumerKey'] = trim($new_instance['consumerKey']);
|
114 |
$instance['consumerSecret'] = trim($new_instance['consumerSecret']);
|
115 |
$instance['accessToken'] = trim($new_instance['accessToken']);
|
123 |
return $instance;
|
124 |
}
|
125 |
function __construct() {
|
126 |
+
add_action('admin_enqueue_scripts', array(&$this, 'viwptf_enqueue_js'));
|
127 |
if(!is_admin())
|
128 |
+
add_action( 'wp_enqueue_scripts', array( &$this, 'viwptf_register_styles' ) );
|
129 |
+
$widget_data = array('classname' => 'TwitterTweets', 'description' => 'A simple widget which lets you add your latest tweets in just a few clicks on your website.' );
|
130 |
+
parent::__construct('wptt_TwitterTweets', 'WP Twitter Feeds', $widget_data);
|
131 |
}
|
132 |
|
133 |
+
function viwptf_register_styles() {
|
134 |
if(!is_admin()){
|
135 |
+
wp_register_style( 'wptt_front', plugins_url( '../css/admin_style.min.css' , __FILE__ ) );
|
136 |
wp_enqueue_style( 'wptt_front' );
|
137 |
}
|
138 |
}
|
139 |
function widget($args, $instance){
|
140 |
extract($args, EXTR_SKIP);
|
|
|
141 |
echo $before_widget;
|
142 |
$this->widgetid=$args['widget_id'];
|
143 |
$wpltf_wdgt_title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
|
145 |
$wpltf_wdgt_consumerSecret = trim($instance['consumerSecret']);
|
146 |
$wpltf_wdgt_accessTokenSecret = trim($instance['accessTokenSecret']);
|
147 |
$widget_replies_excl = isset( $instance['replies_excl'] ) ? $instance['replies_excl'] : false;
|
148 |
+
|
149 |
$wpltf_wdgt_accessToken = trim($instance['accessToken']);
|
150 |
$wpltf_wdgt_tweets_cnt = $instance['tweets_cnt'];
|
151 |
$wpltf_wdgt_store_time = $instance['store_time'];
|
152 |
$wpltf_wdgt_consumerKey = trim($instance['consumerKey']);
|
|
|
153 |
$wpltf_wdgt_disp_scr_name = isset( $instance['disp_scr_name'] ) ? $instance['disp_scr_name'] : false;
|
154 |
$wpltf_wdgt_timeRef = isset( $instance['timeRef'] ) ? $instance['timeRef'] : false;
|
155 |
$wpltf_wdgt_timeAgo = isset( $instance['timeAgo'] ) ? $instance['timeAgo'] : false;
|
156 |
$wpltf_wdgt_twitterIntents = isset( $instance['twitterIntents'] ) ? $instance['twitterIntents'] : false;
|
157 |
$wpltf_wdgt_twitterIntentsText = isset( $instance['twitterIntentsText'] ) ? $instance['twitterIntentsText'] : false;
|
158 |
$wpltf_wdgt_intentColor = $instance['intentColor'];
|
159 |
+
$wpltf_wdgt_slide_style = isset( $instance['slide_style'] ) ? $instance['slide_style'] : 'list';
|
160 |
$wpltf_wdgt_showAvatar = isset( $instance['showAvatar'] ) ? $instance['showAvatar'] : false;
|
161 |
$wpltf_wdgt_border_rad = isset( $instance['border_rad'] ) ? $instance['border_rad'] : false;
|
162 |
$wpltf_wdgt_tewwt_border = isset( $instance['tweet_border'] ) ? $instance['tweet_border'] : 'false';
|
186 |
?>
|
187 |
|
188 |
<ul class="fetched_tweets <?php echo $class;?>">
|
189 |
+
<?php
|
190 |
+
/*
|
191 |
+
* Uses:
|
192 |
+
* Twitter API call:
|
193 |
+
* http://dev.twitter.com/doc/get/statuses/user_timeline
|
194 |
+
* WP transient API ref.
|
195 |
+
* http://www.problogdesign.com/wordpress/use-the-transients-api-to-list-the-latest-commenter/
|
196 |
+
* Plugin Development and Script enhancement
|
197 |
+
* http://www.planet-interactive.co.uk
|
198 |
+
*/
|
199 |
|
200 |
+
|
201 |
$tweets_count = $wpltf_wdgt_tweets_cnt;
|
202 |
$name = $wpltf_wdgt_name;
|
203 |
$timeto_store = $wpltf_wdgt_store_time;
|
205 |
$accessToken = trim($wpltf_wdgt_accessToken);
|
206 |
$accessTokenSecret = trim($wpltf_wdgt_accessTokenSecret);
|
207 |
$replies_excl = $widget_replies_excl;
|
208 |
+
|
209 |
$consumerKey = trim($wpltf_wdgt_consumerKey);
|
210 |
+
$disp_screen_name = ($wpltf_wdgt_disp_scr_name != "true") ? "false" : "true";
|
|
|
211 |
$intents_text = $wpltf_wdgt_twitterIntentsText;
|
212 |
$color_intents = $wpltf_wdgt_intentColor;
|
213 |
+
$slide_style = $wpltf_wdgt_slide_style;
|
214 |
$cache_transient = $wpltf_wdgt_timeRef;
|
215 |
$alter_ago_time = $wpltf_wdgt_timeAgo;
|
216 |
$twitterIntents = $wpltf_wdgt_twitterIntents;
|
218 |
$border_rad_avatar = $wpltf_wdgt_border_rad;
|
219 |
$transName = 'list-tweets-'.$name;
|
220 |
$backupName = $transName . '-backup';
|
221 |
+
|
222 |
+
if(false === ($tweets = get_transient($transName) ) ) :
|
223 |
+
include( plugin_dir_path( __FILE__ ) . 'twitteroauth/twitteroauth.php');
|
224 |
+
|
225 |
+
$api_call = new viwptf_TwitterOAuth(
|
226 |
$consumerKey,
|
227 |
$consumerSecret,
|
228 |
$accessToken,
|
229 |
$accessTokenSecret
|
230 |
);
|
231 |
$totalToFetch = ($replies_excl) ? max(50, $tweets_count * 3) : $tweets_count;
|
232 |
+
|
233 |
$fetchedTweets = $api_call->get(
|
234 |
'statuses/user_timeline',
|
235 |
array(
|
236 |
'screen_name' => $name,
|
237 |
'count' => $totalToFetch,
|
238 |
+
'exclude_replies' => $replies_excl
|
239 |
)
|
240 |
);
|
241 |
+
|
242 |
if($api_call->http_code != 200) :
|
243 |
$tweets = get_option($backupName);
|
244 |
|
245 |
else :
|
246 |
$limitToDisplay = min($tweets_count, count($fetchedTweets));
|
247 |
+
|
248 |
for($i = 0; $i < $limitToDisplay; $i++) :
|
249 |
+
|
250 |
$tweet = $fetchedTweets[$i];
|
251 |
+
|
252 |
$screen_name = $tweet->user->screen_name;
|
253 |
+
$permalink = 'https://twitter.com/'. $name .'/status/'. $tweet->id_str;
|
254 |
$tweet_id = $tweet->id_str;
|
255 |
$image = $tweet->user->profile_image_url;
|
256 |
+
$text = $this->viwptf_sanitize_links($tweet);
|
257 |
$time = $tweet->created_at;
|
258 |
$time = date_parse($time);
|
259 |
$uTime = mktime($time['hour'], $time['minute'], $time['second'], $time['month'], $time['day'], $time['year']);
|
268 |
'time' => $uTime,
|
269 |
'tweet_id' => $tweet_id
|
270 |
);
|
271 |
+
|
272 |
endfor;
|
273 |
set_transient($transName, $tweets, 60 * $timeto_store);
|
274 |
update_option($backupName, $tweets);
|
275 |
+
|
276 |
endif;
|
277 |
+
|
278 |
endif;
|
279 |
+
|
280 |
+
if(!function_exists('wtf_twitter_time_diff'))
|
281 |
{
|
282 |
+
|
283 |
+
function wtf_twitter_time_diff( $from, $to = '' ) {
|
284 |
$diff = human_time_diff($from,$to);
|
285 |
$replace = array(
|
286 |
' hour' => 'h',
|
295 |
return strtr($diff,$replace);
|
296 |
}
|
297 |
}
|
298 |
+
|
299 |
if($tweets) : ?>
|
300 |
+
|
301 |
+
<?php foreach($tweets as $t) : ?>
|
302 |
+
|
303 |
<li class="tweets_avatar">
|
304 |
<?php
|
305 |
echo '<div class="tweet_wrap"><div class="wdtf-user-card ltr">';
|
307 |
|
308 |
echo '<img ';
|
309 |
echo 'width="45px" height="45px"';
|
310 |
+
echo 'src="' . str_replace('http://', '//', $t['image']) . '" alt="Tweet Avatar" class="';
|
311 |
+
echo ($border_rad_avatar) ? 'circular':'';
|
312 |
echo '"/>';
|
313 |
}
|
314 |
if(!isset($screen_name)){$screen_name = $name;}
|
330 |
<div class="times">
|
331 |
<em>
|
332 |
|
333 |
+
<a href="https://www.twitter.com/<?php echo $screen_name; ?>" target="_blank" title="Follow <?php echo $name; ?> on Twitter [Opens new window]">
|
334 |
<?php
|
335 |
if($cache_transient == "true"){
|
336 |
+
$timeDisplay = wtf_twitter_time_diff($t['time'], current_time('timestamp'));
|
337 |
+
|
338 |
}else{
|
339 |
$timeDisplay = human_time_diff($t['time'], current_time('timestamp'));
|
340 |
}
|
375 |
<div class="seperator_wpltf"></div>
|
376 |
<?php }?>
|
377 |
<ul class="tweet-actions " role="menu" >
|
378 |
+
<li><a href="https://twitter.com/intent/tweet?in_reply_to=<?php echo $t['tweet_id']; ?>" data-lang="en" class="in-reply-to" title="Reply" target="_blank"><span aria-hidden="true" data-icon="" <?php echo ($color_intents) ? 'style="color:'.$color_intents.';"' :''; ?>></span></a></li>
|
379 |
+
<li><a href="https://twitter.com/intent/retweet?tweet_id=<?php echo $t['tweet_id']; ?>" data-lang="en" class="retweet" title="Retweet" target="_blank"><span aria-hidden="true" data-icon="" <?php echo ($color_intents) ? 'style="color:'.$color_intents.';"' :''; ?>></span></a></li>
|
380 |
+
<li><a href="https://twitter.com/intent/favorite?tweet_id=<?php echo $t['tweet_id']; ?>" data-lang="en" class="favorite" title="Favorite" target="_blank"><span aria-hidden="true" data-icon="" <?php echo ($color_intents) ? 'style="color:'.$color_intents.';"' :''; ?>></span></a></li>
|
381 |
</ul>
|
382 |
</div>
|
383 |
<?php } ?>
|
399 |
wp_print_scripts('ticker_script');
|
400 |
|
401 |
}
|
402 |
+
add_action('wp_footer',array($this,'viwptf_add_script_footer'));
|
403 |
}
|
404 |
|
405 |
|
408 |
}
|
409 |
|
410 |
|
411 |
+
|
412 |
+
function viwptf_add_script_footer() { ?>
|
413 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
414 |
<script type="text/javascript">
|
415 |
jQuery(document).ready(function(){
|
416 |
jQuery(".fetched_tweets").removeClass("light");
|
417 |
|
418 |
});
|
419 |
+
var height_li= jQuery(".fetched_tweets li").height();
|
|
|
|
|
|
|
420 |
|
421 |
height_li=height_li+15;
|
422 |
var nt_example1 = jQuery('.fetched_tweets').newsTicker({
|
426 |
|
427 |
});</script> <?php
|
428 |
}
|
|
|
|
|
|
|
429 |
}
|
430 |
+
?>
|
|
controller/twitteroauth/OAuth.php
CHANGED
@@ -1,11 +1,7 @@
|
|
1 |
<?php
|
2 |
-
if (!
|
3 |
-
class OAuthException extends Exception {
|
4 |
-
|
5 |
-
}
|
6 |
-
}
|
7 |
|
8 |
-
class
|
9 |
public $key;
|
10 |
public $secret;
|
11 |
|
@@ -20,7 +16,7 @@ class OAuthConsumer {
|
|
20 |
}
|
21 |
}
|
22 |
|
23 |
-
class
|
24 |
public $key;
|
25 |
public $secret;
|
26 |
|
@@ -32,9 +28,9 @@ class OAuthToken {
|
|
32 |
|
33 |
function to_string() {
|
34 |
return "oauth_token=" .
|
35 |
-
|
36 |
"&oauth_token_secret=" .
|
37 |
-
|
38 |
}
|
39 |
|
40 |
function __toString() {
|
@@ -42,7 +38,7 @@ class OAuthToken {
|
|
42 |
}
|
43 |
}
|
44 |
|
45 |
-
abstract class
|
46 |
|
47 |
abstract public function get_name();
|
48 |
|
@@ -55,7 +51,7 @@ abstract class OAuthSignatureMethod {
|
|
55 |
}
|
56 |
}
|
57 |
|
58 |
-
class
|
59 |
function get_name() {
|
60 |
return "HMAC-SHA1";
|
61 |
}
|
@@ -69,7 +65,7 @@ class OAuthSignatureMethod_HMAC_SHA1 extends OAuthSignatureMethod {
|
|
69 |
($token) ? $token->secret : ""
|
70 |
);
|
71 |
|
72 |
-
$key_parts =
|
73 |
$key = implode('&', $key_parts);
|
74 |
|
75 |
return base64_encode(hash_hmac('sha1', $base_string, $key, true));
|
@@ -77,7 +73,7 @@ class OAuthSignatureMethod_HMAC_SHA1 extends OAuthSignatureMethod {
|
|
77 |
}
|
78 |
|
79 |
|
80 |
-
class
|
81 |
public function get_name() {
|
82 |
return "PLAINTEXT";
|
83 |
}
|
@@ -89,7 +85,7 @@ class OAuthSignatureMethod_PLAINTEXT extends OAuthSignatureMethod {
|
|
89 |
($token) ? $token->secret : ""
|
90 |
);
|
91 |
|
92 |
-
$key_parts =
|
93 |
$key = implode('&', $key_parts);
|
94 |
$request->base_string = $key;
|
95 |
|
@@ -98,7 +94,7 @@ class OAuthSignatureMethod_PLAINTEXT extends OAuthSignatureMethod {
|
|
98 |
}
|
99 |
|
100 |
|
101 |
-
abstract class
|
102 |
public function get_name() {
|
103 |
return "RSA-SHA1";
|
104 |
}
|
@@ -142,7 +138,7 @@ abstract class OAuthSignatureMethod_RSA_SHA1 extends OAuthSignatureMethod {
|
|
142 |
}
|
143 |
}
|
144 |
|
145 |
-
class
|
146 |
private $parameters;
|
147 |
private $http_method;
|
148 |
private $http_url;
|
@@ -152,7 +148,7 @@ class OAuthRequest {
|
|
152 |
|
153 |
function __construct($http_method, $http_url, $parameters=NULL) {
|
154 |
@$parameters or $parameters = array();
|
155 |
-
$parameters = array_merge(
|
156 |
$this->parameters = $parameters;
|
157 |
$this->http_method = $http_method;
|
158 |
$this->http_url = $http_url;
|
@@ -172,23 +168,23 @@ class OAuthRequest {
|
|
172 |
|
173 |
if (!$parameters) {
|
174 |
|
175 |
-
$request_headers =
|
176 |
|
177 |
|
178 |
-
$parameters =
|
179 |
|
180 |
if ($http_method == "POST"
|
181 |
&& @strstr($request_headers["Content-Type"],
|
182 |
"application/x-www-form-urlencoded")
|
183 |
) {
|
184 |
-
$post_data =
|
185 |
file_get_contents(self::$POST_INPUT)
|
186 |
);
|
187 |
$parameters = array_merge($parameters, $post_data);
|
188 |
}
|
189 |
|
190 |
if (@substr($request_headers['Authorization'], 0, 6) == "OAuth ") {
|
191 |
-
$header_parameters =
|
192 |
$request_headers['Authorization']
|
193 |
);
|
194 |
$parameters = array_merge($parameters, $header_parameters);
|
@@ -201,16 +197,16 @@ class OAuthRequest {
|
|
201 |
|
202 |
public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters=NULL) {
|
203 |
@$parameters or $parameters = array();
|
204 |
-
$defaults = array("oauth_version" =>
|
205 |
-
"oauth_nonce" =>
|
206 |
-
"oauth_timestamp" =>
|
207 |
"oauth_consumer_key" => $consumer->key);
|
208 |
if ($token)
|
209 |
$defaults['oauth_token'] = $token->key;
|
210 |
|
211 |
$parameters = array_merge($defaults, $parameters);
|
212 |
|
213 |
-
return new
|
214 |
}
|
215 |
|
216 |
public function set_parameter($name, $value, $allow_duplicates = true) {
|
@@ -247,7 +243,7 @@ class OAuthRequest {
|
|
247 |
unset($params['oauth_signature']);
|
248 |
}
|
249 |
|
250 |
-
return
|
251 |
}
|
252 |
|
253 |
public function get_signature_base_string() {
|
@@ -257,7 +253,7 @@ class OAuthRequest {
|
|
257 |
$this->get_signable_parameters()
|
258 |
);
|
259 |
|
260 |
-
$parts =
|
261 |
|
262 |
return implode('&', $parts);
|
263 |
}
|
@@ -293,13 +289,13 @@ class OAuthRequest {
|
|
293 |
}
|
294 |
|
295 |
public function to_postdata() {
|
296 |
-
return
|
297 |
}
|
298 |
|
299 |
public function to_header($realm=null) {
|
300 |
$first = true;
|
301 |
if($realm) {
|
302 |
-
$out = 'Authorization: OAuth realm="' .
|
303 |
$first = false;
|
304 |
} else
|
305 |
$out = 'Authorization: OAuth';
|
@@ -311,9 +307,9 @@ class OAuthRequest {
|
|
311 |
throw new OAuthException('Arrays not supported in headers');
|
312 |
}
|
313 |
$out .= ($first) ? ' ' : ',';
|
314 |
-
$out .=
|
315 |
'="' .
|
316 |
-
|
317 |
'"';
|
318 |
$first = false;
|
319 |
}
|
@@ -354,7 +350,7 @@ class OAuthRequest {
|
|
354 |
}
|
355 |
}
|
356 |
|
357 |
-
class
|
358 |
protected $timestamp_threshold = 300; // in seconds, five minutes
|
359 |
protected $version = '1.0'; // hi blaine
|
360 |
protected $signature_methods = array();
|
@@ -520,33 +516,11 @@ class OAuthServer {
|
|
520 |
|
521 |
}
|
522 |
|
523 |
-
class OAuthDataStore {
|
524 |
-
function lookup_consumer($consumer_key) {
|
525 |
-
|
526 |
-
}
|
527 |
-
|
528 |
-
function lookup_token($consumer, $token_type, $token) {
|
529 |
-
|
530 |
-
}
|
531 |
-
|
532 |
-
function lookup_nonce($consumer, $token, $nonce, $timestamp) {
|
533 |
-
|
534 |
-
}
|
535 |
-
|
536 |
-
function new_request_token($consumer, $callback = null) {
|
537 |
-
|
538 |
-
}
|
539 |
-
|
540 |
-
function new_access_token($token, $consumer, $verifier = null) {
|
541 |
-
|
542 |
-
}
|
543 |
-
|
544 |
-
}
|
545 |
|
546 |
-
class
|
547 |
public static function urlencode_rfc3986($input) {
|
548 |
if (is_array($input)) {
|
549 |
-
return array_map(array('
|
550 |
} else if (is_scalar($input)) {
|
551 |
return str_replace(
|
552 |
'+',
|
@@ -571,7 +545,7 @@ class OAuthUtil {
|
|
571 |
$header_name = $matches[2][0];
|
572 |
$header_content = (isset($matches[5])) ? $matches[5][0] : $matches[4][0];
|
573 |
if (preg_match('/^oauth_/', $header_name) || !$only_allow_oauth_parameters) {
|
574 |
-
$params[$header_name] =
|
575 |
}
|
576 |
$offset = $match[1] + strlen($match[0]);
|
577 |
}
|
@@ -628,8 +602,8 @@ class OAuthUtil {
|
|
628 |
$parsed_parameters = array();
|
629 |
foreach ($pairs as $pair) {
|
630 |
$split = explode('=', $pair, 2);
|
631 |
-
$parameter =
|
632 |
-
$value = isset($split[1]) ?
|
633 |
|
634 |
if (isset($parsed_parameters[$parameter])) {
|
635 |
|
@@ -650,8 +624,8 @@ class OAuthUtil {
|
|
650 |
public static function build_http_query($params) {
|
651 |
if (!$params) return '';
|
652 |
|
653 |
-
$keys =
|
654 |
-
$values =
|
655 |
$params = array_combine($keys, $values);
|
656 |
|
657 |
uksort($params, 'strcmp');
|
1 |
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
|
|
|
|
|
|
|
|
3 |
|
4 |
+
class viwptf_OAuthConsumer {
|
5 |
public $key;
|
6 |
public $secret;
|
7 |
|
16 |
}
|
17 |
}
|
18 |
|
19 |
+
class viwptf_OAuthToken {
|
20 |
public $key;
|
21 |
public $secret;
|
22 |
|
28 |
|
29 |
function to_string() {
|
30 |
return "oauth_token=" .
|
31 |
+
viwptf_OAuthUtil::urlencode_rfc3986($this->key) .
|
32 |
"&oauth_token_secret=" .
|
33 |
+
viwptf_OAuthUtil::urlencode_rfc3986($this->secret);
|
34 |
}
|
35 |
|
36 |
function __toString() {
|
38 |
}
|
39 |
}
|
40 |
|
41 |
+
abstract class viwptf_OAuthSignatureMethod {
|
42 |
|
43 |
abstract public function get_name();
|
44 |
|
51 |
}
|
52 |
}
|
53 |
|
54 |
+
class viwptf_OAuthSignatureMethod_HMAC_SHA1 extends viwptf_OAuthSignatureMethod {
|
55 |
function get_name() {
|
56 |
return "HMAC-SHA1";
|
57 |
}
|
65 |
($token) ? $token->secret : ""
|
66 |
);
|
67 |
|
68 |
+
$key_parts = viwptf_OAuthUtil::urlencode_rfc3986($key_parts);
|
69 |
$key = implode('&', $key_parts);
|
70 |
|
71 |
return base64_encode(hash_hmac('sha1', $base_string, $key, true));
|
73 |
}
|
74 |
|
75 |
|
76 |
+
class viwptf_OAuthSignatureMethod_PLAINTEXT extends viwptf_OAuthSignatureMethod {
|
77 |
public function get_name() {
|
78 |
return "PLAINTEXT";
|
79 |
}
|
85 |
($token) ? $token->secret : ""
|
86 |
);
|
87 |
|
88 |
+
$key_parts = viwptf_OAuthUtil::urlencode_rfc3986($key_parts);
|
89 |
$key = implode('&', $key_parts);
|
90 |
$request->base_string = $key;
|
91 |
|
94 |
}
|
95 |
|
96 |
|
97 |
+
abstract class viwptf_OAuthSignatureMethod_RSA_SHA1 extends viwptf_OAuthSignatureMethod {
|
98 |
public function get_name() {
|
99 |
return "RSA-SHA1";
|
100 |
}
|
138 |
}
|
139 |
}
|
140 |
|
141 |
+
class viwptf_OAuthRequest {
|
142 |
private $parameters;
|
143 |
private $http_method;
|
144 |
private $http_url;
|
148 |
|
149 |
function __construct($http_method, $http_url, $parameters=NULL) {
|
150 |
@$parameters or $parameters = array();
|
151 |
+
$parameters = array_merge( viwptf_OAuthUtil::parse_parameters(parse_url($http_url, PHP_URL_QUERY)), $parameters);
|
152 |
$this->parameters = $parameters;
|
153 |
$this->http_method = $http_method;
|
154 |
$this->http_url = $http_url;
|
168 |
|
169 |
if (!$parameters) {
|
170 |
|
171 |
+
$request_headers = viwptf_OAuthUtil::get_headers();
|
172 |
|
173 |
|
174 |
+
$parameters = viwptf_OAuthUtil::parse_parameters($_SERVER['QUERY_STRING']);
|
175 |
|
176 |
if ($http_method == "POST"
|
177 |
&& @strstr($request_headers["Content-Type"],
|
178 |
"application/x-www-form-urlencoded")
|
179 |
) {
|
180 |
+
$post_data = viwptf_OAuthUtil::parse_parameters(
|
181 |
file_get_contents(self::$POST_INPUT)
|
182 |
);
|
183 |
$parameters = array_merge($parameters, $post_data);
|
184 |
}
|
185 |
|
186 |
if (@substr($request_headers['Authorization'], 0, 6) == "OAuth ") {
|
187 |
+
$header_parameters = viwptf_OAuthUtil::split_header(
|
188 |
$request_headers['Authorization']
|
189 |
);
|
190 |
$parameters = array_merge($parameters, $header_parameters);
|
197 |
|
198 |
public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters=NULL) {
|
199 |
@$parameters or $parameters = array();
|
200 |
+
$defaults = array("oauth_version" => viwptf_OAuthRequest::$version,
|
201 |
+
"oauth_nonce" => viwptf_OAuthRequest::generate_nonce(),
|
202 |
+
"oauth_timestamp" => viwptf_OAuthRequest::generate_timestamp(),
|
203 |
"oauth_consumer_key" => $consumer->key);
|
204 |
if ($token)
|
205 |
$defaults['oauth_token'] = $token->key;
|
206 |
|
207 |
$parameters = array_merge($defaults, $parameters);
|
208 |
|
209 |
+
return new viwptf_OAuthRequest($http_method, $http_url, $parameters);
|
210 |
}
|
211 |
|
212 |
public function set_parameter($name, $value, $allow_duplicates = true) {
|
243 |
unset($params['oauth_signature']);
|
244 |
}
|
245 |
|
246 |
+
return viwptf_OAuthUtil::build_http_query($params);
|
247 |
}
|
248 |
|
249 |
public function get_signature_base_string() {
|
253 |
$this->get_signable_parameters()
|
254 |
);
|
255 |
|
256 |
+
$parts = viwptf_OAuthUtil::urlencode_rfc3986($parts);
|
257 |
|
258 |
return implode('&', $parts);
|
259 |
}
|
289 |
}
|
290 |
|
291 |
public function to_postdata() {
|
292 |
+
return viwptf_OAuthUtil::build_http_query($this->parameters);
|
293 |
}
|
294 |
|
295 |
public function to_header($realm=null) {
|
296 |
$first = true;
|
297 |
if($realm) {
|
298 |
+
$out = 'Authorization: OAuth realm="' . viwptf_OAuthUtil::urlencode_rfc3986($realm) . '"';
|
299 |
$first = false;
|
300 |
} else
|
301 |
$out = 'Authorization: OAuth';
|
307 |
throw new OAuthException('Arrays not supported in headers');
|
308 |
}
|
309 |
$out .= ($first) ? ' ' : ',';
|
310 |
+
$out .= viwptf_OAuthUtil::urlencode_rfc3986($k) .
|
311 |
'="' .
|
312 |
+
viwptf_OAuthUtil::urlencode_rfc3986($v) .
|
313 |
'"';
|
314 |
$first = false;
|
315 |
}
|
350 |
}
|
351 |
}
|
352 |
|
353 |
+
class viwptf_OAuthServer {
|
354 |
protected $timestamp_threshold = 300; // in seconds, five minutes
|
355 |
protected $version = '1.0'; // hi blaine
|
356 |
protected $signature_methods = array();
|
516 |
|
517 |
}
|
518 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
519 |
|
520 |
+
class viwptf_OAuthUtil {
|
521 |
public static function urlencode_rfc3986($input) {
|
522 |
if (is_array($input)) {
|
523 |
+
return array_map(array('viwptf_OAuthUtil', 'urlencode_rfc3986'), $input);
|
524 |
} else if (is_scalar($input)) {
|
525 |
return str_replace(
|
526 |
'+',
|
545 |
$header_name = $matches[2][0];
|
546 |
$header_content = (isset($matches[5])) ? $matches[5][0] : $matches[4][0];
|
547 |
if (preg_match('/^oauth_/', $header_name) || !$only_allow_oauth_parameters) {
|
548 |
+
$params[$header_name] = viwptf_OAuthUtil::urldecode_rfc3986($header_content);
|
549 |
}
|
550 |
$offset = $match[1] + strlen($match[0]);
|
551 |
}
|
602 |
$parsed_parameters = array();
|
603 |
foreach ($pairs as $pair) {
|
604 |
$split = explode('=', $pair, 2);
|
605 |
+
$parameter = viwptf_OAuthUtil::urldecode_rfc3986($split[0]);
|
606 |
+
$value = isset($split[1]) ? viwptf_OAuthUtil::urldecode_rfc3986($split[1]) : '';
|
607 |
|
608 |
if (isset($parsed_parameters[$parameter])) {
|
609 |
|
624 |
public static function build_http_query($params) {
|
625 |
if (!$params) return '';
|
626 |
|
627 |
+
$keys = viwptf_OAuthUtil::urlencode_rfc3986(array_keys($params));
|
628 |
+
$values = viwptf_OAuthUtil::urlencode_rfc3986(array_values($params));
|
629 |
$params = array_combine($keys, $values);
|
630 |
|
631 |
uksort($params, 'strcmp');
|
controller/twitteroauth/twitteroauth.php
CHANGED
@@ -1,7 +1,14 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
public $http_code;
|
7 |
public $url;
|
@@ -22,10 +29,10 @@ class TwitterOAuth {
|
|
22 |
function lastAPICall() { return $this->last_awptt_widget_call; }
|
23 |
|
24 |
function __construct($consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL) {
|
25 |
-
$this->sha1_method = new
|
26 |
-
$this->consumer = new
|
27 |
if (!empty($oauth_token) && !empty($oauth_token_secret)) {
|
28 |
-
$this->token = new
|
29 |
} else {
|
30 |
$this->token = NULL;
|
31 |
}
|
@@ -81,6 +88,7 @@ class TwitterOAuth {
|
|
81 |
return json_decode($response);
|
82 |
}
|
83 |
return $response;
|
|
|
84 |
}
|
85 |
|
86 |
function post($url, $parameters = array()) {
|
@@ -89,6 +97,7 @@ class TwitterOAuth {
|
|
89 |
return json_decode($response);
|
90 |
}
|
91 |
return $response;
|
|
|
92 |
}
|
93 |
|
94 |
function delete($url, $parameters = array()) {
|
@@ -104,7 +113,7 @@ class TwitterOAuth {
|
|
104 |
if (strrpos($url, 'https://') !== 0 && strrpos($url, 'http://') !== 0) {
|
105 |
$url = "{$this->host}{$url}.{$this->format}";
|
106 |
}
|
107 |
-
$request =
|
108 |
$request->sign_request($this->sha1_method, $this->consumer, $this->token);
|
109 |
switch ($method) {
|
110 |
case 'GET':
|
@@ -148,6 +157,7 @@ class TwitterOAuth {
|
|
148 |
$this->url = $url;
|
149 |
curl_close ($ci);
|
150 |
return $response;
|
|
|
151 |
}
|
152 |
|
153 |
function getHeader($ch, $header) {
|
1 |
<?php
|
2 |
+
/*
|
3 |
+
* Abraham Williams (abraham@abrah.am) http://abrah.am
|
4 |
+
*
|
5 |
+
* The first PHP Library to support OAuth for Twitter's REST API.
|
6 |
+
*/
|
7 |
+
|
8 |
+
/* Load OAuth lib. You can find it at http://oauth.net */
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
10 |
+
require_once( plugin_dir_path( __FILE__ ) . 'OAuth.php');
|
11 |
+
class viwptf_TwitterOAuth {
|
12 |
|
13 |
public $http_code;
|
14 |
public $url;
|
29 |
function lastAPICall() { return $this->last_awptt_widget_call; }
|
30 |
|
31 |
function __construct($consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL) {
|
32 |
+
$this->sha1_method = new viwptf_OAuthSignatureMethod_HMAC_SHA1();
|
33 |
+
$this->consumer = new viwptf_OAuthConsumer($consumer_key, $consumer_secret);
|
34 |
if (!empty($oauth_token) && !empty($oauth_token_secret)) {
|
35 |
+
$this->token = new viwptf_OAuthConsumer($oauth_token, $oauth_token_secret);
|
36 |
} else {
|
37 |
$this->token = NULL;
|
38 |
}
|
88 |
return json_decode($response);
|
89 |
}
|
90 |
return $response;
|
91 |
+
|
92 |
}
|
93 |
|
94 |
function post($url, $parameters = array()) {
|
97 |
return json_decode($response);
|
98 |
}
|
99 |
return $response;
|
100 |
+
|
101 |
}
|
102 |
|
103 |
function delete($url, $parameters = array()) {
|
113 |
if (strrpos($url, 'https://') !== 0 && strrpos($url, 'http://') !== 0) {
|
114 |
$url = "{$this->host}{$url}.{$this->format}";
|
115 |
}
|
116 |
+
$request = viwptf_OAuthRequest::from_consumer_and_token($this->consumer, $this->token, $method, $url, $parameters);
|
117 |
$request->sign_request($this->sha1_method, $this->consumer, $this->token);
|
118 |
switch ($method) {
|
119 |
case 'GET':
|
157 |
$this->url = $url;
|
158 |
curl_close ($ci);
|
159 |
return $response;
|
160 |
+
|
161 |
}
|
162 |
|
163 |
function getHeader($ch, $header) {
|
controller/widget_html.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
-
<?php
|
|
|
|
|
2 |
$cancel_url=plugins_url( '../images/rsz_1onebit_33.png',__FILE__);?>
|
3 |
<style>input.user-validator-valid {
|
4 |
background-color: #CFFAD7;
|
@@ -17,71 +19,68 @@ background-repeat:no-repeat;
|
|
17 |
font-weight:bold;
|
18 |
}
|
19 |
</style>
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
<p>
|
24 |
-
<label for="<?php echo $this->get_field_id('title'); ?>"
|
25 |
</p>
|
26 |
<p>
|
27 |
-
<label for="<?php echo $this->get_field_id('name'); ?>"
|
28 |
-
<span class="widefat user-validator"
|
29 |
</p>
|
30 |
<p>
|
31 |
-
<label for="<?php echo $this->get_field_id('store_time'); ?>"
|
32 |
</p>
|
33 |
<p>
|
34 |
-
<label for="<?php echo
|
35 |
</p>
|
36 |
|
37 |
-
<h4 style="width:100%; text-align:center;"
|
38 |
<div style="padding:10px;">
|
39 |
<p>
|
40 |
-
<label for="<?php echo $this->get_field_id('consumerKey'); ?>"
|
41 |
</p>
|
42 |
<p>
|
43 |
-
<label for="<?php echo $this->get_field_id('consumerSecret'); ?>"
|
44 |
</p>
|
45 |
<p>
|
46 |
-
<label for="<?php echo $this->get_field_id('accessToken'); ?>"
|
47 |
</p>
|
48 |
<p>
|
49 |
-
<label for="<?php echo $this->get_field_id('accessTokenSecret'); ?>"
|
50 |
</p>
|
51 |
|
52 |
</div>
|
53 |
-
<h4 style="width:100%; text-align:center;"
|
54 |
<div style="padding:10px;">
|
55 |
<p>
|
56 |
<input class="checkbox" type="checkbox" value="true" <?php checked( (isset( $instance['twitterIntents']) && ($instance['twitterIntents'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'twitterIntents' ); ?>" name="<?php echo $this->get_field_name( 'twitterIntents' ); ?>" />
|
57 |
-
<label for="<?php echo $this->get_field_id( 'twitterIntents' ); ?>"
|
58 |
</p>
|
59 |
<p>
|
60 |
<input class="checkbox" type="checkbox" value="true" <?php checked( (isset( $instance['twitterIntentsText']) && ($instance['twitterIntentsText'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'twitterIntentsText' ); ?>" name="<?php echo $this->get_field_name( 'twitterIntentsText' ); ?>" />
|
61 |
-
<label for="<?php echo $this->get_field_id( 'twitterIntentsText' ); ?>"
|
62 |
</p>
|
63 |
<p>
|
64 |
-
<label for="<?php echo $this->get_field_id('intentColor'); ?>"
|
65 |
<div id="colorpicker"></div>
|
66 |
</p>
|
67 |
<p>
|
68 |
-
<label for="<?php echo $this->get_field_id( 'slide_style' ); ?>"
|
69 |
<select name="<?php echo $this->get_field_name( 'slide_style' ); ?>" id="<?php echo $this->get_field_id( 'slide_style' ); ?>" style="width: 100%;">
|
70 |
-
<option value="list" <?php if(isset($slide_style) && $slide_style=='list'){echo 'selected';}
|
71 |
-
<option value="slider" <?php if(isset($slide_style) && $slide_style=='slider'){echo 'selected';}
|
72 |
</select>
|
73 |
</p>
|
74 |
<p>
|
75 |
<input class="checkbox" type="checkbox" value="true" <?php checked( ( isset( $instance['border_rad']) && ($instance['showAvatar'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'border_rad' ); ?>" name="<?php echo $this->get_field_name( 'border_rad' ); ?>" />
|
76 |
-
<label for="<?php echo $this->get_field_id( 'border_rad' ); ?>"
|
77 |
</p>
|
78 |
<p>
|
79 |
<input class="checkbox" type="checkbox" value="true" <?php checked( ( isset( $instance['showAvatar']) && ($instance['showAvatar'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'showAvatar' ); ?>" name="<?php echo $this->get_field_name( 'showAvatar' ); ?>" />
|
80 |
-
<label for="<?php echo $this->get_field_id( 'showAvatar' ); ?>"
|
81 |
</p>
|
82 |
|
83 |
<p>
|
84 |
-
<input class="checkbox" type="checkbox" <?php checked( isset( $instance['replies_excl']), true ); ?> id="<?php echo $this->get_field_id( 'replies_excl' ); ?>" name="<?php echo $this->get_field_name( 'replies_excl' ); ?>" />
|
85 |
<label for="<?php echo $this->get_field_id( 'replies_excl' ); ?>">Exclude @replies</label>
|
86 |
</p>
|
87 |
<p>
|
@@ -90,25 +89,24 @@ font-weight:bold;
|
|
90 |
</p>
|
91 |
<p>
|
92 |
<input class="checkbox" type="checkbox" value="true" <?php checked( (isset( $instance['timeRef']) && ($instance['timeRef'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'timeRef' ); ?>" name="<?php echo $this->get_field_name( 'timeRef' ); ?>" />
|
93 |
-
<label for="<?php echo $this->get_field_id( 'timeRef' ); ?>"
|
94 |
</p>
|
95 |
<p>
|
96 |
<input class="checkbox" type="checkbox" <?php checked( (isset( $instance['disp_scr_name']) && ($instance['disp_scr_name'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'disp_scr_name' ); ?>" name="<?php echo $this->get_field_name( 'disp_scr_name' ); ?>" value="true" />
|
97 |
-
<label for="<?php echo $this->get_field_id( 'disp_scr_name' ); ?>"
|
98 |
</p>
|
99 |
<p>
|
100 |
-
<label for="<?php echo $this->get_field_id( 'tweet_border' ); ?>"
|
101 |
<select name="<?php echo $this->get_field_name( 'tweet_border' ); ?>" id="<?php echo $this->get_field_id( 'tweet_border' ); ?>" style="width: 100%;">
|
102 |
-
<option value="true" <?php if(isset($tweet_border) && $tweet_border=='true'){echo 'selected';}
|
103 |
-
<option value="false" <?php if(isset($tweet_border) && $tweet_border=='false'){echo 'selected';}
|
104 |
</select>
|
105 |
</p>
|
106 |
<p>
|
107 |
-
<label for="<?php echo $this->get_field_id( 'tweet_theme' ); ?>"
|
108 |
<select name="<?php echo $this->get_field_name( 'tweet_theme' ); ?>" id="<?php echo $this->get_field_id( 'tweet_theme' ); ?>" style="width: 100%;">
|
109 |
-
<option value="light" <?php if(isset($tweet_theme) && $tweet_theme=='light'){echo 'selected';}
|
110 |
-
<option value="dark" <?php if(isset($tweet_theme) && $tweet_theme=='dark'){echo 'selected';}
|
111 |
</select>
|
112 |
</p>
|
113 |
-
</div>
|
114 |
-
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
3 |
+
$ok_url=plugins_url( '../images/rsz_11button_ok.png',__FILE__);
|
4 |
$cancel_url=plugins_url( '../images/rsz_1onebit_33.png',__FILE__);?>
|
5 |
<style>input.user-validator-valid {
|
6 |
background-color: #CFFAD7;
|
19 |
font-weight:bold;
|
20 |
}
|
21 |
</style>
|
|
|
|
|
|
|
22 |
<p>
|
23 |
+
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Widget Title: ', 'viva-twitter-feed' ); ?><input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($widget_title); ?>" /></label>
|
24 |
</p>
|
25 |
<p>
|
26 |
+
<label for="<?php echo $this->get_field_id('name'); ?>"><?php _e( 'Twitter User Name: ', 'viva-twitter-feed' ); ?><input class="widefat twitter_user_name" id="<?php echo $this->get_field_id('name'); ?>" name="<?php echo $this->get_field_name('name'); ?>" type="text" value="<?php echo esc_attr($name); ?>" /></label>
|
27 |
+
<span class="widefat user-validator"><?php _e( 'Start entering your user name: ', 'viva-twitter-feed' ); ?></span>
|
28 |
</p>
|
29 |
<p>
|
30 |
+
<label for="<?php echo $this->get_field_id('store_time'); ?>"><?php _e( 'Tweets Cache Time (in minutes): ', 'viva-twitter-feed' ); ?><input class="widefat" id="<?php echo $this->get_field_id('store_time'); ?>" name="<?php echo $this->get_field_name('store_time'); ?>" type="text" value="<?php echo esc_attr($timeto_store); ?>" /></label>
|
31 |
</p>
|
32 |
<p>
|
33 |
+
<label for="<?php echo $this->get_field_id('tweets_cnt'); ?>"><?php _e( 'Number of Tweets to Fetch: ', 'viva-twitter-feed' ); ?><input class="widefat" id="<?php echo $this->get_field_id('tweets_cnt'); ?>" name="<?php echo $this->get_field_name('tweets_cnt'); ?>" type="text" value="<?php echo esc_attr($tweets_count); ?>" /></label>
|
34 |
</p>
|
35 |
|
36 |
+
<h4 style="width:100%; text-align:center;"><?php _e( 'Twitter API Settings', 'viva-twitter-feed' ); ?></h4>
|
37 |
<div style="padding:10px;">
|
38 |
<p>
|
39 |
+
<label for="<?php echo $this->get_field_id('consumerKey'); ?>"><?php _e( 'API key: ', 'viva-twitter-feed' ); ?><input class="widefat" id="<?php echo $this->get_field_id('consumerKey'); ?>" name="<?php echo $this->get_field_name('consumerKey'); ?>" type="text" value="<?php echo esc_attr($consumerKey); ?>" /></label>
|
40 |
</p>
|
41 |
<p>
|
42 |
+
<label for="<?php echo $this->get_field_id('consumerSecret'); ?>"><?php _e( 'API secret: ', 'viva-twitter-feed' ); ?><input class="widefat" id="<?php echo $this->get_field_id('consumerSecret'); ?>" name="<?php echo $this->get_field_name('consumerSecret'); ?>" type="text" value="<?php echo esc_attr($consumerSecret); ?>" /></label>
|
43 |
</p>
|
44 |
<p>
|
45 |
+
<label for="<?php echo $this->get_field_id('accessToken'); ?>"><?php _e( 'Access Token: ', 'viva-twitter-feed' ); ?><input class="widefat" id="<?php echo $this->get_field_id('accessToken'); ?>" name="<?php echo $this->get_field_name('accessToken'); ?>" type="text" value="<?php echo esc_attr($accessToken); ?>" /></label>
|
46 |
</p>
|
47 |
<p>
|
48 |
+
<label for="<?php echo $this->get_field_id('accessTokenSecret'); ?>"><?php _e( 'Access Token Secret: ', 'viva-twitter-feed' ); ?><input class="widefat" id="<?php echo $this->get_field_id('accessTokenSecret'); ?>" name="<?php echo $this->get_field_name('accessTokenSecret'); ?>" type="text" value="<?php echo esc_attr($accessTokenSecret); ?>" /></label>
|
49 |
</p>
|
50 |
|
51 |
</div>
|
52 |
+
<h4 style="width:100%; text-align:center;"><?php _e( 'Advanced Options', 'viva-twitter-feed' ); ?></h4>
|
53 |
<div style="padding:10px;">
|
54 |
<p>
|
55 |
<input class="checkbox" type="checkbox" value="true" <?php checked( (isset( $instance['twitterIntents']) && ($instance['twitterIntents'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'twitterIntents' ); ?>" name="<?php echo $this->get_field_name( 'twitterIntents' ); ?>" />
|
56 |
+
<label for="<?php echo $this->get_field_id( 'twitterIntents' ); ?>"><?php _e( 'Show Twitter Intents', 'viva-twitter-feed' ); ?></label>
|
57 |
</p>
|
58 |
<p>
|
59 |
<input class="checkbox" type="checkbox" value="true" <?php checked( (isset( $instance['twitterIntentsText']) && ($instance['twitterIntentsText'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'twitterIntentsText' ); ?>" name="<?php echo $this->get_field_name( 'twitterIntentsText' ); ?>" />
|
60 |
+
<label for="<?php echo $this->get_field_id( 'twitterIntentsText' ); ?>"><?php _e( 'Hide Twitter Intents Text', 'viva-twitter-feed' ); ?></label>
|
61 |
</p>
|
62 |
<p>
|
63 |
+
<label for="<?php echo $this->get_field_id('intentColor'); ?>"><?php _e( 'Colour for Intent icons: ', 'viva-twitter-feed' ); ?></label><input class="intentColor widefat" id="<?php echo $this->get_field_id('intentColor'); ?>" name="<?php echo $this->get_field_name('intentColor'); ?>" type="text" value="<?php echo esc_attr($color_intents); ?>" />
|
64 |
<div id="colorpicker"></div>
|
65 |
</p>
|
66 |
<p>
|
67 |
+
<label for="<?php echo $this->get_field_id( 'slide_style' ); ?>"><?php _e( 'Style:', 'viva-twitter-feed' ); ?></label>
|
68 |
<select name="<?php echo $this->get_field_name( 'slide_style' ); ?>" id="<?php echo $this->get_field_id( 'slide_style' ); ?>" style="width: 100%;">
|
69 |
+
<option value="list" <?php if(isset($slide_style) && $slide_style=='list'){echo 'selected';} ?>><?php _e( 'List', 'viva-twitter-feed' ); ?></option>
|
70 |
+
<option value="slider" <?php if(isset($slide_style) && $slide_style=='slider'){echo 'selected';} ?>><?php _e( 'Slider', 'viva-twitter-feed' ); ?></option>
|
71 |
</select>
|
72 |
</p>
|
73 |
<p>
|
74 |
<input class="checkbox" type="checkbox" value="true" <?php checked( ( isset( $instance['border_rad']) && ($instance['showAvatar'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'border_rad' ); ?>" name="<?php echo $this->get_field_name( 'border_rad' ); ?>" />
|
75 |
+
<label for="<?php echo $this->get_field_id( 'border_rad' ); ?>"><?php _e( 'Circular Avatar image', 'viva-twitter-feed' ); ?></label>
|
76 |
</p>
|
77 |
<p>
|
78 |
<input class="checkbox" type="checkbox" value="true" <?php checked( ( isset( $instance['showAvatar']) && ($instance['showAvatar'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'showAvatar' ); ?>" name="<?php echo $this->get_field_name( 'showAvatar' ); ?>" />
|
79 |
+
<label for="<?php echo $this->get_field_id( 'showAvatar' ); ?>"><?php _e( 'Display avatar image', 'viva-twitter-feed' ); ?></label>
|
80 |
</p>
|
81 |
|
82 |
<p>
|
83 |
+
<input class="checkbox" type="checkbox" <?php checked( isset( $instance['replies_excl']), true ); ?> id="<?php echo $this->get_field_id( 'replies_excl' ); ?>" value="true" name="<?php echo $this->get_field_name( 'replies_excl' ); ?>" />
|
84 |
<label for="<?php echo $this->get_field_id( 'replies_excl' ); ?>">Exclude @replies</label>
|
85 |
</p>
|
86 |
<p>
|
89 |
</p>
|
90 |
<p>
|
91 |
<input class="checkbox" type="checkbox" value="true" <?php checked( (isset( $instance['timeRef']) && ($instance['timeRef'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'timeRef' ); ?>" name="<?php echo $this->get_field_name( 'timeRef' ); ?>" />
|
92 |
+
<label for="<?php echo $this->get_field_id( 'timeRef' ); ?>"><?php _e( 'Set Twitter like short time', 'viva-twitter-feed' ); ?></label>
|
93 |
</p>
|
94 |
<p>
|
95 |
<input class="checkbox" type="checkbox" <?php checked( (isset( $instance['disp_scr_name']) && ($instance['disp_scr_name'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'disp_scr_name' ); ?>" name="<?php echo $this->get_field_name( 'disp_scr_name' ); ?>" value="true" />
|
96 |
+
<label for="<?php echo $this->get_field_id( 'disp_scr_name' ); ?>"><?php _e( 'Show Twitter Screen Name', 'viva-twitter-feed' ); ?></label>
|
97 |
</p>
|
98 |
<p>
|
99 |
+
<label for="<?php echo $this->get_field_id( 'tweet_border' ); ?>"><?php _e( 'Show Twitter Widget Border:', 'viva-twitter-feed' ); ?></label><br/>
|
100 |
<select name="<?php echo $this->get_field_name( 'tweet_border' ); ?>" id="<?php echo $this->get_field_id( 'tweet_border' ); ?>" style="width: 100%;">
|
101 |
+
<option value="true" <?php if(isset($tweet_border) && $tweet_border=='true'){echo 'selected';} ?>><?php _e( 'Yes', 'viva-twitter-feed' ); ?></option>
|
102 |
+
<option value="false" <?php if(isset($tweet_border) && $tweet_border=='false'){echo 'selected';} ?>><?php _e( 'No', 'viva-twitter-feed' ); ?></option>
|
103 |
</select>
|
104 |
</p>
|
105 |
<p>
|
106 |
+
<label for="<?php echo $this->get_field_id( 'tweet_theme' ); ?>"><?php _e( 'Twitter Widget Theme:', 'viva-twitter-feed' ); ?></label><br/>
|
107 |
<select name="<?php echo $this->get_field_name( 'tweet_theme' ); ?>" id="<?php echo $this->get_field_id( 'tweet_theme' ); ?>" style="width: 100%;">
|
108 |
+
<option value="light" <?php if(isset($tweet_theme) && $tweet_theme=='light'){echo 'selected';} ?>><?php _e( 'Light', 'viva-twitter-feed' ); ?></option>
|
109 |
+
<option value="dark" <?php if(isset($tweet_theme) && $tweet_theme=='dark'){echo 'selected';} ?>><?php _e( 'Dark', 'viva-twitter-feed' ); ?></option>
|
110 |
</select>
|
111 |
</p>
|
112 |
+
</div>
|
|
css/admin_style.min.css
CHANGED
@@ -44,6 +44,7 @@ font-size:1.1em;
|
|
44 |
width:68%;
|
45 |
line-height: 18px;
|
46 |
}
|
|
|
47 |
.clear{clear:both;}
|
48 |
.fetched_tweets{
|
49 |
border: medium none;
|
44 |
width:68%;
|
45 |
line-height: 18px;
|
46 |
}
|
47 |
+
.wp_image{background:#ccc;}
|
48 |
.clear{clear:both;}
|
49 |
.fetched_tweets{
|
50 |
border: medium none;
|
css/fonts/wpltf_intents.dev.svg
CHANGED
@@ -1,25 +1,18 @@
|
|
1 |
-
<?xml version="1.0" standalone="no"?>
|
2 |
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"
|
3 |
<svg xmlns="http://www.w3.org/2000/svg">
|
4 |
<metadata>
|
5 |
This is a custom SVG font generated by IcoMoon.
|
6 |
-
<iconset grid="14"
|
7 |
</metadata>
|
8 |
<defs>
|
9 |
-
<font id="stt-intents" horiz-adv-x="448"
|
10 |
-
<font-face units-per-em="448" ascent="384" descent="-64"
|
11 |
-
<missing-glyph horiz-adv-x="448"
|
12 |
-
<glyph class="hidden" unicode="
|
13 |
-
<glyph unicode="
|
14 |
-
<glyph unicode="
|
15 |
-
<glyph unicode="
|
16 |
-
<glyph unicode="
|
17 |
-
|
18 |
-
c0-7.204, 0.813-14.219, 2.38-20.947c-76.388,3.834-144.113,40.425-189.445,96.034c-7.912-13.575-12.445-29.363-12.445-46.208
|
19 |
-
c0-31.889, 16.226-60.022, 40.889-76.504c-15.067,0.478-29.239,4.612-41.63,11.497c-0.009-0.383-0.009-0.768-0.009-1.156
|
20 |
-
c0-44.532, 31.683-81.68, 73.728-90.125c-7.711-2.1-15.832-3.225-24.215-3.225c-5.923,0-11.68,0.578-17.293,1.65
|
21 |
-
c 11.697-36.514, 45.64-63.090, 85.86-63.829c-31.456-24.653-71.088-39.346-114.151-39.346c-7.419,0-14.735,0.435-21.926,1.286
|
22 |
-
c 40.675-26.079, 88.988-41.297, 140.893-41.297c 169.060,0, 261.51,140.054, 261.51,261.513c0,3.985-0.090,7.948-0.267,11.891
|
23 |
-
C 420.096,264.324, 435.678,280.511, 448,298.942z" data-tags="twitter, tweet, social" />
|
24 |
-
<glyph unicode=" " horiz-adv-x="224" />
|
25 |
</font></defs></svg>
|
1 |
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2 |
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3 |
<svg xmlns="http://www.w3.org/2000/svg">
|
4 |
<metadata>
|
5 |
This is a custom SVG font generated by IcoMoon.
|
6 |
+
<iconset grid="14"/>
|
7 |
</metadata>
|
8 |
<defs>
|
9 |
+
<font id="stt-intents" horiz-adv-x="448">
|
10 |
+
<font-face units-per-em="448" ascent="384" descent="-64"/>
|
11 |
+
<missing-glyph horiz-adv-x="448"/>
|
12 |
+
<glyph class="hidden" unicode="" d="M0,384L 448 -64L0 -64 z" horiz-adv-x="0"/>
|
13 |
+
<glyph unicode="" d="M 448,104q0-41.5 -31.75-112.75q-0.75-1.75 -2.625-6t-3.375-7.5t-3.25-5.5q-3-4.25 -7-4.25q-3.75,0 -5.875,2.5t-2.125,6.25q0,2.25 0.625,6.625t 0.625,5.875q 1.25,17 1.25,30.75q0,25.25 -4.375,45.25t-12.125,34.625t-20,25.25t-26.375,17.375t-33.25,10.625t-38.5,5.375t-43.875,1.5l-56,0 l0-64 q0-6.5 -4.75-11.25t-11.25-4.75t-11.25,4.75 l-128,128q-4.75,4.75 -4.75,11.25t 4.75,11.25l 128,128q 4.75,4.75 11.25,4.75t 11.25-4.75t 4.75-11.25l0-64 l 56,0 q 178.25,0 218.75-100.75q 13.25-33.5 13.25-83.25z" data-tags="reply, arrow, left"/>
|
14 |
+
<glyph unicode="" d="M 320,8q0-3.25 -2.375-5.625t-5.625-2.375l-240,0 q-2,0 -3.375,0.5t-2.25,1.75t-1.375,2t-0.75,2.875t-0.25,2.875l0,3.25 l0,2.75 l0,40 l0,104 l-48,0 q-6.5,0 -11.25,4.75t-4.75,11.25q0,6 3.75,10.25l 80,96q 4.75,5.5 12.25,5.5t 12.25-5.5l 80-96q 3.75-4.25 3.75-10.25q0-6.5 -4.75-11.25t-11.25-4.75l-48,0 l0-96 l 144,0 q 4,0 6.25-2.75l 40-48q 1.75-2.75 1.75-5.25 zM 480,112q0-6 -3.75-10.25l-80-96q-5-5.75 -12.25-5.75t-12.25,5.75l-80,96q-3.75,4.25 -3.75,10.25q0,6.5 4.75,11.25t 11.25,4.75l 48,0 l0,96 l-144,0 q-4,0 -6.25,3l-40,48q-1.75,2.25 -1.75,5q0,3.25 2.375,5.625t 5.625,2.375l 240,0 q 2,0 3.375-0.5t 2.25-1.75t 1.375-2t 0.75-2.875t 0.25-2.875l0-3.25 l0-2.75 l0-40 l0-104 l 48,0 q 6.5,0 11.25-4.75t 4.75-11.25z " horiz-adv-x="480" data-tags="retweet, loop, arrows"/>
|
15 |
+
<glyph unicode="" d="M 416,222.25q0-5.5 -6.5-12l-90.75-88.5l 21.5-125q 0.25-1.75 0.25-5q0-5.25 -2.625-8.875t-7.625-3.625q-4.75,0 -10,3l-112.25,59l-112.25-59q-5.5-3 -10-3q-5.25,0 -7.875,3.625t-2.625,8.875q0,1.5 0.5,5l 21.5,125l-91,88.5q-6.25,6.75 -6.25,12q0,9.25 14,11.5l 125.5,18.25l 56.25,113.75q 4.75,10.25 12.25,10.25t 12.25-10.25l 56.25-113.75 l 125.5-18.25q 14-2.25 14-11.5z" horiz-adv-x="416" data-tags="star, favorite, rate"/>
|
16 |
+
<glyph unicode="" d="M 448,298.942c-16.483-7.31-34.197-12.251-52.789-14.473c 18.975,11.375, 33.55,29.387, 40.413,50.851 c-17.761-10.534-37.431-18.183-58.367-22.304c-16.765,17.863-40.653,29.024-67.089,29.024c-50.76,0-91.913-41.15-91.913-91.909 c0-7.204, 0.813-14.219, 2.38-20.947c-76.388,3.834-144.113,40.425-189.445,96.034c-7.912-13.575-12.445-29.363-12.445-46.208 c0-31.889, 16.226-60.022, 40.889-76.504c-15.067,0.478-29.239,4.612-41.63,11.497c-0.009-0.383-0.009-0.768-0.009-1.156 c0-44.532, 31.683-81.68, 73.728-90.125c-7.711-2.1-15.832-3.225-24.215-3.225c-5.923,0-11.68,0.578-17.293,1.65 c 11.697-36.514, 45.64-63.090, 85.86-63.829c-31.456-24.653-71.088-39.346-114.151-39.346c-7.419,0-14.735,0.435-21.926,1.286 c 40.675-26.079, 88.988-41.297, 140.893-41.297c 169.060,0, 261.51,140.054, 261.51,261.513c0,3.985-0.090,7.948-0.267,11.891 C 420.096,264.324, 435.678,280.511, 448,298.942z" data-tags="twitter, tweet, social"/>
|
17 |
+
<glyph unicode=" " horiz-adv-x="224"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
</font></defs></svg>
|
css/fonts/wpltf_intents.svg
CHANGED
@@ -1,25 +1,18 @@
|
|
1 |
-
<?xml version="1.0" standalone="no"?>
|
2 |
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"
|
3 |
<svg xmlns="http://www.w3.org/2000/svg">
|
4 |
<metadata>
|
5 |
This is a custom SVG font generated by IcoMoon.
|
6 |
-
<iconset grid="14"
|
7 |
</metadata>
|
8 |
<defs>
|
9 |
-
<font id="stt-intents" horiz-adv-x="448"
|
10 |
-
<font-face units-per-em="448" ascent="384" descent="-64"
|
11 |
-
<missing-glyph horiz-adv-x="448"
|
12 |
-
<glyph class="hidden" unicode="
|
13 |
-
<glyph unicode="
|
14 |
-
<glyph unicode="
|
15 |
-
<glyph unicode="
|
16 |
-
<glyph unicode="
|
17 |
-
|
18 |
-
c0-7.204, 0.813-14.219, 2.38-20.947c-76.388,3.834-144.113,40.425-189.445,96.034c-7.912-13.575-12.445-29.363-12.445-46.208
|
19 |
-
c0-31.889, 16.226-60.022, 40.889-76.504c-15.067,0.478-29.239,4.612-41.63,11.497c-0.009-0.383-0.009-0.768-0.009-1.156
|
20 |
-
c0-44.532, 31.683-81.68, 73.728-90.125c-7.711-2.1-15.832-3.225-24.215-3.225c-5.923,0-11.68,0.578-17.293,1.65
|
21 |
-
c 11.697-36.514, 45.64-63.090, 85.86-63.829c-31.456-24.653-71.088-39.346-114.151-39.346c-7.419,0-14.735,0.435-21.926,1.286
|
22 |
-
c 40.675-26.079, 88.988-41.297, 140.893-41.297c 169.060,0, 261.51,140.054, 261.51,261.513c0,3.985-0.090,7.948-0.267,11.891
|
23 |
-
C 420.096,264.324, 435.678,280.511, 448,298.942z" />
|
24 |
-
<glyph unicode=" " horiz-adv-x="224" />
|
25 |
</font></defs></svg>
|
1 |
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2 |
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3 |
<svg xmlns="http://www.w3.org/2000/svg">
|
4 |
<metadata>
|
5 |
This is a custom SVG font generated by IcoMoon.
|
6 |
+
<iconset grid="14"/>
|
7 |
</metadata>
|
8 |
<defs>
|
9 |
+
<font id="stt-intents" horiz-adv-x="448">
|
10 |
+
<font-face units-per-em="448" ascent="384" descent="-64"/>
|
11 |
+
<missing-glyph horiz-adv-x="448"/>
|
12 |
+
<glyph class="hidden" unicode="" d="M0,384L 448 -64L0 -64 z" horiz-adv-x="0"/>
|
13 |
+
<glyph unicode="" d="M 448,104q0-41.5 -31.75-112.75q-0.75-1.75 -2.625-6t-3.375-7.5t-3.25-5.5q-3-4.25 -7-4.25q-3.75,0 -5.875,2.5t-2.125,6.25q0,2.25 0.625,6.625t 0.625,5.875q 1.25,17 1.25,30.75q0,25.25 -4.375,45.25t-12.125,34.625t-20,25.25t-26.375,17.375t-33.25,10.625t-38.5,5.375t-43.875,1.5l-56,0 l0-64 q0-6.5 -4.75-11.25t-11.25-4.75t-11.25,4.75 l-128,128q-4.75,4.75 -4.75,11.25t 4.75,11.25l 128,128q 4.75,4.75 11.25,4.75t 11.25-4.75t 4.75-11.25l0-64 l 56,0 q 178.25,0 218.75-100.75q 13.25-33.5 13.25-83.25z"/>
|
14 |
+
<glyph unicode="" d="M 320,8q0-3.25 -2.375-5.625t-5.625-2.375l-240,0 q-2,0 -3.375,0.5t-2.25,1.75t-1.375,2t-0.75,2.875t-0.25,2.875l0,3.25 l0,2.75 l0,40 l0,104 l-48,0 q-6.5,0 -11.25,4.75t-4.75,11.25q0,6 3.75,10.25l 80,96q 4.75,5.5 12.25,5.5t 12.25-5.5l 80-96q 3.75-4.25 3.75-10.25q0-6.5 -4.75-11.25t-11.25-4.75l-48,0 l0-96 l 144,0 q 4,0 6.25-2.75l 40-48q 1.75-2.75 1.75-5.25 zM 480,112q0-6 -3.75-10.25l-80-96q-5-5.75 -12.25-5.75t-12.25,5.75l-80,96q-3.75,4.25 -3.75,10.25q0,6.5 4.75,11.25t 11.25,4.75l 48,0 l0,96 l-144,0 q-4,0 -6.25,3l-40,48q-1.75,2.25 -1.75,5q0,3.25 2.375,5.625t 5.625,2.375l 240,0 q 2,0 3.375-0.5t 2.25-1.75t 1.375-2t 0.75-2.875t 0.25-2.875l0-3.25 l0-2.75 l0-40 l0-104 l 48,0 q 6.5,0 11.25-4.75t 4.75-11.25z " horiz-adv-x="480"/>
|
15 |
+
<glyph unicode="" d="M 416,222.25q0-5.5 -6.5-12l-90.75-88.5l 21.5-125q 0.25-1.75 0.25-5q0-5.25 -2.625-8.875t-7.625-3.625q-4.75,0 -10,3l-112.25,59l-112.25-59q-5.5-3 -10-3q-5.25,0 -7.875,3.625t-2.625,8.875q0,1.5 0.5,5l 21.5,125l-91,88.5q-6.25,6.75 -6.25,12q0,9.25 14,11.5l 125.5,18.25l 56.25,113.75q 4.75,10.25 12.25,10.25t 12.25-10.25l 56.25-113.75 l 125.5-18.25q 14-2.25 14-11.5z" horiz-adv-x="416"/>
|
16 |
+
<glyph unicode="" d="M 448,298.942c-16.483-7.31-34.197-12.251-52.789-14.473c 18.975,11.375, 33.55,29.387, 40.413,50.851 c-17.761-10.534-37.431-18.183-58.367-22.304c-16.765,17.863-40.653,29.024-67.089,29.024c-50.76,0-91.913-41.15-91.913-91.909 c0-7.204, 0.813-14.219, 2.38-20.947c-76.388,3.834-144.113,40.425-189.445,96.034c-7.912-13.575-12.445-29.363-12.445-46.208 c0-31.889, 16.226-60.022, 40.889-76.504c-15.067,0.478-29.239,4.612-41.63,11.497c-0.009-0.383-0.009-0.768-0.009-1.156 c0-44.532, 31.683-81.68, 73.728-90.125c-7.711-2.1-15.832-3.225-24.215-3.225c-5.923,0-11.68,0.578-17.293,1.65 c 11.697-36.514, 45.64-63.090, 85.86-63.829c-31.456-24.653-71.088-39.346-114.151-39.346c-7.419,0-14.735,0.435-21.926,1.286 c 40.675-26.079, 88.988-41.297, 140.893-41.297c 169.060,0, 261.51,140.054, 261.51,261.513c0,3.985-0.090,7.948-0.267,11.891 C 420.096,264.324, 435.678,280.511, 448,298.942z"/>
|
17 |
+
<glyph unicode=" " horiz-adv-x="224"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
</font></defs></svg>
|
js/jquery.newsTicker.js
ADDED
@@ -0,0 +1,203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
(function($, window, document, undefined) {
|
3 |
+
'use strict';
|
4 |
+
var pluginName = 'newsTicker',
|
5 |
+
defaults = {
|
6 |
+
row_height: 20,
|
7 |
+
max_rows: 3,
|
8 |
+
speed: 400,
|
9 |
+
duration: 2500,
|
10 |
+
direction: 'up',
|
11 |
+
autostart: 1,
|
12 |
+
pauseOnHover: 1,
|
13 |
+
nextButton: null,
|
14 |
+
prevButton: null,
|
15 |
+
startButton: null,
|
16 |
+
stopButton: null,
|
17 |
+
hasMoved: function() {},
|
18 |
+
movingUp: function() {},
|
19 |
+
movingDown: function() {},
|
20 |
+
start: function() {},
|
21 |
+
stop: function() {},
|
22 |
+
pause: function() {},
|
23 |
+
unpause: function() {}
|
24 |
+
};
|
25 |
+
|
26 |
+
function Plugin(element, options) {
|
27 |
+
this.element = element;
|
28 |
+
this.$el = $(element);
|
29 |
+
this.options = $.extend({}, defaults, options);
|
30 |
+
this._defaults = defaults;
|
31 |
+
this._name = pluginName;
|
32 |
+
this.moveInterval;
|
33 |
+
this.state = 0;
|
34 |
+
this.paused = 0;
|
35 |
+
this.moving = 0;
|
36 |
+
if (this.$el.is('ul, ol')) {
|
37 |
+
this.init();
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
Plugin.prototype = {
|
42 |
+
init: function() {
|
43 |
+
this.$el.height(this.options.row_height * this.options.max_rows)
|
44 |
+
.css({overflow : 'hidden'});
|
45 |
+
|
46 |
+
this.checkSpeed();
|
47 |
+
|
48 |
+
if(this.options.nextButton && typeof(this.options.nextButton[0]) !== 'undefined')
|
49 |
+
this.options.nextButton.click(function(e) {
|
50 |
+
this.moveNext();
|
51 |
+
this.resetInterval();
|
52 |
+
}.bind(this));
|
53 |
+
if(this.options.prevButton && typeof(this.options.prevButton[0]) !== 'undefined')
|
54 |
+
this.options.prevButton.click(function(e) {
|
55 |
+
this.movePrev();
|
56 |
+
this.resetInterval();
|
57 |
+
}.bind(this));
|
58 |
+
if(this.options.stopButton && typeof(this.options.stopButton[0]) !== 'undefined')
|
59 |
+
this.options.stopButton.click(function(e) {
|
60 |
+
this.stop()
|
61 |
+
}.bind(this));
|
62 |
+
if(this.options.startButton && typeof(this.options.startButton[0]) !== 'undefined')
|
63 |
+
this.options.startButton.click(function(e) {
|
64 |
+
this.start()
|
65 |
+
}.bind(this));
|
66 |
+
|
67 |
+
if(this.options.pauseOnHover) {
|
68 |
+
this.$el.hover(function() {
|
69 |
+
if (this.state)
|
70 |
+
this.pause();
|
71 |
+
}.bind(this), function() {
|
72 |
+
if (this.state)
|
73 |
+
this.unpause();
|
74 |
+
}.bind(this));
|
75 |
+
}
|
76 |
+
|
77 |
+
if(this.options.autostart)
|
78 |
+
this.start();
|
79 |
+
},
|
80 |
+
|
81 |
+
start: function() {
|
82 |
+
if (!this.state) {
|
83 |
+
this.state = 1;
|
84 |
+
this.resetInterval();
|
85 |
+
this.options.start();
|
86 |
+
}
|
87 |
+
},
|
88 |
+
|
89 |
+
stop: function() {
|
90 |
+
if (this.state) {
|
91 |
+
clearInterval(this.moveInterval);
|
92 |
+
this.state = 0;
|
93 |
+
this.options.stop();
|
94 |
+
}
|
95 |
+
},
|
96 |
+
|
97 |
+
resetInterval: function() {
|
98 |
+
if (this.state) {
|
99 |
+
clearInterval(this.moveInterval);
|
100 |
+
this.moveInterval = setInterval(function() {this.move()}.bind(this), this.options.duration);
|
101 |
+
}
|
102 |
+
},
|
103 |
+
|
104 |
+
move: function() {
|
105 |
+
if (!this.paused) this.moveNext();
|
106 |
+
},
|
107 |
+
|
108 |
+
moveNext: function() {
|
109 |
+
if (this.options.direction === 'down')
|
110 |
+
this.moveDown();
|
111 |
+
else if (this.options.direction === 'up')
|
112 |
+
this.moveUp();
|
113 |
+
},
|
114 |
+
|
115 |
+
movePrev: function() {
|
116 |
+
if (this.options.direction === 'down')
|
117 |
+
this.moveUp();
|
118 |
+
else if (this.options.direction === 'up')
|
119 |
+
this.moveDown();
|
120 |
+
},
|
121 |
+
|
122 |
+
pause: function() {
|
123 |
+
if (!this.paused) this.paused = 1;
|
124 |
+
this.options.pause();
|
125 |
+
},
|
126 |
+
|
127 |
+
unpause: function() {
|
128 |
+
if (this.paused) this.paused = 0;
|
129 |
+
this.options.unpause();
|
130 |
+
},
|
131 |
+
|
132 |
+
moveDown: function() {
|
133 |
+
if (!this.moving) {
|
134 |
+
this.moving = 1;
|
135 |
+
this.options.movingDown();
|
136 |
+
this.$el.children('li:last').detach().prependTo(this.$el).css('marginTop', '-' + this.options.row_height + 'px')
|
137 |
+
.animate({marginTop: '0px'}, this.options.speed, function(){
|
138 |
+
this.moving = 0;
|
139 |
+
this.options.hasMoved();
|
140 |
+
}.bind(this));
|
141 |
+
}
|
142 |
+
},
|
143 |
+
|
144 |
+
moveUp: function() {
|
145 |
+
if (!this.moving) {
|
146 |
+
this.moving = 1;
|
147 |
+
this.options.movingUp();
|
148 |
+
var element = this.$el.children('li:first');
|
149 |
+
element.animate({marginTop: '-' + this.options.row_height + 'px'}, this.options.speed,
|
150 |
+
function(){
|
151 |
+
element.detach().css('marginTop', '0').appendTo(this.$el);
|
152 |
+
this.moving = 0;
|
153 |
+
this.options.hasMoved();
|
154 |
+
}.bind(this));
|
155 |
+
}
|
156 |
+
},
|
157 |
+
|
158 |
+
updateOption: function(option, value) {
|
159 |
+
if (typeof(this.options[option]) !== 'undefined'){
|
160 |
+
this.options[option] = value;
|
161 |
+
if (option == 'duration' || option == 'speed'){
|
162 |
+
this.checkSpeed();
|
163 |
+
this.resetInterval();
|
164 |
+
}
|
165 |
+
}
|
166 |
+
},
|
167 |
+
|
168 |
+
add: function(content){
|
169 |
+
this.$el.append($('<li>').html(content));
|
170 |
+
},
|
171 |
+
|
172 |
+
getState: function() {
|
173 |
+
if (paused) return 2 // 2 = paused
|
174 |
+
else return this.state;// 0 = stopped, 1 = started
|
175 |
+
},
|
176 |
+
|
177 |
+
checkSpeed: function() {
|
178 |
+
if (this.options.duration < (this.options.speed + 25))
|
179 |
+
this.options.speed = this.options.duration - 25;
|
180 |
+
},
|
181 |
+
|
182 |
+
destroy: function() {
|
183 |
+
this._destroy(); // or this.delete; depends on jQuery version
|
184 |
+
}
|
185 |
+
};
|
186 |
+
|
187 |
+
$.fn[pluginName] = function(option) {
|
188 |
+
var args = arguments;
|
189 |
+
|
190 |
+
return this.each(function() {
|
191 |
+
var $this = $(this),
|
192 |
+
data = $.data(this, 'plugin_' + pluginName),
|
193 |
+
options = typeof option === 'object' && option;
|
194 |
+
if (!data) {
|
195 |
+
$this.data('plugin_' + pluginName, (data = new Plugin(this, options)));
|
196 |
+
}
|
197 |
+
// if first argument is a string, call silimarly named function
|
198 |
+
if (typeof option === 'string') {
|
199 |
+
data[option].apply(data, Array.prototype.slice.call(args, 1));
|
200 |
+
}
|
201 |
+
});
|
202 |
+
};
|
203 |
+
})(jQuery, window, document);
|
js/jquery.newsTicker.min.js
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
JQuery Advanced News Ticker 1.0.11 (20/02/14)
|
3 |
+
created by risq
|
4 |
+
website (docs & demos) : http://risq.github.io/jquery-advanced-news-ticker/
|
5 |
+
*/
|
6 |
+
(function(b,k,l,m){function g(a,f){this.element=a;this.$el=b(a);this.options=b.extend({},c,f);this._defaults=c;this._name=d;this.moveInterval;this.moving=this.paused=this.state=0;(this.$el.is("ul")||this.$el.is("ol"))&&this.init()}var d="newsTicker",c={row_height:20,max_rows:3,speed:400,duration:2500,direction:"up",autostart:1,pauseOnHover:1,nextButton:null,prevButton:null,startButton:null,stopButton:null,hasMoved:function(){},movingUp:function(){},movingDown:function(){},start:function(){},stop:function(){},
|
7 |
+
pause:function(){},unpause:function(){}};g.prototype={init:function(){this.$el.height(this.options.row_height*this.options.max_rows).css({overflow:"hidden"});this.checkSpeed();this.options.nextButton&&"undefined"!==typeof this.options.nextButton[0]&&this.options.nextButton.click(function(a){this.moveNext();this.resetInterval()}.bind(this));this.options.prevButton&&"undefined"!==typeof this.options.prevButton[0]&&this.options.prevButton.click(function(a){this.movePrev();this.resetInterval()}.bind(this));
|
8 |
+
this.options.stopButton&&"undefined"!==typeof this.options.stopButton[0]&&this.options.stopButton.click(function(a){this.stop()}.bind(this));this.options.startButton&&"undefined"!==typeof this.options.startButton[0]&&this.options.startButton.click(function(a){this.start()}.bind(this));this.options.pauseOnHover&&this.$el.hover(function(){this.state&&this.pause()}.bind(this),function(){this.state&&this.unpause()}.bind(this));this.options.autostart&&this.start()},start:function(){this.state||(this.state=
|
9 |
+
1,this.resetInterval(),this.options.start())},stop:function(){this.state&&(clearInterval(this.moveInterval),this.state=0,this.options.stop())},resetInterval:function(){this.state&&(clearInterval(this.moveInterval),this.moveInterval=setInterval(function(){this.move()}.bind(this),this.options.duration))},move:function(){this.paused||this.moveNext()},moveNext:function(){"down"===this.options.direction?this.moveDown():"up"===this.options.direction&&this.moveUp()},movePrev:function(){"down"===this.options.direction?
|
10 |
+
this.moveUp():"up"===this.options.direction&&this.moveDown()},pause:function(){this.paused||(this.paused=1);this.options.pause()},unpause:function(){this.paused&&(this.paused=0);this.options.unpause()},moveDown:function(){this.moving||(this.moving=1,this.options.movingDown(),this.$el.children("li:last").detach().prependTo(this.$el).css("marginTop","-"+this.options.row_height+"px").animate({marginTop:"0px"},this.options.speed,function(){this.moving=0;this.options.hasMoved()}.bind(this)))},moveUp:function(){if(!this.moving){this.moving=
|
11 |
+
1;this.options.movingUp();var a=this.$el.children("li:first");a.animate({marginTop:"-"+this.options.row_height+"px"},this.options.speed,function(){a.detach().css("marginTop","0").appendTo(this.$el);this.moving=0;this.options.hasMoved()}.bind(this))}},updateOption:function(a,b){"undefined"!==typeof this.options[a]&&(this.options[a]=b,"duration"==a||"speed"==a)&&(this.checkSpeed(),this.resetInterval())},add:function(a){this.$el.append(b("<li>").html(a))},getState:function(){return paused?2:this.state},
|
12 |
+
checkSpeed:function(){this.options.duration<this.options.speed+25&&(this.options.speed=this.options.duration-25)},destroy:function(){this._destroy()}};b.fn[d]=function(a){var f=arguments;return this.each(function(){var c=b(this),e=b.data(this,"plugin_"+d),h="object"===typeof a&&a;e||c.data("plugin_"+d,e=new g(this,h));"string"===typeof a&&e[a].apply(e,Array.prototype.slice.call(f,1))})}})(jQuery,window,document);
|
languages/viva-twitter-feed-fr_FR.mo
ADDED
Binary file
|
languages/viva-twitter-feed-fr_FR.po
ADDED
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: viva twitter feed\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2016-05-21 12:37+0530\n"
|
6 |
+
"PO-Revision-Date: 2016-05-21 12:38+0530\n"
|
7 |
+
"Last-Translator: Kartik <kartik.verma@vivacityinfotech.com>\n"
|
8 |
+
"Language-Team: vivacity\n"
|
9 |
+
"Language: \n"
|
10 |
+
"MIME-Version: 1.0\n"
|
11 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
+
"Content-Transfer-Encoding: 8bit\n"
|
13 |
+
"X-Poedit-KeywordsList: _e\n"
|
14 |
+
"X-Poedit-Basepath: .\n"
|
15 |
+
"X-Poedit-SearchPath-0: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds\n"
|
16 |
+
|
17 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:26
|
18 |
+
msgid "Widget Title: "
|
19 |
+
msgstr "Titre Widget :"
|
20 |
+
|
21 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:29
|
22 |
+
msgid "Twitter User Name: "
|
23 |
+
msgstr "Nom d'utilisateur Twitter:"
|
24 |
+
|
25 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:30
|
26 |
+
msgid "Start entering your user name: "
|
27 |
+
msgstr "Commencez à saisir votre nom d'utilisateur :"
|
28 |
+
|
29 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:33
|
30 |
+
msgid "Tweets Cache Time (in minutes): "
|
31 |
+
msgstr "Tweets Cache Temps (en minutes ) :"
|
32 |
+
|
33 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:36
|
34 |
+
msgid "Number of Tweets to Fetch: "
|
35 |
+
msgstr "Nombre de Tweets à Fetch :"
|
36 |
+
|
37 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:39
|
38 |
+
msgid "Twitter API Settings"
|
39 |
+
msgstr "Twitter Paramètres de l'API"
|
40 |
+
|
41 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:42
|
42 |
+
msgid "API key: "
|
43 |
+
msgstr "API clé:"
|
44 |
+
|
45 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:45
|
46 |
+
msgid "API secret: "
|
47 |
+
msgstr "API secrète :"
|
48 |
+
|
49 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:48
|
50 |
+
msgid "Access Token: "
|
51 |
+
msgstr "Jeton d'accès:"
|
52 |
+
|
53 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:51
|
54 |
+
msgid "Access Token Secret: "
|
55 |
+
msgstr "Jeton d'accès secret :"
|
56 |
+
|
57 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:55
|
58 |
+
msgid "Advanced Options"
|
59 |
+
msgstr "Options avancées"
|
60 |
+
|
61 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:59
|
62 |
+
msgid "Show Twitter Intents"
|
63 |
+
msgstr "Afficher Twitter Intentions"
|
64 |
+
|
65 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:63
|
66 |
+
msgid "Hide Twitter Intents Text"
|
67 |
+
msgstr "Masquer Twitter Intentions texte"
|
68 |
+
|
69 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:66
|
70 |
+
msgid "Colour for Intent icons: "
|
71 |
+
msgstr "Couleur pour les icônes d'intention :"
|
72 |
+
|
73 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:70
|
74 |
+
msgid "Style:"
|
75 |
+
msgstr "Style:"
|
76 |
+
|
77 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:72
|
78 |
+
msgid "List"
|
79 |
+
msgstr "liste"
|
80 |
+
|
81 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:73
|
82 |
+
msgid "Slider"
|
83 |
+
msgstr "curseur"
|
84 |
+
|
85 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:78
|
86 |
+
msgid "Circular Avatar image"
|
87 |
+
msgstr "Circulaire d'image Avatar"
|
88 |
+
|
89 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:82
|
90 |
+
msgid "Display avatar image"
|
91 |
+
msgstr "Affichage image d'avatar"
|
92 |
+
|
93 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:95
|
94 |
+
msgid "Set Twitter like short time"
|
95 |
+
msgstr "Définir Twitter comme peu de temps"
|
96 |
+
|
97 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:99
|
98 |
+
msgid "Show Twitter Screen Name"
|
99 |
+
msgstr "Afficher Twitter Nom d'écran"
|
100 |
+
|
101 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:102
|
102 |
+
msgid "Show Twitter Widget Border:"
|
103 |
+
msgstr "Montrer Border Twitter Widget :"
|
104 |
+
|
105 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:104
|
106 |
+
msgid "Yes"
|
107 |
+
msgstr "Oui"
|
108 |
+
|
109 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:105
|
110 |
+
msgid "No"
|
111 |
+
msgstr "Non"
|
112 |
+
|
113 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:109
|
114 |
+
msgid "Twitter Widget Theme:"
|
115 |
+
msgstr "Twitter Widget Thème:"
|
116 |
+
|
117 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:111
|
118 |
+
msgid "Light"
|
119 |
+
msgstr "Lumière"
|
120 |
+
|
121 |
+
#: /opt/lampp/htdocs/wordpress_451/wp-content/plugins/wp-twitter-feeds/controller/widget_html.php:112
|
122 |
+
msgid "Dark"
|
123 |
+
msgstr "Foncé"
|
124 |
+
|
libs/console.php
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
function logConsole($name, $data = NULL, $jsEval = FALSE){
|
3 |
-
|
4 |
-
if (! $name) return false;
|
5 |
-
|
6 |
-
$isevaled = false;
|
7 |
-
$type = ($data || gettype($data)) ? 'Type: ' . gettype($data) : '';
|
8 |
-
|
9 |
-
if ($jsEval && (is_array($data) || is_object($data)))
|
10 |
-
{
|
11 |
-
$data = 'eval(' . preg_replace('#[\s\r\n\t\0\x0B]+#', '', json_encode($data)) . ')';
|
12 |
-
$isevaled = true;
|
13 |
-
}
|
14 |
-
else
|
15 |
-
{
|
16 |
-
$data = json_encode($data);
|
17 |
-
}
|
18 |
-
|
19 |
-
# sanitalize
|
20 |
-
$data = $data ? $data : '';
|
21 |
-
$search_array = array("#'#", '#""#', "#''#", "#\n#", "#\r\n#");
|
22 |
-
$replace_array = array('"', '', '', '\\n', '\\n');
|
23 |
-
$data = preg_replace($search_array, $replace_array, $data);
|
24 |
-
$data = ltrim(rtrim($data, '"'), '"');
|
25 |
-
$data = $isevaled ? $data : ($data[0] === "'") ? $data : "'" . $data . "'";
|
26 |
-
|
27 |
-
$js = <<<JSCODE
|
28 |
-
\n<script>
|
29 |
-
// fallback - to deal with IE (or browsers that don't have console)
|
30 |
-
if (! window.console) console = {};
|
31 |
-
console.log = console.log || function(name, data){};
|
32 |
-
// end of fallback
|
33 |
-
|
34 |
-
console.log('$name');
|
35 |
-
console.log('------------------------------------------');
|
36 |
-
console.log('$type');
|
37 |
-
console.log($data);
|
38 |
-
console.log('\\n');
|
39 |
-
</script>
|
40 |
-
JSCODE;
|
41 |
-
|
42 |
-
echo $js;
|
43 |
-
}
|
44 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
slider.php
DELETED
@@ -1,188 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$classes[] = 'slider';
|
3 |
-
$classes[] = $widget_id;
|
4 |
-
?>
|
5 |
-
<ul class="fetched_tweets <?php echo $class; ?> <?php echo implode(' ', $classes); ?>" data-timeout="10000" data-speed="1000" data-animation="fade">
|
6 |
-
<?php
|
7 |
-
$tweets_count = $wpltf_wdgt_tweets_cnt;
|
8 |
-
$name = $wpltf_wdgt_name;
|
9 |
-
$timeto_store = $wpltf_wdgt_store_time;
|
10 |
-
$consumerSecret = trim($wpltf_wdgt_consumerSecret);
|
11 |
-
$accessToken = trim($wpltf_wdgt_accessToken);
|
12 |
-
$accessTokenSecret = trim($wpltf_wdgt_accessTokenSecret);
|
13 |
-
$replies_excl = $widget_replies_excl;
|
14 |
-
$consumerKey = trim($wpltf_wdgt_consumerKey);
|
15 |
-
//$dataShowCount = ($wpltf_wdgt_dataShowCount != "true") ? "false" : "true";
|
16 |
-
$disp_screen_name = ($wpltf_wdgt_disp_scr_name != "true") ? "false" : "true";
|
17 |
-
$intents_text = $wpltf_wdgt_twitterIntentsText;
|
18 |
-
$color_intents = $wpltf_wdgt_intentColor;
|
19 |
-
$slide_style = $wpltf_wdgt_slide_style;
|
20 |
-
$cache_transient = $wpltf_wdgt_timeRef;
|
21 |
-
$alter_ago_time = $wpltf_wdgt_timeAgo;
|
22 |
-
$twitterIntents = $wpltf_wdgt_twitterIntents;
|
23 |
-
$showAvatar = $wpltf_wdgt_showAvatar;
|
24 |
-
$border_rad_avatar = $wpltf_wdgt_border_rad;
|
25 |
-
$transName = 'list-tweets-'.$name;
|
26 |
-
$backupName = $transName . '-backup';
|
27 |
-
if(false === ($tweets = get_transient($transName) ) ) :
|
28 |
-
$twitter_outh_path = WP_PLUGIN_DIR. '/wp-twitter-feeds/controller/twitteroauth/twitteroauth.php';
|
29 |
-
require_once ($twitter_outh_path);
|
30 |
-
|
31 |
-
$api_call = new TwitterOAuth(
|
32 |
-
$consumerKey,
|
33 |
-
$consumerSecret,
|
34 |
-
$accessToken,
|
35 |
-
$accessTokenSecret
|
36 |
-
);
|
37 |
-
$totalToFetch = ($replies_excl) ? max(50, $tweets_count * 3) : $tweets_count;
|
38 |
-
|
39 |
-
$fetchedTweets = $api_call->get(
|
40 |
-
'statuses/user_timeline',
|
41 |
-
array(
|
42 |
-
'screen_name' => $name,
|
43 |
-
'count' => $totalToFetch,
|
44 |
-
'replies_excl' => $replies_excl
|
45 |
-
)
|
46 |
-
);
|
47 |
-
|
48 |
-
if($api_call->http_code != 200) :
|
49 |
-
$tweets = get_option($backupName);
|
50 |
-
|
51 |
-
else :
|
52 |
-
$limitToDisplay = min($tweets_count, count($fetchedTweets));
|
53 |
-
|
54 |
-
for($i = 0; $i < $limitToDisplay; $i++) :
|
55 |
-
$tweet = $fetchedTweets[$i];
|
56 |
-
$name = $tweet->user->name;
|
57 |
-
$screen_name = $tweet->user->screen_name;
|
58 |
-
$permalink = 'http://twitter.com/'. $name .'/status/'. $tweet->id_str;
|
59 |
-
$tweet_id = $tweet->id_str;
|
60 |
-
$image = $tweet->user->profile_image_url;
|
61 |
-
$text = $this->sanitize_links($tweet);
|
62 |
-
$time = $tweet->created_at;
|
63 |
-
$time = date_parse($time);
|
64 |
-
$uTime = mktime($time['hour'], $time['minute'], $time['second'], $time['month'], $time['day'], $time['year']);
|
65 |
-
$tweets[] = array(
|
66 |
-
'text' => $text,
|
67 |
-
'scr_name'=>$screen_name,
|
68 |
-
'favourite_count'=>$tweet->favorite_count,
|
69 |
-
'retweet_count'=>$tweet->retweet_count,
|
70 |
-
'name' => $name,
|
71 |
-
'permalink' => $permalink,
|
72 |
-
'image' => $image,
|
73 |
-
'time' => $uTime,
|
74 |
-
'tweet_id' => $tweet_id
|
75 |
-
);
|
76 |
-
endfor;
|
77 |
-
set_transient($transName, $tweets, 60 * $timeto_store);
|
78 |
-
update_option($backupName, $tweets);
|
79 |
-
endif;
|
80 |
-
endif;
|
81 |
-
if(!function_exists('twitter_time_diff'))
|
82 |
-
{
|
83 |
-
function twitter_time_diff( $from, $to = '' ) {
|
84 |
-
$diff = human_time_diff($from,$to);
|
85 |
-
$replace = array(
|
86 |
-
' hour' => 'h',
|
87 |
-
' hours' => 'h',
|
88 |
-
' day' => 'd',
|
89 |
-
' days' => 'd',
|
90 |
-
' minute' => 'm',
|
91 |
-
' minutes' => 'm',
|
92 |
-
' second' => 's',
|
93 |
-
' seconds' => 's',
|
94 |
-
);
|
95 |
-
return strtr($diff,$replace);
|
96 |
-
}
|
97 |
-
}
|
98 |
-
if($tweets) : ?>
|
99 |
-
<?php foreach($tweets as $t) : ?>
|
100 |
-
<li class="tweets_avatar">
|
101 |
-
<?php
|
102 |
-
echo '<div class="tweet_wrap"><div class="wdtf-user-card ltr">';
|
103 |
-
if ($showAvatar){
|
104 |
-
|
105 |
-
echo '<img ';
|
106 |
-
echo 'width="45px" height="45px"';
|
107 |
-
echo 'src="'.$t['image'].'" alt="Tweet Avatar" class="';
|
108 |
-
echo ($border_rad_avatar) ? 'circular':'';
|
109 |
-
echo '"/>';
|
110 |
-
}
|
111 |
-
if(!isset($screen_name)){$screen_name = $name;}
|
112 |
-
|
113 |
-
if($disp_screen_name!='false')
|
114 |
-
{
|
115 |
-
echo '<div class="wdtf-screen-name">';
|
116 |
-
echo "<span class=\"screen_name\">{$t['name']}</span><br>";
|
117 |
-
echo "<a href=\"https://twitter.com/{$screen_name}\" target=\"_blank\" dir=\"ltr\">@{$screen_name}</a></div>";
|
118 |
-
|
119 |
-
}
|
120 |
-
echo '<div class="clear"></div></div>';
|
121 |
-
?>
|
122 |
-
<div class="tweet_data">
|
123 |
-
<?php echo $t['text']; ?>
|
124 |
-
</div>
|
125 |
-
<br/>
|
126 |
-
<div class="clear"></div>
|
127 |
-
<div class="times">
|
128 |
-
<em>
|
129 |
-
|
130 |
-
<a href="http://www.twitter.com/<?php echo $screen_name; ?>" target="_blank" title="Follow <?php echo $name; ?> on Twitter [Opens new window]">
|
131 |
-
<?php
|
132 |
-
if($cache_transient == "true"){
|
133 |
-
$timeDisplay = twitter_time_diff($t['time'], current_time('timestamp'));
|
134 |
-
}else{
|
135 |
-
$timeDisplay = human_time_diff($t['time'], current_time('timestamp'));
|
136 |
-
}
|
137 |
-
if($alter_ago_time == "true"){
|
138 |
-
$displayAgo = " ago";
|
139 |
-
}
|
140 |
-
printf(__('%1$s%2$s'), $timeDisplay, $displayAgo);
|
141 |
-
|
142 |
-
?>
|
143 |
-
</a>
|
144 |
-
</em>
|
145 |
-
</div>
|
146 |
-
<?php if($twitterIntents == "true"){
|
147 |
-
?>
|
148 |
-
<div class="tweets-intent-data">
|
149 |
-
<?php if($t['favourite_count']!=0 || $t['retweet_count']!=0){?>
|
150 |
-
<span class="stats-narrow customisable-border"><span class="stats" data-scribe="component:stats">
|
151 |
-
<?php if($t['retweet_count']!=0)
|
152 |
-
{?>
|
153 |
-
<a href="https://twitter.com/<?php echo $screen_name; ?>/statuses/<?php echo $t['tweet_id']; ?>" title="View Tweet on Twitter" data-scribe="element:favorite_count" target="_blank">
|
154 |
-
<span class="stats-favorites">
|
155 |
-
<strong><?php echo $t['retweet_count'];?></strong> retweet<?php if($t['retweet_count']>1)echo's';?>
|
156 |
-
</span>
|
157 |
-
</a>
|
158 |
-
<?php } ?>
|
159 |
-
<?php if($t['favourite_count']!=0)
|
160 |
-
{?>
|
161 |
-
<a href="https://twitter.com/<?php echo $screen_name; ?>/statuses/<?php echo $t['tweet_id']; ?>" title="View Tweet on Twitter" data-scribe="element:favorite_count" target="_blank">
|
162 |
-
<span class="stats-favorites">
|
163 |
-
<strong><?php echo $t['favourite_count'];?></strong> Favorite<?php if($t['favourite_count']>1)echo's';?>
|
164 |
-
</span>
|
165 |
-
</a>
|
166 |
-
<?php }?>
|
167 |
-
|
168 |
-
</span>
|
169 |
-
</span>
|
170 |
-
<div class="clear"></div>
|
171 |
-
<div class="seperator_wpltf"></div>
|
172 |
-
<?php }?>
|
173 |
-
<ul class="tweet-actions " role="menu" >
|
174 |
-
<li><a href="http://twitter.com/intent/tweet?in_reply_to=<?php echo $t['tweet_id']; ?>" data-lang="en" class="in-reply-to" title="Reply" target="_blank"><span aria-hidden="true" data-icon="" <?php echo ($color_intents) ? 'style="color:'.$color_intents.';"' :''; ?>></span></a></li>
|
175 |
-
<li><a href="http://twitter.com/intent/retweet?tweet_id=<?php echo $t['tweet_id']; ?>" data-lang="en" class="retweet" title="Retweet" target="_blank"><span aria-hidden="true" data-icon="" <?php echo ($color_intents) ? 'style="color:'.$color_intents.';"' :''; ?>></span></a></li>
|
176 |
-
<li><a href="http://twitter.com/intent/favorite?tweet_id=<?php echo $t['tweet_id']; ?>" data-lang="en" class="favorite" title="Favorite" target="_blank"><span aria-hidden="true" data-icon="" <?php echo ($color_intents) ? 'style="color:'.$color_intents.';"' :''; ?>></span></a></li>
|
177 |
-
</ul>
|
178 |
-
</div>
|
179 |
-
<?php } ?>
|
180 |
-
<div class="clear"></div>
|
181 |
-
</div><div class="clear"></div>
|
182 |
-
</li>
|
183 |
-
<?php endforeach; ?>
|
184 |
-
|
185 |
-
<?php else : ?>
|
186 |
-
<li>Waiting for twitter.com...Try reloading the page again </li>
|
187 |
-
<?php endif; ?>
|
188 |
-
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
twitter_usr_validation.php
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
|
|
4 |
{
|
5 |
header('Content-type: application/json');
|
6 |
|
7 |
-
$username = $_GET['screen_name'];
|
8 |
|
9 |
$url="https://twitter.com/intent/user?screen_name=".$username;
|
10 |
if(!@file_get_contents($url)) {
|
1 |
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
3 |
+
add_action('wp_ajax_userValidate','viwptf_do_user_validation');
|
4 |
+
function viwptf_do_user_validation()
|
5 |
{
|
6 |
header('Content-type: application/json');
|
7 |
|
8 |
+
$username = sanitize_text_field($_GET['screen_name']);
|
9 |
|
10 |
$url="https://twitter.com/intent/user?screen_name=".$username;
|
11 |
if(!@file_get_contents($url)) {
|
views/dynamic_html.php
DELETED
@@ -1,82 +0,0 @@
|
|
1 |
-
<p>
|
2 |
-
<label for="<?php echo $this->get_field_id('title'); ?>">Widget Title: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($widget_title); ?>" /></label>
|
3 |
-
</p>
|
4 |
-
<p>
|
5 |
-
<label for="<?php echo $this->get_field_id('name'); ?>">Twitter Name (excluding @ symbol): <input class="widefat" id="<?php echo $this->get_field_id('name'); ?>" name="<?php echo $this->get_field_name('name'); ?>" type="text" value="<?php echo esc_attr($name); ?>" /></label>
|
6 |
-
</p>
|
7 |
-
<p>
|
8 |
-
<label for="<?php echo $this->get_field_id('store_time'); ?>">Tweets Cache Time (in minutes): <input class="widefat" id="<?php echo $this->get_field_id('store_time'); ?>" name="<?php echo $this->get_field_name('store_time'); ?>" type="text" value="<?php echo esc_attr($timeto_store); ?>" /></label>
|
9 |
-
</p>
|
10 |
-
<p>
|
11 |
-
<label for="<?php echo $this->get_field_id('tweets_cnt'); ?>">Number of Tweets to Fetch: <input class="widefat" id="<?php echo $this->get_field_id('tweets_cnt'); ?>" name="<?php echo $this->get_field_name('tweets_cnt'); ?>" type="text" value="<?php echo esc_attr($tweets_count); ?>" /></label>
|
12 |
-
</p>
|
13 |
-
|
14 |
-
<h4 style="width:100%; text-align:center;">Twitter API Options</h4>
|
15 |
-
<div style="padding:10px;">
|
16 |
-
<p>
|
17 |
-
<label for="<?php echo $this->get_field_id('consumerKey'); ?>">Consumer Key: <input class="widefat" id="<?php echo $this->get_field_id('consumerKey'); ?>" name="<?php echo $this->get_field_name('consumerKey'); ?>" type="text" value="<?php echo esc_attr($consumerKey); ?>" /></label>
|
18 |
-
</p>
|
19 |
-
<p>
|
20 |
-
<label for="<?php echo $this->get_field_id('consumerSecret'); ?>">Consumer Secret: <input class="widefat" id="<?php echo $this->get_field_id('consumerSecret'); ?>" name="<?php echo $this->get_field_name('consumerSecret'); ?>" type="text" value="<?php echo esc_attr($consumerSecret); ?>" /></label>
|
21 |
-
</p>
|
22 |
-
<p>
|
23 |
-
<label for="<?php echo $this->get_field_id('accessToken'); ?>">Access Token: <input class="widefat" id="<?php echo $this->get_field_id('accessToken'); ?>" name="<?php echo $this->get_field_name('accessToken'); ?>" type="text" value="<?php echo esc_attr($accessToken); ?>" /></label>
|
24 |
-
</p>
|
25 |
-
<p>
|
26 |
-
<label for="<?php echo $this->get_field_id('accessTokenSecret'); ?>">Access Token Secret: <input class="widefat" id="<?php echo $this->get_field_id('accessTokenSecret'); ?>" name="<?php echo $this->get_field_name('accessTokenSecret'); ?>" type="text" value="<?php echo esc_attr($accessTokenSecret); ?>" /></label>
|
27 |
-
</p>
|
28 |
-
|
29 |
-
</div>
|
30 |
-
<h4 style="width:100%; text-align:center;">Advanced Options</h4>
|
31 |
-
<div style="padding:10px;">
|
32 |
-
<p>
|
33 |
-
<input class="checkbox" type="checkbox" value="true" <?php checked( (isset( $instance['twitterIntents']) && ($instance['twitterIntents'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'twitterIntents' ); ?>" name="<?php echo $this->get_field_name( 'twitterIntents' ); ?>" />
|
34 |
-
<label for="<?php echo $this->get_field_id( 'twitterIntents' ); ?>">Show Twitter Intents</label>
|
35 |
-
</p>
|
36 |
-
<p>
|
37 |
-
<input class="checkbox" type="checkbox" value="true" <?php checked( (isset( $instance['twitterIntentsText']) && ($instance['twitterIntentsText'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'twitterIntentsText' ); ?>" name="<?php echo $this->get_field_name( 'twitterIntentsText' ); ?>" />
|
38 |
-
<label for="<?php echo $this->get_field_id( 'twitterIntentsText' ); ?>">Hide Twitter Intents Text</label>
|
39 |
-
</p>
|
40 |
-
<p>
|
41 |
-
<label for="<?php echo $this->get_field_id('intentColor'); ?>">Colour for Intent icons: <input class="intentColor" id="<?php echo $this->get_field_id('intentColor'); ?>" name="<?php echo $this->get_field_name('intentColor'); ?>" type="text" value="<?php echo esc_attr($color_intents); ?>" /></label>
|
42 |
-
<div id="colorpicker"></div>
|
43 |
-
</p>
|
44 |
-
<p>
|
45 |
-
<input class="checkbox" type="checkbox" value="true" <?php checked( ( isset( $instance['border_rad']) && ($instance['showAvatar'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'border_rad' ); ?>" name="<?php echo $this->get_field_name( 'border_rad' ); ?>" />
|
46 |
-
<label for="<?php echo $this->get_field_id( 'border_rad' ); ?>">Circular Avatar image</label>
|
47 |
-
</p>
|
48 |
-
<p>
|
49 |
-
<input class="checkbox" type="checkbox" value="true" <?php checked( ( isset( $instance['showAvatar']) && ($instance['showAvatar'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'showAvatar' ); ?>" name="<?php echo $this->get_field_name( 'showAvatar' ); ?>" />
|
50 |
-
<label for="<?php echo $this->get_field_id( 'showAvatar' ); ?>">Display avatar image</label>
|
51 |
-
</p>
|
52 |
-
<p>
|
53 |
-
<label for="<?php echo $this->get_field_id('avatarSize'); ?>">Size of Avatar (default: 48): <input class="widefat" id="<?php echo $this->get_field_id('avatarSize'); ?>" name="<?php echo $this->get_field_name('avatarSize'); ?>" type="text" value="<?php echo esc_attr($avatarSize); ?>" /><br><em>only numeric values allowed</em></label>
|
54 |
-
</p>
|
55 |
-
<p>
|
56 |
-
<input class="checkbox" type="checkbox" <?php checked( isset( $instance['replies_excl']), true ); ?> id="<?php echo $this->get_field_id( 'replies_excl' ); ?>" name="<?php echo $this->get_field_name( 'replies_excl' ); ?>" />
|
57 |
-
<label for="<?php echo $this->get_field_id( 'replies_excl' ); ?>">Exclude_@replies</label>
|
58 |
-
</p>
|
59 |
-
<p>
|
60 |
-
<input class="checkbox" type="checkbox" value="true" <?php checked( (isset( $instance['timeAgo']) && ($instance['timeAgo'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'timeAgo' ); ?>" name="<?php echo $this->get_field_name( 'timeAgo' ); ?>" value="true" />
|
61 |
-
<label for="<?php echo $this->get_field_id( 'timeAgo' ); ?>">Show "ago" after the time</label>
|
62 |
-
</p>
|
63 |
-
<p>
|
64 |
-
<input class="checkbox" type="checkbox" value="true" <?php checked( (isset( $instance['timeRef']) && ($instance['timeRef'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'timeRef' ); ?>" name="<?php echo $this->get_field_name( 'timeRef' ); ?>" />
|
65 |
-
<label for="<?php echo $this->get_field_id( 'timeRef' ); ?>">Change to Twitter style short time</label>
|
66 |
-
</p>
|
67 |
-
<p>
|
68 |
-
<input class="checkbox" type="checkbox" <?php checked( (isset( $instance['disp_scr_name']) && ($instance['disp_scr_name'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'disp_scr_name' ); ?>" name="<?php echo $this->get_field_name( 'disp_scr_name' ); ?>" value="true" />
|
69 |
-
<label for="<?php echo $this->get_field_id( 'disp_scr_name' ); ?>">Show Twitter Screen Name</label>
|
70 |
-
</p>
|
71 |
-
<p>
|
72 |
-
<input class="checkbox" type="checkbox" <?php checked( (isset( $instance['twitterFollow']) && ($instance['twitterFollow'] == "on") ), true ); ?> id="<?php echo $this->get_field_id( 'twitterFollow' ); ?>" name="<?php echo $this->get_field_name( 'twitterFollow' ); ?>" />
|
73 |
-
<label for="<?php echo $this->get_field_id( 'twitterFollow' ); ?>">Show Twitter Follow Button</label>
|
74 |
-
</p>
|
75 |
-
<p>
|
76 |
-
<input class="checkbox" type="checkbox" <?php checked( (isset( $instance['dataShowCount']) && ($instance['dataShowCount'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'dataShowCount' ); ?>" name="<?php echo $this->get_field_name( 'dataShowCount' ); ?>" value="true" />
|
77 |
-
<label for="<?php echo $this->get_field_id( 'dataShowCount' ); ?>">Show Twitter Followers Count</label>
|
78 |
-
</p>
|
79 |
-
<p>
|
80 |
-
<label for="<?php echo $this->get_field_id('dataLang'); ?>">Tweets Language: <input class="widefat" id="<?php echo $this->get_field_id('dataLang'); ?>" name="<?php echo $this->get_field_name('dataLang'); ?>" type="text" value="<?php echo esc_attr($dataLang); ?>" /></label>
|
81 |
-
</p>
|
82 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
views/slider.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* HTML output for the Horizontal Slider style of widget.
|
4 |
*/
|
@@ -22,7 +23,6 @@ $classes[] = $widget_id;
|
|
22 |
$accessTokenSecret = trim($wpltf_wdgt_accessTokenSecret);
|
23 |
$replies_excl = $widget_replies_excl;
|
24 |
$consumerKey = trim($wpltf_wdgt_consumerKey);
|
25 |
-
//$dataShowCount = ($wpltf_wdgt_dataShowCount != "true") ? "false" : "true";
|
26 |
$disp_screen_name = ($wpltf_wdgt_disp_scr_name != "true") ? "false" : "true";
|
27 |
$intents_text = $wpltf_wdgt_twitterIntentsText;
|
28 |
$color_intents = $wpltf_wdgt_intentColor;
|
@@ -65,7 +65,7 @@ $classes[] = $widget_id;
|
|
65 |
$tweet = $fetchedTweets[$i];
|
66 |
$name = $tweet->user->name;
|
67 |
$screen_name = $tweet->user->screen_name;
|
68 |
-
$permalink = '
|
69 |
$tweet_id = $tweet->id_str;
|
70 |
$image = $tweet->user->profile_image_url;
|
71 |
$text = $this->sanitize_links($tweet);
|
@@ -137,7 +137,7 @@ $classes[] = $widget_id;
|
|
137 |
<div class="times">
|
138 |
<em>
|
139 |
|
140 |
-
<a href="
|
141 |
<?php
|
142 |
if($cache_transient == "true"){
|
143 |
$timeDisplay = twitter_time_diff($t['time'], current_time('timestamp'));
|
@@ -181,9 +181,9 @@ $classes[] = $widget_id;
|
|
181 |
<div class="seperator_wpltf"></div>
|
182 |
<?php }?>
|
183 |
<ul class="tweet-actions " role="menu" >
|
184 |
-
<li><a href="
|
185 |
-
<li><a href="
|
186 |
-
<li><a href="
|
187 |
</ul>
|
188 |
</div>
|
189 |
<?php } ?>
|
1 |
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
3 |
/*
|
4 |
* HTML output for the Horizontal Slider style of widget.
|
5 |
*/
|
23 |
$accessTokenSecret = trim($wpltf_wdgt_accessTokenSecret);
|
24 |
$replies_excl = $widget_replies_excl;
|
25 |
$consumerKey = trim($wpltf_wdgt_consumerKey);
|
|
|
26 |
$disp_screen_name = ($wpltf_wdgt_disp_scr_name != "true") ? "false" : "true";
|
27 |
$intents_text = $wpltf_wdgt_twitterIntentsText;
|
28 |
$color_intents = $wpltf_wdgt_intentColor;
|
65 |
$tweet = $fetchedTweets[$i];
|
66 |
$name = $tweet->user->name;
|
67 |
$screen_name = $tweet->user->screen_name;
|
68 |
+
$permalink = 'https://twitter.com/'. $name .'/status/'. $tweet->id_str;
|
69 |
$tweet_id = $tweet->id_str;
|
70 |
$image = $tweet->user->profile_image_url;
|
71 |
$text = $this->sanitize_links($tweet);
|
137 |
<div class="times">
|
138 |
<em>
|
139 |
|
140 |
+
<a href="https://www.twitter.com/<?php echo $screen_name; ?>" target="_blank" title="Follow <?php echo $name; ?> on Twitter [Opens new window]">
|
141 |
<?php
|
142 |
if($cache_transient == "true"){
|
143 |
$timeDisplay = twitter_time_diff($t['time'], current_time('timestamp'));
|
181 |
<div class="seperator_wpltf"></div>
|
182 |
<?php }?>
|
183 |
<ul class="tweet-actions " role="menu" >
|
184 |
+
<li><a href="https://twitter.com/intent/tweet?in_reply_to=<?php echo $t['tweet_id']; ?>" data-lang="en" class="in-reply-to" title="Reply" target="_blank"><span aria-hidden="true" data-icon="" <?php echo ($color_intents) ? 'style="color:'.$color_intents.';"' :''; ?>></span></a></li>
|
185 |
+
<li><a href="https://twitter.com/intent/retweet?tweet_id=<?php echo $t['tweet_id']; ?>" data-lang="en" class="retweet" title="Retweet" target="_blank"><span aria-hidden="true" data-icon="" <?php echo ($color_intents) ? 'style="color:'.$color_intents.';"' :''; ?>></span></a></li>
|
186 |
+
<li><a href="https://twitter.com/intent/favorite?tweet_id=<?php echo $t['tweet_id']; ?>" data-lang="en" class="favorite" title="Favorite" target="_blank"><span aria-hidden="true" data-icon="" <?php echo ($color_intents) ? 'style="color:'.$color_intents.';"' :''; ?>></span></a></li>
|
187 |
</ul>
|
188 |
</div>
|
189 |
<?php } ?>
|
wp-latest-twitter-tweets.php
CHANGED
@@ -1,43 +1,56 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
Plugin Name: WP Twitter Feeds
|
4 |
-
Plugin URI: http://www.vivacityinfotech.net/
|
5 |
-
Description: Displays latest tweets from your Twitter account using Twitter oAuth API 1.1.
|
6 |
-
Author: Vivacity Infotech Pvt. Ltd.
|
7 |
-
Version: 1.
|
8 |
-
Author
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
published by the Free Software Foundation.
|
15 |
-
|
16 |
-
This program is distributed in the hope that it will be useful,
|
17 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
18 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
19 |
-
GNU General Public License for more details.
|
20 |
-
|
21 |
-
You should have received a copy of the GNU General Public License
|
22 |
-
along with this program; if not, write to the Free Software
|
23 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
24 |
|
|
|
|
|
|
|
25 |
*/
|
26 |
-
|
27 |
-
|
28 |
-
add_action(
|
29 |
-
function
|
30 |
{
|
|
|
|
|
31 |
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
-
|
35 |
-
add_filter('plugin_row_meta', '
|
36 |
-
function
|
37 |
if ( strpos( $file, 'wp-latest-twitter-tweets.php' ) !== false ) {
|
38 |
-
$links[] = '<a href="http://wordpress.org/support/plugin/wp-twitter-feeds">Support</a>';
|
39 |
-
$links[] = '<a href="http://
|
40 |
}
|
41 |
return $links;
|
42 |
}
|
43 |
-
?>
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: WP Twitter Feeds
|
4 |
+
* Plugin URI: http://www.vivacityinfotech.net/
|
5 |
+
* Description: Displays latest tweets from your Twitter account using Twitter oAuth API 1.1.
|
6 |
+
* Author: Vivacity Infotech Pvt. Ltd.
|
7 |
+
* Version: 1.5
|
8 |
+
* Author: Vivacity Infotech Pvt. Ltd.
|
9 |
+
* Author URI: http://vivacityinfotech.net/
|
10 |
+
* Author Email: support@vivacityinfotech.com
|
11 |
+
* @package WP Twitter Feeds
|
12 |
+
* @since 1.0.0
|
13 |
+
* @author Vivacity Infotech Pvt. Ltd.
|
14 |
+
* @copyright Copyright (c) 2014-2016, Vivacity Infotech Pvt. Ltd.
|
15 |
+
* @license http://www.gnu.org/licenses/gpl-2.0.html
|
16 |
+
*/
|
17 |
+
/* Copyright 2014-2015 Ashley Sheinwald (email : ashley@planet-interactive.co.uk)
|
18 |
+
Copyright 2016 Vivacity Infotech Pvt. Ltd. (email : info@vivacityinfotech.com)
|
19 |
+
This program is free software; you can redistribute it and/or modify
|
20 |
+
it under the terms of the GNU General Public License, version 2, as
|
21 |
+
published by the Free Software Foundation.
|
22 |
|
23 |
+
This program is distributed in the hope that it will be useful,
|
24 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
25 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
26 |
+
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
+
You should have received a copy of the GNU General Public License
|
29 |
+
along with this program; if not, write to the Free Software
|
30 |
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
31 |
*/
|
32 |
+
|
33 |
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
34 |
+
add_action('init', 'viva_twitter_feed');
|
35 |
+
function viva_twitter_feed()
|
36 |
{
|
37 |
+
load_plugin_textdomain('viva-twitter-feed', FALSE, dirname(plugin_basename(__FILE__)).'/languages/');
|
38 |
+
}
|
39 |
|
40 |
+
include( plugin_dir_path( __FILE__ ) . 'twitter_usr_validation.php');
|
41 |
+
require_once( plugin_dir_path( __FILE__ ) . 'controller/twitter_widget.class.php');
|
42 |
+
add_action( 'widgets_init', 'viwptf_reg_widget');
|
43 |
+
function viwptf_reg_widget()
|
44 |
+
{
|
45 |
+
register_widget("viwptf_TwitterTweets");
|
46 |
}
|
47 |
+
|
48 |
+
add_filter('plugin_row_meta', 'viwptf_add_meta_links',10, 2);
|
49 |
+
function viwptf_add_meta_links($links, $file) {
|
50 |
if ( strpos( $file, 'wp-latest-twitter-tweets.php' ) !== false ) {
|
51 |
+
$links[] = '<a href="http://wordpress.org/support/plugin/wp-twitter-feeds" target="_blank">Support</a>';
|
52 |
+
$links[] = '<a href="http://vivacityinfotech.net/paypal-donation/" target="_blank">Donate</a>';
|
53 |
}
|
54 |
return $links;
|
55 |
}
|
56 |
+
?>
|
wp-latest-twitter-tweets.php~
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Plugin Name: WP Twitter Feeds
|
4 |
-
Plugin URI: http://www.vivacityinfotech.net/
|
5 |
-
Description: Displays latest tweets from your Twitter account using Twitter oAuth API 1.1.
|
6 |
-
Author: Vivacity Infotech Pvt. Ltd.
|
7 |
-
Version: 1.4.3
|
8 |
-
Author URI: http://www.vivacityinfotech.net/
|
9 |
-
|
10 |
-
Copyright 2014 Vivacity InfoTech Pvt. Ltd. (email : support@vivacityinfotech.com)
|
11 |
-
|
12 |
-
This program is free software; you can redistribute it and/or modify
|
13 |
-
it under the terms of the GNU General Public License, version 2, as
|
14 |
-
published by the Free Software Foundation.
|
15 |
-
|
16 |
-
This program is distributed in the hope that it will be useful,
|
17 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
18 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
19 |
-
GNU General Public License for more details.
|
20 |
-
|
21 |
-
You should have received a copy of the GNU General Public License
|
22 |
-
along with this program; if not, write to the Free Software
|
23 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
24 |
-
|
25 |
-
*/
|
26 |
-
include('twitter_usr_validation.php');
|
27 |
-
require_once('controller/twitter_widget.class.php');
|
28 |
-
add_action( 'widgets_init', 'wpltf_reg_widget');
|
29 |
-
function wpltf_reg_widget()
|
30 |
-
{
|
31 |
-
|
32 |
-
register_widget("wptt_TwitterTweets");
|
33 |
-
}
|
34 |
-
|
35 |
-
add_filter('plugin_row_meta', 'add_meta_links',10, 2);
|
36 |
-
function add_meta_links($links, $file) {
|
37 |
-
if ( strpos( $file, 'wp-latest-twitter-tweets.php' ) !== false ) {
|
38 |
-
$links[] = '<a href="http://wordpress.org/support/plugin/wp-twitter-feeds">Support</a>';
|
39 |
-
$links[] = '<a href="http://bit.ly/1icl56K">Donate</a>';
|
40 |
-
}
|
41 |
-
return $links;
|
42 |
-
}
|
43 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|