-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmathilda_dashboard.php
More file actions
70 lines (54 loc) · 2.2 KB
/
mathilda_dashboard.php
File metadata and controls
70 lines (54 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
// Security
if (!defined('ABSPATH')) { exit; }
/*
Mathilda Dashboard
*/
/* Mathilda @ Auf einen Blick */
function mathilda_glance_counter() {
$mathilda_tweets_count=get_option('mathilda_tweets_count');
$text='<li class="post-count"><a class="tweet-count" href="tools.php?page=mathilda-tools-menu">';
$text.=$mathilda_tweets_count . ' Tweets</a</a></li>';
echo $text;
}
add_filter( 'dashboard_glance_items', 'mathilda_glance_counter');
/*
Mathilda Dashboard Widget
*/
// Register the Mathilda Dashboard Widget
function register_mathilda_dashboard_widget_reporting() {
wp_add_dashboard_widget(
'mathilda_dashboard_widget_reporting',
'Mathilda',
'mathilda_dashboard_widget_reporting_display'
);
}
add_action( 'wp_dashboard_setup', 'register_mathilda_dashboard_widget_reporting' );
// Mathilda Dashboard User Interface
function mathilda_dashboard_widget_reporting_display() {
if(mathilda_select_count()==0) {
echo '<p>Hello, I am Mathilda and I will show you some tweet statistics here, after you have loaded your tweets with me.</p>';
} else {
echo '<p>Hello, I am Mathilda and you have posted the following.</p>';
echo '<table>';
echo '<tr><td>' . mathilda_tweets_count() . ' </td><td>Tweets</td></tr>';
echo '<tr><td>' . mathilda_retweets_count() . '</td><td>Retweets</td></tr>';
echo '<tr><td>' . mathilda_replies_count() . '</td><td>Replies</td></tr>';
echo '<tr><td>' . mathilda_quotes_count() . '</td><td>Quotes</td></tr>';
echo '<tr><td>' . mathilda_images_count() . '</td><td>Images</td></tr>';
echo '<tr><td>' . mathilda_mentions_count() . ' </td><td>Mentions</td></tr>';
echo '<tr><td>' . mathilda_hashtags_count() . ' </td><td>Hashtags</td></tr>';
echo '<tr><td>' . mathilda_urls_count() . '</td><td>Links</td></tr>';
echo '</table>';
$lastjobrun=get_option('mathilda_cron_lastrun');
if($lastjobrun !== '0') {
echo '<p>Last Tweet Update @ WordPress:<br/>'. $lastjobrun .'</p>';
}
}
$mathilda_import_running=get_option('mathilda_import_running');
$mathilda_import_status=mathilda_get_import_status();
if($mathilda_import_running == 1) {
echo '<p>Mathilda Import Status: '. $mathilda_import_status .' %</p>';
}
}
?>