Shortlinks by Pretty Links – Best WordPress Link Tracking Plugin - Version 1.4.49

Version Description

  • Fixed Keyword Caching Issue for Pro Users
  • Fixed recording duplicate tweet issue for Pro Users
Download this release

Release Info

Developer supercleanse
Plugin Icon 128x128 Shortlinks by Pretty Links – Best WordPress Link Tracking Plugin
Version 1.4.49
Comparing to
See all releases

Version 1.4.49

Files changed (110) hide show
  1. classes/models/PrliClick.php +309 -0
  2. classes/models/PrliGroup.php +124 -0
  3. classes/models/PrliLink.php +412 -0
  4. classes/models/PrliLinkMeta.php +59 -0
  5. classes/models/PrliOptions.php +271 -0
  6. classes/models/PrliUpdate.php +330 -0
  7. classes/models/PrliUrlUtils.php +164 -0
  8. classes/models/PrliUtils.php +1113 -0
  9. classes/models/models.inc.php +61 -0
  10. classes/views/prli-clicks/csv.php +23 -0
  11. classes/views/prli-clicks/csv_download.php +89 -0
  12. classes/views/prli-clicks/head.php +105 -0
  13. classes/views/prli-clicks/list.php +151 -0
  14. classes/views/prli-dashboard-widget/widget.php +23 -0
  15. classes/views/prli-groups/edit.php +58 -0
  16. classes/views/prli-groups/head.php +35 -0
  17. classes/views/prli-groups/list.php +85 -0
  18. classes/views/prli-groups/new.php +59 -0
  19. classes/views/prli-links/bar.php +13 -0
  20. classes/views/prli-links/edit.php +22 -0
  21. classes/views/prli-links/form.php +94 -0
  22. classes/views/prli-links/head.php +91 -0
  23. classes/views/prli-links/list.php +185 -0
  24. classes/views/prli-links/new.php +22 -0
  25. classes/views/prli-links/ultra-cloak.php +12 -0
  26. classes/views/prli-options/form.php +190 -0
  27. classes/views/prli-options/head.php +54 -0
  28. classes/views/prli-options/pro-settings.php +18 -0
  29. classes/views/prli-tools/form.php +20 -0
  30. classes/views/shared/errors.php +19 -0
  31. classes/views/shared/link-table-nav.php +102 -0
  32. classes/views/shared/nav.php +18 -0
  33. classes/views/shared/table-nav.php +93 -0
  34. images/arrow_down.png +0 -0
  35. images/arrow_up.png +0 -0
  36. images/bar_background.png +0 -0
  37. images/bar_map.png +0 -0
  38. images/bookmark.png +0 -0
  39. images/co.mments.gif +0 -0
  40. images/delicious_32.png +0 -0
  41. images/digg_32.png +0 -0
  42. images/email_32.png +0 -0
  43. images/facebook.png +0 -0
  44. images/facebook_32.png +0 -0
  45. images/forward_params.png +0 -0
  46. images/hyves_32.png +0 -0
  47. images/linkedin_32.png +0 -0
  48. images/mixx_32.png +0 -0
  49. images/newsvine_32.png +0 -0
  50. images/nofollow.png +0 -0
  51. images/not_tracking.png +0 -0
  52. images/pixel_track.png +0 -0
  53. images/pretty-link-48x48.png +0 -0
  54. images/pretty-link-add.png +0 -0
  55. images/pretty-link-med.png +0 -0
  56. images/pretty-link-small.png +0 -0
  57. images/prettylink_logo.jpg +0 -0
  58. images/prettylink_logo_med.jpg +0 -0
  59. images/prettylink_logo_small.jpg +0 -0
  60. images/reddit_32.png +0 -0
  61. images/sphinn_32.png +0 -0
  62. images/stumbleupon_32.png +0 -0
  63. images/technorati_32.png +0 -0
  64. images/tracking.png +0 -0
  65. images/twitter.png +0 -0
  66. images/twitter_32.png +0 -0
  67. images/ultra-cloak.png +0 -0
  68. images/url_icon.gif +0 -0
  69. images/whatever.txt +13 -0
  70. images/yahoobuzz_32.png +0 -0
  71. includes/jquery/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  72. includes/jquery/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  73. includes/jquery/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  74. includes/jquery/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  75. includes/jquery/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  76. includes/jquery/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  77. includes/jquery/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  78. includes/jquery/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  79. includes/jquery/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  80. includes/jquery/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  81. includes/jquery/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  82. includes/jquery/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  83. includes/jquery/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  84. includes/jquery/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  85. includes/jquery/css/ui-lightness/jquery-ui-1.7.1.custom.css +404 -0
  86. includes/jquery/js/jquery-1.3.2.min.js +19 -0
  87. includes/jquery/js/jquery-ui-1.7.1.custom.min.js +273 -0
  88. includes/php/php_browsecap.ini +17350 -0
  89. includes/version-2-kvasir/README.txt +8 -0
  90. includes/version-2-kvasir/js/README.txt +12 -0
  91. includes/version-2-kvasir/js/json/json2.js +461 -0
  92. includes/version-2-kvasir/js/swfobject.js +5 -0
  93. includes/version-2-kvasir/open-flash-chart.swf +0 -0
  94. pretty-bar.php +243 -0
  95. pretty-link.php +38 -0
  96. prli-add-link.php +9 -0
  97. prli-api.php +233 -0
  98. prli-bookmarklet.php +94 -0
  99. prli-clicks.php +454 -0
  100. prli-config.php +130 -0
  101. prli-dashboard-widget.php +13 -0
  102. prli-groups.php +175 -0
  103. prli-image-lookups.php +136 -0
  104. prli-links.php +236 -0
  105. prli-main.php +362 -0
  106. prli-options.php +157 -0
  107. prli-pro-settings.php +34 -0
  108. prli-tools.php +3 -0
  109. prli-xmlrpc.php +333 -0
  110. readme.txt +300 -0
