-
Notifications
You must be signed in to change notification settings - Fork 4
/
GitHub-Buttons-PHP.phtml
182 lines (166 loc) · 5.34 KB
/
GitHub-Buttons-PHP.phtml
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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>The Unofficial GitHub-Buttons - for MooTools, jQuery and PHP</title>
<!-- Bootstrap just 4 styling -->
<link rel="stylesheet" type="text/css" href="Resources/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="Resources/bootstrap-theme.min.css" />
<link rel="stylesheet" type="text/css" href="Resources/Template.css" />
<!-- Include GitHub-Buttons Styles -->
<link rel="stylesheet" type="text/css" href="Dist/GitHubButtons.yui.css" />
</head>
<body>
<header>
<div class="container">
<h1>
The Unofficial GitHub-Buttons<br />
<small>for <a href="GitHub-Buttons-MooTools.html">MooTools</a> / <a href="GitHub-Buttons-jQuery.html">jQuery</a> / <a class="active" href="GitHub-Buttons-PHP.phtml">PHP</a></small>
</h1>
<p class="lead">Show your Love to GitHub with the power of MooTools, jQuery or PHP<br />including buttons for stargazers, watchers, forks and followers</p>
</div>
</header>
<div class="container buttonshowcase">
<hr />
<p class="lead text-center subtitle">Providing a platform coherent API</p>
<hr />
<?php
// include GitHubButtons
require('Dist/GitHubButtons.php');
// create new instance of GitHubButtons using current directory as cache
$ghb = new GitHubButtons(__DIR__.'/.cache');
?>
<div class="row">
<div class="col-lg-3 col-md-6" id="container1">
<?php
// Stargazers
echo $ghb->button(array(
'owner' => 'AndiDittrich',
'repo' => 'EnlighterJS',
'large' => true,
'type' => 'star',
'text' => 'Starring:'
));
// Stargazers small
echo $ghb->button(array(
'owner' => 'AndiDittrich',
'repo' => 'EnlighterJS',
'large' => false,
'type' => 'star'
));
?>
</div>
<div class="col-lg-3 col-md-6" id="container2">
<?php
// Fork
echo $ghb->button(array(
'owner' => 'AndiDittrich',
'repo' => 'EnlighterJS',
'large' => true,
'type' => 'fork'
));
// Fork small
echo $ghb->button(array(
'owner' => 'AndiDittrich',
'repo' => 'EnlighterJS',
'large' => false,
'type' => 'fork'
));
?>
</div>
<div class="col-lg-3 col-md-6" id="container3">
<?php
// Watch
echo $ghb->button(array(
'owner' => 'AndiDittrich',
'repo' => 'EnlighterJS',
'large' => true,
'type' => 'watch'
));
// Watch small
echo $ghb->button(array(
'owner' => 'AndiDittrich',
'repo' => 'EnlighterJS',
'large' => false,
'type' => 'watch'
));
?>
</div>
<div class="col-lg-3 col-md-6" id="container4">
<?php
// Follow
echo $ghb->button(array(
'owner' => 'AndiDittrich',
'repo' => 'EnlighterJS',
'large' => true,
'type' => 'follow'
));
// Follow small
echo $ghb->button(array(
'owner' => 'AndiDittrich',
'repo' => 'EnlighterJS',
'large' => false,
'type' => 'follow'
));
?>
</div>
</div>
<hr />
<div class="row">
<div class="col-lg-6 col-md-12">
<h2>PHP</h2>
<p>Requires: PHP 5.3</p>
<pre>
// create new instance of GitHubButtons using current directory as cache
$ghb = new GitHubButtons(__DIR__);
// create a new stargazer button
echo $ghb->button(array(
'owner' => 'AndiDittrich',
'repo' => 'EnlighterJS',
'large' => true,
'type' => 'star',
'text' => 'Starring:',
'cache' => true,
'cacheLifetime' => 7200,
'errorText' => 'NA'
));</pre>
</div>
<div class="col-lg-6 col-md-12">
<h2>PHP-Singleton</h2>
<p>Requires: PHP 5.3</p>
<pre>
// initialize GitHubButtons singleton using current directory as cache
GitHubButtons::getInstance(__DIR__);
// create a new stargazer button
GitHubButtons::getInstance()->button(array(
'owner' => 'AndiDittrich',
'repo' => 'EnlighterJS',
'large' => true,
'type' => 'star',
'text' => 'Starring:',
'cache' => true,
'cacheLifetime' => 7200,
'errorText' => 'NA'
));</pre>
</div>
</div>
<hr />
<p>Sources: <a href="https://github.com/AndiDittrich/GitHub-Buttons/blob/master/Source/GitHubButtons.MooTools.js">Native MooTools Code</a> - <a href="https://github.com/AndiDittrich/GitHub-Buttons/blob/master/Source/GitHubButtons.jQuery.js">Native jQuery Code</a> - <a href="https://github.com/AndiDittrich/GitHub-Buttons/blob/master/Source/GitHubButtons.php">Native PHP Code</a> - <a href="https://github.com/AndiDittrich/GitHub-Buttons/blob/master/Source/GitHubButtons.css">Stylesheet</a></p>
<p>All required files are located into the <code>Dist/</code> directory including compressed versions!</p>
<hr />
<div class="download-buttons">
<a href="https://github.com/AndiDittrich/GitHub-Buttons" class="btn btn-primary btn-lg">Download on GitHub</a>
</div>
</div>
<footer>
<div class="container">
<p>
<a href="https://github.com/AndiDittrich/GitHub-Buttons">MooTools/jQuery/PHP Plugins</a> created by <a href="http://andidittrich.de">Andi Dittrich</a> | Based on <a href="http://ghbtns.com/">GitHub Buttons</a> from <a href="http://twitter.com/mdo">@mdo</a><br />
It's released under the Terms of <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0 License</a> | Demo created with <a href="http://getbootstrap.com">Bootstrap</a>
</p>
</div>
</footer>
</body>
</html>