classes/models/PrliClick.php ADDED
@@ -0,0 +1,309 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class PrliClick
3
+ {
4
+ var $table_name;
5
+
6
+ function PrliClick()
7
+ {
8
+ global $wpdb;
9
+ $this->table_name = "{$wpdb->prefix}prli_clicks";
10
+ }
11
+
12
+ function get_exclude_where_clause( $where = '', $abbr = 'cl')
13
+ {
14
+ global $prli_options;
15
+ $exclude_list = trim($prli_options->prli_exclude_ips);
16
+ $filter_bots = (int)$prli_options->filter_robots;
17
+ $return_stmt = '';
18
+
19
+ if(empty($exclude_list) and $filter_bots == 0)
20
+ return $return_stmt;
21
+
22
+ $return_stmt .= (empty($where)?'':' AND');
23
+
24
+ if(!empty($exclude_list))
25
+ {
26
+ $exclude_ips = explode(',',$exclude_list);
27
+ for($i = 0; $i < count($exclude_ips); $i++)
28
+ {
29
+ $exclude_ip = trim(preg_replace('#\*#','%',$exclude_ips[$i]));
30
+
31
+ if($i > 0)
32
+ $return_stmt .= ' AND';
33
+
34
+ $return_stmt .= " {$abbr}.ip NOT LIKE '{$exclude_ip}'";
35
+ }
36
+ }
37
+
38
+ if($filter_bots != 0)
39
+ {
40
+ $return_stmt .= (empty($exclude_list)?' (':' AND (');
41
+ $whitelist = trim($prli_options->whitelist_ips);
42
+
43
+ if(!empty($whitelist))
44
+ {
45
+ $whitelist_ips = explode(',',$whitelist);
46
+ for($i = 0; $i <= count($whitelist_ips); $i++)
47
+ {
48
+ if($i == count($whitelist_ips))
49
+ {
50
+ $return_stmt .= ' OR';
51
+ break;
52
+ }
53
+
54
+ $whitelist_ip = trim(preg_replace('#\*#','%',$whitelist_ips[$i]));
55
+
56
+ if($i > 0)
57
+ $return_stmt .= ' OR';
58
+
59
+ $return_stmt .= " {$abbr}.ip LIKE '{$whitelist_ip}'";
60
+ }
61
+
62
+ }
63
+
64
+ $return_stmt .= " {$abbr}.robot=0 )";
65
+ }
66
+
67
+ return $return_stmt;
68
+ }
69
+
70
+ function getOne( $id )
71
+ {
72
+ global $wpdb, $prli_link, $prli_utils;
73
+ $query = 'SELECT cl.*, (SELECT count(*) FROM '. $this->table_name .' cl2 WHERE cl2.ip = cl.ip) as ip_count, (SELECT count(*) FROM '. $this->table_name .' cl3 WHERE cl3.vuid = cl.vuid) as vuid_count, li.name as link_name FROM ' . $this->table_name . ' cl, ' . $prli_link->table_name . ' li WHERE li.id = cl.link_id AND id=' . $id . $prli_utils->prepend_and_or_where(' AND',$this->get_exclude_where_clause());
74
+
75
+ return $wpdb->get_row($query);
76
+ }
77
+
78
+ // SELECT cl.*,li.name as link_name FROM wp_prli_clicks cl, wp_prli_links li WHERE li.id = cl.link_id ORDER BY created_at DESC
79
+ function getAll($where = '', $order = '', $include_stats = false, $limit = '')
80
+ {
81
+ global $wpdb, $prli_link, $prli_utils;
82
+ $where .= $this->get_exclude_where_clause( $where );
83
+ $where = $prli_utils->prepend_and_or_where(' AND', $where);
84
+ $limit = (empty($limit)?'':" LIMIT {$limit}");
85
+ if($include_stats)
86
+ $query = 'SELECT cl.*, (SELECT count(*) FROM '. $this->table_name .' cl2 WHERE cl2.ip = cl.ip) as ip_count, (SELECT count(*) FROM '. $this->table_name .' cl3 WHERE cl3.vuid = cl.vuid) as vuid_count, li.name as link_name FROM ' . $this->table_name . ' cl, ' . $prli_link->table_name . ' li WHERE li.id = cl.link_id' . $where . $order . $limit;
87
+ else
88
+ $query = 'SELECT cl.*, li.name as link_name FROM ' . $this->table_name . ' cl, ' . $prli_link->table_name . ' li WHERE li.id = cl.link_id' . $where . $order . $limit;
89
+
90
+ return $wpdb->get_results($query);
91
+ }
92
+
93
+ // Delete all of the clicks from the database.
94
+ function clearAllClicks()
95
+ {
96
+ global $wpdb;
97
+ $query = "TRUNCATE TABLE " . $this->table_name;
98
+ return $wpdb->query($query);
99
+ }
100
+
101
+ /* This will delete all the clicks in the database by their age measured in days. */
102
+ function clear_clicks_by_age_in_days($days)
103
+ {
104
+ global $wpdb;
105
+
106
+ $days_in_seconds = $days * 24 * 60 * 60;
107
+ $oldest_time = time() - $days_in_seconds;
108
+
109
+ $num_records = $this->getRecordCount( " UNIX_TIMESTAMP(created_at) < {$oldest_time}" );
110
+
111
+ if($num_records)
112
+ {
113
+ $query = "DELETE FROM {$this->table_name} WHERE UNIX_TIMESTAMP(created_at) < %d";
114
+ $query = $wpdb->prepare( $query, $oldest_time );
115
+
116
+ $wpdb->query($query);
117
+ }
118
+
119
+ return $num_records;
120
+ }
121
+
122
+ function get_distinct_ip_count($where='')
123
+ {
124
+ global $wpdb, $prli_link, $prli_utils;
125
+ $where .= $this->get_exclude_where_clause( $where );
126
+ $where = $prli_utils->prepend_and_or_where(' WHERE', $where);
127
+ $query = 'SELECT COUNT(DISTINCT ip) FROM ' . $this->table_name . ' cl'. $where;
128
+ return $wpdb->get_var($query);
129
+ }
130
+
131
+ // Pagination Methods
132
+ function getRecordCount($where='')
133
+ {
134
+ global $wpdb, $prli_link, $prli_utils;
135
+ $where .= $this->get_exclude_where_clause( $where );
136
+ $where = $prli_utils->prepend_and_or_where(' WHERE', $where);
137
+ $query = 'SELECT COUNT(*) FROM ' . $this->table_name . ' cl'. $where;
138
+
139
+ return $wpdb->get_var($query);
140
+ }
141
+
142
+ function getPageCount($p_size, $where='')
143
+ {
144
+ return ceil((int)$this->getRecordCount($where) / (int)$p_size);
145
+ }
146
+
147
+ function getPage($current_p,$p_size, $where = '', $order = '',$include_stats=false)
148
+ {
149
+ global $wpdb, $prli_link, $prli_utils;
150
+ $end_index = $current_p * $p_size;
151
+ $start_index = $end_index - $p_size;
152
+ $where .= $this->get_exclude_where_clause( $where );
153
+ $where = $prli_utils->prepend_and_or_where(' AND', $where);
154
+ if($include_stats)
155
+ $query = 'SELECT cl.*, (SELECT count(*) FROM '. $this->table_name .' cl2 WHERE cl2.ip = cl.ip) as ip_count, (SELECT count(*) FROM '. $this->table_name .' cl3 WHERE cl3.vuid = cl.vuid) as vuid_count, li.name as link_name FROM ' . $this->table_name . ' cl, ' . $prli_link->table_name . ' li WHERE li.id = cl.link_id' . $where . $order . ' LIMIT ' . $start_index . ',' . $p_size . ';';
156
+ else
157
+ $query = 'SELECT cl.*, li.name as link_name FROM ' . $this->table_name . ' cl, ' . $prli_link->table_name . ' li WHERE li.id = cl.link_id' . $where . $order . ' LIMIT ' . $start_index . ',' . $p_size . ';';
158
+ $results = $wpdb->get_results($query);
159
+ return $results;
160
+ }
161
+
162
+ function generateUniqueVisitorId($num_chars = 6)
163
+ {
164
+ global $wpdb, $prli_utils;
165
+
166
+ // We're doing a base 36 hash which is why we're always doing everything by 36
167
+ $max_vuid_value = pow(36,$num_chars);
168
+ $min_vuid_value = 37;
169
+ $vuid = base_convert( mt_rand($min_vuid_value,$max_vuid_value), 10, 36 );
170
+
171
+ $query = "SELECT DISTINCT vuid FROM ".$this->table_name;
172
+ $vuids = $wpdb->get_col($query,0);
173
+
174
+ // It is highly unlikely that we'll ever see 2 identical random vuids
175
+ // but just in case, here's some code to prevent collisions
176
+ while( in_array($vuid,$vuids) )
177
+ $vuid = base_convert( mt_rand($min_vuid_value,$max_vuid_value), 10, 36 );
178
+
179
+ return $vuid;
180
+ }
181
+
182
+ function get_counts_by_days($start_timestamp, $end_timestamp, $link_id = "all", $type = "all", $group = '')
183
+ {
184
+ global $wpdb, $prli_link;
185
+
186
+ $query = "SELECT DATE(cl.created_at) as cldate,COUNT(*) as clcount FROM ".$this->table_name." cl WHERE cl.created_at BETWEEN '".date("Y-n-j",$start_timestamp)." 00:00:00' AND '".date("Y-n-j",$end_timestamp)." 23:59:59'".$search_where.$this->get_exclude_where_clause( ' AND' );
187
+
188
+ if($link_id != "all")
189
+ $query .= " AND link_id=$link_id";
190
+
191
+ if(!empty($group))
192
+ $query .= " AND link_id IN (SELECT id FROM " . $prli_link->table_name . " WHERE group_id=$group)";
193
+
194
+ if($type == "unique")
195
+ $query .= " AND first_click=1";
196
+
197
+ $query .= ' GROUP BY DATE(cl.created_at)';
198
+
199
+ $clicks_array = $wpdb->get_results($query);
200
+
201
+ $temp_array = array();
202
+ $counts_array = array();
203
+ $dates_array = array();
204
+
205
+ // Refactor Array for use later on
206
+ foreach($clicks_array as $c)
207
+ $temp_array[$c->cldate] = $c->clcount;
208
+
209
+ // Get the dates array
210
+ for($c = $start_timestamp; $c <= $end_timestamp; $c += 60*60*24)
211
+ $dates_array[] = date("Y-m-d",$c);
212
+
213
+ // Make sure counts array is in order and includes zero click days
214
+ foreach($dates_array as $date_str)
215
+ {
216
+ if(isset($temp_array[$date_str]))
217
+ $counts_array[$date_str] = $temp_array[$date_str];
218
+ else
219
+ $counts_array[$date_str] = 0;
220
+ }
221
+
222
+ return $counts_array;
223
+ }
224
+
225
+
226
+ function setupClickLineGraph($start_timestamp,$end_timestamp, $link_id = "all", $type = "all", $group = '')
227
+ {
228
+ global $wpdb, $prli_utils, $prli_link, $prli_group;
229
+
230
+ $dates_array = $this->get_counts_by_days($start_timestamp,$end_timestamp,$link_id,$type,$group);
231
+
232
+ $top_click_count = $prli_utils->getTopValue(array_values($dates_array));
233
+
234
+ if(!empty($group))
235
+ $link_slug = "group: '" . $wpdb->get_var("SELECT name FROM ".$prli_group->table_name." WHERE id=$group") . "'";
236
+ else if($link_id == "all")
237
+ $link_slug = "all links";
238
+ else
239
+ $link_slug = "'/".$wpdb->get_var("SELECT slug FROM ".$prli_link->table_name." WHERE id=$link_id") . "'";
240
+
241
+ if($type == "all")
242
+ $type_string = "All hits";
243
+ else
244
+ $type_string = "Unique hits";
245
+
246
+ $json_array = array(
247
+ "elements" => array( array(
248
+ "type" => "line",
249
+ "values" => array_values($dates_array),
250
+ "dot-style" => array(
251
+ "type" => "dot",
252
+ "dot-size" => 4,
253
+ "colour" => "#ffc94e",
254
+ "halo-size" => 1,
255
+ "tip" => "#val# Hits<br>#x_label#"
256
+ ),
257
+ "width" => 2
258
+ ) ),
259
+ "title" => array(
260
+ "text" => 'Pretty Link: '.$type_string.' on '.$link_slug. ' between ' . date("Y-n-j",$start_timestamp) . ' and ' . date("Y-n-j",$end_timestamp),
261
+ "style" => "font-size: 16px; font-weight: bold; color: #3030d0; text-align: center; padding-bottom: 5px;"
262
+ ),
263
+ "bg_colour" => "-1",
264
+ "y_axis" => array(
265
+ "min" => 0,
266
+ "max" => $top_click_count,
267
+ "steps" => (int)(($top_click_count>=10)?$top_click_count/10:1),
268
+ "colour" => "#A2ACBA"
269
+ ),
270
+ "x_axis" => array(
271
+ "colour" => "#A2ACBA",
272
+ "grid-colour" => "#ffefa7",
273
+ "offset" => false,
274
+ "steps" => 4,
275
+ "labels" => array(
276
+ "steps" => 2,
277
+ "rotate" => 25,
278
+ "colour" => "#000000",
279
+ "labels" => array_keys($dates_array)
280
+ )
281
+ )
282
+ );
283
+
284
+ return $prli_utils->prli_json_encode($json_array);
285
+ }
286
+
287
+
288
+ // Set defaults and grab get or post of each possible param
289
+ function get_params_array()
290
+ {
291
+ $values = array(
292
+ 'paged' => (isset($_GET['paged'])?$_GET['paged']:(isset($_POST['paged'])?$_POST['paged']:1)),
293
+ 'l' => (isset($_GET['l'])?$_GET['l']:(isset($_POST['l'])?$_POST['l']:'all')),
294
+ 'group' => (isset($_GET['group'])?$_GET['group']:(isset($_POST['group'])?$_POST['group']:'')),
295
+ 'ip' => (isset($_GET['ip'])?$_GET['ip']:(isset($_POST['ip'])?$_POST['ip']:'')),
296
+ 'vuid' => (isset($_GET['vuid'])?$_GET['vuid']:(isset($_POST['vuid'])?$_POST['vuid']:'')),
297
+ 'sdate' => (isset($_GET['sdate'])?$_GET['sdate']:(isset($_POST['sdate'])?$_POST['sdate']:'')),
298
+ 'edate' => (isset($_GET['edate'])?$_GET['edate']:(isset($_POST['edate'])?$_POST['edate']:'')),
299
+ 'type' => (isset($_GET['type'])?$_GET['type']:(isset($_POST['type'])?$_POST['type']:'all')),
300
+ 'search' => (isset($_GET['search'])?$_GET['search']:(isset($_POST['search'])?$_POST['search']:'')),
301
+ 'sort' => (isset($_GET['sort'])?$_GET['sort']:(isset($_POST['sort'])?$_POST['sort']:'')),
302
+ 'sdir' => (isset($_GET['sdir'])?$_GET['sdir']:(isset($_POST['sdir'])?$_POST['sdir']:''))
303
+ );
304
+
305
+ return $values;
306
+ }
307
+
308
+ }
309
+ ?>
classes/models/PrliGroup.php ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class PrliGroup
3
+ {
4
+ var $table_name;
5
+
6
+ function PrliGroup()
7
+ {
8
+ global $wpdb;
9
+ $this->table_name = "{$wpdb->prefix}prli_groups";
10
+ }
11
+
12
+ function create( $values )
13
+ {
14
+ global $wpdb, $wp_rewrite;
15
+
16
+ $query = 'INSERT INTO ' . $this->table_name .
17
+ ' (name,description,created_at) VALUES (\'' .
18
+ $values['name'] . '\',\'' .
19
+ $values['description'] . '\',' .
20
+ 'NOW())';
21
+ $query_results = $wpdb->query($query);
22
+ return $wpdb->insert_id;
23
+ }
24
+
25
+ function update( $id, $values )
26
+ {
27
+ global $wpdb, $wp_rewrite;
28
+
29
+ $query = 'UPDATE ' . $this->table_name .
30
+ ' SET name=\'' . $values['name'] . '\', ' .
31
+ ' description=\'' . $values['description'] . '\' ' .
32
+ ' WHERE id='.$id;
33
+ $query_results = $wpdb->query($query);
34
+ return $query_results;
35
+ }
36
+
37
+ function destroy( $id )
38
+ {
39
+ require_once(PRLI_MODELS_PATH.'/models.inc.php');
40
+ global $wpdb, $prli_link, $wp_rewrite;
41
+
42
+ // Disconnect the links from this group
43
+ $query = 'UPDATE ' . $prli_link->table_name .
44
+ ' SET group_id = NULL ' .
45
+ ' WHERE group_id='.$id;
46
+ $query_results = $wpdb->query($query);
47
+
48
+ $destroy = 'DELETE FROM ' . $this->table_name . ' WHERE id=' . $id;
49
+ return $wpdb->query($destroy);
50
+ }
51
+
52
+ function getOne( $id, $include_stats = false )
53
+ {
54
+ global $wpdb, $prli_link, $prli_click;
55
+
56
+ if($include_stats)
57
+ $query = 'SELECT gr.*, (SELECT COUNT(*) FROM ' . $prli_link->table_name . ' li WHERE li.group_id = gr.id) as link_count FROM ' . $this->table_name . ' gr WHERE id=' . $id;
58
+ else
59
+ $query = 'SELECT gr.* FROM ' . $this->table_name . ' gr WHERE id=' . $id;
60
+ return $wpdb->get_row($query);
61
+ }
62
+
63
+ function getAll( $where = '', $order_by = '', $return_type = OBJECT, $include_stats = false )
64
+ {
65
+ global $wpdb, $prli_utils, $prli_link, $prli_click;
66
+
67
+ if($include_stats)
68
+ $query = 'SELECT gr.*, (SELECT COUNT(*) FROM ' . $prli_link->table_name . ' li WHERE li.group_id = gr.id) as link_count FROM ' . $this->table_name . ' gr' . $prli_utils->prepend_and_or_where(' WHERE', $where) . $order_by;
69
+ else
70
+ $query = 'SELECT gr.* FROM ' . $this->table_name . " gr" . $prli_utils->prepend_and_or_where(' WHERE', $where) . $order_by;
71
+ return $wpdb->get_results($query, $return_type);
72
+ }
73
+
74
+ // Pagination Methods
75
+ function getRecordCount($where="")
76
+ {
77
+ global $wpdb, $prli_utils;
78
+ $query = 'SELECT COUNT(*) FROM ' . $this->table_name . $prli_utils->prepend_and_or_where(' WHERE', $where);
79
+ return $wpdb->get_var($query);
80
+ }
81
+
82
+ function getPageCount($p_size, $where="")
83
+ {
84
+ return ceil((int)$this->getRecordCount($where) / (int)$p_size);
85
+ }
86
+
87
+ function getPage($current_p,$p_size, $where = "", $order_by = '')
88
+ {
89
+ global $wpdb, $prli_link, $prli_utils, $prli_click;
90
+ $end_index = $current_p * $p_size;
91
+ $start_index = $end_index - $p_size;
92
+ $query = 'SELECT gr.*, (SELECT COUNT(*) FROM ' . $prli_link->table_name . ' li WHERE li.group_id = gr.id) as link_count FROM ' . $this->table_name . ' gr' . $prli_utils->prepend_and_or_where(' WHERE', $where) . $order_by .' LIMIT ' . $start_index . ',' . $p_size;
93
+ $results = $wpdb->get_results($query);
94
+ return $results;
95
+ }
96
+
97
+ // Set defaults and grab get or post of each possible param
98
+ function get_params_array()
99
+ {
100
+ $values = array(
101
+ 'action' => (isset($_GET['action'])?$_GET['action']:(isset($_POST['action'])?$_POST['action']:'list')),
102
+ 'id' => (isset($_GET['id'])?$_GET['id']:(isset($_POST['id'])?$_POST['id']:'')),
103
+ 'paged' => (isset($_GET['paged'])?$_GET['paged']:(isset($_POST['paged'])?$_POST['paged']:1)),
104
+ 'group' => (isset($_GET['group'])?$_GET['group']:(isset($_POST['group'])?$_POST['group']:'')),
105
+ 'search' => (isset($_GET['search'])?$_GET['search']:(isset($_POST['search'])?$_POST['search']:'')),
106
+ 'sort' => (isset($_GET['sort'])?$_GET['sort']:(isset($_POST['sort'])?$_POST['sort']:'')),
107
+ 'sdir' => (isset($_GET['sdir'])?$_GET['sdir']:(isset($_POST['sdir'])?$_POST['sdir']:''))
108
+ );
109
+
110
+ return $values;
111
+ }
112
+
113
+ function validate( $values )
114
+ {
115
+ global $wpdb, $prli_utils;
116
+
117
+ $errors = array();
118
+ if( empty($values['name']) )
119
+ $errors[] = "Group must have a name.";
120
+
121
+ return $errors;
122
+ }
123
+ }
124
+ ?>
classes/models/PrliLink.php ADDED
@@ -0,0 +1,412 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class PrliLink
3
+ {
4
+ var $table_name;
5
+
6
+ function PrliLink()
7
+ {
8
+ global $wpdb;
9
+ $this->table_name = "{$wpdb->prefix}prli_links";
10
+ }
11
+
12
+ function create( $values )
13
+ {
14
+ global $wpdb, $prli_url_utils;
15
+
16
+ if($values['redirect_type'] == 'pixel')
17
+ $values['name'] = (!empty($values['name'])?$values['name']:$values['slug']);
18
+ else
19
+ $values['name'] = (!empty($values['name'])?$values['name']:$prli_url_utils->get_title($values['url'],$values['slug']));
20
+
21
+ $query_str = "INSERT INTO {$this->table_name} " .
22
+ '(url,'.
23
+ 'slug,'.
24
+ 'name,'.
25
+ 'param_forwarding,'.
26
+ 'param_struct,'.
27
+ 'redirect_type,'.
28
+ 'description,'.
29
+ 'track_me,'.
30
+ 'nofollow,'.
31
+ 'group_id,'.
32
+ 'created_at) ' .
33
+ 'VALUES (%s,%s,%s,%s,%s,%s,%s,%d,%d,%d,NOW())';
34
+
35
+ $query = $wpdb->prepare( $query_str,
36
+ $values['url'],
37
+ $values['slug'],
38
+ $values['name'],
39
+ $values['param_forwarding'],
40
+ $values['param_struct'],
41
+ $values['redirect_type'],
42
+ $values['description'],
43
+ (int)isset($values['track_me']),
44
+ (int)isset($values['nofollow']),
45
+ (isset($values['group_id'])?(int)$values['group_id']:'NULL') );
46
+ $query_results = $wpdb->query($query);
47
+
48
+ if($query_results)
49
+ return $wpdb->insert_id;
50
+ else
51
+ return false;
52
+ }
53
+
54
+ function update( $id, $values )
55
+ {
56
+ global $wpdb, $prli_url_utils;
57
+
58
+ if($values['redirect_type'] == 'pixel')
59
+ $values['name'] = (!empty($values['name'])?$values['name']:$values['slug']);
60
+ else
61
+ $values['name'] = (!empty($values['name'])?$values['name']:$prli_url_utils->get_title($values['url'],$values['slug']));
62
+
63
+ $query_str = "UPDATE {$this->table_name} " .
64
+ 'SET url=%s, ' .
65
+ 'slug=%s, ' .
66
+ 'name=%s, ' .
67
+ 'param_forwarding=%s, ' .
68
+ 'param_struct=%s, ' .
69
+ 'redirect_type=%s, ' .
70
+ 'description=%s, ' .
71
+ 'track_me=%d, ' .
72
+ 'nofollow=%d, ' .
73
+ 'group_id=%d ' .
74
+ ' WHERE id=%d';
75
+
76
+ $query = $wpdb->prepare( $query_str,
77
+ $values['url'],
78
+ $values['slug'],
79
+ $values['name'],
80
+ $values['param_forwarding'],
81
+ $values['param_struct'],
82
+ $values['redirect_type'],
83
+ $values['description'],
84
+ (int)isset($values['track_me']),
85
+ (int)isset($values['nofollow']),
86
+ (isset($values['group_id'])?(int)$values['group_id']:'NULL'),
87
+ $id );
88
+
89
+ $query_results = $wpdb->query($query);
90
+ return $query_results;
91
+ }
92
+
93
+ function update_group( $id, $value, $group_id )
94
+ {
95
+ global $wpdb;
96
+ $query = 'UPDATE ' . $this->table_name .
97
+ ' SET group_id=' . (isset($value)?$group_id:'NULL') .
98
+ ' WHERE id='.$id;
99
+ $query_results = $wpdb->query($query);
100
+ return $query_results;
101
+ }
102
+
103
+ function destroy( $id )
104
+ {
105
+ require_once(PRLI_MODELS_PATH.'/models.inc.php');
106
+ global $wpdb, $prli_click;
107
+
108
+ $reset = 'DELETE FROM ' . $prli_click->table_name . ' WHERE link_id=' . $id;
109
+ $destroy = 'DELETE FROM ' . $this->table_name . ' WHERE id=' . $id;
110
+
111
+ $wpdb->query($reset);
112
+ return $wpdb->query($destroy);
113
+ }
114
+
115
+ function reset( $id )
116
+ {
117
+ require_once(PRLI_MODELS_PATH.'/models.inc.php');
118
+ global $wpdb, $prli_click;
119
+
120
+ $reset = 'DELETE FROM ' . $prli_click->table_name . ' WHERE link_id=' . $id;
121
+ return $wpdb->query($reset);
122
+ }
123
+
124
+ function getOneFromSlug( $slug, $return_type = OBJECT, $include_stats = false )
125
+ {
126
+ global $wpdb, $prli_click;
127
+ if($include_stats)
128
+ $query = 'SELECT li.*, ' .
129
+ '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
130
+ 'WHERE cl.link_id = li.id' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as clicks, ' .
131
+ '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
132
+ 'WHERE cl.link_id = li.id ' .
133
+ 'AND cl.first_click <> 0' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as uniques ' .
134
+ "FROM {$this->table_name} li " .
135
+ 'WHERE slug=%s';
136
+ else
137
+ $query = "SELECT * FROM {$this->table_name} WHERE slug=%s";
138
+
139
+ $query = $wpdb->prepare($query, $slug);
140
+ return $wpdb->get_row($query, $return_type);
141
+ }
142
+
143
+ function getOne( $id, $return_type = OBJECT, $include_stats = false )
144
+ {
145
+ global $wpdb, $prli_click;
146
+ if( !isset($id) or empty($id) )
147
+ return false;
148
+
149
+ if($include_stats)
150
+ $query = 'SELECT li.*, ' .
151
+ '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
152
+ 'WHERE cl.link_id = li.id' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as clicks, ' .
153
+ '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
154
+ 'WHERE cl.link_id = li.id ' .
155
+ 'AND cl.first_click <> 0' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as uniques ' .
156
+ 'FROM ' . $this->table_name . ' li ' .
157
+ 'WHERE id=%d';
158
+ else
159
+ $query = "SELECT * FROM {$this->table_name} WHERE id=%d";
160
+
161
+ $query = $wpdb->prepare($query, $id);
162
+ return $wpdb->get_row($query, $return_type);
163
+ }
164
+
165
+ function find_first_target_url($target_url)
166
+ {
167
+ global $wpdb;
168
+ $query_str = "SELECT id FROM {$this->table_name} WHERE url=%s LIMIT 1";
169
+ $query = $wpdb->prepare($query_str,$target_url);
170
+ return $wpdb->get_var($query);
171
+ }
172
+
173
+ function &get_or_create_pretty_link_for_target_url( $target_url, $group=0 )
174
+ {
175
+ $pretty_link_id = $this->find_first_target_url( $target_url );
176
+ $pretty_link = $this->getOne($pretty_link_id);
177
+
178
+ if(empty($pretty_link) or !$pretty_link)
179
+ {
180
+ $pl_insert_id = prli_create_pretty_link( $target_url, '', '', '', $group );
181
+ $pretty_link = $this->getOne($pl_insert_id);
182
+ }
183
+ else
184
+ prli_update_pretty_link( $pretty_link->id, '', '', '', '', $group );
185
+
186
+ if( !isset($pretty_link) or
187
+ empty($pretty_link) or
188
+ !$pretty_link )
189
+ return false;
190
+ else
191
+ return $pretty_link;
192
+ }
193
+
194
+ function &is_pretty_link($url, $check_domain=true)
195
+ {
196
+ global $prli_blogurl;
197
+
198
+ if( !$check_domain or preg_match( '#^' . preg_quote( $prli_blogurl ) . '#', $url ) )
199
+ {
200
+ $uri = preg_replace('#' . preg_quote($prli_blogurl) . '#', '', $url);
201
+
202
+ // Resolve WP installs in sub-directories
203
+ preg_match('#^(https?://.*?)(/.*)$#', $prli_blogurl, $subdir);
204
+
205
+ $struct = PrliUtils::get_permalink_pre_slug_regex();
206
+
207
+ $subdir_str = (isset($subdir[2])?$subdir[2]:'');
208
+
209
+ $match_str = '#^'.$subdir_str.'('.$struct.')([^\?]*?)([\?].*?)?$#';
210
+
211
+ if(preg_match($match_str, $uri, $match_val))
212
+ {
213
+ // Match longest slug -- this is the most common
214
+ $params = $match_val[3];
215
+ if( $pretty_link_found =& $this->is_pretty_link_slug( $match_val[2] ) )
216
+ return compact('pretty_link_found','pretty_link_params');
217
+
218
+ // Trim down the matched link
219
+ $matched_link = preg_replace('#/[^/]*?$#','',$match_val[2],1);
220
+
221
+ // cycle through the links (maximum depth 25 folders so we don't get out
222
+ // of control -- that should be enough eh?) and trim the link down each time
223
+ for( $i=0; ($i < 25) and
224
+ $matched_link and
225
+ !empty($matched_link) and
226
+ $matched_link != $match_val[2]; $i++ )
227
+ {
228
+ $new_match_str ="#^{$subdir_str}({$struct})({$matched_link})(.*?)?$#";
229
+
230
+ $params = $match_val[3];
231
+ if( $pretty_link_found =& $this->is_pretty_link_slug( $match_val[2] ) )
232
+ return compact('pretty_link_found','pretty_link_params');
233
+
234
+ // Trim down the matched link and try again
235
+ $matched_link = preg_replace('#/[^/]*$#','',$match_val[2],1);
236
+ }
237
+ }
238
+ }
239
+
240
+ return false;
241
+ }
242
+
243
+ function &is_pretty_link_slug($slug)
244
+ {
245
+ return $this->getOneFromSlug( urldecode($slug) );
246
+ }
247
+
248
+ function get_link_min( $id, $return_type = OBJECT )
249
+ {
250
+ global $wpdb;
251
+ $query_str = "SELECT * FROM {$this->table_name} WHERE id=%d";
252
+ $query = $wpdb->prepare($query_str, $id);
253
+ return $wpdb->get_row($query, $return_type);
254
+ }
255
+
256
+ function getAll($where = '', $order_by = '', $return_type = OBJECT, $include_stats = false)
257
+ {
258
+ global $wpdb, $prli_click, $prli_group, $prli_utils;
259
+
260
+ if($include_stats)
261
+ $query = 'SELECT li.*, ' .
262
+ '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
263
+ 'WHERE cl.link_id = li.id' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as clicks, ' .
264
+ '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
265
+ 'WHERE cl.link_id = li.id ' .
266
+ 'AND cl.first_click <> 0' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as uniques, ' .
267
+ 'gr.name as group_name ' .
268
+ 'FROM '. $this->table_name . ' li ' .
269
+ 'LEFT OUTER JOIN ' . $prli_group->table_name . ' gr ON li.group_id=gr.id' .
270
+ $prli_utils->prepend_and_or_where(' WHERE', $where) . $order_by;
271
+ else
272
+ $query = "SELECT li.*, gr.name as group_name FROM {$this->table_name} li " .
273
+ 'LEFT OUTER JOIN ' . $prli_group->table_name . ' gr ON li.group_id=gr.id' .
274
+ $prli_utils->prepend_and_or_where(' WHERE', $where) . $order_by;
275
+
276
+ return $wpdb->get_results($query, $return_type);
277
+ }
278
+
279
+ // Pagination Methods
280
+ function getRecordCount($where="")
281
+ {
282
+ global $wpdb, $prli_utils;
283
+ $query = 'SELECT COUNT(*) FROM ' . $this->table_name . ' li' . $prli_utils->prepend_and_or_where(' WHERE', $where);
284
+ return $wpdb->get_var($query);
285
+ }
286
+
287
+ function getPageCount($p_size, $where="")
288
+ {
289
+ return ceil((int)$this->getRecordCount($where) / (int)$p_size);
290
+ }
291
+
292
+ function getPage($current_p,$p_size, $where = "", $order_by = '', $return_type = OBJECT)
293
+ {
294
+ global $wpdb, $prli_click, $prli_utils, $prli_group;
295
+ $end_index = $current_p * $p_size;
296
+ $start_index = $end_index - $p_size;
297
+ $query = 'SELECT li.*, ' .
298
+ '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
299
+ 'WHERE cl.link_id = li.id' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as clicks, ' .
300
+ '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
301
+ 'WHERE cl.link_id = li.id ' .
302
+ 'AND cl.first_click <> 0' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as uniques, ' .
303
+ 'gr.name as group_name ' .
304
+ 'FROM ' . $this->table_name . ' li ' .
305
+ 'LEFT OUTER JOIN ' . $prli_group->table_name . ' gr ON li.group_id=gr.id' .
306
+ $prli_utils->prepend_and_or_where(' WHERE', $where) . $order_by . ' ' .
307
+ 'LIMIT ' . $start_index . ',' . $p_size . ';';
308
+ $results = $wpdb->get_results($query, $return_type);
309
+ return $results;
310
+ }
311
+
312
+ /** I'm generating a slug that is by default 2-3 characters long.
313
+ * This gives us a possibility of 36^3 - 37 = 46,619 possible
314
+ * random slugs. That should be *more* than enough slugs for
315
+ * any website -- if I get any feedback that we need more then
316
+ * I can always make a config option to raise the # of chars.
317
+ */
318
+ function generateValidSlug($num_chars = 3)
319
+ {
320
+ global $wpdb, $prli_utils;
321
+
322
+ // We're doing a base 36 hash which is why we're always doing everything by 36
323
+ $max_slug_value = pow(36,$num_chars);
324
+ $min_slug_value = 37; // we want to have at least 2 characters in the slug
325
+ $slug = base_convert( rand($min_slug_value,$max_slug_value), 10, 36 );
326
+
327
+ $query = "SELECT slug FROM " . $this->table_name; // . " WHERE slug='" . $slug . "'";
328
+ $slugs = $wpdb->get_col($query,0);
329
+
330
+ // It is highly unlikely that we'll ever see 2 identical random slugs
331
+ // but just in case, here's some code to prevent collisions
332
+ while( in_array($slug,$slugs) or !$prli_utils->slugIsAvailable($slug) )
333
+ $slug = base_convert( rand($min_slug_value,$max_slug_value), 10, 36 );
334
+
335
+ return $slug;
336
+ }
337
+
338
+ function get_pretty_link_url($slug)
339
+ {
340
+ global $prli_blogurl;
341
+
342
+ $link = $this->getOneFromSlug($slug);
343
+
344
+ if((isset($link->param_forwarding) and $link->param_forwarding == 'custom') and
345
+ (isset($link->redirect_type) and $link->redirect_type == 'pixel'))
346
+ return "&lt;img src=\"".$prli_blogurl . PrliUtils::get_permalink_pre_slug_uri() . $link->slug . $link->param_struct . "\" width=\"1\" height=\"1\" style=\"display: none\" /&gt;";
347
+ else if((!isset($link->param_forwarding) or $link->param_forwarding != 'custom') and
348
+ (isset($link->redirect_type) and $link->redirect_type == 'pixel'))
349
+ return "&lt;img src=\"".$prli_blogurl . PrliUtils::get_permalink_pre_slug_uri() . $link->slug . "\" width=\"1\" height=\"1\" style=\"display: none\" /&gt;";
350
+ else if((isset($link->param_forwarding) and $link->param_forwarding == 'custom') and
351
+ (!isset($link->redirect_type) or $link->redirect_type != 'pixel'))
352
+ return $prli_blogurl . PrliUtils::get_permalink_pre_slug_uri() . $link->slug . $link->param_struct;
353
+ else
354
+ return $prli_blogurl . PrliUtils::get_permalink_pre_slug_uri() . $link->slug;
355
+ }
356
+
357
+ // Set defaults and grab get or post of each possible param
358
+ function get_params_array()
359
+ {
360
+ $values = array(
361
+ 'action' => (isset($_GET['action'])?$_GET['action']:(isset($_POST['action'])?$_POST['action']:'list')),
362
+ 'regenerate' => (isset($_GET['regenerate'])?$_GET['regenerate']:(isset($_POST['regenerate'])?$_POST['regenerate']:'false')),
363
+ 'id' => (isset($_GET['id'])?$_GET['id']:(isset($_POST['id'])?$_POST['id']:'')),
364
+ 'group_name' => (isset($_GET['group_name'])?$_GET['group_name']:(isset($_POST['group_name'])?$_POST['group_name']:'')),
365
+ 'paged' => (isset($_GET['paged'])?$_GET['paged']:(isset($_POST['paged'])?$_POST['paged']:1)),
366
+ 'group' => (isset($_GET['group'])?$_GET['group']:(isset($_POST['group'])?$_POST['group']:'')),
367
+ 'search' => (isset($_GET['search'])?$_GET['search']:(isset($_POST['search'])?$_POST['search']:'')),
368
+ 'sort' => (isset($_GET['sort'])?$_GET['sort']:(isset($_POST['sort'])?$_POST['sort']:'')),
369
+ 'sdir' => (isset($_GET['sdir'])?$_GET['sdir']:(isset($_POST['sdir'])?$_POST['sdir']:''))
370
+ );
371
+
372
+ return $values;
373
+ }
374
+
375
+ function validate( $values )
376
+ {
377
+ global $wpdb, $prli_utils, $prli_blogurl;
378
+
379
+ $errors = array();
380
+ if( ( $values['url'] == null or $values['url'] == '') and $values['redirect_type'] != 'pixel' )
381
+ $errors[] = "Target URL can't be blank";
382
+
383
+ if( $values['slug'] == null or $values['slug'] == '' )
384
+ $errors[] = "Pretty Link can't be blank";
385
+
386
+ if( $values['url'] == $prli_blogurl.PrliUtils::get_permalink_pre_slug_uri().$values['slug'] )
387
+ $errors[] = "Target URL must be different than the Pretty Link";
388
+
389
+ if( !empty($values['url']) and
390
+ !preg_match('/^http.?:\/\/.*\..*$/', $values['url'] ) and
391
+ !preg_match('!^(http|https)://(localhost|127\.0\.0\.1)(:\d+)?(/[\w- ./?%&=]*)?!', $values['url'] ) )
392
+ $errors[] = "Link URL must be a correctly formatted url";
393
+
394
+ if( preg_match('/^[\?\&\#]+$/', $values['slug'] ) )
395
+ $errors[] = "Pretty Link slugs must not contain question marks, ampersands or number signs.";
396
+
397
+ if( preg_match('#/$#', $values['slug']) )
398
+ $errors[] = "Pretty Link slugs must not end with a slash (\"/\")";
399
+
400
+ if( !$prli_utils->slugIsAvailable($values['slug'],$values['id']) )
401
+ $errors[] = "This Pretty Link Slug is already taken. Check to make sure it isn't being used by another pretty link, post, page, category or tag slug. If none of these are true then check to see that this slug isn't the name of a file in the root folder of your wordpress install.";
402
+
403
+ if( isset($values['param_forwarding']) and $values['param_forwarding'] == 'custom' and empty($values['param_struct']) )
404
+ $errors[] = "If Custom Parameter Forwarding has been selected then you must specify a forwarding format.";
405
+
406
+ if( isset($values['param_forwarding']) and $values['param_forwarding'] == 'custom' and !preg_match('#%.*?%#', $values['param_struct']) )
407
+ $errors[] = "Your parameter forwarding must have at least one parameter specified in the format ex: <code>/%var1%/%var_two%/%varname3% ...</code>";
408
+
409
+ return $errors;
410
+ }
411
+ }
412
+ ?>
classes/models/PrliLinkMeta.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class PrliLinkMeta
3
+ {
4
+ var $table_name;
5
+
6
+ function PrliLinkMeta()
7
+ {
8
+ global $wpdb;
9
+ $this->table_name = "{$wpdb->prefix}prli_link_metas";
10
+ }
11
+
12
+ function get_link_meta($link_id,$meta_key,$return_var=false)
13
+ {
14
+ global $wpdb;
15
+ $query_str = "SELECT meta_value FROM {$this->table_name} WHERE meta_key=%s and link_id=%d";
16
+ $query = $wpdb->prepare($query_str,$meta_key,$link_id);
17
+
18
+ if($return_var)
19
+ return $wpdb->get_var("{$query} LIMIT 1");
20
+ else
21
+ return $wpdb->get_col($query, 0);
22
+ }
23
+
24
+ function add_link_meta($link_id, $meta_key, $meta_value)
25
+ {
26
+ global $wpdb;
27
+
28
+ $query_str = "INSERT INTO {$this->table_name} " .
29
+ '(meta_key,meta_value,link_id,created_at) VALUES (%s,%s,%d,NOW())';
30
+ $query = $wpdb->prepare($query_str, $meta_key, $meta_value, $link_id);
31
+ return $wpdb->query($query);
32
+ }
33
+
34
+ function update_link_meta($link_id, $meta_key, $meta_values)
35
+ {
36
+ global $wpdb;
37
+ $this->delete_link_meta($link_id, $meta_key);
38
+
39
+ if(!is_array($meta_values))
40
+ $meta_values = array($meta_values);
41
+
42
+ $status = false;
43
+ foreach($meta_values as $meta_value)
44
+ $status = $this->add_link_meta($link_id, $meta_key, $meta_value);
45
+
46
+ return $status;
47
+ }
48
+
49
+ function delete_link_meta($link_id, $meta_key)
50
+ {
51
+ global $wpdb;
52
+
53
+ $query_str = "DELETE FROM {$this->table_name} " .
54
+ "WHERE meta_key=%s AND link_id=%d";
55
+ $query = $wpdb->prepare($query_str, $meta_key, $link_id);
56
+ return $wpdb->query($query);
57
+ }
58
+ }
59
+ ?>
classes/models/PrliOptions.php ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class PrliOptions
3
+ {
4
+ var $prli_exclude_ips;
5
+ var $whitelist_ips;
6
+ var $filter_robots;
7
+ var $prettybar_image_url;
8
+ var $prettybar_background_image_url;
9
+ var $prettybar_color;
10
+ var $prettybar_text_color;
11
+ var $prettybar_link_color;
12
+ var $prettybar_hover_color;
13
+ var $prettybar_visited_color;
14
+ var $prettybar_show_title;
15
+ var $prettybar_show_description;
16
+ var $prettybar_show_share_links;
17
+ var $prettybar_show_target_url_link;
18
+ var $prettybar_title_limit;
19
+ var $prettybar_desc_limit;
20
+ var $prettybar_link_limit;
21
+
22
+ var $link_redirect_type;
23
+ var $link_prefix;
24
+ var $link_track_me;
25
+ var $link_nofollow;
26
+
27
+ var $bookmarklet_auth;
28
+
29
+ function PrliOptions()
30
+ {
31
+ $this->set_default_options();
32
+ }
33
+
34
+ function set_default_options()
35
+ {
36
+ // Must account for the Legacy Options
37
+ $prli_exclude_ips = 'prli_exclude_ips';
38
+ $prettybar_image_url = 'prli_prettybar_image_url';
39
+ $prettybar_background_image_url = 'prli_prettybar_background_image_url';
40
+ $prettybar_color = 'prli_prettybar_color';
41
+ $prettybar_text_color = 'prli_prettybar_text_color';
42
+ $prettybar_link_color = 'prli_prettybar_link_color';
43
+ $prettybar_hover_color = 'prli_prettybar_hover_color';
44
+ $prettybar_visited_color = 'prli_prettybar_visited_color';
45
+ $prettybar_show_title = 'prli_prettybar_show_title';
46
+ $prettybar_show_description = 'prli_prettybar_show_description';
47
+ $prettybar_show_share_links = 'prli_prettybar_show_share_links';
48
+ $prettybar_show_target_url_link = 'prli_prettybar_show_target_url_link';
49
+ $prettybar_title_limit = 'prli_prettybar_title_limit';
50
+ $prettybar_desc_limit = 'prli_prettybar_desc_limit';
51
+ $prettybar_link_limit = 'prli_prettybar_link_limit';
52
+ $link_show_prettybar = 'prli_link_show_prettybar';
53
+ $link_ultra_cloak = 'prli_link_ultra_cloak';
54
+ $link_track_me = 'prli_link_track_me';
55
+ $link_prefix = 'prli_link_prefix';
56
+ $link_track_as_pixel = 'prli_link_track_as_pixel';
57
+ $link_nofollow = 'prli_link_nofollow';
58
+ $link_redirect_type = 'prli_link_redirect_type';
59
+
60
+
61
+ if(!isset($this->prettybar_show_title)) {
62
+ if($var = get_option( $prettybar_show_title )) {
63
+ $this->prettybar_show_title = $var;
64
+ delete_option( $prettybar_show_title );
65
+ }
66
+ else
67
+ $this->prettybar_show_title = '1';
68
+ }
69
+
70
+ if(!isset($this->prettybar_show_description)) {
71
+ if($var = get_option( $prettybar_show_description )) {
72
+ $this->prettybar_show_description = $var;
73
+ delete_option( $prettybar_show_description );
74
+ }
75
+ else
76
+ $this->prettybar_show_description = '1';
77
+ }
78
+
79
+ if(!isset($this->prettybar_show_share_links)) {
80
+ if($var = get_option( $prettybar_show_share_links )) {
81
+ $this->prettybar_show_share_links = $var;
82
+ delete_option( $prettybar_show_share_links );
83
+ }
84
+ else
85
+ $this->prettybar_show_share_links = '1';
86
+ }
87
+
88
+ if(!isset($this->prettybar_show_target_url_link)) {
89
+ if($var = get_option( $prettybar_show_target_url_link )) {
90
+ $this->prettybar_show_target_url_link = $var;
91
+ delete_option( $prettybar_show_target_url_link );
92
+ }
93
+ else
94
+ $this->prettybar_show_target_url_link = '1';
95
+ }
96
+
97
+ if(!isset($this->link_track_me)) {
98
+ if($var = get_option( $link_track_me )) {
99
+ $this->link_track_me = $var;
100
+ delete_option( $link_track_me );
101
+ }
102
+ else
103
+ $this->link_track_me = '1';
104
+ }
105
+
106
+ if(!isset($this->link_prefix))
107
+ $this->link_prefix = 0;
108
+
109
+ if(!isset($this->link_nofollow)) {
110
+ if($var = get_option( $link_nofollow )) {
111
+ $this->link_nofollow = $var;
112
+ delete_option( $link_nofollow );
113
+ }
114
+ else
115
+ $this->link_nofollow = '0';
116
+ }
117
+
118
+ if(!isset($this->link_redirect_type)) {
119
+ if($var = get_option( $link_track_as_pixel )) {
120
+ $this->link_redirect_type = 'pixel';
121
+ delete_option( $link_show_prettybar );
122
+ delete_option( $link_ultra_cloak );
123
+ delete_option( $link_track_as_pixel );
124
+ delete_option( $link_redirect_type );
125
+ }
126
+ if($var = get_option( $link_show_prettybar )) {
127
+ $this->link_redirect_type = 'prettybar';
128
+ delete_option( $link_show_prettybar );
129
+ delete_option( $link_ultra_cloak );
130
+ delete_option( $link_track_as_pixel );
131
+ delete_option( $link_redirect_type );
132
+ }
133
+ if($var = get_option( $link_ultra_cloak )) {
134
+ $this->link_redirect_type = 'cloak';
135
+ delete_option( $link_show_prettybar );
136
+ delete_option( $link_ultra_cloak );
137
+ delete_option( $link_track_as_pixel );
138
+ delete_option( $link_redirect_type );
139
+ }
140
+ if($var = get_option( $link_redirect_type )) {
141
+ $this->link_redirect_type = $var;
142
+ delete_option( $link_show_prettybar );
143
+ delete_option( $link_ultra_cloak );
144
+ delete_option( $link_track_as_pixel );
145
+ delete_option( $link_redirect_type );
146
+ }
147
+ else
148
+ $this->link_redirect_type = '307';
149
+ }
150
+
151
+ if(!isset($this->prli_exclude_ips))
152
+ {
153
+ if($var = get_option( $prli_exclude_ips )) {
154
+ $this->prli_exclude_ips = $var;
155
+ delete_option( $prli_exclude_ips );
156
+ }
157
+ else
158
+ $this->prli_exclude_ips = '';
159
+ }
160
+
161
+ if(!isset($this->prettybar_image_url))
162
+ {
163
+ if($var = get_option( $prettybar_image_url )) {
164
+ $this->prettybar_image_url = $var;
165
+ delete_option( $prettybar_image_url );
166
+ }
167
+ else
168
+ $this->prettybar_image_url = PRLI_URL . '/images/pretty-link-48x48.png';
169
+ }
170
+
171
+ if(!isset($this->prettybar_background_image_url))
172
+ {
173
+ if($var = get_option( $prettybar_background_image_url )) {
174
+ $this->prettybar_background_image_url = $var;
175
+ delete_option( $prettybar_background_image_url );
176
+ }
177
+ else
178
+ $this->prettybar_background_image_url = PRLI_URL . '/images/bar_background.png';
179
+ }
180
+
181
+ if(!isset($this->prettybar_color))
182
+ {
183
+ if($var = get_option( $prettybar_color )) {
184
+ $this->prettybar_color = $var;
185
+ delete_option( $prettybar_color );
186
+ }
187
+ else
188
+ $this->prettybar_color = '';
189
+ }
190
+
191
+ if(!isset($this->prettybar_text_color))
192
+ {
193
+ if($var = get_option( $prettybar_text_color )) {
194
+ $this->prettybar_text_color = $var;
195
+ delete_option( $prettybar_text_color );
196
+ }
197
+ else
198
+ $this->prettybar_text_color = '000000';
199
+ }
200
+
201
+ if(!isset($this->prettybar_link_color))
202
+ {
203
+ if($var = get_option( $prettybar_link_color )) {
204
+ $this->prettybar_link_color = $var;
205
+ delete_option( $prettybar_link_color );
206
+ }
207
+ else
208
+ $this->prettybar_link_color = '0000ee';
209
+ }
210
+
211
+ if(!isset($this->prettybar_hover_color))
212
+ {
213
+ if($var = get_option( $prettybar_hover_color )) {
214
+ $this->prettybar_hover_color = $var;
215
+ delete_option( $prettybar_hover_color );
216
+ }
217
+ else
218
+ $this->prettybar_hover_color = 'ababab';
219
+ }
220
+
221
+ if(!isset($this->prettybar_visited_color))
222
+ {
223
+ if($var = get_option( $prettybar_visited_color )) {
224
+ $this->prettybar_visited_color = $var;
225
+ delete_option( $prettybar_visited_color );
226
+ }
227
+ else
228
+ $this->prettybar_visited_color = '551a8b';
229
+ }
230
+
231
+ if(!isset($this->prettybar_title_limit))
232
+ {
233
+ if($var = get_option( $prettybar_title_limit )) {
234
+ $this->prettybar_title_limit = $var;
235
+ delete_option( $prettybar_title_limit );
236
+ }
237
+ else
238
+ $this->prettybar_title_limit = '25';
239
+ }
240
+
241
+ if(!isset($this->prettybar_desc_limit))
242
+ {
243
+ if($var = get_option( $prettybar_desc_limit )) {
244
+ $this->prettybar_desc_limit = $var;
245
+ delete_option( $prettybar_desc_limit );
246
+ }
247
+ else
248
+ $this->prettybar_desc_limit = '30';
249
+ }
250
+
251
+ if(!isset($this->prettybar_link_limit))
252
+ {
253
+ if($var = get_option( $prettybar_link_limit )) {
254
+ $this->prettybar_link_limit = $var;
255
+ delete_option( $prettybar_link_limit );
256
+ }
257
+ else
258
+ $this->prettybar_link_limit = '30';
259
+ }
260
+
261
+ if(!isset($this->bookmarklet_auth))
262
+ $this->bookmarklet_auth = md5(get_option('auth_salt') . time());
263
+
264
+ if(!isset($this->whitelist_ips))
265
+ $this->whitelist_ips = '';
266
+
267
+ if(!isset($this->filter_robots))
268
+ $this->filter_robots = 0;
269
+ }
270
+ }
271
+ ?>
classes/models/PrliUpdate.php ADDED
@@ -0,0 +1,330 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /** Okay, this class is not a pure model -- it contains all the functions
4
+ * necessary to successfully provide an update mechanism for PrettyLinkPro!
5
+ */
6
+ class PrliUpdate
7
+ {
8
+ var $plugin_name;
9
+ var $plugin_slug;
10
+ var $plugin_url;
11
+ var $pro_script;
12
+ var $pro_mothership;
13
+
14
+ var $pro_cred_store;
15
+ var $pro_auth_store;
16
+
17
+ var $pro_username_label;
18
+ var $pro_password_label;
19
+
20
+ var $pro_username_str;
21
+ var $pro_password_str;
22
+
23
+ var $pro_error_message_str;
24
+
25
+ var $pro_check_interval;
26
+ var $pro_last_checked_store;
27
+
28
+ var $pro_username;
29
+ var $pro_password;
30
+ var $pro_mothership_xmlrpc_url;
31
+
32
+ var $wordpress_version;
33
+
34
+ function PrliUpdate()
35
+ {
36
+ // Where all the vitals are defined for this plugin
37
+ $this->plugin_name = 'pretty-link/pretty-link.php';
38
+ $this->plugin_slug = 'pretty-link';
39
+ $this->plugin_url = 'http://blairwilliams.com/pl';
40
+ $this->pro_script = PRLI_PATH . '/pro/pretty-link-pro.php';
41
+ $this->pro_mothership = 'http://prettylinkpro.com';
42
+ $this->pro_cred_store = 'prlipro-credentials';
43
+ $this->pro_auth_store = 'prlipro_activated';
44
+ $this->pro_last_checked_store = 'prlipro_last_checked_update';
45
+ $this->pro_username_label = __('Pretty Link Pro Username');
46
+ $this->pro_password_label = __('Pretty Link Pro Password');
47
+ $this->pro_error_message_str = __('Your Pretty Link Pro Username or Password was Invalid');
48
+
49
+ // Don't modify these variables
50
+ $this->pro_check_interval = 60*15; // Checking every 15 minutes
51
+ $this->pro_username_str = 'proplug-username';
52
+ $this->pro_password_str = 'proplug-password';
53
+ $this->pro_mothership_xmlrpc_url = $this->pro_mothership . '/xmlrpc.php';
54
+
55
+ // Get the numerical version of wordpress
56
+ $this->wordpress_version = (float)preg_replace( "#^([\d\.]*).*$#", '$1', get_bloginfo('version') );
57
+
58
+ // Retrieve Pro Credentials
59
+ $creds = get_option($this->pro_cred_store);
60
+ if($creds and is_array($creds))
61
+ {
62
+ extract($creds);
63
+ $this->pro_username = ((isset($username) and !empty($username))?$username:'');
64
+ $this->pro_password = ((isset($password) and !empty($password))?$password:'');
65
+
66
+ // Plugin Update Actions -- gotta make sure the right url is used with pro ... don't want any downgrades of course
67
+ add_action('update_option_update_plugins', array($this, 'check_for_update_now')); // for WordPress 2.7
68
+ add_action('update_option__transient_update_plugins', array($this, 'check_for_update_now')); // for WordPress 2.8
69
+ add_action("admin_init", array($this, 'periodically_check_for_update'));
70
+ }
71
+ }
72
+
73
+ function pro_is_installed()
74
+ {
75
+ return file_exists($this->pro_script);
76
+ }
77
+
78
+ function pro_is_authorized($force_check=false)
79
+ {
80
+ if( !empty($this->pro_username) and
81
+ !empty($this->pro_password) )
82
+ {
83
+ $authorized = get_option($this->pro_auth_store);
84
+ if(!$force_check and isset($authorized))
85
+ return $authorized;
86
+ else
87
+ {
88
+ $new_auth = $this->authorize_user($this->pro_username,$this->pro_password);
89
+ update_option($this->pro_auth_store, $new_auth);
90
+ return $new_auth;
91
+ }
92
+ }
93
+
94
+ return false;
95
+ }
96
+
97
+ function pro_is_installed_and_authorized()
98
+ {
99
+ return ($this->pro_is_installed() and $this->pro_is_authorized());
100
+ }
101
+
102
+ function authorize_user($username, $password)
103
+ {
104
+ include_once( ABSPATH . 'wp-includes/class-IXR.php' );
105
+
106
+ $client = new IXR_Client( $this->pro_mothership_xmlrpc_url );
107
+
108
+ if ( !$client->query( 'proplug.is_user_authorized', $username, $password ) )
109
+ return false;
110
+
111
+ return $client->getResponse();
112
+ }
113
+
114
+ function user_allowed_to_download()
115
+ {
116
+ include_once( ABSPATH . 'wp-includes/class-IXR.php' );
117
+
118
+ $client = new IXR_Client( $this->pro_mothership_xmlrpc_url );
119
+
120
+ if ( !$client->query( 'proplug.is_user_allowed_to_download', $this->pro_username, $this->pro_password, get_option('home') ) )
121
+ return false;
122
+
123
+ return $client->getResponse();
124
+ }
125
+
126
+ function pro_cred_form()
127
+ {
128
+ if(isset($_POST) and
129
+ isset($_POST['process_cred_form']) and
130
+ $_POST['process_cred_form'] == 'Y')
131
+ {
132
+ if($this->process_pro_cred_form())
133
+ {
134
+ if(!$this->pro_is_installed())
135
+ {
136
+ $inst_install_url = wp_nonce_url('update.php?action=upgrade-plugin&plugin=' . $this->plugin_name, 'upgrade-plugin_' . $this->plugin_name);
137
+
138
+ ?>
139
+ <div id="message" class="updated fade">
140
+ <strong><?php printf(__('Your Username & Password was accepted<br/>Now you can %1$sUpgrade Automatically!%2$s'), "<a href=\"{$inst_install_url}\">","</a>"); ?></strong>
141
+ </div>
142
+ <?php
143
+ }
144
+ }
145
+ else
146
+ {
147
+ ?>
148
+ <div class="error">
149
+ <ul>
150
+ <li><strong><?php _e('ERROR', 'pretty-link'); ?></strong>: <?php echo $this->pro_error_message_str; ?></li>
151
+ </ul>
152
+ </div>
153
+ <?php
154
+ }
155
+ }
156
+
157
+ $this->display_pro_cred_form();
158
+ }
159
+
160
+ function display_pro_cred_form()
161
+ {
162
+ // Yah, this is the view for the credentials form -- this class isn't a true model
163
+ extract($this->get_pro_cred_form_vals());
164
+ ?>
165
+ <form name="cred_form" method="post" action="">
166
+ <input type="hidden" name="process_cred_form" value="Y">
167
+ <?php wp_nonce_field('cred_form'); ?>
168
+
169
+ <table class="form-table">
170
+ <tr class="form-field">
171
+ <td valign="top" width="15%"><?php echo $this->pro_username_label; ?>:</td>
172
+ <td width="85%">
173
+ <input type="text" name="<?php echo $this->pro_username_str; ?>" value="<?php echo $username; ?>"/>
174
+ </td>
175
+ </tr>
176
+ <tr class="form-field">
177
+ <td valign="top" width="15%"><?php echo $this->pro_password_label; ?>:</td>
178
+ <td width="85%">
179
+ <input type="password" name="<?php echo $this->pro_password_str; ?>" value="<?php echo $password; ?>"/>
180
+ </td>
181
+ </tr>
182
+ </table>
183
+ <p class="submit">
184
+ <input type="submit" name="Submit" value="<?php _e('Save'); ?>" />
185
+ </p>
186
+ </form>
187
+ <?php
188
+ }
189
+
190
+ function process_pro_cred_form()
191
+ {
192
+ $creds = $this->get_pro_cred_form_vals();
193
+ $user_authorized = $this->authorize_user($creds['username'], $creds['password']);
194
+
195
+ if(!empty($user_authorized) and $user_authorized)
196
+ {
197
+ update_option($this->pro_cred_store, $creds);
198
+ update_option($this->pro_auth_store, $user_authorized);
199
+
200
+ extract($creds);
201
+ $this->pro_username = ((isset($username) and !empty($username))?$username:'');
202
+ $this->pro_password = ((isset($password) and !empty($password))?$password:'');
203
+
204
+ if(!$this->pro_is_installed())
205
+ $this->queue_update(true);
206
+ }
207
+
208
+ return $user_authorized;
209
+ }
210
+
211
+ function get_pro_cred_form_vals()
212
+ {
213
+ $username = ((isset($_POST[$this->pro_username_str]))?$_POST[$this->pro_username_str]:$this->pro_username);
214
+ $password = ((isset($_POST[$this->pro_password_str]))?$_POST[$this->pro_password_str]:$this->pro_password);
215
+
216
+ return compact('username','password');
217
+ }
218
+
219
+ function get_download_url($version)
220
+ {
221
+ include_once( ABSPATH . 'wp-includes/class-IXR.php' );
222
+
223
+ $client = new IXR_Client( $this->pro_mothership_xmlrpc_url );
224
+
225
+ if( !$client->query( 'proplug.get_encoded_download_url', $this->pro_username, $this->pro_password, $version ) )
226
+ return false;
227
+
228
+ return base64_decode($client->getResponse());
229
+ }
230
+
231
+ function get_current_version()
232
+ {
233
+ include_once( ABSPATH . 'wp-includes/class-IXR.php' );
234
+
235
+ $client = new IXR_Client( $this->pro_mothership_xmlrpc_url );
236
+
237
+ if( !$client->query( 'proplug.get_current_version' ) )
238
+ return false;
239
+
240
+ return $client->getResponse();
241
+ }
242
+
243
+ function queue_update($force=false)
244
+ {
245
+ static $already_set_option, $already_set_transient, $already_set_site_transient;
246
+
247
+ if(!is_admin())
248
+ return;
249
+
250
+ // Make sure this method doesn't check back with the mothership too often
251
+ if($already_set_option or $already_set_transient or $already_set_site_transient)
252
+ return;
253
+
254
+ if($this->pro_is_authorized())
255
+ {
256
+ // If pro is authorized but not installed then we need to force an upgrade
257
+ if(!$this->pro_is_installed())
258
+ $force=true;
259
+
260
+ if($this->wordpress_version >= 3.0)
261
+ $plugin_updates = get_site_transient("update_plugins");
262
+ else
263
+ {
264
+ if(function_exists('get_transient'))
265
+ $plugin_updates = get_transient("update_plugins");
266
+ else
267
+ $plugin_updates = get_option("update_plugins");
268
+ }
269
+
270
+ $curr_version = $this->get_current_version();
271
+ $installed_version = $plugin_updates->checked[$this->plugin_name];
272
+
273
+ if( $force or ( $curr_version != $installed_version ) )
274
+ {
275
+ $download_url = $this->get_download_url($curr_version);
276
+
277
+ if(!empty($download_url) and $download_url and $this->user_allowed_to_download())
278
+ {
279
+ if(isset($plugin_updates->response[$this->plugin_name]))
280
+ unset($plugin_updates->response[$this->plugin_name]);
281
+
282
+ $plugin_updates->response[$this->plugin_name] = new stdClass();
283
+ $plugin_updates->response[$this->plugin_name]->id = '0';
284
+ $plugin_updates->response[$this->plugin_name]->slug = $this->plugin_slug;
285
+ $plugin_updates->response[$this->plugin_name]->new_version = $curr_version;
286
+ $plugin_updates->response[$this->plugin_name]->url = $this->plugin_url;
287
+ $plugin_updates->response[$this->plugin_name]->package = $download_url;
288
+ }
289
+ }
290
+ else
291
+ {
292
+ if(isset($plugin_updates->response[$this->plugin_name]))
293
+ unset($plugin_updates->response[$this->plugin_name]);
294
+ }
295
+
296
+ if( ( $this->wordpress_version >= 3.0 ) and !$already_set_site_transient )
297
+ {
298
+ $already_set_site_transient = true;
299
+ set_site_transient("update_plugins", $plugin_updates); // for WordPress 3.0
300
+ }
301
+ else if( function_exists('set_transient') and !$already_set_transient )
302
+ {
303
+ $already_set_transient = true;
304
+ set_transient("update_plugins", $plugin_updates); // for WordPress 2.8+
305
+ }
306
+ else if( !$already_set_option )
307
+ {
308
+ $already_set_option = true;
309
+ update_option("update_plugins", $plugin_updates); // for WordPress 2.7+
310
+ }
311
+ }
312
+ }
313
+
314
+ function check_for_update_now()
315
+ {
316
+ $this->queue_update();
317
+ }
318
+
319
+ function periodically_check_for_update()
320
+ {
321
+ $last_checked = get_option($this->pro_last_checked_store);
322
+
323
+ if(!$last_checked or ((time() - $last_checked) >= $this->pro_check_interval))
324
+ {
325
+ $this->queue_update();
326
+ update_option($this->pro_last_checked_store, time());
327
+ }
328
+ }
329
+ }
330
+ ?>
classes/models/PrliUrlUtils.php ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class PrliUrlUtils {
3
+
4
+ function get_title($url, $slug='')
5
+ {
6
+ $title = '';
7
+
8
+ $data = PrliUrlUtils::curl_read_remote_file($url);
9
+
10
+ // Look for <title>(.*?)</title> in the text
11
+ if($data and preg_match('#<title>[\s\n\r]*?(.*?)[\s\n\r]*?</title>#im', $data, $matches))
12
+ $title = trim($matches[1]);
13
+
14
+ if(empty($title) or !$title)
15
+ return $slug;
16
+
17
+ return $title;
18
+ }
19
+
20
+ function valid_url($url)
21
+ {
22
+ $data = PrliUrlUtils::curl_read_remote_header($url);
23
+
24
+ if(!empty($data) and $data)
25
+ {
26
+ preg_match("/HTTP\/1\.[1|0]\s(\d{3})/",$data,$matches);
27
+ return ($matches[1] == '200');
28
+ }
29
+
30
+ // Let's just assume its valid if we can't test it
31
+ return true;
32
+ }
33
+
34
+ function curl_read_remote_header($url)
35
+ {
36
+ if(function_exists('curl_init'))
37
+ {
38
+ $ch = curl_init();
39
+
40
+ curl_setopt($ch, CURLOPT_URL, $url);
41
+ curl_setopt($ch, CURLOPT_HEADER, true);
42
+ curl_setopt($ch, CURLOPT_NOBODY, true);
43
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
44
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
45
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
46
+
47
+ $data = curl_exec($ch);
48
+
49
+ curl_close($ch);
50
+
51
+ return $data;
52
+ }
53
+
54
+ return false;
55
+ }
56
+
57
+ function curl_read_remote_file($url)
58
+ {
59
+ if(function_exists('curl_init'))
60
+ {
61
+ $ch = curl_init();
62
+
63
+ curl_setopt($ch, CURLOPT_URL, $url);
64
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
65
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
66
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
67
+
68
+ $data = curl_exec($ch);
69
+
70
+ curl_close($ch);
71
+
72
+ return $data;
73
+ }
74
+
75
+ return false;
76
+ }
77
+
78
+ /**
79
+ * Sends http request ensuring the request will fail before $timeout seconds
80
+ * gotta use a socket connection because some hosting setups don't allow fopen.
81
+ * Supports SSL sites as well as 301, 302 & 307 redirects
82
+ * Returns the response content (no header, trimmed)
83
+ * @param string $url
84
+ * @param string $num_chunks Set to 0 if you want to read the full file
85
+ * @param string $chunk_size In bytes
86
+ * @param int $timeout
87
+ * @return string|false false if request failed
88
+ */
89
+ function read_remote_file($url, $num_chunks=0, $headers='', $params='', $chunk_size=1024, $timeout=30 )
90
+ {
91
+ $purl = @parse_url($url);
92
+
93
+ $sock_host = $purl['host'];
94
+ $sock_port = ($purl['port']?(int)$purl['port']:80);
95
+ $sock_scheme = $purl['scheme'];
96
+
97
+ $req_host = $purl['host'];
98
+ $req_path = $purl['path'];
99
+
100
+ if(empty($req_path))
101
+ $req_path = "/";
102
+
103
+ if($sock_scheme == 'https')
104
+ {
105
+ $sock_port = 443;
106
+ $sock_host = "ssl://{$sock_host}";
107
+ }
108
+
109
+ $fp = fsockopen($sock_host, $sock_port, $errno, $errstr, $timeout);
110
+ $contents = '';
111
+ $header = '';
112
+
113
+ if (!$fp)
114
+ return false;
115
+ else
116
+ {
117
+ // Send get request
118
+ $request = "GET {$req_path}{$params} HTTP/1.1\r\n";
119
+ $request .= "Host: {$req_host}\r\n";
120
+ $request .= $headers;
121
+ $request .= "Connection: Close\r\n\r\n";
122
+ fwrite($fp, $request);
123
+
124
+ // Read response
125
+ $head_end_found = false;
126
+ $buffer = '';
127
+ for($i = 0; !feof($fp); $i++)
128
+ {
129
+ if($num_chunks > 0 and $i >= $num_chunks)
130
+ break;
131
+
132
+ $out = fread($fp,$chunk_size);
133
+ if($head_end_found)
134
+ $contents .= $out;
135
+ else
136
+ {
137
+ $buffer .= $out;
138
+ $head_end = strpos($buffer, "\r\n\r\n");
139
+ if($head_end !== false)
140
+ {
141
+ $head_end_found = true;
142
+ $contents .= substr($buffer, ($head_end + 4));
143
+ $header .= substr($buffer, 0, $head_end);
144
+ // Follow HTTP redirects
145
+ if(preg_match("#http/1\.1 (301|302|307)#i",$header))
146
+ {
147
+ preg_match("#^Location:(.*?)$#im",$header,$matches);
148
+ return PrliUrlUtils::read_remote_file(trim($matches[1]));
149
+ }
150
+ else if(preg_match("#http/1\.1 (400|401|402|403|404|405|406|407|408|409|410|411|412|413|414|415|416|417|500|501|502|503|504|505)#i",$header))
151
+ return false; // The file wasn't found
152
+ }
153
+ }
154
+ }
155
+ fclose($fp);
156
+ }
157
+
158
+ if(empty($contents))
159
+ return false;
160
+ else
161
+ return trim($contents);
162
+ }
163
+ }
164
+ ?>
classes/models/PrliUtils.php ADDED
@@ -0,0 +1,1113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once('models.inc.php');
3
+
4
+ class PrliUtils
5
+ {
6
+ /** Okay I realize that Percentagize isn't really a word but
7
+ * this is so that the values we have will work with google
8
+ * charts.
9
+ */
10
+ function percentagizeArray($data,$max_value)
11
+ {
12
+ $new_data = array();
13
+ foreach($data as $point)
14
+ {
15
+ if( $max_value > 0 )
16
+ {
17
+ $new_data[] = $point / $max_value * 100;
18
+ }
19
+ else
20
+ {
21
+ $new_data[] = 0;
22
+ }
23
+ }
24
+ return $new_data;
25
+ }
26
+
27
+ function getTopValue($values_array)
28
+ {
29
+ rsort($values_array);
30
+ return $values_array[0];
31
+ }
32
+
33
+ function getFirstClickDate()
34
+ {
35
+ global $wpdb;
36
+
37
+ $clicks_table = $wpdb->prefix . "prli_clicks";
38
+ $query = "SELECT created_at FROM $clicks_table ORDER BY created_at LIMIT 1";
39
+ $first_click = $wpdb->get_var($query);
40
+
41
+ if(isset($first_click))
42
+ {
43
+ return strtotime($first_click);
44
+ }
45
+ else
46
+ return null;
47
+ }
48
+
49
+ function getMonthsArray()
50
+ {
51
+ global $wpdb;
52
+ global $prli_click;
53
+
54
+ $months = array();
55
+ $year = date("Y");
56
+ $month = date("m");
57
+ $current_timestamp = time();
58
+ $current_month_timestamp = mktime(0, 0, 0, date("m", $current_timestamp), 1, date("Y", $current_timestamp));
59
+
60
+ $clicks_table = $prli_click->tableName();
61
+ $first_click = $wpdb->get_var("SELECT created_at FROM $clicks_table ORDER BY created_at LIMIT 1;");
62
+ $first_timestamp = ((empty($first_click))?$current_timestamp:strtotime($first_click));
63
+ $first_date = mktime(0, 0, 0, date("m", $first_timestamp), 1, date("Y", $first_timestamp));
64
+
65
+ while($current_month_timestamp >= $first_date)
66
+ {
67
+ $months[] = $current_month_timestamp;
68
+ if(date("m") == 1)
69
+ $current_month_timestamp = mktime(0, 0, 0, 12, 1, date("Y", $current_month_timestamp)-1);
70
+ else
71
+ $current_month_timestamp = mktime(0, 0, 0, date("m", $current_month_timestamp)-1, 1, date("Y", $current_month_timestamp));
72
+ }
73
+ return $months;
74
+ }
75
+
76
+ // For Pagination
77
+ function getLastRecordNum($r_count,$current_p,$p_size)
78
+ {
79
+ return (($r_count < ($current_p * $p_size))?$r_count:($current_p * $p_size));
80
+ }
81
+
82
+ // For Pagination
83
+ function getFirstRecordNum($r_count,$current_p,$p_size)
84
+ {
85
+ if($current_p == 1)
86
+ return 1;
87
+ else
88
+ return ($this->getLastRecordNum($r_count,($current_p - 1),$p_size) + 1);
89
+ }
90
+
91
+ function slugIsAvailable( $full_slug, $id = '' )
92
+ {
93
+ global $wpdb, $prli_blogurl, $prli_link;
94
+
95
+ // We don't care about anything after the slash for now because we don't want
96
+ // to have to worry about comparing against every imaginable combination in WordPress
97
+ $slug_components = explode('/',$full_slug);
98
+ $slug = $slug_components[0];
99
+
100
+ // Check slug uniqueness against posts, pages and categories
101
+ $posts_table = $wpdb->prefix . "posts";
102
+ $terms_table = $wpdb->prefix . "terms";
103
+
104
+ $post_slug = $wpdb->get_var("SELECT post_name FROM $posts_table WHERE post_name='$slug'");
105
+ $term_slug = $wpdb->get_col("SELECT slug FROM $terms_table WHERE slug='$slug'");
106
+
107
+ if( $post_slug == $slug or $term_slug == $slug )
108
+ return false;
109
+
110
+ // Check slug against files on the root wordpress install
111
+ $root_dir = opendir(ABSPATH);
112
+
113
+ while (($file = readdir($root_dir)) !== false) {
114
+ $haystack = strtolower($file);
115
+ if($haystack == $slug)
116
+ return false;
117
+ }
118
+
119
+ // Check slug against other slugs in the prli links database.
120
+ // We'll use the full_slug here because its easier to guarantee uniqueness.
121
+ if($id != null and $id != '')
122
+ $query = "SELECT slug FROM " . $prli_link->table_name . " WHERE slug='" . $full_slug . "' AND id <> " . $id;
123
+ else
124
+ $query = "SELECT slug FROM " . $prli_link->table_name . " WHERE slug='" . $full_slug . "'";
125
+
126
+ $link_slug = $wpdb->get_var($query);
127
+
128
+ if( $link_slug == $full_slug )
129
+ return false;
130
+
131
+ $pre_slug_slug = PrliUtils::get_permalink_pre_slug_uri(true,true);
132
+
133
+ if($full_slug == $pre_slug_slug)
134
+ return false;
135
+
136
+ // TODO: Check permalink structure to avoid the ability of creating a year or something as a slug
137
+
138
+ return true;
139
+ }
140
+
141
+ function &php_get_browsercap_ini()
142
+ {
143
+ // Since it's a fairly expensive proposition to load the ini file
144
+ // let's make sure we only do it once
145
+ static $browsecap_ini;
146
+
147
+ if(!isset($browsecap_ini))
148
+ {
149
+ if( version_compare(PHP_VERSION, '5.3.0') >= 0 )
150
+ $browsecap_ini =& parse_ini_file( PRLI_PATH . "/includes/php/php_browsecap.ini", true, INI_SCANNER_RAW );
151
+ else
152
+ $browsecap_ini =& parse_ini_file( PRLI_PATH . "/includes/php/php_browsecap.ini", true );
153
+ }
154
+
155
+ return $browsecap_ini;
156
+ }
157
+
158
+ /* Needed because we don't know if the target uesr will have a browsercap file installed
159
+ on their server ... particularly in a shared hosting environment this is difficult
160
+ */
161
+ function php_get_browser($agent = NULL)
162
+ {
163
+ $agent=$agent?$agent:$_SERVER['HTTP_USER_AGENT'];
164
+ $yu=array();
165
+ $q_s=array("#\.#","#\*#","#\?#");
166
+ $q_r=array("\.",".*",".?");
167
+ $brows =& $this->php_get_browsercap_ini();
168
+
169
+ if(!empty($brows) and $brows and is_array($brows))
170
+ {
171
+ foreach($brows as $k=>$t)
172
+ {
173
+ if(fnmatch($k,$agent))
174
+ {
175
+ $yu['browser_name_pattern']=$k;
176
+ $pat=preg_replace($q_s,$q_r,$k);
177
+ $yu['browser_name_regex']=strtolower("^$pat$");
178
+ foreach($brows as $g=>$r)
179
+ {
180
+ if($t['Parent']==$g)
181
+ {
182
+ foreach($brows as $a=>$b)
183
+ {
184
+ if($r['Parent']==$a)
185
+ {
186
+ $yu=array_merge($yu,$b,$r,$t);
187
+ foreach($yu as $d=>$z)
188
+ {
189
+ $l=strtolower($d);
190
+ $hu[$l]=$z;
191
+ }
192
+ }
193
+ }
194
+ }
195
+ }
196
+
197
+ break;
198
+ }
199
+ }
200
+ }
201
+
202
+ return $hu;
203
+ }
204
+
205
+ // This is where the magic happens!
206
+ function track_link($slug,$values)
207
+ {
208
+ global $wpdb, $prli_click, $prli_link;
209
+
210
+ $query = "SELECT * FROM ".$prli_link->table_name." WHERE slug='$slug' LIMIT 1";
211
+ $pretty_link = $wpdb->get_row($query);
212
+ $pretty_link_target = apply_filters('prli_target_url',array('url' => $pretty_link->url, 'link_id' => $pretty_link->id));
213
+ $pretty_link_url = $pretty_link_target['url'];
214
+
215
+ if(isset($pretty_link->track_me) and $pretty_link->track_me)
216
+ {
217
+ $first_click = 0;
218
+
219
+ $click_ip = $_SERVER['REMOTE_ADDR'];
220
+ $click_referer = $_SERVER['HTTP_REFERER'];
221
+ $click_host = gethostbyaddr($click_ip);
222
+
223
+ $click_uri = $_SERVER['REQUEST_URI'];
224
+ $click_user_agent = $_SERVER['HTTP_USER_AGENT'];
225
+ $click_browser = $this->php_get_browser();
226
+
227
+ //Set Cookie if it doesn't exist
228
+ $cookie_name = 'prli_click_' . $pretty_link->id;
229
+ //Used for unique click tracking
230
+ $cookie_expire_time = time()+60*60*24*30; // Expire in 30 days
231
+
232
+ $visitor_cookie = 'prli_visitor';
233
+ //Used for visitor activity
234
+ $visitor_cookie_expire_time = time()+60*60*24*365; // Expire in 1 year
235
+
236
+
237
+ if($_COOKIE[$cookie_name] == null)
238
+ {
239
+ setcookie($cookie_name,$slug,$cookie_expire_time,'/');
240
+ $first_click = 1;
241
+ }
242
+
243
+ // Retrieve / Generate visitor id
244
+ if($_COOKIE[$visitor_cookie] == null)
245
+ {
246
+ $visitor_uid = $prli_click->generateUniqueVisitorId();
247
+ setcookie($visitor_cookie,$visitor_uid,$visitor_cookie_expire_time,'/');
248
+ }
249
+ else
250
+ $visitor_uid = $_COOKIE[$visitor_cookie];
251
+
252
+ //Record Click in DB
253
+ $insert_str = "INSERT INTO {$prli_click->table_name} (link_id,vuid,ip,browser,btype,bversion,os,referer,uri,host,first_click,robot,created_at) VALUES (%d,%s,%s,%s,%s,%s,%s,%s,%s,%s,%d,%d,NOW())";
254
+ $insert = $wpdb->prepare($insert_str, $pretty_link->id,
255
+ $visitor_uid,
256
+ $click_ip,
257
+ $click_user_agent,
258
+ $click_browser['browser'],
259
+ $click_browser['version'],
260
+ $click_browser['platform'],
261
+ $click_referer,
262
+ $click_uri,
263
+ $click_host,
264
+ $first_click,
265
+ $this->this_is_a_robot($click_user_agent,$click_browser));
266
+
267
+ $results = $wpdb->query( $insert );
268
+
269
+ do_action('prli_record_click',array('link_id' => $pretty_link->id, 'click_id' => $wpdb->insert_id, 'url' => $pretty_link_url));
270
+ }
271
+
272
+ // Reformat Parameters
273
+ $param_string = '';
274
+
275
+ if(isset($pretty_link->param_forwarding) and ($pretty_link->param_forwarding == 'custom' OR $pretty_link->param_forwarding == 'on') and isset($values) and count($values) >= 1)
276
+ {
277
+ $first_param = true;
278
+ foreach($values as $key => $value)
279
+ {
280
+ if($first_param)
281
+ {
282
+ $param_string = (preg_match("#\?#", $pretty_link_url)?"&":"?");
283
+ $first_param = false;
284
+ }
285
+ else
286
+ $param_string .= "&";
287
+
288
+ $param_string .= "$key=$value";
289
+ }
290
+ }
291
+
292
+ if(isset($pretty_link->nofollow) and $pretty_link->nofollow)
293
+ header("X-Robots-Tag: noindex, nofollow", true);
294
+
295
+ switch($pretty_link->redirect_type)
296
+ {
297
+ case 'pixel':
298
+ header("HTTP/1.1 200 OK");
299
+ break;
300
+ case 'prettybar':
301
+ global $prli_blogurl;
302
+ header("HTTP/1.1 200 OK");
303
+ require_once PRLI_VIEWS_PATH . '/prli-links/bar.php';
304
+ break;
305
+ case 'cloak':
306
+ header("HTTP/1.1 200 OK");
307
+ require_once PRLI_VIEWS_PATH . '/prli-links/ultra-cloak.php';
308
+ break;
309
+ case '301':
310
+ header("HTTP/1.1 301 Moved Permanently");
311
+ header('Location: '.$pretty_link_url.$param_string);
312
+ break;
313
+ default:
314
+ if($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.0')
315
+ header("HTTP/1.1 302 Found");
316
+ else
317
+ header("HTTP/1.1 307 Temporary Redirect");
318
+ header('Location: '.$pretty_link_url.$param_string);
319
+ }
320
+ }
321
+
322
+ function get_custom_forwarding_rule($param_struct)
323
+ {
324
+ $param_struct = preg_replace('#%.*?%#','(.*?)',$param_struct);
325
+ return preg_replace('#\(\.\*\?\)$#','(.*)',$param_struct); // replace the last one with a greedy operator
326
+ }
327
+
328
+ function get_custom_forwarding_params($param_struct, $start_index = 1)
329
+ {
330
+ preg_match_all('#%(.*?)%#', $param_struct, $matches);
331
+
332
+ $param_string = '';
333
+ $match_index = $start_index;
334
+ for($i = 0; $i < count($matches[1]); $i++)
335
+ {
336
+ if($i == 0 and $start_index == 1)
337
+ $param_string .= "?";
338
+ else
339
+ $param_string .= "&";
340
+
341
+ $param_string .= $matches[1][$i] . "=$$match_index";
342
+ $match_index++;
343
+ }
344
+
345
+ return $param_string;
346
+ }
347
+
348
+ function decode_custom_param_str($param_struct, $uri_string)
349
+ {
350
+ // Get the structure matches (param names)
351
+ preg_match_all('#%(.*?)%#', $param_struct, $struct_matches);
352
+
353
+ // Get the uri matches (param values)
354
+ $match_str = '#'.$this->get_custom_forwarding_rule($param_struct).'#';
355
+ preg_match($match_str, $uri_string, $uri_matches);
356
+
357
+ $param_array = array();
358
+ for($i = 0; $i < count($struct_matches[1]); $i++)
359
+ $param_array[$struct_matches[1][$i]] = $uri_matches[$i+1];
360
+
361
+ return $param_array;
362
+ }
363
+
364
+ // Detects whether an array is a true numerical array or an
365
+ // associative array (or hash).
366
+ function prli_array_type($item)
367
+ {
368
+ $array_type = 'unknown';
369
+
370
+ if(is_array($item))
371
+ {
372
+ $array_type = 'array';
373
+
374
+ foreach($item as $key => $value)
375
+ {
376
+ if(!is_numeric($key))
377
+ {
378
+ $array_type = 'hash';
379
+ break;
380
+ }
381
+ }
382
+ }
383
+
384
+ return $array_type;
385
+ }
386
+
387
+ // This eliminates the need to use php's built in json_encoder
388
+ // which only works with PHP 5.2 and above.
389
+ function prli_json_encode($json_array)
390
+ {
391
+ $json_str = '';
392
+
393
+ if(is_array($json_array))
394
+ {
395
+ if($this->prli_array_type($json_array) == 'array')
396
+ {
397
+ $first = true;
398
+ $json_str .= "[";
399
+ foreach($json_array as $item)
400
+ {
401
+ if(!$first)
402
+ $json_str .= ",";
403
+
404
+ if(is_numeric($item))
405
+ $json_str .= (($item < 0)?"\"$item\"":$item);
406
+ else if(is_array($item))
407
+ $json_str .= $this->prli_json_encode($item);
408
+ else if(is_string($item))
409
+ $json_str .= '"'.$item.'"';
410
+ else if(is_bool($item))
411
+ $json_str .= (($item)?"true":"false");
412
+
413
+ $first = false;
414
+ }
415
+ $json_str .= "]";
416
+ }
417
+ else if($this->prli_array_type($json_array) == 'hash')
418
+ {
419
+ $first = true;
420
+ $json_str .= "{";
421
+ foreach($json_array as $key => $item)
422
+ {
423
+ if(!$first)
424
+ $json_str .= ",";
425
+
426
+ $json_str .= "\"$key\":";
427
+
428
+ if(is_numeric($item))
429
+ $json_str .= (($item < 0)?"\"$item\"":$item);
430
+ else if(is_array($item))
431
+ $json_str .= $this->prli_json_encode($item);
432
+ else if(is_string($item))
433
+ $json_str .= "\"$item\"";
434
+ else if(is_bool($item))
435
+ $json_str .= (($item)?"true":"false");
436
+
437
+ $first = false;
438
+ }
439
+ $json_str .= "}";
440
+ }
441
+ }
442
+
443
+ return $json_str;
444
+ }
445
+
446
+ // This eliminates the need to use php's built in json_encoder
447
+ // which only works with PHP 5.2 and above.
448
+ function prli_json_decode(&$json_str,$type='array',$index = 0)
449
+ {
450
+ $json_array = array();
451
+ $index_str = '';
452
+ $value_str = '';
453
+ $in_string = false;
454
+ $in_index = ($type=='hash'); //first char in hash is an index
455
+ $in_value = ($type=='array'); //first char in array is a value
456
+
457
+ $json_special_chars_array = array('{','[','}',']','"',',',':');
458
+
459
+ // On the first pass we need to do some special stuff
460
+ if($index == 0)
461
+ {
462
+ if($json_str[$index] == '{')
463
+ {
464
+ $type = 'hash';
465
+ $in_index = true;
466
+ $in_value = false;
467
+ }
468
+ else if($json_str[$index]=='[')
469
+ {
470
+ $type = 'array';
471
+ $in_index = false;
472
+ $in_value = true;
473
+ }
474
+ else
475
+ return false; // not valid json
476
+
477
+ // skip to next index
478
+ $index++;
479
+ }
480
+
481
+ for($i = $index; $i < strlen($json_str); $i++)
482
+ {
483
+ if($in_string and in_array($json_str[$i],$json_special_chars_array))
484
+ {
485
+ if($json_str[$i] == '"')
486
+ $in_string = false;
487
+ else
488
+ {
489
+ if($in_value)
490
+ $value_str .= $json_str[$i];
491
+ else if($in_index)
492
+ $index_str .= $json_str[$i];
493
+ }
494
+ }
495
+ else
496
+ {
497
+ switch($json_str[$i])
498
+ {
499
+ case '{':
500
+ $array_vals = $this->prli_json_decode($json_str,'hash',$i + 1);
501
+
502
+ if($type=='hash')
503
+ $json_array[$index_str] = $array_vals[1]; // We'll never get an array as an index
504
+ else if($type=='array')
505
+ $json_array[] = $array_vals[1];
506
+
507
+ $i = $array_vals[0]; // Skip ahead to the new index
508
+ break;
509
+
510
+ case '[':
511
+ $array_vals = $this->prli_json_decode($json_str,'array',$i + 1);
512
+
513
+ if($type=='hash')
514
+ $json_array[$index_str] = $array_vals[1];
515
+ else if($type=='array')
516
+ $json_array[] = $array_vals[1];
517
+
518
+ $i = $array_vals[0]; // Skip ahead to the new index
519
+ break;
520
+
521
+ case '}':
522
+ if(!empty($index_str) and !empty($value_str))
523
+ {
524
+ $json_array[$index_str] = $this->prli_decode_json_unicode($value_str);
525
+ $index_str = '';
526
+ $value_str = '';
527
+ }
528
+ return array($i,$json_array);
529
+
530
+ case ']':
531
+ if(!empty($value_str))
532
+ {
533
+ $json_array[] = $this->prli_decode_json_unicode($value_str);
534
+ $value_str = '';
535
+ }
536
+ return array($i,$json_array);
537
+
538
+ // skip the null character
539
+ case '\0':
540
+ break;
541
+
542
+ // Handle Escapes
543
+ case '\\':
544
+ if($in_string)
545
+ {
546
+ if(in_array($json_str[$i + 1],$json_special_chars_array))
547
+ {
548
+ if($in_value)
549
+ $value_str .= '\\'.$json_str[$i + 1];
550
+ else if($in_index)
551
+ $index_str .= '\\'.$json_str[$i + 1];
552
+
553
+ $i++; // skip the escaped char now that its been recorded
554
+ }
555
+ else
556
+ {
557
+ if($in_value)
558
+ $value_str .= $json_str[$i];
559
+ else if($in_index)
560
+ $index_str .= $json_str[$i];
561
+ }
562
+ }
563
+ break;
564
+
565
+ case '"':
566
+ $in_string = !$in_string; // just tells us if we're in a string
567
+ break;
568
+
569
+ case ':':
570
+ if($type == 'hash')
571
+ {
572
+ $in_value = true;
573
+ $in_index = false;
574
+ }
575
+ break;
576
+
577
+ case ',':
578
+ if($type == 'hash')
579
+ {
580
+ if(!empty($index_str) and !empty($value_str))
581
+ {
582
+ $json_array[$index_str] = $this->prli_decode_json_unicode($value_str);
583
+ $index_str = '';
584
+ $value_str = '';
585
+ }
586
+
587
+ $in_index = true;
588
+ $in_value = false;
589
+ }
590
+ else if($type == 'array')
591
+ {
592
+ if(!empty($value_str))
593
+ {
594
+ $json_array[] = $this->prli_decode_json_unicode($value_str);
595
+ $value_str = '';
596
+ }
597
+
598
+ $in_value = true;
599
+ $in_index = false; // always false in an array
600
+ }
601
+ break;
602
+
603
+ // record index and value
604
+ default:
605
+ if($in_value)
606
+ $value_str .= $json_str[$i];
607
+ else if($in_index)
608
+ $index_str .= $json_str[$i];
609
+ }
610
+ }
611
+ }
612
+
613
+ return array(-1,$json_array);
614
+ }
615
+
616
+ function prli_decode_json_unicode($val)
617
+ {
618
+ $val = preg_replace_callback("/\\\u([0-9a-fA-F]{4})/",
619
+ create_function(
620
+ '$matches',
621
+ 'return html_entity_decode("&#".hexdec($matches[1]).";",ENT_COMPAT,"UTF-8");'
622
+ ),
623
+ $val);
624
+ return $val;
625
+ }
626
+
627
+ // Get the timestamp of the start date
628
+ function get_start_date($values,$min_date = '')
629
+ {
630
+ // set default to 30 days ago
631
+ if(empty($min_date))
632
+ $min_date = 30;
633
+
634
+ if(!empty($values['sdate']))
635
+ {
636
+ $sdate = explode("-",$values['sdate']);
637
+ $start_timestamp = mktime(0,0,0,$sdate[1],$sdate[2],$sdate[0]);
638
+ }
639
+ else
640
+ $start_timestamp = time()-60*60*24*(int)$min_date;
641
+
642
+ return $start_timestamp;
643
+ }
644
+
645
+ // Get the timestamp of the end date
646
+ function get_end_date($values)
647
+ {
648
+ if(!empty($values['edate']))
649
+ {
650
+ $edate = explode("-",$values['edate']);
651
+ $end_timestamp = mktime(0,0,0,$edate[1],$edate[2],$edate[0]);
652
+ }
653
+ else
654
+ $end_timestamp = time();
655
+
656
+ return $end_timestamp;
657
+ }
658
+
659
+ function prepend_and_or_where( $starts_with = ' WHERE', $where = '' )
660
+ {
661
+ return (( $where == '' )?'':$starts_with . $where);
662
+ }
663
+
664
+ function uninstall_pro()
665
+ {
666
+ $prlipro_path = PRLI_PATH . '/pro';
667
+
668
+ // unlink pro directory
669
+ $this->delete_dir($prlipro_path);
670
+
671
+ delete_option( 'prlipro_activated' );
672
+ delete_option( 'prlipro_username' );
673
+ delete_option( 'prlipro_password' );
674
+ delete_option( 'prlipro-credentials' );
675
+
676
+ // Yah- I just leave the pro database tables & data hanging
677
+ // around in case you want to re-install it at some point
678
+ }
679
+
680
+ function install_pro_db()
681
+ {
682
+ global $wpdb;
683
+
684
+ $pro_db_version = 1; // this is the version of the database we're moving to
685
+ $old_pro_db_version = get_option('prlipro_db_version');
686
+
687
+ if($pro_db_version != $old_pro_db_version)
688
+ {
689
+ $upgrade_path = ABSPATH . 'wp-admin/includes/upgrade.php';
690
+ require_once($upgrade_path);
691
+
692
+ // Pretty Link Pro Tables
693
+ $tweets_table = "{$wpdb->prefix}prli_tweets";
694
+ $keywords_table = "{$wpdb->prefix}prli_keywords";
695
+ $reports_table = "{$wpdb->prefix}prli_reports";
696
+ $report_links_table = "{$wpdb->prefix}prli_report_links";
697
+ $link_rotations_table = "{$wpdb->prefix}prli_link_rotations";
698
+ $clicks_rotations_table = "{$wpdb->prefix}prli_clicks_rotations";
699
+
700
+ $charset_collate = '';
701
+ if( $wpdb->has_cap( 'collation' ) )
702
+ {
703
+ if( !empty($wpdb->charset) )
704
+ $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
705
+ if( !empty($wpdb->collate) )
706
+ $charset_collate .= " COLLATE $wpdb->collate";
707
+ }
708
+
709
+ /* Create/Upgrade Tweets Table */
710
+ $sql = "CREATE TABLE {$tweets_table} (
711
+ id int(11) NOT NULL auto_increment,
712
+ twid varchar(255) NOT NULL,
713
+ tw_text varchar(255) default NULL,
714
+ tw_to_user_id varchar(255) default NULL,
715
+ tw_from_user varchar(255) default NULL,
716
+ tw_from_user_id varchar(255) NOT NULL,
717
+ tw_iso_language_code varchar(255) default NULL,
718
+ tw_source varchar(255) default NULL,
719
+ tw_profile_image_url varchar(255) default NULL,
720
+ tw_created_at varchar(255) NOT NULL,
721
+ created_at datetime NOT NULL,
722
+ link_id int(11) default NULL,
723
+ PRIMARY KEY (id),
724
+ KEY link_id (link_id),
725
+ KEY twid (twid)
726
+ ) {$charset_collate};";
727
+
728
+ dbDelta($sql);
729
+
730
+ /* Create/Upgrade Keywords Table */
731
+ $sql = "CREATE TABLE {$keywords_table} (
732
+ id int(11) NOT NULL auto_increment,
733
+ text varchar(255) NOT NULL,
734
+ link_id int(11) NOT NULL,
735
+ created_at datetime NOT NULL,
736
+ PRIMARY KEY (id),
737
+ KEY link_id (link_id)
738
+ ) {$charset_collate};";
739
+
740
+ dbDelta($sql);
741
+
742
+ /* Create/Upgrade Reports Table */
743
+ $sql = "CREATE TABLE {$reports_table} (
744
+ id int(11) NOT NULL auto_increment,
745
+ name varchar(255) NOT NULL,
746
+ goal_link_id int(11) default NULL,
747
+ created_at datetime NOT NULL,
748
+ PRIMARY KEY (id),
749
+ KEY goal_link_id (goal_link_id)
750
+ ) {$charset_collate};";
751
+
752
+ dbDelta($sql);
753
+
754
+ /* Create/Upgrade Reports Table */
755
+ $sql = "CREATE TABLE {$report_links_table} (
756
+ id int(11) NOT NULL auto_increment,
757
+ report_id int(11) NOT NULL,
758
+ link_id int(11) NOT NULL,
759
+ created_at datetime NOT NULL,
760
+ PRIMARY KEY (id),
761
+ KEY report_id (report_id),
762
+ KEY link_id (link_id)
763
+ ) {$charset_collate};";
764
+
765
+ dbDelta($sql);
766
+
767
+ /* Create/Upgrade Link Rotations Table */
768
+ $sql = "CREATE TABLE {$link_rotations_table} (
769
+ id int(11) NOT NULL auto_increment,
770
+ url varchar(255) default NULL,
771
+ weight int(11) default 0,
772
+ r_index int(11) default 0,
773
+ link_id int(11) NOT NULL,
774
+ created_at datetime NOT NULL,
775
+ PRIMARY KEY (id),
776
+ KEY link_id (link_id)
777
+ ) {$charset_collate};";
778
+
779
+ dbDelta($sql);
780
+
781
+ /* Create/Upgrade Clicks / Rotations Table */
782
+ $sql = "CREATE TABLE {$clicks_rotations_table} (
783
+ id int(11) NOT NULL auto_increment,
784
+ click_id int(11) NOT NULL,
785
+ link_id int(11) NOT NULL,
786
+ url text NOT NULL,
787
+ PRIMARY KEY (id),
788
+ KEY click_id (click_id),
789
+ KEY link_id (link_id)
790
+ ) {$charset_collate};";
791
+
792
+ dbDelta($sql);
793
+ }
794
+
795
+ /***** SAVE DB VERSION *****/
796
+ delete_option('prlipro_db_version');
797
+ add_option('prlipro_db_version',$pro_db_version);
798
+ }
799
+
800
+ // be careful with this one -- I use it to forceably reinstall pretty link pro
801
+ function delete_dir($dir)
802
+ {
803
+ if (!file_exists($dir))
804
+ return true;
805
+
806
+ if (!is_dir($dir))
807
+ return unlink($dir);
808
+
809
+ foreach (scandir($dir) as $item)
810
+ {
811
+ if ($item == '.' || $item == '..')
812
+ continue;
813
+
814
+ if (!$this->delete_dir($dir.DIRECTORY_SEPARATOR.$item))
815
+ return false;
816
+ }
817
+
818
+ return rmdir($dir);
819
+ }
820
+
821
+ // Used in the install procedure to migrate database columns
822
+ function migrate_before_db_upgrade()
823
+ {
824
+ global $prli_options, $prli_update, $prli_link, $prli_click, $wpdb;
825
+ $db_version = (int)get_option('prli_db_version');
826
+
827
+ if(!$db_version)
828
+ return;
829
+
830
+ // Migration for version 1 of the database
831
+ if($db_version and $db_version < 1)
832
+ {
833
+ $query = "SELECT * from {$prli_link->table_name}";
834
+ $links = $wpdb->get_results($query);
835
+ $query_str = "UPDATE {$prli_link->table_name} SET redirect_type=%s WHERE id=%d";
836
+
837
+ foreach($links as $link)
838
+ {
839
+ if(isset($link->track_as_img) and $link->track_as_img)
840
+ {
841
+ $query = $wpdb->prepare($query_str, 'pixel', $link->id);
842
+ $wpdb->query($query);
843
+ }
844
+ else if(isset($link->use_prettybar) and $link->use_prettybar)
845
+ {
846
+ $query = $wpdb->prepare($query_str, 'prettybar', $link->id);
847
+ $wpdb->query($query);
848
+ }
849
+ else if(isset($link->use_ultra_cloak) and $link->use_ultra_cloak)
850
+ {
851
+ $query = $wpdb->prepare($query_str, 'cloak', $link->id);
852
+ $wpdb->query($query);
853
+ }
854
+ }
855
+
856
+ $query = "ALTER TABLE {$prli_link->table_name} DROP COLUMN track_as_img, DROP COLUMN use_prettybar, DROP COLUMN use_ultra_cloak, DROP COLUMN gorder";
857
+ $wpdb->query($query);
858
+ }
859
+
860
+ if($db_version and $db_version < 2)
861
+ {
862
+ unset($prli_options->prli_exclude_ips);
863
+ unset($prli_options->prettybar_image_url);
864
+ unset($prli_options->prettybar_background_image_url);
865
+ unset($prli_options->prettybar_color);
866
+ unset($prli_options->prettybar_text_color);
867
+ unset($prli_options->prettybar_link_color);
868
+ unset($prli_options->prettybar_hover_color);
869
+ unset($prli_options->prettybar_visited_color);
870
+ unset($prli_options->prettybar_title_limit);
871
+ unset($prli_options->prettybar_desc_limit);
872
+ unset($prli_options->prettybar_link_limit);
873
+
874
+ // Save the posted value in the database
875
+ update_option( 'prli_options', $prli_options );
876
+ }
877
+
878
+ // Modify the tables so they're UTF-8
879
+ if($db_version and $db_version < 3)
880
+ {
881
+ $charset_collate = '';
882
+ if( $wpdb->has_cap( 'collation' ) )
883
+ {
884
+ if( !empty($wpdb->charset) )
885
+ $charset_collate = "CONVERT TO CHARACTER SET $wpdb->charset";
886
+ if( !empty($wpdb->collate) )
887
+ $charset_collate .= " COLLATE $wpdb->collate";
888
+ }
889
+
890
+ if(!empty($charset_collate))
891
+ {
892
+ $prli_table_names = array( "{$wpdb->prefix}prli_groups",
893
+ "{$wpdb->prefix}prli_clicks",
894
+ "{$wpdb->prefix}prli_links",
895
+ "{$wpdb->prefix}prli_link_metas",
896
+ "{$wpdb->prefix}prli_tweets",
897
+ "{$wpdb->prefix}prli_keywords",
898
+ "{$wpdb->prefix}prli_reports",
899
+ "{$wpdb->prefix}prli_report_links",
900
+ "{$wpdb->prefix}prli_link_rotations",
901
+ "{$wpdb->prefix}prli_clicks_rotations" );
902
+
903
+ foreach($prli_table_names as $prli_table_name)
904
+ {
905
+ $query = "ALTER TABLE {$prli_table_name} {$charset_collate}";
906
+ $wpdb->query($query);
907
+ }
908
+ }
909
+ }
910
+
911
+ // Upgrade the twitter hide badges on pages / posts for pro users
912
+ if($db_version and $db_version < 7)
913
+ {
914
+ if($prli_update->pro_is_installed())
915
+ {
916
+ global $prlipro_options;
917
+
918
+ if(trim($prlipro_options->twitter_badge_hidden) != '')
919
+ {
920
+ $hidden_post_ids = explode(',',trim($prlipro_options->twitter_badge_hidden));
921
+ foreach($hidden_post_ids as $post_id)
922
+ {
923
+ $prlipro_post_options = PrliProPostOptions::get_stored_object($post_id);
924
+ $prlipro_post_options->hide_twitter_button = 1;
925
+ $prlipro_post_options->store($post_id);
926
+ }
927
+ }
928
+ }
929
+ }
930
+
931
+ if($db_version and $db_version < 8)
932
+ {
933
+ // Install / Upgrade Pretty Link Pro
934
+ $prlipro_username = get_option( 'prlipro_username' );
935
+ $prlipro_password = get_option( 'prlipro_password' );
936
+
937
+ if( !empty($prlipro_username) and !empty($prlipro_password) )
938
+ {
939
+ $creds = array('username' => $prlipro_username,
940
+ 'password' => $prlipro_password);
941
+ update_option('prlipro-credentials', $creds);
942
+ }
943
+ }
944
+
945
+ // Hiding pretty link custom fields
946
+ if($db_version and $db_version < 10)
947
+ {
948
+ $query_str = "UPDATE {$wpdb->postmeta} SET meta_key=%s WHERE meta_key=%s";
949
+
950
+ $query = $wpdb->prepare($query_str, '_pretty-link', 'pretty-link');
951
+ $wpdb->query($query);
952
+
953
+ $query = $wpdb->prepare($query_str, '_prli-keyword-cached-content', 'prli-keyword-cached-content');
954
+ $wpdb->query($query);
955
+
956
+ $query = $wpdb->prepare($query_str, '_prlipro-post-options', 'prlipro-post-options');
957
+ $wpdb->query($query);
958
+ }
959
+ }
960
+
961
+
962
+ function migrate_after_db_upgrade()
963
+ {
964
+ global $prli_options, $prli_link, $prli_link_meta, $prli_click, $wpdb;
965
+ $db_version = (int)get_option('prli_db_version');
966
+
967
+ if(!$db_version)
968
+ return;
969
+
970
+ if($db_version and $db_version < 5)
971
+ {
972
+ // Migrate pretty-link-posted-to-twitter
973
+ $query = "SELECT * FROM {$wpdb->prefix}postmeta WHERE meta_key=%s";
974
+ $query = $wpdb->prepare($query,'pretty-link-posted-to-twitter');
975
+ $posts_posted = $wpdb->get_results($query);
976
+
977
+ foreach($posts_posted as $postmeta)
978
+ {
979
+ if($postmeta->meta_value == '1')
980
+ {
981
+ $link_id = PrliUtils::get_prli_post_meta($postmeta->post_id,'pretty-link',true);
982
+ $prli_link_meta->update_link_meta($link_id,'pretty-link-posted-to-twitter','1');
983
+ }
984
+ }
985
+
986
+ // Cleanup
987
+ $query = "DELETE FROM {$wpdb->prefix}postmeta WHERE meta_key=%s OR meta_key=%s OR meta_key=%s OR meta_key=%s";
988
+ $query = $wpdb->prepare($query,'pretty-link-posted-to-twitter','pretty-link-tweet-count','pretty-link-tweet-last-update','prli-keyword-replacement-count');
989
+ $results = $wpdb->query($query);
990
+
991
+ $query = "DELETE FROM {$prli_link_meta->table_name} WHERE meta_key=%s";
992
+ $query = $wpdb->prepare($query,'prli-url-aliases');
993
+ $results = $wpdb->query($query);
994
+ }
995
+ }
996
+
997
+ function this_is_a_robot($browser_ua,&$browsecap,$header='')
998
+ {
999
+ $click = new PrliClick();
1000
+ $click->browser = $browser_ua;
1001
+ $click->btype = $browsecap['browser'];
1002
+ return $this->is_robot($click, $browsecap, $header);
1003
+ }
1004
+
1005
+ function is_robot(&$click,&$browsecap,$header='')
1006
+ {
1007
+ global $prli_utils, $prli_click;
1008
+ $ua_string = trim(urldecode($click->browser));
1009
+ $btype = trim($click->btype);
1010
+
1011
+ // Yah, if the whole user agent string is missing -- wtf?
1012
+ if(empty($ua_string))
1013
+ return 1;
1014
+
1015
+ // If the Browser type was unidentifiable then it's most likely a bot
1016
+ if(empty($btype))
1017
+ return 1;
1018
+
1019
+ // Some bots actually say they're bots right up front let's get rid of them asap
1020
+ if(preg_match("#(bot|Bot|spider|Spider|crawl|Crawl)#",$ua_string))
1021
+ return 1;
1022
+
1023
+ $crawler = $browsecap['crawler'];
1024
+
1025
+ // If php_browsecap tells us its a bot, let's believe him
1026
+ if($crawler == 1)
1027
+ return 1;
1028
+
1029
+ return 0;
1030
+ }
1031
+
1032
+ function get_permalink_pre_slug_uri($force=false,$trim=false)
1033
+ {
1034
+ global $prli_options;
1035
+
1036
+ if($force or $prli_options->link_prefix)
1037
+ {
1038
+ preg_match('#^([^%]*?)%#', get_option('permalink_structure'), $struct);
1039
+ $pre_slug_uri = $struct[1];
1040
+
1041
+ if($trim)
1042
+ {
1043
+ $pre_slug_uri = trim($pre_slug_uri);
1044
+ $pre_slug_uri = preg_replace('#^/#','',$pre_slug_uri);
1045
+ $pre_slug_uri = preg_replace('#/$#','',$pre_slug_uri);
1046
+ }
1047
+
1048
+ return $pre_slug_uri;
1049
+ }
1050
+ else
1051
+ return '/';
1052
+ }
1053
+
1054
+ function get_permalink_pre_slug_regex()
1055
+ {
1056
+ $pre_slug_uri = PrliUtils::get_permalink_pre_slug_uri(true);
1057
+
1058
+ if(empty($pre_slug_uri))
1059
+ return '/';
1060
+ else
1061
+ return "{$pre_slug_uri}|/";
1062
+ }
1063
+
1064
+ function rewriting_on()
1065
+ {
1066
+ $permalink_structure = get_option('permalink_structure');
1067
+
1068
+ return ($permalink_structure and !empty($permalink_structure));
1069
+ }
1070
+
1071
+ function get_prli_post_meta($post_id, $key, $single=false)
1072
+ {
1073
+ if( isset($post_id) and !empty($post_id) and
1074
+ $post_id and is_numeric($post_id) )
1075
+ return get_post_meta($post_id, $key, $single);
1076
+ else
1077
+ return false;
1078
+ }
1079
+
1080
+ function update_prli_post_meta($post_id, $meta_key, $meta_value)
1081
+ {
1082
+ if( isset($post_id) and !empty($post_id) and
1083
+ $post_id and is_numeric($post_id) )
1084
+ return update_post_meta($post_id, $meta_key, $meta_value);
1085
+ else
1086
+ return false;
1087
+ }
1088
+
1089
+ function delete_prli_post_meta($post_id, $key)
1090
+ {
1091
+ if( isset($post_id) and !empty($post_id) and
1092
+ $post_id and is_numeric($post_id) )
1093
+ return delete_post_meta($post_id, $key, $meta_value);
1094
+ else
1095
+ return false;
1096
+ }
1097
+
1098
+ /** Gets rid of any pretty link postmetas created without a post_id **/
1099
+ function clear_unknown_post_metas()
1100
+ {
1101
+ global $wpdb;
1102
+
1103
+ $query = "SELECT count(*) FROM {$wpdb->postmeta} WHERE ( meta_key LIKE 'prli%' OR meta_key LIKE 'pretty-link%' OR meta_key LIKE '_prli%' OR meta_key LIKE '_pretty-link%' ) AND post_id=0";
1104
+ $count = $wpdb->get_var($query);
1105
+
1106
+ if($count)
1107
+ {
1108
+ $query = "DELETE FROM {$wpdb->postmeta} WHERE ( meta_key LIKE 'prli%' OR meta_key LIKE 'pretty-link%' OR meta_key LIKE '_prli%' OR meta_key LIKE '_pretty-link%' ) AND post_id=0";
1109
+ $wpdb->query($query);
1110
+ }
1111
+ }
1112
+ }
1113
+ ?>
classes/models/models.inc.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once(PRLI_MODELS_PATH.'/PrliLink.php');
3
+ require_once(PRLI_MODELS_PATH.'/PrliClick.php');
4
+ require_once(PRLI_MODELS_PATH.'/PrliGroup.php');
5
+ require_once(PRLI_MODELS_PATH.'/PrliUtils.php');
6
+ require_once(PRLI_MODELS_PATH.'/PrliUrlUtils.php');
7
+ require_once(PRLI_MODELS_PATH.'/PrliLinkMeta.php');
8
+ require_once(PRLI_MODELS_PATH.'/PrliUpdate.php');
9
+
10
+ global $prli_link;
11
+ global $prli_link_meta;
12
+ global $prli_click;
13
+ global $prli_group;
14
+ global $prli_utils;
15
+ global $prli_url_utils;
16
+ global $prli_update;
17
+
18
+ $prli_link = new PrliLink();
19
+ $prli_link_meta = new PrliLinkMeta();
20
+ $prli_click = new PrliClick();
21
+ $prli_group = new PrliGroup();
22
+ $prli_utils = new PrliUtils();
23
+ $prli_url_utils = new PrliUrlUtils();
24
+ $prli_update = new PrliUpdate();
25
+
26
+ function prli_get_main_message( $message = "Get started by <a href=\"?page=pretty-link/prli-links.php&action=new\">adding a URL</a> that you want to turn into a pretty link.<br/>Come back to see how many times it was clicked.", $expiration=3600) // Get new messages every 1 hour
27
+ {
28
+ global $prli_update, $wp_version;
29
+ include_once(ABSPATH."/wp-includes/class-IXR.php");
30
+
31
+ $message_mothership = (($prli_update->pro_is_installed_and_authorized())?'http://prettylinkpro.com/xmlrpc.php':'http://blairwilliams.com/xmlrpc.php');
32
+
33
+ if( version_compare($wp_version, '3.0', '>=') )
34
+ $messages = get_site_transient('_prli_messages'); // for WordPress 3.0
35
+ else
36
+ $messages = get_transient('_prli_messages'); // for WordPress 2.8+
37
+
38
+ // if the messages array has expired go back to the mothership
39
+ if($messages === false)
40
+ {
41
+ $client = new IXR_Client($message_mothership);
42
+ if ($client->query('prli.get_main_message_array'))
43
+ $messages = $client->getResponse();
44
+
45
+ // If we're having connection issues on the mothership then store the default message in the transient
46
+ if(empty($messages) or !$messages or !is_array($messages))
47
+ $messages = array($message);
48
+
49
+ if( version_compare($wp_version, '3.0', '>=') )
50
+ set_site_transient("_prli_messages", $messages, $expiration); // for WordPress 3.0
51
+ else
52
+ set_transient("_prli_messages", $messages, $expiration); // for WordPress 2.8+
53
+ }
54
+
55
+ if(empty($messages) or !$messages or !is_array($messages))
56
+ return $message;
57
+ else
58
+ return $messages[array_rand($messages)];
59
+ }
60
+
61
+ ?>
classes/views/prli-clicks/csv.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(is_user_logged_in() and current_user_can('level_10'))
3
+ {
4
+
5
+ $filename = date("ymdHis",time()) . '_' . $link_name . '_pretty_link_clicks_' . $hmin . '-' . $hmax . '.csv';
6
+ header("Content-Type: text/x-csv");
7
+ header("Content-Disposition: attachment; filename=\"$filename\"");
8
+ header("Expires: ".gmdate("D, d M Y H:i:s", mktime(date("H")+2, date("i"), date("s"), date("m"), date("d"), date("Y")))." GMT");
9
+ header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
10
+ header("Cache-Control: no-cache, must-revalidate");
11
+ header("Pragma: no-cache");
12
+
13
+ echo '"Browser","Browser Version","Platform","IP","Visitor ID","Timestamp","Host","URI","Referrer","Link"' . "\n";
14
+ foreach($clicks as $click)
15
+ {
16
+ $link = $prli_link->getOne($click->link_id);
17
+
18
+ echo "\"$click->btype\",\"$click->bversion\",\"$click->os\",\"$click->ip\",\"$click->vuid\",\"$click->created_at\",\"$click->host\",\"$click->uri\",\"$click->referer\",\"" . ((empty($link->name))?$link->slug:$link->name) . "\"\n";
19
+ }
20
+ }
21
+ else
22
+ header("Location: " . $prli_blogurl);
23
+ ?>
classes/views/prli-clicks/csv_download.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+ <?php
3
+ require(PRLI_VIEWS_PATH.'/shared/nav.php');
4
+ ?>
5
+
6
+ <h2><img src="<?php echo PRLI_URL.'/images/pretty-link-med.png'; ?>"/>&nbsp;Pretty Link: CSV Downloads</h2>
7
+ <span style="font-size: 14px; font-weight: bold;">For <?php echo stripslashes($link_name); ?>: </span>
8
+
9
+ <h3>Hit Reports:</h3>
10
+ <span class="description">All hits on <?php echo stripslashes($link_name); ?></span>
11
+ <br/>
12
+ <ul>
13
+ <?php
14
+ for($i=$hit_page_count; $i>0; $i--)
15
+ {
16
+ $hit_min = 0;
17
+
18
+ if($i)
19
+ $hit_min = ($i - 1) * $max_rows_per_file;
20
+
21
+ if($i==$hit_page_count)
22
+ $hit_max = $hit_record_count;
23
+ else
24
+ $hit_max = ($i * $max_rows_per_file) - 1;
25
+
26
+ $hit_count = $hit_max - $hit_min + 1;
27
+ $report_label = "Hits {$hit_min}-{$hit_max} ({$hit_count} Records)";
28
+ $hit_param_delim = (preg_match('#\?#',$hit_report_url)?'&':'?');
29
+ ?>
30
+ <li><a href="<?php echo $hit_report_url . $hit_param_delim; ?>prli_page=<?php echo $i; ?>"><?php echo $report_label; ?></a></li>
31
+ <?php
32
+ }
33
+ ?>
34
+ </ul>
35
+ <br/>
36
+ <h3>IP History Reports:</h3>
37
+ <span class="description">Shows all of the pretty links that visitors in <?php echo stripslashes($link_name); ?> have visited identified by IP address and sorted in descending order by date.</span>
38
+ <br/>
39
+ <ul>
40
+ <?php
41
+ for($i=$history_page_count; $i>0; $i--)
42
+ {
43
+ $history_min = 0;
44
+
45
+ if($i)
46
+ $history_min = ($i - 1) * $max_rows_per_file;
47
+
48
+ if($i==$history_page_count)
49
+ $history_max = $history_record_count;
50
+ else
51
+ $history_max = ($i * $max_rows_per_file) - 1;
52
+
53
+ $history_count = $history_max - $history_min + 1;
54
+ $report_label = "Hits {$history_min}-{$history_max} ({$history_count} Records)";
55
+ $history_param_delim = (preg_match('#\?#',$history_report_url)?'&':'?');
56
+ ?>
57
+ <li><a href="<?php echo $history_report_url . $history_param_delim; ?>prli_page=<?php echo $i; ?>"><?php echo $report_label; ?></a></li>
58
+ <?php
59
+ }
60
+ ?>
61
+ </ul>
62
+ <br/>
63
+ <h3>IP Origin Reports:</h3>
64
+ <span class="description">Shows the first the pretty link that visitors in <?php echo stripslashes($link_name); ?> have visited identified by IP address and the hit(s) that got these visitors listed in <?php echo stripslashes($link_name); ?>.</span>
65
+ <br/>
66
+ <ul>
67
+ <?php
68
+ for($i=$origin_page_count; $i>0; $i--)
69
+ {
70
+ $origin_min = 0;
71
+
72
+ if($i)
73
+ $origin_min = ($i - 1) * $max_rows_per_file;
74
+
75
+ if($i==$origin_page_count)
76
+ $origin_max = $origin_record_count;
77
+ else
78
+ $origin_max = ($i * $max_rows_per_file) - 1;
79
+
80
+ $origin_count = $origin_max - $origin_min + 1;
81
+ $report_label = "Hits {$origin_min}-{$origin_max} ({$origin_count} Records)";
82
+ $origin_param_delim = (preg_match('#\?#',$origin_report_url)?'&':'?');
83
+ ?>
84
+ <li><a href="<?php echo $origin_report_url . $origin_param_delim; ?>prli_page=<?php echo $i; ?>"><?php echo $report_label; ?></a></li>
85
+ <?php
86
+ }
87
+ ?>
88
+ </ul>
89
+ </div>
classes/views/prli-clicks/head.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- JQuery UI Includes -->
2
+ <link type="text/css" href="<?php echo PRLI_URL; ?>/includes/jquery/css/ui-lightness/jquery-ui-1.7.1.custom.css" rel="stylesheet" />
3
+ <script type="text/javascript" src="<?php echo PRLI_URL; ?>/includes/jquery/js/jquery-1.3.2.min.js"></script>
4
+ <script type="text/javascript" src="<?php echo PRLI_URL; ?>/includes/jquery/js/jquery-ui-1.7.1.custom.min.js"></script>
5
+
6
+ <script type="text/javascript">
7
+ $(document).ready(function(){
8
+ $("#sdate").datepicker({ dateFormat: 'yy-mm-dd', defaultDate: -30, minDate: -<?php echo $min_date; ?>, maxDate: 0 });
9
+ $("#edate").datepicker({ dateFormat: 'yy-mm-dd', minDate: -<?php echo $min_date; ?>, maxDate: 0 });
10
+ });
11
+ </script>
12
+
13
+ <script type="text/javascript">
14
+ $(document).ready(function(){
15
+ $(".filter_pane").hide();
16
+ $(".filter_toggle").click( function () {
17
+ $(".filter_pane").slideToggle("slow");
18
+ });
19
+ });
20
+ </script>
21
+
22
+ <style type="text/css">
23
+ .filter_toggle {
24
+ line-height: 34px;
25
+ font-size: 14px;
26
+ font-weight: bold;
27
+ padding-bottom: 10px;
28
+ }
29
+
30
+ .filter_pane {
31
+ background-color: white;
32
+ border: 2px solid #777777;
33
+ height: 275px;
34
+ width: 600px;
35
+ padding-left: 20px;
36
+ padding-top: 10px;
37
+ }
38
+
39
+ </style>
40
+
41
+ <!-- Open Flash Chart Includes -->
42
+ <script type="text/javascript" src="<?php echo PRLI_URL; ?>/includes/version-2-kvasir/js/json/json2.js"></script>
43
+ <script type="text/javascript" src="<?php echo PRLI_URL; ?>/includes/version-2-kvasir/js/swfobject.js"></script>
44
+ <script type="text/javascript">
45
+ swfobject.embedSWF("<?php echo PRLI_URL; ?>/includes/version-2-kvasir/open-flash-chart.swf", "my_chart", "100%", "250", "9.0.0");
46
+ </script>
47
+
48
+ <script type="text/javascript">
49
+
50
+ function ofc_ready()
51
+ {
52
+ //alert('ofc_ready');
53
+ }
54
+
55
+ function open_flash_chart_data()
56
+ {
57
+ //alert( 'reading data' );
58
+ return JSON.stringify(data);
59
+ }
60
+
61
+ function findSWF(movieName) {
62
+ if (navigator.appName.indexOf("Microsoft")!= -1) {
63
+ return window[movieName];
64
+ } else {
65
+ return document[movieName];
66
+ }
67
+ }
68
+
69
+ OFC = {};
70
+
71
+ OFC.jquery = {
72
+ name: "jQuery",
73
+ version: function(src) { return $('#'+ src)[0].get_version() },
74
+ rasterize: function (src, dst) { $('#'+ dst).replaceWith(OFC.jquery.image(src)) },
75
+ image: function(src) { return "<img src='data:image/png;base64," + $('#'+src)[0].get_img_binary() + "' />"},
76
+ popup: function(src) {
77
+ var img_win = window.open('', 'Charts: Export as Image')
78
+ with(img_win.document) {
79
+ write('<html><head><title>Charts: Export as Image<\/title><\/head><body>' + OFC.jquery.image(src) + '<div>Right-Click on the above Image to Save<\/div><\/body><\/html>') }
80
+ // stop the 'loading...' message
81
+ img_win.document.close();
82
+ }
83
+ }
84
+
85
+ // Using an object as namespaces is JS Best Practice. I like the Control.XXX style.
86
+ //if (!Control) {var Control = {}}
87
+ //if (typeof(Control == "undefined")) {var Control = {}}
88
+ if (typeof(Control == "undefined")) {var Control = {OFC: OFC.jquery}}
89
+
90
+
91
+ // By default, right-clicking on OFC and choosing "save image locally" calls this function.
92
+ // You are free to change the code in OFC and call my wrapper (Control.OFC.your_favorite_save_method)
93
+ // function save_image() { alert(1); Control.OFC.popup('my_chart') }
94
+ function save_image() {
95
+ //alert(1);
96
+ OFC.jquery.popup('my_chart')
97
+ }
98
+
99
+ function moo() {
100
+ //alert(99);
101
+ };
102
+
103
+ var data = <?php echo $prli_click->setupClickLineGraph($start_timestamp,$end_timestamp,$link_id,$type,$group); ?>;
104
+
105
+ </script>
classes/views/prli-clicks/list.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+ <?php
3
+ require(PRLI_VIEWS_PATH.'/shared/nav.php');
4
+ ?>
5
+ <h2><img src="<?php echo PRLI_URL.'/images/pretty-link-med.png'; ?>"/>&nbsp;Pretty Link: Hits</h2>
6
+ <span style="font-size: 14px; font-weight: bold;">For <?php echo stripslashes($link_name); ?>: </span>
7
+ <?php
8
+ // Don't show this sheesh if we're displaying the vuid or ip grouping
9
+ if(empty($params['ip']) and empty($params['vuid']))
10
+ {
11
+ ?>
12
+ <a href="#" style="display:inline;" class="filter_toggle">Customize Report</a>
13
+ <?php
14
+ }
15
+ ?>
16
+ <?php
17
+ if(!empty($params['l']) and $params['l'] != 'all')
18
+ echo '<br/><a href="?page='. PRLI_PLUGIN_NAME .'/prli-links.php">&laquo Back to Links</a>';
19
+ else if(!empty($params['ip']) or !empty($params['vuid']))
20
+ echo '<br/><a href="?page='. PRLI_PLUGIN_NAME .'/prli-clicks.php">&laquo Back to Hits</a>';
21
+
22
+ if(empty($params['ip']) and empty($params['vuid']))
23
+ {
24
+ ?>
25
+
26
+
27
+ <div class="filter_pane">
28
+ <form class="form-fields" name="form2" method="post" action="">
29
+ <?php wp_nonce_field('prli-reports'); ?>
30
+ <span>Type:</span>&nbsp;
31
+ <select id="type" name="type" style="display: inline;">
32
+ <option value="all"<?php print ((empty($params['type']) or $params['type'] == "all")?" selected=\"true\"":""); ?>>All Hits&nbsp;</option>
33
+ <option value="unique"<?php print (($params['type'] == "unique")?" selected=\"true\"":""); ?>>Unique Hits&nbsp;</option>
34
+ </select>
35
+ <br/>
36
+ <br/>
37
+ <span>Date Range:</span>
38
+ <div id="dateselectors" style="display: inline;">
39
+ <input type="text" name="sdate" id="sdate" value="<?php echo $params['sdate']; ?>" style="display:inline;"/>&nbsp;to&nbsp;<input type="text" name="edate" id="edate" value="<?php echo $params['edate']; ?>" style="display:inline;"/>
40
+ </div>
41
+ <br/>
42
+ <br/>
43
+ <div class="submit" style="display: inline;"><input type="submit" name="Submit" value="Customize"/> or <a href="#" class="filter_toggle">Cancel</a></div>
44
+ </form>
45
+ </div>
46
+
47
+ <div id="my_chart"></div>
48
+
49
+ <?php
50
+ }
51
+ $navstyle = "float: right;";
52
+ require(PRLI_VIEWS_PATH.'/shared/table-nav.php');
53
+ ?>
54
+
55
+ <div id="search_pane" style="padding-top: 5px;">
56
+ <form class="form-fields" name="click_form" method="post" action="">
57
+ <?php wp_nonce_field('prli-clicks'); ?>
58
+
59
+ <input type="hidden" name="sort" id="sort" value="<?php echo $sort_str; ?>" />
60
+ <input type="hidden" name="sdir" id="sort" value="<?php echo $sdir_str; ?>" />
61
+ <input type="text" name="search" id="search" value="<?php echo $search_str; ?>" style="display:inline;"/>
62
+ <div class="submit" style="display: inline;"><input type="submit" name="Submit" value="Search Hits"/>
63
+ <?php
64
+ if(!empty($search_str))
65
+ {
66
+ ?>
67
+ or <a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-clicks.php<?php echo (!empty($params['l'])?'&l='.$params['l']:''); ?>">Reset</a>
68
+ <?php
69
+ }
70
+ ?>
71
+ </div>
72
+ </form>
73
+ </div>
74
+ <table class="widefat post fixed" cellspacing="0">
75
+ <thead>
76
+ <tr>
77
+ <th class="manage-column" width="5%"><a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-clicks.php<?php echo $sort_params; ?>&sort=btype<?php echo (($sort_str == 'btype' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Browser<?php echo (($sort_str == 'btype')?'&nbsp;&nbsp;&nbsp;<img src="'.PRLI_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
78
+ </th>
79
+ <th class="manage-column" width="12%">
80
+ <a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-clicks.php<?php echo $sort_params; ?>&sort=ip<?php echo (($sort_str == 'ip' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">IP<?php echo (($sort_str == 'ip')?'&nbsp;&nbsp;&nbsp;<img src="'.PRLI_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
81
+ </th>
82
+ <th class="manage-column" width="12%">
83
+ <a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-clicks.php<?php echo $sort_params; ?>&sort=vuid<?php echo (($sort_str == 'vuid' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Visitor<?php echo (($sort_str == 'vuid')?'&nbsp;&nbsp;&nbsp;<img src="'.PRLI_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
84
+ </th>
85
+ <th class="manage-column" width="13%">
86
+ <a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-clicks.php<?php echo $sort_params; ?>&sort=created_at<?php echo (($sort_str == 'created_at' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Timestamp<?php echo ((empty($sort_str) or $sort_str == 'created_at')?'&nbsp;&nbsp;&nbsp;<img src="'.PRLI_URL.'/images/'.((empty($sort_str) or $sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
87
+ </th>
88
+ <th class="manage-column" width="16%">
89
+ <a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-clicks.php<?php echo $sort_params; ?>&sort=host<?php echo (($sort_str == 'host' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Host<?php echo (($sort_str == 'host')?'&nbsp;&nbsp;&nbsp;<img src="'.PRLI_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
90
+ </th>
91
+ <th class="manage-column" width="16%">
92
+ <a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-clicks.php<?php echo $sort_params; ?>&sort=uri<?php echo (($sort_str == 'uri' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">URI<?php echo (($sort_str == 'uri')?'&nbsp;&nbsp;&nbsp;<img src="'.PRLI_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
93
+ </th>
94
+ <th class="manage-column" width="16%">
95
+ <a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-clicks.php<?php echo $sort_params; ?>&sort=referer<?php echo (($sort_str == 'referer' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Referrer<?php echo (($sort_str == 'referer')?'&nbsp;&nbsp;&nbsp;<img src="'.PRLI_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
96
+ </th>
97
+ <th class="manage-column" width="13%">
98
+ <a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-clicks.php<?php echo $sort_params; ?>&sort=link<?php echo (($sort_str == 'link' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Link<?php echo (($sort_str == 'link')?'&nbsp;&nbsp;&nbsp;<img src="'.PRLI_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
99
+ </th>
100
+ </tr>
101
+ </thead>
102
+ <?php
103
+
104
+ if(count($clicks) <= 0)
105
+ {
106
+ ?>
107
+ <tr>
108
+ <td colspan="7">No Hits have been recorded yet</td>
109
+ </tr>
110
+ <?php
111
+ }
112
+ else
113
+ {
114
+ foreach($clicks as $click)
115
+ {
116
+ ?>
117
+ <tr>
118
+ <td><img src="http://d14715w921jdje.cloudfront.net/browser/<?php echo prli_browser_image($click->btype); ?>" alt="<?php echo $click->btype . " v" . $click->bversion; ?>" title="<?php echo $click->btype . " v" . $click->bversion; ?>"/>&nbsp;<img src="http://d14715w921jdje.cloudfront.net/os/<?php echo prli_os_image($click->os); ?>" alt="<?php echo $click->os; ?>" title="<?php echo $click->os; ?>"/></td>
119
+ <td><a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-clicks.php&ip=<?php echo $click->ip; ?>" title="View All Activity for IP Address: <?php echo $click->ip; ?>"><?php echo $click->ip; ?> (<?php echo $click->ip_count; ?>)</a></td>
120
+ <td><a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-clicks.php&vuid=<?php echo $click->vuid; ?>" title="View All Activity for Visitor: <?php echo $click->vuid; ?>"><?php echo $click->vuid; ?><?php echo (($click->vuid != null)?" ($click->vuid_count)":''); ?></a></td>
121
+ <td><?php echo $click->created_at; ?></td>
122
+ <td><?php echo $click->host; ?></td>
123
+ <td><?php echo $click->uri; ?></td>
124
+ <td><?php echo $click->referer; ?></td>
125
+ <td><a href="?page=<?php print PRLI_PLUGIN_NAME; ?>/prli-clicks.php&l=<?php echo $click->link_id; ?>" title="View clicks for <?php echo stripslashes($click->link_name); ?>"><?php echo stripslashes($click->link_name); ?></a></td>
126
+ </tr>
127
+ <?php
128
+ }
129
+ }
130
+ ?>
131
+ <tfoot>
132
+ <tr>
133
+ <th class="manage-column">Browser</th>
134
+ <th class="manage-column">IP</th>
135
+ <th class="manage-column">Visitor</th>
136
+ <th class="manage-column">Timestamp</th>
137
+ <th class="manage-column">Host</th>
138
+ <th class="manage-column">URI</th>
139
+ <th class="manage-column">Referrer</th>
140
+ <th class="manage-column">Link</th>
141
+ </tr>
142
+ </tfoot>
143
+ </table>
144
+
145
+ <a href="?page=pretty-link/prli-clicks.php&action=csv<?php echo $page_params; ?>">Download CSV (<?php echo stripslashes($link_name); ?>)</a>
146
+
147
+ <?php
148
+ require(PRLI_VIEWS_PATH.'/shared/table-nav.php');
149
+ ?>
150
+
151
+ </div>
classes/views/prli-dashboard-widget/widget.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+ <a href="http://blairwilliams.com/pretty-link"><img style="float: left; border: 0px;" src="<?php echo PRLI_URL.'/images/prettylink_logo_small.jpg'; ?>"/></a><div style="min-height: 48px;"><div style="min-height: 18px; margin-left: 137px; margin-top: 0px; padding-top: 0px; border: 1px solid #e5e597; background-color: #ffffa0; display: block;"><p style="font-size: 11px; margin:0px; padding: 0px; padding-left: 10px;"><?php echo $message; ?></p></div></div>
3
+
4
+ <form name="form1" method="post" action="?page=<?php echo PRLI_PLUGIN_NAME ?>/prli-links.php">
5
+ <input type="hidden" name="action" value="quick-create">
6
+ <?php wp_nonce_field('update-options'); ?>
7
+
8
+ <table class="form-table">
9
+ <tr class="form-field">
10
+ <td valign="top">Target URL</td>
11
+ <td><input type="text" name="url" value="" size="75">
12
+ </tr>
13
+ <tr>
14
+ <td valign="top">Pretty Link</td>
15
+ <td><strong><?php echo $prli_blogurl; ?></strong>/<input type="text" name="slug" value="<?php echo $prli_link->generateValidSlug(); ?>">
16
+ </tr>
17
+ </table>
18
+
19
+ <p class="submit">
20
+ <input type="submit" name="Submit" value="Create" />
21
+ </p>
22
+ </form>
23
+ </div>
classes/views/prli-groups/edit.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+ <h2><img src="<?php echo PRLI_URL.'/images/pretty-link-med.png'; ?>"/>&nbsp;Pretty Link: Edit Group</h2>
3
+
4
+ <?php
5
+ require(PRLI_VIEWS_PATH.'/shared/errors.php');
6
+ ?>
7
+
8
+ <form name="form1" method="post" action="?page=<?php echo PRLI_PLUGIN_NAME ?>/prli-groups.php">
9
+ <input type="hidden" name="action" value="update">
10
+ <input type="hidden" name="id" value="<?php echo $id; ?>">
11
+ <?php wp_nonce_field('update-options'); ?>
12
+
13
+ <table class="form-table">
14
+ <tr class="form-field">
15
+ <td width="75px" valign="top">Name: </td>
16
+ <td><input type="text" name="name" value="<?php echo htmlspecialchars(stripslashes((($_POST['name'] != null and $record == null)?$_POST['name']:$record->name))); ?>" size="75">
17
+ <br/><span class="setting-description">This is how you'll identify your Group.</span></td>
18
+ </tr>
19
+ <tr class="form-field">
20
+ <td valign="top">Description: </td>
21
+ <td><textarea style="height: 100px;" name="description"><?php echo (($_POST['description'] != null and $record == null)?$_POST['description']:$record->description); ?></textarea>
22
+ <br/><span class="setting-description">A Description of this group.</span></td>
23
+ </tr>
24
+ <tr class="form-field" valign="top">
25
+ <td valign="top">Links: </td>
26
+ <td valign="top">
27
+ <div style="height: 150px; width: 95%; border: 1px solid #8cbdd5; overflow: auto;">
28
+ <table width="100%" cellspacing="0">
29
+ <thead style="background-color: #dedede; padding: 0px; margin: 0px; line-height: 8px; font-size: 14px;">
30
+ <th style="padding-left: 5px; margin: 0px; width: 50%; min-width: 50%;"><strong>Name</strong></th>
31
+ <th style="padding-left: 5px; margin: 0px; width: 50%; min-width: 50%;"><strong>Current Group</strong></th>
32
+ </thead>
33
+ <?php
34
+ for($i = 0; $i < count($links); $i++)
35
+ {
36
+ $link = $links[$i];
37
+ ?>
38
+ <tr style="line-height: 15px; font-size: 12px;<?php echo (($i%2)?' background-color: #efefef;':''); ?>">
39
+ <td style="min-width: 50%; width: 50%"><input type="checkbox" style="display:inline;width: 15px; padding: 0; margin: 0; float: left; text-align: left;" name="link[<?php echo $link->id; ?>]" <?php echo (((isset($_POST['link'][$link->id]) and $_POST['link'][$link->id] == 'on') or (empty($_POST) and $link->group_id == $record->id))?'checked="true"':''); ?>/><span>&nbsp;<?php echo htmlspecialchars(stripslashes($link->name)) . " <strong>(" . $link->slug . ")</strong>"; ?></span></td>
40
+ <td style="min-width: 50%; width: 50%"><?php echo htmlspecialchars(stripslashes($link->group_name)); ?></td>
41
+ </tr>
42
+ <?php
43
+
44
+ }
45
+ ?>
46
+ </table>
47
+ </div>
48
+ <span class="setting-description">Select some links for this group. <strong>Note: each link can only be in one group at a time.</strong></span></td>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+
53
+ <p class="submit">
54
+ <input type="submit" name="Submit" value="Update" />&nbsp;or&nbsp;<a href="?page=<?php echo PRLI_PLUGIN_NAME ?>/prli-groups.php">Cancel</a>
55
+ </p>
56
+
57
+ </form>
58
+ </div>
classes/views/prli-groups/head.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script type="text/javascript" src="<?php echo PRLI_URL; ?>/includes/jquery/js/jquery-1.3.2.min.js"></script>
2
+ <script type="text/javascript">
3
+ jQuery(document).ready(function() {
4
+ jQuery('.group_actions').hide();
5
+ jQuery('.edit_group').hover(
6
+ function() {
7
+ jQuery(this).children(".group_actions").show();
8
+ },
9
+ function() {
10
+ jQuery(this).children(".group_actions").hide();
11
+ }
12
+ );
13
+ });
14
+ </script>
15
+
16
+ <style type="text/css">
17
+
18
+ .advanced_toggle {
19
+ line-height: 34px;
20
+ font-size: 12px;
21
+ font-weight: bold;
22
+ padding-bottom: 10px;
23
+ }
24
+
25
+ .edit_group {
26
+ height: 50px;
27
+ }
28
+ .group_name {
29
+ font-size: 12px;
30
+ font-weight: bold;
31
+ }
32
+ .group_actions {
33
+ padding-top: 5px;
34
+ }
35
+ </style>
classes/views/prli-groups/list.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+ <?php
3
+ require(PRLI_VIEWS_PATH.'/shared/nav.php');
4
+ ?>
5
+ <h2><img src="<?php echo PRLI_URL.'/images/pretty-link-med.png'; ?>"/>&nbsp;Pretty Link: Groups</h2>
6
+ <div id="message" class="updated fade" style="padding:5px;"><?php echo $prli_message; ?></div>
7
+ <div id="search_pane" style="float: right;">
8
+ <form class="form-fields" name="group_form" method="post" action="">
9
+ <?php wp_nonce_field('prli-groups'); ?>
10
+ <input type="hidden" name="sort" id="sort" value="<?php echo $sort_str; ?>" />
11
+ <input type="hidden" name="sdir" id="sort" value="<?php echo $sdir_str; ?>" />
12
+ <input type="text" name="search" id="search" value="<?php echo $search_str; ?>" style="display:inline;"/>
13
+ <div class="submit" style="display: inline;"><input type="submit" name="Submit" value="Search"/>
14
+ <?php
15
+ if(!empty($search_str))
16
+ {
17
+ ?>
18
+ or <a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-groups.php">Reset</a>
19
+ <?php
20
+ }
21
+ ?>
22
+ </div>
23
+ </form>
24
+ </div>
25
+ <div id="button_bar">
26
+ <p><a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-groups.php&action=new">Add a Pretty Link Group</a></p>
27
+ </div>
28
+
29
+ <?php
30
+ require(PRLI_VIEWS_PATH.'/shared/table-nav.php');
31
+ ?>
32
+ <table class="widefat post fixed" cellspacing="0">
33
+ <thead>
34
+ <tr>
35
+ <th class="manage-column" width="50%"><a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-groups.php&sort=name<?php echo (($sort_str == 'name' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Name<?php echo (($sort_str == 'name')?'&nbsp;&nbsp;&nbsp;<img src="'.PRLI_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a></th>
36
+ <th class="manage-column" width="20%"><a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-groups.php&sort=link_count<?php echo (($sort_str == 'link_count' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Links<?php echo (($sort_str == 'link_count')?'&nbsp;&nbsp;&nbsp;<img src="'.PRLI_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a></th>
37
+ <th class="manage-column" width="30%"><a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-groups.php&sort=created_at<?php echo (($sort_str == 'created_at' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Created<?php echo ((empty($sort_str) or $sort_str == 'created_at')?'&nbsp;&nbsp;&nbsp;<img src="'.PRLI_URL.'/images/'.((empty($sort_str) or $sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a></th>
38
+ </tr>
39
+ </thead>
40
+ <?php
41
+
42
+ if($record_count <= 0)
43
+ {
44
+ ?>
45
+ <tr>
46
+ <td colspan="5">No Pretty Link Groups were found</td>
47
+ </tr>
48
+ <?php
49
+ }
50
+ else
51
+ {
52
+ foreach($groups as $group)
53
+ {
54
+ ?>
55
+ <tr>
56
+ <td class="edit_group">
57
+ <a class="group_name" href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-groups.php&action=edit&id=<?php echo $group->id; ?>" title="Edit <?php echo htmlspecialchars(stripslashes($group->name)); ?>"><?php echo htmlspecialchars(stripslashes($group->name)); ?></a>
58
+ <br/>
59
+ <div class="group_actions">
60
+ <a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-groups.php&action=edit&id=<?php echo $group->id; ?>" title="Edit <?php echo htmlspecialchars(stripslashes($group->name)); ?>">Edit</a>&nbsp;|
61
+ <a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-groups.php&action=destroy&id=<?php echo $group->id; ?>" onclick="return confirm('Are you sure you want to delete your <?php echo htmlspecialchars(stripslashes($group->name)); ?> Pretty Link Group?');" title="Delete <?php echo htmlspecialchars(stripslashes($group->name)); ?>">Delete</a>&nbsp;|
62
+ <a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-links.php&group=<?php echo $group->id; ?>" title="View links in <?php echo htmlspecialchars(stripslashes($group->name)); ?>">Links</a>&nbsp;|
63
+ <a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-clicks.php&group=<?php echo $group->id; ?>" title="View hits in <?php echo htmlspecialchars(stripslashes($group->name)); ?>">Hits</a>
64
+ </div>
65
+ </td>
66
+ <td><a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-links.php&group=<?php echo $group->id; ?>" title="View links in <?php echo htmlspecialchars(stripslashes($group->name)); ?>"><?php echo $group->link_count; ?></a></td>
67
+ <td><?php echo $group->created_at; ?></td>
68
+ </tr>
69
+ <?php
70
+ }
71
+ }
72
+ ?>
73
+ <tfoot>
74
+ <tr>
75
+ <th class="manage-column">Name</th>
76
+ <th class="manage-column">Links</th>
77
+ <th class="manage-column">Created</th>
78
+ </tr>
79
+ </tfoot>
80
+ </table>
81
+ <?php
82
+ require(PRLI_VIEWS_PATH.'/shared/table-nav.php');
83
+ ?>
84
+
85
+ </div>
classes/views/prli-groups/new.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+ <h2><img src="<?php echo PRLI_URL.'/images/pretty-link-med.png'; ?>"/>&nbsp;Pretty Link: Add Group</h2>
3
+
4
+ <?php
5
+ require(PRLI_VIEWS_PATH.'/shared/errors.php');
6
+ ?>
7
+
8
+ <form name="form1" method="post" action="?page=<?php echo PRLI_PLUGIN_NAME ?>/prli-groups.php">
9
+ <input type="hidden" name="action" value="create">
10
+ <?php wp_nonce_field('update-options'); ?>
11
+ <input type="hidden" name="id" value="<?php echo $id; ?>">
12
+
13
+ <table class="form-table">
14
+ <tr class="form-field">
15
+ <td width="75px" valign="top">Name*: </td>
16
+ <td><input type="text" name="name" value="<?php echo (($_POST['name'] != null)?$_POST['name']:''); ?>" size="75">
17
+ <br/><span class="setting-description">This is how you'll identify your Group.</span></td>
18
+ </tr>
19
+ <tr class="form-field">
20
+ <td valign="top">Description: </td>
21
+ <td><textarea style="height: 100px;" name="description"><?php echo (($_POST['description'] != null)?$_POST['description']:''); ?></textarea>
22
+ <br/><span class="setting-description">A Description of this group.</span></td>
23
+ </tr>
24
+ <tr class="form-field" valign="top">
25
+ <td valign="top">Links: </td>
26
+ <td valign="top">
27
+ <div style="height: 150px; width: 95%; border: 1px solid #8cbdd5; overflow: auto;">
28
+ <table width="100%" cellspacing="0">
29
+ <thead style="background-color: #dedede; padding: 0px; margin: 0px; line-height: 8px; font-size: 14px;">
30
+ <th width="50%" style="padding-left: 5px; margin: 0px;"><strong>Name</strong></th>
31
+ <th width="50%" style="padding-left: 5px; margin: 0px;"><strong>Current Group</strong></th>
32
+ </thead>
33
+ <?php
34
+ for($i = 0; $i < count($links); $i++)
35
+ {
36
+ $link = $links[$i];
37
+ ?>
38
+ <tr style="line-height: 15px; font-size: 12px;<?php echo (($i%2)?' background-color: #efefef;':''); ?>">
39
+ <td style="min-width: 50%; width: 50%;"><input type="checkbox" style="width: 15px;" name="link[<?php echo $link->id; ?>]" <?php echo ((isset($_POST['link'][$link->id]) and $_POST['link'][$link->id] == 'on')?'checked="true"':''); ?>/>&nbsp;<?php echo htmlspecialchars(stripslashes($link->name)) . " <strong>(" . $link->slug . ")</strong>"; ?></td>
40
+ <td style="min-width: 50%; width: 50%;"><?php echo htmlspecialchars(stripslashes($link->group_name)); ?></td>
41
+ </tr>
42
+ <?php
43
+
44
+ }
45
+ ?>
46
+ </table>
47
+ </div>
48
+ <span class="setting-description">Select some links for this group. <strong>Note: each link can only be in one group at a time.</strong></span></td>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+ </div>
53
+
54
+ <p class="submit">
55
+ <input type="submit" name="Submit" value="Create" />&nbsp;or&nbsp;<a href="?page=<?php echo PRLI_PLUGIN_NAME ?>/prli-groups.php">Cancel</a>
56
+ </p>
57
+
58
+ </form>
59
+ </div>
classes/views/prli-links/bar.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
5
+ <meta name="description" content="<?php echo stripslashes($pretty_link->description); ?>" />
6
+ <title><?php echo htmlspecialchars(stripslashes($pretty_link->name)); ?></title>
7
+ </head>
8
+ <frameset rows="66,*" framespacing=0 frameborder=0>
9
+ <frame src="<?php echo PRLI_URL . "/pretty-bar.php?slug=".$pretty_link->slug . "&url=".urlencode($pretty_link_url.$param_string); ?>" noresize frameborder=0 scrolling=no marginwidth=0 marginheight=0 style="">
10
+ <frame src="<?php echo $pretty_link_url.$param_string; ?>" frameborder=0 marginwidth=0 marginheight=0>
11
+ <noframes>Your browser does not support frames. Click <a href="<?php echo $pretty_link_url.$param_string; ?>">here</a> to view the page.</noframes>
12
+ </frameset>
13
+ </html>
classes/views/prli-links/edit.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+ <h2><img src="<?php echo PRLI_URL.'/images/pretty-link-med.png'; ?>"/>&nbsp;Pretty Link: Edit Link</h2>
3
+
4
+ <?php
5
+ require(PRLI_VIEWS_PATH.'/shared/errors.php');
6
+ ?>
7
+
8
+ <form name="form1" method="post" action="?page=<?php echo PRLI_PLUGIN_NAME ?>/prli-links.php">
9
+ <input type="hidden" name="action" value="update">
10
+ <input type="hidden" name="id" value="<?php echo $id; ?>">
11
+ <?php wp_nonce_field('update-options'); ?>
12
+
13
+ <?php
14
+ require(PRLI_VIEWS_PATH.'/prli-links/form.php');
15
+ ?>
16
+
17
+ <p class="submit">
18
+ <input type="submit" name="Submit" value="Update" />&nbsp;or&nbsp;<a href="?page=<?php echo PRLI_PLUGIN_NAME ?>/prli-links.php">Cancel</a>
19
+ </p>
20
+
21
+ </form>
22
+ </div>
classes/views/prli-links/form.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <table class="form-table">
2
+ <tr class="form-field">
3
+ <td width="75px" valign="top">Target URL*: </td>
4
+ <td><textarea style="height: 50px;" name="url"><?php echo htmlentities($values['url'],ENT_COMPAT,'UTF-8'); ?></textarea>
5
+ <a class="toggle">&nbsp;[?]</a>
6
+ <span class="description toggle_pane"><br/>Enter the URL you want to mask and track. Don't forget to start your url with <code>http://</code> or <code>https://</code>. Example: <code>http://www.yoururl.com</code></span></td>
7
+ </tr>
8
+ <tr>
9
+ <td valign="top">Pretty Link*: </td>
10
+ <td><strong><?php echo $prli_blogurl; ?></strong>/<input type="text" name="slug" value="<?php echo $values['slug']; ?>" size="50"/>
11
+ <a class="toggle">&nbsp;[?]</a>
12
+ <span class="toggle_pane description"><br/>Enter the slug (word trailing your main URL) that will form your pretty link and redirect to the URL above.</span></td>
13
+ </tr>
14
+ <tr class="form-field">
15
+ <td width="75px" valign="top">Title: </td>
16
+ <td><input type="text" name="name" value="<?php echo $values['name']; ?>" />
17
+ <a class="toggle">&nbsp;[?]</a>
18
+ <span class="description toggle_pane"><br/>This will act as the title of your Pretty Link. If a name is not entered here then the slug name will be used.</span></td>
19
+ </tr>
20
+ <tr class="form-field">
21
+ <td valign="top">Description: </td>
22
+ <td><textarea style="height: 50px;" name="description"><?php echo $values['description']; ?></textarea>
23
+ </select><a class="toggle">&nbsp;[?]</a>
24
+ <span class="toggle_pane description"><br/>A Description of this link.</span></td>
25
+ </tr>
26
+ </table>
27
+ <h3><a class="options-table-toggle">Link Options <span class="expand-options" style="display: none;">[+]</span><span class="collapse-options">[-]</span></a> <span class="expand-collapse" style="display: none"><a class="expand-all" title="Show all option instructions.">&nbsp;[?]</a><a class="collapse-all" title="Hide all option instructions." style="display: none;">&nbsp;[?]</a></span></h3>
28
+ <table class="options-table">
29
+ <tr>
30
+ <td valign="top" width="50%">
31
+ <h3>Group&nbsp;</h3>
32
+ <div class="pane">
33
+ <select name="group_id" style="padding: 0px; margin: 0px;">
34
+ <option>None</option>
35
+ <?php
36
+ foreach($values['groups'] as $group)
37
+ {
38
+ ?>
39
+ <option value="<?php echo $group['id']; ?>"<?php echo $group['value']; ?>><?php echo $group['name']; ?>&nbsp;</option>
40
+ <?php
41
+ }
42
+ ?>
43
+ </select><a class="toggle">&nbsp;[?]</a>
44
+ <div class="toggle_pane description">Select a group for this link.</div>
45
+ </div>
46
+ <br/>
47
+ <h3>Redirection Type&nbsp;</h3>
48
+ <div class="pane">
49
+ <select id="redirect_type" name="redirect_type" style="padding: 0px; margin: 0px;">
50
+ <option value="307"<?php echo $values['redirect_type']['307']; ?>>307 (Temporary)&nbsp;</option>
51
+ <option value="301"<?php echo $values['redirect_type']['301']; ?>>301 (Permanent)&nbsp;</option>
52
+ <option value="prettybar"<?php echo $values['redirect_type']['prettybar']; ?>>Pretty Bar&nbsp;</option>
53
+ <option value="cloak"<?php echo $values['redirect_type']['cloak']; ?>>Cloaked&nbsp;</option>
54
+ <option value="pixel"<?php echo $values['redirect_type']['pixel']; ?>>Pixel&nbsp;</option>
55
+ </select><a class="toggle">&nbsp;[?]</a>
56
+ <div class="toggle_pane description"><strong>307 Redirection</strong> is the best option if your Target URL could possibly change or need accurate reporting for this link.<br/><br/><strong>301 Redirection</strong> is the best option if you're <strong>NOT</strong> planning on changing your Target URL. Traditionally this option is considered to be the best approach to use for your SEO/SEM efforts but since Pretty Link uses your domain name either way this notion isn't necessarily true for Pretty Links. Also, this option may not give you accurate reporting since proxy and caching servers may go directly to your Target URL once it's cached.<br/><br/><strong>Pretty Bar Redirection</strong> is the best option if you want to show the Pretty Bar at the top of the page when redirecting to the Target URL.<br/><br/><strong>Cloak Redirection</strong> is the best option if you don't want your Target URL to be visible even after the redirection. This way, if a Target URL doesn't redirect to a URL you want to show then this will mask it.<br/><br/><strong>Pixel Redirection</strong> is the option you should select if you want this link to behave like a tracking pixel instead of as a link. This option is useful if you want to track the number of times a page or email is opened. If you place your Pretty Link inside an img tag on the page (Example: <code>&lt;img src="<?php echo $prli_blogurl . "/yourslug"; ?>" /&gt;</code>) then the page load will be tracked as a click and then displayed. Note: If this option is selected your Target URL will simply be ignored if there's a value in it.</div>
57
+ </div>
58
+ <br/>
59
+ <h3>SEO Options</h3>
60
+ <div class="pane">
61
+ <input type="checkbox" name="nofollow" <?php echo $values['nofollow']; ?>/>&nbsp; 'Nofollow' this Link <a class="toggle">&nbsp;[?]</a>
62
+ <div class="toggle_pane description">Select this if you want to add a nofollow code to this link. A nofollow will prevent reputable spiders and robots from following or indexing this link.</div>
63
+ </div>
64
+ </td>
65
+ <td valign="top" width="50%">
66
+ <h3>Tracking Options</h3>
67
+ <div class="pane">
68
+ <input type="checkbox" name="track_me" <?php echo $values['track_me']; ?>/>&nbsp; Track this Link <a class="toggle">&nbsp;[?]</a>
69
+ <div class="toggle_pane description">De-select this option if you don't want this link tracked. If de-selected, this link will still redirect to the target URL but hits on it won't be recorded in the database.</div>
70
+ </div>
71
+ <br/>
72
+ <a name="param_forwarding_pos" height="0"></a>
73
+ <h3>Parameter Forwarding</h3>
74
+ <ul style="list-style-type: none" class="pane">
75
+ <li>
76
+ <input type="radio" name="param_forwarding" value="off" <?php echo $values['param_forwarding']['off']; ?>/>&nbsp;Forward Parameters Off <a class="toggle">&nbsp;[?]</a>
77
+ <div class="toggle_pane description">You may want to leave this option off if you don't need to forward any parameters on to your Target URL.</div>
78
+ </li>
79
+ <li>
80
+ <input type="radio" name="param_forwarding" value="on" <?php echo $values['param_forwarding']['on']; ?> />&nbsp;Standard Parameter Forwarding <a class="toggle">&nbsp;[?]</a>
81
+ <div class="toggle_pane description">Select this option if you want to forward parameters through your pretty link to your Target URL. This will allow you to pass parameters in the standard syntax for example the pretty link <code>http://yoururl.com/coollink?product_id=4&sku=5441</code> will forward to the target URL and append the same parameters like so: <code>http://anotherurl.com?product_id=4&sku=5441</code>.</div>
82
+ </li>
83
+ <li>
84
+ <input type="radio" name="param_forwarding" value="custom" <?php echo $values['param_forwarding']['custom']; ?> />&nbsp;Custom Parameter Forwarding&nbsp;&nbsp;<input type="text" name="param_struct" value="<?php echo $values['param_struct'] ?>" size="25"/> <a class="toggle">&nbsp;[?]</a>
85
+ <div class="toggle_pane description">Select this option if you want to forward parameters through your Pretty Link to your Target URL and write the parameters in a custom format. For example, say I wanted to to have my links look like this: <code>http://yourdomain.com/products/14/4</code> and I wanted this to forward to <code>http://anotherurl.com?product_id=14&dock=4</code> you'd just select this option and enter the following string into the text field <code>/products/%product_id%/%dock%</code>. This will tell Pretty Link where each variable will be located in the URL and what each variable name is.</div>
86
+ </li>
87
+ </ul>
88
+ </td>
89
+ </tr>
90
+ </table>
91
+ <?php
92
+ // Add stuff to the form here
93
+ do_action('prli_link_fields',$id);
94
+ ?>
classes/views/prli-links/head.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script type="text/javascript">
2
+ jQuery(document).ready(function() {
3
+ jQuery('.link_actions').hide();
4
+ jQuery('.edit_link').hover(
5
+ function() {
6
+ jQuery(this).children(".link_actions").show();
7
+ },
8
+ function() {
9
+ jQuery(this).children(".link_actions").hide();
10
+ }
11
+ );
12
+
13
+ jQuery(".options-table").hide();
14
+ jQuery(".options-table-toggle > .expand-options").show();
15
+ jQuery(".options-table-toggle > .collapse-options").hide();
16
+ jQuery(".options-table-toggle").click( function () {
17
+ jQuery(this).children(".expand-options").toggle();
18
+ jQuery(this).children(".collapse-options").toggle();
19
+ jQuery(".expand-collapse").toggle();
20
+ jQuery(".options-table").toggle();
21
+ });
22
+
23
+ jQuery(".toggle_pane").hide();
24
+ jQuery(".toggle").click( function () {
25
+ jQuery(this).next(".toggle_pane").toggle();
26
+ });
27
+ jQuery(".expand-all").click( function () {
28
+ jQuery(".toggle_pane").show();
29
+ jQuery(".expand-all").hide();
30
+ jQuery(".collapse-all").show();
31
+ });
32
+ jQuery(".collapse-all").click( function () {
33
+ jQuery(".toggle_pane").hide();
34
+ jQuery(".expand-all").show();
35
+ jQuery(".collapse-all").hide();
36
+ });
37
+ });
38
+ </script>
39
+
40
+ <style type="text/css">
41
+
42
+ .options-table {
43
+ width: 80%;
44
+ margin-top: 10px;
45
+ }
46
+
47
+ .options-table td {
48
+ padding: 10px;
49
+ background-color: #f4f0db;
50
+ }
51
+
52
+ .options-table h3 {
53
+ padding: 0px;
54
+ margin: 0px;
55
+ padding-left: 10px;
56
+ }
57
+
58
+ .expand-all, .collapse-all, .options-table-toggle {
59
+ cursor: pointer;
60
+ }
61
+
62
+ .toggle {
63
+ line-height: 34px;
64
+ font-size: 12px;
65
+ font-weight: bold;
66
+ padding-bottom: 10px;
67
+ cursor: pointer;
68
+ }
69
+
70
+ .pane {
71
+ background-color: #f4f0db;
72
+ padding-left: 10px;
73
+ }
74
+
75
+ ul.pane li {
76
+ padding: 0px;
77
+ margin: 0px;
78
+ }
79
+
80
+ .edit_link {
81
+ height: 50px;
82
+ }
83
+
84
+ .slug_name {
85
+ font-size: 12px;
86
+ font-weight: bold;
87
+ }
88
+ .link_actions {
89
+ padding-top: 5px;
90
+ }
91
+ </style>
classes/views/prli-links/list.php ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+ <?php
3
+ require(PRLI_VIEWS_PATH.'/shared/nav.php');
4
+ ?>
5
+ <h2><img src="<?php echo PRLI_URL.'/images/pretty-link-med.png'; ?>"/>&nbsp;Pretty Link: Links</h2>
6
+ <?php
7
+ if(empty($params['group']))
8
+ {
9
+ $permalink_structure = get_option('permalink_structure');
10
+ if(!$permalink_structure or empty($permalink_structure))
11
+ {
12
+ ?>
13
+ <div class="error" style="padding-top: 5px; padding-bottom: 5px;"><strong>WordPress Must be Configured:</strong> Pretty Link won't work until you select a Permalink Structure other than "Default" ... <a href="<?php echo $prli_siteurl; ?>/wp-admin/options-permalink.php">Permalink Settings</a></div>
14
+ <?php
15
+ }
16
+ ?>
17
+ <div id="message" class="updated fade" style="padding:5px;"><?php echo $prli_message; ?></div>
18
+ <?php do_action('prli-link-message'); ?>
19
+ <div id="search_pane" style="float: right;">
20
+ <form class="form-fields" name="link_form" method="post" action="">
21
+ <?php wp_nonce_field('prli-links'); ?>
22
+ <input type="hidden" name="sort" id="sort" value="<?php echo $sort_str; ?>" />
23
+ <input type="hidden" name="sdir" id="sort" value="<?php echo $sdir_str; ?>" />
24
+ <input type="text" name="search" id="search" value="<?php echo $search_str; ?>" style="display:inline;"/>
25
+ <div class="submit" style="display: inline;"><input type="submit" name="Submit" value="Search"/>
26
+ <?php
27
+ if(!empty($search_str))
28
+ {
29
+ ?>
30
+ or <a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-links.php">Reset</a>
31
+ <?php
32
+ }
33
+ ?>
34
+ </div>
35
+ </form>
36
+ </div>
37
+ <div id="button_bar">
38
+ <p><a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-add-link.php"><img src="<?php echo PRLI_URL.'/images/pretty-link-add.png'; ?>"/> Add a Pretty Link</a>
39
+ &nbsp;|&nbsp;<a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-options.php">Options</a>
40
+ &nbsp;|&nbsp;<a href="http://blairwilliams.com/plintro">Watch Pretty Link Intro Video</a>
41
+ <?php do_action('prli-link-nav'); ?>
42
+ </p>
43
+ </div>
44
+ <?php
45
+ }
46
+ else
47
+ {
48
+ ?>
49
+ <h3><?php echo $prli_message; ?></h3>
50
+ <a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-groups.php">&laquo Back to Groups</a>
51
+ <br/><br/>
52
+ <?php
53
+ }
54
+ ?>
55
+ <form class="form-fields link-list-form" name="link_list_form" method="post" action="">
56
+ <input type="hidden" name="action" value="list-form"/>
57
+ <?php $footer = false; require(PRLI_VIEWS_PATH.'/shared/link-table-nav.php'); ?>
58
+ <table class="widefat post fixed" cellspacing="0">
59
+ <thead>
60
+ <tr>
61
+ <th class="manage-column" width="30%"><?php do_action('prli-list-header-icon'); ?><a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-links.php&sort=name<?php echo (($sort_str == 'name' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Name<?php echo (($sort_str == 'name')?'&nbsp;&nbsp;&nbsp;<img src="'.PRLI_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a></th>
62
+ <?php do_action('prli_link_column_header'); ?>
63
+ <th class="manage-column" width="10%"><a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-links.php&sort=clicks<?php echo (($sort_str == 'clicks' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Hits / Uniq<?php echo (($sort_str == 'clicks')?'&nbsp;&nbsp;&nbsp;<img src="'.PRLI_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a></th>
64
+ <th class="manage-column" width="5%"><a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-links.php&sort=group_name<?php echo (($sort_str == 'group_name' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Group<?php echo (($sort_str == 'group_name')?'&nbsp;&nbsp;&nbsp;<img src="'.PRLI_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a></th>
65
+ <th class="manage-column" width="12%"><a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-links.php&sort=created_at<?php echo (($sort_str == 'created_at' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Created<?php echo ((empty($sort_str) or $sort_str == 'created_at')?'&nbsp;&nbsp;&nbsp;<img src="'.PRLI_URL.'/images/'.((empty($sort_str) or $sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a></th>
66
+ <th class="manage-column" width="20%"><a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-links.php&sort=slug<?php echo (($sort_str == 'slug' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Links<?php echo (($sort_str == 'slug')?'&nbsp;&nbsp;&nbsp;<img src="'.PRLI_URL.'/images/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a></th>
67
+ </tr>
68
+ </thead>
69
+ <?php
70
+
71
+ if($record_count <= 0)
72
+ {
73
+ ?>
74
+ <tr>
75
+ <td colspan="5">Watch this video to see how to get started! -- <a href="http://blairwilliams.com/xba"><strong>Get More Video Tutorials like this one...</strong></a><br/><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/i6C2Bljby3k&hl=en&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/i6C2Bljby3k&hl=en&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object></td>
76
+ </tr>
77
+ <?php
78
+ }
79
+ else
80
+ {
81
+ global $prli_blogurl;
82
+ foreach($links as $link)
83
+ {
84
+ $struct = PrliUtils::get_permalink_pre_slug_uri();
85
+ $pretty_link_url = "{$prli_blogurl}{$struct}{$link->slug}";
86
+ ?>
87
+ <tr style="min-height: 75px; height: 75px;">
88
+ <td class="edit_link">
89
+
90
+ <?php do_action('prli_list_icon',$link->id); ?>
91
+ <?php if( $link->redirect_type == 'prettybar' ) { ?>
92
+ <img src="<?php echo PRLI_URL.'/images/pretty-link-small.png'; ?>" title="Using PrettyBar" width="13px" height="13px" />
93
+ <?php }
94
+ else if( $link->redirect_type == 'cloak' ) { ?>
95
+ <img src="<?php echo PRLI_URL.'/images/ultra-cloak.png'; ?>" title="Using Ultra Cloak" width="13px" height="13px" />
96
+ <?php }
97
+ else if( $link->redirect_type == 'pixel' ) { ?>
98
+ <img src="<?php echo PRLI_URL.'/images/pixel_track.png'; ?>" width="13px" height="13px" name="Pixel Tracking Enabled" alt="Pixel Tracking Enabled" title="Pixel Tracking Enabled"/>&nbsp;
99
+ <?php }
100
+ else if( $link->redirect_type == '307' ) { ?>
101
+ <span title="Temporary Redirection (307)" style="font-size: 14px; line-height: 14px; padding: 0px; margin: 0px; color: green;"><strong>T</strong></span>&nbsp;
102
+ <?php }
103
+ else if( $link->redirect_type == '301' ) { ?>
104
+ <span title="Permanent Redirection (301)" style="font-size: 14px; line-height: 14px; padding: 0px; margin: 0px; color: green;"><strong>P</strong></span>&nbsp;
105
+ <?php } ?>
106
+
107
+ <?php if( $link->nofollow ) { ?>
108
+ <img src="<?php echo PRLI_URL.'/images/nofollow.png'; ?>" title="nofollow" width="13px" height="13px" />
109
+ <?php }
110
+
111
+ if($link->param_forwarding == 'on')
112
+ {
113
+ ?>
114
+ <img src="<?php echo PRLI_URL.'/images/forward_params.png'; ?>" width="13px" height="13px" name="Standard Parameter Forwarding Enabled" alt="Standard Parameter Forwarding Enabled" title="Standard Parameter Forwarding Enabled"/>&nbsp;
115
+ <?php
116
+ }
117
+ else if($link->param_forwarding == 'custom')
118
+ {
119
+ ?>
120
+ <img src="<?php echo PRLI_URL.'/images/forward_params.png'; ?>" width="13px" height="13px" name="Custom Parameter Forwarding Enabled" alt="Custom Parameter Forwarding Enabled" title="Custom Parameter Forwarding Enabled"/>&nbsp;
121
+ <?php
122
+ }
123
+ ?>
124
+
125
+ <?php if( $link->redirect_type != 'pixel' )
126
+ {
127
+ ?>
128
+ <a href="<?php echo $link->url; ?>" target="_blank" title="Visit Target URL: <?php echo $link->url; ?> in a New Window"><img src="<?php echo PRLI_URL.'/images/url_icon.gif'; ?>" width="13px" height="13px" name="Visit" alt="Visit"/></a>&nbsp;
129
+ <a href="<?php echo $pretty_link_url; ?>" target="_blank" title="Visit Pretty Link: <?php echo $pretty_link_url; ?> in a New Window"><img src="<?php echo PRLI_URL.'/images/url_icon.gif'; ?>" width="13px" height="13px" name="Visit" alt="Visit"/></a>&nbsp;
130
+ <?php
131
+ }
132
+ ?>
133
+ <a class="slug_name" href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-links.php&action=edit&id=<?php echo $link->id; ?>" title="Edit <?php echo stripslashes($link->name); ?>"><?php echo stripslashes($link->name); ?></a>
134
+ <br/>
135
+ <div class="link_actions">
136
+ <a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-links.php&action=edit&id=<?php echo $link->id; ?>" title="Edit <?php echo $link->slug; ?>">Edit</a>&nbsp;|
137
+ <a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-links.php&action=destroy&id=<?php echo $link->id; ?>" onclick="return confirm('Are you sure you want to delete your <?php echo $link->name; ?> Pretty Link? This will delete the Pretty Link and all of the statistical data about it in your database.');" title="Delete <?php echo $link->slug; ?>">Delete</a>
138
+ <?php if( $link->track_me ) { ?>
139
+ |&nbsp;<a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-links.php&action=reset&id=<?php echo $link->id; ?>" onclick="return confirm('Are you sure you want to reset your <?php echo $link->name; ?> Pretty Link? This will delete all of the statistical data about this Pretty Link in your database.');" title="Reset <?php echo $link->name; ?>">Reset</a>&nbsp;|
140
+ <a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-clicks.php&l=<?php echo $link->id; ?>" title="View clicks for <?php echo $link->slug; ?>">Hits</a>
141
+ <?php do_action('prli-link-action',$link->id); ?>
142
+ <?php } ?>
143
+ <?php if( $link->redirect_type != 'pixel' )
144
+ {
145
+ ?>
146
+ |&nbsp;<a href="http://twitter.com/home?status=<?php echo $pretty_link_url; ?>" target="_blank" title="Post <?php echo $pretty_link_url; ?> to Twitter">Tweet</a>&nbsp;|
147
+ <a href="mailto:?subject=Pretty Link&body=<?php echo $pretty_link_url; ?>" target="_blank" title="Send <?php echo $pretty_link_url; ?> in an Email">Email</a>
148
+ <?php
149
+ }
150
+ ?>
151
+ </div>
152
+ </td>
153
+ <?php do_action('prli_link_column_row',$link->id); ?>
154
+ <td><?php echo (($link->track_me)?"<a href=\"?page=".PRLI_PLUGIN_NAME."/prli-clicks.php&l=$link->id\" title=\"View clicks for $link->slug\">$link->clicks/$link->uniques</a>":"<img src=\"".PRLI_URL."/images/not_tracking.png\" title=\"This link isn't being tracked\"/>"); ?></td>
155
+ <td><a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-links.php&group=<?php echo $link->group_id; ?>"><?php echo $link->group_name; ?></a></td>
156
+ <td><?php echo $link->created_at; ?></td>
157
+ </td>
158
+ <td><input type='text' style="font-size: 10px; width: 100%;" readonly="true" onclick='this.select();' onfocus='this.select();' value='<?php echo $pretty_link_url; ?>' /><br/>
159
+ <?php if( $link->redirect_type != 'pixel' )
160
+ {
161
+ ?>
162
+ <span style="font-size: 8px;" title="<?php echo $link->url; ?>"><strong>Target URL:</strong> <?php echo htmlentities((substr($link->url,0,47) . ((strlen($link->url) >= 47)?'...':'')),ENT_COMPAT,'UTF-8'); ?></span></td>
163
+ <?php
164
+ }
165
+ ?>
166
+ </tr>
167
+ <?php
168
+ }
169
+ }
170
+ ?>
171
+ <tfoot>
172
+ <tr>
173
+ <th class="manage-column"><?php do_action('prli-list-header-icon'); ?>Name</th>
174
+ <?php do_action('prli_link_column_footer'); ?>
175
+ <th class="manage-column">Hits / Uniq</th>
176
+ <th class="manage-column">Group</th>
177
+ <th class="manage-column">Created</th>
178
+ <th class="manage-column">Links</th>
179
+ </tr>
180
+ </tfoot>
181
+ </table>
182
+ <?php $footer = true; require(PRLI_VIEWS_PATH.'/shared/link-table-nav.php'); ?>
183
+ </form>
184
+
185
+ </div>
classes/views/prli-links/new.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+ <h2><img src="<?php echo PRLI_URL.'/images/pretty-link-med.png'; ?>"/>&nbsp;Pretty Link: Add Link</h2>
3
+
4
+ <?php
5
+ require(PRLI_VIEWS_PATH.'/shared/errors.php');
6
+ ?>
7
+
8
+ <form name="form1" method="post" action="?page=<?php echo PRLI_PLUGIN_NAME ?>/prli-links.php">
9
+ <input type="hidden" name="action" value="create">
10
+ <?php wp_nonce_field('update-options'); ?>
11
+ <input type="hidden" name="id" value="<?php echo $id; ?>">
12
+
13
+ <?php
14
+ require(PRLI_VIEWS_PATH.'/prli-links/form.php');
15
+ ?>
16
+
17
+ <p class="submit">
18
+ <input type="submit" name="Submit" value="Create" />&nbsp;or&nbsp;<a href="?page=<?php echo PRLI_PLUGIN_NAME ?>/prli-links.php">Cancel</a>
19
+ </p>
20
+
21
+ </form>
22
+ </div>
classes/views/prli-links/ultra-cloak.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
5
+ <title><?php echo htmlspecialchars(stripslashes($pretty_link->name)); ?></title>
6
+ <meta name="description" content="<?php echo stripslashes($pretty_link->description); ?>" />
7
+ </head>
8
+ <frameset rows="*" framespacing=0 frameborder=0>
9
+ <frame src="<?php echo $pretty_link_url.$param_string; ?>" frameborder=0 marginwidth=0 marginheight=0>
10
+ <noframes>Your browser does not support frames. Click <a href="<?php echo $pretty_link_url.$param_string; ?>">here</a> to view the page.</noframes>
11
+ </frameset>
12
+ </html>
classes/views/prli-options/form.php ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+ <div id="icon-options-general" class="icon32"><br /></div>
3
+ <h2 id="prli_title">Pretty Link: Options</h2>
4
+ <br/>
5
+ <?php
6
+ $permalink_structure = get_option('permalink_structure');
7
+ if(!$permalink_structure or empty($permalink_structure))
8
+ {
9
+ ?>
10
+ <div class="error" style="padding-top: 5px; padding-bottom: 5px;"><strong>WordPress Must be Configured:</strong> Pretty Link won't work until you select a Permalink Structure other than "Default" ... <a href="<?php echo $prli_siteurl; ?>/wp-admin/options-permalink.php">Permalink Settings</a></div>
11
+ <?php
12
+ }
13
+ ?>
14
+ <?php do_action('prli-options-message'); ?>
15
+ <a href="admin.php?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-links.php">&laquo Pretty Link Admin</a>
16
+
17
+ <form name="form1" method="post" action="">
18
+ <input type="hidden" name="<?php echo $hidden_field_name; ?>" value="Y">
19
+ <?php wp_nonce_field('update-options'); ?>
20
+
21
+ <h3><a class="toggle link-toggle-button">Link Option Defaults <span class="link-expand" style="display: none;">[+]</span><span class="link-collapse">[-]</span></a></h3>
22
+ <ul class="link-toggle-pane" style="list-style-type: none;">
23
+ <li>
24
+ <input type="checkbox" name="<?php echo $link_track_me; ?>" <?php echo (($prli_options->link_track_me != 0)?'checked="true"':''); ?>/>&nbsp; Track Link
25
+ <br/><span class="description">Default all new links to be tracked.</span>
26
+ </li>
27
+ <li>
28
+ <input type="checkbox" name="<?php echo $link_nofollow; ?>" <?php echo (($prli_options->link_nofollow != 0)?'checked="true"':''); ?>/>&nbsp; Add <code>nofollow</code> to Link
29
+ <br/><span class="description">Add the <code>nofollow</code> attribute by default to new links.</span>
30
+ </li>
31
+ <li>
32
+ <input type="checkbox" name="<?php echo $link_prefix; ?>" <?php echo (($prli_options->link_prefix != 0)?'checked="true"':''); ?>/>&nbsp; Use a prefix from your Permalink structure in your Pretty Links
33
+ <br/><span class="description">This option should only be checked if you have elements in your permalink structure that must be present in any link on your site. For example, some WordPress installs don't have the benefit of full rewrite capabilities and in this case you'd need an index.php included in each link (http://example.com/index.php/mycoolslug instead of http://example.com/mycoolslug). If this is the case for you then check this option but the vast majority of users will want to keep this unchecked.</span>
34
+ </li>
35
+ <li>
36
+ <h4>Default Link Redirection Type:</h4>
37
+ <select name="<?php echo $link_redirect_type; ?>">
38
+ <option value="307" <?php echo (($prli_options->link_redirect_type == '307')?' selected="selected"':''); ?>/>Temporary (307)</option>
39
+ <option value="301" <?php echo (($prli_options->link_redirect_type == '301')?' selected="selected"':''); ?>/>Permanent (301)</option>
40
+ <option value="prettybar" <?php echo (($prli_options->link_redirect_type == 'prettybar')?' selected="selected"':''); ?>/>Pretty Bar</option>
41
+ <option value="cloak" <?php echo (($prli_options->link_redirect_type == 'cloak')?' selected="selected"':''); ?>/>Cloak</option>
42
+ <option value="pixel" <?php echo (($prli_options->link_redirect_type == 'pixel')?' selected="selected"':''); ?>/>Pixel</option>
43
+ </select>
44
+ <br/><span class="description">Select the type of redirection you want your newly created links to have.</span>
45
+ </li>
46
+ </ul>
47
+ <h3><a class="toggle prettybar-toggle-button">PrettyBar Options <span class="prettybar-expand" style="display: none;">[+]</span><span class="prettybar-collapse">[-]</span></a></h3>
48
+ <table class="prettybar-toggle-pane form-table">
49
+ <tr class="form-field">
50
+ <td valign="top" width="15%"><?php _e("Image URL:", $prettybar_image_url ); ?> </td>
51
+ <td width="85%">
52
+ <input type="text" name="<?php echo $prettybar_image_url; ?>" value="<?php echo $prli_options->prettybar_image_url; ?>"/>
53
+ <br/><span class="description">If set, this will replace the logo image on the PrettyBar. The image that this URL references should be 48x48 Pixels to fit.</span>
54
+ </td>
55
+ </tr>
56
+ <tr class="form-field">
57
+ <td valign="top" width="15%"><?php _e("Background Image URL:", $prettybar_background_image_url ); ?> </td>
58
+ <td width="85%">
59
+ <input type="text" name="<?php echo $prettybar_background_image_url; ?>" value="<?php echo $prli_options->prettybar_background_image_url; ?>"/>
60
+ <br/><span class="description">If set, this will replace the background image on PrettyBar. The image that this URL references should be 65px tall -- this image will be repeated horizontally across the bar.</span>
61
+ </td>
62
+ </tr>
63
+ <tr>
64
+ <td valign="top" width="15%"><?php _e("Background Color:", $prettybar_color ); ?> </td>
65
+ <td width="85%">
66
+ #<input type="text" name="<?php echo $prettybar_color; ?>" value="<?php echo $prli_options->prettybar_color; ?>" size="6"/>
67
+ <br/><span class="description">This will alter the background color of the PrettyBar if you haven't specified a PrettyBar background image.</span>
68
+ </td>
69
+ </tr>
70
+ <tr>
71
+ <td valign="top" width="15%"><?php _e("Text Color:", $prettybar_text_color ); ?> </td>
72
+ <td width="85%">
73
+ #<input type="text" name="<?php echo $prettybar_text_color; ?>" value="<?php echo $prli_options->prettybar_text_color; ?>" size="6"/>
74
+ <br/><span class="description">If not set, this defaults to black (RGB value <code>#000000</code>) but you can change it to whatever color you like.</span>
75
+ </td>
76
+ </tr>
77
+ <tr>
78
+ <td valign="top" width="15%"><?php _e("Link Color:", $prettybar_link_color ); ?> </td>
79
+ <td width="85%">
80
+ #<input type="text" name="<?php echo $prettybar_link_color; ?>" value="<?php echo $prli_options->prettybar_link_color; ?>" size="6"/>
81
+ <br/><span class="description">If not set, this defaults to blue (RGB value <code>#0000ee</code>) but you can change it to whatever color you like.</span>
82
+ </td>
83
+ </tr>
84
+ <tr>
85
+ <td valign="top" width="15%"><?php _e("Link Hover Color:", $prettybar_hover_color ); ?> </td>
86
+ <td width="85%">
87
+ #<input type="text" name="<?php echo $prettybar_hover_color; ?>" value="<?php echo $prli_options->prettybar_hover_color; ?>" size="6"/>
88
+ <br/><span class="description">If not set, this defaults to RGB value <code>#ababab</code> but you can change it to whatever color you like.</span>
89
+ </td>
90
+ </tr>
91
+ <tr>
92
+ <td valign="top" width="15%"><?php _e("Visited Link Color:", $prettybar_visited_color ); ?> </td>
93
+ <td width="85%">
94
+ #<input type="text" name="<?php echo $prettybar_visited_color; ?>" value="<?php echo $prli_options->prettybar_visited_color; ?>" size="6"/>
95
+ <br/><span class="description">If not set, this defaults to RGB value <code>#551a8b</code> but you can change it to whatever color you like.</span>
96
+ </td>
97
+ </tr>
98
+ <tr>
99
+ <td valign="top" width="15%"><?php _e("Title Char Limit*:", $prettybar_title_limit ); ?> </td>
100
+ <td width="85%">
101
+ <input type="text" name="<?php echo $prettybar_title_limit; ?>" value="<?php echo $prli_options->prettybar_title_limit; ?>" size="4"/>
102
+ <br/><span class="description">If your Website has a long title then you may need to adjust this value so that it will all fit on the PrettyBar. It is recommended that you keep this value to <code>30</code> characters or less so the PrettyBar's format looks good across different browsers and screen resolutions.</span>
103
+ </td>
104
+ </tr>
105
+ <tr>
106
+ <td valign="top" width="15%"><?php _e("Description Char Limit*:", $prettybar_desc_limit ); ?> </td>
107
+ <td width="85%">
108
+ <input type="text" name="<?php echo $prettybar_desc_limit; ?>" value="<?php echo $prli_options->prettybar_desc_limit; ?>" size="4"/>
109
+ <br/><span class="description">If your Website has a long Description (tagline) then you may need to adjust this value so that it will all fit on the PrettyBar. It is recommended that you keep this value to <code>40</code> characters or less so the PrettyBar's format looks good across different browsers and screen resolutions.</span>
110
+ </td>
111
+ </tr>
112
+ <tr>
113
+ <td valign="top" width="15%"><?php _e("Target URL Char Limit*:", $prettybar_link_limit ); ?> </td>
114
+ <td width="85%">
115
+ <input type="text" name="<?php echo $prettybar_link_limit; ?>" value="<?php echo $prli_options->prettybar_link_limit; ?>" size="4"/>
116
+ <br/><span class="description">If you link to a lot of large Target URLs you may want to adjust this value. It is recommended that you keep this value to <code>40</code> or below so the PrettyBar's format looks good across different browsers and URL sizes</span>
117
+ </td>
118
+ </tr>
119
+ <tr>
120
+ <td colspan="2">
121
+ <input type="checkbox" name="<?php echo $prettybar_show_title; ?>" <?php echo (($prli_options->prettybar_show_title != 0)?'checked="true"':''); ?>/>&nbsp; Show Pretty Bar Title
122
+ <br/><span class="description">Make sure this is checked if you want the title of your blog (and link) to show up on the PrettyBar.</span>
123
+ </td>
124
+ </tr>
125
+ <tr>
126
+ <td colspan="2">
127
+ <input type="checkbox" name="<?php echo $prettybar_show_description; ?>" <?php echo (($prli_options->prettybar_show_description != 0)?'checked="true"':''); ?>/>&nbsp; Show Pretty Bar Description
128
+ <br/><span class="description">Make sure this is checked if you want your site description to show up on the PrettyBar.</span>
129
+ </td>
130
+ </tr>
131
+ <tr>
132
+ <td colspan="2">
133
+ <input type="checkbox" name="<?php echo $prettybar_show_share_links; ?>" <?php echo (($prli_options->prettybar_show_share_links != 0)?'checked="true"':''); ?>/>&nbsp; Show Pretty Bar Share Links
134
+ <br/><span class="description">Make sure this is checked if you want "share links" to show up on the PrettyBar.</span>
135
+ </td>
136
+ </tr>
137
+ <tr>
138
+ <td colspan="2">
139
+ <input type="checkbox" name="<?php echo $prettybar_show_target_url_link; ?>" <?php echo (($prli_options->prettybar_show_target_url_link != 0)?'checked="true"':''); ?>/>&nbsp; Show Pretty Bar Target URL
140
+ <br/><span class="description">Make sure this is checked if you want a link displaying the Target URL to show up on the PrettyBar.</span>
141
+ </td>
142
+ </tr>
143
+
144
+ <?php do_action('prli-prettybar-options'); ?>
145
+ </table>
146
+ <h3><a class="toggle reporting-toggle-button">Reporting Options <span class="reporting-expand" style="display: none;">[+]</span><span class="reporting-collapse">[-]</span></a></h3>
147
+ <table class="reporting-toggle-pane form-table">
148
+ <tr class="form-field">
149
+ <td valign="top">Excluded IP Addresses: </td>
150
+ <td>
151
+ <input type="text" name="<?php echo $prli_exclude_ips; ?>" value="<?php echo $prli_options->prli_exclude_ips; ?>">
152
+ <br/><span class="description">Enter IP Addresses or IP Ranges you want to exclude from your Hit data and Stats. Each IP Address should be separated by commas. Example: <code>192.168.0.1, 192.168.2.1, 192.168.3.4 or 192.168.*.*</code></span>
153
+ <br/><span class="description" style="color: red;">Your Current IP Address is <?php echo $_SERVER['REMOTE_ADDR']; ?></span>
154
+ </td>
155
+ </tr>
156
+ <tr>
157
+ <td colspan="2">
158
+ <input type="checkbox" class="filter-robots-checkbox" name="<?php echo $filter_robots; ?>" <?php echo (($prli_options->filter_robots != 0)?'checked="true"':''); ?>/>&nbsp; Filter Robots
159
+ <br/><span class="description">Filter known Robots and unidentifiable browser clients from your hit data, stats and reports. <code>IMPORTANT: Any robot hits recorded with any version of Pretty Link before 1.4.22 won't be filtered by this setting.</code></span>
160
+ <table class="option-pane whitelist-ips">
161
+ <tr class="form-field">
162
+ <td valign="top">Whitelist IP Addresses: </td>
163
+ <td>
164
+ <input type="text" name="<?php echo $whitelist_ips; ?>" value="<?php echo $prli_options->whitelist_ips; ?>">
165
+ <br/><span class="description">Enter IP Addresses or IP Ranges you want to always include in your Hit data and Stats even if they are flagged as robots. Each IP Address should be separated by commas. Example: <code>192.168.0.1, 192.168.2.1, 192.168.3.4 or 192.168.*.*</code></span>
166
+ </td>
167
+ </tr>
168
+ </table>
169
+ </td>
170
+ </tr>
171
+ </table>
172
+
173
+ <p class="submit">
174
+ <input type="submit" name="Submit" value="<?php _e('Update Options', $prli_domain ) ?>" />
175
+ </p>
176
+
177
+
178
+ <h3>Trim Hit Database</h3>
179
+
180
+ <p><a href="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI'] ); ?>&action=clear_30day_clicks" onclick="return confirm('***WARNING*** If you click OK you will delete ALL of the Hit data that is older than 30 days. Your data will be gone forever -- no way to retreive it. Do not click OK unless you are absolutely sure you want to delete this data because there is no going back!');">Delete Hits older than 30 days</a>
181
+ <br/><span class="description">This will clear all hits in your database that are older than 30 days.</span></p>
182
+
183
+ <p><a href="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI'] ); ?>&action=clear_90day_clicks" onclick="return confirm('***WARNING*** If you click OK you will delete ALL of the Hit data that is older than 90 days. Your data will be gone forever -- no way to retreive it. Do not click OK unless you are absolutely sure you want to delete this data because there is no going back!');">Delete Hits older than 90 days</a>
184
+ <br/><span class="description">This will clear all hits in your database that are older than 90 days.</span></p>
185
+
186
+ <p><a href="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI'] ); ?>&action=clear_all_clicks" onclick="return confirm('***WARNING*** If you click OK you will delete ALL of the Hit data in your Database. Your data will be gone forever -- no way to retreive it. Do not click OK unless you are absolutely sure you want to delete all your data because there is no going back!');">Delete All Hits</a>
187
+ <br/><span class="description">Seriously, only click this link if you want to delete all the Hit data in your database.</span></p>
188
+
189
+ </form>
190
+ </div>
classes/views/prli-options/head.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script type="text/javascript">
2
+ jQuery(document).ready(function() {
3
+ jQuery('.prettybar-expand').show();
4
+ jQuery('.prettybar-collapse').hide();
5
+ jQuery('.prettybar-toggle-pane').hide();
6
+ jQuery('.prettybar-toggle-button').click(function() {
7
+ jQuery('.prettybar-toggle-pane').toggle();
8
+ jQuery('.prettybar-expand').toggle();
9
+ jQuery('.prettybar-collapse').toggle();
10
+ });
11
+
12
+ jQuery('.reporting-expand').show();
13
+ jQuery('.reporting-collapse').hide();
14
+ jQuery('.reporting-toggle-pane').hide();
15
+ jQuery('.reporting-toggle-button').click(function() {
16
+ jQuery('.reporting-toggle-pane').toggle();
17
+ jQuery('.reporting-expand').toggle();
18
+ jQuery('.reporting-collapse').toggle();
19
+ });
20
+
21
+ jQuery('.link-expand').show();
22
+ jQuery('.link-collapse').hide();
23
+ jQuery('.link-toggle-pane').hide();
24
+ jQuery('.link-toggle-button').click(function() {
25
+ jQuery('.link-toggle-pane').toggle();
26
+ jQuery('.link-expand').toggle();
27
+ jQuery('.link-collapse').toggle();
28
+ });
29
+
30
+ if (jQuery('.filter-robots-checkbox').is(':checked')) {
31
+ jQuery('.whitelist-ips').show();
32
+ }
33
+ else {
34
+ jQuery('.whitelist-ips').hide();
35
+ }
36
+
37
+ jQuery('.filter-robots-checkbox').change(function() {
38
+ if (jQuery('.filter-robots-checkbox').is(':checked')) {
39
+ jQuery('.whitelist-ips').show();
40
+ }
41
+ else {
42
+ jQuery('.whitelist-ips').hide();
43
+ }
44
+ });
45
+ });
46
+ </script>
47
+
48
+ <style type="text/css">
49
+ .toggle {
50
+ cursor: pointer;
51
+ }
52
+ </style>
53
+
54
+ <?php do_action('prli-options-head'); ?>
classes/views/prli-options/pro-settings.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+ <div id="icon-options-general" class="icon32"><br /></div>
3
+ <h2 id="prli_title">Pretty Link: Pro Account Information</h2>
4
+ <?php $this_uri = preg_replace('#&.*?$#', '', str_replace( '%7E', '~', $_SERVER['REQUEST_URI'])); ?>
5
+ <h3>Pretty Link Pro Account Information</h3>
6
+ <?php if($prli_update->pro_is_installed_and_authorized()) { ?>
7
+ <p><a href="http://prettylinkpro.com/user-manual">User Manual</a></p>
8
+ <?php } ?>
9
+ <?php echo $prli_update->pro_cred_form(); ?>
10
+ <?php if($prli_update->pro_is_installed_and_authorized()) { ?>
11
+ <div><p><strong>Pretty Link Pro is Installed</strong></p><p><a href="<?php echo $this_uri; ?>&action=pro-uninstall" onclick="return confirm('Are you sure you want to Un-Install Pretty Link Pro? This will delete your pro username & password from your local database, remove all the pro software but will leave all your data intact incase you want to reinstall sometime :) ...');" title="Downgrade to Pretty Link Standard" >Downgrade to Pretty Link Standard</a></p><br/><p><strong>Edit/Update Your Profile:</strong><br/><span class="description">Use your account username and password to log in to your Account and Affiliate Control Panel</span></p><p><a href="http://prettylinkpro.com/amember/member.php">Account</a>&nbsp;|&nbsp;<a href="http://prettylinkpro.com/amember/aff_member.php">Affiliate Control Panel</a></div>
12
+
13
+ <?php } else { ?>
14
+ <p><strong>Ready to take your marketing efforts to the next level?</strong><br/>
15
+ <a href="http://prettylinkpro.com">Pretty Link Pro</a> will help you automate, share, test and get more clicks &amp; conversions from your Pretty Links!<br/><br/><a href="http://prettylinkpro.com">Learn More &raquo;</a></p>
16
+ <?php } ?>
17
+
18
+ </div>
classes/views/prli-tools/form.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+ <?php
3
+ require(PRLI_VIEWS_PATH.'/shared/nav.php');
4
+ ?>
5
+ <h2><img src="<?php echo PRLI_URL.'/images/pretty-link-med.png'; ?>"/>&nbsp;Pretty Link: Tools</h2>
6
+ <h3>Bookmarklet: </h3>
7
+ <p><strong><a href="javascript:location.href='<?php echo PRLI_URL; ?>/prli-bookmarklet.php?k=<?php echo $prli_options->bookmarklet_auth; ?>&target_url='+escape(location.href);">Get PrettyLink</a></strong><br/>
8
+ <span class="description">Just drag this "Get PrettyLink" link to your toolbar to install the bookmarklet. As you browse the web, you can just click this bookmarklet to create a pretty link from the current url you're looking at.&nbsp;&nbsp;<a href="http://blairwilliams.com/pretty-link-bookmarklet/">(more help)</a></span>
9
+ <p><strong>Note:</strong> iPhone users can install this bookmarklet in their Safari to create Pretty Links with the following steps:<br/>
10
+ <ol>
11
+ <li>Copy this text:<br/><code>javascript:location.href='<?php echo PRLI_URL; ?>/prli-bookmarklet.php?k=<?php echo $prli_options->bookmarklet_auth; ?>&target_url='+escape(location.href);</code></li>
12
+ <li>Tap the + button at the bottom of the screen</li>
13
+ <li>Choose "Add Bookmark", rename your bookmark to "Get PrettyLink" (or whatever you want) and then "Save"</li>
14
+ <li>Navigate through your Bookmarks folders until you find the new bookmark and click "Edit"</li>
15
+ <li>Delete all the text from the address</li>
16
+ <li>Paste the text you copied in Step 1 into the address field</li>
17
+ <li>To save the changes hit "Bookmarks" and <strong>you're done!</strong> Now when you find a page you want to save off as a Pretty Link, just click the "Bookmarks" icon at the bottom of the screen and select your link.</li>
18
+ </ol>
19
+ <?php do_action('prli-add-tools'); ?>
20
+ </div>
classes/views/shared/errors.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( $errors != null and count($errors) > 0 )
3
+ {
4
+ ?>
5
+ <div class="error">
6
+ <ul>
7
+ <?php
8
+ foreach( $errors as $error )
9
+ {
10
+ ?>
11
+ <li><strong>ERROR</strong>: <?php print $error; ?></li>
12
+ <?php
13
+ }
14
+ ?>
15
+ </ul>
16
+ </div>
17
+ <?php
18
+ }
19
+ ?>
classes/views/shared/link-table-nav.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Only show the pager bar if there is more than 1 page
3
+ if($page_count > 1)
4
+ {
5
+ ?>
6
+ <div class="tablenav"<?php echo (isset($navstyle)?" style=\"$navstyle\"":''); ?>>
7
+ <?php do_action('prli-link-list-actions', $footer); ?>
8
+ <div class='tablenav-pages'><span class="displaying-num">Displaying <?php print "$page_first_record&#8211;$page_last_record of $record_count"; ?></span>
9
+
10
+ <?php
11
+ // Only show the prev page button if the current page is not the first page
12
+ if($current_page > 1)
13
+ {
14
+ ?>
15
+ <a class='prev page-numbers' href='?page=<?php print PRLI_PLUGIN_NAME; ?>/<?php print $controller_file . $page_params; ?>&paged=<?php print($current_page-1); ?>'>&laquo;</a>
16
+ <?php
17
+ }
18
+
19
+ // First page is always displayed
20
+ if($current_page==1)
21
+ {
22
+ ?>
23
+ <span class='page-numbers current'>1</span>
24
+ <?php
25
+ }
26
+ else
27
+ {
28
+ ?>
29
+ <a class='page-numbers' href='?page=<?php print PRLI_PLUGIN_NAME; ?>/<?php print $controller_file . $page_params; ?>&paged=1'>1</a>
30
+ <?php
31
+ }
32
+
33
+ // If the current page is more than 2 spaces away from the first page then we put some dots in here
34
+ if($current_page >= 5)
35
+ {
36
+ ?>
37
+ <span class='page-numbers dots'>...</span>
38
+ <?php
39
+ }
40
+
41
+ // display the current page icon and the 2 pages beneath and above it
42
+ $low_page = (($current_page >= 5)?($current_page-2):2);
43
+ $high_page = ((($current_page + 2) < ($page_count-1))?($current_page+2):($page_count-1));
44
+ for($i = $low_page; $i <= $high_page; $i++)
45
+ {
46
+ if($current_page==$i)
47
+ {
48
+ ?>
49
+ <span class='page-numbers current'><?php print $i; ?></span>
50
+ <?php
51
+ }
52
+ else
53
+ {
54
+ ?>
55
+ <a class='page-numbers' href='?page=<?php print PRLI_PLUGIN_NAME; ?>/<?php print $controller_file . $page_params; ?>&paged=<?php print $i; ?>'><?php print $i; ?></a>
56
+ <?php
57
+ }
58
+ }
59
+
60
+ // If the current page is more than 2 away from the last page then show ellipsis
61
+ if($current_page < ($page_count - 3))
62
+ {
63
+ ?>
64
+ <span class='page-numbers dots'>...</span>
65
+ <?php
66
+ }
67
+
68
+ // Display the last page icon
69
+ if($current_page == $page_count)
70
+ {
71
+ ?>
72
+ <span class='page-numbers current'><?php print $page_count; ?></span>
73
+ <?php
74
+ }
75
+ else
76
+ {
77
+ ?>
78
+ <a class='page-numbers' href='?page=<?php print PRLI_PLUGIN_NAME; ?>/<?php print $controller_file . $page_params; ?>&paged=<?php print $page_count; ?>'><?php print $page_count; ?></a>
79
+ <?php
80
+ }
81
+
82
+ // Display the next page icon if there is a next page
83
+ if($current_page < $page_count)
84
+ {
85
+ ?>
86
+ <a class='next page-numbers' href='?page=<?php print PRLI_PLUGIN_NAME; ?>/<?php print $controller_file . $page_params; ?>&paged=<?php print($current_page + 1); ?>'>&raquo;</a>
87
+ <?php
88
+ }
89
+ ?>
90
+ </div>
91
+ </div>
92
+ <?php
93
+ }
94
+ else
95
+ {
96
+ ?>
97
+ <div class="tablenav"<?php echo (isset($navstyle)?" style=\"$navstyle\"":''); ?>>
98
+ <?php do_action('prli-link-list-actions', $footer); ?>
99
+ </div>
100
+ <?php
101
+ }
102
+ ?>
classes/views/shared/nav.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $prli_update;
3
+
4
+ if($prli_update->pro_is_installed_and_authorized())
5
+ {
6
+ $support_link =<<<SUPPORT_LINK
7
+ &nbsp;|&nbsp;<a href="http://prettylinkpro.com/user-manual">Pro Manual</a>&nbsp;|&nbsp;<a href="http://prettylinkpro.com/forum">Pro Forums</a>
8
+ SUPPORT_LINK;
9
+ }
10
+ else
11
+ {
12
+ $support_link =<<<SUPPORT_LINK
13
+ &nbsp;|&nbsp;<a href="http://prettylinkpro.com">Premium Support</a>
14
+ SUPPORT_LINK;
15
+ }
16
+
17
+ ?>
18
+ <p style="font-size: 14px; font-weight: bold; float: right; text-align: right; padding-top: 0px; padding-right: 10px;">Connect with Pretty Link:&nbsp;&nbsp;<a href="http://twitter.com/blairwilli"><img src="<?php echo PRLI_URL; ?>/images/twitter_32.png" style="width: 24px; height: 24px;" /></a>&nbsp;<a href="http://www.facebook.com/pages/Pretty-Link/283252860401"><img src="<?php echo PRLI_URL; ?>/images/facebook_32.png" style="width: 24px; height: 24px;" /></a><br/>Get Help:&nbsp;&nbsp;<a href="http://blairwilliams.com/xba" target="_blank">Tutorials (UPDATED!)</a><?php echo $support_link; ?>&nbsp;|&nbsp;<a href="http://blairwilliams.com/work">One on One</a></p>
classes/views/shared/table-nav.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Only show the pager bar if there is more than 1 page
3
+ if($page_count > 1)
4
+ {
5
+ ?>
6
+ <div class="tablenav"<?php echo (isset($navstyle)?" style=\"$navstyle\"":''); ?>>
7
+ <div class='tablenav-pages'><span class="displaying-num">Displaying <?php print "$page_first_record&#8211;$page_last_record of $record_count"; ?></span>
8
+
9
+ <?php
10
+ // Only show the prev page button if the current page is not the first page
11
+ if($current_page > 1)
12
+ {
13
+ ?>
14
+ <a class='prev page-numbers' href='?page=<?php print PRLI_PLUGIN_NAME; ?>/<?php print $controller_file . $page_params; ?>&paged=<?php print($current_page-1); ?>'>&laquo;</a>
15
+ <?php
16
+ }
17
+
18
+ // First page is always displayed
19
+ if($current_page==1)
20
+ {
21
+ ?>
22
+ <span class='page-numbers current'>1</span>
23
+ <?php
24
+ }
25
+ else
26
+ {
27
+ ?>
28
+ <a class='page-numbers' href='?page=<?php print PRLI_PLUGIN_NAME; ?>/<?php print $controller_file . $page_params; ?>&paged=1'>1</a>
29
+ <?php
30
+ }
31
+
32
+ // If the current page is more than 2 spaces away from the first page then we put some dots in here
33
+ if($current_page >= 5)
34
+ {
35
+ ?>
36
+ <span class='page-numbers dots'>...</span>
37
+ <?php
38
+ }
39
+
40
+ // display the current page icon and the 2 pages beneath and above it
41
+ $low_page = (($current_page >= 5)?($current_page-2):2);
42
+ $high_page = ((($current_page + 2) < ($page_count-1))?($current_page+2):($page_count-1));
43
+ for($i = $low_page; $i <= $high_page; $i++)
44
+ {
45
+ if($current_page==$i)
46
+ {
47
+ ?>
48
+ <span class='page-numbers current'><?php print $i; ?></span>
49
+ <?php
50
+ }
51
+ else
52
+ {
53
+ ?>
54
+ <a class='page-numbers' href='?page=<?php print PRLI_PLUGIN_NAME; ?>/<?php print $controller_file . $page_params; ?>&paged=<?php print $i; ?>'><?php print $i; ?></a>
55
+ <?php
56
+ }
57
+ }
58
+
59
+ // If the current page is more than 2 away from the last page then show ellipsis
60
+ if($current_page < ($page_count - 3))
61
+ {
62
+ ?>
63
+ <span class='page-numbers dots'>...</span>
64
+ <?php
65
+ }
66
+
67
+ // Display the last page icon
68
+ if($current_page == $page_count)
69
+ {
70
+ ?>
71
+ <span class='page-numbers current'><?php print $page_count; ?></span>
72
+ <?php
73
+ }
74
+ else
75
+ {
76
+ ?>
77
+ <a class='page-numbers' href='?page=<?php print PRLI_PLUGIN_NAME; ?>/<?php print $controller_file . $page_params; ?>&paged=<?php print $page_count; ?>'><?php print $page_count; ?></a>
78
+ <?php
79
+ }
80
+
81
+ // Display the next page icon if there is a next page
82
+ if($current_page < $page_count)
83
+ {
84
+ ?>
85
+ <a class='next page-numbers' href='?page=<?php print PRLI_PLUGIN_NAME; ?>/<?php print $controller_file . $page_params; ?>&paged=<?php print($current_page + 1); ?>'>&raquo;</a>
86
+ <?php
87
+ }
88
+ ?>
89
+ </div>
90
+ </div>
91
+ <?php
92
+ }
93
+ ?>
images/arrow_down.png ADDED
Binary file
images/arrow_up.png ADDED
Binary file
images/bar_background.png ADDED
Binary file
images/bar_map.png ADDED
Binary file
images/bookmark.png ADDED
Binary file
images/co.mments.gif ADDED
Binary file
images/delicious_32.png ADDED
Binary file
images/digg_32.png ADDED
Binary file
images/email_32.png ADDED
Binary file
images/facebook.png ADDED
Binary file
images/facebook_32.png ADDED
Binary file
images/forward_params.png ADDED
Binary file
images/hyves_32.png ADDED
Binary file
images/linkedin_32.png ADDED
Binary file
images/mixx_32.png ADDED
Binary file
images/newsvine_32.png ADDED
Binary file
images/nofollow.png ADDED
Binary file
images/not_tracking.png ADDED
Binary file
images/pixel_track.png ADDED
Binary file
images/pretty-link-48x48.png ADDED
Binary file
images/pretty-link-add.png ADDED
Binary file
images/pretty-link-med.png ADDED
Binary file
images/pretty-link-small.png ADDED
Binary file
images/prettylink_logo.jpg ADDED
Binary file
images/prettylink_logo_med.jpg ADDED
Binary file
images/prettylink_logo_small.jpg ADDED
Binary file
images/reddit_32.png ADDED
Binary file
images/sphinn_32.png ADDED
Binary file
images/stumbleupon_32.png ADDED
Binary file
images/technorati_32.png ADDED
Binary file
images/tracking.png ADDED
Binary file
images/twitter.png ADDED
Binary file
images/twitter_32.png ADDED
Binary file
images/ultra-cloak.png ADDED
Binary file
images/url_icon.gif ADDED
Binary file
images/whatever.txt ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ wget http://speckyboy.com/wp-content/plugins/sociable/images/delicious_32.png
2
+ wget http://speckyboy.com/wp-content/plugins/sociable/images/stumbleupon_32.png
3
+ wget http://speckyboy.com/wp-content/plugins/sociable/images/digg_32.png
4
+ wget http://speckyboy.com/wp-content/plugins/sociable/images/twitter_32.png
5
+ wget http://speckyboy.com/wp-content/plugins/sociable/images/mixx_32.png
6
+ wget http://speckyboy.com/wp-content/plugins/sociable/images/technorati_32.png
7
+ wget http://speckyboy.com/wp-content/plugins/sociable/images/facebook_32.png
8
+ wget http://speckyboy.com/wp-content/plugins/sociable/images/newsvine_32.png
9
+ wget http://speckyboy.com/wp-content/plugins/sociable/images/reddit_32.png
10
+ wget http://speckyboy.com/wp-content/plugins/sociable/images/linkedin_32.png
11
+ wget http://speckyboy.com/wp-content/plugins/sociable/images/co.mments.gif
12
+ wget http://speckyboy.com/wp-content/plugins/sociable/images/yahoobuzz_32.png
13
+ wget http://speckyboy.com/wp-content/plugins/sociable/images/email_32.png
images/yahoobuzz_32.png ADDED
Binary file
includes/jquery/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png ADDED
Binary file
includes/jquery/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png ADDED
Binary file
includes/jquery/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png ADDED
Binary file
includes/jquery/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png ADDED
Binary file
includes/jquery/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png ADDED
Binary file
includes/jquery/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png ADDED
Binary file
includes/jquery/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png ADDED
Binary file
includes/jquery/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png ADDED
Binary file
includes/jquery/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png ADDED
Binary file
includes/jquery/css/ui-lightness/images/ui-icons_222222_256x240.png ADDED
Binary file
includes/jquery/css/ui-lightness/images/ui-icons_228ef1_256x240.png ADDED
Binary file
includes/jquery/css/ui-lightness/images/ui-icons_ef8c08_256x240.png ADDED
Binary file
includes/jquery/css/ui-lightness/images/ui-icons_ffd27a_256x240.png ADDED
Binary file
includes/jquery/css/ui-lightness/images/ui-icons_ffffff_256x240.png ADDED
Binary file
includes/jquery/css/ui-lightness/jquery-ui-1.7.1.custom.css ADDED
@@ -0,0 +1,404 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery UI CSS Framework
3
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
4
+ * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
5
+ */
6
+
7
+ /* Layout helpers
8
+ ----------------------------------*/
9
+ .ui-helper-hidden { display: none; }
10
+ .ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
11
+ .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
12
+ .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
13
+ .ui-helper-clearfix { display: inline-block; }
14
+ /* required comment for clearfix to work in Opera \*/
15
+ * html .ui-helper-clearfix { height:1%; }
16
+ .ui-helper-clearfix { display:block; }
17
+ /* end clearfix */
18
+ .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
19
+
20
+
21
+ /* Interaction Cues
22
+ ----------------------------------*/
23
+ .ui-state-disabled { cursor: default !important; }
24
+
25
+
26
+ /* Icons
27
+ ----------------------------------*/
28
+
29
+ /* states and images */
30
+ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
31
+
32
+
33
+ /* Misc visuals
34
+ ----------------------------------*/
35
+
36
+ /* Overlays */
37
+ .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
38
+
39
+ /*
40
+ * jQuery UI CSS Framework
41
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
42
+ * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
43
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px
44
+ */
45
+
46
+
47
+ /* Component containers
48
+ ----------------------------------*/
49
+ .ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; }
50
+ .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; }
51
+ .ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; }
52
+ .ui-widget-content a { color: #333333; }
53
+ .ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
54
+ .ui-widget-header a { color: #ffffff; }
55
+
56
+ /* Interaction states
57
+ ----------------------------------*/
58
+ .ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; outline: none; }
59
+ .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; outline: none; }
60
+ .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; outline: none; }
61
+ .ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; outline: none; }
62
+ .ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; outline: none; }
63
+ .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; outline: none; text-decoration: none; }
64
+
65
+ /* Interaction Cues
66
+ ----------------------------------*/
67
+ .ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; }
68
+ .ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; }
69
+ .ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; }
70
+ .ui-state-error a, .ui-widget-content .ui-state-error a { color: #ffffff; }
71
+ .ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #ffffff; }
72
+ .ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
73
+ .ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; }
74
+ .ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
75
+
76
+ /* Icons
77
+ ----------------------------------*/
78
+
79
+ /* states and images */
80
+ .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
81
+ .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
82
+ .ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); }
83
+ .ui-state-default .ui-icon { background-image: url(images/ui-icons_ef8c08_256x240.png); }
84
+ .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); }
85
+ .ui-state-active .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); }
86
+ .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_228ef1_256x240.png); }
87
+ .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); }
88
+
89
+ /* positioning */
90
+ .ui-icon-carat-1-n { background-position: 0 0; }
91
+ .ui-icon-carat-1-ne { background-position: -16px 0; }
92
+ .ui-icon-carat-1-e { background-position: -32px 0; }
93
+ .ui-icon-carat-1-se { background-position: -48px 0; }
94
+ .ui-icon-carat-1-s { background-position: -64px 0; }
95
+ .ui-icon-carat-1-sw { background-position: -80px 0; }
96
+ .ui-icon-carat-1-w { background-position: -96px 0; }
97
+ .ui-icon-carat-1-nw { background-position: -112px 0; }
98
+ .ui-icon-carat-2-n-s { background-position: -128px 0; }
99
+ .ui-icon-carat-2-e-w { background-position: -144px 0; }
100
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
101
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
102
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
103
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
104
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
105
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
106
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
107
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
108
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
109
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
110
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
111
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
112
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
113
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
114
+ .ui-icon-arrow-1-s { background-position: -64px -32px; }
115
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
116
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
117
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
118
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
119
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
120
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
121
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
122
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
123
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
124
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
125
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
126
+ .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
127
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
128
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
129
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
130
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
131
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
132
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
133
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
134
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
135
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
136
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
137
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
138
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
139
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
140
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
141
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
142
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
143
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
144
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
145
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
146
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
147
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
148
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
149
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
150
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
151
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
152
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
153
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
154
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
155
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
156
+ .ui-icon-extlink { background-position: -32px -80px; }
157
+ .ui-icon-newwin { background-position: -48px -80px; }
158
+ .ui-icon-refresh { background-position: -64px -80px; }
159
+ .ui-icon-shuffle { background-position: -80px -80px; }
160
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
161
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
162
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
163
+ .ui-icon-folder-open { background-position: -16px -96px; }
164
+ .ui-icon-document { background-position: -32px -96px; }
165
+ .ui-icon-document-b { background-position: -48px -96px; }
166
+ .ui-icon-note { background-position: -64px -96px; }
167
+ .ui-icon-mail-closed { background-position: -80px -96px; }
168
+ .ui-icon-mail-open { background-position: -96px -96px; }
169
+ .ui-icon-suitcase { background-position: -112px -96px; }
170
+ .ui-icon-comment { background-position: -128px -96px; }
171
+ .ui-icon-person { background-position: -144px -96px; }
172
+ .ui-icon-print { background-position: -160px -96px; }
173
+ .ui-icon-trash { background-position: -176px -96px; }
174
+ .ui-icon-locked { background-position: -192px -96px; }
175
+ .ui-icon-unlocked { background-position: -208px -96px; }
176
+ .ui-icon-bookmark { background-position: -224px -96px; }
177
+ .ui-icon-tag { background-position: -240px -96px; }
178
+ .ui-icon-home { background-position: 0 -112px; }
179
+ .ui-icon-flag { background-position: -16px -112px; }
180
+ .ui-icon-calendar { background-position: -32px -112px; }
181
+ .ui-icon-cart { background-position: -48px -112px; }
182
+ .ui-icon-pencil { background-position: -64px -112px; }
183
+ .ui-icon-clock { background-position: -80px -112px; }
184
+ .ui-icon-disk { background-position: -96px -112px; }
185
+ .ui-icon-calculator { background-position: -112px -112px; }
186
+ .ui-icon-zoomin { background-position: -128px -112px; }
187
+ .ui-icon-zoomout { background-position: -144px -112px; }
188
+ .ui-icon-search { background-position: -160px -112px; }
189
+ .ui-icon-wrench { background-position: -176px -112px; }
190
+ .ui-icon-gear { background-position: -192px -112px; }
191
+ .ui-icon-heart { background-position: -208px -112px; }
192
+ .ui-icon-star { background-position: -224px -112px; }
193
+ .ui-icon-link { background-position: -240px -112px; }
194
+ .ui-icon-cancel { background-position: 0 -128px; }
195
+ .ui-icon-plus { background-position: -16px -128px; }
196
+ .ui-icon-plusthick { background-position: -32px -128px; }
197
+ .ui-icon-minus { background-position: -48px -128px; }
198
+ .ui-icon-minusthick { background-position: -64px -128px; }
199
+ .ui-icon-close { background-position: -80px -128px; }
200
+ .ui-icon-closethick { background-position: -96px -128px; }
201
+ .ui-icon-key { background-position: -112px -128px; }
202
+ .ui-icon-lightbulb { background-position: -128px -128px; }
203
+ .ui-icon-scissors { background-position: -144px -128px; }
204
+ .ui-icon-clipboard { background-position: -160px -128px; }
205
+ .ui-icon-copy { background-position: -176px -128px; }
206
+ .ui-icon-contact { background-position: -192px -128px; }
207
+ .ui-icon-image { background-position: -208px -128px; }
208
+ .ui-icon-video { background-position: -224px -128px; }
209
+ .ui-icon-script { background-position: -240px -128px; }
210
+ .ui-icon-alert { background-position: 0 -144px; }
211
+ .ui-icon-info { background-position: -16px -144px; }
212
+ .ui-icon-notice { background-position: -32px -144px; }
213
+ .ui-icon-help { background-position: -48px -144px; }
214
+ .ui-icon-check { background-position: -64px -144px; }
215
+ .ui-icon-bullet { background-position: -80px -144px; }
216
+ .ui-icon-radio-off { background-position: -96px -144px; }
217
+ .ui-icon-radio-on { background-position: -112px -144px; }
218
+ .ui-icon-pin-w { background-position: -128px -144px; }
219
+ .ui-icon-pin-s { background-position: -144px -144px; }
220
+ .ui-icon-play { background-position: 0 -160px; }
221
+ .ui-icon-pause { background-position: -16px -160px; }
222
+ .ui-icon-seek-next { background-position: -32px -160px; }
223
+ .ui-icon-seek-prev { background-position: -48px -160px; }
224
+ .ui-icon-seek-end { background-position: -64px -160px; }
225
+ .ui-icon-seek-first { background-position: -80px -160px; }
226
+ .ui-icon-stop { background-position: -96px -160px; }
227
+ .ui-icon-eject { background-position: -112px -160px; }
228
+ .ui-icon-volume-off { background-position: -128px -160px; }
229
+ .ui-icon-volume-on { background-position: -144px -160px; }
230
+ .ui-icon-power { background-position: 0 -176px; }
231
+ .ui-icon-signal-diag { background-position: -16px -176px; }
232
+ .ui-icon-signal { background-position: -32px -176px; }
233
+ .ui-icon-battery-0 { background-position: -48px -176px; }
234
+ .ui-icon-battery-1 { background-position: -64px -176px; }
235
+ .ui-icon-battery-2 { background-position: -80px -176px; }
236
+ .ui-icon-battery-3 { background-position: -96px -176px; }
237
+ .ui-icon-circle-plus { background-position: 0 -192px; }
238
+ .ui-icon-circle-minus { background-position: -16px -192px; }
239
+ .ui-icon-circle-close { background-position: -32px -192px; }
240
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
241
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
242
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
243
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
244
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
245
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
246
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
247
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
248
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
249
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
250
+ .ui-icon-circle-check { background-position: -208px -192px; }
251
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
252
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
253
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
254
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
255
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
256
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
257
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
258
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
259
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
260
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
261
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
262
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
263
+
264
+
265
+ /* Misc visuals
266
+ ----------------------------------*/
267
+
268
+ /* Corner radius */
269
+ .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; }
270
+ .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; }
271
+ .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; }
272
+ .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
273
+ .ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; }
274
+ .ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
275
+ .ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
276
+ .ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; }
277
+ .ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; }
278
+
279
+ /* Overlays */
280
+ .ui-widget-overlay { background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); }
281
+ .ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; }/* Accordion
282
+ ----------------------------------*/
283
+ .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
284
+ .ui-accordion .ui-accordion-li-fix { display: inline; }
285
+ .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
286
+ .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; }
287
+ .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
288
+ .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; }
289
+ .ui-accordion .ui-accordion-content-active { display: block; }/* Datepicker
290
+ ----------------------------------*/
291
+ .ui-datepicker { width: 17em; padding: .2em .2em 0; }
292
+ .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
293
+ .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
294
+ .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
295
+ .ui-datepicker .ui-datepicker-prev { left:2px; }
296
+ .ui-datepicker .ui-datepicker-next { right:2px; }
297
+ .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
298
+ .ui-datepicker .ui-datepicker-next-hover { right:1px; }
299
+ .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
300
+ .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
301
+ .ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; }
302
+ .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
303
+ .ui-datepicker select.ui-datepicker-month,
304
+ .ui-datepicker select.ui-datepicker-year { width: 49%;}
305
+ .ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; }
306
+ .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
307
+ .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
308
+ .ui-datepicker td { border: 0; padding: 1px; }
309
+ .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
310
+ .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
311
+ .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
312
+ .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
313
+
314
+ /* with multiple calendars */
315
+ .ui-datepicker.ui-datepicker-multi { width:auto; }
316
+ .ui-datepicker-multi .ui-datepicker-group { float:left; }
317
+ .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
318
+ .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
319
+ .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
320
+ .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
321
+ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
322
+ .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
323
+ .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
324
+ .ui-datepicker-row-break { clear:both; width:100%; }
325
+
326
+ /* RTL support */
327
+ .ui-datepicker-rtl { direction: rtl; }
328
+ .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
329
+ .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
330
+ .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
331
+ .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
332
+ .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
333
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
334
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
335
+ .ui-datepicker-rtl .ui-datepicker-group { float:right; }
336
+ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
337
+ .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
338
+
339
+ /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
340
+ .ui-datepicker-cover {
341
+ display: none; /*sorry for IE5*/
342
+ display/**/: block; /*sorry for IE5*/
343
+ position: absolute; /*must have*/
344
+ z-index: -1; /*must have*/
345
+ filter: mask(); /*must have*/
346
+ top: -4px; /*must have*/
347
+ left: -4px; /*must have*/
348
+ width: 200px; /*must have*/
349
+ height: 200px; /*must have*/
350
+ }/* Dialog
351
+ ----------------------------------*/
352
+ .ui-dialog { position: relative; padding: .2em; width: 300px; }
353
+ .ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; }
354
+ .ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; }
355
+ .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
356
+ .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
357
+ .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
358
+ .ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
359
+ .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
360
+ .ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; }
361
+ .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
362
+ .ui-draggable .ui-dialog-titlebar { cursor: move; }
363
+ /* Progressbar
364
+ ----------------------------------*/
365
+ .ui-progressbar { height:2em; text-align: left; }
366
+ .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/* Resizable
367
+ ----------------------------------*/
368
+ .ui-resizable { position: relative;}
369
+ .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
370
+ .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
371
+ .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; }
372
+ .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; }
373
+ .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; }
374
+ .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; }
375
+ .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
376
+ .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
377
+ .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
378
+ .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Slider
379
+ ----------------------------------*/
380
+ .ui-slider { position: relative; text-align: left; }
381
+ .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
382
+ .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; }
383
+
384
+ .ui-slider-horizontal { height: .8em; }
385
+ .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
386
+ .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
387
+ .ui-slider-horizontal .ui-slider-range-min { left: 0; }
388
+ .ui-slider-horizontal .ui-slider-range-max { right: 0; }
389
+
390
+ .ui-slider-vertical { width: .8em; height: 100px; }
391
+ .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
392
+ .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
393
+ .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
394
+ .ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs
395
+ ----------------------------------*/
396
+ .ui-tabs { padding: .2em; zoom: 1; }
397
+ .ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; }
398
+ .ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; }
399
+ .ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; }
400
+ .ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; }
401
+ .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
402
+ .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
403
+ .ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; }
404
+ .ui-tabs .ui-tabs-hide { display: none !important; }
includes/jquery/js/jquery-1.3.2.min.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery JavaScript Library v1.3.2
3
+ * http://jquery.com/
4
+ *
5
+ * Copyright (c) 2009 John Resig
6
+ * Dual licensed under the MIT and GPL licenses.
7
+ * http://docs.jquery.com/License
8
+ *
9
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
10
+ * Revision: 6246
11
+ */
12
+ (function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
13
+ /*
14
+ * Sizzle CSS Selector Engine - v0.9.3
15
+ * Copyright 2009, The Dojo Foundation
16
+ * Released under the MIT, BSD, and GPL Licenses.
17
+ * More information: http://sizzlejs.com/
18
+ */
19
+ (function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();
includes/jquery/js/jquery-ui-1.7.1.custom.min.js ADDED
@@ -0,0 +1,273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery UI 1.7.1
3
+ *
4
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
6
+ * and GPL (GPL-LICENSE.txt) licenses.
7
+ *
8
+ * http://docs.jquery.com/UI
9
+ */
10
+ * jQuery UI Draggable 1.7.1
11
+ *
12
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
13
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
14
+ * and GPL (GPL-LICENSE.txt) licenses.
15
+ *
16
+ * http://docs.jquery.com/UI/Draggables
17
+ *
18
+ * Depends:
19
+ * ui.core.js
20
+ */
21
+ * jQuery UI Droppable 1.7.1
22
+ *
23
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
24
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
25
+ * and GPL (GPL-LICENSE.txt) licenses.
26
+ *
27
+ * http://docs.jquery.com/UI/Droppables
28
+ *
29
+ * Depends:
30
+ * ui.core.js
31
+ * ui.draggable.js
32
+ */
33
+ * jQuery UI Resizable 1.7.1
34
+ *
35
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
36
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
37
+ * and GPL (GPL-LICENSE.txt) licenses.
38
+ *
39
+ * http://docs.jquery.com/UI/Resizables
40
+ *
41
+ * Depends:
42
+ * ui.core.js
43
+ */
44
+ * jQuery UI Selectable 1.7.1
45
+ *
46
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
47
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
48
+ * and GPL (GPL-LICENSE.txt) licenses.
49
+ *
50
+ * http://docs.jquery.com/UI/Selectables
51
+ *
52
+ * Depends:
53
+ * ui.core.js
54
+ */
55
+ * jQuery UI Sortable 1.7.1
56
+ *
57
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
58
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
59
+ * and GPL (GPL-LICENSE.txt) licenses.
60
+ *
61
+ * http://docs.jquery.com/UI/Sortables
62
+ *
63
+ * Depends:
64
+ * ui.core.js
65
+ */
66
+ * jQuery UI Accordion 1.7.1
67
+ *
68
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
69
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
70
+ * and GPL (GPL-LICENSE.txt) licenses.
71
+ *
72
+ * http://docs.jquery.com/UI/Accordion
73
+ *
74
+ * Depends:
75
+ * ui.core.js
76
+ */
77
+ * jQuery UI Dialog 1.7.1
78
+ *
79
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
80
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
81
+ * and GPL (GPL-LICENSE.txt) licenses.
82
+ *
83
+ * http://docs.jquery.com/UI/Dialog
84
+ *
85
+ * Depends:
86
+ * ui.core.js
87
+ * ui.draggable.js
88
+ * ui.resizable.js
89
+ */
90
+ * jQuery UI Slider 1.7.1
91
+ *
92
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
93
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
94
+ * and GPL (GPL-LICENSE.txt) licenses.
95
+ *
96
+ * http://docs.jquery.com/UI/Slider
97
+ *
98
+ * Depends:
99
+ * ui.core.js
100
+ */
101
+ * jQuery UI Tabs 1.7.1
102
+ *
103
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
104
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
105
+ * and GPL (GPL-LICENSE.txt) licenses.
106
+ *
107
+ * http://docs.jquery.com/UI/Tabs
108
+ *
109
+ * Depends:
110
+ * ui.core.js
111
+ */
112
+ * jQuery UI Datepicker 1.7.1
113
+ *
114
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
115
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
116
+ * and GPL (GPL-LICENSE.txt) licenses.
117
+ *
118
+ * http://docs.jquery.com/UI/Datepicker
119
+ *
120
+ * Depends:
121
+ * ui.core.js
122
+ */
123
+ * jQuery UI Progressbar 1.7.1
124
+ *
125
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
126
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
127
+ * and GPL (GPL-LICENSE.txt) licenses.
128
+ *
129
+ * http://docs.jquery.com/UI/Progressbar
130
+ *
131
+ * Depends:
132
+ * ui.core.js
133
+ */
134
+ * jQuery UI Effects 1.7.1
135
+ *
136
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
137
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
138
+ * and GPL (GPL-LICENSE.txt) licenses.
139
+ *
140
+ * http://docs.jquery.com/UI/Effects/
141
+ */
142
+ * jQuery UI Effects Blind 1.7.1
143
+ *
144
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
145
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
146
+ * and GPL (GPL-LICENSE.txt) licenses.
147
+ *
148
+ * http://docs.jquery.com/UI/Effects/Blind
149
+ *
150
+ * Depends:
151
+ * effects.core.js
152
+ */
153
+ * jQuery UI Effects Bounce 1.7.1
154
+ *
155
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
156
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
157
+ * and GPL (GPL-LICENSE.txt) licenses.
158
+ *
159
+ * http://docs.jquery.com/UI/Effects/Bounce
160
+ *
161
+ * Depends:
162
+ * effects.core.js
163
+ */
164
+ * jQuery UI Effects Clip 1.7.1
165
+ *
166
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
167
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
168
+ * and GPL (GPL-LICENSE.txt) licenses.
169
+ *
170
+ * http://docs.jquery.com/UI/Effects/Clip
171
+ *
172
+ * Depends:
173
+ * effects.core.js
174
+ */
175
+ * jQuery UI Effects Drop 1.7.1
176
+ *
177
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
178
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
179
+ * and GPL (GPL-LICENSE.txt) licenses.
180
+ *
181
+ * http://docs.jquery.com/UI/Effects/Drop
182
+ *
183
+ * Depends:
184
+ * effects.core.js
185
+ */
186
+ * jQuery UI Effects Explode 1.7.1
187
+ *
188
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
189
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
190
+ * and GPL (GPL-LICENSE.txt) licenses.
191
+ *
192
+ * http://docs.jquery.com/UI/Effects/Explode
193
+ *
194
+ * Depends:
195
+ * effects.core.js
196
+ */
197
+ * jQuery UI Effects Fold 1.7.1
198
+ *
199
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
200
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
201
+ * and GPL (GPL-LICENSE.txt) licenses.
202
+ *
203
+ * http://docs.jquery.com/UI/Effects/Fold
204
+ *
205
+ * Depends:
206
+ * effects.core.js
207
+ */
208
+ * jQuery UI Effects Highlight 1.7.1
209
+ *
210
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
211
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
212
+ * and GPL (GPL-LICENSE.txt) licenses.
213
+ *
214
+ * http://docs.jquery.com/UI/Effects/Highlight
215
+ *
216
+ * Depends:
217
+ * effects.core.js
218
+ */
219
+ * jQuery UI Effects Pulsate 1.7.1
220
+ *
221
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
222
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
223
+ * and GPL (GPL-LICENSE.txt) licenses.
224
+ *
225
+ * http://docs.jquery.com/UI/Effects/Pulsate
226
+ *
227
+ * Depends:
228
+ * effects.core.js
229
+ */
230
+ * jQuery UI Effects Scale 1.7.1
231
+ *
232
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
233
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
234
+ * and GPL (GPL-LICENSE.txt) licenses.
235
+ *
236
+ * http://docs.jquery.com/UI/Effects/Scale
237
+ *
238
+ * Depends:
239
+ * effects.core.js
240
+ */
241
+ * jQuery UI Effects Shake 1.7.1
242
+ *
243
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
244
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
245
+ * and GPL (GPL-LICENSE.txt) licenses.
246
+ *
247
+ * http://docs.jquery.com/UI/Effects/Shake
248
+ *
249
+ * Depends:
250
+ * effects.core.js
251
+ */
252
+ * jQuery UI Effects Slide 1.7.1
253
+ *
254
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
255
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
256
+ * and GPL (GPL-LICENSE.txt) licenses.
257
+ *
258
+ * http://docs.jquery.com/UI/Effects/Slide
259
+ *
260
+ * Depends:
261
+ * effects.core.js
262
+ */
263
+ * jQuery UI Effects Transfer 1.7.1
264
+ *
265
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
266
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
267
+ * and GPL (GPL-LICENSE.txt) licenses.
268
+ *
269
+ * http://docs.jquery.com/UI/Effects/Transfer
270
+ *
271
+ * Depends:
272
+ * effects.core.js
273
+ */
includes/php/php_browsecap.ini ADDED
@@ -0,0 +1,17350 @@