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

Version Description

Download this release

Release Info

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

Code changes from version 1.4.56 to 1.4.6

Files changed (314) hide show
  1. classes/models/PrliClick.php +29 -102
  2. classes/models/PrliGroup.php +5 -13
  3. classes/models/PrliLink.php +112 -259
  4. classes/models/PrliLinkMeta.php +2 -3
  5. classes/models/PrliUtils.php +293 -570
  6. classes/models/models.inc.php +0 -55
  7. classes/views/prli-clicks/csv.php +4 -3
  8. classes/views/prli-clicks/list.php +15 -33
  9. classes/views/prli-dashboard-widget/widget.php +3 -3
  10. classes/views/prli-groups/edit.php +1 -1
  11. classes/views/prli-groups/list.php +8 -5
  12. classes/views/prli-groups/new.php +1 -1
  13. classes/views/prli-links/bar.php +0 -1
  14. classes/views/prli-links/edit.php +1 -1
  15. classes/views/prli-links/form.php +62 -46
  16. classes/views/prli-links/head.php +1 -1
  17. classes/views/prli-links/list.php +48 -58
  18. classes/views/prli-links/new.php +1 -1
  19. classes/views/prli-links/ultra-cloak.php +0 -1
  20. classes/views/prli-options/form.php +126 -61
  21. classes/views/prli-options/head.php +8 -19
  22. classes/views/prli-options/pro-settings.php +31 -6
  23. classes/views/shared/errors.php +1 -1
  24. classes/views/shared/nav.php +1 -9
  25. images/arrow_down.png +0 -0
  26. images/arrow_up.png +0 -0
  27. images/bar_background.png +0 -0
  28. images/bar_map.png +0 -0
  29. images/bookmark.png +0 -0
  30. images/browser/abilon.png +0 -0
  31. images/browser/adobe.png +0 -0
  32. images/browser/akregator.png +0 -0
  33. images/browser/alcatel.png +0 -0
  34. images/browser/amaya.png +0 -0
  35. images/browser/amigavoyager.png +0 -0
  36. images/browser/analogx.png +0 -0
  37. images/browser/apt.png +0 -0
  38. images/browser/avant.png +0 -0
  39. images/browser/aweb.png +0 -0
  40. images/browser/bpftp.png +0 -0
  41. images/browser/bytel.png +0 -0
  42. images/browser/chimera.png +0 -0
  43. images/browser/chrome.png +0 -0
  44. images/browser/cyberdog.png +0 -0
  45. images/browser/da.png +0 -0
  46. images/browser/dillo.png +0 -0
  47. images/browser/doris.png +0 -0
  48. images/browser/dreamcast.png +0 -0
  49. images/browser/ecatch.png +0 -0
  50. images/browser/encompass.png +0 -0
  51. images/browser/epiphany.png +0 -0
  52. images/browser/ericsson.png +0 -0
  53. images/browser/feeddemon.png +0 -0
  54. images/browser/feedreader.png +0 -0
  55. images/browser/firefox.png +0 -0
  56. images/browser/flashget.png +0 -0
  57. images/browser/fpexpress.png +0 -0
  58. images/browser/fresco.png +0 -0
  59. images/browser/freshdownload.png +0 -0
  60. images/browser/frontpage.png +0 -0
  61. images/browser/galeon.png +0 -0
  62. images/browser/getright.png +0 -0
  63. images/browser/gnome.png +0 -0
  64. images/browser/gnus.png +0 -0
  65. images/browser/gozilla.png +0 -0
  66. images/browser/hotjava.png +0 -0
  67. images/browser/httrack.png +0 -0
  68. images/browser/ibrowse.png +0 -0
  69. images/browser/icab.png +0 -0
  70. images/browser/java.png +0 -0
  71. images/browser/jetbrains_omea.png +0 -0
  72. images/browser/kmeleon.png +0 -0
  73. images/browser/konqueror.png +0 -0
  74. images/browser/leechget.png +0 -0
  75. images/browser/lg.png +0 -0
  76. images/browser/lotusnotes.png +0 -0
  77. images/browser/lynx.png +0 -0
  78. images/browser/macweb.png +0 -0
  79. images/browser/mediaplayer.png +0 -0
  80. images/browser/motorola.png +0 -0
  81. images/browser/mozilla.png +0 -0
  82. images/browser/mplayer.png +0 -0
  83. images/browser/msie.png +0 -0
  84. images/browser/msie_large.png +0 -0
  85. images/browser/multizilla.png +0 -0
  86. images/browser/ncsa_mosaic.png +0 -0
  87. images/browser/neon.png +0 -0
  88. images/browser/netnewswire.png +0 -0
  89. images/browser/netpositive.png +0 -0
  90. images/browser/netscape.png +0 -0
  91. images/browser/netscape_large.png +0 -0
  92. images/browser/netshow.png +0 -0
  93. images/browser/newsfire.png +0 -0
  94. images/browser/newsgator.png +0 -0
  95. images/browser/newzcrawler.png +0 -0
  96. images/browser/nokia.png +0 -0
  97. images/browser/notavailable.png +0 -0
  98. images/browser/omniweb.png +0 -0
  99. images/browser/opera.png +0 -0
  100. images/browser/panasonic.png +0 -0
  101. images/browser/pdaphone.png +0 -0
  102. images/browser/philips.png +0 -0
  103. images/browser/phoenix.png +0 -0
  104. images/browser/pluck.png +0 -0
  105. images/browser/pulpfiction.png +0 -0
  106. images/browser/real.png +0 -0
  107. images/browser/rss.png +0 -0
  108. images/browser/rssbandit.png +0 -0
  109. images/browser/rssowl.png +0 -0
  110. images/browser/rssreader.png +0 -0
  111. images/browser/rssxpress.png +0 -0
  112. images/browser/safari.png +0 -0
  113. images/browser/sagem.png +0 -0
  114. images/browser/samsung.png +0 -0
  115. images/browser/sharp.png +0 -0
  116. images/browser/sharpreader.png +0 -0
  117. images/browser/shrook.png +0 -0
  118. images/browser/siemens.png +0 -0
  119. images/browser/sony.png +0 -0
  120. images/browser/staroffice.png +0 -0
  121. images/browser/subversion.png +0 -0
  122. images/browser/teleport.png +0 -0
  123. images/browser/trium.png +0 -0
  124. images/browser/unknown.png +0 -0
  125. images/browser/w3c.png +0 -0
  126. images/browser/webcopier.png +0 -0
  127. images/browser/webreaper.png +0 -0
  128. images/browser/webtv.png +0 -0
  129. images/browser/webzip.png +0 -0
  130. images/browser/winxbox.png +0 -0
  131. images/browser/wizz.png +0 -0
  132. images/forward_params.png +0 -0
  133. images/nofollow.png +0 -0
  134. images/not_tracking.png +0 -0
  135. images/os/aix.png +0 -0
  136. images/os/amigaos.png +0 -0
  137. images/os/apple.png +0 -0
  138. images/os/atari.png +0 -0
  139. images/os/beos.png +0 -0
  140. images/os/bsd.png +0 -0
  141. images/os/bsdfreebsd.png +0 -0
  142. images/os/bsdi.png +0 -0
  143. images/os/bsdnetbsd.png +0 -0
  144. images/os/bsdopenbsd.png +0 -0
  145. images/os/commodore.png +0 -0
  146. images/os/cpm.png +0 -0
  147. images/os/debian.png +0 -0
  148. images/os/digital.png +0 -0
  149. images/os/dos.png +0 -0
  150. images/os/dreamcast.png +0 -0
  151. images/os/freebsd.png +0 -0
  152. images/os/gnu.png +0 -0
  153. images/os/hpux.png +0 -0
  154. images/os/ibm.png +0 -0
  155. images/os/imode.png +0 -0
  156. images/os/irix.png +0 -0
  157. images/os/java.png +0 -0
  158. images/os/kfreebsd.png +0 -0
  159. images/os/linux.png +0 -0
  160. images/os/linuxcentos.png +0 -0
  161. images/os/linuxdebian.png +0 -0
  162. images/os/linuxfedora.png +0 -0
  163. images/os/linuxgentoo.png +0 -0
  164. images/os/linuxmandr.png +0 -0
  165. images/os/linuxredhat.png +0 -0
  166. images/os/linuxsuse.png +0 -0
  167. images/os/linuxubuntu.png +0 -0
  168. images/os/mac.png +0 -0
  169. images/os/macintosh.png +0 -0
  170. images/os/macosx.png +0 -0
  171. images/os/netbsd.png +0 -0
  172. images/os/netware.png +0 -0
  173. images/os/next.png +0 -0
  174. images/os/openbsd.png +0 -0
  175. images/os/os2.png +0 -0
  176. images/os/osf.png +0 -0
  177. images/os/psp.png +0 -0
  178. images/os/qnx.png +0 -0
  179. images/os/riscos.png +0 -0
  180. images/os/sco.png +0 -0
  181. images/os/sunos.png +0 -0
  182. images/os/symbian.png +0 -0
  183. images/os/unix.png +0 -0
  184. images/os/unknown.png +0 -0
  185. images/os/vms.png +0 -0
  186. images/os/webtv.png +0 -0
  187. images/os/win.png +0 -0
  188. images/os/win16.png +0 -0
  189. images/os/win2000.png +0 -0
  190. images/os/win2003.png +0 -0
  191. images/os/win95.png +0 -0
  192. images/os/win98.png +0 -0
  193. images/os/wince.png +0 -0
  194. images/os/winlong.png +0 -0
  195. images/os/winme.png +0 -0
  196. images/os/winnt.png +0 -0
  197. images/os/winunknown.png +0 -0
  198. images/os/winxbox.png +0 -0
  199. images/os/winxp.png +0 -0
  200. images/pixel_track.png +0 -0
  201. images/pretty-link-48x48.png +0 -0
  202. images/pretty-link-add.png +0 -0
  203. images/pretty-link-med.png +0 -0
  204. images/pretty-link-small.png +0 -0
  205. images/tracking.png +0 -0
  206. images/ultra-cloak.png +0 -0
  207. images/url_icon.gif +0 -0
  208. includes/php/php_browsecap.ini +390 -801
  209. pretty-bar.php +57 -52
  210. pretty-link.php +332 -7
  211. prli-api.php +47 -14
  212. prli-clicks.php +7 -67
  213. prli-config.php +61 -81
  214. prli-dashboard-widget.php +8 -1
  215. prli-links.php +29 -24
  216. prli-options.php +131 -50
  217. prli-pro-settings.php +50 -7
  218. prli-xmlrpc.php +30 -10
  219. readme.txt +45 -275
  220. {classes → trunk/classes}/controllers/PrliAppController.php +1 -1
  221. trunk/classes/models/PrliClick.php +314 -0
  222. trunk/classes/models/PrliGroup.php +124 -0
  223. trunk/classes/models/PrliLink.php +473 -0
  224. trunk/classes/models/PrliLinkMeta.php +59 -0
  225. {classes → trunk/classes}/models/PrliOptions.php +0 -0
  226. {classes → trunk/classes}/models/PrliUpdate.php +5 -5
  227. {classes → trunk/classes}/models/PrliUrlUtils.php +0 -0
  228. trunk/classes/models/PrliUtils.php +1178 -0
  229. trunk/classes/models/models.inc.php +74 -0
  230. trunk/classes/views/prli-clicks/csv.php +22 -0
  231. {classes → trunk/classes}/views/prli-clicks/csv_download.php +1 -0
  232. trunk/classes/views/prli-clicks/head.php +106 -0
  233. trunk/classes/views/prli-clicks/list.php +170 -0
  234. trunk/classes/views/prli-dashboard-widget/widget.php +24 -0
  235. trunk/classes/views/prli-groups/edit.php +58 -0
  236. trunk/classes/views/prli-groups/head.php +35 -0
  237. trunk/classes/views/prli-groups/list.php +85 -0
  238. trunk/classes/views/prli-groups/new.php +59 -0
  239. trunk/classes/views/prli-links/bar.php +13 -0
  240. trunk/classes/views/prli-links/edit.php +22 -0
  241. trunk/classes/views/prli-links/form.php +99 -0
  242. trunk/classes/views/prli-links/head.php +91 -0
  243. trunk/classes/views/prli-links/list.php +191 -0
  244. trunk/classes/views/prli-links/new.php +22 -0
  245. trunk/classes/views/prli-links/ultra-cloak.php +12 -0
  246. trunk/classes/views/prli-options/form.php +110 -0
  247. trunk/classes/views/prli-options/head.php +47 -0
  248. trunk/classes/views/prli-options/pro-settings.php +18 -0
  249. {classes → trunk/classes}/views/prli-tools/form.php +1 -1
  250. trunk/classes/views/shared/errors.php +19 -0
  251. {classes → trunk/classes}/views/shared/link-table-nav.php +0 -0
  252. trunk/classes/views/shared/nav.php +9 -0
  253. trunk/classes/views/shared/table-nav.php +93 -0
  254. trunk/i18n/pretty-link.pot +589 -0
  255. trunk/images/arrow_down.png +0 -0
  256. trunk/images/arrow_up.png +0 -0
  257. trunk/images/bar_background.png +0 -0
  258. trunk/images/bar_map.png +0 -0
  259. trunk/images/bookmark.png +0 -0
  260. trunk/images/co.mments.gif +0 -0
  261. trunk/images/dark_add_twitter_account.png +0 -0
  262. trunk/images/delicious_32.png +0 -0
  263. trunk/images/digg_32.png +0 -0
  264. trunk/images/email_32.png +0 -0
  265. trunk/images/facebook.png +0 -0
  266. trunk/images/facebook_32.png +0 -0
  267. trunk/images/forward_params.png +0 -0
  268. trunk/images/hyves_32.png +0 -0
  269. trunk/images/linkedin_32.png +0 -0
  270. trunk/images/mixx_32.png +0 -0
  271. trunk/images/newsvine_32.png +0 -0
  272. trunk/images/nofollow.png +0 -0
  273. trunk/images/not_tracking.png +0 -0
  274. trunk/images/pixel_track.png +0 -0
  275. trunk/images/pretty-link-48x48.png +0 -0
  276. trunk/images/pretty-link-add.png +0 -0
  277. trunk/images/pretty-link-med.png +0 -0
  278. trunk/images/pretty-link-small.png +0 -0
  279. trunk/images/prettylink_logo.jpg +0 -0
  280. trunk/images/prettylink_logo_med.jpg +0 -0
  281. trunk/images/prettylink_logo_small.jpg +0 -0
  282. trunk/images/reddit_32.png +0 -0
  283. trunk/images/retweet.gif +0 -0
  284. trunk/images/retweet.png +0 -0
  285. trunk/images/rotate_link.png +0 -0
  286. trunk/images/sphinn_32.png +0 -0
  287. trunk/images/stumbleupon_32.png +0 -0
  288. trunk/images/technorati_32.png +0 -0
  289. trunk/images/tracking.png +0 -0
  290. trunk/images/tweet.gif +0 -0
  291. trunk/images/tweet.png +0 -0
  292. trunk/images/twitter.png +0 -0
  293. trunk/images/twitter_32.png +0 -0
  294. trunk/images/ultra-cloak.png +0 -0
  295. trunk/images/url_icon.gif +0 -0
  296. trunk/images/yahoobuzz_32.png +0 -0
  297. trunk/includes/jquery/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  298. trunk/includes/jquery/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  299. trunk/includes/jquery/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  300. trunk/includes/jquery/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  301. trunk/includes/jquery/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  302. trunk/includes/jquery/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  303. trunk/includes/jquery/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  304. trunk/includes/jquery/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  305. trunk/includes/jquery/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  306. trunk/includes/jquery/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  307. trunk/includes/jquery/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  308. trunk/includes/jquery/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  309. trunk/includes/jquery/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  310. trunk/includes/jquery/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  311. trunk/includes/jquery/css/ui-lightness/jquery-ui-1.7.1.custom.css +404 -0
  312. trunk/includes/jquery/js/jquery-1.3.2.min.js +19 -0
  313. trunk/includes/jquery/js/jquery-ui-1.7.1.custom.min.js +273 -0
  314. trunk/includes/php/php_browsecap.ini +12615 -0
classes/models/PrliClick.php CHANGED
@@ -9,127 +9,58 @@ class PrliClick
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, $prli_link_meta;
97
-
98
- $query = $wpdb->prepare("DELETE FROM {$prli_link_meta->table_name} WHERE meta_key=%s OR meta_key=%s", 'static-clicks', 'static-uniques');
99
- $wpdb->query($query);
100
-
101
- $query = "TRUNCATE TABLE {$this->table_name}";
102
- return $wpdb->query($query);
103
- }
104
-
105
- /* This will delete all the clicks in the database by their age measured in days. */
106
- function clear_clicks_by_age_in_days($days)
107
  {
108
  global $wpdb;
109
-
110
- $days_in_seconds = $days * 24 * 60 * 60;
111
- $oldest_time = time() - $days_in_seconds;
112
-
113
- $num_records = $this->getRecordCount( " UNIX_TIMESTAMP(created_at) < {$oldest_time}" );
114
-
115
- if($num_records)
116
- {
117
- $query = "DELETE FROM {$this->table_name} WHERE UNIX_TIMESTAMP(created_at) < %d";
118
- $query = $wpdb->prepare( $query, $oldest_time );
119
-
120
- $wpdb->query($query);
121
- }
122
-
123
- return $num_records;
124
- }
125
-
126
- function get_distinct_ip_count($where='')
127
- {
128
- global $wpdb, $prli_link, $prli_utils;
129
- $where .= $this->get_exclude_where_clause( $where );
130
- $where = $prli_utils->prepend_and_or_where(' WHERE', $where);
131
- $query = 'SELECT COUNT(DISTINCT ip) FROM ' . $this->table_name . ' cl'. $where;
132
- return $wpdb->get_var($query);
133
  }
134
 
135
  // Pagination Methods
@@ -139,7 +70,6 @@ class PrliClick
139
  $where .= $this->get_exclude_where_clause( $where );
140
  $where = $prli_utils->prepend_and_or_where(' WHERE', $where);
141
  $query = 'SELECT COUNT(*) FROM ' . $this->table_name . ' cl'. $where;
142
-
143
  return $wpdb->get_var($query);
144
  }
145
 
@@ -148,17 +78,15 @@ class PrliClick
148
  return ceil((int)$this->getRecordCount($where) / (int)$p_size);
149
  }
150
 
151
- function getPage($current_p,$p_size, $where = '', $order = '',$include_stats=false)
152
  {
153
  global $wpdb, $prli_link, $prli_utils;
 
154
  $end_index = $current_p * $p_size;
155
  $start_index = $end_index - $p_size;
156
  $where .= $this->get_exclude_where_clause( $where );
157
  $where = $prli_utils->prepend_and_or_where(' AND', $where);
158
- if($include_stats)
159
- $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 . ';';
160
- else
161
- $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 . ';';
162
  $results = $wpdb->get_results($query);
163
  return $results;
164
  }
@@ -187,7 +115,6 @@ class PrliClick
187
  {
188
  global $wpdb, $prli_link;
189
 
190
- $search_where = '';
191
  $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' );
192
 
193
  if($link_id != "all")
9
  $this->table_name = "{$wpdb->prefix}prli_clicks";
10
  }
11
 
12
+ function get_ip_exclude_list()
13
  {
14
+ $exclude_list = get_option('prli_exclude_ips');
15
+ $exclude_list = preg_replace('#[ \t]#','',$exclude_list);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
+ if($exclude_list)
18
+ return "'" . implode("','", explode(',',$exclude_list)) . "'";
19
+ else
20
+ return '';
21
+ }
 
 
22
 
23
+ function get_exclude_where_clause( $where = '', $abbr = 'cl')
24
+ {
25
+ $exclude_list = $this->get_ip_exclude_list();
26
 
27
+ if($where == '')
28
+ $starts_with = '';
29
+ else
30
+ $starts_with = ' AND';
31
+
32
+ if( $exclude_list != '')
33
+ return $starts_with . " $abbr.ip NOT IN (" . $exclude_list . ')';
34
+ else
35
+ return '';
36
  }
37
 
38
  function getOne( $id )
39
  {
40
  global $wpdb, $prli_link, $prli_utils;
41
+ $click_table = $wpdb->prefix . "prli_clicks";
42
  $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());
43
 
44
  return $wpdb->get_row($query);
45
  }
46
 
47
  // 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
48
+ function getAll($where = '', $order = '')
49
  {
50
  global $wpdb, $prli_link, $prli_utils;
51
+ $click_table = $wpdb->prefix . "prli_clicks";
52
  $where .= $this->get_exclude_where_clause( $where );
53
  $where = $prli_utils->prepend_and_or_where(' AND', $where);
54
+ $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;
 
 
 
 
 
55
  return $wpdb->get_results($query);
56
  }
57
 
58
  // Delete all of the clicks from the database.
59
  function clearAllClicks()
 
 
 
 
 
 
 
 
 
 
 
 
60
  {
61
  global $wpdb;
62
+ $query = "TRUNCATE TABLE " . $this->table_name;
63
+ return $wpdb->query($query);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  }
65
 
66
  // Pagination Methods
70
  $where .= $this->get_exclude_where_clause( $where );
71
  $where = $prli_utils->prepend_and_or_where(' WHERE', $where);
72
  $query = 'SELECT COUNT(*) FROM ' . $this->table_name . ' cl'. $where;
 
73
  return $wpdb->get_var($query);
74
  }
75
 
78
  return ceil((int)$this->getRecordCount($where) / (int)$p_size);
79
  }
80
 
81
+ function getPage($current_p,$p_size, $where = '', $order = '')
82
  {
83
  global $wpdb, $prli_link, $prli_utils;
84
+ $click_table = $wpdb->prefix . "prli_clicks";
85
  $end_index = $current_p * $p_size;
86
  $start_index = $end_index - $p_size;
87
  $where .= $this->get_exclude_where_clause( $where );
88
  $where = $prli_utils->prepend_and_or_where(' AND', $where);
89
+ $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 . ';';
 
 
 
90
  $results = $wpdb->get_results($query);
91
  return $results;
92
  }
115
  {
116
  global $wpdb, $prli_link;
117
 
 
118
  $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' );
119
 
120
  if($link_id != "all")
classes/models/PrliGroup.php CHANGED
@@ -49,25 +49,17 @@ class PrliGroup
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
 
@@ -89,7 +81,7 @@ class PrliGroup
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
  }
49
  return $wpdb->query($destroy);
50
  }
51
 
52
+ function getOne( $id )
53
  {
54
  global $wpdb, $prli_link, $prli_click;
55
+ $query = 'SELECT gr.*, (SELECT COUNT(*) FROM ' . $prli_link->table_name . ' li WHERE li.group_id = gr.id) as link_count, (SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl WHERE link_id IN (SELECT li2.id FROM ' . $prli_link->table_name . ' li2 WHERE li2.group_id=gr.id)) as click_count FROM ' . $this->table_name . ' gr WHERE id=' . $id . ';';
 
 
 
 
56
  return $wpdb->get_row($query);
57
  }
58
 
59
+ function getAll( $where = '', $order_by = '', $return_type = OBJECT )
60
  {
61
  global $wpdb, $prli_utils, $prli_link, $prli_click;
62
+ $query = 'SELECT gr.*, (SELECT COUNT(*) FROM ' . $prli_link->table_name . ' li WHERE li.group_id = gr.id) as link_count, (SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl WHERE link_id IN (SELECT li2.id FROM ' . $prli_link->table_name . ' li2 WHERE li2.group_id=gr.id)) as click_count FROM ' . $this->table_name . ' gr' . $prli_utils->prepend_and_or_where(' WHERE', $where) . $order_by;
 
 
 
 
63
  return $wpdb->get_results($query, $return_type);
64
  }
65
 
81
  global $wpdb, $prli_link, $prli_utils, $prli_click;
82
  $end_index = $current_p * $p_size;
83
  $start_index = $end_index - $p_size;
84
+ $query = 'SELECT gr.*, (SELECT COUNT(*) FROM ' . $prli_link->table_name . ' li WHERE li.group_id = gr.id) as link_count, (SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl WHERE link_id IN (SELECT li2.id FROM ' . $prli_link->table_name . ' li2 WHERE li2.group_id=gr.id)) as click_count FROM ' . $this->table_name . ' gr' . $prli_utils->prepend_and_or_where(' WHERE', $where) . $order_by .' LIMIT ' . $start_index . ',' . $p_size;
85
  $results = $wpdb->get_results($query);
86
  return $results;
87
  }
classes/models/PrliLink.php CHANGED
@@ -11,13 +11,9 @@ class PrliLink
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,'.
@@ -26,11 +22,15 @@ class PrliLink
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'],
@@ -40,8 +40,12 @@ class PrliLink
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
 
@@ -53,13 +57,9 @@ class PrliLink
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, ' .
@@ -68,21 +68,29 @@ class PrliLink
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
- isset($values['url'])?$values['url']:'',
78
- isset($values['slug'])?$values['slug']:'',
79
- isset($values['name'])?$values['name']:'',
80
- isset($values['param_forwarding'])?$values['param_forwarding']:'',
81
- isset($values['param_struct'])?$values['param_struct']:'',
82
- isset($values['redirect_type'])?$values['redirect_type']:'',
83
- isset($values['description'])?$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
 
@@ -103,14 +111,11 @@ class PrliLink
103
  function destroy( $id )
104
  {
105
  require_once(PRLI_MODELS_PATH.'/models.inc.php');
106
- global $wpdb, $prli_click, $prli_link_meta;
107
 
108
- do_action('prli_delete_link', $id);
109
- $metas = $wpdb->prepare("DELETE FROM {$prli_link_meta->table_name} WHERE link_id=%d",$id);
110
- $reset = $wpdb->prepare("DELETE FROM {$prli_click->table_name} WHERE link_id=%d",$id);
111
- $destroy = $wpdb->prepare("DELETE FROM {$this->table_name} WHERE id=%d",$id);
112
 
113
- $wpdb->query($metas);
114
  $wpdb->query($reset);
115
  return $wpdb->query($destroy);
116
  }
@@ -118,213 +123,75 @@ class PrliLink
118
  function reset( $id )
119
  {
120
  require_once(PRLI_MODELS_PATH.'/models.inc.php');
121
- global $wpdb, $prli_click, $prli_link_meta;
122
-
123
- $prli_link_meta->delete_link_meta($id, 'static-clicks');
124
- $prli_link_meta->delete_link_meta($id, 'static-uniques');
125
 
126
- $reset = $wpdb->prepare("DELETE FROM {$prli_click->table_name} WHERE link_id=%d", $id);
127
  return $wpdb->query($reset);
128
  }
129
 
130
- function getOneFromSlug( $slug, $return_type = OBJECT, $include_stats = false )
131
- {
132
- global $wpdb, $prli_click, $prli_options, $prli_link_meta;
133
- if($include_stats)
134
- {
135
- $query = 'SELECT li.*, ';
136
- if($prli_options->extended_tracking != 'count')
137
- {
138
- $query .= '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
139
- 'WHERE cl.link_id = li.id' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as clicks, ' .
140
- '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
141
- 'WHERE cl.link_id = li.id ' .
142
- 'AND cl.first_click <> 0' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as uniques ';
143
- }
144
- else
145
- {
146
- $query .= '(SELECT lm.meta_value FROM ' . $prli_link_meta->table_name . ' lm ' .
147
- 'WHERE lm.meta_key="static-clicks" AND lm.link_id=li.id LIMIT 1) as clicks, ' .
148
- '(SELECT lm.meta_value FROM ' . $prli_link_meta->table_name . ' lm ' .
149
- 'WHERE lm.meta_key="static-uniques" AND lm.link_id=li.id LIMIT 1) as uniques ';
150
- }
151
- $query .= "FROM {$this->table_name} li " .
152
- 'WHERE slug=%s';
153
- }
154
- else
155
- $query = "SELECT * FROM {$this->table_name} WHERE slug=%s";
156
-
157
- $query = $wpdb->prepare($query, $slug);
158
- $link = $wpdb->get_row($query, $return_type);
159
-
160
- if( $include_stats and $link and $prli_options->extended_tracking == 'count' )
161
- {
162
- $link->clicks = $prli_link_meta->get_link_meta($link->id,'static-clicks',true);
163
- $link->uniques = $prli_link_meta->get_link_meta($link->id,'static-uniques',true);
164
- }
165
-
166
- return $link;
167
- }
168
-
169
- function getOne( $id, $return_type = OBJECT, $include_stats = false )
170
  {
171
- global $wpdb, $prli_click, $prli_link_meta, $prli_options;
172
- if( !isset($id) or empty($id) )
173
- return false;
174
-
175
- if($include_stats)
176
- {
177
- $query = 'SELECT li.*, ';
178
- if($prli_options->extended_tracking != 'count')
179
- {
180
- $query .= '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
181
- 'WHERE cl.link_id = li.id' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as clicks, ' .
182
- '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
183
- 'WHERE cl.link_id = li.id ' .
184
- 'AND cl.first_click <> 0' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as uniques ';
185
- }
186
- else
187
- {
188
- $query .= '(SELECT lm.meta_value FROM ' . $prli_link_meta->table_name . ' lm ' .
189
- 'WHERE lm.meta_key="static-clicks" AND lm.link_id=li.id LIMIT 1) as clicks, ' .
190
- '(SELECT lm.meta_value FROM ' . $prli_link_meta->table_name . ' lm ' .
191
- 'WHERE lm.meta_key="static-uniques" AND lm.link_id=li.id LIMIT 1) as uniques ';
192
- }
193
- $query .= 'FROM ' . $this->table_name . ' li ' .
194
- 'WHERE id=%d';
195
- }
196
- else
197
- $query = "SELECT * FROM {$this->table_name} WHERE id=%d";
198
-
199
- $query = $wpdb->prepare($query, $id);
200
  return $wpdb->get_row($query, $return_type);
201
  }
202
 
203
- function find_first_target_url($target_url)
204
- {
205
- global $wpdb;
206
- $query_str = "SELECT id FROM {$this->table_name} WHERE url=%s LIMIT 1";
207
- $query = $wpdb->prepare($query_str,$target_url);
208
- return $wpdb->get_var($query);
209
- }
210
-
211
- function &get_or_create_pretty_link_for_target_url( $target_url, $group=0 )
212
- {
213
- $pretty_link_id = $this->find_first_target_url( $target_url );
214
- $pretty_link = $this->getOne($pretty_link_id);
215
-
216
- if(empty($pretty_link) or !$pretty_link)
217
- {
218
- $pl_insert_id = prli_create_pretty_link( $target_url, '', '', '', $group );
219
- $pretty_link = $this->getOne($pl_insert_id);
220
- }
221
- else
222
- prli_update_pretty_link( $pretty_link->id, '', '', '', '', $group );
223
-
224
- if( !isset($pretty_link) or
225
- empty($pretty_link) or
226
- !$pretty_link )
227
- return false;
228
- else
229
- return $pretty_link;
230
- }
231
-
232
- function is_pretty_link($url, $check_domain=true)
233
- {
234
- global $prli_blogurl;
235
-
236
- if( !$check_domain or preg_match( '#^' . preg_quote( $prli_blogurl ) . '#', $url ) )
237
- {
238
- $uri = preg_replace('#' . preg_quote($prli_blogurl) . '#', '', $url);
239
-
240
- // Resolve WP installs in sub-directories
241
- preg_match('#^(https?://.*?)(/.*)$#', $prli_blogurl, $subdir);
242
-
243
- $struct = PrliUtils::get_permalink_pre_slug_regex();
244
-
245
- $subdir_str = (isset($subdir[2])?$subdir[2]:'');
246
-
247
- $match_str = '#^'.$subdir_str.'('.$struct.')([^\?]*?)([\?].*?)?$#';
248
-
249
- if(preg_match($match_str, $uri, $match_val))
250
- {
251
- // Match longest slug -- this is the most common
252
- $params = (isset($match_val[3])?$match_val[3]:'');
253
- if( $pretty_link_found =& $this->is_pretty_link_slug( $match_val[2] ) )
254
- return compact('pretty_link_found','pretty_link_params');
255
-
256
- // Trim down the matched link
257
- $matched_link = preg_replace('#/[^/]*?$#','',$match_val[2],1);
258
-
259
- // cycle through the links (maximum depth 25 folders so we don't get out
260
- // of control -- that should be enough eh?) and trim the link down each time
261
- for( $i=0; ($i < 25) and
262
- $matched_link and
263
- !empty($matched_link) and
264
- $matched_link != $match_val[2]; $i++ )
265
- {
266
- $new_match_str ="#^{$subdir_str}({$struct})({$matched_link})(.*?)?$#";
267
-
268
- $params = (isset($match_val[3])?$match_val:'');
269
- if( $pretty_link_found =& $this->is_pretty_link_slug( $match_val[2] ) )
270
- return compact('pretty_link_found','pretty_link_params');
271
-
272
- // Trim down the matched link and try again
273
- $matched_link = preg_replace('#/[^/]*$#','',$match_val[2],1);
274
- }
275
- }
276
- }
277
-
278
- return false;
279
- }
280
-
281
- function is_pretty_link_slug($slug)
282
  {
283
- return $this->getOneFromSlug( urldecode($slug) );
 
 
 
 
 
 
 
 
 
284
  }
285
 
286
  function get_link_min( $id, $return_type = OBJECT )
287
  {
288
  global $wpdb;
289
- $query_str = "SELECT * FROM {$this->table_name} WHERE id=%d";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  $query = $wpdb->prepare($query_str, $id);
291
  return $wpdb->get_row($query, $return_type);
292
  }
293
 
294
- function getAll($where = '', $order_by = '', $return_type = OBJECT, $include_stats = false)
295
  {
296
- global $wpdb, $prli_click, $prli_group, $prli_link_meta, $prli_options, $prli_utils;
297
-
298
- if($include_stats)
299
- {
300
- $query = 'SELECT li.*, ';
301
- if($prli_options->extended_tracking != 'count')
302
- {
303
- $query .= '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
304
- 'WHERE cl.link_id = li.id' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as clicks, ' .
305
- '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
306
- 'WHERE cl.link_id = li.id ' .
307
- 'AND cl.first_click <> 0' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as uniques, ';
308
- }
309
- else
310
- {
311
- $query .= '(SELECT lm.meta_value FROM ' . $prli_link_meta->table_name . ' lm ' .
312
- 'WHERE lm.meta_key="static-clicks" AND lm.link_id=li.id LIMIT 1) as clicks, ' .
313
- '(SELECT lm.meta_value FROM ' . $prli_link_meta->table_name . ' lm ' .
314
- 'WHERE lm.meta_key="static-uniques" AND lm.link_id=li.id LIMIT 1) as uniques, ';
315
- }
316
- $query .= 'gr.name as group_name ' .
317
- 'FROM '. $this->table_name . ' li ' .
318
- 'LEFT OUTER JOIN ' . $prli_group->table_name . ' gr ON li.group_id=gr.id' .
319
- $prli_utils->prepend_and_or_where(' WHERE', $where) . $order_by;
320
- }
321
- else
322
- {
323
- $query = "SELECT li.*, gr.name as group_name FROM {$this->table_name} li " .
324
- 'LEFT OUTER JOIN ' . $prli_group->table_name . ' gr ON li.group_id=gr.id' .
325
- $prli_utils->prepend_and_or_where(' WHERE', $where) . $order_by;
326
- }
327
-
328
  return $wpdb->get_results($query, $return_type);
329
  }
330
 
@@ -343,26 +210,16 @@ class PrliLink
343
 
344
  function getPage($current_p,$p_size, $where = "", $order_by = '', $return_type = OBJECT)
345
  {
346
- global $wpdb, $prli_click, $prli_utils, $prli_group, $prli_link_meta, $prli_options;
347
  $end_index = $current_p * $p_size;
348
  $start_index = $end_index - $p_size;
349
- $query = 'SELECT li.*, ';
350
- if($prli_options->extended_tracking != 'count')
351
- {
352
- $query .= '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
353
  'WHERE cl.link_id = li.id' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as clicks, ' .
354
  '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
355
  'WHERE cl.link_id = li.id ' .
356
- 'AND cl.first_click <> 0' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as uniques, ';
357
- }
358
- else
359
- {
360
- $query .= '(SELECT lm.meta_value FROM ' . $prli_link_meta->table_name . ' lm ' .
361
- 'WHERE lm.meta_key="static-clicks" AND lm.link_id=li.id LIMIT 1) as clicks, ' .
362
- '(SELECT lm.meta_value FROM ' . $prli_link_meta->table_name . ' lm ' .
363
- 'WHERE lm.meta_key="static-uniques" AND lm.link_id=li.id LIMIT 1) as uniques, ';
364
- }
365
- $query .= 'gr.name as group_name ' .
366
  'FROM ' . $this->table_name . ' li ' .
367
  'LEFT OUTER JOIN ' . $prli_group->table_name . ' gr ON li.group_id=gr.id' .
368
  $prli_utils->prepend_and_or_where(' WHERE', $where) . $order_by . ' ' .
@@ -404,33 +261,34 @@ class PrliLink
404
  $link = $this->getOneFromSlug($slug);
405
 
406
  if((isset($link->param_forwarding) and $link->param_forwarding == 'custom') and
407
- (isset($link->redirect_type) and $link->redirect_type == 'pixel'))
408
- 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;";
409
  else if((!isset($link->param_forwarding) or $link->param_forwarding != 'custom') and
410
- (isset($link->redirect_type) and $link->redirect_type == 'pixel'))
411
- return "&lt;img src=\"".$prli_blogurl . PrliUtils::get_permalink_pre_slug_uri() . $link->slug . "\" width=\"1\" height=\"1\" style=\"display: none\" /&gt;";
412
  else if((isset($link->param_forwarding) and $link->param_forwarding == 'custom') and
413
- (!isset($link->redirect_type) or $link->redirect_type != 'pixel'))
414
- return $prli_blogurl . PrliUtils::get_permalink_pre_slug_uri() . $link->slug . $link->param_struct;
415
  else
416
- return $prli_blogurl . PrliUtils::get_permalink_pre_slug_uri() . $link->slug;
417
  }
418
 
419
  // Set defaults and grab get or post of each possible param
420
  function get_params_array()
421
  {
422
- return array(
423
- 'action' => (isset($_REQUEST['action'])?$_REQUEST['action']:'list'),
424
- 'regenerate' => (isset($_REQUEST['regenerate'])?$_REQUEST['regenerate']:'false'),
425
- 'id' => (isset($_REQUEST['id'])?$_REQUEST['id']:''),
426
- 'group_name' => (isset($_REQUEST['group_name'])?$_REQUEST['group_name']:''),
427
- 'paged' => (isset($_REQUEST['paged'])?$_REQUEST['paged']:1),
428
- 'group' => (isset($_REQUEST['group'])?$_REQUEST['group']:''),
429
- 'search' => (isset($_REQUEST['search'])?$_REQUEST['search']:''),
430
- 'sort' => (isset($_REQUEST['sort'])?$_REQUEST['sort']:''),
431
- 'sdir' => (isset($_REQUEST['sdir'])?$_REQUEST['sdir']:''),
432
- 'message' => (isset($_REQUEST['message'])?$_REQUEST['message']:'')
433
  );
 
 
434
  }
435
 
436
  function validate( $values )
@@ -438,28 +296,23 @@ class PrliLink
438
  global $wpdb, $prli_utils, $prli_blogurl;
439
 
440
  $errors = array();
441
- if( ( $values['url'] == null or $values['url'] == '') and $values['redirect_type'] != 'pixel' )
442
- $errors[] = "Target URL can't be blank";
443
 
444
  if( $values['slug'] == null or $values['slug'] == '' )
445
  $errors[] = "Pretty Link can't be blank";
446
 
447
- if( $values['url'] == $prli_blogurl.PrliUtils::get_permalink_pre_slug_uri().$values['slug'] )
448
  $errors[] = "Target URL must be different than the Pretty Link";
449
 
450
- if( !empty($values['url']) and
451
- !preg_match('/^http.?:\/\/.*\..*$/', $values['url'] ) and
452
- !preg_match('!^(http|https)://(localhost|127\.0\.0\.1)(:\d+)?(/[\w- ./?%&=]*)?!', $values['url'] ) )
453
  $errors[] = "Link URL must be a correctly formatted url";
454
 
455
- if( preg_match('/^[\?\&\#]+$/', $values['slug'] ) )
456
- $errors[] = "Pretty Link slugs must not contain question marks, ampersands or number signs.";
457
-
458
- if( preg_match('#/$#', $values['slug']) )
459
- $errors[] = "Pretty Link slugs must not end with a slash (\"/\")";
460
 
461
  if( !$prli_utils->slugIsAvailable($values['slug'],$values['id']) )
462
- $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.";
463
 
464
  if( isset($values['param_forwarding']) and $values['param_forwarding'] == 'custom' and empty($values['param_struct']) )
465
  $errors[] = "If Custom Parameter Forwarding has been selected then you must specify a forwarding format.";
11
 
12
  function create( $values )
13
  {
14
+ global $wpdb;
 
 
 
 
 
15
 
16
+ $values['name'] = (!empty($values['name'])?$values['name']:$values['slug']);
17
  $query_str = "INSERT INTO {$this->table_name} " .
18
  '(url,'.
19
  'slug,'.
22
  'param_struct,'.
23
  'redirect_type,'.
24
  'description,'.
25
+ 'gorder,'.
26
  'track_me,'.
27
  'nofollow,'.
28
+ 'use_prettybar,'.
29
+ 'use_ultra_cloak,'.
30
+ 'track_as_img,'.
31
  'group_id,'.
32
  'created_at) ' .
33
+ 'VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%d,%d,%d,%d,%d,%d,NOW())';
34
 
35
  $query = $wpdb->prepare( $query_str,
36
  $values['url'],
40
  $values['param_struct'],
41
  $values['redirect_type'],
42
  $values['description'],
43
+ $values['gorder'],
44
  (int)isset($values['track_me']),
45
  (int)isset($values['nofollow']),
46
+ (int)isset($values['use_prettybar']),
47
+ (int)isset($values['use_ultra_cloak']),
48
+ (int)isset($values['track_as_img']),
49
  (isset($values['group_id'])?(int)$values['group_id']:'NULL') );
50
  $query_results = $wpdb->query($query);
51
 
57
 
58
  function update( $id, $values )
59
  {
60
+ global $wpdb;
 
 
 
 
 
61
 
62
+ $values['name'] = (!empty($values['name'])?$values['name']:$values['slug']);
63
  $query_str = "UPDATE {$this->table_name} " .
64
  'SET url=%s, ' .
65
  'slug=%s, ' .
68
  'param_struct=%s, ' .
69
  'redirect_type=%s, ' .
70
  'description=%s, ' .
71
+ 'gorder=%s, ' .
72
  'track_me=%d, ' .
73
  'nofollow=%d, ' .
74
+ 'use_prettybar=%d, ' .
75
+ 'use_ultra_cloak=%d, ' .
76
+ 'track_as_img=%d, ' .
77
  'group_id=%d ' .
78
  ' WHERE id=%d';
79
 
80
  $query = $wpdb->prepare( $query_str,
81
+ $values['url'],
82
+ $values['slug'],
83
+ $values['name'],
84
+ $values['param_forwarding'],
85
+ $values['param_struct'],
86
+ $values['redirect_type'],
87
+ $values['description'],
88
+ $values['gorder'],
89
  (int)isset($values['track_me']),
90
  (int)isset($values['nofollow']),
91
+ (int)isset($values['use_prettybar']),
92
+ (int)isset($values['use_ultra_cloak']),
93
+ (int)isset($values['track_as_img']),
94
  (isset($values['group_id'])?(int)$values['group_id']:'NULL'),
95
  $id );
96
 
111
  function destroy( $id )
112
  {
113
  require_once(PRLI_MODELS_PATH.'/models.inc.php');
114
+ global $wpdb, $prli_click;
115
 
116
+ $reset = 'DELETE FROM ' . $prli_click->table_name . ' WHERE link_id=' . $id;
117
+ $destroy = 'DELETE FROM ' . $this->table_name . ' WHERE id=' . $id;
 
 
118
 
 
119
  $wpdb->query($reset);
120
  return $wpdb->query($destroy);
121
  }
123
  function reset( $id )
124
  {
125
  require_once(PRLI_MODELS_PATH.'/models.inc.php');
126
+ global $wpdb, $prli_click;
 
 
 
127
 
128
+ $reset = 'DELETE FROM ' . $prli_click->table_name . ' WHERE link_id=' . $id;
129
  return $wpdb->query($reset);
130
  }
131
 
132
+ function getOneFromSlug( $slug, $return_type = OBJECT )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  {
134
+ global $wpdb, $prli_click;
135
+ $query = 'SELECT li.*, ' .
136
+ '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
137
+ 'WHERE cl.link_id = li.id' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as clicks, ' .
138
+ '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
139
+ 'WHERE cl.link_id = li.id ' .
140
+ 'AND cl.first_click <> 0' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as uniques ' .
141
+ 'FROM ' . $this->table_name . ' li ' .
142
+ 'WHERE slug=\'' . $slug . '\'';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  return $wpdb->get_row($query, $return_type);
144
  }
145
 
146
+ function getOne( $id )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  {
148
+ global $wpdb, $prli_click;
149
+ $query = 'SELECT li.*, ' .
150
+ '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
151
+ 'WHERE cl.link_id = li.id' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as clicks, ' .
152
+ '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
153
+ 'WHERE cl.link_id = li.id ' .
154
+ 'AND cl.first_click <> 0' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as uniques ' .
155
+ 'FROM ' . $this->table_name . ' li ' .
156
+ 'WHERE id=' . $id;
157
+ return $wpdb->get_row($query);
158
  }
159
 
160
  function get_link_min( $id, $return_type = OBJECT )
161
  {
162
  global $wpdb;
163
+ $query_str = 'SELECT id,'.
164
+ 'url,'.
165
+ 'slug,'.
166
+ 'name,'.
167
+ 'description,'.
168
+ 'group_id,'.
169
+ 'redirect_type,'.
170
+ 'track_me,'.
171
+ 'use_prettybar,'.
172
+ 'use_ultra_cloak,'.
173
+ 'param_forwarding,'.
174
+ 'param_struct,'.
175
+ 'track_as_img '.
176
+ "FROM {$this->table_name} ".
177
+ 'WHERE id=%d';
178
  $query = $wpdb->prepare($query_str, $id);
179
  return $wpdb->get_row($query, $return_type);
180
  }
181
 
182
+ function getAll($where = '', $order_by = '', $return_type = OBJECT)
183
  {
184
+ global $wpdb, $prli_click, $prli_group, $prli_utils;
185
+ $query = 'SELECT li.*, ' .
186
+ '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
187
+ 'WHERE cl.link_id = li.id' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as clicks, ' .
188
+ '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
189
+ 'WHERE cl.link_id = li.id ' .
190
+ 'AND cl.first_click <> 0' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as uniques, ' .
191
+ 'gr.name as group_name ' .
192
+ 'FROM '. $this->table_name . ' li ' .
193
+ 'LEFT OUTER JOIN ' . $prli_group->table_name . ' gr ON li.group_id=gr.id' .
194
+ $prli_utils->prepend_and_or_where(' WHERE', $where) . $order_by;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  return $wpdb->get_results($query, $return_type);
196
  }
197
 
210
 
211
  function getPage($current_p,$p_size, $where = "", $order_by = '', $return_type = OBJECT)
212
  {
213
+ global $wpdb, $prli_click, $prli_utils, $prli_group;
214
  $end_index = $current_p * $p_size;
215
  $start_index = $end_index - $p_size;
216
+ $query = 'SELECT li.*, ' .
217
+ '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
 
 
218
  'WHERE cl.link_id = li.id' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as clicks, ' .
219
  '(SELECT COUNT(*) FROM ' . $prli_click->table_name . ' cl ' .
220
  'WHERE cl.link_id = li.id ' .
221
+ 'AND cl.first_click <> 0' . $prli_click->get_exclude_where_clause( ' AND' ) . ') as uniques, ' .
222
+ 'gr.name as group_name ' .
 
 
 
 
 
 
 
 
223
  'FROM ' . $this->table_name . ' li ' .
224
  'LEFT OUTER JOIN ' . $prli_group->table_name . ' gr ON li.group_id=gr.id' .
225
  $prli_utils->prepend_and_or_where(' WHERE', $where) . $order_by . ' ' .
261
  $link = $this->getOneFromSlug($slug);
262
 
263
  if((isset($link->param_forwarding) and $link->param_forwarding == 'custom') and
264
+ (isset($link->track_as_img) and $link->track_as_img == 1))
265
+ return "&lt;img src=\"".$prli_blogurl . '/' . $link->slug . $link->param_struct . "\" width=\"1\" height=\"1\" style=\"display: none\" /&gt;";
266
  else if((!isset($link->param_forwarding) or $link->param_forwarding != 'custom') and
267
+ (isset($link->track_as_img) and $link->track_as_img == 1))
268
+ return "&lt;img src=\"".$prli_blogurl . '/' . $link->slug . "\" width=\"1\" height=\"1\" style=\"display: none\" /&gt;";
269
  else if((isset($link->param_forwarding) and $link->param_forwarding == 'custom') and
270
+ (!isset($link->track_as_img) or $link->track_as_img == 0))
271
+ return $prli_blogurl . '/' . $link->slug . $link->param_struct;
272
  else
273
+ return $prli_blogurl . '/' . $link->slug;
274
  }
275
 
276
  // Set defaults and grab get or post of each possible param
277
  function get_params_array()
278
  {
279
+ $values = array(
280
+ 'action' => (isset($_GET['action'])?$_GET['action']:(isset($_POST['action'])?$_POST['action']:'list')),
281
+ 'regenerate' => (isset($_GET['regenerate'])?$_GET['regenerate']:(isset($_POST['regenerate'])?$_POST['regenerate']:'false')),
282
+ 'id' => (isset($_GET['id'])?$_GET['id']:(isset($_POST['id'])?$_POST['id']:'')),
283
+ 'group_name' => (isset($_GET['group_name'])?$_GET['group_name']:(isset($_POST['group_name'])?$_POST['group_name']:'')),
284
+ 'paged' => (isset($_GET['paged'])?$_GET['paged']:(isset($_POST['paged'])?$_POST['paged']:1)),
285
+ 'group' => (isset($_GET['group'])?$_GET['group']:(isset($_POST['group'])?$_POST['group']:'')),
286
+ 'search' => (isset($_GET['search'])?$_GET['search']:(isset($_POST['search'])?$_POST['search']:'')),
287
+ 'sort' => (isset($_GET['sort'])?$_GET['sort']:(isset($_POST['sort'])?$_POST['sort']:'')),
288
+ 'sdir' => (isset($_GET['sdir'])?$_GET['sdir']:(isset($_POST['sdir'])?$_POST['sdir']:''))
 
289
  );
290
+
291
+ return $values;
292
  }
293
 
294
  function validate( $values )
296
  global $wpdb, $prli_utils, $prli_blogurl;
297
 
298
  $errors = array();
299
+ if( ( $values['url'] == null or $values['url'] == '') and $values['track_as_img'] != 'on' )
300
+ $errors[] = "Target URL can't be blank -- unless this Pretty Link is being used as a tracking pixel (see Advanced Options on this page)";
301
 
302
  if( $values['slug'] == null or $values['slug'] == '' )
303
  $errors[] = "Pretty Link can't be blank";
304
 
305
+ if( $values['url'] == "$prli_blogurl/".$values['slug'] )
306
  $errors[] = "Target URL must be different than the Pretty Link";
307
 
308
+ if( !empty($values['url']) and !preg_match('/^http.?:\/\/.*\..*$/', $values['url'] ) )
 
 
309
  $errors[] = "Link URL must be a correctly formatted url";
310
 
311
+ if( !preg_match('/^[a-zA-Z0-9\.\-_\/]+$/', $values['slug'] ) )
312
+ $errors[] = "Pretty Link must not contain spaces or special characters";
 
 
 
313
 
314
  if( !$prli_utils->slugIsAvailable($values['slug'],$values['id']) )
315
+ $errors[] = "This pretty link slug is already taken, please choose a different one";
316
 
317
  if( isset($values['param_forwarding']) and $values['param_forwarding'] == 'custom' and empty($values['param_struct']) )
318
  $errors[] = "If Custom Parameter Forwarding has been selected then you must specify a forwarding format.";
classes/models/PrliLinkMeta.php CHANGED
@@ -39,11 +39,10 @@ class PrliLinkMeta
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)
39
  if(!is_array($meta_values))
40
  $meta_values = array($meta_values);
41
 
 
42
  foreach($meta_values as $meta_value)
43
+ $this->add_link_meta($link_id, $meta_key, $meta_value);
44
 
45
+ return $wpdb->query($query);
46
  }
47
 
48
  function delete_link_meta($link_id, $meta_key)
classes/models/PrliUtils.php CHANGED
@@ -83,9 +83,13 @@ class PrliUtils
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 = '' )
@@ -98,11 +102,13 @@ class PrliUtils
98
  $slug = $slug_components[0];
99
 
100
  // Check slug uniqueness against posts, pages and categories
101
- $postname = $wpdb->get_var($wpdb->prepare("SELECT post_name FROM {$wpdb->posts} WHERE post_name=%s LIMIT 1",$slug));
102
- $taxonomy = $wpdb->get_var($wpdb->prepare("SELECT taxonomy FROM {$wpdb->term_taxonomy} WHERE taxonomy=%s LIMIT 1",$slug));
103
 
104
- // If anything was returned for these two calls then the slug has been taken
105
- if( $postname or $taxonomy )
 
 
106
  return false;
107
 
108
  // Check slug against files on the root wordpress install
@@ -116,43 +122,21 @@ class PrliUtils
116
 
117
  // Check slug against other slugs in the prli links database.
118
  // We'll use the full_slug here because its easier to guarantee uniqueness.
119
- if(!is_null($id) and !empty($id) and is_numeric($id))
120
- $query = $wpdb->prepare("SELECT slug FROM {$prli_link->table_name} WHERE slug=%s AND id <> %d", $full_slug, $id);
121
  else
122
- $query = $wpdb->prepare("SELECT slug FROM {$prli_link->table_name} WHERE slug=%s", $full_slug);
123
 
124
  $link_slug = $wpdb->get_var($query);
125
 
126
  if( $link_slug == $full_slug )
127
  return false;
128
 
129
- $pre_slug_slug = PrliUtils::get_permalink_pre_slug_uri(true,true);
130
-
131
- if($full_slug == $pre_slug_slug)
132
- return false;
133
-
134
  // TODO: Check permalink structure to avoid the ability of creating a year or something as a slug
135
 
136
  return true;
137
  }
138
 
139
- function &php_get_browsercap_ini()
140
- {
141
- // Since it's a fairly expensive proposition to load the ini file
142
- // let's make sure we only do it once
143
- static $browsecap_ini;
144
-
145
- if(!isset($browsecap_ini))
146
- {
147
- if( version_compare(PHP_VERSION, '5.3.0') >= 0 )
148
- $browsecap_ini =& parse_ini_file( PRLI_PATH . "/includes/php/php_browsecap.ini", true, INI_SCANNER_RAW );
149
- else
150
- $browsecap_ini =& parse_ini_file( PRLI_PATH . "/includes/php/php_browsecap.ini", true );
151
- }
152
-
153
- return $browsecap_ini;
154
- }
155
-
156
  /* Needed because we don't know if the target uesr will have a browsercap file installed
157
  on their server ... particularly in a shared hosting environment this is difficult
158
  */
@@ -162,38 +146,34 @@ class PrliUtils
162
  $yu=array();
163
  $q_s=array("#\.#","#\*#","#\?#");
164
  $q_r=array("\.",".*",".?");
165
- $brows =& $this->php_get_browsercap_ini();
166
-
167
- if(!empty($brows) and $brows and is_array($brows))
168
  {
169
- foreach($brows as $k=>$t)
170
  {
171
- if(fnmatch($k,$agent))
 
 
 
172
  {
173
- $yu['browser_name_pattern']=$k;
174
- $pat=preg_replace($q_s,$q_r,$k);
175
- $yu['browser_name_regex']=strtolower("^$pat$");
176
- foreach($brows as $g=>$r)
177
  {
178
- if($t['Parent']==$g)
179
  {
180
- foreach($brows as $a=>$b)
181
  {
182
- if($r['Parent']==$a)
 
183
  {
184
- $yu=array_merge($yu,$b,$r,$t);
185
- foreach($yu as $d=>$z)
186
- {
187
- $l=strtolower($d);
188
- $hu[$l]=$z;
189
- }
190
  }
191
  }
192
  }
193
  }
194
-
195
- break;
196
  }
 
 
197
  }
198
  }
199
 
@@ -203,7 +183,7 @@ class PrliUtils
203
  // This is where the magic happens!
204
  function track_link($slug,$values)
205
  {
206
- global $wpdb, $prli_click, $prli_options, $prli_link, $prli_update;
207
 
208
  $query = "SELECT * FROM ".$prli_link->table_name." WHERE slug='$slug' LIMIT 1";
209
  $pretty_link = $wpdb->get_row($query);
@@ -212,95 +192,53 @@ class PrliUtils
212
 
213
  if(isset($pretty_link->track_me) and $pretty_link->track_me)
214
  {
215
- $first_click = 0;
 
 
 
 
 
 
 
 
216
 
217
- $click_ip = isset($_SERVER['REMOTE_ADDR'])?$_SERVER['REMOTE_ADDR']:'';
218
- $click_referer = isset($_SERVER['HTTP_REFERER'])?$_SERVER['HTTP_REFERER']:'';
219
- $click_uri = isset($_SERVER['REQUEST_URI'])?$_SERVER['REQUEST_URI']:'';
220
- $click_user_agent = isset($_SERVER['HTTP_USER_AGENT'])?$_SERVER['HTTP_USER_AGENT']:'';
221
-
222
  //Set Cookie if it doesn't exist
223
  $cookie_name = 'prli_click_' . $pretty_link->id;
224
-
225
  //Used for unique click tracking
226
  $cookie_expire_time = time()+60*60*24*30; // Expire in 30 days
 
 
 
 
227
 
228
- if(!isset($_COOKIE[$cookie_name]))
 
229
  {
230
- setcookie($cookie_name,$slug,$cookie_expire_time,'/');
231
- $first_click = 1;
232
  }
233
 
234
- if(isset($prli_options->extended_tracking) and $prli_options->extended_tracking == 'extended')
 
235
  {
236
- $click_browser = $this->php_get_browser();
237
- $click_host = gethostbyaddr($click_ip);
238
-
239
- $visitor_cookie = 'prli_visitor';
240
- //Used for visitor activity
241
- $visitor_cookie_expire_time = time()+60*60*24*365; // Expire in 1 year
242
-
243
- // Retrieve / Generate visitor id
244
- if(!isset($_COOKIE[$visitor_cookie]))
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
  else
253
- {
254
- $click_browser = array( 'browser' => '', 'version' => '', 'platform' => '', 'crawler' => '' );
255
- $click_host = '';
256
- $visitor_uid = '';
257
- }
258
 
259
- if($prli_options->extended_tracking != 'count')
260
- {
261
- //Record Click in DB
262
- $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())";
263
- $insert = $wpdb->prepare($insert_str, $pretty_link->id,
264
- $visitor_uid,
265
- $click_ip,
266
- $click_user_agent,
267
- $click_browser['browser'],
268
- $click_browser['version'],
269
- $click_browser['platform'],
270
- $click_referer,
271
- $click_uri,
272
- $click_host,
273
- $first_click,
274
- $this->this_is_a_robot($click_user_agent,$click_browser));
275
-
276
- $results = $wpdb->query( $insert );
277
-
278
- do_action('prli_record_click',array('link_id' => $pretty_link->id, 'click_id' => $wpdb->insert_id, 'url' => $pretty_link_url));
279
- }
280
- else
281
- {
282
- global $prli_link_meta;
283
- $exclude_ips = explode(",", $prli_options->prli_exclude_ips);
284
- if(!in_array($click_ip, $exclude_ips) and !$this->this_is_a_robot($click_user_agent,$click_browser))
285
- {
286
- $clicks = $prli_link_meta->get_link_meta($pretty_link->id, 'static-clicks', true);
287
- $clicks = (empty($clicks) or $clicks === false)?0:$clicks;
288
- $prli_link_meta->update_link_meta($pretty_link->id, 'static-clicks', $clicks+1);
289
-
290
- if($first_click)
291
- {
292
- $uniques = $prli_link_meta->get_link_meta($pretty_link->id, 'static-uniques', true);
293
- $uniques = (empty($uniques) or $uniques === false)?0:$uniques;
294
- $prli_link_meta->update_link_meta($pretty_link->id, 'static-uniques', $uniques+1);
295
- }
296
- }
297
- }
298
  }
299
 
300
  // Reformat Parameters
301
  $param_string = '';
302
 
303
- 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)
304
  {
305
  $first_param = true;
306
  foreach($values as $key => $value)
@@ -317,27 +255,34 @@ class PrliUtils
317
  }
318
  }
319
 
320
- if(isset($pretty_link->nofollow) and $pretty_link->nofollow)
321
- header("X-Robots-Tag: noindex, nofollow", true);
322
-
323
- switch($pretty_link->redirect_type)
324
  {
325
- case '301':
326
- header("HTTP/1.1 301 Moved Permanently");
327
- header('Location: '.$pretty_link_url.$param_string);
328
- break;
329
- default:
330
- if( $pretty_link->redirect_type == '307' or
331
- !$prli_update->pro_is_installed_and_authorized() )
 
 
 
 
 
 
 
 
 
332
  {
333
  if($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.0')
334
  header("HTTP/1.1 302 Found");
335
  else
336
  header("HTTP/1.1 307 Temporary Redirect");
337
- header('Location: '.$pretty_link_url.$param_string);
338
  }
339
- else
340
- do_action('prli_issue_cloaked_redirect', $pretty_link->redirect_type, $pretty_link, $pretty_link_url, $param_string);
 
341
  }
342
  }
343
 
@@ -543,7 +488,7 @@ class PrliUtils
543
  case '}':
544
  if(!empty($index_str) and !empty($value_str))
545
  {
546
- $json_array[$index_str] = $this->prli_decode_json_unicode($value_str);
547
  $index_str = '';
548
  $value_str = '';
549
  }
@@ -552,7 +497,7 @@ class PrliUtils
552
  case ']':
553
  if(!empty($value_str))
554
  {
555
- $json_array[] = $this->prli_decode_json_unicode($value_str);
556
  $value_str = '';
557
  }
558
  return array($i,$json_array);
@@ -601,7 +546,7 @@ class PrliUtils
601
  {
602
  if(!empty($index_str) and !empty($value_str))
603
  {
604
- $json_array[$index_str] = $this->prli_decode_json_unicode($value_str);
605
  $index_str = '';
606
  $value_str = '';
607
  }
@@ -613,7 +558,7 @@ class PrliUtils
613
  {
614
  if(!empty($value_str))
615
  {
616
- $json_array[] = $this->prli_decode_json_unicode($value_str);
617
  $value_str = '';
618
  }
619
 
@@ -635,17 +580,6 @@ class PrliUtils
635
  return array(-1,$json_array);
636
  }
637
 
638
- function prli_decode_json_unicode($val)
639
- {
640
- $val = preg_replace_callback("/\\\u([0-9a-fA-F]{4})/",
641
- create_function(
642
- '$matches',
643
- 'return html_entity_decode("&#".hexdec($matches[1]).";",ENT_COMPAT,"UTF-8");'
644
- ),
645
- $val);
646
- return $val;
647
- }
648
-
649
  // Get the timestamp of the start date
650
  function get_start_date($values,$min_date = '')
651
  {
@@ -683,485 +617,274 @@ class PrliUtils
683
  return (( $where == '' )?'':$starts_with . $where);
684
  }
685
 
686
- function uninstall_pro()
 
687
  {
688
- $prlipro_path = PRLI_PATH . '/pro';
689
 
690
- // unlink pro directory
691
- $this->delete_dir($prlipro_path);
692
-
693
- delete_option( 'prlipro_activated' );
694
- delete_option( 'prlipro_username' );
695
- delete_option( 'prlipro_password' );
696
- delete_option( 'prlipro-credentials' );
697
-
698
- // Yah- I just leave the pro database tables & data hanging
699
- // around in case you want to re-install it at some point
700
- }
701
 
702
- function install_pro_db()
703
- {
704
- global $wpdb, $prlipro_db_version;
705
 
706
- $old_pro_db_version = get_option('prlipro_db_version');
 
 
 
 
707
 
708
- if($prlipro_db_version != $old_pro_db_version)
709
- {
710
- $upgrade_path = ABSPATH . 'wp-admin/includes/upgrade.php';
711
- require_once($upgrade_path);
712
-
713
- // Pretty Link Pro Tables
714
- $tweets_table = "{$wpdb->prefix}prli_tweets";
715
- $keywords_table = "{$wpdb->prefix}prli_keywords";
716
- $reports_table = "{$wpdb->prefix}prli_reports";
717
- $report_links_table = "{$wpdb->prefix}prli_report_links";
718
- $link_rotations_table = "{$wpdb->prefix}prli_link_rotations";
719
- $clicks_rotations_table = "{$wpdb->prefix}prli_clicks_rotations";
720
-
721
- $charset_collate = '';
722
- if( $wpdb->has_cap( 'collation' ) )
723
- {
724
- if( !empty($wpdb->charset) )
725
- $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
726
- if( !empty($wpdb->collate) )
727
- $charset_collate .= " COLLATE $wpdb->collate";
728
  }
729
-
730
- /* Create/Upgrade Tweets Table */
731
- $sql = "CREATE TABLE {$tweets_table} (
732
- id int(11) NOT NULL auto_increment,
733
- twid varchar(255) NOT NULL,
734
- tw_text varchar(255) default NULL,
735
- tw_to_user_id varchar(255) default NULL,
736
- tw_from_user varchar(255) default NULL,
737
- tw_from_user_id varchar(255) NOT NULL,
738
- tw_iso_language_code varchar(255) default NULL,
739
- tw_source varchar(255) default NULL,
740
- tw_profile_image_url varchar(255) default NULL,
741
- tw_created_at varchar(255) NOT NULL,
742
- created_at datetime NOT NULL,
743
- link_id int(11) default NULL,
744
- PRIMARY KEY (id),
745
- KEY link_id (link_id),
746
- KEY twid (twid)
747
- ) {$charset_collate};";
748
-
749
- dbDelta($sql);
750
-
751
- /* Create/Upgrade Keywords Table */
752
- $sql = "CREATE TABLE {$keywords_table} (
753
- id int(11) NOT NULL auto_increment,
754
- text varchar(255) NOT NULL,
755
- link_id int(11) NOT NULL,
756
- created_at datetime NOT NULL,
757
- PRIMARY KEY (id),
758
- KEY link_id (link_id)
759
- ) {$charset_collate};";
760
-
761
- dbDelta($sql);
762
-
763
- /* Create/Upgrade Reports Table */
764
- $sql = "CREATE TABLE {$reports_table} (
765
- id int(11) NOT NULL auto_increment,
766
- name varchar(255) NOT NULL,
767
- goal_link_id int(11) default NULL,
768
- created_at datetime NOT NULL,
769
- PRIMARY KEY (id),
770
- KEY goal_link_id (goal_link_id)
771
- ) {$charset_collate};";
772
-
773
- dbDelta($sql);
774
-
775
- /* Create/Upgrade Reports Table */
776
- $sql = "CREATE TABLE {$report_links_table} (
777
- id int(11) NOT NULL auto_increment,
778
- report_id int(11) NOT NULL,
779
- link_id int(11) NOT NULL,
780
- created_at datetime NOT NULL,
781
- PRIMARY KEY (id),
782
- KEY report_id (report_id),
783
- KEY link_id (link_id)
784
- ) {$charset_collate};";
785
-
786
- dbDelta($sql);
787
-
788
- /* Create/Upgrade Link Rotations Table */
789
- $sql = "CREATE TABLE {$link_rotations_table} (
790
- id int(11) NOT NULL auto_increment,
791
- url varchar(255) default NULL,
792
- weight int(11) default 0,
793
- r_index int(11) default 0,
794
- link_id int(11) NOT NULL,
795
- created_at datetime NOT NULL,
796
- PRIMARY KEY (id),
797
- KEY link_id (link_id)
798
- ) {$charset_collate};";
799
-
800
- dbDelta($sql);
801
-
802
- /* Create/Upgrade Clicks / Rotations Table */
803
- $sql = "CREATE TABLE {$clicks_rotations_table} (
804
- id int(11) NOT NULL auto_increment,
805
- click_id int(11) NOT NULL,
806
- link_id int(11) NOT NULL,
807
- url text NOT NULL,
808
- PRIMARY KEY (id),
809
- KEY click_id (click_id),
810
- KEY link_id (link_id)
811
- ) {$charset_collate};";
812
-
813
- dbDelta($sql);
814
  }
815
 
816
- /***** SAVE DB VERSION *****/
817
- delete_option('prlipro_db_version');
818
- add_option('prlipro_db_version',$prlipro_db_version);
819
  }
820
 
821
- // be careful with this one -- I use it to forceably reinstall pretty link pro
822
- function delete_dir($dir)
823
  {
824
- if (!file_exists($dir))
825
- return true;
826
-
827
- if (!is_dir($dir))
828
- return unlink($dir);
829
-
830
- foreach (scandir($dir) as $item)
831
- {
832
- if ($item == '.' || $item == '..')
833
- continue;
834
-
835
- if (!$this->delete_dir($dir.DIRECTORY_SEPARATOR.$item))
836
- return false;
837
- }
838
-
839
- return rmdir($dir);
840
  }
841
 
842
- // Used in the install procedure to migrate database columns
843
- function migrate_before_db_upgrade()
844
  {
845
- global $prli_options, $prli_update, $prli_link, $prli_click, $wpdb;
846
- $db_version = (int)get_option('prli_db_version');
847
-
848
- if(!$db_version)
849
- return;
850
-
851
- // Migration for version 1 of the database
852
- if($db_version and $db_version < 1)
853
  {
854
- $query = "SELECT * from {$prli_link->table_name}";
855
- $links = $wpdb->get_results($query);
856
- $query_str = "UPDATE {$prli_link->table_name} SET redirect_type=%s WHERE id=%d";
857
 
858
- foreach($links as $link)
859
- {
860
- if(isset($link->track_as_img) and $link->track_as_img)
861
- {
862
- $query = $wpdb->prepare($query_str, 'pixel', $link->id);
863
- $wpdb->query($query);
864
- }
865
- else if(isset($link->use_prettybar) and $link->use_prettybar)
866
- {
867
- $query = $wpdb->prepare($query_str, 'prettybar', $link->id);
868
- $wpdb->query($query);
869
- }
870
- else if(isset($link->use_ultra_cloak) and $link->use_ultra_cloak)
871
- {
872
- $query = $wpdb->prepare($query_str, 'cloak', $link->id);
873
- $wpdb->query($query);
874
- }
875
- }
876
-
877
- $query = "ALTER TABLE {$prli_link->table_name} DROP COLUMN track_as_img, DROP COLUMN use_prettybar, DROP COLUMN use_ultra_cloak, DROP COLUMN gorder";
878
- $wpdb->query($query);
879
- }
880
-
881
- if($db_version and $db_version < 2)
882
- {
883
- unset($prli_options->prli_exclude_ips);
884
- unset($prli_options->prettybar_image_url);
885
- unset($prli_options->prettybar_background_image_url);
886
- unset($prli_options->prettybar_color);
887
- unset($prli_options->prettybar_text_color);
888
- unset($prli_options->prettybar_link_color);
889
- unset($prli_options->prettybar_hover_color);
890
- unset($prli_options->prettybar_visited_color);
891
- unset($prli_options->prettybar_title_limit);
892
- unset($prli_options->prettybar_desc_limit);
893
- unset($prli_options->prettybar_link_limit);
894
-
895
- // Save the posted value in the database
896
- update_option( 'prli_options', $prli_options );
897
  }
 
 
 
898
 
899
- // Modify the tables so they're UTF-8
900
- if($db_version and $db_version < 3)
901
- {
902
- $charset_collate = '';
903
- if( $wpdb->has_cap( 'collation' ) )
904
- {
905
- if( !empty($wpdb->charset) )
906
- $charset_collate = "CONVERT TO CHARACTER SET $wpdb->charset";
907
- if( !empty($wpdb->collate) )
908
- $charset_collate .= " COLLATE $wpdb->collate";
909
- }
910
 
911
- if(!empty($charset_collate))
912
- {
913
- $prli_table_names = array( "{$wpdb->prefix}prli_groups",
914
- "{$wpdb->prefix}prli_clicks",
915
- "{$wpdb->prefix}prli_links",
916
- "{$wpdb->prefix}prli_link_metas",
917
- "{$wpdb->prefix}prli_tweets",
918
- "{$wpdb->prefix}prli_keywords",
919
- "{$wpdb->prefix}prli_reports",
920
- "{$wpdb->prefix}prli_report_links",
921
- "{$wpdb->prefix}prli_link_rotations",
922
- "{$wpdb->prefix}prli_clicks_rotations" );
923
-
924
- foreach($prli_table_names as $prli_table_name)
925
- {
926
- $query = "ALTER TABLE {$prli_table_name} {$charset_collate}";
927
- $wpdb->query($query);
928
- }
929
- }
930
- }
931
-
932
- // Upgrade the twitter hide badges on pages / posts for pro users
933
- if($db_version and $db_version < 7)
934
- {
935
- if($prli_update->pro_is_installed())
936
- {
937
- global $prlipro_options;
938
 
939
- if(trim($prlipro_options->twitter_badge_hidden) != '')
940
- {
941
- $hidden_post_ids = explode(',',trim($prlipro_options->twitter_badge_hidden));
942
- foreach($hidden_post_ids as $post_id)
943
- {
944
- $prlipro_post_options = PrliProPostOptions::get_stored_object($post_id);
945
- $prlipro_post_options->hide_twitter_button = 1;
946
- $prlipro_post_options->store($post_id);
947
- }
948
- }
949
- }
950
- }
951
-
952
- if($db_version and $db_version < 8)
953
- {
954
- // Install / Upgrade Pretty Link Pro
955
- $prlipro_username = get_option( 'prlipro_username' );
956
- $prlipro_password = get_option( 'prlipro_password' );
957
 
958
- if( !empty($prlipro_username) and !empty($prlipro_password) )
959
- {
960
- $creds = array('username' => $prlipro_username,
961
- 'password' => $prlipro_password);
962
- update_option('prlipro-credentials', $creds);
963
- }
964
- }
965
 
966
- // Hiding pretty link custom fields
967
- if($db_version and $db_version < 10)
968
- {
969
- $query_str = "UPDATE {$wpdb->postmeta} SET meta_key=%s WHERE meta_key=%s";
970
 
971
- $query = $wpdb->prepare($query_str, '_pretty-link', 'pretty-link');
972
- $wpdb->query($query);
 
973
 
974
- $query = $wpdb->prepare($query_str, '_prli-keyword-cached-content', 'prli-keyword-cached-content');
975
- $wpdb->query($query);
976
 
977
- $query = $wpdb->prepare($query_str, '_prlipro-post-options', 'prlipro-post-options');
978
- $wpdb->query($query);
979
- }
980
 
981
- if($db_version and $db_version < 11)
982
  {
983
- /* Too much to handle on larger tweet databases -- this code will still be accessible by going to the following url:
984
- {$prli_blogurl}/wp-admin/admin.php?page=pretty-link/pro/prlipro-options.php&action=trim_dup_tweets
985
- // Clearing out duplicate tweets
986
- if($prli_update->pro_is_installed())
987
  {
988
- $block_size = 2000;
989
- $upper_limit = $block_size - 1;
990
- $tweet_table = "{$wpdb->prefix}prli_tweets";
991
-
992
- $query = $wpdb->prepare("SELECT count(DISTINCT twid) FROM {$tweet_table}");
993
- $twid_count = $wpdb->get_var($query);
994
-
995
- for($offset=0; $offset < $twid_count; $offset += $block_size)
996
  {
997
- $limit = $offset + $upper_limit;
998
- $query = $wpdb->prepare("SELECT id FROM {$tweet_table} GROUP BY twid LIMIT %d,%d",$offset,$limit);
999
- $tweet_ids = $wpdb->get_col($query);
1000
-
1001
- if(is_array($tweet_ids) and count($tweet_ids) > 0)
1002
- {
1003
- $query = $wpdb->prepare("DELETE FROM {$tweet_table} WHERE id not in (" . implode(',', $tweet_ids) . ")");
1004
- $wpdb->query($query);
1005
- }
1006
  }
1007
- }
1008
- */
1009
- }
1010
- }
1011
-
1012
-
1013
- function migrate_after_db_upgrade()
1014
- {
1015
- global $prli_options, $prli_link, $prli_link_meta, $prli_click, $wpdb;
1016
- $db_version = (int)get_option('prli_db_version');
1017
-
1018
- if(!$db_version)
1019
- return;
1020
-
1021
- if($db_version and $db_version < 5)
1022
- {
1023
- // Migrate pretty-link-posted-to-twitter
1024
- $query = "SELECT * FROM {$wpdb->prefix}postmeta WHERE meta_key=%s";
1025
- $query = $wpdb->prepare($query,'pretty-link-posted-to-twitter');
1026
- $posts_posted = $wpdb->get_results($query);
1027
-
1028
- foreach($posts_posted as $postmeta)
1029
- {
1030
- if($postmeta->meta_value == '1')
1031
  {
1032
- $link_id = PrliUtils::get_prli_post_meta($postmeta->post_id,'pretty-link',true);
1033
- $prli_link_meta->update_link_meta($link_id,'pretty-link-posted-to-twitter','1');
1034
  }
1035
- }
1036
 
1037
- // Cleanup
1038
- $query = "DELETE FROM {$wpdb->prefix}postmeta WHERE meta_key=%s OR meta_key=%s OR meta_key=%s OR meta_key=%s";
1039
- $query = $wpdb->prepare($query,'pretty-link-posted-to-twitter','pretty-link-tweet-count','pretty-link-tweet-last-update','prli-keyword-replacement-count');
1040
- $results = $wpdb->query($query);
1041
 
1042
- $query = "DELETE FROM {$prli_link_meta->table_name} WHERE meta_key=%s";
1043
- $query = $wpdb->prepare($query,'prli-url-aliases');
1044
- $results = $wpdb->query($query);
1045
- }
1046
- }
1047
 
1048
- function this_is_a_robot($browser_ua,&$browsecap,$header='')
1049
- {
1050
- $click = new PrliClick();
1051
- $click->browser = $browser_ua;
1052
- $click->btype = $browsecap['browser'];
1053
- return $this->is_robot($click, $browsecap, $header);
1054
- }
1055
 
1056
- function is_robot(&$click,&$browsecap,$header='')
1057
- {
1058
- global $prli_utils, $prli_click, $prli_options;
1059
- $ua_string = trim(urldecode($click->browser));
1060
- $btype = trim($click->btype);
1061
 
1062
- // Yah, if the whole user agent string is missing -- wtf?
1063
- if(empty($ua_string))
1064
- return 1;
1065
 
1066
- // If we're doing extended tracking and the Browser type
1067
- // was unidentifiable then it's most likely a bot
1068
- if( isset($prli_options->extended_tracking) and
1069
- $prli_options->extended_tracking == 'extended' and
1070
- empty($btype) )
1071
- return 1;
1072
 
1073
- // Some bots actually say they're bots right up front let's get rid of them asap
1074
- if(preg_match("#(bot|Bot|spider|Spider|crawl|Crawl)#",$ua_string))
1075
- return 1;
1076
-
1077
- $crawler = $browsecap['crawler'];
1078
-
1079
- // If php_browsecap tells us its a bot, let's believe him
1080
- if($crawler == 1)
1081
- return 1;
1082
 
1083
- return 0;
1084
- }
1085
-
1086
- function get_permalink_pre_slug_uri($force=false,$trim=false)
1087
- {
1088
- global $prli_options;
1089
-
1090
- if($force or $prli_options->link_prefix)
1091
- {
1092
- preg_match('#^([^%]*?)%#', get_option('permalink_structure'), $struct);
1093
- $pre_slug_uri = $struct[1];
1094
-
1095
- if($trim)
1096
- {
1097
- $pre_slug_uri = trim($pre_slug_uri);
1098
- $pre_slug_uri = preg_replace('#^/#','',$pre_slug_uri);
1099
- $pre_slug_uri = preg_replace('#/$#','',$pre_slug_uri);
1100
  }
 
 
 
 
 
 
 
1101
 
1102
- return $pre_slug_uri;
 
 
1103
  }
1104
  else
1105
- return '/';
 
 
1106
  }
1107
 
1108
- function get_permalink_pre_slug_regex()
1109
  {
1110
- $pre_slug_uri = PrliUtils::get_permalink_pre_slug_uri(true);
1111
 
1112
- if(empty($pre_slug_uri))
1113
- return '/';
1114
- else
1115
- return "{$pre_slug_uri}|/";
1116
- }
1117
 
1118
- function rewriting_on()
1119
- {
1120
- $permalink_structure = get_option('permalink_structure');
1121
-
1122
- return ($permalink_structure and !empty($permalink_structure));
1123
- }
1124
-
1125
- function get_prli_post_meta($post_id, $key, $single=false)
1126
- {
1127
- if( isset($post_id) and !empty($post_id) and
1128
- $post_id and is_numeric($post_id) )
1129
- return get_post_meta($post_id, $key, $single);
1130
- else
1131
- return false;
1132
  }
1133
 
1134
- function update_prli_post_meta($post_id, $meta_key, $meta_value)
1135
  {
1136
- if( isset($post_id) and !empty($post_id) and
1137
- $post_id and is_numeric($post_id) )
1138
- return update_post_meta($post_id, $meta_key, $meta_value);
1139
- else
1140
- return false;
1141
- }
1142
 
1143
- function delete_prli_post_meta($post_id, $key)
1144
- {
1145
- if( isset($post_id) and !empty($post_id) and
1146
- $post_id and is_numeric($post_id) )
1147
- return delete_post_meta($post_id, $key);
1148
- else
1149
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1150
  }
1151
 
1152
- /** Gets rid of any pretty link postmetas created without a post_id **/
1153
- function clear_unknown_post_metas()
1154
  {
1155
- global $wpdb;
1156
-
1157
- $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";
1158
- $count = $wpdb->get_var($query);
1159
 
1160
- if($count)
 
 
 
1161
  {
1162
- $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";
1163
- $wpdb->query($query);
 
 
 
1164
  }
 
 
1165
  }
 
1166
  }
1167
  ?>
83
  function getFirstRecordNum($r_count,$current_p,$p_size)
84
  {
85
  if($current_p == 1)
86
+ {
87
  return 1;
88
+ }
89
  else
90
+ {
91
  return ($this->getLastRecordNum($r_count,($current_p - 1),$p_size) + 1);
92
+ }
93
  }
94
 
95
  function slugIsAvailable( $full_slug, $id = '' )
102
  $slug = $slug_components[0];
103
 
104
  // Check slug uniqueness against posts, pages and categories
105
+ $posts_table = $wpdb->prefix . "posts";
106
+ $terms_table = $wpdb->prefix . "terms";
107
 
108
+ $post_slug = $wpdb->get_var("SELECT post_name FROM $posts_table WHERE post_name='$slug'");
109
+ $term_slug = $wpdb->get_col("SELECT slug FROM $terms_table WHERE slug='$slug'");
110
+
111
+ if( $post_slug == $slug or $term_slug == $slug )
112
  return false;
113
 
114
  // Check slug against files on the root wordpress install
122
 
123
  // Check slug against other slugs in the prli links database.
124
  // We'll use the full_slug here because its easier to guarantee uniqueness.
125
+ if($id != null and $id != '')
126
+ $query = "SELECT slug FROM " . $prli_link->table_name . " WHERE slug='" . $full_slug . "' AND id <> " . $id;
127
  else
128
+ $query = "SELECT slug FROM " . $prli_link->table_name . " WHERE slug='" . $full_slug . "'";
129
 
130
  $link_slug = $wpdb->get_var($query);
131
 
132
  if( $link_slug == $full_slug )
133
  return false;
134
 
 
 
 
 
 
135
  // TODO: Check permalink structure to avoid the ability of creating a year or something as a slug
136
 
137
  return true;
138
  }
139
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  /* Needed because we don't know if the target uesr will have a browsercap file installed
141
  on their server ... particularly in a shared hosting environment this is difficult
142
  */
146
  $yu=array();
147
  $q_s=array("#\.#","#\*#","#\?#");
148
  $q_r=array("\.",".*",".?");
149
+ $brows=parse_ini_file(PRLI_PATH."/includes/php/php_browsecap.ini",true);
150
+ foreach($brows as $k=>$t)
 
151
  {
152
+ if(fnmatch($k,$agent))
153
  {
154
+ $yu['browser_name_pattern']=$k;
155
+ $pat=preg_replace($q_s,$q_r,$k);
156
+ $yu['browser_name_regex']=strtolower("^$pat$");
157
+ foreach($brows as $g=>$r)
158
  {
159
+ if($t['Parent']==$g)
 
 
 
160
  {
161
+ foreach($brows as $a=>$b)
162
  {
163
+ if($r['Parent']==$a)
164
  {
165
+ $yu=array_merge($yu,$b,$r,$t);
166
+ foreach($yu as $d=>$z)
167
  {
168
+ $l=strtolower($d);
169
+ $hu[$l]=$z;
 
 
 
 
170
  }
171
  }
172
  }
173
  }
 
 
174
  }
175
+
176
+ break;
177
  }
178
  }
179
 
183
  // This is where the magic happens!
184
  function track_link($slug,$values)
185
  {
186
+ global $wpdb, $prli_click, $prli_link;
187
 
188
  $query = "SELECT * FROM ".$prli_link->table_name." WHERE slug='$slug' LIMIT 1";
189
  $pretty_link = $wpdb->get_row($query);
192
 
193
  if(isset($pretty_link->track_me) and $pretty_link->track_me)
194
  {
195
+ $first_click = false;
196
+
197
+ $click_ip = $_SERVER['REMOTE_ADDR'];
198
+ $click_referer = $_SERVER['HTTP_REFERER'];
199
+ $click_host = gethostbyaddr($click_ip);
200
+
201
+ $click_uri = $_SERVER['REQUEST_URI'];
202
+ $click_user_agent = $_SERVER['HTTP_USER_AGENT'];
203
+ $click_browser = $this->php_get_browser();
204
 
 
 
 
 
 
205
  //Set Cookie if it doesn't exist
206
  $cookie_name = 'prli_click_' . $pretty_link->id;
 
207
  //Used for unique click tracking
208
  $cookie_expire_time = time()+60*60*24*30; // Expire in 30 days
209
+
210
+ $visitor_cookie = 'prli_visitor';
211
+ //Used for visitor activity
212
+ $visitor_cookie_expire_time = time()+60*60*24*365; // Expire in 1 year
213
 
214
+
215
+ if($_COOKIE[$cookie_name] == null)
216
  {
217
+ setcookie($cookie_name,$slug,$cookie_expire_time);
218
+ $first_click = true;
219
  }
220
 
221
+ // Retrieve / Generate visitor id
222
+ if($_COOKIE[$visitor_cookie] == null)
223
  {
224
+ $visitor_uid = $prli_click->generateUniqueVisitorId();
225
+ setcookie($visitor_cookie,$visitor_uid,$visitor_cookie_expire_time);
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  }
227
  else
228
+ $visitor_uid = $_COOKIE[$visitor_cookie];
229
+
230
+ //Record Click in DB
231
+ $insert = "INSERT INTO ".$prli_click->table_name." (link_id,vuid,ip,browser,btype,bversion,os,referer,uri,host,first_click,created_at) VALUES ($pretty_link->id,'$visitor_uid','$click_ip','$click_user_agent','".$click_browser['browser']."','".$click_browser['version']."','".$click_browser['platform']."','$click_referer','$click_uri','$click_host','$first_click',NOW())";
 
232
 
233
+ $results = $wpdb->query( $insert );
234
+
235
+ do_action('prli_record_click',array('link_id' => $pretty_link->id, 'click_id' => $wpdb->insert_id, 'url' => $pretty_link_url));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  }
237
 
238
  // Reformat Parameters
239
  $param_string = '';
240
 
241
+ if(isset($pretty_link->param_forwarding) and $pretty_link->param_forwarding and isset($values) and count($values) >= 1)
242
  {
243
  $first_param = true;
244
  foreach($values as $key => $value)
255
  }
256
  }
257
 
258
+ //Redirect to Product URL
259
+ if(!isset($pretty_link->track_as_img) or $pretty_link->track_as_img == 0)
 
 
260
  {
261
+ if(isset($pretty_link->nofollow) and $pretty_link->nofollow)
262
+ header('X-Robots-Tag: noindex, nofollow');
263
+
264
+ // If we're using the pretty bar then don't redirect -- load the pretty bar view
265
+ if( isset($pretty_link->use_prettybar) and $pretty_link->use_prettybar )
266
+ {
267
+ global $prli_blogurl;
268
+ require_once PRLI_VIEWS_PATH . '/prli-links/bar.php';
269
+ }
270
+ else if( isset($pretty_link->use_ultra_cloak) and $pretty_link->use_ultra_cloak )
271
+ require_once PRLI_VIEWS_PATH . '/prli-links/ultra-cloak.php';
272
+ else
273
+ {
274
+ if ((int)$pretty_link->redirect_type == 301)
275
+ header("HTTP/1.1 301 Moved Permanently");
276
+ elseif ((int)$pretty_link->redirect_type == 307)
277
  {
278
  if($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.0')
279
  header("HTTP/1.1 302 Found");
280
  else
281
  header("HTTP/1.1 307 Temporary Redirect");
 
282
  }
283
+
284
+ header('Location: '.$pretty_link_url.$param_string);
285
+ }
286
  }
287
  }
288
 
488
  case '}':
489
  if(!empty($index_str) and !empty($value_str))
490
  {
491
+ $json_array[$index_str] = htmlspecialchars_decode(stripslashes($value_str));
492
  $index_str = '';
493
  $value_str = '';
494
  }
497
  case ']':
498
  if(!empty($value_str))
499
  {
500
+ $json_array[] = htmlspecialchars_decode(stripslashes($value_str));
501
  $value_str = '';
502
  }
503
  return array($i,$json_array);
546
  {
547
  if(!empty($index_str) and !empty($value_str))
548
  {
549
+ $json_array[$index_str] = htmlspecialchars_decode(stripslashes($value_str));
550
  $index_str = '';
551
  $value_str = '';
552
  }
558
  {
559
  if(!empty($value_str))
560
  {
561
+ $json_array[] = htmlspecialchars_decode(stripslashes($value_str));
562
  $value_str = '';
563
  }
564
 
580
  return array(-1,$json_array);
581
  }
582
 
 
 
 
 
 
 
 
 
 
 
 
583
  // Get the timestamp of the start date
584
  function get_start_date($values,$min_date = '')
585
  {
617
  return (( $where == '' )?'':$starts_with . $where);
618
  }
619
 
620
+ // Determines whether or not Pretty Link Pro is installed and activated
621
+ function pro_is_installed()
622
  {
623
+ $activated = get_option('prlipro_activated');
624
 
625
+ if(!$activated)
626
+ {
627
+ $username = get_option( 'prlipro_username' );
628
+ $password = get_option( 'prlipro_password' );
 
 
 
 
 
 
 
629
 
630
+ if($username and $password)
631
+ {
632
+ $user_type = $this->get_pro_user_type($username, $password);
633
 
634
+ if(!empty($user_type))
635
+ {
636
+ // Tells us that Pro has been activated
637
+ delete_option('prlipro_activated');
638
+ add_option('prlipro_activated',1);
639
 
640
+ $activated = true;
641
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
642
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
643
  }
644
 
645
+
646
+ return ( $activated and $this->pro_files_installed() );
 
647
  }
648
 
649
+ function pro_files_installed()
 
650
  {
651
+ return file_exists(PRLI_PATH . "/pro/pretty-link-pro.php");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
652
  }
653
 
654
+ function get_pro_version()
 
655
  {
656
+ if($this->pro_is_installed())
 
 
 
 
 
 
 
657
  {
658
+ require_once(PRLI_PATH . "/pro/prlipro-config.php");
659
+ global $prlipro_version;
 
660
 
661
+ return $prlipro_version;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
662
  }
663
+ else
664
+ return 0;
665
+ }
666
 
667
+ function get_pro_user_type($username, $password)
668
+ {
669
+ include_once(ABSPATH."wp-includes/class-IXR.php");
 
 
 
 
 
 
 
 
670
 
671
+ $client = new IXR_Client('http://prettylinkpro.com/xmlrpc.php');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
672
 
673
+ if (!$client->query('prlipro.get_user_type',$username,$password))
674
+ return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
675
 
676
+ $type = $client->getResponse();
 
 
 
 
 
 
677
 
678
+ return $type;
679
+ }
 
 
680
 
681
+ function download_and_install_pro($username, $password, $force = false)
682
+ {
683
+ global $prli_version, $wpdb;
684
 
685
+ include_once(ABSPATH."wp-includes/class-IXR.php");
 
686
 
687
+ $client = new IXR_Client('http://prettylinkpro.com/xmlrpc.php');
688
+ $user_type = $this->get_pro_user_type($username, $password);
 
689
 
690
+ if(!empty($user_type))
691
  {
692
+ if($force or !$this->pro_files_installed())
 
 
 
693
  {
694
+ // Test to make sure this sheesh is writeable
695
+ $handle = fopen(PRLI_PATH . '/098j1248iomv.txt', 'w');
696
+ if(!$handle)
 
 
 
 
 
697
  {
698
+ return "Your account was validated but " . PRLI_PATH . " is not writeable<br/>Talk to your webhost about increasing your write permissions or install using the <a href=\"http://prettylinkpro.com/user-manual/pretty-link-pro-manual-installation/\">Manual Install</a> Process";
 
 
 
 
 
 
 
 
699
  }
700
+ else
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
701
  {
702
+ fclose($handle);
703
+ unlink(PRLI_PATH . '/098j1248iomv.txt');
704
  }
 
705
 
706
+ // Get the file
707
+ if (!$client->query('prlipro.download_upgrade_file',$username,$password,$prli_version))
708
+ return $client->getErrorCode() . ": " . $client->getErrorMessage();
 
709
 
710
+ $zipfile_str = $client->getResponse();
 
 
 
 
711
 
712
+ $zipfilename = PRLI_PATH . "/pretty-link-pro-{$prli_version}.zip";
 
 
 
 
 
 
713
 
714
+ // Write the transferred string out as a file
715
+ $fh = fopen($zipfilename, 'w');
716
+ fwrite($fh, $zipfile_str);
717
+ fclose($fh);
 
718
 
719
+ // Unzip the file
720
+ include_once(ABSPATH.'wp-admin/includes/class-pclzip.php');
721
+ $prlipro_path = PRLI_PATH . '/pro';
722
 
723
+ // unlink pro directory if force is set to true
724
+ if($force)
725
+ $this->delete_dir($prlipro_path);
 
 
 
726
 
727
+ $archive = new PclZip($zipfilename);
728
+ if( !($archive_files = $archive->extract( PCLZIP_OPT_PATH, PRLI_PATH ) ) )
729
+ return("Unzip Error : ".$archive->errorInfo(true));
 
 
 
 
 
 
730
 
731
+ // Unlink the zip file
732
+ unlink($zipfilename);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
733
  }
734
+
735
+ $this->install_pro_db();
736
+
737
+ // Delete all Pro Keyword Caches if they exist
738
+ $postmeta_table = "{$wpdb->prefix}postmeta";
739
+ $query = $wpdb->prepare("DELETE FROM {$postmeta_table} WHERE meta_key=%s", 'prli-keyword-cached-content');
740
+ $wpdb->query($query);
741
 
742
+ // Tells us that Pro has been activated
743
+ delete_option('prlipro_activated');
744
+ add_option('prlipro_activated',1);
745
  }
746
  else
747
+ return("Your Username and/or Password are not valid");
748
+
749
+ return 'SUCCESS';
750
  }
751
 
752
+ function uninstall_pro()
753
  {
754
+ $prlipro_path = PRLI_PATH . '/pro';
755
 
756
+ // unlink pro directory
757
+ $this->delete_dir($prlipro_path);
 
 
 
758
 
759
+ delete_option( 'prlipro_activated' );
760
+ delete_option( 'prlipro_username' );
761
+ delete_option( 'prlipro_password' );
762
+
763
+ // Yah- I just leave the pro database tables & data hanging
764
+ // around in case you want to re-install it at some point
 
 
 
 
 
 
 
 
765
  }
766
 
767
+ function install_pro_db()
768
  {
769
+ global $wpdb;
 
 
 
 
 
770
 
771
+ $upgrade_path = ABSPATH . 'wp-admin/includes/upgrade.php';
772
+ require_once($upgrade_path);
773
+
774
+ // Pretty Link Pro Tables
775
+ $tweets_table = "{$wpdb->prefix}prli_tweets";
776
+ $keywords_table = "{$wpdb->prefix}prli_keywords";
777
+ $reports_table = "{$wpdb->prefix}prli_reports";
778
+ $report_links_table = "{$wpdb->prefix}prli_report_links";
779
+ $link_rotations_table = "{$wpdb->prefix}prli_link_rotations";
780
+ $clicks_rotations_table = "{$wpdb->prefix}prli_clicks_rotations";
781
+
782
+ /* Create/Upgrade Tweets Table */
783
+ $sql = "CREATE TABLE {$tweets_table} (
784
+ id int(11) NOT NULL auto_increment,
785
+ twid varchar(255) NOT NULL,
786
+ tw_text varchar(255) default NULL,
787
+ tw_to_user_id varchar(255) default NULL,
788
+ tw_from_user varchar(255) default NULL,
789
+ tw_from_user_id varchar(255) NOT NULL,
790
+ tw_iso_language_code varchar(255) default NULL,
791
+ tw_source varchar(255) default NULL,
792
+ tw_profile_image_url varchar(255) default NULL,
793
+ tw_created_at varchar(255) NOT NULL,
794
+ created_at datetime NOT NULL,
795
+ link_id int(11) default NULL,
796
+ PRIMARY KEY (id),
797
+ KEY link_id (link_id),
798
+ KEY twid (twid)
799
+ );";
800
+
801
+ dbDelta($sql);
802
+
803
+ /* Create/Upgrade Keywords Table */
804
+ $sql = "CREATE TABLE {$keywords_table} (
805
+ id int(11) NOT NULL auto_increment,
806
+ text varchar(255) NOT NULL,
807
+ link_id int(11) NOT NULL,
808
+ created_at datetime NOT NULL,
809
+ PRIMARY KEY (id),
810
+ KEY link_id (link_id)
811
+ );";
812
+
813
+ dbDelta($sql);
814
+
815
+ /* Create/Upgrade Reports Table */
816
+ $sql = "CREATE TABLE {$reports_table} (
817
+ id int(11) NOT NULL auto_increment,
818
+ name varchar(255) NOT NULL,
819
+ goal_link_id int(11) default NULL,
820
+ created_at datetime NOT NULL,
821
+ PRIMARY KEY (id),
822
+ KEY goal_link_id (goal_link_id)
823
+ );";
824
+
825
+ dbDelta($sql);
826
+
827
+ /* Create/Upgrade Reports Table */
828
+ $sql = "CREATE TABLE {$report_links_table} (
829
+ id int(11) NOT NULL auto_increment,
830
+ report_id int(11) NOT NULL,
831
+ link_id int(11) NOT NULL,
832
+ created_at datetime NOT NULL,
833
+ PRIMARY KEY (id),
834
+ KEY report_id (report_id),
835
+ KEY link_id (link_id)
836
+ );";
837
+
838
+ dbDelta($sql);
839
+
840
+ /* Create/Upgrade Link Rotations Table */
841
+ $sql = "CREATE TABLE {$link_rotations_table} (
842
+ id int(11) NOT NULL auto_increment,
843
+ url varchar(255) default NULL,
844
+ weight int(11) default 0,
845
+ r_index int(11) default 0,
846
+ link_id int(11) NOT NULL,
847
+ created_at datetime NOT NULL,
848
+ PRIMARY KEY (id),
849
+ KEY link_id (link_id)
850
+ );";
851
+
852
+ dbDelta($sql);
853
+
854
+ /* Create/Upgrade Clicks / Rotations Table */
855
+ $sql = "CREATE TABLE {$clicks_rotations_table} (
856
+ id int(11) NOT NULL auto_increment,
857
+ click_id int(11) NOT NULL,
858
+ link_id int(11) NOT NULL,
859
+ url text NOT NULL,
860
+ PRIMARY KEY (id),
861
+ KEY click_id (click_id),
862
+ KEY link_id (link_id)
863
+ );";
864
+
865
+ dbDelta($sql);
866
  }
867
 
868
+ // be careful with this one -- I use it to forceably reinstall pretty link pro
869
+ function delete_dir($dir)
870
  {
871
+ if (!file_exists($dir))
872
+ return true;
 
 
873
 
874
+ if (!is_dir($dir))
875
+ return unlink($dir);
876
+
877
+ foreach (scandir($dir) as $item)
878
  {
879
+ if ($item == '.' || $item == '..')
880
+ continue;
881
+
882
+ if (!$this->delete_dir($dir.DIRECTORY_SEPARATOR.$item))
883
+ return false;
884
  }
885
+
886
+ return rmdir($dir);
887
  }
888
+
889
  }
890
  ?>
classes/models/models.inc.php CHANGED
@@ -3,72 +3,17 @@ 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
- global $prli_db_version;
27
- global $prlipro_db_version;
28
-
29
- $prli_db_version = 11; // this is the version of the database we're moving to
30
- $prlipro_db_version = 1; // this is the version of the database we're moving to
31
-
32
- // Load Controller(s)
33
- require_once( PRLI_CONTROLLERS_PATH.'/PrliAppController.php');
34
-
35
- global $prli_app_controller;
36
-
37
- $prli_app_controller = new PrliAppController();
38
-
39
- 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
40
- {
41
- global $prli_update, $wp_version;
42
- include_once(ABSPATH."/wp-includes/class-IXR.php");
43
-
44
- $message_mothership = (($prli_update->pro_is_installed_and_authorized())?'http://prettylinkpro.com/xmlrpc.php':'http://blairwilliams.com/xmlrpc.php');
45
-
46
- if( version_compare($wp_version, '3.0', '>=') )
47
- $messages = get_site_transient('_prli_messages'); // for WordPress 3.0
48
- else
49
- $messages = get_transient('_prli_messages'); // for WordPress 2.8+
50
-
51
- // if the messages array has expired go back to the mothership
52
- if($messages === false)
53
- {
54
- $client = new IXR_Client($message_mothership);
55
- if ($client->query('prli.get_main_message_array'))
56
- $messages = $client->getResponse();
57
-
58
- // If we're having connection issues on the mothership then store the default message in the transient
59
- if(empty($messages) or !$messages or !is_array($messages))
60
- $messages = array($message);
61
-
62
- if( version_compare($wp_version, '3.0', '>=') )
63
- set_site_transient("_prli_messages", $messages, $expiration); // for WordPress 3.0
64
- else
65
- set_transient("_prli_messages", $messages, $expiration); // for WordPress 2.8+
66
- }
67
-
68
- if(empty($messages) or !$messages or !is_array($messages))
69
- return $message;
70
- else
71
- return $messages[array_rand($messages)];
72
- }
73
-
74
  ?>
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.'/PrliLinkMeta.php');
 
7
 
8
  global $prli_link;
9
  global $prli_link_meta;
10
  global $prli_click;
11
  global $prli_group;
12
  global $prli_utils;
 
 
13
 
14
  $prli_link = new PrliLink();
15
  $prli_link_meta = new PrliLinkMeta();
16
  $prli_click = new PrliClick();
17
  $prli_group = new PrliGroup();
18
  $prli_utils = new PrliUtils();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  ?>
classes/views/prli-clicks/csv.php CHANGED
@@ -1,8 +1,9 @@
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");
1
  <?php
2
+ require_once('prli-config.php');
 
3
 
4
+ if(is_user_logged_in() and $current_user->user_level >= 8)
5
+ {
6
+ $filename = date("ymdHis",time()) . '_' . $link_name . '_pretty_link_clicks.csv';
7
  header("Content-Type: text/x-csv");
8
  header("Content-Disposition: attachment; filename=\"$filename\"");
9
  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");
classes/views/prli-clicks/list.php CHANGED
@@ -2,8 +2,8 @@
2
  <?php
3
  require(PRLI_VIEWS_PATH.'/shared/nav.php');
4
  ?>
5
- <h2><img src="<?php echo PRLI_IMAGES_URL.'/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']))
@@ -25,7 +25,7 @@
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;">
@@ -53,7 +53,7 @@
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; ?>" />
@@ -74,34 +74,28 @@
74
  <table class="widefat post fixed" cellspacing="0">
75
  <thead>
76
  <tr>
77
- <?php if( isset($prli_options->extended_tracking) and $prli_options->extended_tracking == "extended" ) { ?>
78
- <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_IMAGES_URL.'/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
79
  </th>
80
- <?php } ?>
81
  <th class="manage-column" width="12%">
82
- <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_IMAGES_URL.'/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
83
  </th>
84
- <?php if( isset($prli_options->extended_tracking) and $prli_options->extended_tracking == "extended" ) { ?>
85
  <th class="manage-column" width="12%">
86
- <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_IMAGES_URL.'/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
87
  </th>
88
- <?php } ?>
89
  <th class="manage-column" width="13%">
90
- <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_IMAGES_URL.'/'.((empty($sort_str) or $sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
91
  </th>
92
- <?php if( isset($prli_options->extended_tracking) and $prli_options->extended_tracking == "extended" ) { ?>
93
  <th class="manage-column" width="16%">
94
- <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_IMAGES_URL.'/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
95
  </th>
96
- <?php } ?>
97
  <th class="manage-column" width="16%">
98
- <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_IMAGES_URL.'/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
99
  </th>
100
  <th class="manage-column" width="16%">
101
- <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_IMAGES_URL.'/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
102
  </th>
103
  <th class="manage-column" width="13%">
104
- <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_IMAGES_URL.'/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a>
105
  </th>
106
  </tr>
107
  </thead>
@@ -121,20 +115,14 @@
121
  {
122
  ?>
123
  <tr>
124
- <?php if( isset($prli_options->extended_tracking) and $prli_options->extended_tracking == "extended" ) { ?>
125
- <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>
126
- <?php } ?>
127
  <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>
128
- <?php if( isset($prli_options->extended_tracking) and $prli_options->extended_tracking == "extended" ) { ?>
129
  <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>
130
- <?php } ?>
131
  <td><?php echo $click->created_at; ?></td>
132
- <?php if( isset($prli_options->extended_tracking) and $prli_options->extended_tracking == "extended" ) { ?>
133
  <td><?php echo $click->host; ?></td>
134
- <?php } ?>
135
  <td><?php echo $click->uri; ?></td>
136
  <td><?php echo $click->referer; ?></td>
137
- <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>
138
  </tr>
139
  <?php
140
  }
@@ -142,17 +130,11 @@
142
  ?>
143
  <tfoot>
144
  <tr>
145
- <?php if( isset($prli_options->extended_tracking) and $prli_options->extended_tracking == "extended" ) { ?>
146
  <th class="manage-column">Browser</th>
147
- <?php } ?>
148
  <th class="manage-column">IP</th>
149
- <?php if( isset($prli_options->extended_tracking) and $prli_options->extended_tracking == "extended" ) { ?>
150
  <th class="manage-column">Visitor</th>
151
- <?php } ?>
152
  <th class="manage-column">Timestamp</th>
153
- <?php if( isset($prli_options->extended_tracking) and $prli_options->extended_tracking == "extended" ) { ?>
154
  <th class="manage-column">Host</th>
155
- <?php } ?>
156
  <th class="manage-column">URI</th>
157
  <th class="manage-column">Referrer</th>
158
  <th class="manage-column">Link</th>
@@ -160,7 +142,7 @@
160
  </tfoot>
161
  </table>
162
 
163
- <a href="?page=pretty-link/prli-clicks.php&action=csv<?php echo $page_params; ?>">Download CSV (<?php echo stripslashes($link_name); ?>)</a>
164
 
165
  <?php
166
  require(PRLI_VIEWS_PATH.'/shared/table-nav.php');
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 $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']))
25
 
26
 
27
  <div class="filter_pane">
28
+ <form class="form-fields" name="form2" method="post" action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>">
29
  <?php wp_nonce_field('prli-reports'); ?>
30
  <span>Type:</span>&nbsp;
31
  <select id="type" name="type" style="display: inline;">
53
  ?>
54
 
55
  <div id="search_pane" style="padding-top: 5px;">
56
+ <form class="form-fields" name="click_form" method="post" action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>">
57
  <?php wp_nonce_field('prli-clicks'); ?>
58
 
59
  <input type="hidden" name="sort" id="sort" value="<?php echo $sort_str; ?>" />
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>
115
  {
116
  ?>
117
  <tr>
118
+ <td><img src="<?php echo PRLI_URL; ?>/images/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="<?php echo PRLI_URL; ?>/images/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 $click->link_name; ?>"><?php echo $click->link_name; ?></a></td>
126
  </tr>
127
  <?php
128
  }
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>
142
  </tfoot>
143
  </table>
144
 
145
+ <a href="<?php echo PRLI_URL; ?>/prli-clicks.php?action=csv<?php echo $page_params; ?>">Download CSV (<?php echo $link_name; ?>)</a>
146
 
147
  <?php
148
  require(PRLI_VIEWS_PATH.'/shared/table-nav.php');
classes/views/prli-dashboard-widget/widget.php CHANGED
@@ -1,5 +1,5 @@
1
  <div class="wrap">
2
- <a href="http://blairwilliams.com/pretty-link"><img style="float: left; border: 0px;" src="<?php echo PRLI_IMAGES_URL . '/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">
@@ -7,11 +7,11 @@
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>
1
  <div class="wrap">
2
+ <img style="float: left;" src="<?php echo PRLI_URL.'/images/pretty-link-med.png'; ?>"/><div style="min-height: 36px;"><div style="min-height: 18px; margin-left: 45px; margin-top: 0px; padding-top: 0px; border: 1px solid #e5e597; background-color: #ffffa0; display: block;"><p style="font-size: 12px; 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">
7
 
8
  <table class="form-table">
9
  <tr class="form-field">
10
+ <td width="75px" 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>
classes/views/prli-groups/edit.php CHANGED
@@ -1,5 +1,5 @@
1
  <div class="wrap">
2
- <h2><img src="<?php echo PRLI_IMAGES_URL.'/pretty-link-med.png'; ?>"/>&nbsp;Pretty Link: Edit Group</h2>
3
 
4
  <?php
5
  require(PRLI_VIEWS_PATH.'/shared/errors.php');
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');
classes/views/prli-groups/list.php CHANGED
@@ -2,10 +2,10 @@
2
  <?php
3
  require(PRLI_VIEWS_PATH.'/shared/nav.php');
4
  ?>
5
- <h2><img src="<?php echo PRLI_IMAGES_URL.'/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; ?>" />
@@ -32,9 +32,10 @@
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_IMAGES_URL.'/'.(($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_IMAGES_URL.'/'.(($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_IMAGES_URL.'/'.((empty($sort_str) or $sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a></th>
 
38
  </tr>
39
  </thead>
40
  <?php
@@ -63,6 +64,7 @@
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>
@@ -73,6 +75,7 @@
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>
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="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>">
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; ?>" />
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="10%"><a href="?page=<?php echo PRLI_PLUGIN_NAME; ?>/prli-groups.php&sort=click_count<?php echo (($sort_str == 'click_count' and $sdir_str == 'asc')?'&sdir=desc':''); ?>">Hits<?php echo (($sort_str == 'click_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="10%"><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>
38
+ <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>
39
  </tr>
40
  </thead>
41
  <?php
64
  <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>
65
  </div>
66
  </td>
67
+ <td><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)); ?>"><?php echo $group->click_count; ?></a></td>
68
  <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>
69
  <td><?php echo $group->created_at; ?></td>
70
  </tr>
75
  <tfoot>
76
  <tr>
77
  <th class="manage-column">Name</th>
78
+ <th class="manage-column">Hits</th>
79
  <th class="manage-column">Links</th>
80
  <th class="manage-column">Created</th>
81
  </tr>
classes/views/prli-groups/new.php CHANGED
@@ -1,5 +1,5 @@
1
  <div class="wrap">
2
- <h2><img src="<?php echo PRLI_IMAGES_URL.'/pretty-link-med.png'; ?>"/>&nbsp;Pretty Link: Add Group</h2>
3
 
4
  <?php
5
  require(PRLI_VIEWS_PATH.'/shared/errors.php');
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');
classes/views/prli-links/bar.php CHANGED
@@ -2,7 +2,6 @@
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>
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
  </head>
7
  <frameset rows="66,*" framespacing=0 frameborder=0>
classes/views/prli-links/edit.php CHANGED
@@ -1,5 +1,5 @@
1
  <div class="wrap">
2
- <h2><img src="<?php echo PRLI_IMAGES_URL.'/pretty-link-med.png'; ?>"/>&nbsp;Pretty Link: Edit Link</h2>
3
 
4
  <?php
5
  require(PRLI_VIEWS_PATH.'/shared/errors.php');
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');
classes/views/prli-links/form.php CHANGED
@@ -1,93 +1,109 @@
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
- <?php do_action('prli_redirection_types', $values); ?>
53
- </select><a class="toggle">&nbsp;[?]</a>
54
- <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>
55
- <?php global $prli_update; ?>
56
- <?php if(!$prli_update->pro_is_installed_and_authorized()) { ?>
57
- <p class="description">To Enable Cloaking &amp; Pretty Bar<br/>Upgrade to <a href="http://prettylinkpro.com">Pretty Link Pro</a></p>
58
- <?php } ?>
59
  </div>
60
  <br/>
61
  <h3>SEO Options</h3>
62
  <div class="pane">
63
- <input type="checkbox" name="nofollow" <?php echo $values['nofollow']; ?>/>&nbsp; 'Nofollow' this Link <a class="toggle">&nbsp;[?]</a>
64
  <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>
65
  </div>
66
  </td>
67
  <td valign="top" width="50%">
68
- <h3>Tracking Options</h3>
 
 
 
 
 
 
 
 
 
 
 
 
69
  <div class="pane">
70
- <input type="checkbox" name="track_me" <?php echo $values['track_me']; ?>/>&nbsp; Track this Link <a class="toggle">&nbsp;[?]</a>
71
- <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>
72
  </div>
73
  <br/>
74
  <a name="param_forwarding_pos" height="0"></a>
75
  <h3>Parameter Forwarding</h3>
76
  <ul style="list-style-type: none" class="pane">
77
  <li>
78
- <input type="radio" name="param_forwarding" value="off" <?php echo $values['param_forwarding']['off']; ?>/>&nbsp;Forward Parameters Off <a class="toggle">&nbsp;[?]</a>
79
  <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>
80
  </li>
81
  <li>
82
- <input type="radio" name="param_forwarding" value="on" <?php echo $values['param_forwarding']['on']; ?> />&nbsp;Standard Parameter Forwarding <a class="toggle">&nbsp;[?]</a>
83
  <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>
84
  </li>
85
- <!--
86
  <li>
87
- <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>
88
  <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>
89
  </li>
90
- -->
91
  </ul>
92
  </td>
93
  </tr>
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 $values['url']; ?></textarea>
5
+ <br/>
6
+ <span class="description">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="25">
11
+ <br/>
12
+ <span class="description">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" size="75" value="<?php echo $values['name']; ?>" />
17
+ <br/>
18
+ <span class="description">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: 100px;" name="description"><?php echo $values['description']; ?></textarea>
23
+ <br/>
24
+ <span class="description">A Description of this link.</span></td>
25
+ </tr>
26
+ <tr class="form-field">
27
+ <td colspan="2">
28
+ <span>Group:&nbsp;</span>
29
+ <select name="group_id">
30
+ <option>None</option>
31
+ <?php
32
+ foreach($values['groups'] as $group)
33
+ {
34
+ ?>
35
+ <option value="<?php echo $group['id']; ?>"<?php echo $group['value']; ?>><?php echo $group['name']; ?>&nbsp;</option>
36
+ <?php
37
+ }
38
+ ?>
39
+ </select>
40
+ <br/>
41
+ <span class="description">Select a group for this link.</span>
42
+ </td>
43
  </tr>
44
  </table>
45
+ <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.">[?]</a><a class="collapse-all" title="Hide all option instructions." style="display: none;">[?]</a></span></h3>
46
  <table class="options-table">
47
  <tr>
48
  <td valign="top" width="50%">
49
+ <h3>Display Options</h3>
50
  <div class="pane">
51
+ <input type="checkbox" name="use_prettybar" <?php echo $values['use_prettybar']; ?>/>&nbsp; Show Pretty Bar <a class="toggle">[?]</a>
52
+ <div class="toggle_pane description">Select this option if you want to show the Pretty Bar at the top of the page when redirecting to the Target URL.</div>
53
+ <br/>
54
+ <input type="checkbox" name="use_ultra_cloak" <?php echo $values['use_ultra_cloak']; ?>/>&nbsp; Ultra Cloak this Link <a class="toggle">[?]</a>
55
+ <div class="toggle_pane description">When checked, the Target URL will be not 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.</div>
 
 
 
 
 
 
 
56
  </div>
57
  <br/>
58
+ <h3>Tracking Options</h3>
59
  <div class="pane">
60
+ <input type="checkbox" name="track_me" <?php echo $values['track_me']; ?>/>&nbsp; Track this Link <a class="toggle">[?]</a>
61
+ <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>
62
+ <br/>
63
+ <input type="checkbox" name="track_as_img" <?php echo $values['track_as_img']; ?>/>&nbsp; Track as a Pixel <a class="toggle">[?]</a>
64
+ <div class="toggle_pane description">Select this option if you want this link to behave as 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>
 
 
 
 
 
65
  </div>
66
  <br/>
67
  <h3>SEO Options</h3>
68
  <div class="pane">
69
+ <input type="checkbox" name="nofollow" <?php echo $values['nofollow']; ?>/>&nbsp; 'Nofollow' this Link <a class="toggle">[?]</a>
70
  <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>
71
  </div>
72
  </td>
73
  <td valign="top" width="50%">
74
+ <h3>Redirect Type:</h3>
75
+ <ul style="list-style-type: none" class="pane">
76
+ <li>
77
+ <input type="radio" name="redirect_type" value="307" <?php echo $values['redirect_type']['307']; ?>/>&nbsp;Temporary Redirect (307) <a class="toggle">[?]</a>
78
+ <div class="toggle_pane description">This is the best option if you're planning on changing your Target URL and want accurate reporting for this link.</div>
79
+ </li>
80
+ <li>
81
+ <input type="radio" name="redirect_type" value="301" <?php echo $values['redirect_type']['301']; ?> />&nbsp;Permanent Redirect (301) <a class="toggle">[?]</a>
82
+ <div class="toggle_pane description">This 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.</div>
83
+ </li>
84
+ </ul>
85
+ <br/>
86
+ <h3>Group Options</h3>
87
  <div class="pane">
88
+ Group Listing Order:&nbsp;<input type="text" name="gorder" value="<?php echo $values['gorder']; ?>" size="10"> <a class="toggle">[?]</a>
89
+ <div class="toggle_pane description">You can use this to determine the order that your link show up in the group it's in. The group will default to alphabetic order -- but this will override that default behavior. I also realize this isn't the easiest way for you to re-order links but we'll get a better way in the future.</div>
90
  </div>
91
  <br/>
92
  <a name="param_forwarding_pos" height="0"></a>
93
  <h3>Parameter Forwarding</h3>
94
  <ul style="list-style-type: none" class="pane">
95
  <li>
96
+ <input type="radio" name="param_forwarding" value="off" <?php echo $values['param_forwarding']['off']; ?>/>&nbsp; Forward Parameters Off <a class="toggle">[?]</a>
97
  <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>
98
  </li>
99
  <li>
100
+ <input type="radio" name="param_forwarding" value="on" <?php echo $values['param_forwarding']['on']; ?> />&nbsp;Standard Parameter Forwarding <a class="toggle">[?]</a>
101
  <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>
102
  </li>
 
103
  <li>
104
+ <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">[?]</a>
105
  <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>
106
  </li>
 
107
  </ul>
108
  </td>
109
  </tr>
classes/views/prli-links/head.php CHANGED
@@ -40,7 +40,7 @@ jQuery(document).ready(function() {
40
  <style type="text/css">
41
 
42
  .options-table {
43
- width: 80%;
44
  margin-top: 10px;
45
  }
46
 
40
  <style type="text/css">
41
 
42
  .options-table {
43
+ width: 67%;
44
  margin-top: 10px;
45
  }
46
 
classes/views/prli-links/list.php CHANGED
@@ -2,7 +2,7 @@
2
  <?php
3
  require(PRLI_VIEWS_PATH.'/shared/nav.php');
4
  ?>
5
- <h2><img src="<?php echo PRLI_IMAGES_URL . '/pretty-link-med.png'; ?>"/>&nbsp;Pretty Link: Links</h2>
6
  <?php
7
  if(empty($params['group']))
8
  {
@@ -17,7 +17,7 @@
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; ?>" />
@@ -35,9 +35,8 @@
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_IMAGES_URL . '/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>
@@ -52,18 +51,19 @@
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_IMAGES_URL . '/'.(($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_IMAGES_URL . '/'.(($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_IMAGES_URL . '/'.(($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_IMAGES_URL . '/'.((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_IMAGES_URL . '/'.(($sdir_str == 'desc')?'arrow_down.png':'arrow_up.png').'"/>':'') ?></a></th>
67
  </tr>
68
  </thead>
69
  <?php
@@ -72,61 +72,56 @@
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_IMAGES_URL . '/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_IMAGES_URL . '/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_IMAGES_URL . '/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_IMAGES_URL . '/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_IMAGES_URL . '/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_IMAGES_URL . '/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_IMAGES_URL . '/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_IMAGES_URL . '/url_icon.gif'; ?>" width="13px" height="13px" name="Visit" alt="Visit"/></a>&nbsp;
130
  <?php
131
  }
132
  ?>
@@ -135,12 +130,12 @@
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
- |&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>
139
- <?php if( $link->track_me and $prli_options->extended_tracking!='count' ) { ?>
140
- |&nbsp;<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;|
@@ -151,21 +146,15 @@
151
  </div>
152
  </td>
153
  <?php do_action('prli_link_column_row',$link->id); ?>
154
- <td>
155
- <?php if($prli_options->extended_tracking!='count')
156
- echo (($link->track_me)?"<a href=\"?page=".PRLI_PLUGIN_NAME."/prli-clicks.php&l=$link->id\" title=\"View clicks for $link->slug\">" . (empty($link->clicks)?0:$link->clicks) . "/" . (empty($link->uniques)?0:$link->uniques) . "</a>":"<img src=\"".PRLI_IMAGES_URL."/not_tracking.png\" title=\"This link isn't being tracked\"/>");
157
- else
158
- echo (($link->track_me)?(empty($link->clicks)?0:$link->clicks) . "/" . (empty($link->uniques)?0:$link->uniques):"<img src=\"".PRLI_IMAGES_URL."/not_tracking.png\" title=\"This link isn't being tracked\"/>");
159
- ?>
160
- </td>
161
  <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>
162
  <td><?php echo $link->created_at; ?></td>
163
  </td>
164
  <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/>
165
- <?php if( $link->redirect_type != 'pixel' )
166
  {
167
  ?>
168
- <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>
169
  <?php
170
  }
171
  ?>
@@ -176,7 +165,7 @@
176
  ?>
177
  <tfoot>
178
  <tr>
179
- <th class="manage-column"><?php do_action('prli-list-header-icon'); ?>Name</th>
180
  <?php do_action('prli_link_column_footer'); ?>
181
  <th class="manage-column">Hits / Uniq</th>
182
  <th class="manage-column">Group</th>
@@ -185,7 +174,8 @@
185
  </tr>
186
  </tfoot>
187
  </table>
188
- <?php $footer = true; require(PRLI_VIEWS_PATH.'/shared/link-table-nav.php'); ?>
189
- </form>
 
190
 
191
  </div>
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
  {
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="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>">
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; ?>" />
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
  <?php do_action('prli-link-nav'); ?>
41
  </p>
42
  </div>
51
  <?php
52
  }
53
  ?>
54
+
55
+ <?php
56
+ require(PRLI_VIEWS_PATH.'/shared/table-nav.php');
57
+ ?>
58
  <table class="widefat post fixed" cellspacing="0">
59
  <thead>
60
  <tr>
61
+ <th class="manage-column" width="30%"><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
72
  {
73
  ?>
74
  <tr>
75
+ <td colspan="5">No Pretty Links were found</td>
76
  </tr>
77
  <?php
78
  }
79
  else
80
  {
 
81
  foreach($links as $link)
82
  {
83
+ $pretty_link_url = $prli_link->get_pretty_link_url($link->slug);//$prli_blogurl . '/' . $link->slug;
 
84
  ?>
85
  <tr style="min-height: 75px; height: 75px;">
86
  <td class="edit_link">
87
 
88
  <?php do_action('prli_list_icon',$link->id); ?>
89
+ <?php if( $link->use_prettybar and !$link->track_as_img ) { ?>
90
+ <img src="<?php echo PRLI_URL.'/images/pretty-link-small.png'; ?>" title="Using PrettyBar" width="13px" height="13px" />
91
+ <?php } ?>
92
+ <?php if( $link->use_ultra_cloak and !$link->track_as_img ) { ?>
93
+ <img src="<?php echo PRLI_URL.'/images/ultra-cloak.png'; ?>" title="Using Ultra Cloak" width="13px" height="13px" />
 
 
 
 
 
 
 
 
 
94
  <?php } ?>
 
95
  <?php if( $link->nofollow ) { ?>
96
+ <img src="<?php echo PRLI_URL.'/images/nofollow.png'; ?>" title="nofollow" width="13px" height="13px" />
97
+ <?php } ?>
98
+ <?php if( !$link->track_as_img ) { ?>
99
+ <span title="<?php echo (($link->redirect_type == '307')?"Temporary Redirection (307)":"Permanent Redirection (301)"); ?>" style="font-size: 14px; cursor: help; line-height: 14px; padding: 0px; margin: 0px; color: green;"><strong><?php echo (($link->redirect_type == '307')?"T":"P"); ?></strong></span>&nbsp;
100
+ <?php } ?>
101
+ <?php if( !$link->track_as_img )
102
  {
103
  ?>
104
+ <a href="<? 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;
105
+ <a href="<? 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;
106
  <?php
107
  }
108
+ else
109
  {
110
  ?>
111
+ <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;
112
  <?php
113
  }
 
114
 
115
+ if($link->param_forwarding == 'on')
116
+ {
117
+ ?>
118
+ <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;
119
+ <?php
120
+ }
121
+ else if($link->param_forwarding == 'custom')
122
  {
123
  ?>
124
+ <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;
 
125
  <?php
126
  }
127
  ?>
130
  <div class="link_actions">
131
  <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;|
132
  <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>
133
+ <?php if( $link->track_me ) { ?>
134
+ |&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;|
135
+ <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>
136
  <?php do_action('prli-link-action',$link->id); ?>
137
  <?php } ?>
138
+ <?php if( !$link->track_as_img )
139
  {
140
  ?>
141
  |&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;|
146
  </div>
147
  </td>
148
  <?php do_action('prli_link_column_row',$link->id); ?>
149
+ <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>
 
 
 
 
 
 
150
  <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>
151
  <td><?php echo $link->created_at; ?></td>
152
  </td>
153
  <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/>
154
+ <?php if( !$link->track_as_img )
155
  {
156
  ?>
157
+ <span style="font-size: 8px;"><strong>Target URL:</strong> <? echo $link->url; ?></span></td>
158
  <?php
159
  }
160
  ?>
165
  ?>
166
  <tfoot>
167
  <tr>
168
+ <th class="manage-column">Name</th>
169
  <?php do_action('prli_link_column_footer'); ?>
170
  <th class="manage-column">Hits / Uniq</th>
171
  <th class="manage-column">Group</th>
174
  </tr>
175
  </tfoot>
176
  </table>
177
+ <?php
178
+ require(PRLI_VIEWS_PATH.'/shared/table-nav.php');
179
+ ?>
180
 
181
  </div>
classes/views/prli-links/new.php CHANGED
@@ -1,5 +1,5 @@
1
  <div class="wrap">
2
- <h2><img src="<?php echo PRLI_IMAGES_URL . '/pretty-link-med.png'; ?>"/>&nbsp;Pretty Link: Add Link</h2>
3
 
4
  <?php
5
  require(PRLI_VIEWS_PATH.'/shared/errors.php');
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');
classes/views/prli-links/ultra-cloak.php CHANGED
@@ -3,7 +3,6 @@
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>
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
  </head>
7
  <frameset rows="*" framespacing=0 frameborder=0>
8
  <frame src="<?php echo $pretty_link_url.$param_string; ?>" frameborder=0 marginwidth=0 marginheight=0>
classes/views/prli-options/form.php CHANGED
@@ -14,97 +14,162 @@ if(!$permalink_structure or empty($permalink_structure))
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
- <?php do_action('prli_default_redirection_types',$prli_options->link_redirect_type); ?>
41
- </select>
42
- <br/><span class="description">Select the type of redirection you want your newly created links to have.</span>
 
 
 
 
 
 
 
 
 
 
 
 
43
  </li>
44
  </ul>
45
- <?php do_action('prli_custom_option_pane'); ?>
46
- <h3><a class="toggle reporting-toggle-button">Reporting Options <span class="reporting-expand" style="display: none;">[+]</span><span class="reporting-collapse">[-]</span></a></h3>
47
- <table class="reporting-toggle-pane form-table">
48
  <tr class="form-field">
49
- <td valign="top">Excluded IP Addresses: </td>
50
- <td>
51
- <input type="text" name="<?php echo $prli_exclude_ips; ?>" value="<?php echo $prli_options->prli_exclude_ips; ?>">
52
- <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>
53
- <br/><span class="description" style="color: red;">Your Current IP Address is <?php echo $_SERVER['REMOTE_ADDR']; ?></span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  </td>
55
  </tr>
56
  <tr>
57
  <td colspan="2">
58
- <input type="checkbox" class="filter-robots-checkbox" name="<?php echo $filter_robots; ?>" <?php echo (($prli_options->filter_robots != 0)?'checked="true"':''); ?>/>&nbsp; <?php _e('Filter Robots'); ?>
59
- <br/><span class="description"><?php _e('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>
60
- <table class="option-pane whitelist-ips">
61
- <tr class="form-field">
62
- <td valign="top"><?php _e('Whitelist IP Addresses:'); ?>&nbsp;</td>
63
- <td>
64
- <input type="text" name="<?php echo $whitelist_ips; ?>" value="<?php echo $prli_options->whitelist_ips; ?>">
65
- <br/><span class="description"><?php _e('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>
66
- </td>
67
- </tr>
68
- </table>
69
  </td>
70
  </tr>
71
  <tr>
72
  <td colspan="2">
73
- <h4><?php _e('Tracking Style:'); ?></h4><span class="description"><code><?php _e('Note: Changing your tracking style can affect the accuracy of your existing statistics.'); ?></code></span>
74
- <div id="option-pane">
75
- <ul style="list-style-type: none;" class="pane">
76
- <li>
77
- <input type="radio" name="<?php echo $extended_tracking; ?>" value="normal"<?php echo (($prli_options->extended_tracking == 'normal')?' checked="checked"':''); ?>/>&nbsp;<?php _e('Normal Tracking'); ?>
78
- </li>
79
- <li>
80
- <input type="radio" name="<?php echo $extended_tracking; ?>" value="extended"<?php echo (($prli_options->extended_tracking == 'extended')?' checked="checked"':''); ?>/>&nbsp;<?php _e('Extended Tracking (more stats / slower performance)'); ?>
81
- </li>
82
- <li>
83
- <input type="radio" name="<?php echo $extended_tracking; ?>" value="count"<?php echo (($prli_options->extended_tracking == 'count')?' checked="checked"':''); ?>/>&nbsp;<?php _e('Simple Click Count Tracking (less stats / faster performance)'); ?>
84
- </li>
85
- </ul>
86
- </div>
87
  </td>
88
  </tr>
89
  </table>
90
 
91
  <p class="submit">
92
- <input type="submit" name="Submit" value="<?php _e('Update Options') ?>" />
93
  </p>
94
 
95
-
96
- <h3>Trim Hit Database</h3>
97
-
98
- <?php if($prli_options->extended_tracking != 'count') { ?>
99
- <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>
100
- <br/><span class="description">This will clear all hits in your database that are older than 30 days.</span></p>
101
-
102
- <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>
103
- <br/><span class="description">This will clear all hits in your database that are older than 90 days.</span></p>
104
- <?php } ?>
105
-
106
- <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>
107
- <br/><span class="description">Seriously, only click this link if you want to delete all the Hit data in your database.</span></p>
108
 
109
  </form>
110
  </div>
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="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>">
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_show_prettybar; ?>" <?php echo (($link_show_prettybar_val != 0)?'checked="true"':''); ?>/>&nbsp; Show Pretty Bar
25
+ <br/><span class="setting-description">Show PrettyBar by default when link is created.</span>
26
  </li>
27
  <li>
28
+ <input type="checkbox" name="<?php echo $link_ultra_cloak; ?>" <?php echo (($link_ultra_cloak_val != 0)?'checked="true"':''); ?>/>&nbsp; Ultra Cloak Link
29
+ <br/><span class="setting-description">Ultra Cloak all links as they are created.</span>
30
  </li>
31
  <li>
32
+ <input type="checkbox" name="<?php echo $link_track_me; ?>" <?php echo (($link_track_me_val != 0)?'checked="true"':''); ?>/>&nbsp; Track Link
33
+ <br/><span class="setting-description">Default all new links to be tracked.</span>
34
  </li>
35
  <li>
36
+ <input type="checkbox" name="<?php echo $link_track_as_pixel; ?>" <?php echo (($link_track_as_pixel_val != 0)?'checked="true"':''); ?>/>&nbsp; Track Link as a Pixel
37
+ <br/><span class="setting-description">Default all new links to be tracking pixels.</span>
38
+ </li>
39
+ <li>
40
+ <input type="checkbox" name="<?php echo $link_nofollow; ?>" <?php echo (($link_nofollow_val != 0)?'checked="true"':''); ?>/>&nbsp; Add <code>nofollow</code> to Link
41
+ <br/><span class="setting-description">Add the <code>nofollow</code> attribute by default to new links.</span>
42
+ </li>
43
+ <li>
44
+ <h4>Default Link Redirect Type:</h4>
45
+ <ul style="list-style-type: none">
46
+ <li>
47
+ <input type="radio" name="<?php echo $link_redirect_type; ?>" value="307" <?php echo (($link_redirect_type_val == '307')?' checked=true':''); ?>/>&nbsp;Temporary Redirect (307)
48
+ <div class="setting-description">Default newly created links to have temporary (307) redirection.</div>
49
+ </li>
50
+ <li>
51
+ <input type="radio" name="<?php echo $link_redirect_type; ?>" value="301" <?php echo (($link_redirect_type_val == '301')?' checked=true':''); ?> />&nbsp;Permanent Redirect (301)
52
+ <div class="setting-description">Default newly created links to have permanent (307) redirection.</div>
53
+ </li>
54
+ </ul>
55
  </li>
56
  </ul>
57
+ <h3><a class="toggle prettybar-toggle-button">PrettyBar Options <span class="prettybar-expand" style="display: none;">[+]</span><span class="prettybar-collapse">[-]</span></a></h3>
58
+ <table class="prettybar-toggle-pane form-table">
 
59
  <tr class="form-field">
60
+ <td valign="top" width="15%"><?php _e("Image URL:", $prettybar_image_url ); ?> </td>
61
+ <td width="85%">
62
+ <input type="text" name="<?php echo $prettybar_image_url; ?>" value="<?php echo $prettybar_image_url_val; ?>"/>
63
+ <br/><span class="setting-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>
64
+ </td>
65
+ </tr>
66
+ <tr class="form-field">
67
+ <td valign="top" width="15%"><?php _e("Background Image URL:", $prettybar_background_image_url ); ?> </td>
68
+ <td width="85%">
69
+ <input type="text" name="<?php echo $prettybar_background_image_url; ?>" value="<?php echo $prettybar_background_image_url_val; ?>"/>
70
+ <br/><span class="setting-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>
71
+ </td>
72
+ </tr>
73
+ <tr>
74
+ <td valign="top" width="15%"><?php _e("Background Color:", $prettybar_color ); ?> </td>
75
+ <td width="85%">
76
+ #<input type="text" name="<?php echo $prettybar_color; ?>" value="<?php echo $prettybar_color_val; ?>" size="6"/>
77
+ <br/><span class="setting-description">This will alter the background color of the PrettyBar if you haven't specified a PrettyBar background image.</span>
78
+ </td>
79
+ </tr>
80
+ <tr>
81
+ <td valign="top" width="15%"><?php _e("Text Color:", $prettybar_text_color ); ?> </td>
82
+ <td width="85%">
83
+ #<input type="text" name="<?php echo $prettybar_text_color; ?>" value="<?php echo $prettybar_text_color_val; ?>" size="6"/>
84
+ <br/><span class="setting-description">If not set, this defaults to black (RGB value <code>#000000</code>) but you can change it to whatever color you like.</span>
85
+ </td>
86
+ </tr>
87
+ <tr>
88
+ <td valign="top" width="15%"><?php _e("Link Color:", $prettybar_link_color ); ?> </td>
89
+ <td width="85%">
90
+ #<input type="text" name="<?php echo $prettybar_link_color; ?>" value="<?php echo $prettybar_link_color_val; ?>" size="6"/>
91
+ <br/><span class="setting-description">If not set, this defaults to blue (RGB value <code>#0000ee</code>) but you can change it to whatever color you like.</span>
92
+ </td>
93
+ </tr>
94
+ <tr>
95
+ <td valign="top" width="15%"><?php _e("Link Hover Color:", $prettybar_hover_color ); ?> </td>
96
+ <td width="85%">
97
+ #<input type="text" name="<?php echo $prettybar_hover_color; ?>" value="<?php echo $prettybar_hover_color_val; ?>" size="6"/>
98
+ <br/><span class="setting-description">If not set, this defaults to RGB value <code>#ababab</code> but you can change it to whatever color you like.</span>
99
+ </td>
100
+ </tr>
101
+ <tr>
102
+ <td valign="top" width="15%"><?php _e("Visited Link Color:", $prettybar_visited_color ); ?> </td>
103
+ <td width="85%">
104
+ #<input type="text" name="<?php echo $prettybar_visited_color; ?>" value="<?php echo $prettybar_visited_color_val; ?>" size="6"/>
105
+ <br/><span class="setting-description">If not set, this defaults to RGB value <code>#551a8b</code> but you can change it to whatever color you like.</span>
106
+ </td>
107
+ </tr>
108
+ <tr>
109
+ <td valign="top" width="15%"><?php _e("Title Char Limit*:", $prettybar_title_limit ); ?> </td>
110
+ <td width="85%">
111
+ <input type="text" name="<?php echo $prettybar_title_limit; ?>" value="<?php echo $prettybar_title_limit_val; ?>" size="4"/>
112
+ <br/><span class="setting-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>
113
+ </td>
114
+ </tr>
115
+ <tr>
116
+ <td valign="top" width="15%"><?php _e("Description Char Limit*:", $prettybar_desc_limit ); ?> </td>
117
+ <td width="85%">
118
+ <input type="text" name="<?php echo $prettybar_desc_limit; ?>" value="<?php echo $prettybar_desc_limit_val; ?>" size="4"/>
119
+ <br/><span class="setting-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>
120
+ </td>
121
+ </tr>
122
+ <tr>
123
+ <td valign="top" width="15%"><?php _e("Target URL Char Limit*:", $prettybar_link_limit ); ?> </td>
124
+ <td width="85%">
125
+ <input type="text" name="<?php echo $prettybar_link_limit; ?>" value="<?php echo $prettybar_link_limit_val; ?>" size="4"/>
126
+ <br/><span class="setting-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>
127
+ </td>
128
+ </tr>
129
+ <tr>
130
+ <td colspan="2">
131
+ <input type="checkbox" name="<?php echo $prettybar_show_title; ?>" <?php echo (($prettybar_show_title_val != 0)?'checked="true"':''); ?>/>&nbsp; Show Pretty Bar Title
132
+ <br/><span class="setting-description">Make sure this is checked if you want the title of your blog (and link) to show up on the PrettyBar.</span>
133
+ </td>
134
+ </tr>
135
+ <tr>
136
+ <td colspan="2">
137
+ <input type="checkbox" name="<?php echo $prettybar_show_description; ?>" <?php echo (($prettybar_show_description_val != 0)?'checked="true"':''); ?>/>&nbsp; Show Pretty Bar Description
138
+ <br/><span class="setting-description">Make sure this is checked if you want your site description to show up on the PrettyBar.</span>
139
  </td>
140
  </tr>
141
  <tr>
142
  <td colspan="2">
143
+ <input type="checkbox" name="<?php echo $prettybar_show_share_links; ?>" <?php echo (($prettybar_show_share_links_val != 0)?'checked="true"':''); ?>/>&nbsp; Show Pretty Bar Share Links
144
+ <br/><span class="setting-description">Make sure this is checked if you want "share links" to show up on the PrettyBar.</span>
 
 
 
 
 
 
 
 
 
145
  </td>
146
  </tr>
147
  <tr>
148
  <td colspan="2">
149
+ <input type="checkbox" name="<?php echo $prettybar_show_target_url_link; ?>" <?php echo (($prettybar_show_target_url_link_val != 0)?'checked="true"':''); ?>/>&nbsp; Show Pretty Bar Target URL
150
+ <br/><span class="setting-description">Make sure this is checked if you want a link displaying the Target URL to show up on the PrettyBar.</span>
151
+ </td>
152
+ </tr>
153
+
154
+ </table>
155
+ <h3><a class="toggle reporting-toggle-button">Reporting Options <span class="reporting-expand" style="display: none;">[+]</span><span class="reporting-collapse">[-]</span></a></h3>
156
+ <table class="reporting-toggle-pane form-table">
157
+ <tr class="form-field">
158
+ <td valign="top">Excluded IP Addresses: </td>
159
+ <td>
160
+ <input type="text" name="<?php echo $prli_exclude_ips; ?>" value="<?php echo $prli_exclude_ips_val; ?>">
161
+ <br/><span class="setting-description">Enter IP Addresses 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</code></span>
162
+ <br/><span class="setting-description" style="color: red;">Your Current IP Address is <?php echo $_SERVER['REMOTE_ADDR']; ?></span>
163
  </td>
164
  </tr>
165
  </table>
166
 
167
  <p class="submit">
168
+ <input type="submit" name="Submit" value="<?php _e('Update Options', $prli_domain ) ?>" />
169
  </p>
170
 
171
+ <p><a href="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI'] ); ?>&action=clear_all_clicks4134" 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>
172
+ <br/><span class="setting-description">Seriously, only click this link if you want to delete all the Hit data in your database.</span></p>
 
 
 
 
 
 
 
 
 
 
 
173
 
174
  </form>
175
  </div>
classes/views/prli-options/head.php CHANGED
@@ -1,6 +1,13 @@
1
  <script type="text/javascript">
2
  jQuery(document).ready(function() {
3
- <?php do_action('prli_options_js'); ?>
 
 
 
 
 
 
 
4
 
5
  jQuery('.reporting-expand').show();
6
  jQuery('.reporting-collapse').hide();
@@ -19,22 +26,6 @@ jQuery(document).ready(function() {
19
  jQuery('.link-expand').toggle();
20
  jQuery('.link-collapse').toggle();
21
  });
22
-
23
- if (jQuery('.filter-robots-checkbox').is(':checked')) {
24
- jQuery('.whitelist-ips').show();
25
- }
26
- else {
27
- jQuery('.whitelist-ips').hide();
28
- }
29
-
30
- jQuery('.filter-robots-checkbox').change(function() {
31
- if (jQuery('.filter-robots-checkbox').is(':checked')) {
32
- jQuery('.whitelist-ips').show();
33
- }
34
- else {
35
- jQuery('.whitelist-ips').hide();
36
- }
37
- });
38
  });
39
  </script>
40
 
@@ -43,5 +34,3 @@ jQuery(document).ready(function() {
43
  cursor: pointer;
44
  }
45
  </style>
46
-
47
- <?php do_action('prli-options-head'); ?>
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();
26
  jQuery('.link-expand').toggle();
27
  jQuery('.link-collapse').toggle();
28
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  });
30
  </script>
31
 
34
  cursor: pointer;
35
  }
36
  </style>
 
 
classes/views/prli-options/pro-settings.php CHANGED
@@ -2,17 +2,42 @@
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>
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
+ <form name="proaccount_form" method="post" action="<?php echo $this_uri; ?>">
6
+ <input type="hidden" name="<?php echo $hidden_field_name; ?>" value="Y">
7
+ <input type="hidden" name="action" value="pro-settings">
8
+ <?php wp_nonce_field('update-options'); ?>
9
+
10
  <h3>Pretty Link Pro Account Information</h3>
11
+ <?php if($prli_utils->pro_is_installed()) { ?>
12
  <p><a href="http://prettylinkpro.com/user-manual">User Manual</a></p>
13
  <?php } ?>
14
+ <table class="form-table">
15
+ <tr class="form-field">
16
+ <td valign="top" width="15%"><?php _e("Pretty Link Pro Username*:", $prlipro_username ); ?> </td>
17
+ <td width="85%">
18
+ <input type="text" name="<?php echo $prlipro_username; ?>" value="<?php echo $prlipro_username_val; ?>"/>
19
+ <br/><span class="description">Your Pretty Link Pro Username.</span>
20
+ </td>
21
+ </tr>
22
+ <tr class="form-field">
23
+ <td valign="top" width="15%"><?php _e("Pretty Link Pro Password:", $prlipro_password ); ?> </td>
24
+ <td width="85%">
25
+ <input type="password" name="<?php echo $prlipro_password; ?>" value="<?php echo $prlipro_password_val; ?>"/>
26
+ <br/><span class="description">Your Pretty Link Pro Password.</span>
27
+ </td>
28
+ </tr>
29
+ </table>
30
+
31
+ <p class="submit">
32
+ <input type="submit" name="Submit" value="<?php _e('Save', $prli_domain ) ?>" />
33
+ </p>
34
+
35
+ <?php if($prli_utils->pro_is_installed()) { ?>
36
+ <div><p><strong>The <?php echo $prli_utils->get_pro_version(); ?> Version of Pretty LInk Pro is Installed</strong></p><p><a href="<?php echo $this_uri; ?>&action=force-pro-reinstall" title="Re-Install">Re-Install</a>&nbsp;|&nbsp;<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="Un-Install" >Un-Install</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>
37
 
38
  <?php } else { ?>
39
+ <a href="http://prettylinkpro.com">Upgrade to Pretty Link Pro</a>
 
40
  <?php } ?>
41
 
42
+ </form>
43
  </div>
classes/views/shared/errors.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- if( isset($errors) and count($errors) > 0 )
3
  {
4
  ?>
5
  <div class="error">
1
  <?php
2
+ if( $errors != null and count($errors) > 0 )
3
  {
4
  ?>
5
  <div class="error">
classes/views/shared/nav.php CHANGED
@@ -1,9 +1 @@
1
- <?php
2
- global $prli_update;
3
-
4
- if($prli_update->pro_is_installed_and_authorized())
5
- $support_link = "&nbsp;|&nbsp;<a href=\"http://prettylinkpro.com/user-manual\">" . __('Pro Manual') . '</a>';
6
- else
7
- $support_link = "&nbsp;|&nbsp;<a href=\"http://prettylinkpro.com\">" . __('Upgrade to Pro') . '</a>';
8
- ?>
9
- <p style="font-size: 14px; font-weight: bold; float: right; text-align: right; padding-top: 0px; padding-right: 10px;"><?php _e('Connect'); ?>:&nbsp;&nbsp;<a href="http://twitter.com/blairwilli"><img src="<?php echo PRLI_IMAGES_URL; ?>/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_IMAGES_URL; ?>/facebook_32.png" style="width: 24px; height: 24px;" /></a><br/><?php _e('Get Help'); ?>:&nbsp;&nbsp;<a href="http://blairwilliams.com/xba" target="_blank"><?php _e('Tutorials'); ?></a><?php echo $support_link; ?>&nbsp;|&nbsp;<a href="http://blairwilliams.com/work"><?php _e('One on One'); ?></a></p>
1
+ <p style="font-size: 14px; font-weight: bold; float: right; text-align: right; padding-top: 5px;"><span style="font-size: 12px;"><a href="http://blairwilliams.com/blog">Get the most from WordPress at BlairWilliams.com</a></span><br/><a href="http://blairwilliams.com/faq" target="_blank">Get Help</a>&nbsp;|&nbsp;<a href="http://blairwilliams.com/category/tutorial" target="_blank">Tutorials</a>&nbsp;|&nbsp;<a href="http://blairwilliams.com/don" target="_blank">Donate</a></p>
 
 
 
 
 
 
 
 
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/browser/abilon.png ADDED
Binary file
images/browser/adobe.png ADDED
Binary file
images/browser/akregator.png ADDED
Binary file
images/browser/alcatel.png ADDED
Binary file
images/browser/amaya.png ADDED
Binary file
images/browser/amigavoyager.png ADDED
Binary file
images/browser/analogx.png ADDED
Binary file
images/browser/apt.png ADDED
Binary file
images/browser/avant.png ADDED
Binary file
images/browser/aweb.png ADDED
Binary file
images/browser/bpftp.png ADDED
Binary file
images/browser/bytel.png ADDED
Binary file
images/browser/chimera.png ADDED
Binary file
images/browser/chrome.png ADDED
Binary file
images/browser/cyberdog.png ADDED
Binary file
images/browser/da.png ADDED
Binary file
images/browser/dillo.png ADDED
Binary file
images/browser/doris.png ADDED
Binary file
images/browser/dreamcast.png ADDED
Binary file
images/browser/ecatch.png ADDED
Binary file
images/browser/encompass.png ADDED
Binary file
images/browser/epiphany.png ADDED
Binary file
images/browser/ericsson.png ADDED
Binary file
images/browser/feeddemon.png ADDED
Binary file
images/browser/feedreader.png ADDED
Binary file
images/browser/firefox.png ADDED
Binary file
images/browser/flashget.png ADDED
Binary file
images/browser/fpexpress.png ADDED
Binary file
images/browser/fresco.png ADDED
Binary file
images/browser/freshdownload.png ADDED
Binary file
images/browser/frontpage.png ADDED
Binary file
images/browser/galeon.png ADDED
Binary file
images/browser/getright.png ADDED
Binary file
images/browser/gnome.png ADDED
Binary file
images/browser/gnus.png ADDED
Binary file
images/browser/gozilla.png ADDED
Binary file
images/browser/hotjava.png ADDED
Binary file
images/browser/httrack.png ADDED
Binary file
images/browser/ibrowse.png ADDED
Binary file
images/browser/icab.png ADDED
Binary file
images/browser/java.png ADDED
Binary file
images/browser/jetbrains_omea.png ADDED
Binary file
images/browser/kmeleon.png ADDED
Binary file
images/browser/konqueror.png ADDED
Binary file
images/browser/leechget.png ADDED
Binary file
images/browser/lg.png ADDED
Binary file
images/browser/lotusnotes.png ADDED
Binary file
images/browser/lynx.png ADDED
Binary file
images/browser/macweb.png ADDED
Binary file
images/browser/mediaplayer.png ADDED
Binary file
images/browser/motorola.png ADDED
Binary file
images/browser/mozilla.png ADDED
Binary file
images/browser/mplayer.png ADDED
Binary file
images/browser/msie.png ADDED
Binary file
images/browser/msie_large.png ADDED
Binary file
images/browser/multizilla.png ADDED
Binary file
images/browser/ncsa_mosaic.png ADDED
Binary file
images/browser/neon.png ADDED
Binary file
images/browser/netnewswire.png ADDED
Binary file
images/browser/netpositive.png ADDED
Binary file
images/browser/netscape.png ADDED
Binary file
images/browser/netscape_large.png ADDED
Binary file
images/browser/netshow.png ADDED
Binary file
images/browser/newsfire.png ADDED
Binary file
images/browser/newsgator.png ADDED
Binary file
images/browser/newzcrawler.png ADDED
Binary file
images/browser/nokia.png ADDED
Binary file
images/browser/notavailable.png ADDED
Binary file
images/browser/omniweb.png ADDED
Binary file
images/browser/opera.png ADDED
Binary file
images/browser/panasonic.png ADDED
Binary file
images/browser/pdaphone.png ADDED
Binary file
images/browser/philips.png ADDED
Binary file
images/browser/phoenix.png ADDED
Binary file
images/browser/pluck.png ADDED
Binary file
images/browser/pulpfiction.png ADDED
Binary file
images/browser/real.png ADDED
Binary file
images/browser/rss.png ADDED
Binary file
images/browser/rssbandit.png ADDED
Binary file
images/browser/rssowl.png ADDED
Binary file
images/browser/rssreader.png ADDED
Binary file
images/browser/rssxpress.png ADDED
Binary file
images/browser/safari.png ADDED
Binary file
images/browser/sagem.png ADDED
Binary file
images/browser/samsung.png ADDED
Binary file
images/browser/sharp.png ADDED
Binary file
images/browser/sharpreader.png ADDED
Binary file
images/browser/shrook.png ADDED
Binary file
images/browser/siemens.png ADDED
Binary file
images/browser/sony.png ADDED
Binary file
images/browser/staroffice.png ADDED
Binary file
images/browser/subversion.png ADDED
Binary file
images/browser/teleport.png ADDED
Binary file
images/browser/trium.png ADDED
Binary file
images/browser/unknown.png ADDED
Binary file
images/browser/w3c.png ADDED
Binary file
images/browser/webcopier.png ADDED
Binary file
images/browser/webreaper.png ADDED
Binary file
images/browser/webtv.png ADDED
Binary file
images/browser/webzip.png ADDED
Binary file
images/browser/winxbox.png ADDED
Binary file
images/browser/wizz.png ADDED
Binary file
images/forward_params.png ADDED
Binary file
images/nofollow.png ADDED
Binary file
images/not_tracking.png ADDED
Binary file
images/os/aix.png ADDED
Binary file
images/os/amigaos.png ADDED
Binary file
images/os/apple.png ADDED
Binary file
images/os/atari.png ADDED
Binary file
images/os/beos.png ADDED
Binary file
images/os/bsd.png ADDED
Binary file
images/os/bsdfreebsd.png ADDED
Binary file
images/os/bsdi.png ADDED
Binary file
images/os/bsdnetbsd.png ADDED
Binary file
images/os/bsdopenbsd.png ADDED
Binary file
images/os/commodore.png ADDED
Binary file
images/os/cpm.png ADDED
Binary file
images/os/debian.png ADDED
Binary file
images/os/digital.png ADDED
Binary file
images/os/dos.png ADDED
Binary file
images/os/dreamcast.png ADDED
Binary file
images/os/freebsd.png ADDED
Binary file
images/os/gnu.png ADDED
Binary file
images/os/hpux.png ADDED
Binary file
images/os/ibm.png ADDED
Binary file
images/os/imode.png ADDED
Binary file
images/os/irix.png ADDED
Binary file
images/os/java.png ADDED
Binary file
images/os/kfreebsd.png ADDED
Binary file
images/os/linux.png ADDED
Binary file
images/os/linuxcentos.png ADDED
Binary file
images/os/linuxdebian.png ADDED
Binary file
images/os/linuxfedora.png ADDED
Binary file
images/os/linuxgentoo.png ADDED
Binary file
images/os/linuxmandr.png ADDED
Binary file
images/os/linuxredhat.png ADDED
Binary file
images/os/linuxsuse.png ADDED
Binary file
images/os/linuxubuntu.png ADDED
Binary file
images/os/mac.png ADDED
Binary file
images/os/macintosh.png ADDED
Binary file
images/os/macosx.png ADDED
Binary file
images/os/netbsd.png ADDED
Binary file
images/os/netware.png ADDED
Binary file
images/os/next.png ADDED
Binary file
images/os/openbsd.png ADDED
Binary file
images/os/os2.png ADDED
Binary file
images/os/osf.png ADDED
Binary file
images/os/psp.png ADDED
Binary file
images/os/qnx.png ADDED
Binary file
images/os/riscos.png ADDED
Binary file
images/os/sco.png ADDED
Binary file
images/os/sunos.png ADDED
Binary file
images/os/symbian.png ADDED
Binary file
images/os/unix.png ADDED
Binary file
images/os/unknown.png ADDED
Binary file
images/os/vms.png ADDED
Binary file
images/os/webtv.png ADDED
Binary file
images/os/win.png ADDED
Binary file
images/os/win16.png ADDED
Binary file
images/os/win2000.png ADDED
Binary file
images/os/win2003.png ADDED
Binary file
images/os/win95.png ADDED
Binary file
images/os/win98.png ADDED
Binary file
images/os/wince.png ADDED
Binary file
images/os/winlong.png ADDED
Binary file
images/os/winme.png ADDED
Binary file
images/os/winnt.png ADDED
Binary file
images/os/winunknown.png ADDED
Binary file
images/os/winxbox.png ADDED
Binary file
images/os/winxp.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/tracking.png ADDED
Binary file
images/ultra-cloak.png ADDED
Binary file
images/url_icon.gif ADDED
Binary file
includes/php/php_browsecap.ini CHANGED
@@ -1,9 +1,9 @@
1
  ;;; Provided courtesy of http://browsers.garykeith.com
2
- ;;; Created on Friday, December 11, 2009 at 3:27 PM GMT
3
 
4
  [GJK_Browscap_Version]
5
- Version=4523
6
- Released=Fri, 11 Dec 2009 15:27:01 -0000
7
 
8
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DefaultProperties
9
 
@@ -63,10 +63,6 @@ Frames=true
63
  Tables=true
64
  Crawler=true
65
 
66
- [AC-BaiduBot/1.*]
67
- Parent=Baidu
68
- Browser="AC-BaiduBot"
69
-
70
  [BaiduImageSpider*]
71
  Parent=Baidu
72
  Browser="BaiduImageSpider"
@@ -130,10 +126,6 @@ Parent=Google
130
  Browser="Googlebot-Image"
131
  CDF=true
132
 
133
- [Googlebot-News/*]
134
- Parent=Google
135
- Browser="Googlebot-News"
136
-
137
  [googlebot-urlconsole]
138
  Parent=Google
139
  Browser="googlebot-urlconsole"
@@ -154,10 +146,6 @@ Browser="Googlebot"
154
  Parent=Google
155
  Browser="Googlebot/Test"
156
 
157
- [GoogleFriendConnect/1.*]
158
- Parent=Google
159
- Browser="Google Friend Connect"
160
-
161
  [gsa-crawler*]
162
  Parent=Google
163
  Browser="Google Search Appliance"
@@ -167,10 +155,15 @@ isBanned=true
167
  Parent=Google
168
  Browser="Mediapartners-Google"
169
 
170
- [Mozilla/?.0 (compatible; Google Desktop*)]
171
  Parent=Google
172
  Browser="Google Desktop"
173
 
 
 
 
 
 
174
  [Mozilla/5.0 (compatible; Google Keyword Tool;*)]
175
  Parent=Google
176
  Browser="Google Keyword Tool"
@@ -222,10 +215,6 @@ Browser="Y!J-AGENT/BMI"
222
  Parent=Inktomi
223
  Browser="Yahoo! Directory Engine"
224
 
225
- [Mozilla/5.0 (compatible; Yahoo! SearchMonkey 1.0; *)]
226
- Parent=Inktomi
227
- Browser="Yahoo! Search Monkey"
228
-
229
  [Mozilla/5.0 (compatible; Yahoo! Slurp China; http://misc.yahoo.com.cn/help.html)]
230
  Parent=Inktomi
231
  Browser="Yahoo! Slurp China"
@@ -277,76 +266,21 @@ MinorVer=3
277
  Parent=Inktomi
278
  Browser="slurp"
279
 
280
- [Y!J SearchMonkey/1.0*]
281
- Parent=Inktomi
282
- Browser="YahooFeedSeeker"
283
- isSyndicationReader=true
284
-
285
- [Y!J-BRE*]
286
- Parent=Inktomi
287
- Browser="YahooFeedSeeker"
288
- isSyndicationReader=true
289
-
290
- [Y!J-BRG/GSC*]
291
- Parent=Inktomi
292
- Browser="YahooFeedSeeker"
293
- isSyndicationReader=true
294
-
295
- [Y!J-BRI*]
296
- Parent=Inktomi
297
- Browser="YahooFeedSeeker"
298
- isSyndicationReader=true
299
-
300
- [Y!J-BRO/YFSJ*]
301
- Parent=Inktomi
302
- Browser="YahooFeedSeeker"
303
- isSyndicationReader=true
304
-
305
- [Y!J-BRP/YFSBJ*]
306
- Parent=Inktomi
307
- Browser="YahooFeedSeeker"
308
- isSyndicationReader=true
309
-
310
- [Y!J-BRQ/DLCK*]
311
- Parent=Inktomi
312
- Browser="YahooFeedSeeker"
313
- isSyndicationReader=true
314
-
315
  [Y!J-BSC/1.0*]
316
  Parent=Inktomi
317
- Browser="YahooFeedSeeker"
318
  Version=1.0
319
  MajorVer=1
320
  MinorVer=0
321
- isSyndicationReader=true
322
-
323
- [Y!J-DSC*]
324
- Parent=Inktomi
325
- Browser="YahooFeedSeeker"
326
- isSyndicationReader=true
327
-
328
- [Y!J-NSC/1.0*]
329
- Parent=Inktomi
330
- Browser="YahooFeedSeeker"
331
- isSyndicationReader=true
332
-
333
- [Y!J-PSC*]
334
- Parent=Inktomi
335
- Browser="YahooFeedSeeker"
336
- isSyndicationReader=true
337
 
338
  [Y!J-SRD/1.0]
339
  Parent=Inktomi
340
- Browser="YahooFeedSeeker"
341
  Version=1.0
342
  MajorVer=1
343
  MinorVer=0
344
 
345
- [Y!J-VSC/ViSe*]
346
- Parent=Inktomi
347
- Browser="YahooFeedSeeker"
348
- isSyndicationReader=true
349
-
350
  [Yahoo Mindset]
351
  Parent=Inktomi
352
  Browser="Yahoo Mindset"
@@ -755,9 +689,9 @@ isBanned=true
755
  Parent=Exalead
756
  Browser="Exabot-Images"
757
 
758
- [Mozilla/5.0 (compatible; Exabot/3.0 (BiggerBetter); *)]
759
  Parent=Exalead
760
- Browser="Exabot/BiggerBetter"
761
 
762
  [Mozilla/5.0 (compatible; Exabot/3.0;*)]
763
  Parent=Exalead
@@ -1119,11 +1053,6 @@ Version=1.0
1119
  MajorVer=1
1120
  MinorVer=0
1121
 
1122
- [cz32ts]
1123
- Parent=General Crawlers
1124
- Browser="cz32ts"
1125
- isBanned=true
1126
-
1127
  [ddetailsbot (http://www.displaydetails.com)]
1128
  Parent=General Crawlers
1129
  Browser="ddetailsbot"
@@ -1242,11 +1171,6 @@ Parent=General Crawlers
1242
  Browser="LucidMedia-ClickSense"
1243
  isBanned=true
1244
 
1245
- [Made by ZmEu @ WhiteHat v0.* (www.WhiteHat.ro)]
1246
- Parent=General Crawlers
1247
- Browser="ZmEu"
1248
- isBanned=true
1249
-
1250
  [Mahalobot/1.0 (?http://www.mahalo.com/)]
1251
  Parent=General Crawlers
1252
  Browser="Mahalobot"
@@ -1390,19 +1314,18 @@ isBanned=true
1390
  Parent=General Crawlers
1391
  Browser="Kyluka"
1392
 
1393
- [Mozilla/5.0 (compatible; MJ12bot/v1.*)]
1394
  Parent=General Crawlers
1395
  Browser="MJ12bot"
 
 
 
1396
  isBanned=true
1397
 
1398
  [Mozilla/5.0 (compatible; MSIE 7.0 ?http://www.europarchive.org)]
1399
  Parent=General Crawlers
1400
  Browser="Europe Web Archive"
1401
 
1402
- [Mozilla/5.0 (compatible; Plukkie/1.?; http://www.botje.com/plukkie.htm)]
1403
- Parent=General Crawlers
1404
- Browser="Plukkie"
1405
-
1406
  [Mozilla/5.0 (compatible; Seznam screenshot-generator 2.0;*)]
1407
  Parent=General Crawlers
1408
  Browser="Seznam screenshot-generator"
@@ -1420,11 +1343,6 @@ Browser="UnWrap"
1420
  Parent=General Crawlers
1421
  Browser="Vermut"
1422
 
1423
- [Mozilla/5.0 (compatible; Viralheat Bot/*) ]
1424
- Parent=General Crawlers
1425
- Browser="Viralheat"
1426
- isBanned=true
1427
-
1428
  [Mozilla/5.0 (compatible; Webbot/*)]
1429
  Parent=General Crawlers
1430
  Browser="Webbot.ru"
@@ -1443,11 +1361,6 @@ Parent=General Crawlers
1443
  Browser="NetCarta_WebMapper"
1444
  isBanned=true
1445
 
1446
- [Netchart Adv Crawler*]
1447
- Parent=General Crawlers
1448
- Browser="Netchart Adv Crawler"
1449
- isBanned=true
1450
-
1451
  [NetID.com Bot*]
1452
  Parent=General Crawlers
1453
  Browser="NetID.com Bot"
@@ -1686,19 +1599,10 @@ Parent=General Crawlers
1686
  Browser="Talkro Web-Shot"
1687
  isBanned=true
1688
 
1689
- [Tasap-image-robot/0.* (http://www.tasap.com)]
1690
- Parent=General Crawlers
1691
- Browser="Tasap-image-robot"
1692
- isBanned=true
1693
-
1694
  [Tecomi Bot (http://www.tecomi.com/bot.htm)]
1695
  Parent=General Crawlers
1696
  Browser="Tecomi"
1697
 
1698
- [TencentTraveler*]
1699
- Parent=General Crawlers
1700
- Browser="TencentTraveler"
1701
-
1702
  [TheInformant*]
1703
  Parent=General Crawlers
1704
  Browser="TheInformant"
@@ -1743,10 +1647,6 @@ isBanned=true
1743
  Parent=General Crawlers
1744
  Browser="Visicom Toolbar"
1745
 
1746
- [Visited by http://tools.geek-tools.org]
1747
- Parent=General Crawlers
1748
- Browser="geek-tools.org"
1749
-
1750
  [W3C-WebCon/*]
1751
  Parent=General Crawlers
1752
  Browser="W3C-WebCon"
@@ -1790,7 +1690,7 @@ Browser="WhizBang"
1790
  Parent=General Crawlers
1791
  Browser="Willow Internet Crawler"
1792
 
1793
- [WIRE/* (Linux*; i686; Bot,Robot,Spider,Crawler)]
1794
  Parent=General Crawlers
1795
  Browser="WIRE"
1796
  isBanned=true
@@ -1926,10 +1826,6 @@ Browser="Deepindex"
1926
  Parent=Search Engines
1927
  Browser="DiamondBot"
1928
 
1929
- [DuckDuckBot/*; (?http://duckduckgo.com/duckduckbot.html)]
1930
- Parent=Search Engines
1931
- Browser="DuckDuckBot"
1932
-
1933
  [Dumbot*]
1934
  Parent=Search Engines
1935
  Browser="Dumbot"
@@ -2080,15 +1976,11 @@ Browser="miniRank"
2080
  Parent=Search Engines
2081
  Browser="Mnogosearch"
2082
 
2083
- [Mozilla/0.9* no dos :) (Linux*)]
2084
  Parent=Search Engines
2085
  Browser="goliat"
2086
  isBanned=true
2087
 
2088
- [Mozilla/4.0 (compatible; *Vagabondo/*; webcrawler at wise-guys dot nl; *)]
2089
- Parent=Search Engines
2090
- Browser="Vagabondo"
2091
-
2092
  [Mozilla/4.0 (compatible; Arachmo)]
2093
  Parent=Search Engines
2094
  Browser="Arachmo"
@@ -2103,6 +1995,10 @@ Parent=Search Engines
2103
  Browser="Girafabot"
2104
  Win32=true
2105
 
 
 
 
 
2106
  [Mozilla/4.0(?compatible; MSIE 6.0; Qihoo *)]
2107
  Parent=Search Engines
2108
  Browser="Qihoo"
@@ -2120,10 +2016,6 @@ isBanned=true
2120
  Parent=Search Engines
2121
  Browser="ActiveTouristBot"
2122
 
2123
- [Mozilla/5.0 (compatible; ayna-crawler http://www.ayna.com)]
2124
- Parent=Search Engines
2125
- Browser="ayna-crawler"
2126
-
2127
  [Mozilla/5.0 (compatible; Butterfly/1.0; *)*]
2128
  Parent=Search Engines
2129
  Browser="Butterfly"
@@ -2166,10 +2058,6 @@ Parent=Search Engines
2166
  Browser="Octopodus"
2167
  isBanned=true
2168
 
2169
- [Mozilla/5.0 (compatible; ParchBot/1.0;*)]
2170
- Parent=Search Engines
2171
- Browser="ParchBot"
2172
-
2173
  [Mozilla/5.0 (compatible; Pogodak.*)]
2174
  Parent=Search Engines
2175
  Browser="Pogodak"
@@ -2181,7 +2069,6 @@ Browser="Quantcastbot"
2181
  [Mozilla/5.0 (compatible; ScoutJet; *http://www.scoutjet.com/)]
2182
  Parent=Search Engines
2183
  Browser="ScoutJet"
2184
- isBanned=true
2185
 
2186
  [Mozilla/5.0 (compatible; Scrubby/*; http://www.scrubtheweb.com/abs/meta-check.html)]
2187
  Parent=Search Engines
@@ -2916,14 +2803,6 @@ Browser="www4mail"
2916
  Parent=E-Mail Harvesters
2917
  Browser="8484 Boston Project"
2918
 
2919
- [Atomic_Email]
2920
- Parent=E-Mail Harvesters
2921
- Browser="Atomic_Email"
2922
-
2923
- [Atomic_Email_Hunter/*]
2924
- Parent=E-Mail Harvesters
2925
- Browser="Atomic Email Hunter"
2926
-
2927
  [CherryPicker*/*]
2928
  Parent=E-Mail Harvesters
2929
  Browser="CherryPickerElite"
@@ -3016,10 +2895,6 @@ Browser="Bloglines Title Fetch"
3016
  Parent=Feeds Blogs
3017
  Browser="BlogLines Web"
3018
 
3019
- [BlogPulse (ISSpider-3.*)]
3020
- Parent=Feeds Blogs
3021
- Browser="BlogPulse"
3022
-
3023
  [BlogPulseLive (support@blogpulse.com)]
3024
  Parent=Feeds Blogs
3025
  Browser="BlogPulseLive"
@@ -3217,10 +3092,6 @@ Browser="NewsMonster"
3217
  Parent=Feeds Syndicators
3218
  Browser="Rojo"
3219
 
3220
- [Mozilla/5.0 NewsFox/*]
3221
- Parent=Feeds Syndicators
3222
- Browser="NewsFox"
3223
-
3224
  [Netvibes (*)]
3225
  Parent=Feeds Syndicators
3226
  Browser="Netvibes"
@@ -3857,10 +3728,6 @@ Parent=Miscellaneous Browsers
3857
  Browser="12345"
3858
  isBanned=true
3859
 
3860
- [1st ZipCommander (Net) - http://www.zipcommander.com/]
3861
- Parent=Miscellaneous Browsers
3862
- Browser="1st ZipCommander"
3863
-
3864
  [Ace Explorer]
3865
  Parent=Miscellaneous Browsers
3866
  Browser="Ace Explorer"
@@ -4306,10 +4173,6 @@ Browser="3wGet"
4306
  Parent=Rippers
4307
  Browser="ActiveRefresh"
4308
 
4309
- [Ad Muncher*]
4310
- Parent=Rippers
4311
- Browser="Ad Muncher"
4312
-
4313
  [Artera (Version *)]
4314
  Parent=Rippers
4315
  Browser="Artera"
@@ -4434,10 +4297,6 @@ Browser="HTMLParser"
4434
  Parent=Rippers
4435
  Browser="http generic"
4436
 
4437
- [http://arachnode.net*]
4438
- Parent=Rippers
4439
- Browser="arachnode"
4440
-
4441
  [httpclient*]
4442
  Parent=Rippers
4443
 
@@ -4896,7 +4755,7 @@ Browser="websitepulse checker"
4896
 
4897
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Social Bookmarkers
4898
 
4899
- [Social Networking]
4900
  Parent=DefaultProperties
4901
  Browser="Social Bookmarkers"
4902
  Frames=true
@@ -4905,38 +4764,23 @@ Cookies=true
4905
  JavaScript=true
4906
 
4907
  [BookmarkBase(2/;http://bookmarkbase.com)]
4908
- Parent=Social Networking
4909
  Browser="BookmarkBase"
4910
 
4911
  [Cocoal.icio.us/1.0 (v43) (Mac OS X; http://www.scifihifi.com/cocoalicious)]
4912
- Parent=Social Networking
4913
  Browser="Cocoalicious"
4914
 
4915
- [Mozilla/5.0 (*) Gecko/* Firefox/2.0 OneRiot/1.0 (http://www.oneriot.com) ]
4916
- Parent=Social Networking
4917
- Browser="OneRiot"
4918
- isBanned=true
4919
-
4920
  [Mozilla/5.0 (compatible; FriendFeedBot/0.*; Http://friendfeed.com/about/bot)]
4921
- Parent=Social Networking
4922
  Browser="FriendFeedBot"
4923
 
4924
- [Mozilla/5.0 (compatible; Twitturls; http://twitturls.com)]
4925
- Parent=Social Networking
4926
- Browser="Twitturls"
4927
- isBanned=true
4928
-
4929
- [SocialSpider-Finder/0.*]
4930
- Parent=Social Networking
4931
- Browser="SocialSpider-Finder"
4932
-
4933
  [Twitturly*]
4934
- Parent=Social Networking
4935
  Browser="Twitturly"
4936
- isBanned=true
4937
 
4938
  [WinkBot/*]
4939
- Parent=Social Networking
4940
  Browser="WinkBot"
4941
 
4942
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Translators
@@ -4985,14 +4829,6 @@ MajorVer=1
4985
  MinorVer=0
4986
  Platform=Win2000
4987
 
4988
- [Browscap Mirror System/1.* (browscap.giantrealm.com)]
4989
- Parent=Version Checkers
4990
- Browser="Browscap Mirror"
4991
-
4992
- [Browscap Mirror v1.30]
4993
- Parent=Version Checkers
4994
- Browser="Browscap Mirror"
4995
-
4996
  [Browscap updater]
4997
  Parent=Version Checkers
4998
  Browser="Browscap updater"
@@ -5025,10 +4861,6 @@ Parent=Version Checkers
5025
  Browser="Mono Browser Capabilities Updater"
5026
  isBanned=true
5027
 
5028
- [PHP Browser Capabilities Project/0.7 socket]
5029
- Parent=Version Checkers
5030
- Browser="PHP Browser Capabilities Project"
5031
-
5032
  [Rewmi/*]
5033
  Parent=Version Checkers
5034
  isBanned=true
@@ -5053,38 +4885,6 @@ Browser="clarkson.edu "
5053
  Parent=Version Checkers
5054
  Browser="Subst�ncia"
5055
 
5056
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; W3C
5057
-
5058
- [W3C]
5059
- Parent=DefaultProperties
5060
- Browser="W3C"
5061
- Crawler=true
5062
-
5063
- [Jigsaw/* W3C_CSS_Validator*/*]
5064
- Parent=W3C
5065
- Browser="W3C CSS Validator"
5066
-
5067
- [W3C-checklink/*]
5068
- Parent=W3C
5069
- Browser="W3C Link Checker"
5070
-
5071
- [W3C-mobileOK/DDC-*]
5072
- Parent=W3C
5073
- Browser="W3C Mobile Validator"
5074
- isMobileDevice=true
5075
-
5076
- [W3C-WebCon/*]
5077
- Parent=W3C
5078
- Browser="W3C WebCon"
5079
-
5080
- [W3C_Validator/*]
5081
- Parent=W3C
5082
- Browser="W3C Validator"
5083
-
5084
- [W3CLineMode/*]
5085
- Parent=W3C
5086
- Browser="W3C LineMode"
5087
-
5088
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Become
5089
 
5090
  [Become]
@@ -5212,7 +5012,7 @@ Parent=Netcraft
5212
  Browser="Netcraft Webserver Survey"
5213
  isBanned=true
5214
 
5215
- [Mozilla/5.0 (compatible; NetcraftSurveyAgent/1.0; *info@netcraft.com)]
5216
  Parent=Netcraft
5217
  Browser="NetcraftSurveyAgent"
5218
 
@@ -5442,7 +5242,7 @@ Platform=Win7
5442
  Parent=Chrome 2.0
5443
  Platform=Win7
5444
 
5445
- [Mozilla/5.0 (X11; U; Linux i686*; *) AppleWebKit/* (KHTML, like Gecko) Chrome/2.0.* Safari/*]
5446
  Parent=Chrome 2.0
5447
  Platform=Linux
5448
 
@@ -5483,61 +5283,10 @@ Platform=Win7
5483
  Parent=Chrome 3.0
5484
  Platform=Win7
5485
 
5486
- [Mozilla/5.0 (X11; U; Linux i686*; *) AppleWebKit/* (KHTML, like Gecko) Chrome/3.0.* Safari/*]
5487
  Parent=Chrome 3.0
5488
  Platform=Linux
5489
 
5490
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Chrome 4.0
5491
-
5492
- [Chrome 4.0]
5493
- Parent=DefaultProperties
5494
- Browser="Chrome"
5495
- Version=4.0
5496
- MajorVer=4
5497
- Beta=true
5498
- Win32=true
5499
- Frames=true
5500
- IFrames=true
5501
- Tables=true
5502
- Cookies=true
5503
- JavaApplets=true
5504
- JavaScript=true
5505
- CssVersion=3
5506
- supportsCSS=true
5507
-
5508
- [Mozilla/5.0 (Macintosh; U; Intel Mac OS X*; *) AppleWebKit/* (KHTML, like Gecko) Chrome/4.0.* Safari/*]
5509
- Parent=Chrome 4.0
5510
- Platform=MacOSX
5511
-
5512
- [Mozilla/5.0 (Windows; U; Windows NT 5.1; *) AppleWebKit/* (KHTML, like Gecko) Chrome/4.0.* Safari/*]
5513
- Parent=Chrome 4.0
5514
- Platform=WinXP
5515
-
5516
- [Mozilla/5.0 (Windows; U; Windows NT 5.2; *) AppleWebKit/* (KHTML, like Gecko) Chrome/4.0.* Safari/*]
5517
- Parent=Chrome 4.0
5518
- Platform=Win2003
5519
-
5520
- [Mozilla/5.0 (Windows; U; Windows NT 6.0; *) AppleWebKit/* (KHTML, like Gecko) Chrome/4.0.* Safari/*]
5521
- Parent=Chrome 4.0
5522
- Platform=WinVista
5523
-
5524
- [Mozilla/5.0 (Windows; U; Windows NT 6.1; *) AppleWebKit/* (KHTML, like Gecko) Chrome/4.0.* Safari/*]
5525
- Parent=Chrome 4.0
5526
- Platform=Win7
5527
-
5528
- [Mozilla/5.0 (Windows; U; Windows NT 7.0; *) AppleWebKit/* (KHTML, like Gecko) Chrome/4.0.* Safari/*]
5529
- Parent=Chrome 4.0
5530
- Platform=Win7
5531
-
5532
- [Mozilla/5.0 (X11; U; Linux i686*; *) AppleWebKit/* (KHTML, like Gecko) Chrome/4.0.* Safari/*]
5533
- Parent=Chrome 4.0
5534
- Platform=Linux
5535
-
5536
- [Mozilla/5.0 (X11; U; Linux x86_64; *) AppleWebKit/* (KHTML, like Gecko) Chrome/4.0.* Safari/*]
5537
- Parent=Chrome 4.0
5538
- Win32=false
5539
- Win64=true
5540
-
5541
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Google Code
5542
 
5543
  [Google Code]
@@ -5712,6 +5461,40 @@ Platform=WinVista
5712
  Parent=Iron 2.0
5713
  Platform=Win7
5714
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5715
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Media Players
5716
 
5717
  [Media Players]
@@ -5767,25 +5550,6 @@ isBanned=true
5767
  Parent=Media Players
5768
  Browser="WinAmp"
5769
 
5770
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Microsoft Zune
5771
-
5772
- [Microsoft Zune]
5773
- Parent=DefaultProperties
5774
- Browser=""
5775
- Cookies=true
5776
-
5777
- [Mozilla/4.0 (compatible; MSIE ?.0; Microsoft ZuneHD 4.*)]
5778
- Parent=Microsoft Zune
5779
- Version=4.0
5780
- MajorVer=4
5781
- MinorVer=0
5782
-
5783
- [Mozilla/4.0 (compatible; ZuneHD 4.*)]
5784
- Parent=Microsoft Zune
5785
- Browser="ZuneHD"
5786
- Version=4
5787
- MajorVer=4
5788
-
5789
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Nintendo
5790
 
5791
  [Nintendo Wii]
@@ -5887,6 +5651,31 @@ MajorVer=9
5887
  MinorVer=0
5888
  Win32=true
5889
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5890
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; QuickTime 7.0
5891
 
5892
  [QuickTime 7.0]
@@ -6141,10 +5930,8 @@ Parent=DefaultProperties
6141
  Browser="Android"
6142
  Platform=Android
6143
  Frames=true
6144
- IFrames=true
6145
  Tables=true
6146
  Cookies=true
6147
- JavaApplets=true
6148
  JavaScript=true
6149
  isMobileDevice=true
6150
 
@@ -6167,15 +5954,6 @@ Version=3.0
6167
  MajorVer=3
6168
  MinorVer=0
6169
 
6170
- [Mozilla/5.0 (Linux; U; Android 2.0*; *; Droid Build/*) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17]
6171
- Parent=Android
6172
- Browser="Mobile Safari"
6173
- Version=2.0
6174
- MajorVer=2
6175
- MinorVer=0
6176
- CssVersion=3
6177
- supportsCSS=true
6178
-
6179
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; BlackBerry
6180
 
6181
  [BlackBerry]
@@ -6312,80 +6090,89 @@ isMobileDevice=true
6312
  CssVersion=3
6313
  supportsCSS=true
6314
 
6315
- [Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 2_* like Mac OS X; *) AppleWebKit/* (KHTML, like Gecko)*]
6316
  Parent=iPhone
6317
- Browser="iPhone Simulator"
6318
- Version=2.0
6319
- MajorVer=2
6320
- MinorVer=0
6321
 
6322
- [Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 3* like Mac OS X; *) AppleWebKit/* (KHTML, like Gecko)*]
6323
  Parent=iPhone
6324
- Version=3.0
6325
- MajorVer=3
6326
- MinorVer=0
6327
 
6328
- [Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 3_1* like Mac OS X; *) AppleWebKit/* (KHTML, like Gecko)*]
6329
  Parent=iPhone
 
6330
  Version=3.1
6331
  MajorVer=3
6332
  MinorVer=1
6333
 
6334
- [Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_* like Mac OS X; *) AppleWebKit/* (KHTML, like Gecko)*]
6335
  Parent=iPhone
6336
- Version=2.0
6337
- MajorVer=2
6338
- MinorVer=0
 
6339
 
6340
- [Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_* like Mac OS X; *)*]
6341
  Parent=iPhone
6342
- Version=2.0
6343
- MajorVer=2
6344
- MinorVer=0
 
6345
 
6346
- [Mozilla/5.0 (iPhone; U; CPU iPhone OS 3* like Mac OS X; *) AppleWebKit/* (KHTML, like Gecko)*]
6347
  Parent=iPhone
6348
- Version=3.0
6349
- MajorVer=3
6350
- MinorVer=0
6351
 
6352
- [Mozilla/5.0 (iPhone; U; CPU iPhone OS 3* like Mac OS X; *)*]
6353
  Parent=iPhone
6354
- Version=3.0
6355
  MajorVer=3
6356
- MinorVer=0
6357
 
6358
- [Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1* like Mac OS X; *) AppleWebKit/* (KHTML, like Gecko)*]
6359
  Parent=iPhone
6360
  Version=3.1
6361
  MajorVer=3
6362
  MinorVer=1
6363
 
6364
- [Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1* like Mac OS X; *)*]
6365
  Parent=iPhone
6366
  Version=3.1
6367
  MajorVer=3
6368
  MinorVer=1
6369
 
6370
- [Mozilla/5.0 (iPod; U; CPU iPhone OS 2_* like Mac OS X; *)*]
6371
  Parent=iPhone
6372
- Browser="iPod Touch"
6373
- Version=2.0
6374
- MajorVer=2
6375
- MinorVer=0
6376
 
6377
- [Mozilla/5.0 (iPod; U; CPU iPhone OS 3* like Mac OS X; *)*]
 
 
 
 
 
 
6378
  Parent=iPhone
6379
- Browser="iPod Touch"
6380
  Version=3.0
6381
  MajorVer=3
6382
  MinorVer=0
6383
 
6384
- [Mozilla/5.0 (iPod; U; CPU iPhone OS 3_1* like Mac OS X; *)*]
6385
  Parent=iPhone
6386
- Version=3.1
6387
  MajorVer=3
6388
- MinorVer=1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6389
 
6390
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; KDDI
6391
 
@@ -6635,12 +6422,6 @@ Version=4.2
6635
  MajorVer=4
6636
  MinorVer=2
6637
 
6638
- [Opera/* (J2ME/MIDP; Opera Mini/5.0*)*]
6639
- Parent=Opera Mini
6640
- Version=5.0
6641
- MajorVer=5
6642
- MinorVer=0
6643
-
6644
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Opera Mobile
6645
 
6646
  [Opera Mobile]
@@ -6651,27 +6432,6 @@ Tables=true
6651
  Cookies=true
6652
  isMobileDevice=true
6653
 
6654
- [Opera/9.* (*SymbOS; Opera Mobi/*; U; *) Presto/2.* Version/10.*]
6655
- Parent=Opera Mobile
6656
- Version=10.0
6657
- MajorVer=10
6658
- MinorVer=0
6659
- Platform=SymbianOS
6660
-
6661
- [Opera/9.* (Microsoft Windows; PPC; Opera Mobi/*; U; *)]
6662
- Parent=Opera Mobile
6663
- Version=9.0
6664
- MajorVer=9
6665
- MinorVer=0
6666
- Platform=Win
6667
-
6668
- [Opera/9.* (Windows Mobile; *; Opera Mobi/*; U; *) Presto/2.*]
6669
- Parent=Opera Mobile
6670
- Version=9.0
6671
- MajorVer=9
6672
- MinorVer=0
6673
- Platform=Win
6674
-
6675
  [Opera/9.5 (Microsoft Windows; PPC; *Opera Mobile/*)]
6676
  Parent=Opera Mobile
6677
  Version=9.5
@@ -6705,7 +6465,7 @@ JavaScript=true
6705
  ActiveXControls=true
6706
  isMobileDevice=true
6707
 
6708
- [Mozilla/5.0 (webOS/1.0*; U; *) AppleWebKit/525.* (KHTML, like Gecko) Version/1.0 Safari/525.* Pre/1.0]
6709
  Parent=Palm
6710
  Browser="Palm Pre"
6711
  Version=1.0
@@ -6714,7 +6474,7 @@ MinorVer=0
6714
  CssVersion=2
6715
  supportsCSS=true
6716
 
6717
- [Mozilla/5.0 (webOS/1.1*; U; *) AppleWebKit/525.* (KHTML, like Gecko) Version/1.0 Safari/525.* Pre/1.0]
6718
  Parent=Palm
6719
  Browser="Palm Pre"
6720
  Version=1.1
@@ -6723,19 +6483,6 @@ MinorVer=1
6723
  CssVersion=2
6724
  supportsCSS=true
6725
 
6726
- [Mozilla/5.0 (webOS/1.2*; U; *) AppleWebKit/525.* (KHTML, like Gecko) Version/1.0 Safari/525.* Pre/1.0]
6727
- Parent=Palm
6728
- Browser="Palm Pre"
6729
- Version=1.2
6730
- MajorVer=1
6731
- MinorVer=2
6732
-
6733
- [Mozilla/5.0 (webOS/1.3*; U; *) AppleWebKit/525.* (KHTML, like Gecko) Version/1.0 Safari/525.* Pre/1.0]
6734
- Parent=Palm
6735
- Version=1.3
6736
- MajorVer=1
6737
- MinorVer=3
6738
-
6739
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Playstation
6740
 
6741
  [Playstation]
@@ -6953,45 +6700,141 @@ JavaApplets=true
6953
  CssVersion=1
6954
  supportsCSS=true
6955
 
6956
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Amaya
6957
-
6958
- [Amaya]
6959
- Parent=DefaultProperties
6960
- Browser="Amaya"
6961
- Tables=true
6962
- Cookies=true
6963
-
6964
- [amaya/10.*]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6965
  Parent=Amaya
6966
- Version=10.0
6967
- MajorVer=10
6968
- MinorVer=0
 
 
6969
 
6970
- [amaya/11.*]
6971
  Parent=Amaya
6972
- Version=11.0
6973
- MajorVer=11
6974
  MinorVer=0
 
 
6975
 
6976
- [amaya/7.*]
6977
  Parent=Amaya
6978
- Version=7.0
6979
- MajorVer=7
6980
- MinorVer=0
 
 
6981
 
6982
- [amaya/8.*]
6983
  Parent=Amaya
6984
- Version=8.0
6985
- MajorVer=8
6986
- MinorVer=0
6987
  CssVersion=2
6988
  supportsCSS=true
6989
 
6990
- [amaya/9.*]
6991
  Parent=Amaya
6992
- Version=9.0
6993
  MajorVer=9
6994
- MinorVer=0
 
 
 
 
 
 
 
 
 
 
 
 
6995
 
6996
  [Emacs-w3m/*]
6997
  Parent=Emacs/W3
@@ -7657,136 +7500,6 @@ Platform=Solaris
7657
  Parent=ELinks 0.12
7658
  Platform=Unix
7659
 
7660
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ELinks 0.13
7661
-
7662
- [ELinks 0.13]
7663
- Parent=DefaultProperties
7664
- Browser="ELinks"
7665
- Version=0.13
7666
- MinorVer=13
7667
- Frames=true
7668
- Tables=true
7669
-
7670
- [ELinks (0.13*; *AIX*)]
7671
- Parent=ELinks 0.13
7672
- Platform=AIX
7673
-
7674
- [ELinks (0.13*; *BeOS*)]
7675
- Parent=ELinks 0.13
7676
- Platform=BeOS
7677
-
7678
- [ELinks (0.13*; *CygWin*)]
7679
- Parent=ELinks 0.13
7680
- Platform=CygWin
7681
-
7682
- [ELinks (0.13*; *Darwin*)]
7683
- Parent=ELinks 0.13
7684
- Platform=Darwin
7685
-
7686
- [ELinks (0.13*; *Digital Unix*)]
7687
- Parent=ELinks 0.13
7688
- Platform=Digital Unix
7689
-
7690
- [ELinks (0.13*; *FreeBSD*)]
7691
- Parent=ELinks 0.13
7692
- Platform=FreeBSD
7693
-
7694
- [ELinks (0.13*; *HPUX*)]
7695
- Parent=ELinks 0.13
7696
- Platform=HP-UX
7697
-
7698
- [ELinks (0.13*; *IRIX*)]
7699
- Parent=ELinks 0.13
7700
- Platform=IRIX
7701
-
7702
- [ELinks (0.13*; *Linux*)]
7703
- Parent=ELinks 0.13
7704
- Platform=Linux
7705
-
7706
- [ELinks (0.13*; *NetBSD*)]
7707
- Parent=ELinks 0.13
7708
- Platform=NetBSD
7709
-
7710
- [ELinks (0.13*; *OpenBSD*)]
7711
- Parent=ELinks 0.13
7712
- Platform=OpenBSD
7713
-
7714
- [ELinks (0.13*; *OS/2*)]
7715
- Parent=ELinks 0.13
7716
- Platform=OS/2
7717
-
7718
- [ELinks (0.13*; *RISC*)]
7719
- Parent=ELinks 0.13
7720
- Platform=RISC OS
7721
-
7722
- [ELinks (0.13*; *Solaris*)]
7723
- Parent=ELinks 0.13
7724
- Platform=Solaris
7725
-
7726
- [ELinks (0.13*; *Unix*)]
7727
- Parent=ELinks 0.13
7728
- Platform=Unix
7729
-
7730
- [ELinks/0.13* (*AIX*)]
7731
- Parent=ELinks 0.13
7732
- Platform=AIX
7733
-
7734
- [ELinks/0.13* (*BeOS*)]
7735
- Parent=ELinks 0.13
7736
- Platform=BeOS
7737
-
7738
- [ELinks/0.13* (*CygWin*)]
7739
- Parent=ELinks 0.13
7740
- Platform=CygWin
7741
-
7742
- [ELinks/0.13* (*Darwin*)]
7743
- Parent=ELinks 0.13
7744
- Platform=Darwin
7745
-
7746
- [ELinks/0.13* (*Digital Unix*)]
7747
- Parent=ELinks 0.13
7748
- Platform=Digital Unix
7749
-
7750
- [ELinks/0.13* (*FreeBSD*)]
7751
- Parent=ELinks 0.13
7752
- Platform=FreeBSD
7753
-
7754
- [ELinks/0.13* (*HPUX*)]
7755
- Parent=ELinks 0.13
7756
- Platform=HP-UX
7757
-
7758
- [ELinks/0.13* (*IRIX*)]
7759
- Parent=ELinks 0.13
7760
- Platform=IRIX
7761
-
7762
- [ELinks/0.13* (*Linux*)]
7763
- Parent=ELinks 0.13
7764
- Platform=Linux
7765
-
7766
- [ELinks/0.13* (*NetBSD*)]
7767
- Parent=ELinks 0.13
7768
- Platform=NetBSD
7769
-
7770
- [ELinks/0.13* (*OpenBSD*)]
7771
- Parent=ELinks 0.13
7772
- Platform=OpenBSD
7773
-
7774
- [ELinks/0.13* (*OS/2*)]
7775
- Parent=ELinks 0.13
7776
- Platform=OS/2
7777
-
7778
- [ELinks/0.13* (*RISC*)]
7779
- Parent=ELinks 0.13
7780
- Platform=RISC OS
7781
-
7782
- [ELinks/0.13* (*Solaris*)]
7783
- Parent=ELinks 0.13
7784
- Platform=Solaris
7785
-
7786
- [ELinks/0.13* (*Unix*)]
7787
- Parent=ELinks 0.13
7788
- Platform=Unix
7789
-
7790
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ELinks 0.9
7791
 
7792
  [ELinks 0.9]
@@ -8497,12 +8210,6 @@ MajorVer=4
8497
  MinorVer=2
8498
  Platform=MacOSX
8499
 
8500
- [Mozilla/5.0 (Macintosh; U; Intel Mac OS X*; *) AppleWebKit/* (KHTML, like Gecko) iCab/4.7 Safari/*]
8501
- Parent=iCab
8502
- Version=4.7
8503
- MajorVer=4
8504
- MinorVer=7
8505
-
8506
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; iSiloX
8507
 
8508
  [iSiloX]
@@ -8590,20 +8297,32 @@ JavaApplets=true
8590
  JavaScript=true
8591
  Crawler=true
8592
 
8593
- [Mozilla/5.0 (X11; U; Linux i686*; en-US; rv:1.*: Desktop/LX Amethyst) Gecko/*]
8594
  Parent=Lycoris Desktop/LX
8595
  Version=1.1
8596
  MajorVer=1
8597
  MinorVer=1
8598
  Platform=Linux
8599
 
8600
- [Mozilla/5.0 (X11; U; Linux i686*; en-US; rv:1.*; Desktop/LX Amethyst) Gecko/*]
8601
  Parent=Lycoris Desktop/LX
8602
  Version=1.0
8603
  MajorVer=1
8604
  MinorVer=0
8605
  Platform=Linux
8606
 
 
 
 
 
 
 
 
 
 
 
 
 
8607
  [Mozilla/4.0 (VMS_Mosaic)]
8608
  Parent=Mosaic
8609
  Platform=OpenVMS
@@ -8710,6 +8429,18 @@ Version=5.1
8710
  MajorVer=5
8711
  MinorVer=1
8712
 
 
 
 
 
 
 
 
 
 
 
 
 
8713
  [Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/420+ (KHTML, like Gecko, Safari/420) OmniWeb/v607]
8714
  Parent=OmniWeb
8715
  Version=5.5
@@ -8722,6 +8453,12 @@ Version=5.6
8722
  MajorVer=5
8723
  MinorVer=6
8724
 
 
 
 
 
 
 
8725
  [Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/85 (KHTML, like Gecko) OmniWeb/v496]
8726
  Parent=OmniWeb
8727
  Version=4.5
@@ -9180,22 +8917,19 @@ JavaScript=true
9180
  CssVersion=2
9181
  supportsCSS=true
9182
 
9183
- [Mozilla/5.0 (compatible; Konqueror/4.0*) KHTML/4.0* (like Gecko)]
9184
- Parent=Konqueror 4.0
9185
-
9186
- [Mozilla/5.0 (compatible; Konqueror/4.0*; Debian) KHTML/4.0* (like Gecko)]
9187
  Parent=Konqueror 4.0
9188
  Platform=Debian
9189
 
9190
- [Mozilla/5.0 (compatible; Konqueror/4.0.*; *Linux) KHTML/4.0* (like Gecko)]
9191
  Parent=Konqueror 4.0
9192
  Platform=Linux
9193
 
9194
- [Mozilla/5.0 (compatible; Konqueror/4.0.*; FreeBSD) KHTML/4.0* (like Gecko)]
9195
  Parent=Konqueror 4.0
9196
  Platform=FreeBSD
9197
 
9198
- [Mozilla/5.0 (compatible; Konqueror/4.0.*; NetBSD) KHTML/4.0* (like Gecko)]
9199
  Parent=Konqueror 4.0
9200
  Platform=NetBSD
9201
 
@@ -9215,22 +8949,19 @@ JavaScript=true
9215
  CssVersion=2
9216
  supportsCSS=true
9217
 
9218
- [Mozilla/5.0 (compatible; Konqueror/4.1*) KHTML/4.1* (like Gecko)*]
9219
- Parent=Konqueror 4.1
9220
-
9221
- [Mozilla/5.0 (compatible; Konqueror/4.1*; *Linux*) KHTML/4.1* (like Gecko)*]
9222
  Parent=Konqueror 4.1
9223
  Platform=Linux
9224
 
9225
- [Mozilla/5.0 (compatible; Konqueror/4.1*; Debian) KHTML/4.1* (like Gecko)*]
9226
  Parent=Konqueror 4.1
9227
  Platform=Debian
9228
 
9229
- [Mozilla/5.0 (compatible; Konqueror/4.1*; FreeBSD) KHTML/4.1* (like Gecko)*]
9230
  Parent=Konqueror 4.1
9231
  Platform=FreeBSD
9232
 
9233
- [Mozilla/5.0 (compatible; Konqueror/4.1*; NetBSD) KHTML/4.1* (like Gecko)*]
9234
  Parent=Konqueror 4.1
9235
  Platform=NetBSD
9236
 
@@ -9250,68 +8981,22 @@ JavaScript=true
9250
  CssVersion=2
9251
  supportsCSS=true
9252
 
9253
- [Mozilla/5.0 (compatible; Konqueror/4.2*) KHTML/4.2* (like Gecko)*]
9254
- Parent=Konqueror 4.2
9255
-
9256
- [Mozilla/5.0 (compatible; Konqueror/4.2*; *Linux*) KHTML/4.2* (like Gecko)*]
9257
  Parent=Konqueror 4.2
9258
  Platform=Linux
9259
 
9260
- [Mozilla/5.0 (compatible; Konqueror/4.2*; Debian) KHTML/4.2* (like Gecko)*]
9261
  Parent=Konqueror 4.2
9262
  Platform=Debian
9263
 
9264
- [Mozilla/5.0 (compatible; Konqueror/4.2*; FreeBSD) KHTML/4.2* (like Gecko)*]
9265
  Parent=Konqueror 4.2
9266
  Platform=FreeBSD
9267
 
9268
- [Mozilla/5.0 (compatible; Konqueror/4.2*; NetBSD) KHTML/4.2* (like Gecko)*]
9269
  Parent=Konqueror 4.2
9270
  Platform=NetBSD
9271
 
9272
- [Mozilla/5.0 (compatible; Konqueror/4.2*; Windows) KHTML/4.2* (like Gecko)]
9273
- Parent=Konqueror 4.2
9274
- Platform=Win
9275
-
9276
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Konqueror 4.3
9277
-
9278
- [Konqueror 4.3]
9279
- Parent=DefaultProperties
9280
- Browser="Konqueror"
9281
- Version=4.3
9282
- MajorVer=4
9283
- MinorVer=3
9284
- Frames=true
9285
- IFrames=true
9286
- Tables=true
9287
- Cookies=true
9288
- JavaScript=true
9289
- CssVersion=2
9290
- supportsCSS=true
9291
-
9292
- [Mozilla/5.0 (compatible; Konqueror/4.3*) KHTML/4.3* (like Gecko)*]
9293
- Parent=Konqueror 4.3
9294
-
9295
- [Mozilla/5.0 (compatible; Konqueror/4.3*; *Linux*) KHTML/4.3* (like Gecko)*]
9296
- Parent=Konqueror 4.3
9297
- Platform=Linux
9298
-
9299
- [Mozilla/5.0 (compatible; Konqueror/4.3*; Debian) KHTML/4.3* (like Gecko)*]
9300
- Parent=Konqueror 4.3
9301
- Platform=Debian
9302
-
9303
- [Mozilla/5.0 (compatible; Konqueror/4.3*; FreeBSD) KHTML/4.3* (like Gecko)*]
9304
- Parent=Konqueror 4.3
9305
- Platform=FreeBSD
9306
-
9307
- [Mozilla/5.0 (compatible; Konqueror/4.3*; NetBSD) KHTML/4.3* (like Gecko)*]
9308
- Parent=Konqueror 4.3
9309
- Platform=NetBSD
9310
-
9311
- [Mozilla/5.0 (compatible; Konqueror/4.3*; Windows) KHTML/4.3* (like Gecko)]
9312
- Parent=Konqueror 4.3
9313
- Platform=Win
9314
-
9315
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Safari
9316
 
9317
  [Safari]
@@ -9508,6 +9193,7 @@ Parent=DefaultProperties
9508
  Browser="Safari"
9509
  Version=4.0
9510
  MajorVer=4
 
9511
  Frames=true
9512
  IFrames=true
9513
  Tables=true
@@ -9565,13 +9251,14 @@ Platform=Win7
9565
  Parent=Safari 4.0
9566
  Platform=Win7
9567
 
9568
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Opera 10
9569
 
9570
- [Opera 10]
9571
  Parent=DefaultProperties
9572
  Browser="Opera"
9573
  Version=10.0
9574
  MajorVer=10
 
9575
  Frames=true
9576
  IFrames=true
9577
  Tables=true
@@ -9579,111 +9266,111 @@ Cookies=true
9579
  BackgroundSounds=true
9580
  JavaApplets=true
9581
  JavaScript=true
9582
- CssVersion=2
9583
  supportsCSS=true
9584
 
9585
- [Mozilla/4.0 (compatible; MSIE ?.0; Windows NT 5.0; *) Opera 10.*]
9586
- Parent=Opera 10
9587
  Platform=Win2000
9588
 
9589
- [Mozilla/4.0 (compatible; MSIE ?.0; Windows NT 5.1; *) Opera 10.*]
9590
- Parent=Opera 10
9591
  Platform=WinXP
9592
 
9593
- [Mozilla/4.0 (compatible; MSIE ?.0; Windows NT 5.2; *) Opera 10.*]
9594
- Parent=Opera 10
9595
  Platform=Win2003
9596
 
9597
- [Mozilla/4.0 (compatible; MSIE ?.0; Windows NT 6.0; *) Opera 10.*]
9598
- Parent=Opera 10
9599
  Platform=WinVista
9600
 
9601
- [Mozilla/4.0 (compatible; MSIE ?.0; Windows NT 6.1; *) Opera 10.*]
9602
- Parent=Opera 10
9603
  Platform=Win7
9604
 
9605
- [Mozilla/4.0 (compatible; MSIE ?.0; X11; FreeBSD*) Opera 10.*]
9606
- Parent=Opera 10
9607
  Platform=FreeBSD
9608
 
9609
- [Mozilla/4.0 (compatible; MSIE ?.0; X11; Linux*; *) Opera 10.*]
9610
- Parent=Opera 10
9611
  Platform=Linux
9612
 
9613
- [Mozilla/4.0 (compatible; MSIE ?.0; X11; SunOS*) Opera 10.*]
9614
- Parent=Opera 10
9615
  Platform=SunOS
9616
 
9617
- [Opera/10.* (Macintosh; *Mac OS X; U; *) Presto/2.2.*]
9618
- Parent=Opera 10
9619
  Platform=MacOSX
9620
 
9621
- [Opera/10.* (Windows NT 5.0; U; *) Presto/2.2.*]
9622
- Parent=Opera 10
9623
  Platform=Win2000
9624
 
9625
- [Opera/10.* (Windows NT 5.1; U; *) Presto/2.2.*]
9626
- Parent=Opera 10
9627
  Platform=WinXP
9628
 
9629
- [Opera/10.* (Windows NT 5.2; U; *) Presto/2.2.*]
9630
- Parent=Opera 10
9631
  Platform=Win2003
9632
 
9633
- [Opera/10.* (Windows NT 6.0; U; *) Presto/2.2.*]
9634
- Parent=Opera 10
9635
  Platform=WinVista
9636
 
9637
- [Opera/10.* (Windows NT 6.1; U; *) Presto/2.2.*]
9638
- Parent=Opera 10
9639
  Platform=Win7
9640
 
9641
- [Opera/10.* (X11; FreeBSD; U; *) Presto/2.2.*]
9642
- Parent=Opera 10
9643
  Platform=FreeBSD
9644
 
9645
- [Opera/10.* (X11; Linux*; U; *) Presto/2.2.*]
9646
- Parent=Opera 10
9647
  Platform=Linux
9648
 
9649
- [Opera/10.* (X11; SunOS; U; *) Presto/2.2.*]
9650
- Parent=Opera 10
9651
  Platform=SunOS
9652
 
9653
- [Opera/9.80 (Macintosh; *Mac OS X; U; *) Presto/2.2.* Version/10.*]
9654
- Parent=Opera 10
9655
  Platform=MacOSX
9656
 
9657
- [Opera/9.80 (Windows NT 5.0; U; *) Presto/2.2.* Version/10.*]
9658
- Parent=Opera 10
9659
  Platform=Win2000
9660
 
9661
- [Opera/9.80 (Windows NT 5.1; U; *) Presto/2.2.* Version/10.*]
9662
- Parent=Opera 10
9663
  Platform=WinXP
9664
 
9665
- [Opera/9.80 (Windows NT 5.2; U; *) Presto/2.2.* Version/10.*]
9666
- Parent=Opera 10
9667
  Platform=Win2003
9668
 
9669
- [Opera/9.80 (Windows NT 6.0; U; *) Presto/2.2.* Version/10.*]
9670
- Parent=Opera 10
9671
  Platform=WinVista
9672
 
9673
- [Opera/9.80 (Windows NT 6.1; U; *) Presto/2.2.* Version/10.*]
9674
- Parent=Opera 10
9675
  Platform=Win7
9676
 
9677
- [Opera/9.80 (X11; FreeBSD; U; *) Presto/2.2.* Version/10.*]
9678
- Parent=Opera 10
9679
  Platform=FreeBSD
9680
 
9681
- [Opera/9.80 (X11; Linux*; U; *) Presto/2.2.* Version/10.*]
9682
- Parent=Opera 10
9683
  Platform=Linux
9684
 
9685
- [Opera/9.80 (X11; SunOS; U; *) Presto/2.2.* Version/10.*]
9686
- Parent=Opera 10
9687
  Platform=SunOS
9688
 
9689
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Opera 7.0
@@ -14451,7 +14138,7 @@ Platform=Win7
14451
  Parent=SeaMonkey 1.1
14452
  Platform=FreeBSD
14453
 
14454
- [Mozilla/5.0 (X11; ?; Linux*; *; rv:1.8*) Gecko/* SeaMonkey/1.1*]
14455
  Parent=SeaMonkey 1.1
14456
  Platform=Linux
14457
 
@@ -15357,11 +15044,11 @@ Platform=SunOS
15357
 
15358
  [Firefox 3.6]
15359
  Parent=DefaultProperties
15360
- Browser="Firefox"
15361
  Version=3.6
15362
  MajorVer=3
15363
  MinorVer=6
15364
- Beta=true
15365
  Frames=true
15366
  IFrames=true
15367
  Tables=true
@@ -15371,176 +15058,82 @@ JavaScript=true
15371
  CssVersion=3
15372
  supportsCSS=true
15373
 
15374
- [Mozilla/5.0 (Macintosh; *; *Mac OS X*; *; rv:1.9.2*) Gecko/* Firefox/3.6*]
15375
  Parent=Firefox 3.6
15376
  Platform=MacOSX
15377
 
15378
- [Mozilla/5.0 (Windows; *; Windows NT 5.0; *; rv:1.9.2*) Gecko/* Firefox/3.6*]
15379
  Parent=Firefox 3.6
15380
  Platform=Win2000
15381
 
15382
- [Mozilla/5.0 (Windows; *; Windows NT 5.1; *; rv:1.9.2*) Gecko/* Firefox/3.6*]
15383
  Parent=Firefox 3.6
15384
  Platform=WinXP
15385
  Win32=true
15386
 
15387
- [Mozilla/5.0 (Windows; *; Windows NT 5.2; *; rv:1.9.2*) Gecko/* Firefox/3.6*]
15388
  Parent=Firefox 3.6
15389
  Platform=Win2003
15390
  Win32=true
15391
 
15392
- [Mozilla/5.0 (Windows; *; Windows NT 6.0; *; rv:1.9.2*) Gecko/* Firefox/3.6*]
15393
  Parent=Firefox 3.6
15394
  Platform=WinVista
15395
  Win32=true
15396
 
15397
- [Mozilla/5.0 (Windows; *; Windows NT 6.1; *; rv:1.9.2*) Gecko/* Firefox/3.6*]
15398
  Parent=Firefox 3.6
15399
  Platform=Win7
15400
 
15401
- [Mozilla/5.0 (Windows; *; WinNT4.0; *; rv:1.9.2*) Gecko/* Firefox/3.6*]
15402
  Parent=Firefox 3.6
15403
  Platform=WinNT
15404
  Win32=true
15405
 
15406
- [Mozilla/5.0 (Windows; U; Windows NT 5.1 x64; *; rv:1.9.2*) Gecko/* Firefox/3.6*]
15407
  Parent=Firefox 3.6
15408
  Platform=WinXP
15409
  Win32=false
15410
  Win64=true
15411
 
15412
- [Mozilla/5.0 (Windows; U; Windows NT 5.2 x64; *; rv:1.9.2*) Gecko/* Firefox/3.6*]
15413
  Parent=Firefox 3.6
15414
  Platform=Win2003
15415
  Win32=false
15416
  Win64=true
15417
 
15418
- [Mozilla/5.0 (Windows; U; Windows NT 6.0 x64; *; rv:1.9.2*) Gecko/* Firefox/3.6*]
15419
  Parent=Firefox 3.6
15420
  Platform=WinVista
15421
 
15422
- [Mozilla/5.0 (Windows; U; Windows NT 6.1 x64; *; rv:1.9.2*) Gecko/* Firefox/3.6*]
15423
  Parent=Firefox 3.6
15424
  Platform=Win7
15425
 
15426
- [Mozilla/5.0 (X11; *; *Linux*; *; rv:1.9.2*) Gecko/* Firefox/3.6*]
15427
  Parent=Firefox 3.6
15428
  Platform=Linux
15429
 
15430
- [Mozilla/5.0 (X11; *; FreeBSD*; *; rv:1.9.2*) Gecko/* Firefox/3.6*]
15431
  Parent=Firefox 3.6
15432
  Platform=FreeBSD
15433
 
15434
- [Mozilla/5.0 (X11; *; HP-UX*; *; rv:1.9.2*) Gecko/* Firefox/3.6*]
15435
  Parent=Firefox 3.6
15436
  Platform=HP-UX
15437
 
15438
- [Mozilla/5.0 (X11; *; IRIX64*; *; rv:1.9.2*) Gecko/* Firefox/3.6*]
15439
  Parent=Firefox 3.6
15440
  Platform=IRIX64
15441
 
15442
- [Mozilla/5.0 (X11; *; OpenBSD*; *; rv:1.9.2*) Gecko/* Firefox/3.6*]
15443
  Parent=Firefox 3.6
15444
  Platform=OpenBSD
15445
 
15446
- [Mozilla/5.0 (X11; *; SunOS*; *; rv:1.9.2*) Gecko/* Firefox/3.6*]
15447
  Parent=Firefox 3.6
15448
  Platform=SunOS
15449
 
15450
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Firefox 3.7
15451
-
15452
- [Firefox 3.7]
15453
- Parent=DefaultProperties
15454
- Browser="Firefox"
15455
- Version=3.7
15456
- MajorVer=3
15457
- MinorVer=7
15458
- Alpha=true
15459
- Frames=true
15460
- IFrames=true
15461
- Tables=true
15462
- Cookies=true
15463
- JavaApplets=true
15464
- JavaScript=true
15465
- CssVersion=3
15466
- supportsCSS=true
15467
-
15468
- [Mozilla/5.0 (Macintosh; *; *Mac OS X*; *; rv:1.9.3) Gecko/* Minefield/3.7*]
15469
- Parent=Firefox 3.7
15470
- Platform=MacOSX
15471
-
15472
- [Mozilla/5.0 (Windows; *; Windows NT 5.0; *; rv:1.9.3) Gecko/* Minefield/3.7*]
15473
- Parent=Firefox 3.7
15474
- Platform=Win2000
15475
-
15476
- [Mozilla/5.0 (Windows; *; Windows NT 5.1; *; rv:1.9.3) Gecko/* Minefield/3.7*]
15477
- Parent=Firefox 3.7
15478
- Platform=WinXP
15479
- Win32=true
15480
-
15481
- [Mozilla/5.0 (Windows; *; Windows NT 5.2; *; rv:1.9.3) Gecko/* Minefield/3.7*]
15482
- Parent=Firefox 3.7
15483
- Platform=Win2003
15484
- Win32=true
15485
-
15486
- [Mozilla/5.0 (Windows; *; Windows NT 6.0; *; rv:1.9.3) Gecko/* Minefield/3.7*]
15487
- Parent=Firefox 3.7
15488
- Platform=WinVista
15489
- Win32=true
15490
-
15491
- [Mozilla/5.0 (Windows; *; Windows NT 6.1; *; rv:1.9.3) Gecko/* Minefield/3.7*]
15492
- Parent=Firefox 3.7
15493
- Platform=Win7
15494
-
15495
- [Mozilla/5.0 (Windows; *; WinNT4.0; *; rv:1.9.3) Gecko/* Minefield/3.7*]
15496
- Parent=Firefox 3.7
15497
- Platform=WinNT
15498
- Win32=true
15499
-
15500
- [Mozilla/5.0 (Windows; U; Windows NT 5.1 x64; *; rv:1.9.3) Gecko/* Minefield/3.7*]
15501
- Parent=Firefox 3.7
15502
- Platform=WinXP
15503
- Win32=false
15504
- Win64=true
15505
-
15506
- [Mozilla/5.0 (Windows; U; Windows NT 5.2 x64; *; rv:1.9.3) Gecko/* Minefield/3.7*]
15507
- Parent=Firefox 3.7
15508
- Platform=Win2003
15509
- Win32=false
15510
- Win64=true
15511
-
15512
- [Mozilla/5.0 (Windows; U; Windows NT 6.0 x64; *; rv:1.9.3) Gecko/* Minefield/3.7*]
15513
- Parent=Firefox 3.7
15514
- Platform=WinVista
15515
-
15516
- [Mozilla/5.0 (Windows; U; Windows NT 6.1 x64; *; rv:1.9.3) Gecko/* Minefield/3.7*]
15517
- Parent=Firefox 3.7
15518
- Platform=Win7
15519
-
15520
- [Mozilla/5.0 (X11; *; *Linux*; *; rv:1.9.3) Gecko/* Minefield/3.7*]
15521
- Parent=Firefox 3.7
15522
- Platform=Linux
15523
-
15524
- [Mozilla/5.0 (X11; *; FreeBSD*; *; rv:1.9.3) Gecko/* Minefield/3.7*]
15525
- Parent=Firefox 3.7
15526
- Platform=FreeBSD
15527
-
15528
- [Mozilla/5.0 (X11; *; HP-UX*; *; rv:1.9.3) Gecko/* Minefield/3.7*]
15529
- Parent=Firefox 3.7
15530
- Platform=HP-UX
15531
-
15532
- [Mozilla/5.0 (X11; *; IRIX64*; *; rv:1.9.3) Gecko/* Minefield/3.7*]
15533
- Parent=Firefox 3.7
15534
- Platform=IRIX64
15535
-
15536
- [Mozilla/5.0 (X11; *; OpenBSD*; *; rv:1.9.3) Gecko/* Minefield/3.7*]
15537
- Parent=Firefox 3.7
15538
- Platform=OpenBSD
15539
-
15540
- [Mozilla/5.0 (X11; *; SunOS*; *; rv:1.9.3) Gecko/* Minefield/3.7*]
15541
- Parent=Firefox 3.7
15542
- Platform=SunOS
15543
-
15544
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Thunderbird 1.0
15545
 
15546
  [Thunderbird 1.0]
@@ -15579,7 +15172,7 @@ Platform=WinVista
15579
  Parent=Thunderbird 1.0
15580
  Platform=Win7
15581
 
15582
- [Mozilla/5.0 (X11; U; Linux i686*; *; rv:1.9.*) Gecko/* Thunderbird/1.*]
15583
  Parent=Thunderbird 1.0
15584
  Platform=Linux
15585
 
@@ -15621,7 +15214,7 @@ Platform=WinVista
15621
  Parent=Thunderbird 2.0
15622
  Platform=Win7
15623
 
15624
- [Mozilla/5.0 (X11; U; Linux i686*; *; rv:1.9.*) Gecko/* Thunderbird/2.*]
15625
  Parent=Thunderbird 2.0
15626
  Platform=Linux
15627
 
@@ -15663,7 +15256,7 @@ Platform=WinVista
15663
  Parent=Thunderbird 3.0
15664
  Platform=Win7
15665
 
15666
- [Mozilla/5.0 (X11; U; Linux i686*; *; rv:1.9.*) Gecko/* Thunderbird/3.*]
15667
  Parent=Thunderbird 3.0
15668
  Platform=Linux
15669
 
@@ -17251,14 +16844,6 @@ ActiveXControls=true
17251
  CssVersion=3
17252
  supportsCSS=true
17253
 
17254
- [Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0*)*]
17255
- Parent=IE 8.0
17256
- Platform=WinXP
17257
-
17258
- [Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; Trident/4.0*)*]
17259
- Parent=IE 8.0
17260
- Platform=Win2003
17261
-
17262
  [Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0*)*]
17263
  Parent=IE 8.0
17264
  Platform=WinVista
@@ -17283,6 +16868,10 @@ Platform=Win2003
17283
  Parent=IE 8.0
17284
  Platform=WinVista
17285
 
 
 
 
 
17286
  [Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Win64; x64; Trident/4.0*)*]
17287
  Parent=IE 8.0
17288
  Platform=WinVista
1
  ;;; Provided courtesy of http://browsers.garykeith.com
2
+ ;;; Created on Friday, July 31, 2009 at 9:56 PM GMT
3
 
4
  [GJK_Browscap_Version]
5
+ Version=4484
6
+ Released=Fri, 31 Jul 2009 21:56:31 -0000
7
 
8
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DefaultProperties
9
 
63
  Tables=true
64
  Crawler=true
65
 
 
 
 
 
66
  [BaiduImageSpider*]
67
  Parent=Baidu
68
  Browser="BaiduImageSpider"
126
  Browser="Googlebot-Image"
127
  CDF=true
128
 
 
 
 
 
129
  [googlebot-urlconsole]
130
  Parent=Google
131
  Browser="googlebot-urlconsole"
146
  Parent=Google
147
  Browser="Googlebot/Test"
148
 
 
 
 
 
149
  [gsa-crawler*]
150
  Parent=Google
151
  Browser="Google Search Appliance"
155
  Parent=Google
156
  Browser="Mediapartners-Google"
157
 
158
+ [Mozilla/4.0 (compatible; Google Desktop)]
159
  Parent=Google
160
  Browser="Google Desktop"
161
 
162
+ [Mozilla/4.0 (compatible; GoogleToolbar*)]
163
+ Parent=Google
164
+ Browser="Google Toolbar"
165
+ isBanned=true
166
+
167
  [Mozilla/5.0 (compatible; Google Keyword Tool;*)]
168
  Parent=Google
169
  Browser="Google Keyword Tool"
215
  Parent=Inktomi
216
  Browser="Yahoo! Directory Engine"
217
 
 
 
 
 
218
  [Mozilla/5.0 (compatible; Yahoo! Slurp China; http://misc.yahoo.com.cn/help.html)]
219
  Parent=Inktomi
220
  Browser="Yahoo! Slurp China"
266
  Parent=Inktomi
267
  Browser="slurp"
268
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
269
  [Y!J-BSC/1.0*]
270
  Parent=Inktomi
271
+ Browser="Y!J-BSC"
272
  Version=1.0
273
  MajorVer=1
274
  MinorVer=0
275
+ isBanned=true
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
 
277
  [Y!J-SRD/1.0]
278
  Parent=Inktomi
279
+ Browser="Y!J-SRD"
280
  Version=1.0
281
  MajorVer=1
282
  MinorVer=0
283
 
 
 
 
 
 
284
  [Yahoo Mindset]
285
  Parent=Inktomi
286
  Browser="Yahoo Mindset"
689
  Parent=Exalead
690
  Browser="Exabot-Images"
691
 
692
+ [Mozilla/5.0 (compatible; Exabot/3.0 (BiggerBetter/tests);*)]
693
  Parent=Exalead
694
+ Browser="Exabot/BiggerBetter/tests"
695
 
696
  [Mozilla/5.0 (compatible; Exabot/3.0;*)]
697
  Parent=Exalead
1053
  MajorVer=1
1054
  MinorVer=0
1055
 
 
 
 
 
 
1056
  [ddetailsbot (http://www.displaydetails.com)]
1057
  Parent=General Crawlers
1058
  Browser="ddetailsbot"
1171
  Browser="LucidMedia-ClickSense"
1172
  isBanned=true
1173
 
 
 
 
 
 
1174
  [Mahalobot/1.0 (?http://www.mahalo.com/)]
1175
  Parent=General Crawlers
1176
  Browser="Mahalobot"
1314
  Parent=General Crawlers
1315
  Browser="Kyluka"
1316
 
1317
+ [Mozilla/5.0 (compatible; MJ12bot/v1.2.*; http://www.majestic12.co.uk/bot.php*)]
1318
  Parent=General Crawlers
1319
  Browser="MJ12bot"
1320
+ Version=1.2
1321
+ MajorVer=1
1322
+ MinorVer=2
1323
  isBanned=true
1324
 
1325
  [Mozilla/5.0 (compatible; MSIE 7.0 ?http://www.europarchive.org)]
1326
  Parent=General Crawlers
1327
  Browser="Europe Web Archive"
1328
 
 
 
 
 
1329
  [Mozilla/5.0 (compatible; Seznam screenshot-generator 2.0;*)]
1330
  Parent=General Crawlers
1331
  Browser="Seznam screenshot-generator"
1343
  Parent=General Crawlers
1344
  Browser="Vermut"
1345
 
 
 
 
 
 
1346
  [Mozilla/5.0 (compatible; Webbot/*)]
1347
  Parent=General Crawlers
1348
  Browser="Webbot.ru"
1361
  Browser="NetCarta_WebMapper"
1362
  isBanned=true
1363
 
 
 
 
 
 
1364
  [NetID.com Bot*]
1365
  Parent=General Crawlers
1366
  Browser="NetID.com Bot"
1599
  Browser="Talkro Web-Shot"
1600
  isBanned=true
1601
 
 
 
 
 
 
1602
  [Tecomi Bot (http://www.tecomi.com/bot.htm)]
1603
  Parent=General Crawlers
1604
  Browser="Tecomi"
1605
 
 
 
 
 
1606
  [TheInformant*]
1607
  Parent=General Crawlers
1608
  Browser="TheInformant"
1647
  Parent=General Crawlers
1648
  Browser="Visicom Toolbar"
1649
 
 
 
 
 
1650
  [W3C-WebCon/*]
1651
  Parent=General Crawlers
1652
  Browser="W3C-WebCon"
1690
  Parent=General Crawlers
1691
  Browser="Willow Internet Crawler"
1692
 
1693
+ [WIRE/* (Linux; i686; Bot,Robot,Spider,Crawler)]
1694
  Parent=General Crawlers
1695
  Browser="WIRE"
1696
  isBanned=true
1826
  Parent=Search Engines
1827
  Browser="DiamondBot"
1828
 
 
 
 
 
1829
  [Dumbot*]
1830
  Parent=Search Engines
1831
  Browser="Dumbot"
1976
  Parent=Search Engines
1977
  Browser="Mnogosearch"
1978
 
1979
+ [Mozilla/0.9* no dos :) (Linux)]
1980
  Parent=Search Engines
1981
  Browser="goliat"
1982
  isBanned=true
1983
 
 
 
 
 
1984
  [Mozilla/4.0 (compatible; Arachmo)]
1985
  Parent=Search Engines
1986
  Browser="Arachmo"
1995
  Browser="Girafabot"
1996
  Win32=true
1997
 
1998
+ [Mozilla/4.0 (compatible; Vagabondo/*; webcrawler at wise-guys dot nl; *)]
1999
+ Parent=Search Engines
2000
+ Browser="Vagabondo"
2001
+
2002
  [Mozilla/4.0(?compatible; MSIE 6.0; Qihoo *)]
2003
  Parent=Search Engines
2004
  Browser="Qihoo"
2016
  Parent=Search Engines
2017
  Browser="ActiveTouristBot"
2018
 
 
 
 
 
2019
  [Mozilla/5.0 (compatible; Butterfly/1.0; *)*]
2020
  Parent=Search Engines
2021
  Browser="Butterfly"
2058
  Browser="Octopodus"
2059
  isBanned=true
2060
 
 
 
 
 
2061
  [Mozilla/5.0 (compatible; Pogodak.*)]
2062
  Parent=Search Engines
2063
  Browser="Pogodak"
2069
  [Mozilla/5.0 (compatible; ScoutJet; *http://www.scoutjet.com/)]
2070
  Parent=Search Engines
2071
  Browser="ScoutJet"
 
2072
 
2073
  [Mozilla/5.0 (compatible; Scrubby/*; http://www.scrubtheweb.com/abs/meta-check.html)]
2074
  Parent=Search Engines
2803
  Parent=E-Mail Harvesters
2804
  Browser="8484 Boston Project"
2805
 
 
 
 
 
 
 
 
 
2806
  [CherryPicker*/*]
2807
  Parent=E-Mail Harvesters
2808
  Browser="CherryPickerElite"
2895
  Parent=Feeds Blogs
2896
  Browser="BlogLines Web"
2897
 
 
 
 
 
2898
  [BlogPulseLive (support@blogpulse.com)]
2899
  Parent=Feeds Blogs
2900
  Browser="BlogPulseLive"
3092
  Parent=Feeds Syndicators
3093
  Browser="Rojo"
3094
 
 
 
 
 
3095
  [Netvibes (*)]
3096
  Parent=Feeds Syndicators
3097
  Browser="Netvibes"
3728
  Browser="12345"
3729
  isBanned=true
3730
 
 
 
 
 
3731
  [Ace Explorer]
3732
  Parent=Miscellaneous Browsers
3733
  Browser="Ace Explorer"
4173
  Parent=Rippers
4174
  Browser="ActiveRefresh"
4175
 
 
 
 
 
4176
  [Artera (Version *)]
4177
  Parent=Rippers
4178
  Browser="Artera"
4297
  Parent=Rippers
4298
  Browser="http generic"
4299
 
 
 
 
 
4300
  [httpclient*]
4301
  Parent=Rippers
4302
 
4755
 
4756
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Social Bookmarkers
4757
 
4758
+ [Social Bookmarkers]
4759
  Parent=DefaultProperties
4760
  Browser="Social Bookmarkers"
4761
  Frames=true
4764
  JavaScript=true
4765
 
4766
  [BookmarkBase(2/;http://bookmarkbase.com)]
4767
+ Parent=Social Bookmarkers
4768
  Browser="BookmarkBase"
4769
 
4770
  [Cocoal.icio.us/1.0 (v43) (Mac OS X; http://www.scifihifi.com/cocoalicious)]
4771
+ Parent=Social Bookmarkers
4772
  Browser="Cocoalicious"
4773
 
 
 
 
 
 
4774
  [Mozilla/5.0 (compatible; FriendFeedBot/0.*; Http://friendfeed.com/about/bot)]
4775
+ Parent=Social Bookmarkers
4776
  Browser="FriendFeedBot"
4777
 
 
 
 
 
 
 
 
 
 
4778
  [Twitturly*]
4779
+ Parent=Social Bookmarkers
4780
  Browser="Twitturly"
 
4781
 
4782
  [WinkBot/*]
4783
+ Parent=Social Bookmarkers
4784
  Browser="WinkBot"
4785
 
4786
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Translators
4829
  MinorVer=0
4830
  Platform=Win2000
4831
 
 
 
 
 
 
 
 
 
4832
  [Browscap updater]
4833
  Parent=Version Checkers
4834
  Browser="Browscap updater"
4861
  Browser="Mono Browser Capabilities Updater"
4862
  isBanned=true
4863
 
 
 
 
 
4864
  [Rewmi/*]
4865
  Parent=Version Checkers
4866
  isBanned=true
4885
  Parent=Version Checkers
4886
  Browser="Subst�ncia"
4887
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4888
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Become
4889
 
4890
  [Become]
5012
  Browser="Netcraft Webserver Survey"
5013
  isBanned=true
5014
 
5015
+ [Mozilla/5.0 (compatible; NetcraftSurveyAgent/1.0; info@netcraft.com)]
5016
  Parent=Netcraft
5017
  Browser="NetcraftSurveyAgent"
5018
 
5242
  Parent=Chrome 2.0
5243
  Platform=Win7
5244
 
5245
+ [Mozilla/5.0 (X11; U; Linux i686; *) AppleWebKit/* (KHTML, like Gecko) Chrome/3.0.* Safari/*]
5246
  Parent=Chrome 2.0
5247
  Platform=Linux
5248
 
5283
  Parent=Chrome 3.0
5284
  Platform=Win7
5285
 
5286
+ [Mozilla/5.0 (X11; U; Linux i686; *) AppleWebKit/* (KHTML, like Gecko) Chrome/3.0.* Safari/*]
5287
  Parent=Chrome 3.0
5288
  Platform=Linux
5289
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5290
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Google Code
5291
 
5292
  [Google Code]
5461
  Parent=Iron 2.0
5462
  Platform=Win7
5463
 
5464
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; iPod
5465
+
5466
+ [iPod]
5467
+ Parent=DefaultProperties
5468
+ Browser="iPod"
5469
+ Platform=iPhone OSX
5470
+ isMobileDevice=true
5471
+
5472
+ [Mozilla/5.0 (iPod; U; *Mac OS X; *) AppleWebKit/* (*) Version/3.0 Mobile/* Safari/*]
5473
+ Parent=iPod
5474
+ Version=3.0
5475
+ MajorVer=3
5476
+ MinorVer=0
5477
+ Platform=MacOSX
5478
+
5479
+ [Mozilla/5.0 (iPod; U; CPU iPhone OS 2_2 like Mac OS X; en-us) AppleWebKit/* (KHTML, like Gecko) Mobile/*]
5480
+ Parent=iPod
5481
+
5482
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; iTunes
5483
+
5484
+ [iTunes]
5485
+ Parent=DefaultProperties
5486
+ Browser="iTunes"
5487
+ Platform=iPhone OSX
5488
+
5489
+ [iTunes/* (Windows; ?)]
5490
+ Parent=iTunes
5491
+ Browser="iTunes"
5492
+ Platform=Win32
5493
+ Win32=true
5494
+
5495
+ [MOT-* iTunes/* MIB/* Profile/MIDP-* Configuration/CLDC-* UP.Link/*]
5496
+ Parent=iTunes
5497
+
5498
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Media Players
5499
 
5500
  [Media Players]
5550
  Parent=Media Players
5551
  Browser="WinAmp"
5552
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5553
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Nintendo
5554
 
5555
  [Nintendo Wii]
5651
  MinorVer=0
5652
  Win32=true
5653
 
5654
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Zune
5655
+
5656
+ [Zune]
5657
+ Parent=DefaultProperties
5658
+ Browser="Zune"
5659
+ Cookies=true
5660
+
5661
+ [Mozilla/4.0 (compatible; MSIE ?.0; *Zune 2.0*)*]
5662
+ Parent=Zune
5663
+ Version=2.0
5664
+ MajorVer=2
5665
+ MinorVer=0
5666
+
5667
+ [Mozilla/4.0 (compatible; MSIE ?.0; *Zune 2.5*)*]
5668
+ Parent=Zune
5669
+ Version=2.5
5670
+ MajorVer=2
5671
+ MinorVer=5
5672
+
5673
+ [Mozilla/4.0 (compatible; MSIE ?.0; *Zune 3.0*)*]
5674
+ Parent=Zune
5675
+ Version=3.0
5676
+ MajorVer=3
5677
+ MinorVer=0
5678
+
5679
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; QuickTime 7.0
5680
 
5681
  [QuickTime 7.0]
5930
  Browser="Android"
5931
  Platform=Android
5932
  Frames=true
 
5933
  Tables=true
5934
  Cookies=true
 
5935
  JavaScript=true
5936
  isMobileDevice=true
5937
 
5954
  MajorVer=3
5955
  MinorVer=0
5956
 
 
 
 
 
 
 
 
 
 
5957
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; BlackBerry
5958
 
5959
  [BlackBerry]
6090
  CssVersion=3
6091
  supportsCSS=true
6092
 
6093
+ [Mozilla/4.0 (iPhone; *)]
6094
  Parent=iPhone
 
 
 
 
6095
 
6096
+ [Mozilla/4.0 (iPhone; U; CPU like Mac OS X; *)]
6097
  Parent=iPhone
 
 
 
6098
 
6099
+ [Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 2_* like Mac OS X; *) AppleWebKit/* (KHTML, like Gecko) Version/3.1* Mobile/* Safari/*]
6100
  Parent=iPhone
6101
+ Browser="iPhone Simulator"
6102
  Version=3.1
6103
  MajorVer=3
6104
  MinorVer=1
6105
 
6106
+ [Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 2_0_1 like Mac OS X; *) AppleWebKit/* (KHTML, like Gecko) Version/3.1* Mobile/* Safari/*]
6107
  Parent=iPhone
6108
+ Browser="iPhone Simulator"
6109
+ Version=3.1
6110
+ MajorVer=3
6111
+ MinorVer=1
6112
 
6113
+ [Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 2_1 like Mac OS X; *) AppleWebKit/* (KHTML, like Gecko) Version/3.1* Mobile/* Safari/*]
6114
  Parent=iPhone
6115
+ Browser="iPhone Simulator"
6116
+ Version=3.1
6117
+ MajorVer=3
6118
+ MinorVer=1
6119
 
6120
+ [Mozilla/5.0 (iPhone)]
6121
  Parent=iPhone
 
 
 
6122
 
6123
+ [Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_* like Mac OS X; *) AppleWebKit/* (KHTML, like Gecko)]
6124
  Parent=iPhone
6125
+ Version=3.1
6126
  MajorVer=3
6127
+ MinorVer=1
6128
 
6129
+ [Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_* like Mac OS X; *) AppleWebKit/* (KHTML, like Gecko) Version/3.1* Mobile/* Safari/*]
6130
  Parent=iPhone
6131
  Version=3.1
6132
  MajorVer=3
6133
  MinorVer=1
6134
 
6135
+ [Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_0* like Mac OS X; *) AppleWebKit/* (KHTML, like Gecko) Version/3.1* Mobile/* Safari/*]
6136
  Parent=iPhone
6137
  Version=3.1
6138
  MajorVer=3
6139
  MinorVer=1
6140
 
6141
+ [Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_0_2 like Mac OS X; *) AppleWebKit/* (KHTML, like Gecko)]
6142
  Parent=iPhone
 
 
 
 
6143
 
6144
+ [Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_1 like Mac OS X; *)*]
6145
+ Parent=iPhone
6146
+
6147
+ [Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_2_1 like Mac OS X; *)]
6148
+ Parent=iPhone
6149
+
6150
+ [Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0* like Mac OS X; *) AppleWebKit/* (KHTML, like Gecko) Version/4.0 Mobile/* Safari/*]
6151
  Parent=iPhone
 
6152
  Version=3.0
6153
  MajorVer=3
6154
  MinorVer=0
6155
 
6156
+ [Mozilla/5.0 (iPhone; U; CPU like Mac OS X; *) AppleWebKit/* (KHTML, like Gecko) Version/3.0 Mobile/* Safari/*]
6157
  Parent=iPhone
6158
+ Version=3.0
6159
  MajorVer=3
6160
+ MinorVer=0
6161
+
6162
+ [Mozilla/5.0 (iPod; U; *Mac OS X; *) AppleWebKit/* (*) Version/* Mobile/*]
6163
+ Parent=iPhone
6164
+ Browser="iPod Touch"
6165
+
6166
+ [Mozilla/5.0 (iPod; U; CPU iPhone OS 2_2* like Mac OS X; *)*]
6167
+ Parent=iPhone
6168
+ Browser="iPod Touch"
6169
+ Version=2.2
6170
+ MajorVer=2
6171
+ MinorVer=2
6172
+
6173
+ [Mozilla/5.0 (iPod; U; CPU iPhone OS 3_0* like Mac OS X; *) AppleWebKit/* (KHTML, like Gecko)]
6174
+ Parent=iPhone
6175
+ Browser="iPod Touch"
6176
 
6177
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; KDDI
6178
 
6422
  MajorVer=4
6423
  MinorVer=2
6424
 
 
 
 
 
 
 
6425
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Opera Mobile
6426
 
6427
  [Opera Mobile]
6432
  Cookies=true
6433
  isMobileDevice=true
6434
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6435
  [Opera/9.5 (Microsoft Windows; PPC; *Opera Mobile/*)]
6436
  Parent=Opera Mobile
6437
  Version=9.5
6465
  ActiveXControls=true
6466
  isMobileDevice=true
6467
 
6468
+ [Mozilla/5.0 (webOS/1.0; U; *) AppleWebKit/525.* (KHTML, like Gecko) Version/1.0 Safari/525.* Pre/1.0]
6469
  Parent=Palm
6470
  Browser="Palm Pre"
6471
  Version=1.0
6474
  CssVersion=2
6475
  supportsCSS=true
6476
 
6477
+ [Mozilla/5.0 (webOS/1.1; U; *) AppleWebKit/525.* (KHTML, like Gecko) Version/1.0 Safari/525.* Pre/1.0]
6478
  Parent=Palm
6479
  Browser="Palm Pre"
6480
  Version=1.1
6483
  CssVersion=2
6484
  supportsCSS=true
6485
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6486
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Playstation
6487
 
6488
  [Playstation]
6700
  CssVersion=1
6701
  supportsCSS=true
6702
 
6703
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Amaya
6704
+
6705
+ [Amaya]
6706
+ Parent=DefaultProperties
6707
+ Browser="Amaya"
6708
+ Tables=true
6709
+ Cookies=true
6710
+
6711
+ [amaya/7.*]
6712
+ Parent=Amaya
6713
+ Version=7.0
6714
+ MajorVer=7
6715
+ MinorVer=0
6716
+
6717
+ [amaya/8.0*]
6718
+ Parent=Amaya
6719
+ Version=8.0
6720
+ MajorVer=8
6721
+ MinorVer=0
6722
+ CssVersion=2
6723
+ supportsCSS=true
6724
+
6725
+ [amaya/8.1*]
6726
+ Parent=Amaya
6727
+ Version=8.1
6728
+ MajorVer=8
6729
+ MinorVer=1
6730
+ CssVersion=2
6731
+ supportsCSS=true
6732
+
6733
+ [amaya/8.2*]
6734
+ Parent=Amaya
6735
+ Version=8.2
6736
+ MajorVer=8
6737
+ MinorVer=2
6738
+ CssVersion=2
6739
+ supportsCSS=true
6740
+
6741
+ [amaya/8.3*]
6742
+ Parent=Amaya
6743
+ Version=8.3
6744
+ MajorVer=8
6745
+ MinorVer=3
6746
+ CssVersion=2
6747
+ supportsCSS=true
6748
+
6749
+ [amaya/8.4*]
6750
+ Parent=Amaya
6751
+ Version=8.4
6752
+ MajorVer=8
6753
+ MinorVer=4
6754
+ CssVersion=2
6755
+ supportsCSS=true
6756
+
6757
+ [amaya/8.5*]
6758
+ Parent=Amaya
6759
+ Version=8.5
6760
+ MajorVer=8
6761
+ MinorVer=5
6762
+ CssVersion=2
6763
+ supportsCSS=true
6764
+
6765
+ [amaya/8.6*]
6766
+ Parent=Amaya
6767
+ Version=8.6
6768
+ MajorVer=8
6769
+ MinorVer=6
6770
+ CssVersion=2
6771
+ supportsCSS=true
6772
+
6773
+ [amaya/8.7*]
6774
+ Parent=Amaya
6775
+ Version=8.7
6776
+ MajorVer=8
6777
+ MinorVer=7
6778
+ CssVersion=2
6779
+ supportsCSS=true
6780
+
6781
+ [amaya/8.8*]
6782
+ Parent=Amaya
6783
+ Version=8.8
6784
+ MajorVer=8
6785
+ MinorVer=8
6786
+ CssVersion=2
6787
+ supportsCSS=true
6788
+
6789
+ [amaya/8.9*]
6790
  Parent=Amaya
6791
+ Version=8.9
6792
+ MajorVer=8
6793
+ MinorVer=9
6794
+ CssVersion=2
6795
+ supportsCSS=true
6796
 
6797
+ [amaya/9.0*]
6798
  Parent=Amaya
6799
+ Version=9.0
6800
+ MajorVer=8
6801
  MinorVer=0
6802
+ CssVersion=2
6803
+ supportsCSS=true
6804
 
6805
+ [amaya/9.1*]
6806
  Parent=Amaya
6807
+ Version=9.1
6808
+ MajorVer=9
6809
+ MinorVer=1
6810
+ CssVersion=2
6811
+ supportsCSS=true
6812
 
6813
+ [amaya/9.2*]
6814
  Parent=Amaya
6815
+ Version=9.2
6816
+ MajorVer=9
6817
+ MinorVer=2
6818
  CssVersion=2
6819
  supportsCSS=true
6820
 
6821
+ [amaya/9.3*]
6822
  Parent=Amaya
6823
+ Version=9.3
6824
  MajorVer=9
6825
+ MinorVer=3
6826
+
6827
+ [amaya/9.4*]
6828
+ Parent=Amaya
6829
+ Version=9.4
6830
+ MajorVer=9
6831
+ MinorVer=4
6832
+
6833
+ [amaya/9.5*]
6834
+ Parent=Amaya
6835
+ Version=9.5
6836
+ MajorVer=9
6837
+ MinorVer=5
6838
 
6839
  [Emacs-w3m/*]
6840
  Parent=Emacs/W3
7500
  Parent=ELinks 0.12
7501
  Platform=Unix
7502
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7503
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ELinks 0.9
7504
 
7505
  [ELinks 0.9]
8210
  MinorVer=2
8211
  Platform=MacOSX
8212
 
 
 
 
 
 
 
8213
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; iSiloX
8214
 
8215
  [iSiloX]
8297
  JavaScript=true
8298
  Crawler=true
8299
 
8300
+ [Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.*: Desktop/LX Amethyst) Gecko/*]
8301
  Parent=Lycoris Desktop/LX
8302
  Version=1.1
8303
  MajorVer=1
8304
  MinorVer=1
8305
  Platform=Linux
8306
 
8307
+ [Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.*; Desktop/LX Amethyst) Gecko/*]
8308
  Parent=Lycoris Desktop/LX
8309
  Version=1.0
8310
  MajorVer=1
8311
  MinorVer=0
8312
  Platform=Linux
8313
 
8314
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Mosaic
8315
+
8316
+ [Mosaic]
8317
+ Parent=DefaultProperties
8318
+ Browser="Mosaic"
8319
+ Frames=true
8320
+ IFrames=true
8321
+ Tables=true
8322
+ Cookies=true
8323
+ JavaApplets=true
8324
+ JavaScript=true
8325
+
8326
  [Mozilla/4.0 (VMS_Mosaic)]
8327
  Parent=Mosaic
8328
  Platform=OpenVMS
8429
  MajorVer=5
8430
  MinorVer=1
8431
 
8432
+ [Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.34]
8433
+ Parent=OmniWeb
8434
+ Version=5.1
8435
+ MajorVer=5
8436
+ MinorVer=1
8437
+
8438
+ [Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/420+ (KHTML, like Gecko, Safari/420) OmniWeb/v607]
8439
+ Parent=OmniWeb
8440
+ Version=5.5
8441
+ MajorVer=5
8442
+ MinorVer=5
8443
+
8444
  [Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/420+ (KHTML, like Gecko, Safari/420) OmniWeb/v607]
8445
  Parent=OmniWeb
8446
  Version=5.5
8453
  MajorVer=5
8454
  MinorVer=6
8455
 
8456
+ [Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/522+ (KHTML, like Gecko, Safari/522) OmniWeb/v613]
8457
+ Parent=OmniWeb
8458
+ Version=5.6
8459
+ MajorVer=5
8460
+ MinorVer=6
8461
+
8462
  [Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/85 (KHTML, like Gecko) OmniWeb/v496]
8463
  Parent=OmniWeb
8464
  Version=4.5
8917
  CssVersion=2
8918
  supportsCSS=true
8919
 
8920
+ [Mozilla/5.0 (compatible; Konqueror/4.0*; Debian) KHTML/4.* (like Gecko)]
 
 
 
8921
  Parent=Konqueror 4.0
8922
  Platform=Debian
8923
 
8924
+ [Mozilla/5.0 (compatible; Konqueror/4.0.*; *Linux) KHTML/4.* (like Gecko)]
8925
  Parent=Konqueror 4.0
8926
  Platform=Linux
8927
 
8928
+ [Mozilla/5.0 (compatible; Konqueror/4.0.*; FreeBSD) KHTML/4.* (like Gecko)]
8929
  Parent=Konqueror 4.0
8930
  Platform=FreeBSD
8931
 
8932
+ [Mozilla/5.0 (compatible; Konqueror/4.0.*; NetBSD) KHTML/4.* (like Gecko)]
8933
  Parent=Konqueror 4.0
8934
  Platform=NetBSD
8935
 
8949
  CssVersion=2
8950
  supportsCSS=true
8951
 
8952
+ [Mozilla/5.0 (compatible; Konqueror/4.1*; *Linux*) KHTML/4.* (like Gecko)*]
 
 
 
8953
  Parent=Konqueror 4.1
8954
  Platform=Linux
8955
 
8956
+ [Mozilla/5.0 (compatible; Konqueror/4.1*; Debian) KHTML/4.* (like Gecko)*]
8957
  Parent=Konqueror 4.1
8958
  Platform=Debian
8959
 
8960
+ [Mozilla/5.0 (compatible; Konqueror/4.1*; FreeBSD) KHTML/4.* (like Gecko)*]
8961
  Parent=Konqueror 4.1
8962
  Platform=FreeBSD
8963
 
8964
+ [Mozilla/5.0 (compatible; Konqueror/4.1*; NetBSD) KHTML/4.* (like Gecko)*]
8965
  Parent=Konqueror 4.1
8966
  Platform=NetBSD
8967
 
8981
  CssVersion=2
8982
  supportsCSS=true
8983
 
8984
+ [Mozilla/5.0 (compatible; Konqueror/4.2*; *Linux*) KHTML/4.* (like Gecko)*]
 
 
 
8985
  Parent=Konqueror 4.2
8986
  Platform=Linux
8987
 
8988
+ [Mozilla/5.0 (compatible; Konqueror/4.2*; Debian) KHTML/4.* (like Gecko)*]
8989
  Parent=Konqueror 4.2
8990
  Platform=Debian
8991
 
8992
+ [Mozilla/5.0 (compatible; Konqueror/4.2*; FreeBSD) KHTML/4.* (like Gecko)*]
8993
  Parent=Konqueror 4.2
8994
  Platform=FreeBSD
8995
 
8996
+ [Mozilla/5.0 (compatible; Konqueror/4.2*; NetBSD) KHTML/4.* (like Gecko)*]
8997
  Parent=Konqueror 4.2
8998
  Platform=NetBSD
8999
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9000
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Safari
9001
 
9002
  [Safari]
9193
  Browser="Safari"
9194
  Version=4.0
9195
  MajorVer=4
9196
+ Beta=true
9197
  Frames=true
9198
  IFrames=true
9199
  Tables=true
9251
  Parent=Safari 4.0
9252
  Platform=Win7
9253
 
9254
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Opera 10.0
9255
 
9256
+ [Opera 10.0]
9257
  Parent=DefaultProperties
9258
  Browser="Opera"
9259
  Version=10.0
9260
  MajorVer=10
9261
+ Beta=true
9262
  Frames=true
9263
  IFrames=true
9264
  Tables=true
9266
  BackgroundSounds=true
9267
  JavaApplets=true
9268
  JavaScript=true
9269
+ CssVersion=3
9270
  supportsCSS=true
9271
 
9272
+ [Mozilla/4.0 (compatible; MSIE ?.0; Windows NT 5.0; *) Opera 10.00]
9273
+ Parent=Opera 10.0
9274
  Platform=Win2000
9275
 
9276
+ [Mozilla/4.0 (compatible; MSIE ?.0; Windows NT 5.1; *) Opera 10.00]
9277
+ Parent=Opera 10.0
9278
  Platform=WinXP
9279
 
9280
+ [Mozilla/4.0 (compatible; MSIE ?.0; Windows NT 5.2; *) Opera 10.00]
9281
+ Parent=Opera 10.0
9282
  Platform=Win2003
9283
 
9284
+ [Mozilla/4.0 (compatible; MSIE ?.0; Windows NT 6.0; *) Opera 10.00]
9285
+ Parent=Opera 10.0
9286
  Platform=WinVista
9287
 
9288
+ [Mozilla/4.0 (compatible; MSIE ?.0; Windows NT 6.1; *) Opera 10.00]
9289
+ Parent=Opera 10.0
9290
  Platform=Win7
9291
 
9292
+ [Mozilla/4.0 (compatible; MSIE ?.0; X11; FreeBSD*) Opera 10.00]
9293
+ Parent=Opera 10.0
9294
  Platform=FreeBSD
9295
 
9296
+ [Mozilla/4.0 (compatible; MSIE ?.0; X11; Linux*; *) Opera 10.00]
9297
+ Parent=Opera 10.0
9298
  Platform=Linux
9299
 
9300
+ [Mozilla/4.0 (compatible; MSIE ?.0; X11; SunOS*) Opera 10.00]
9301
+ Parent=Opera 10.0
9302
  Platform=SunOS
9303
 
9304
+ [Opera/10.00 (Macintosh; *Mac OS X; U; *) Presto/2.2.*]
9305
+ Parent=Opera 10.0
9306
  Platform=MacOSX
9307
 
9308
+ [Opera/10.00 (Windows NT 5.0; U; *) Presto/2.2.*]
9309
+ Parent=Opera 10.0
9310
  Platform=Win2000
9311
 
9312
+ [Opera/10.00 (Windows NT 5.1; U; *) Presto/2.2.*]
9313
+ Parent=Opera 10.0
9314
  Platform=WinXP
9315
 
9316
+ [Opera/10.00 (Windows NT 5.2; U; *) Presto/2.2.*]
9317
+ Parent=Opera 10.0
9318
  Platform=Win2003
9319
 
9320
+ [Opera/10.00 (Windows NT 6.0; U; *) Presto/2.2.*]
9321
+ Parent=Opera 10.0
9322
  Platform=WinVista
9323
 
9324
+ [Opera/10.00 (Windows NT 6.1; U; *) Presto/2.2.*]
9325
+ Parent=Opera 10.0
9326
  Platform=Win7
9327
 
9328
+ [Opera/10.00 (X11; FreeBSD; U; *) Presto/2.2.*]
9329
+ Parent=Opera 10.0
9330
  Platform=FreeBSD
9331
 
9332
+ [Opera/10.00 (X11; Linux*; U; *) Presto/2.2.*]
9333
+ Parent=Opera 10.0
9334
  Platform=Linux
9335
 
9336
+ [Opera/10.00 (X11; SunOS; U; *) Presto/2.2.*]
9337
+ Parent=Opera 10.0
9338
  Platform=SunOS
9339
 
9340
+ [Opera/9.80 (Macintosh; *Mac OS X; U; *) Presto/2.2.* Version/10.00]
9341
+ Parent=Opera 10.0
9342
  Platform=MacOSX
9343
 
9344
+ [Opera/9.80 (Windows NT 5.0; U; *) Presto/2.2.* Version/10.00]
9345
+ Parent=Opera 10.0
9346
  Platform=Win2000
9347
 
9348
+ [Opera/9.80 (Windows NT 5.1; U; *) Presto/2.2.* Version/10.00]
9349
+ Parent=Opera 10.0
9350
  Platform=WinXP
9351
 
9352
+ [Opera/9.80 (Windows NT 5.2; U; *) Presto/2.2.* Version/10.00]
9353
+ Parent=Opera 10.0
9354
  Platform=Win2003
9355
 
9356
+ [Opera/9.80 (Windows NT 6.0; U; *) Presto/2.2.* Version/10.00]
9357
+ Parent=Opera 10.0
9358
  Platform=WinVista
9359
 
9360
+ [Opera/9.80 (Windows NT 6.1; U; *) Presto/2.2.* Version/10.00]
9361
+ Parent=Opera 10.0
9362
  Platform=Win7
9363
 
9364
+ [Opera/9.80 (X11; FreeBSD; U; *) Presto/2.2.* Version/10.00]
9365
+ Parent=Opera 10.0
9366
  Platform=FreeBSD
9367
 
9368
+ [Opera/9.80 (X11; Linux i686; U; *) Presto/2.2.* Version/10.00]
9369
+ Parent=Opera 10.0
9370
  Platform=Linux
9371
 
9372
+ [Opera/9.80 (X11; SunOS; U; *) Presto/2.2.* Version/10.00]
9373
+ Parent=Opera 10.0
9374
  Platform=SunOS
9375
 
9376
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Opera 7.0
14138
  Parent=SeaMonkey 1.1
14139
  Platform=FreeBSD
14140
 
14141
+ [Mozilla/5.0 (X11; ?; Linux*; *; rv:1.8*) Gecko/20060221 SeaMonkey/1.1*]
14142
  Parent=SeaMonkey 1.1
14143
  Platform=Linux
14144
 
15044
 
15045
  [Firefox 3.6]
15046
  Parent=DefaultProperties
15047
+ Browser="Firefox 3.6"
15048
  Version=3.6
15049
  MajorVer=3
15050
  MinorVer=6
15051
+ Alpha=true
15052
  Frames=true
15053
  IFrames=true
15054
  Tables=true
15058
  CssVersion=3
15059
  supportsCSS=true
15060
 
15061
+ [Mozilla/5.0 (Macintosh; *; *Mac OS X*; *; rv:1.9.*) Gecko/* Minefield/3.6*]
15062
  Parent=Firefox 3.6
15063
  Platform=MacOSX
15064
 
15065
+ [Mozilla/5.0 (Windows; *; Windows NT 5.0; *; rv:1.9.*) Gecko/* Minefield/3.6*]
15066
  Parent=Firefox 3.6
15067
  Platform=Win2000
15068
 
15069
+ [Mozilla/5.0 (Windows; *; Windows NT 5.1; *; rv:1.9.*) Gecko/* Minefield/3.6*]
15070
  Parent=Firefox 3.6
15071
  Platform=WinXP
15072
  Win32=true
15073
 
15074
+ [Mozilla/5.0 (Windows; *; Windows NT 5.2; *; rv:1.9.*) Gecko/* Minefield/3.6*]
15075
  Parent=Firefox 3.6
15076
  Platform=Win2003
15077
  Win32=true
15078
 
15079
+ [Mozilla/5.0 (Windows; *; Windows NT 6.0; *; rv:1.9.*) Gecko/* Minefield/3.6*]
15080
  Parent=Firefox 3.6
15081
  Platform=WinVista
15082
  Win32=true
15083
 
15084
+ [Mozilla/5.0 (Windows; *; Windows NT 6.1; *; rv:1.9.*) Gecko/* Minefield/3.6*]
15085
  Parent=Firefox 3.6
15086
  Platform=Win7
15087
 
15088
+ [Mozilla/5.0 (Windows; *; WinNT4.0; *; rv:1.9.*) Gecko/* Minefield/3.6*]
15089
  Parent=Firefox 3.6
15090
  Platform=WinNT
15091
  Win32=true
15092
 
15093
+ [Mozilla/5.0 (Windows; U; Windows NT 5.1 x64; *; rv:1.9.*) Gecko/* Minefield/3.6*]
15094
  Parent=Firefox 3.6
15095
  Platform=WinXP
15096
  Win32=false
15097
  Win64=true
15098
 
15099
+ [Mozilla/5.0 (Windows; U; Windows NT 5.2 x64; *; rv:1.9.*) Gecko/* Minefield/3.6*]
15100
  Parent=Firefox 3.6
15101
  Platform=Win2003
15102
  Win32=false
15103
  Win64=true
15104
 
15105
+ [Mozilla/5.0 (Windows; U; Windows NT 6.0 x64; *; rv:1.9.*) Gecko/* Minefield/3.6*]
15106
  Parent=Firefox 3.6
15107
  Platform=WinVista
15108
 
15109
+ [Mozilla/5.0 (Windows; U; Windows NT 6.1 x64; *; rv:1.9.*) Gecko/* Minefield/3.6*]
15110
  Parent=Firefox 3.6
15111
  Platform=Win7
15112
 
15113
+ [Mozilla/5.0 (X11; *; *Linux*; *; rv:1.9.*) Gecko/* Minefield/3.6*]
15114
  Parent=Firefox 3.6
15115
  Platform=Linux
15116
 
15117
+ [Mozilla/5.0 (X11; *; FreeBSD*; *; rv:1.9.*) Gecko/* Minefield/3.6*]
15118
  Parent=Firefox 3.6
15119
  Platform=FreeBSD
15120
 
15121
+ [Mozilla/5.0 (X11; *; HP-UX*; *; rv:1.9.*) Gecko/* Minefield/3.6*]
15122
  Parent=Firefox 3.6
15123
  Platform=HP-UX
15124
 
15125
+ [Mozilla/5.0 (X11; *; IRIX64*; *; rv:1.9.*) Gecko/* Minefield/3.6*]
15126
  Parent=Firefox 3.6
15127
  Platform=IRIX64
15128
 
15129
+ [Mozilla/5.0 (X11; *; OpenBSD*; *; rv:1.9.*) Gecko/* Minefield/3.6*]
15130
  Parent=Firefox 3.6
15131
  Platform=OpenBSD
15132
 
15133
+ [Mozilla/5.0 (X11; *; SunOS*; *; rv:1.9.*) Gecko/* Minefield/3.6*]
15134
  Parent=Firefox 3.6
15135
  Platform=SunOS
15136
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15137
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Thunderbird 1.0
15138
 
15139
  [Thunderbird 1.0]
15172
  Parent=Thunderbird 1.0
15173
  Platform=Win7
15174
 
15175
+ [Mozilla/5.0 (X11; U; Linux i686; *; rv:1.9.*) Gecko/* Thunderbird/1.*]
15176
  Parent=Thunderbird 1.0
15177
  Platform=Linux
15178
 
15214
  Parent=Thunderbird 2.0
15215
  Platform=Win7
15216
 
15217
+ [Mozilla/5.0 (X11; U; Linux i686; *; rv:1.9.*) Gecko/* Thunderbird/2.*]
15218
  Parent=Thunderbird 2.0
15219
  Platform=Linux
15220
 
15256
  Parent=Thunderbird 3.0
15257
  Platform=Win7
15258
 
15259
+ [Mozilla/5.0 (X11; U; Linux i686; *; rv:1.9.*) Gecko/* Thunderbird/3.*]
15260
  Parent=Thunderbird 3.0
15261
  Platform=Linux
15262
 
16844
  CssVersion=3
16845
  supportsCSS=true
16846
 
 
 
 
 
 
 
 
 
16847
  [Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0*)*]
16848
  Parent=IE 8.0
16849
  Platform=WinVista
16868
  Parent=IE 8.0
16869
  Platform=WinVista
16870
 
16871
+ [Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0*)*]
16872
+ Parent=IE 8.0
16873
+ Platform=WinVista
16874
+
16875
  [Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Win64; x64; Trident/4.0*)*]
16876
  Parent=IE 8.0
16877
  Platform=WinVista
pretty-bar.php CHANGED
@@ -1,34 +1,47 @@
1
  <?php
2
- $root = dirname(dirname(dirname(dirname(__FILE__))));
3
- if (file_exists($root.'/wp-load.php'))
4
- require_once($root.'/wp-load.php');
5
- else
6
- require_once($root.'/wp-config.php');
7
-
8
  require_once('prli-config.php');
9
  require_once(PRLI_MODELS_PATH . '/models.inc.php');
10
 
11
  $link = $prli_link->getOneFromSlug($_GET['slug']);
12
- $bar_image = $prli_options->prettybar_image_url;
13
- $bar_background_image = $prli_options->prettybar_background_image_url;
14
- $bar_color = $prli_options->prettybar_color;
15
- $bar_text_color = $prli_options->prettybar_text_color;
16
- $bar_link_color = $prli_options->prettybar_link_color;
17
- $bar_visited_color = $prli_options->prettybar_visited_color;
18
- $bar_hover_color = $prli_options->prettybar_hover_color;
19
- $bar_show_title = $prli_options->prettybar_show_title;
20
- $bar_show_description = $prli_options->prettybar_show_description;
21
- $bar_show_share_links = $prli_options->prettybar_show_share_links;
22
- $bar_show_target_url_link = $prli_options->prettybar_show_target_url_link;
23
- $bar_title_limit = (int)$prli_options->prettybar_title_limit;
24
- $bar_desc_limit = (int)$prli_options->prettybar_desc_limit;
25
- $bar_link_limit = (int)$prli_options->prettybar_link_limit;
26
 
27
  $target_url = $_GET['url'];
28
 
29
- $shortened_title = stripslashes(substr($prli_blogname,0,$bar_title_limit));
30
- $shortened_desc = stripslashes(substr($prli_blogdescription,0,$bar_desc_limit));
31
- $shortened_link = stripslashes(substr($target_url,0,$bar_link_limit));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
  if(strlen($prli_blogname) > $bar_title_limit)
34
  $shortened_title .= "...";
@@ -40,13 +53,10 @@ if(strlen($target_url) > $bar_link_limit)
40
  $shortened_link .= "...";
41
 
42
  ?>
43
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
44
- "http://www.w3.org/TR/html4/loose.dtd">
45
  <html>
46
  <head>
47
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
48
- <meta name="description" content="<?php echo stripslashes($link->description); ?>" />
49
- <title><?php echo stripslashes($link->name); ?></title>
50
  <style type="text/css">
51
  html, body {
52
  margin: 0px;
@@ -79,12 +89,12 @@ html, body {
79
  border-bottom: 2px solid black;
80
  }
81
 
82
- .baritems {
83
  margin-top: 0px;
84
  padding: 0px;
85
  }
86
 
87
- .blog-title {
88
  padding-top: 5px;
89
  margin: 0px;
90
  width: 200px;
@@ -110,11 +120,11 @@ a:hover {
110
  }
111
 
112
  .map {
113
- background-image: url(http://d14715w921jdje.cloudfront.net/images/bar_map.png);
114
  background-repeat: no-repeat;
115
  }
116
 
117
- .closebutton {
118
  background-position: -200px 0;
119
  height: 20px;
120
  width: 20px;
@@ -130,46 +140,46 @@ a:hover {
130
  overflow: hidden;
131
  }
132
 
133
- .right_container {
134
  float: right;
135
  margin-top: 8px;
136
  margin-right: 8px;
137
  text-align: right;
138
  }
139
 
140
- .closebutton:hover {
141
  background-position: -200px -30px;
142
  }
143
 
144
- .closebutton:active {
145
  background-position: -200px -60px;
146
  }
147
 
148
- ul.baritems li {
149
  display: inline;
150
  /*float: left;*/
151
  /*padding-left: 15px;*/
152
  }
153
 
154
- .retweet {
155
  padding-top: 5px;
156
  padding-left: 15px;
157
  line-height: 26px;
158
  width: 200px;
159
  }
160
 
161
- .blog-image {
162
  padding-top: 7px;
163
  padding-left: 5px;
164
  padding-right: 5px;
165
  width: 50px;
166
  }
167
 
168
- .small-text {
169
  font-size: 10px;
170
  }
171
 
172
- .powered-by {
173
  padding-top: 15px;
174
  text-align: right;
175
  }
@@ -185,11 +195,11 @@ td {
185
  <div id="prettybar">
186
  <table width="100%" height="65px">
187
  <tr>
188
- <td class="blog-image" valign="top">
189
  <div class="pb-cell">
190
  <a href="<?php echo $prli_blogurl; ?>" target="_top"><img src="<?php echo $bar_image; ?>" width="48px" height="48px" border="0"/></a></div>
191
  </td>
192
- <td class="blog-title" valign="top">
193
  <div class="pb-cell">
194
  <h2>
195
  <?php if( $bar_show_title ) { ?>
@@ -201,7 +211,7 @@ td {
201
  <?php } else echo "&nbsp;"; ?>
202
  </div>
203
  </td>
204
- <td class="retweet" valign="top">
205
  <div class="pb-cell">
206
  <h4>
207
  <?php if( $bar_show_target_url_link ) { ?>
@@ -210,26 +220,21 @@ td {
210
  </h4>
211
  <h4>
212
  <?php if( $bar_show_share_links ) { ?>
213
- <a href="http://twitter.com/home?status=<?php echo $prli_blogurl . PrliUtils::get_permalink_pre_slug_uri() . $_GET['slug']; ?>" target="_top">Share on Twitter</a>
214
  <?php } else echo "&nbsp;"; ?>
215
  </h4>
216
  </div>
217
  </td>
218
  <td valign="top">
219
- <div class="pb-cell right_container">
220
  <table width="100%" cellpadding="0" cellspacing="0" style="padding: 0px; margin: 0px;">
221
  <tr>
222
  <td>
223
- <p class="map closebutton"><a href="<?php echo $target_url; ?>" target="_top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></p>
224
  </td>
225
  <tr>
226
  <td>
227
- <?php
228
- $link_html =<<<LINKHTML
229
- <p class="powered-by small-text">Powered by <a href="http://blairwilliams.com/pl" target="_top"><img src="<?php echo PRLI_IMAGES_URL; ?>/pretty-link-small.png" width="12px" height="12px" border="0"/> Pretty Link</a></p>
230
- LINKHTML;
231
- echo apply_filters('prli-display-attrib-link',$link_html);
232
- ?>
233
  </td>
234
  </tr>
235
  </table>
1
  <?php
2
+ require_once('../../../wp-config.php');
 
 
 
 
 
3
  require_once('prli-config.php');
4
  require_once(PRLI_MODELS_PATH . '/models.inc.php');
5
 
6
  $link = $prli_link->getOneFromSlug($_GET['slug']);
7
+ $bar_image = get_option('prli_prettybar_image_url');
8
+ $bar_background_image = get_option('prli_prettybar_background_image_url');
9
+ $bar_color = get_option('prli_prettybar_color');
10
+ $bar_text_color = get_option('prli_prettybar_text_color');
11
+ $bar_link_color = get_option('prli_prettybar_link_color');
12
+ $bar_visited_color = get_option('prli_prettybar_visited_color');
13
+ $bar_hover_color = get_option('prli_prettybar_hover_color');
14
+ $bar_show_title = get_option('prli_prettybar_show_title');
15
+ $bar_show_description = get_option('prli_prettybar_show_description');
16
+ $bar_show_share_links = get_option('prli_prettybar_show_share_links');
17
+ $bar_show_target_url_link = get_option('prli_prettybar_show_target_url_link');
18
+ $bar_title_limit = (int)get_option('prli_prettybar_title_limit');
19
+ $bar_desc_limit = (int)get_option('prli_prettybar_desc_limit');
20
+ $bar_link_limit = (int)get_option('prli_prettybar_link_limit');
21
 
22
  $target_url = $_GET['url'];
23
 
24
+ if(empty($bar_image) or !$bar_image)
25
+ $bar_image = 'images/pretty-link-48x48.png';
26
+
27
+ if((empty($bar_background_image) and empty($bar_color)) or (!$bar_background_image and !$bar_color))
28
+ $bar_background_image = 'images/bar_background.png';
29
+
30
+ if(empty($bar_text_color) or !$bar_text_color)
31
+ $bar_text_color = '000000';
32
+
33
+ if(empty($bar_link_color) or !$bar_link_color)
34
+ $bar_link_color = '0000ee';
35
+
36
+ if(empty($bar_visited_color) or !$bar_visited_color)
37
+ $bar_visited_color = '551a8b';
38
+
39
+ if(empty($bar_hover_color) or !$bar_hover_color)
40
+ $bar_hover_color = 'ababab';
41
+
42
+ $shortened_title = htmlspecialchars(stripslashes(substr($prli_blogname,0,$bar_title_limit)));
43
+ $shortened_desc = htmlspecialchars(stripslashes(substr($prli_blogdescription,0,$bar_desc_limit)));
44
+ $shortened_link = htmlspecialchars(stripslashes(substr($target_url,0,$bar_link_limit)));
45
 
46
  if(strlen($prli_blogname) > $bar_title_limit)
47
  $shortened_title .= "...";
53
  $shortened_link .= "...";
54
 
55
  ?>
 
 
56
  <html>
57
  <head>
58
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
59
+ <title><?php echo htmlspecialchars(stripslashes($link->name)); ?></title>
 
60
  <style type="text/css">
61
  html, body {
62
  margin: 0px;
89
  border-bottom: 2px solid black;
90
  }
91
 
92
+ #baritems {
93
  margin-top: 0px;
94
  padding: 0px;
95
  }
96
 
97
+ #blog_title {
98
  padding-top: 5px;
99
  margin: 0px;
100
  width: 200px;
120
  }
121
 
122
  .map {
123
+ background-image: url(./images/bar_map.png);
124
  background-repeat: no-repeat;
125
  }
126
 
127
+ #closebutton {
128
  background-position: -200px 0;
129
  height: 20px;
130
  width: 20px;
140
  overflow: hidden;
141
  }
142
 
143
+ #right_container {
144
  float: right;
145
  margin-top: 8px;
146
  margin-right: 8px;
147
  text-align: right;
148
  }
149
 
150
+ #closebutton:hover {
151
  background-position: -200px -30px;
152
  }
153
 
154
+ #closebutton:active {
155
  background-position: -200px -60px;
156
  }
157
 
158
+ ul#baritems li {
159
  display: inline;
160
  /*float: left;*/
161
  /*padding-left: 15px;*/
162
  }
163
 
164
+ #retweet {
165
  padding-top: 5px;
166
  padding-left: 15px;
167
  line-height: 26px;
168
  width: 200px;
169
  }
170
 
171
+ #blog_image {
172
  padding-top: 7px;
173
  padding-left: 5px;
174
  padding-right: 5px;
175
  width: 50px;
176
  }
177
 
178
+ #small_text {
179
  font-size: 10px;
180
  }
181
 
182
+ .powered_by {
183
  padding-top: 15px;
184
  text-align: right;
185
  }
195
  <div id="prettybar">
196
  <table width="100%" height="65px">
197
  <tr>
198
+ <td id="blog_image" valign="top">
199
  <div class="pb-cell">
200
  <a href="<?php echo $prli_blogurl; ?>" target="_top"><img src="<?php echo $bar_image; ?>" width="48px" height="48px" border="0"/></a></div>
201
  </td>
202
+ <td id="blog_title" valign="top">
203
  <div class="pb-cell">
204
  <h2>
205
  <?php if( $bar_show_title ) { ?>
211
  <?php } else echo "&nbsp;"; ?>
212
  </div>
213
  </td>
214
+ <td id="retweet" valign="top">
215
  <div class="pb-cell">
216
  <h4>
217
  <?php if( $bar_show_target_url_link ) { ?>
220
  </h4>
221
  <h4>
222
  <?php if( $bar_show_share_links ) { ?>
223
+ <a href="http://twitter.com/home?status=<?php echo $prli_blogurl . "/" . $_GET['slug']; ?>" target="_top">Share on Twitter</a>
224
  <?php } else echo "&nbsp;"; ?>
225
  </h4>
226
  </div>
227
  </td>
228
  <td valign="top">
229
+ <div id="right_container" class="pb-cell">
230
  <table width="100%" cellpadding="0" cellspacing="0" style="padding: 0px; margin: 0px;">
231
  <tr>
232
  <td>
233
+ <p id="closebutton" class="map"><a href="<?php echo $target_url; ?>" target="_top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></p>
234
  </td>
235
  <tr>
236
  <td>
237
+ <p id="small_text" class="powered_by">Powered by <a href="http://blairwilliams.com/pl" target="_top"><img src="images/pretty-link-small.png" width="12px" height="12px" border="0"/> Pretty Link</a></p>
 
 
 
 
 
238
  </td>
239
  </tr>
240
  </table>
pretty-link.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php
2
  /*
3
- Plugin Name: Pretty Link Lite
4
  Plugin URI: http://blairwilliams.com/pretty-link
5
  Description: Shrink, track and share any URL on the Internet from your WordPress website!
6
- Version: 1.4.56
7
- Author: Caseproof
8
- Author URI: http://caseproof.com
9
- Copyright: 2004-2011, Caseproof, LLC
10
 
11
  GNU General Public License, Free Software Foundation <http://creativecommons.org/licenses/GPL/2.0/>
12
  This program is free software; you can redistribute it and/or modify
@@ -29,10 +29,335 @@ require_once(PRLI_MODELS_PATH . '/models.inc.php');
29
  require_once('prli-api.php'); // load api methods
30
  require_once('prli-xmlrpc.php'); // load xml-rpc api methods
31
 
32
- require_once(PRLI_PATH.'/prli-main.php');
 
 
33
 
34
  // Provide Back End Hooks to the Pro version of Pretty Link
35
- if($prli_update->pro_is_installed_and_authorized())
36
  require_once(PRLI_PATH.'/pro/pretty-link-pro.php');
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  ?>
1
  <?php
2
  /*
3
+ Plugin Name: Pretty Link
4
  Plugin URI: http://blairwilliams.com/pretty-link
5
  Description: Shrink, track and share any URL on the Internet from your WordPress website!
6
+ Version: 1.4.6
7
+ Author: Blair Williams
8
+ Author URI: http://blairwilliams.com
9
+ Copyright: 2009, Caseproof, LLC
10
 
11
  GNU General Public License, Free Software Foundation <http://creativecommons.org/licenses/GPL/2.0/>
12
  This program is free software; you can redistribute it and/or modify
29
  require_once('prli-api.php'); // load api methods
30
  require_once('prli-xmlrpc.php'); // load xml-rpc api methods
31
 
32
+ $prli_inc_utils = new PrliUtils();
33
+
34
+ add_action('admin_menu', 'prli_menu');
35
 
36
  // Provide Back End Hooks to the Pro version of Pretty Link
37
+ if($prli_inc_utils->pro_is_installed())
38
  require_once(PRLI_PATH.'/pro/pretty-link-pro.php');
39
 
40
+ function prli_menu()
41
+ {
42
+ add_menu_page('Pretty Link', 'Pretty Link', 8, PRLI_PATH.'/prli-links.php','',PRLI_URL.'/images/pretty-link-small.png');
43
+ add_submenu_page(PRLI_PATH.'/prli-links.php', 'Pretty Link | Add New Link', 'Add New Link', 8, PRLI_PATH.'/prli-add-link.php');
44
+ add_submenu_page(PRLI_PATH.'/prli-links.php', 'Pretty Link | Groups', 'Groups', 8, PRLI_PATH.'/prli-groups.php');
45
+ add_submenu_page(PRLI_PATH.'/prli-links.php', 'Pretty Link | Hits', 'Hits', 8, PRLI_PATH.'/prli-clicks.php');
46
+ add_submenu_page(PRLI_PATH.'/prli-links.php', 'Pretty Link | Options', 'Options', 8, PRLI_PATH.'/prli-options.php');
47
+ add_submenu_page(PRLI_PATH.'/prli-links.php', 'Pretty Link | Pretty Link Pro', 'Pretty Link Pro', 8, PRLI_PATH.'/prli-pro-settings.php');
48
+
49
+ add_action('admin_head-pretty-link/prli-clicks.php', 'prli_reports_admin_header');
50
+ add_action('admin_head-pretty-link/prli-links.php', 'prli_links_admin_header');
51
+ add_action('admin_head-pretty-link/prli-add-link.php', 'prli_links_admin_header');
52
+ add_action('admin_head-pretty-link/prli-groups.php', 'prli_groups_admin_header');
53
+ add_action('admin_head-pretty-link/prli-options.php', 'prli_options_admin_header');
54
+ }
55
+
56
+ /* Add header to prli-options page */
57
+ function prli_options_admin_header()
58
+ {
59
+ require_once 'classes/views/prli-options/head.php';
60
+ }
61
+
62
+ /* Add header to prli-clicks page */
63
+ function prli_reports_admin_header()
64
+ {
65
+ // Don't show this sheesh if we're displaying the vuid or ip grouping
66
+ if(!isset($_GET['ip']) and !isset($_GET['vuid']))
67
+ {
68
+ global $prli_siteurl, $prli_click, $prli_utils;
69
+
70
+ $params = $prli_click->get_params_array();
71
+ $first_click = $prli_utils->getFirstClickDate();
72
+
73
+ // Adjust for the first click
74
+ if(isset($first_click))
75
+ {
76
+ $min_date = (int)((time()-$first_click)/60/60/24);
77
+
78
+ if($min_date < 30)
79
+ $start_timestamp = $prli_utils->get_start_date($params,$min_date);
80
+ else
81
+ $start_timestamp = $prli_utils->get_start_date($params,30);
82
+
83
+ $end_timestamp = $prli_utils->get_end_date($params);
84
+ }
85
+ else
86
+ {
87
+ $min_date = 0;
88
+ $start_timestamp = time();
89
+ $end_timestamp = time();
90
+ }
91
+
92
+ $link_id = $params['l'];
93
+ $type = $params['type'];
94
+ $group = $params['group'];
95
+
96
+ require_once 'classes/views/prli-clicks/head.php';
97
+ }
98
+ }
99
+
100
+ /* Add header to the prli-links page */
101
+ function prli_links_admin_header()
102
+ {
103
+ global $prli_siteurl;
104
+ require_once 'classes/views/prli-links/head.php';
105
+ }
106
+
107
+ /* Add header to the prli-links page */
108
+ function prli_groups_admin_header()
109
+ {
110
+ global $prli_siteurl;
111
+ require_once 'classes/views/prli-groups/head.php';
112
+ }
113
+
114
+ /********* ADD REDIRECTS FOR STANDARD MODE ***********/
115
+ function prli_redirect()
116
+ {
117
+ global $prli_blogurl, $wpdb, $prli_link;
118
+
119
+ // Resolve WP installs in sub-directories
120
+ preg_match('#^http://.*?(/.*)$#', $prli_blogurl, $subdir);
121
+
122
+ $match_str = '#^'.$subdir[1].'/(.*?)([\?/].*?)?$#';
123
+
124
+ if(preg_match($match_str, $_SERVER['REQUEST_URI'], $match_val))
125
+ {
126
+ // match short slugs (most common)
127
+ prli_link_redirect_from_slug($match_val[1],$match_val[2]);
128
+
129
+ // Match nested slugs (pretty link sub-directory nesting)
130
+ $possible_links = $wpdb->get_col("SELECT slug FROM " . $prli_link->table_name . " WHERE slug like '".$match_val[1]."/%'",0);
131
+ foreach($possible_links as $possible_link)
132
+ {
133
+ // Try to match the full link against the URI
134
+ if( preg_match('#^'.$subdir[1].'/('.$possible_link.')([\?/].*?)?$#', $_SERVER['REQUEST_URI'], $match_val) )
135
+ prli_link_redirect_from_slug($possible_link,$match_val[2]);
136
+ }
137
+ }
138
+ }
139
+
140
+ // For use with the prli_redirect function
141
+ function prli_link_redirect_from_slug($slug,$param_str)
142
+ {
143
+ global $prli_link, $prli_utils;
144
+
145
+ $link = $prli_link->getOneFromSlug($slug);
146
+
147
+ if(isset($link->slug) and !empty($link->slug))
148
+ {
149
+ $custom_get = $_GET;
150
+
151
+ if(isset($link->param_forwarding) and $link->param_forwarding == 'custom')
152
+ $custom_get = $prli_utils->decode_custom_param_str($link->param_struct, $param_str);
153
+
154
+ $prli_utils->track_link($link->slug,$custom_get);
155
+ exit;
156
+ }
157
+ }
158
+
159
+ add_action('init', 'prli_redirect'); //Redirect
160
+
161
+ /********* DASHBOARD WIDGET ***********/
162
+ function prli_dashboard_widget_function() {
163
+ require_once 'prli-dashboard-widget.php';
164
+ }
165
+
166
+ // Create the function use in the action hook
167
+ function prli_add_dashboard_widgets() {
168
+ global $current_user;
169
+ get_currentuserinfo();
170
+ if($current_user->user_level >= 8)
171
+ {
172
+ wp_add_dashboard_widget('prli_dashboard_widget', 'Pretty Link Quick Add', 'prli_dashboard_widget_function');
173
+
174
+ // Globalize the metaboxes array, this holds all the widgets for wp-admin
175
+ global $wp_meta_boxes;
176
+
177
+ // Get the regular dashboard widgets array
178
+ $normal_dashboard = $wp_meta_boxes['dashboard']['normal']['core'];
179
+
180
+ // Backup and delete our new dashbaord widget from the end of the array
181
+ $prli_widget_backup = array('prli_dashboard_widget' => $normal_dashboard['prli_dashboard_widget']);
182
+ unset($normal_dashboard['prli_dashboard_widget']);
183
+
184
+ // Merge the two arrays together so our widget is at the beginning
185
+ $i = 0;
186
+ foreach($normal_dashboard as $key => $value)
187
+ {
188
+ if($i == 1 or (count($normal_dashboard) <= 1 and $i == count($normal_dashboard) - 1))
189
+ $sorted_dashboard['prli_dashboard_widget'] = $prli_widget_backup['prli_dashboard_widget'];
190
+
191
+ $sorted_dashboard[$key] = $normal_dashboard[$key];
192
+ $i++;
193
+ }
194
+
195
+ // Save the sorted array back into the original metaboxes
196
+ $wp_meta_boxes['dashboard']['normal']['core'] = $sorted_dashboard;
197
+ }
198
+ }
199
+
200
+ // Hook into the 'wp_dashboard_setup' action to register our other functions
201
+ add_action('wp_dashboard_setup', 'prli_add_dashboard_widgets' );
202
+
203
+ /********* EXPORT PRETTY LINK API VIA XML-RPC ***********/
204
+ function prli_export_api($api_methods)
205
+ {
206
+ $api_methods['prli.create_pretty_link'] = 'prli_xmlrpc_create_pretty_link';
207
+ $api_methods['prli.get_all_groups'] = 'prli_xmlrpc_get_all_groups';
208
+ $api_methods['prli.get_all_links'] = 'prli_xmlrpc_get_all_links';
209
+ $api_methods['prli.get_link'] = 'prli_xmlrpc_get_link';
210
+ $api_methods['prli.get_link_from_slug'] = 'prli_xmlrpc_get_link_from_slug';
211
+ $api_methods['prli.get_pretty_link_url'] = 'prli_xmlrpc_get_pretty_link_url';
212
+ $api_methods['prli.api_version'] = 'prli_xmlrpc_api_version';
213
+
214
+ return $api_methods;
215
+ }
216
+
217
+ add_filter('xmlrpc_methods', 'prli_export_api');
218
+
219
+ /********* INSTALL PLUGIN ***********/
220
+ function prli_install()
221
+ {
222
+ global $wpdb, $prli_utils;
223
+
224
+ //require_once(dirname(__FILE__) . "/classes/models/PrliUtils.php");
225
+ //$prli_utils = new PrliUtils();
226
+
227
+ $groups_table = $wpdb->prefix . "prli_groups";
228
+ $clicks_table = $wpdb->prefix . "prli_clicks";
229
+ $pretty_links_table = $wpdb->prefix . "prli_links";
230
+ $link_metas_table = $wpdb->prefix . "prli_link_metas";
231
+
232
+ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
233
+
234
+ /* Create/Upgrade Clicks (Hits) Table */
235
+ $sql = "CREATE TABLE " . $clicks_table . " (
236
+ id int(11) NOT NULL auto_increment,
237
+ ip varchar(255) default NULL,
238
+ browser varchar(255) default NULL,
239
+ btype varchar(255) default NULL,
240
+ bversion varchar(255) default NULL,
241
+ os varchar(255) default NULL,
242
+ referer varchar(255) default NULL,
243
+ host varchar(255) default NULL,
244
+ uri varchar(255) default NULL,
245
+ first_click tinyint default 0,
246
+ created_at datetime NOT NULL,
247
+ link_id int(11) default NULL,
248
+ vuid varchar(25) default NULL,
249
+ PRIMARY KEY (id),
250
+ KEY link_id (link_id),
251
+ KEY vuid (vuid)".
252
+ // We won't worry about this constraint for now.
253
+ //CONSTRAINT ".$clicks_table."_ibfk_1 FOREIGN KEY (link_id) REFERENCES $pretty_links_table (id)
254
+ ");";
255
+
256
+ dbDelta($sql);
257
+
258
+ /* Create/Upgrade Pretty Links Table */
259
+ $sql = "CREATE TABLE " . $pretty_links_table . " (
260
+ id int(11) NOT NULL auto_increment,
261
+ name varchar(255) default NULL,
262
+ description text default NULL,
263
+ url text default NULL,
264
+ slug varchar(255) default NULL,
265
+ track_as_img tinyint(1) default 0,
266
+ nofollow tinyint(1) default 0,
267
+ track_me tinyint(1) default 1,
268
+ use_prettybar tinyint(1) default 0,
269
+ use_ultra_cloak tinyint(1) default 0,
270
+ param_forwarding varchar(255) default NULL,
271
+ param_struct varchar(255) default NULL,
272
+ redirect_type varchar(255) default '307',
273
+ gorder int(11) default 0,
274
+ created_at datetime NOT NULL,
275
+ group_id int(11) default NULL,
276
+ PRIMARY KEY (id),
277
+ KEY group_id (group_id),
278
+ KEY slug (slug)
279
+ );";
280
+
281
+ dbDelta($sql);
282
+
283
+ /* Create/Upgrade Groups Table */
284
+ $sql = "CREATE TABLE " . $groups_table . " (
285
+ id int(11) NOT NULL auto_increment,
286
+ name varchar(255) default NULL,
287
+ description text default NULL,
288
+ cmon_g varchar(255) default NULL,
289
+ created_at datetime NOT NULL,
290
+ PRIMARY KEY (id)
291
+ );";
292
+
293
+ dbDelta($sql);
294
+
295
+ /* Create/Upgrade Groups Table */
296
+ $sql = "CREATE TABLE {$link_metas_table} (
297
+ id int(11) NOT NULL auto_increment,
298
+ meta_key varchar(255) default NULL,
299
+ meta_value longtext default NULL,
300
+ link_id int(11) NOT NULL,
301
+ created_at datetime NOT NULL,
302
+ PRIMARY KEY (id),
303
+ KEY link_id (link_id)
304
+ );";
305
+
306
+ dbDelta($sql);
307
+
308
+ // Install / Upgrade Pretty Link Pro
309
+ $prlipro_username = get_option( 'prlipro_username' );
310
+ $prlipro_password = get_option( 'prlipro_password' );
311
+
312
+ if( !empty($prlipro_username) and !empty($prlipro_password) and
313
+ $prli_utils->get_pro_user_type($prlipro_username,$prlipro_password) != false )
314
+ $prlipro_response = $prli_utils->download_and_install_pro( $prlipro_username, $prlipro_password );
315
+
316
+ // TODO: Move all these options into a central options class
317
+ // Set PrettyBar Defaults
318
+ $prettybar_show_title = 'prli_prettybar_show_title';
319
+ $prettybar_show_description = 'prli_prettybar_show_description';
320
+ $prettybar_show_share_links = 'prli_prettybar_show_share_links';
321
+ $prettybar_show_target_url_link = 'prli_prettybar_show_target_url_link';
322
+
323
+ if(!get_option($prettybar_show_title))
324
+ add_option('prli_prettybar_show_title',1);
325
+ if(!get_option($prettybar_show_description))
326
+ add_option('prli_prettybar_show_description',1);
327
+ if(!get_option($prettybar_show_share_links))
328
+ add_option('prli_prettybar_show_share_links',1);
329
+ if(!get_option($prettybar_show_target_url_link))
330
+ add_option('prli_prettybar_show_target_url_link',1);
331
+
332
+ // Set Link Defaults
333
+ $link_show_prettybar = 'prli_link_show_prettybar';
334
+ $link_ultra_cloak = 'prli_link_ultra_cloak';
335
+ $link_track_me = 'prli_link_track_me';
336
+ $link_track_as_pixel = 'prli_link_track_as_pixel';
337
+ $link_nofollow = 'prli_link_nofollow';
338
+ $link_redirect_type = 'prli_link_redirect_type';
339
+
340
+ if(!get_option($link_show_prettybar))
341
+ add_option('prli_link_show_prettybar',0);
342
+ if(!get_option($link_ultra_cloak))
343
+ add_option('prli_link_ultra_cloak',0);
344
+ if(!get_option($link_track_me))
345
+ add_option('prli_link_track_me',1);
346
+ if(!get_option($link_track_as_pixel))
347
+ add_option('prli_link_track_as_pixel',0);
348
+ if(!get_option($link_nofollow))
349
+ add_option('prli_link_nofollow',0);
350
+ if(!get_option($link_redirect_type))
351
+ update_option('prli_link_redirect_type','307');
352
+ if(!get_option('prli_prettybar_title_limit'))
353
+ update_option('prli_prettybar_title_limit', '30');
354
+ if(!get_option('prli_prettybar_desc_limit'))
355
+ update_option('prli_prettybar_desc_limit', '40');
356
+ if(!get_option('prli_prettybar_link_limit'))
357
+ update_option('prli_prettybar_link_limit', '40');
358
+ }
359
+
360
+ // Ensure this gets called on first install
361
+ register_activation_hook(__FILE__,'prli_install');
362
+
363
  ?>
prli-api.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
  function prli_api_version()
10
  {
11
- return '1.3';
12
  }
13
 
14
  /**
@@ -30,6 +30,14 @@ function prli_api_version()
30
  * If this value isn't set then the link will not be
31
  * placed in a group.
32
  *
 
 
 
 
 
 
 
 
33
  * @param boolean $link_track_me Optional, If true the link will be tracked,
34
  * if not set the default value (from the pretty
35
  * link option page) will be used
@@ -39,8 +47,7 @@ function prli_api_version()
39
  * value (from the pretty link option page) will
40
  * be used
41
  *
42
- * @param string $link_redirect_type Optional, valid values include '307', '301',
43
- * 'prettybar', 'cloak' or 'pixel'
44
  * if not set the default value (from the pretty
45
  * link option page) will be used
46
  *
@@ -56,14 +63,17 @@ function prli_create_pretty_link( $target_url,
56
  $name = '',
57
  $description = '',
58
  $group_id = 0,
 
 
59
  $track_me = '',
60
  $nofollow = '',
61
  $redirect_type = '',
 
62
  $param_forwarding = '',
63
  $param_struct = '' )
64
  {
65
  global $wpdb, $prli_link, $prli_blogurl;
66
- global $prli_error_messages, $prli_pretty_link, $prli_pretty_slug, $prli_options;
67
 
68
  $prli_error_messages = array();
69
 
@@ -73,17 +83,27 @@ function prli_create_pretty_link( $target_url,
73
  $values['name'] = $name;
74
  $values['description'] = $description;
75
  $values['group_id'] = $group_id;
76
- $values['redirect_type'] = (($redirect_type == '')?$prli_options->link_redirect_type:$redirect_type);
77
- $values['nofollow'] = (($nofollow == '')?$prli_options->link_nofollow:$nofollow);
78
- $values['track_me'] = (($track_me == '')?$prli_options->link_track_me:$track_me);
 
 
 
79
  $values['param_forwarding'] = (($param_forwarding == '')?'off':$param_forwarding);
80
  $values['param_struct'] = $param_struct;
 
81
 
82
  // make array look like $_POST
83
  if(empty($values['nofollow']) or !$values['nofollow'])
84
  unset($values['nofollow']);
 
 
 
 
85
  if(empty($values['track_me']) or !$values['track_me'])
86
  unset($values['track_me']);
 
 
87
 
88
  $prli_error_messages = $prli_link->validate( $values );
89
 
@@ -107,9 +127,12 @@ function prli_update_pretty_link( $id,
107
  $name = -1,
108
  $description = -1,
109
  $group_id = '',
 
 
110
  $track_me = '',
111
  $nofollow = '',
112
  $redirect_type = '',
 
113
  $param_forwarding = '',
114
  $param_struct = -1 )
115
  {
@@ -135,15 +158,25 @@ function prli_update_pretty_link( $id,
135
  $values['group_id'] = (($group_id == '')?$record->group_id:$group_id);
136
  $values['redirect_type'] = (($redirect_type == '')?$record->redirect_type:$redirect_type);
137
  $values['nofollow'] = (($nofollow == '')?$record->nofollow:$nofollow);
 
 
138
  $values['track_me'] = (($track_me == '')?(int)$record->track_me:$track_me);
 
139
  $values['param_forwarding'] = (($param_forwarding == '')?$record->param_forwarding:$param_forwarding);
140
  $values['param_struct'] = (($param_struct == -1)?$record->param_struct:$param_struct);
 
141
 
142
  // make array look like $_POST
143
  if(empty($values['nofollow']) or !$values['nofollow'])
144
  unset($values['nofollow']);
 
 
 
 
145
  if(empty($values['track_me']) or !$values['track_me'])
146
  unset($values['track_me']);
 
 
147
 
148
  $prli_error_messages = $prli_link->validate( $values );
149
 
@@ -195,10 +228,10 @@ function prli_get_all_links()
195
  * @return bool (false if failure) | array An associative array with all the
196
  * data about the given pretty link.
197
  */
198
- function prli_get_link_from_slug($slug, $return_type = OBJECT, $include_stats = false)
199
  {
200
  global $prli_link;
201
- $link = $prli_link->getOneFromSlug($slug, $return_type, $include_stats);
202
  return $link;
203
  }
204
 
@@ -208,10 +241,10 @@ function prli_get_link_from_slug($slug, $return_type = OBJECT, $include_stats =
208
  * @return bool (false if failure) | array An associative array with all the
209
  * data about the given pretty link.
210
  */
211
- function prli_get_link($id, $return_type = OBJECT, $include_stats = false)
212
  {
213
  global $prli_link;
214
- $link = $prli_link->getOne($id, $return_type, $include_stats);
215
  return $link;
216
  }
217
 
@@ -222,10 +255,10 @@ function prli_get_link($id, $return_type = OBJECT, $include_stats = false)
222
  */
223
  function prli_get_pretty_link_url($id)
224
  {
225
- global $prli_link,$prli_blogurl;
226
 
227
- if($pretty_link = $prli_link->getOne($id))
228
- return "{$prli_blogurl}".PrliUtils::get_permalink_pre_slug_uri()."{$pretty_link->slug}";
229
 
230
  return false;
231
  }
8
  */
9
  function prli_api_version()
10
  {
11
+ return '1.1';
12
  }
13
 
14
  /**
30
  * If this value isn't set then the link will not be
31
  * placed in a group.
32
  *
33
+ * @param boolean $show_prettybar Optional, If true the prettybar will be shown,
34
+ * if not set the default value (from the pretty
35
+ * link option page) will be used
36
+ *
37
+ * @param boolean $ultra_cloak Optional, If true then the link will be ultra-cloaked,
38
+ * if not set the default value (from the pretty link
39
+ * option page) will be used
40
+ *
41
  * @param boolean $link_track_me Optional, If true the link will be tracked,
42
  * if not set the default value (from the pretty
43
  * link option page) will be used
47
  * value (from the pretty link option page) will
48
  * be used
49
  *
50
+ * @param string $link_redirect_type Optional, valid values include '307' or '301',
 
51
  * if not set the default value (from the pretty
52
  * link option page) will be used
53
  *
63
  $name = '',
64
  $description = '',
65
  $group_id = 0,
66
+ $show_prettybar = '',
67
+ $ultra_cloak = '',
68
  $track_me = '',
69
  $nofollow = '',
70
  $redirect_type = '',
71
+ $track_as_img = '',
72
  $param_forwarding = '',
73
  $param_struct = '' )
74
  {
75
  global $wpdb, $prli_link, $prli_blogurl;
76
+ global $prli_error_messages, $prli_pretty_link, $prli_pretty_slug;
77
 
78
  $prli_error_messages = array();
79
 
83
  $values['name'] = $name;
84
  $values['description'] = $description;
85
  $values['group_id'] = $group_id;
86
+ $values['redirect_type'] = (($redirect_type == '')?get_option( 'prli_link_redirect_type' ):$redirect_type);
87
+ $values['nofollow'] = (($nofollow == '')?get_option( 'prli_link_nofollow' ):$nofollow);
88
+ $values['use_prettybar'] = (($show_prettybar == '')?(int)get_option( 'prli_link_show_prettybar' ):$show_prettybar);
89
+ $values['use_ultra_cloak'] = (($ultra_cloak == '')?(int)get_option( 'prli_link_ultra_cloak' ):$ultra_cloak);
90
+ $values['track_me'] = (($track_me == '')?get_option( 'prli_link_track_me' ):$track_me);
91
+ $values['track_as_img'] = (($track_as_img == '')?0:$track_as_img);
92
  $values['param_forwarding'] = (($param_forwarding == '')?'off':$param_forwarding);
93
  $values['param_struct'] = $param_struct;
94
+ $values['gorder'] = '0'; // not supported by this function
95
 
96
  // make array look like $_POST
97
  if(empty($values['nofollow']) or !$values['nofollow'])
98
  unset($values['nofollow']);
99
+ if(empty($values['use_prettybar']) or !$values['use_prettybar'])
100
+ unset($values['use_prettybar']);
101
+ if(empty($values['use_ultra_cloak']) or !$values['use_ultra_cloak'])
102
+ unset($values['use_ultra_cloak']);
103
  if(empty($values['track_me']) or !$values['track_me'])
104
  unset($values['track_me']);
105
+ if(empty($values['track_as_img']) or !$values['track_as_img'])
106
+ unset($values['track_as_img']);
107
 
108
  $prli_error_messages = $prli_link->validate( $values );
109
 
127
  $name = -1,
128
  $description = -1,
129
  $group_id = '',
130
+ $show_prettybar = '',
131
+ $ultra_cloak = '',
132
  $track_me = '',
133
  $nofollow = '',
134
  $redirect_type = '',
135
+ $track_as_img = '',
136
  $param_forwarding = '',
137
  $param_struct = -1 )
138
  {
158
  $values['group_id'] = (($group_id == '')?$record->group_id:$group_id);
159
  $values['redirect_type'] = (($redirect_type == '')?$record->redirect_type:$redirect_type);
160
  $values['nofollow'] = (($nofollow == '')?$record->nofollow:$nofollow);
161
+ $values['use_prettybar'] = (($show_prettybar == '')?(int)$record->use_prettybar:$show_prettybar);
162
+ $values['use_ultra_cloak'] = (($ultra_cloak == '')?(int)$record->use_ultra_cloak:$ultra_cloak);
163
  $values['track_me'] = (($track_me == '')?(int)$record->track_me:$track_me);
164
+ $values['track_as_img'] = (($track_as_img == '')?(int)$record->track_as_img:$track_as_img);
165
  $values['param_forwarding'] = (($param_forwarding == '')?$record->param_forwarding:$param_forwarding);
166
  $values['param_struct'] = (($param_struct == -1)?$record->param_struct:$param_struct);
167
+ $values['gorder'] = $record->gorder; // not supported by this function
168
 
169
  // make array look like $_POST
170
  if(empty($values['nofollow']) or !$values['nofollow'])
171
  unset($values['nofollow']);
172
+ if(empty($values['use_prettybar']) or !$values['use_prettybar'])
173
+ unset($values['use_prettybar']);
174
+ if(empty($values['use_ultra_cloak']) or !$values['use_ultra_cloak'])
175
+ unset($values['use_ultra_cloak']);
176
  if(empty($values['track_me']) or !$values['track_me'])
177
  unset($values['track_me']);
178
+ if(empty($values['track_as_img']) or !$values['track_as_img'])
179
+ unset($values['track_as_img']);
180
 
181
  $prli_error_messages = $prli_link->validate( $values );
182
 
228
  * @return bool (false if failure) | array An associative array with all the
229
  * data about the given pretty link.
230
  */
231
+ function prli_get_link_from_slug($slug)
232
  {
233
  global $prli_link;
234
+ $link = $prli_link->getOneFromSlug($slug, ARRAY_A);
235
  return $link;
236
  }
237
 
241
  * @return bool (false if failure) | array An associative array with all the
242
  * data about the given pretty link.
243
  */
244
+ function prli_get_link($id)
245
  {
246
  global $prli_link;
247
+ $link = $prli_link->getOne($id, ARRAY_A);
248
  return $link;
249
  }
250
 
255
  */
256
  function prli_get_pretty_link_url($id)
257
  {
258
+ global $prli_blogurl;
259
 
260
+ if($pretty_link = prli_get_link($id))
261
+ return "{$prli_blogurl}/{$pretty_link->slug}";
262
 
263
  return false;
264
  }
prli-clicks.php CHANGED
@@ -1,13 +1,15 @@
1
  <?php
2
 
 
 
 
3
  require_once 'prli-config.php';
4
  require_once(PRLI_MODELS_PATH . '/models.inc.php');
5
  require_once(PRLI_PATH . '/prli-image-lookups.php');
6
 
7
  $controller_file = basename(__FILE__);
8
- $max_rows_per_file = 5000;
9
 
10
- if(!isset($_REQUEST['action']))
11
  {
12
  $page_params = '';
13
 
@@ -90,57 +92,13 @@ if(!isset($_REQUEST['action']))
90
 
91
  $record_count = $prli_click->getRecordCount($count_where_clause);
92
  $page_count = $prli_click->getPageCount($page_size,$count_where_clause);
93
- $clicks = $prli_click->getPage($current_page,$page_size,$where_clause,$order_by,true);
94
  $page_last_record = $prli_utils->getLastRecordNum($record_count,$current_page,$page_size);
95
  $page_first_record = $prli_utils->getFirstRecordNum($record_count,$current_page,$page_size);
96
 
97
  require_once 'classes/views/prli-clicks/list.php';
98
  }
99
- else if(isset($_REQUEST['action']) and $_REQUEST['action'] == 'csv')
100
- {
101
- $param_string = '';
102
- $where_clause = '';
103
-
104
- if(isset($_GET['l']))
105
- {
106
- $where_clause = " link_id=".$_GET['l'];
107
- $link_name = $wpdb->get_var("SELECT name FROM ".$wpdb->prefix."prli_links WHERE id=".$_GET['l']);
108
- $link_slug = $wpdb->get_var("SELECT slug FROM ".$wpdb->prefix."prli_links WHERE id=".$_GET['l']);
109
- $param_string .= "l=".$_GET['l'];
110
- }
111
- else if(isset($_GET['ip']))
112
- {
113
- $link_name = "ip_addr_" . $_GET['ip'];
114
- $where_clause = " cl.ip='".$_GET['ip']."'";
115
- $param_string .= "ip=".$_GET['ip'];
116
- }
117
- else if(isset($_GET['vuid']))
118
- {
119
- $link_name = "visitor_" . $_GET['vuid'];
120
- $where_clause = " cl.vuid='".$_GET['vuid']."'";
121
- $param_string .= "vuid=".$_GET['vuid'];
122
- }
123
- else if(isset($_GET['group']))
124
- {
125
- $group = $prli_group->getOne($_GET['group']);
126
- $link_name = "group_" . $group->name;
127
- $where_clause .= " cl.link_id IN (SELECT id FROM {$prli_link->table_name} WHERE group_id=".$_GET['group'].")";
128
- $param_string .= "group=".$_GET['group'];
129
- }
130
- else
131
- {
132
- $link_name = "all_links";
133
- }
134
-
135
- $hit_record_count = $prli_click->getRecordCount($where_clause);
136
- $hit_page_count = (int)ceil($hit_record_count / $max_rows_per_file);
137
-
138
- $param_string = (empty($param_string)?'':"&{$param_string}");
139
- $hit_report_url = "{$prli_blogurl}/index.php?action=prli_download_csv_hit_report{$param_string}";
140
-
141
- require_once 'classes/views/prli-clicks/csv_download.php';
142
- }
143
- else if(isset($_REQUEST['action']) and $_REQUEST['action'] == 'prli_download_csv_hit_report')
144
  {
145
  if(isset($_GET['l']))
146
  {
@@ -170,24 +128,7 @@ else if(isset($_REQUEST['action']) and $_REQUEST['action'] == 'prli_download_csv
170
  $where_clause = "";
171
  }
172
 
173
- $link_name = stripslashes($link_name);
174
- $link_name = preg_replace("#[ ,]#",'',$link_name);
175
-
176
- $record_count = $prli_click->getRecordCount($where_clause);
177
- $page_count = (int)ceil($record_count / $max_rows_per_file);
178
- $prli_page = $_GET['prli_page'];
179
- $hmin = 0;
180
-
181
- if($prli_page)
182
- $hmin = ($prli_page - 1) * $max_rows_per_file;
183
-
184
- if($prli_page==$page_count)
185
- $hmax = $record_count;
186
- else
187
- $hmax = ($prli_page * $max_rows_per_file) - 1;
188
-
189
- $hlimit = "{$hmin},{$max_rows_per_file}";
190
- $clicks = $prli_click->getAll($where_clause,'',false,$hlimit);
191
  require_once 'classes/views/prli-clicks/csv.php';
192
  }
193
 
@@ -196,7 +137,6 @@ function prli_get_click_sort_vars($params,$where_clause = '')
196
  {
197
  $count_where_clause = '';
198
  $page_params = '';
199
- $order_by = '';
200
 
201
  // These will have to work with both get and post
202
  $sort_str = $params['sort'];
1
  <?php
2
 
3
+ if(isset($_GET['action']) and $_GET['action'] == 'csv')
4
+ require_once(dirname(__FILE__) . '/../../../wp-config.php');
5
+
6
  require_once 'prli-config.php';
7
  require_once(PRLI_MODELS_PATH . '/models.inc.php');
8
  require_once(PRLI_PATH . '/prli-image-lookups.php');
9
 
10
  $controller_file = basename(__FILE__);
 
11
 
12
+ if($_GET['action'] == null and $_POST['action'] == null)
13
  {
14
  $page_params = '';
15
 
92
 
93
  $record_count = $prli_click->getRecordCount($count_where_clause);
94
  $page_count = $prli_click->getPageCount($page_size,$count_where_clause);
95
+ $clicks = $prli_click->getPage($current_page,$page_size,$where_clause,$order_by);
96
  $page_last_record = $prli_utils->getLastRecordNum($record_count,$current_page,$page_size);
97
  $page_first_record = $prli_utils->getFirstRecordNum($record_count,$current_page,$page_size);
98
 
99
  require_once 'classes/views/prli-clicks/list.php';
100
  }
101
+ else if($_GET['action'] == 'csv' or $_POST['action'] == 'csv')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  {
103
  if(isset($_GET['l']))
104
  {
128
  $where_clause = "";
129
  }
130
 
131
+ $clicks = $prli_click->getAll($where_clause);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  require_once 'classes/views/prli-clicks/csv.php';
133
  }
134
 
137
  {
138
  $count_where_clause = '';
139
  $page_params = '';
 
140
 
141
  // These will have to work with both get and post
142
  $sort_str = $params['sort'];
prli-config.php CHANGED
@@ -1,23 +1,12 @@
1
  <?php
2
- define('PRLI_PLUGIN_NAME',"pretty-link");
3
- define('PRLI_PATH',WP_PLUGIN_DIR.'/'.PRLI_PLUGIN_NAME);
4
- define('PRLI_MODELS_PATH',PRLI_PATH.'/classes/models');
5
- define('PRLI_CONTROLLERS_PATH',PRLI_PATH.'/classes/controllers');
6
- define('PRLI_VIEWS_PATH',PRLI_PATH.'/classes/views');
7
- //define(PRLI_URL,WP_PLUGIN_URL.'/'.PRLI_PLUGIN_NAME);
8
- define('PRLI_URL',plugins_url($path = '/'.PRLI_PLUGIN_NAME));
9
- define('PRLI_IMAGES_URL','https://d14715w921jdje.cloudfront.net/images');
10
-
11
- require_once(PRLI_MODELS_PATH.'/PrliOptions.php');
12
-
13
- // For IIS compatibility
14
- if (!function_exists('fnmatch'))
15
- {
16
- function fnmatch($pattern, $string)
17
- {
18
- return preg_match("#^".strtr(preg_quote($pattern, '#'), array('\*' => '.*', '\?' => '.'))."$#i", $string);
19
- }
20
- }
21
 
22
  // The number of items per page on a table
23
  global $page_size;
@@ -33,63 +22,53 @@ $prli_siteurl = get_option('siteurl');
33
  $prli_blogname = get_option('blogname');
34
  $prli_blogdescription = get_option('blogdescription');
35
 
36
- /***** SETUP OPTIONS OBJECT *****/
37
- global $prli_options;
38
-
39
- $prli_options = get_option('prli_options');
40
-
41
- // If unserializing didn't work
42
- if(!is_object($prli_options))
43
- {
44
- if($prli_options and is_string($prli_options))
45
- $prli_options = unserialize($prli_options);
46
-
47
- // If it still isn't an object then let's create it
48
- if(!is_object($prli_options))
49
- $prli_options = new PrliOptions();
50
-
51
- update_option('prli_options',$prli_options);
52
- }
53
-
54
- $prli_options->set_default_options(); // Sets defaults for unset options
55
-
56
- /***** TODO: Uh... these functions should find a better home somewhere *****/
57
  function setup_new_vars($groups)
58
  {
59
- global $prli_link, $prli_options;
60
 
61
- $values = array();
62
- $values['url'] = (isset($_REQUEST['url'])?$_REQUEST['url']:'');
63
- $values['slug'] = (isset($_REQUEST['slug'])?$_REQUEST['slug']:$prli_link->generateValidSlug());
64
- $values['name'] = htmlspecialchars((isset($_REQUEST['name'])?stripslashes($_REQUEST['name']):''));
65
- $values['description'] = htmlspecialchars((isset($_REQUEST['description'])?stripslashes($_REQUEST['description']):''));
 
66
 
67
- $values['track_me'] = (((isset($_REQUEST['track_me']) and $_REQUEST['track_me'] == 'on') or (!isset($_REQUEST['track_me']) and $prli_options->link_track_me == '1'))?'checked="true"':'');
68
- $values['nofollow'] = (((isset($_REQUEST['nofollow']) and $_REQUEST['nofollow'] == 'on') or (!isset($_REQUEST['nofollow']) and $prli_options->link_nofollow == '1'))?'checked="true"':'');
 
 
 
 
69
 
 
 
 
 
 
 
 
 
 
 
70
  $values['redirect_type'] = array();
71
- $values['redirect_type']['307'] = (((isset($_REQUEST['redirect_type']) and $_REQUEST['redirect_type'] == '307') or (!isset($_REQUEST['redirect_type']) and $prli_options->link_redirect_type == '307'))?'selected="selected"':'');
72
- $values['redirect_type']['301'] = (((isset($_REQUEST['redirect_type']) and $_REQUEST['redirect_type'] == '301') or (!isset($_REQUEST['redirect_type']) and $prli_options->link_redirect_type == '301'))?'selected="selected"':'');
73
- $values['redirect_type']['prettybar'] = (((isset($_REQUEST['redirect_type']) and $_REQUEST['redirect_type'] == 'prettybar') or (!isset($_REQUEST['redirect_type']) and $prli_options->link_redirect_type == 'prettybar'))?'selected="selected"':'');
74
- $values['redirect_type']['cloak'] = (((isset($_REQUEST['redirect_type']) and $_REQUEST['redirect_type'] == 'cloak') or (!isset($_REQUEST['redirect_type']) and $prli_options->link_redirect_type == 'cloak'))?'selected="selected"':'');
75
- $values['redirect_type']['pixel'] = (((isset($_REQUEST['redirect_type']) and $_REQUEST['redirect_type'] == 'pixel') or (!isset($_REQUEST['redirect_type']) and $prli_options->link_redirect_type == 'pixel'))?'selected="selected"':'');
76
 
77
  $values['groups'] = array();
78
-
79
- if(is_array($groups))
80
  {
81
- foreach($groups as $group)
82
- {
83
- $values['groups'][] = array( 'id' => $group->id,
84
- 'value' => ((isset($_REQUEST['group_id']) and $_REQUEST['group_id'] == $group->id)?' selected="true"':''),
85
- 'name' => $group->name );
86
- }
87
  }
88
 
 
 
89
  $values['param_forwarding'] = array();
90
- $values['param_forwarding']['off'] = (((isset($_REQUEST['param_forwarding']) and $_REQUEST['param_forwarding'] == 'off') or !isset($_REQUEST['param_forwarding']))?'checked="true"':'');
91
- $values['param_forwarding']['on'] = ((isset($_REQUEST['param_forwarding']) and $_REQUEST['param_forwarding'] == 'on')?'checked="true"':'');
92
- $values['param_forwarding']['custom'] = ((isset($_REQUEST['param_forwarding']) and $_REQUEST['param_forwarding'] == 'custom')?'checked="true"':'');
93
 
94
  return $values;
95
  }
@@ -99,33 +78,34 @@ function setup_edit_vars($groups,$record)
99
  global $prli_link;
100
 
101
  $values = array();
102
- $values['url'] = ((isset($_REQUEST['url']) and $record == null)?$_REQUEST['url']:$record->url);
103
- $values['slug'] = ((isset($_REQUEST['slug']) and $record == null)?$_REQUEST['slug']:$record->slug);
104
- $values['name'] = htmlspecialchars(stripslashes(((isset($_REQUEST['name']) and $record == null)?$_REQUEST['name']:$record->name)));
105
- $values['description'] = htmlspecialchars(stripslashes(((isset($_REQUEST['description']) and $record == null)?$_REQUEST['description']:$record->description)));
106
- $values['track_me'] = (((isset($_REQUEST['track_me']) or $record->track_me) and ((isset($_REQUEST['track_me']) and $_REQUEST['track_me'] == 'on') or $record->track_me == 1))?'checked="true"':'');
107
- $values['nofollow'] = (((isset($_REQUEST['nofollow']) or $record->nofollow) and ($_REQUEST['nofollow'] == 'on' or $record->nofollow == 1))?'checked="true"':'');
 
 
108
 
109
  $values['groups'] = array();
110
  foreach($groups as $group)
111
  {
112
  $values['groups'][] = array( 'id' => $group->id,
113
- 'value' => (((isset($_REQUEST['group_id']) and ($_REQUEST['group_id'] == $group->id)) or ($record->group_id == $group->id))?' selected="true"':''),
114
  'name' => $group->name );
115
  }
116
-
117
  $values['param_forwarding'] = array();
118
- $values['param_forwarding']['off'] = ((!isset($_REQUEST['param_forwarding']) or $record->param_forwarding == 'off')?'checked="true"':'');
119
- $values['param_forwarding']['on'] = (((isset($_REQUEST['param_forwarding']) and $_REQUEST['param_forwarding'] == 'on') or (isset($record->param_forwarding) and $record->param_forwarding == 'on'))?'checked="true"':'');
120
- $values['param_forwarding']['custom'] = (((isset($_REQUEST['param_forwarding']) and $_REQUEST['param_forwarding'] == 'custom') or (isset($record->param_forwarding) and $record->param_forwarding == 'custom'))?'checked="true"':'');
121
- $values['param_struct'] = ((isset($_REQUEST['param_struct']) and $record == null)?$_REQUEST['param_struct']:$record->param_struct);
122
 
123
  $values['redirect_type'] = array();
124
- $values['redirect_type']['307'] = ((!isset($_REQUEST['redirect_type']) or (isset($_REQUEST['redirect_type']) and $_REQUEST['redirect_type'] == '307') or (isset($record->redirect_type) and $record->redirect_type == '307'))?' selected="selected"':'');
125
- $values['redirect_type']['301'] = (((isset($_REQUEST['redirect_type']) and $_REQUEST['redirect_type'] == '301') or (isset($record->redirect_type) and $record->redirect_type == '301'))?' selected="selected"':'');
126
- $values['redirect_type']['prettybar'] = (((isset($_REQUEST['redirect_type']) and $_REQUEST['redirect_type'] == 'prettybar') or (isset($record->redirect_type) and $record->redirect_type == 'prettybar'))?' selected="selected"':'');
127
- $values['redirect_type']['cloak'] = (((isset($_REQUEST['redirect_type']) and $_REQUEST['redirect_type'] == 'cloak') or (isset($record->redirect_type) and $record->redirect_type == 'cloak'))?' selected="selected"':'');
128
- $values['redirect_type']['pixel'] = (((isset($_REQUEST['redirect_type']) and $_REQUEST['redirect_type'] == 'pixel') or (isset($record->redirect_type) and $record->redirect_type == 'pixel'))?' selected="selected"':'');
129
 
130
  return $values;
131
  }
1
  <?php
2
+ define(PRLI_PLUGIN_NAME,"pretty-link");
3
+ define(PRLI_PATH,WP_PLUGIN_DIR.'/'.PRLI_PLUGIN_NAME);
4
+ define(PRLI_MODELS_PATH,PRLI_PATH.'/classes/models');
5
+ define(PRLI_VIEWS_PATH,PRLI_PATH.'/classes/views');
6
+ define(PRLI_URL,WP_PLUGIN_URL.'/'.PRLI_PLUGIN_NAME);
7
+
8
+ global $prli_version;
9
+ $prli_version = '1.4.6';
 
 
 
 
 
 
 
 
 
 
 
10
 
11
  // The number of items per page on a table
12
  global $page_size;
22
  $prli_blogname = get_option('blogname');
23
  $prli_blogdescription = get_option('blogdescription');
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  function setup_new_vars($groups)
26
  {
27
+ global $prli_link;
28
 
29
+ $link_show_prettybar = 'prli_link_show_prettybar';
30
+ $link_ultra_cloak = 'prli_link_ultra_cloak';
31
+ $link_track_me = 'prli_link_track_me';
32
+ $link_track_as_pixel = 'prli_link_track_as_pixel';
33
+ $link_nofollow = 'prli_link_nofollow';
34
+ $link_redirect_type = 'prli_link_redirect_type';
35
 
36
+ $link_show_prettybar_val = get_option( $link_show_prettybar );
37
+ $link_ultra_cloak_val = get_option( $link_ultra_cloak );
38
+ $link_track_me_val = get_option( $link_track_me );
39
+ $link_track_as_pixel_val = get_option( $link_track_as_pixel );
40
+ $link_nofollow_val = get_option( $link_nofollow );
41
+ $link_redirect_type_val = get_option( $link_redirect_type );
42
 
43
+ $values = array();
44
+ $values['url'] = (($_POST['url'] != null)?$_POST['url']:'');
45
+ $values['slug'] = (($_POST['slug'] != null)?$_POST['slug']:$prli_link->generateValidSlug());
46
+ $values['name'] = htmlspecialchars((($_POST['name'] != null)?stripslashes($_POST['name']):''));
47
+ $values['description'] = htmlspecialchars((($_POST['description'] != null)?stripslashes($_POST['description']):''));
48
+
49
+ $values['use_prettybar'] = (((isset($_POST['use_prettybar']) and $_POST['use_prettybar'] == 'on') or (!isset($_POST['track_as_img']) and $link_show_prettybar_val == '1'))?'checked="true"':'');
50
+ $values['use_ultra_cloak'] = (((isset($_POST['use_ultra_cloak']) and $_POST['use_ultra_cloak'] == 'on') or (!isset($_POST['track_as_img']) and $link_ultra_cloak_val == '1'))?'checked="true"':'');
51
+ $values['track_me'] = (((isset($_POST['track_me']) and $_POST['track_me'] == 'on') or (!isset($_POST['track_as_img']) and $link_track_me_val == '1'))?'checked="true"':'');
52
+ $values['nofollow'] = (((isset($_POST['nofollow']) and $_POST['nofollow'] == 'on') or (!isset($_POST['track_as_img']) and $link_nofollow_val == '1'))?'checked="true"':'');
53
  $values['redirect_type'] = array();
54
+ $values['redirect_type']['307'] = (((isset($_POST['redirect_type']) and $_POST['redirect_type'] == '307') or (!isset($_POST['track_as_img']) and $link_redirect_type_val == '307'))?'checked="true"':'');
55
+ $values['redirect_type']['301'] = (((isset($_POST['redirect_type']) and $_POST['redirect_type'] == '301') or (!isset($_POST['track_as_img']) and $link_redirect_type_val == '301'))?'checked="true"':'');
56
+ $values['track_as_img'] = (((isset($_POST['track_as_img']) and $_POST['track_as_img'] == 'on') or (!isset($_POST['track_as_img']) and $link_track_as_pixel_val == '1'))?'checked="true"':'');
 
 
57
 
58
  $values['groups'] = array();
59
+ foreach($groups as $group)
 
60
  {
61
+ $values['groups'][] = array( 'id' => $group->id,
62
+ 'value' => (($_POST['group_id'] == $group->id)?' selected="true"':''),
63
+ 'name' => $group->name );
 
 
 
64
  }
65
 
66
+ $values['gorder'] = (isset($_POST['gorder'])?$_POST['gorder']:'0');
67
+
68
  $values['param_forwarding'] = array();
69
+ $values['param_forwarding']['off'] = (((isset($_POST['param_forwarding']) and $_POST['param_forwarding'] == 'off') or !isset($_POST['param_forwarding']))?'checked="true"':'');
70
+ $values['param_forwarding']['on'] = ((isset($_POST['param_forwarding']) and $_POST['param_forwarding'] == 'on')?'checked="true"':'');
71
+ $values['param_forwarding']['custom'] = ((isset($_POST['param_forwarding']) and $_POST['param_forwarding'] == 'custom')?'checked="true"':'');
72
 
73
  return $values;
74
  }
78
  global $prli_link;
79
 
80
  $values = array();
81
+ $values['url'] = (($_POST['url'] != null and $record == null)?$_POST['url']:$record->url);
82
+ $values['slug'] = (($_POST['slug'] != null and $record == null)?$_POST['slug']:$record->slug);
83
+ $values['name'] = htmlspecialchars(stripslashes((($_POST['name'] != null and $record == null)?$_POST['name']:$record->name)));
84
+ $values['description'] = htmlspecialchars(stripslashes((($_POST['description'] != null and $record == null)?$_POST['description']:$record->description)));
85
+ $values['use_prettybar'] = ((($_POST['use_prettybar'] or $record->use_prettybar) and ($_POST['use_prettybar'] == 'on' or $record->use_prettybar == 1))?'checked="true"':'');
86
+ $values['use_ultra_cloak'] = ((($_POST['use_ultra_cloak'] or $record->use_ultra_cloak) and ($_POST['use_ultra_cloak'] == 'on' or $record->use_ultra_cloak == 1))?'checked="true"':'');
87
+ $values['track_me'] = ((($_POST['track_me'] or $record->track_me) and ($_POST['track_me'] == 'on' or $record->track_me == 1))?'checked="true"':'');
88
+ $values['nofollow'] = ((($_POST['nofollow'] or $record->nofollow) and ($_POST['nofollow'] == 'on' or $record->nofollow == 1))?'checked="true"':'');
89
 
90
  $values['groups'] = array();
91
  foreach($groups as $group)
92
  {
93
  $values['groups'][] = array( 'id' => $group->id,
94
+ 'value' => ((($_POST['group_id'] == $group->id) or ($record->group_id == $group->id))?' selected="true"':''),
95
  'name' => $group->name );
96
  }
97
+ $values['gorder'] = (($_POST['gorder'] != null and $record == null)?$_POST['gorder']:$record->gorder);
98
  $values['param_forwarding'] = array();
99
+ $values['param_forwarding']['off'] = ((!isset($_POST['param_forwarding']) or $record->param_forwarding == 'off')?'checked="true"':'');
100
+ $values['param_forwarding']['on'] = (((isset($_POST['param_forwarding']) and $_POST['param_forwarding'] == 'on') or (isset($record->param_forwarding) and $record->param_forwarding == 'on'))?'checked="true"':'');
101
+ $values['param_forwarding']['custom'] = (((isset($_POST['param_forwarding']) and $_POST['param_forwarding'] == 'custom') or (isset($record->param_forwarding) and $record->param_forwarding == 'custom'))?'checked="true"':'');
102
+ $values['param_struct'] = (($_POST['param_struct'] != null and $record == null)?$_POST['param_struct']:$record->param_struct);
103
 
104
  $values['redirect_type'] = array();
105
+ $values['redirect_type']['307'] = ((!isset($_POST['redirect_type']) or $_POST['redirect_type'] == '307' or $record->redirect_type == '307')?'checked="true"':'');
106
+ $values['redirect_type']['301'] = (((isset($_POST['redirect_type']) and $_POST['redirect_type'] == '301') or (isset($record->redirect_type) and $record->redirect_type == '301'))?'checked="true"':'');
107
+
108
+ $values['track_as_img'] = ((($_POST['track_as_img'] or $record->track_as_img) and ($_POST['track_as_img'] == 'on' or $record->track_as_img == 1))?'checked="true"':'');
 
109
 
110
  return $values;
111
  }
prli-dashboard-widget.php CHANGED
@@ -2,7 +2,14 @@
2
  require_once('prli-config.php');
3
  require_once(PRLI_MODELS_PATH . '/models.inc.php');
4
 
5
- $message = prli_get_main_message("Add a Pretty Link from your Dashboard:");
 
 
 
 
 
 
 
6
 
7
  global $prli_group,$prli_link,$prli_blogurl;
8
 
2
  require_once('prli-config.php');
3
  require_once(PRLI_MODELS_PATH . '/models.inc.php');
4
 
5
+ include_once(ABSPATH."/wp-includes/class-IXR.php");
6
+
7
+ $client = new IXR_Client('http://blairwilliams.com/xmlrpc.php');
8
+
9
+ $message = "Add a pretty link right here�";
10
+
11
+ if ($client->query('prli.get_main_message'))
12
+ $message = $client->getResponse();
13
 
14
  global $prli_group,$prli_link,$prli_blogurl;
15
 
prli-links.php CHANGED
@@ -6,9 +6,7 @@ $params = $prli_link->get_params_array();
6
 
7
  if($params['action'] == 'list')
8
  {
9
- if(!empty($params['message']))
10
- $prli_message = $params['message'];
11
- else if(empty($params['group']))
12
  $prli_message = prli_get_main_message();
13
  else
14
  $prli_message = "Links in Group: " . $wpdb->get_var("SELECT name FROM " . $prli_group->table_name . " WHERE id=".$params['group']);
@@ -20,11 +18,6 @@ if($params['action'] == 'list')
20
 
21
  prli_display_links_list($params, $prli_message);
22
  }
23
- else if($params['action'] == 'list-form')
24
- {
25
- if(apply_filters('prli-link-list-process-form', true))
26
- prli_display_links_list($params, prli_get_main_message());
27
- }
28
  else if($params['action'] == 'quick-create')
29
  {
30
  $errors = $prli_link->validate($_POST);
@@ -37,16 +30,22 @@ else if($params['action'] == 'quick-create')
37
  }
38
  else
39
  {
 
40
  $_POST['param_forwarding'] = 'off';
41
  $_POST['param_struct'] = '';
42
  $_POST['name'] = '';
43
  $_POST['description'] = '';
44
- if( $prli_options->link_track_me )
 
 
 
 
45
  $_POST['track_me'] = 'on';
46
- if( $prli_options->link_nofollow )
 
 
47
  $_POST['nofollow'] = 'on';
48
-
49
- $_POST['redirect_type'] = $prli_options->link_redirect_type;
50
 
51
  $record = $prli_link->create( $_POST );
52
 
@@ -85,14 +84,6 @@ else if($params['action'] == 'edit')
85
  $id = $params['id'];
86
  require_once 'classes/views/prli-links/edit.php';
87
  }
88
- else if($params['action'] == 'bulk-update')
89
- {
90
- if(apply_filters('prli-bulk-link-update', true))
91
- {
92
- $prli_message = "Your Pretty Links were Successfully Updated";
93
- prli_display_links_list($params, $prli_message, '', 1);
94
- }
95
- }
96
  else if($params['action'] == 'update')
97
  {
98
  $errors = $prli_link->validate($_POST);
@@ -133,13 +124,10 @@ else if($params['action'] == 'destroy')
133
  // Helpers
134
  function prli_display_links_list($params, $prli_message, $page_params_ov = false, $current_page_ov = false)
135
  {
136
- global $wpdb, $prli_utils, $prli_click, $prli_group, $prli_link, $page_size, $prli_options;
137
 
138
  $controller_file = basename(__FILE__);
139
 
140
- $where_clause = '';
141
- $page_params = '';
142
-
143
  if(!empty($params['group']))
144
  {
145
  $where_clause = " group_id=" . $params['group'];
@@ -213,6 +201,9 @@ function prli_get_link_sort_vars($params,$where_clause = '')
213
  case "slug":
214
  $order_by .= " ORDER BY $sort_str";
215
  break;
 
 
 
216
  default:
217
  $order_by .= " ORDER BY created_at";
218
  }
@@ -234,5 +225,19 @@ function prli_get_link_sort_vars($params,$where_clause = '')
234
  'page_params' => $page_params);
235
  }
236
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
 
238
  ?>
6
 
7
  if($params['action'] == 'list')
8
  {
9
+ if(empty($params['group']))
 
 
10
  $prli_message = prli_get_main_message();
11
  else
12
  $prli_message = "Links in Group: " . $wpdb->get_var("SELECT name FROM " . $prli_group->table_name . " WHERE id=".$params['group']);
18
 
19
  prli_display_links_list($params, $prli_message);
20
  }
 
 
 
 
 
21
  else if($params['action'] == 'quick-create')
22
  {
23
  $errors = $prli_link->validate($_POST);
30
  }
31
  else
32
  {
33
+ $_POST['gorder'] = '0';
34
  $_POST['param_forwarding'] = 'off';
35
  $_POST['param_struct'] = '';
36
  $_POST['name'] = '';
37
  $_POST['description'] = '';
38
+ if( get_option( 'prli_link_show_prettybar' ) )
39
+ $_POST['use_prettybar'] = 'on';
40
+ if( get_option( 'prli_link_ultra_cloak' ) )
41
+ $_POST['use_ultra_cloak'] = 'on';
42
+ if( get_option( 'prli_link_track_me' ) )
43
  $_POST['track_me'] = 'on';
44
+ if( get_option( 'prli_link_track_as_pixel' ) )
45
+ $_POST['track_as_img'] = 'on';
46
+ if( get_option( 'prli_link_nofollow' ) )
47
  $_POST['nofollow'] = 'on';
48
+ $_POST['redirect_type'] = get_option( 'prli_link_redirect_type' );
 
49
 
50
  $record = $prli_link->create( $_POST );
51
 
84
  $id = $params['id'];
85
  require_once 'classes/views/prli-links/edit.php';
86
  }
 
 
 
 
 
 
 
 
87
  else if($params['action'] == 'update')
88
  {
89
  $errors = $prli_link->validate($_POST);
124
  // Helpers
125
  function prli_display_links_list($params, $prli_message, $page_params_ov = false, $current_page_ov = false)
126
  {
127
+ global $wpdb, $prli_utils, $prli_click, $prli_group, $prli_link, $page_size;
128
 
129
  $controller_file = basename(__FILE__);
130
 
 
 
 
131
  if(!empty($params['group']))
132
  {
133
  $where_clause = " group_id=" . $params['group'];
201
  case "slug":
202
  $order_by .= " ORDER BY $sort_str";
203
  break;
204
+ case "gorder":
205
+ $order_by .= " ORDER BY gorder,group_name";
206
+ break;
207
  default:
208
  $order_by .= " ORDER BY created_at";
209
  }
225
  'page_params' => $page_params);
226
  }
227
 
228
+ function prli_get_main_message()
229
+ {
230
+ include_once(ABSPATH."/wp-includes/class-IXR.php");
231
+
232
+ $client = new IXR_Client('http://blairwilliams.com/xmlrpc.php');
233
+
234
+ $message = "Get started by <a href=\"?page=".PRLI_PLUGIN_NAME."/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.";
235
+
236
+ if ($client->query('prli.get_main_message'))
237
+ $message = $client->getResponse();
238
+
239
+ return $message;
240
+ }
241
+
242
 
243
  ?>
prli-options.php CHANGED
@@ -6,84 +6,165 @@ $errors = array();
6
 
7
  // variables for the field and option names
8
  $prli_exclude_ips = 'prli_exclude_ips';
9
- $whitelist_ips = 'prli_whitelist_ips';
10
- $filter_robots = 'prli_filter_robots';
11
- $extended_tracking = 'prli_extended_tracking';
12
-
 
 
 
 
 
 
 
 
 
 
 
 
13
  $link_track_me = 'prli_link_track_me';
14
- $link_prefix = 'prli_link_prefix';
15
  $link_nofollow = 'prli_link_nofollow';
16
  $link_redirect_type = 'prli_link_redirect_type';
17
  $hidden_field_name = 'prli_update_options';
18
 
19
- $update_message = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  // See if the user has posted us some information
22
  // If they did, this hidden field will be set to 'Y'
23
- if( isset($_REQUEST[ $hidden_field_name ]) and $_REQUEST[ $hidden_field_name ] == 'Y' )
24
  {
25
  // Validate This
26
- if( !empty($_POST[ $prli_exclude_ips ]) and !preg_match( "#^[ \t]*((\d{1,3}|\*)\.(\d{1,3}|\*)\.(\d{1,3}|\*)\.(\d{1,3}|\*)|([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*))([ \t]*,[ \t]*((\d{1,3}|\*)\.(\d{1,3}|\*)\.(\d{1,3}|\*)\.(\d{1,3}|\*)|([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*)))*$#", $_POST[ $prli_exclude_ips ] ) )
27
- $errors[] = "Excluded IP Addresses must be a comma separated list of IPv4 or IPv6 addresses or ranges.";
28
 
29
- if( !empty($_POST[ $whitelist_ips ]) and !preg_match( "#^[ \t]*((\d{1,3}|\*)\.(\d{1,3}|\*)\.(\d{1,3}|\*)\.(\d{1,3}|\*)|([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*))([ \t]*,[ \t]*((\d{1,3}|\*)\.(\d{1,3}|\*)\.(\d{1,3}|\*)\.(\d{1,3}|\*)|([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*):([0-9a-fA-F]{1,4}|\*)))*$#", $_POST[ $whitelist_ips ] ) )
30
- $errors[] = "Whitlist IP Addresses must be a comma separated list of IPv4 or IPv6 addresses or ranges.";
31
 
32
- $errors = apply_filters('prli-validate-options',$errors);
 
33
 
34
- // Read their posted value
35
- $prli_options->prli_exclude_ips = stripslashes($_POST[ $prli_exclude_ips ]);
36
- $prli_options->whitelist_ips = stripslashes($_POST[ $whitelist_ips ]);
37
- $prli_options->filter_robots = (int)isset($_POST[ $filter_robots ]);
38
- $prli_options->extended_tracking = stripslashes($_POST[ $extended_tracking ]);
39
- $prli_options->link_track_me = (int)isset($_POST[ $link_track_me ]);
40
- $prli_options->link_prefix = (int)isset($_POST[ $link_prefix ]);
41
- $prli_options->link_nofollow = (int)isset($_POST[ $link_nofollow ]);
42
- $prli_options->link_redirect_type = $_POST[ $link_redirect_type ];
 
 
 
 
 
 
 
 
 
 
 
43
 
44
- do_action('prli-store-options');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
  if( count($errors) > 0 )
 
47
  require(PRLI_VIEWS_PATH.'/shared/errors.php');
 
48
  else
49
  {
50
  // Save the posted value in the database
51
- update_option( 'prli_options', $prli_options );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
 
53
  // Put an options updated message on the screen
 
54
 
55
- $update_message = __('Options saved.');
 
56
  }
57
  }
58
- else if(isset($_REQUEST['action']) and $_REQUEST['action'] == 'clear_all_clicks')
59
  {
60
  $prli_click->clearAllClicks();
61
-
62
- $update_message = __('Hit Database was Cleared.');
63
- }
64
- else if(isset($_REQUEST['action']) and $_REQUEST['action'] == 'clear_30day_clicks')
65
- {
66
- $num_clicks = $prli_click->clear_clicks_by_age_in_days(30);
67
-
68
- if($num_clicks)
69
- $update_message = __("Hits older than 30 days ({$num_clicks} Hits) were deleted" );
70
- else
71
- $update_message = __("No hits older than 30 days were found, so nothing was deleted" );
72
- }
73
- else if(isset($_REQUEST['action']) and $_REQUEST['action'] == 'clear_90day_clicks')
74
- {
75
- $num_clicks = $prli_click->clear_clicks_by_age_in_days(90);
76
-
77
- if($num_clicks)
78
- $update_message = __("Hits older than 90 days ({$num_clicks} Hits) were deleted" );
79
- else
80
- $update_message = __("No hits older than 90 days were found, so nothing was deleted" );
81
- }
82
-
83
- if($update_message)
84
- {
85
  ?>
86
- <div class="updated"><p><strong><?php echo $update_message; ?></strong></p></div>
 
87
  <?php
88
  }
89
 
6
 
7
  // variables for the field and option names
8
  $prli_exclude_ips = 'prli_exclude_ips';
9
+ $prettybar_image_url = 'prli_prettybar_image_url';
10
+ $prettybar_background_image_url = 'prli_prettybar_background_image_url';
11
+ $prettybar_color = 'prli_prettybar_color';
12
+ $prettybar_text_color = 'prli_prettybar_text_color';
13
+ $prettybar_link_color = 'prli_prettybar_link_color';
14
+ $prettybar_hover_color = 'prli_prettybar_hover_color';
15
+ $prettybar_visited_color = 'prli_prettybar_visited_color';
16
+ $prettybar_show_title = 'prli_prettybar_show_title';
17
+ $prettybar_show_description = 'prli_prettybar_show_description';
18
+ $prettybar_show_share_links = 'prli_prettybar_show_share_links';
19
+ $prettybar_show_target_url_link = 'prli_prettybar_show_target_url_link';
20
+ $prettybar_title_limit = 'prli_prettybar_title_limit';
21
+ $prettybar_desc_limit = 'prli_prettybar_desc_limit';
22
+ $prettybar_link_limit = 'prli_prettybar_link_limit';
23
+ $link_show_prettybar = 'prli_link_show_prettybar';
24
+ $link_ultra_cloak = 'prli_link_ultra_cloak';
25
  $link_track_me = 'prli_link_track_me';
26
+ $link_track_as_pixel = 'prli_link_track_as_pixel';
27
  $link_nofollow = 'prli_link_nofollow';
28
  $link_redirect_type = 'prli_link_redirect_type';
29
  $hidden_field_name = 'prli_update_options';
30
 
31
+ $prli_domain = "pretty-link";
32
+
33
+ // Read in existing option value from database
34
+ $prli_exclude_ips_val = get_option( $prli_exclude_ips );
35
+ $prettybar_image_url_val = get_option( $prettybar_image_url );
36
+ $prettybar_background_image_url_val = get_option( $prettybar_background_image_url );
37
+ $prettybar_color_val = get_option( $prettybar_color );
38
+ $prettybar_text_color_val = get_option( $prettybar_text_color );
39
+ $prettybar_link_color_val = get_option( $prettybar_link_color );
40
+ $prettybar_hover_color_val = get_option( $prettybar_hover_color );
41
+ $prettybar_visited_color_val = get_option( $prettybar_visited_color );
42
+ $prettybar_show_title_val = get_option( $prettybar_show_title );
43
+ $prettybar_show_description_val = get_option( $prettybar_show_description );
44
+ $prettybar_show_share_links_val = get_option( $prettybar_show_share_links );
45
+ $prettybar_show_target_url_link_val = get_option( $prettybar_show_target_url_link );
46
+ $prettybar_title_limit_val = get_option( $prettybar_title_limit );
47
+ $prettybar_desc_limit_val = get_option( $prettybar_desc_limit );
48
+ $prettybar_link_limit_val = get_option( $prettybar_link_limit );
49
+ $link_show_prettybar_val = get_option( $link_show_prettybar );
50
+ $link_ultra_cloak_val = get_option( $link_ultra_cloak );
51
+ $link_track_me_val = get_option( $link_track_me );
52
+ $link_track_as_pixel_val = get_option( $link_track_as_pixel );
53
+ $link_nofollow_val = get_option( $link_nofollow );
54
+ $link_redirect_type_val = get_option( $link_redirect_type );
55
 
56
  // See if the user has posted us some information
57
  // If they did, this hidden field will be set to 'Y'
58
+ if( $_POST[ $hidden_field_name ] == 'Y' )
59
  {
60
  // Validate This
61
+ if( !empty($_POST[$prettybar_image_url]) and !preg_match('/^http.?:\/\/.*\..*$/', $_POST[$prettybar_image_url] ) )
62
+ $errors[] = "Logo Image URL must be a correctly formatted URL";
63
 
64
+ if( !empty($_POST[$prettybar_background_image_url]) and !preg_match('/^http.?:\/\/.*\..*$/', $_POST[$prettybar_background_image_url] ) )
65
+ $errors[] = "Background Image URL must be a correctly formatted URL";
66
 
67
+ if( !empty($_POST[ $prli_exclude_ips ]) and !preg_match( "#^[ \t]*(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})([ \t]*,[ \t]*\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})*$#", $_POST[ $prli_exclude_ips ] ) )
68
+ $errors[] = "Must be a comma separated list of IP addresses.";
69
 
70
+ if( !empty($_POST[ $prettybar_color ]) and !preg_match( "#^[0-9a-fA-F]{6}$#", $_POST[ $prettybar_color ] ) )
71
+ $errors[] = "PrettyBar Background Color must be an actual RGB Value";
72
+
73
+ if( !empty($_POST[ $prettybar_text_color ]) and !preg_match( "#^[0-9a-fA-F]{6}$#", $_POST[ $prettybar_text_color ] ) )
74
+ $errors[] = "PrettyBar Text Color must be an actual RGB Value";
75
+
76
+ if( !empty($_POST[ $prettybar_link_color ]) and !preg_match( "#^[0-9a-fA-F]{6}$#", $_POST[ $prettybar_link_color ] ) )
77
+ $errors[] = "PrettyBar Link Color must be an actual RGB Value";
78
+
79
+ if( !empty($_POST[ $prettybar_hover_color ]) and !preg_match( "#^[0-9a-fA-F]{6}$#", $_POST[ $prettybar_hover_color ] ) )
80
+ $errors[] = "PrettyBar Hover Color must be an actual RGB Value";
81
+
82
+ if( !empty($_POST[ $prettybar_visited_color ]) and !preg_match( "#^[0-9a-fA-F]{6}$#", $_POST[ $prettybar_visited_color ] ) )
83
+ $errors[] = "PrettyBar Hover Color must be an actual RGB Value";
84
+
85
+ if( empty($_POST[ $prettybar_title_limit ]) )
86
+ $errors[] = "PrettyBar Title Character Limit must not be blank";
87
+
88
+ if( empty($_POST[ $prettybar_desc_limit ]) )
89
+ $errors[] = "PrettyBar Description Character Limit must not be blank";
90
 
91
+ if( empty($_POST[ $prettybar_link_limit ]) )
92
+ $errors[] = "PrettyBar Link Character Limit must not be blank";
93
+
94
+ if( !empty($_POST[ $prettybar_title_limit ]) and !preg_match( "#^[0-9]*$#", $_POST[ $prettybar_title_limit ] ) )
95
+ $errors[] = "PrettyBar Title Character Limit must be a number";
96
+
97
+ if( !empty($_POST[ $prettybar_desc_limit ]) and !preg_match( "#^[0-9]*$#", $_POST[ $prettybar_desc_limit ] ) )
98
+ $errors[] = "PrettyBar Description Character Limit must be a number";
99
+
100
+ if( !empty($_POST[ $prettybar_link_limit ]) and !preg_match( "#^[0-9]*$#", $_POST[ $prettybar_link_limit ] ) )
101
+ $errors[] = "PrettyBar Link Character Limit must be a number";
102
+
103
+ // Read their posted value
104
+ $prli_exclude_ips_val = stripslashes($_POST[ $prli_exclude_ips ]);
105
+ $prettybar_image_url_val = stripslashes($_POST[ $prettybar_image_url ]);
106
+ $prettybar_background_image_url_val = stripslashes($_POST[ $prettybar_background_image_url ]);
107
+ $prettybar_color_val = stripslashes($_POST[ $prettybar_color ]);
108
+ $prettybar_text_color_val = stripslashes($_POST[ $prettybar_text_color ]);
109
+ $prettybar_link_color_val = stripslashes($_POST[ $prettybar_link_color ]);
110
+ $prettybar_hover_color_val = stripslashes($_POST[ $prettybar_hover_color ]);
111
+ $prettybar_visited_color_val = stripslashes($_POST[ $prettybar_visited_color ]);
112
+ $prettybar_show_title_val = (int)isset($_POST[ $prettybar_show_title ]);
113
+ $prettybar_show_description_val = (int)isset($_POST[ $prettybar_show_description ]);
114
+ $prettybar_show_share_links_val = (int)isset($_POST[ $prettybar_show_share_links ]);
115
+ $prettybar_show_target_url_link_val = (int)isset($_POST[ $prettybar_show_target_url_link ]);
116
+ $prettybar_title_limit_val = stripslashes($_POST[ $prettybar_title_limit ]);
117
+ $prettybar_desc_limit_val = stripslashes($_POST[ $prettybar_desc_limit ]);
118
+ $prettybar_link_limit_val = stripslashes($_POST[ $prettybar_link_limit ]);
119
+ $link_show_prettybar_val = (int)isset($_POST[ $link_show_prettybar ]);
120
+ $link_ultra_cloak_val = (int)isset($_POST[ $link_ultra_cloak ]);
121
+ $link_track_me_val = (int)isset($_POST[ $link_track_me ]);
122
+ $link_track_as_pixel_val = (int)isset($_POST[ $link_track_as_pixel ]);
123
+ $link_nofollow_val = (int)isset($_POST[ $link_nofollow ]);
124
+ $link_redirect_type_val = $_POST[ $link_redirect_type ];
125
 
126
  if( count($errors) > 0 )
127
+ {
128
  require(PRLI_VIEWS_PATH.'/shared/errors.php');
129
+ }
130
  else
131
  {
132
  // Save the posted value in the database
133
+ update_option( $prli_exclude_ips, $prli_exclude_ips_val );
134
+ update_option( $prettybar_image_url, $prettybar_image_url_val );
135
+ update_option( $prettybar_background_image_url, $prettybar_background_image_url_val );
136
+ update_option( $prettybar_color, $prettybar_color_val );
137
+ update_option( $prettybar_text_color, $prettybar_text_color_val );
138
+ update_option( $prettybar_link_color, $prettybar_link_color_val );
139
+ update_option( $prettybar_hover_color, $prettybar_hover_color_val );
140
+ update_option( $prettybar_visited_color, $prettybar_visited_color_val );
141
+ update_option( $prettybar_show_title, $prettybar_show_title_val );
142
+ update_option( $prettybar_show_description, $prettybar_show_description_val );
143
+ update_option( $prettybar_show_share_links, $prettybar_show_share_links_val );
144
+ update_option( $prettybar_show_target_url_link, $prettybar_show_target_url_link_val );
145
+ update_option( $prettybar_title_limit, $prettybar_title_limit_val );
146
+ update_option( $prettybar_desc_limit, $prettybar_desc_limit_val );
147
+ update_option( $prettybar_link_limit, $prettybar_link_limit_val );
148
+ update_option( $link_show_prettybar, $link_show_prettybar_val );
149
+ update_option( $link_ultra_cloak, $link_ultra_cloak_val );
150
+ update_option( $link_track_me, $link_track_me_val );
151
+ update_option( $link_track_as_pixel, $link_track_as_pixel_val );
152
+ update_option( $link_nofollow, $link_nofollow_val );
153
+ update_option( $link_redirect_type, $link_redirect_type_val );
154
 
155
  // Put an options updated message on the screen
156
+ ?>
157
 
158
+ <div class="updated"><p><strong><?php _e('Options saved.', $prli_domain ); ?></strong></p></div>
159
+ <?php
160
  }
161
  }
162
+ else if($_GET['action'] == 'clear_all_clicks4134' or $_POST['action'] == 'clear_all_clicks4134')
163
  {
164
  $prli_click->clearAllClicks();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  ?>
166
+
167
+ <div class="updated"><p><strong><?php _e('Hit Database Was Cleared.', $prli_domain ); ?></strong></p></div>
168
  <?php
169
  }
170
 
prli-pro-settings.php CHANGED
@@ -9,26 +9,69 @@ $prlipro_username = 'prlipro_username';
9
  $prlipro_password = 'prlipro_password';
10
  $hidden_field_name = 'prli_update_options';
11
 
 
 
12
  // Read in existing option value from database
13
  $prlipro_username_val = get_option( $prlipro_username );
14
  $prlipro_password_val = get_option( $prlipro_password );
15
 
16
  if($_GET['action'] == 'force-pro-reinstall')
17
  {
18
- // Queue the update and auto upgrade
19
- $prli_update->queue_update(true);
20
- $reinstall_url = wp_nonce_url('update.php?action=upgrade-plugin&plugin=pretty-link/pretty-link.php', 'upgrade-plugin_pretty-link/pretty-link.php');
21
- ?>
22
- <div class="updated"><p><strong><?php printf(__('You\'re almost done!<br/>%1$sFinish your Re-Install of Pretty Link Pro%2$s'), '<a href="'.$reinstall_url.'">', '</a>'); ?></strong></p></div>
23
- <?php
24
  }
25
  if($_GET['action'] == 'pro-uninstall')
26
  {
27
  $prli_utils->uninstall_pro();
28
  ?>
29
 
30
- <div class="updated"><p><strong><?php _e('Pretty Link Pro Successfully Uninstalled.' ); ?></strong></p></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  <?php
 
 
32
  }
33
 
34
  require_once 'classes/views/prli-options/pro-settings.php';
9
  $prlipro_password = 'prlipro_password';
10
  $hidden_field_name = 'prli_update_options';
11
 
12
+ $prli_domain = "pretty-link";
13
+
14
  // Read in existing option value from database
15
  $prlipro_username_val = get_option( $prlipro_username );
16
  $prlipro_password_val = get_option( $prlipro_password );
17
 
18
  if($_GET['action'] == 'force-pro-reinstall')
19
  {
20
+ $prli_utils->download_and_install_pro($prlipro_username_val, $prlipro_password_val, true);
21
+ ?>
22
+
23
+ <div class="updated"><p><strong><?php _e('Pretty Link Pro Successfully Reinstalled.', $prli_domain ); ?></strong></p></div>
24
+ <?php
 
25
  }
26
  if($_GET['action'] == 'pro-uninstall')
27
  {
28
  $prli_utils->uninstall_pro();
29
  ?>
30
 
31
+ <div class="updated"><p><strong><?php _e('Pretty Link Pro Successfully Uninstalled.', $prli_domain ); ?></strong></p></div>
32
+ <?php
33
+ }
34
+ else
35
+ {
36
+ // See if the user has posted us some information
37
+ // If they did, this hidden field will be set to 'Y'
38
+ if( $_POST[ $hidden_field_name ] == 'Y' )
39
+ {
40
+ // Validate This
41
+ // This is where the remote username / password will be validated
42
+ //if( !empty($_POST[$prettybar_image_url]) and !preg_match('/^http.?:\/\/.*\..*$/', $_POST[$prettybar_image_url] ) )
43
+ // $errors[] = "Logo Image URL must be a correctly formatted URL";
44
+
45
+ // Read their posted value
46
+ $prlipro_username_val = stripslashes($_POST[ $prlipro_username ]);
47
+ $prlipro_password_val = stripslashes($_POST[ $prlipro_password ]);
48
+
49
+ $user_type = $prli_utils->get_pro_user_type($prlipro_username_val, $prlipro_password_val);
50
+ if(empty($user_type))
51
+ $errors[] = "Your user account couldn't be validated...";
52
+
53
+
54
+ if( count($errors) > 0 )
55
+ {
56
+ require(PRLI_VIEWS_PATH.'/shared/errors.php');
57
+ }
58
+ else
59
+ {
60
+ // TODO: Download & Install Pretty Link Pro if Account is valid and software isn't currently installed
61
+ // Save the posted value in the database
62
+ update_option( $prlipro_username, $prlipro_username_val );
63
+ update_option( $prlipro_password, $prlipro_password_val );
64
+
65
+ // Put an options updated message on the screen
66
+ $message = $prli_utils->download_and_install_pro($prlipro_username_val, $prlipro_password_val);
67
+
68
+ $message = (($message == 'SUCCESS')?'Pretty Link Pro has been installed click here to get started: <a href="?page=pretty-link/pro/prlipro-options.php">Pretty Link Pro Options</a>':$message);
69
+ ?>
70
+
71
+ <div class="updated"><p><strong><?php _e($message, $prli_domain ); ?></strong></p></div>
72
  <?php
73
+ }
74
+ }
75
  }
76
 
77
  require_once 'classes/views/prli-options/pro-settings.php';
prli-xmlrpc.php CHANGED
@@ -53,6 +53,14 @@ function prli_xmlrpc_api_version($args)
53
  * If this value isn't set then the link will not be
54
  * placed in a group.
55
  *
 
 
 
 
 
 
 
 
56
  * @param boolean $link_track_me Optional, If true the link will be tracked,
57
  * if not set the default value (from the pretty
58
  * link option page) will be used
@@ -100,20 +108,26 @@ function prli_xmlrpc_create_pretty_link( $args )
100
  $name = (isset($args[4])?$args[4]:'');
101
  $description = (isset($args[5])?$args[5]:'');
102
  $group_id = (isset($args[6])?$args[6]:'');
103
- $track_me = (isset($args[7])?$args[7]:'');
104
- $nofollow = (isset($args[8])?$args[8]:'');
105
- $redirect_type = (isset($args[9])?$args[9]:'');
106
- $param_forwarding = (isset($args[10])?$args[10]:'off');
107
- $param_struct = (isset($args[11])?$args[11]:'');
 
 
 
108
 
109
  if( $link = prli_create_pretty_link( $target_url,
110
  $slug,
111
  $name,
112
  $description,
113
  $group_id,
 
 
114
  $track_me,
115
  $nofollow,
116
  $redirect_type,
 
117
  $param_forwarding,
118
  $param_struct ) )
119
  return $link;
@@ -148,11 +162,14 @@ function prli_xmlrpc_update_pretty_link( $args )
148
  $name = (isset($args[5])?$args[5]:'');
149
  $description = (isset($args[6])?$args[6]:'');
150
  $group_id = (isset($args[7])?$args[7]:'');
151
- $track_me = (isset($args[8])?$args[8]:'');
152
- $nofollow = (isset($args[9])?$args[9]:'');
153
- $redirect_type = (isset($args[10])?$args[10]:'');
154
- $param_forwarding = (isset($args[11])?$args[11]:'');
155
- $param_struct = (isset($args[12])?$args[12]:'');
 
 
 
156
 
157
  if( $link = prli_update_pretty_link( $id,
158
  $target_url,
@@ -160,9 +177,12 @@ function prli_xmlrpc_update_pretty_link( $args )
160
  $name,
161
  $description,
162
  $group_id,
 
 
163
  $track_me,
164
  $nofollow,
165
  $redirect_type,
 
166
  $param_forwarding,
167
  $param_struct ) )
168
  return $link;
53
  * If this value isn't set then the link will not be
54
  * placed in a group.
55
  *
56
+ * @param boolean $show_prettybar Optional, If true the prettybar will be shown,
57
+ * if not set the default value (from the pretty
58
+ * link option page) will be used
59
+ *
60
+ * @param boolean $ultra_cloak Optional, If true then the link will be ultra-cloaked,
61
+ * if not set the default value (from the pretty link
62
+ * option page) will be used
63
+ *
64
  * @param boolean $link_track_me Optional, If true the link will be tracked,
65
  * if not set the default value (from the pretty
66
  * link option page) will be used
108
  $name = (isset($args[4])?$args[4]:'');
109
  $description = (isset($args[5])?$args[5]:'');
110
  $group_id = (isset($args[6])?$args[6]:'');
111
+ $show_prettybar = (isset($args[7])?$args[7]:'');
112
+ $ultra_cloak = (isset($args[8])?$args[8]:'');
113
+ $track_me = (isset($args[9])?$args[9]:'');
114
+ $nofollow = (isset($args[10])?$args[10]:'');
115
+ $redirect_type = (isset($args[11])?$args[11]:'');
116
+ $track_as_img = (isset($args[12])?$args[12]:'');
117
+ $param_forwarding = (isset($args[13])?$args[13]:'off');
118
+ $param_struct = (isset($args[14])?$args[14]:'');
119
 
120
  if( $link = prli_create_pretty_link( $target_url,
121
  $slug,
122
  $name,
123
  $description,
124
  $group_id,
125
+ $show_prettybar,
126
+ $ultra_cloak,
127
  $track_me,
128
  $nofollow,
129
  $redirect_type,
130
+ $track_as_img,
131
  $param_forwarding,
132
  $param_struct ) )
133
  return $link;
162
  $name = (isset($args[5])?$args[5]:'');
163
  $description = (isset($args[6])?$args[6]:'');
164
  $group_id = (isset($args[7])?$args[7]:'');
165
+ $show_prettybar = (isset($args[8])?$args[8]:'');
166
+ $ultra_cloak = (isset($args[9])?$args[9]:'');
167
+ $track_me = (isset($args[10])?$args[10]:'');
168
+ $nofollow = (isset($args[11])?$args[11]:'');
169
+ $redirect_type = (isset($args[12])?$args[12]:'');
170
+ $track_as_img = (isset($args[13])?$args[13]:'');
171
+ $param_forwarding = (isset($args[14])?$args[14]:'');
172
+ $param_struct = (isset($args[15])?$args[15]:'');
173
 
174
  if( $link = prli_update_pretty_link( $id,
175
  $target_url,
177
  $name,
178
  $description,
179
  $group_id,
180
+ $show_prettybar,
181
+ $ultra_cloak,
182
  $track_me,
183
  $nofollow,
184
  $redirect_type,
185
+ $track_as_img,
186
  $param_forwarding,
187
  $param_struct ) )
188
  return $link;
readme.txt CHANGED
@@ -1,44 +1,44 @@
1
- === Pretty Link Lite ===
2
  Contributors: supercleanse
3
- Donate link: http://prettylinkpro.com
4
- Tags: links, link, url, urls, affiliate, affiliates, pretty, marketing, redirect, forward, plugin, twitter, tweet, rewrite, shorturl, hoplink, hop, shortlink, short, shorten, click, clicks, track, tracking, tiny, tinyurl, budurl, shrinking, domain, shrink, mask, masking, cloak, cloaking, slug, slugs, admin, administration, stats, statistics, stat, statistic, email, ajax, javascript, ui, csv, download, page, post, pages, posts, shortcode, seo, automation, widget, widgets, dashboard
5
- Requires at least: 2.9
6
- Tested up to: 3.1
7
- Stable tag: 1.4.56
8
 
9
  Shrink, track and share any URL on the Internet from your WordPress website. Create short links suitable for Twitter using your own domain name!
10
 
11
  == Description ==
12
 
13
- Shrink, track and share any URL on the Internet from your WordPress website. Create short links suitable for Twitter using your own domain name!
14
 
15
- = Upgrade to Pretty Link Pro =
16
 
17
- Pretty Link Pro is an upgrade to Pretty Link that adds the capability to automate your pretty link creation, cloak links, auto-tweet them, replace keywords thoughout your blog and much more. You can learn more about it here:
18
 
19
  http://prettylinkpro.com
20
 
21
- = Detail =
22
-
23
- Pretty Link enables you to shorten links using your own domain name (as opposed to using tinyurl.com, bit.ly, or any other link shrinking service)! In addition to creating clean links, Pretty Link tracks each hit on your URL and provides a full, detailed report of where the hit came from, the browser, os and host. Pretty Link is a killer plugin for people who want to clean up their affiliate links, track clicks from emails, their links on Twitter to come from their own domain, or generally increase the reach of their website by spreading these links on forums or comments on other blogs.
24
-
25
  = Examples =
26
 
27
  This is a link setup using Pretty Link that redirects to the Pretty Link Homepage where you can find more info about this Plugin:
28
 
29
  http://blairwilliams.com/pl
30
 
31
- Here's a named Pretty Link (I used the slug 'aweber') that does a 307 redirect to my affiliate link for aweber.com:
32
 
33
- http://blairwilliams.com/aweber
34
 
35
  Here's a link that Pretty Link generated a random slug for (similar to how bit.ly or tinyurl would do):
36
 
37
  http://blairwilliams.com/w7a
38
 
 
 
 
 
39
  = Features =
40
 
41
- * Gives you the ability to create clean, simple URLs on your website that redirect to any other URL (allows for 301 and 307 redirects only)
42
  * Generates random 2-3 character slugs for your URL or allows you to name a custom slug for your URL
43
  * Tracks the Number of Hits per link
44
  * Tracks the Number of Unique Hits per link
@@ -47,6 +47,8 @@ http://blairwilliams.com/w7a
47
  * Download hit details in CSV format
48
  * Intuitive Javascript / AJAX Admin User Interface
49
  * Pass custom parameters to your scripts through pretty link and still have full tracking ability
 
 
50
  * Exclude IP Addresses from Stats
51
  * Enables you to post your Pretty Links to Twitter directly from your WordPress admin
52
  * Enables you to send your Pretty Links via Email directly from your WordPress admin
@@ -55,7 +57,24 @@ http://blairwilliams.com/w7a
55
  * Organize Links into Groups
56
  * Create nofollow/noindex links
57
  * Turn tracking on / off on each link
58
- * Pretty Link Bookmarklet
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
 
60
  == Installation ==
61
 
@@ -65,266 +84,17 @@ http://blairwilliams.com/w7a
65
 
66
  3. Make sure you have changed your permalink Common Settings in Settings -> Permalinks away from "Default" to something else. I prefer using custom and then "/%postname%/" for the simplest possible URL slugs.
67
 
68
- == Changelog ==
69
-
70
- = 1.4.56 =
71
- * Updated to be fully compatible with WordPress 3.1 and WordPress MultiSite for all users
72
- * Fixed link rotation issue (weights not sticking) for Pro Users
73
- * Fixed auto link creation issue with the group not being set properly for Pro Users
74
- * Fixed the slug available routine for all users
75
- * Fixed the delete hits issue with simple click counting for all users
76
- * Fixed some keyword replacement deletion issues for pro users
77
-
78
- = 1.4.55 =
79
- * Fixed the CSV export issues
80
- * Moved all Pretty Link images to Amazon CloudFront
81
- * Added TweetDeck & Twitter for iPhone support for Pro Users
82
-
83
- = 1.4.53 =
84
- * Added the ability to change the pretty link tracking mode to simple, normal and extended
85
- * Fixed numerous debug issues
86
- * Fixed memory_limit issue in pretty link
87
- * Fixed pretty bar issue affecting pro users
88
-
89
- = 1.4.52 =
90
- * Fixed bugs related to the cloaking and pretty bar redirection changes
91
-
92
- = 1.4.51 =
93
- * Removed cloaking & pretty bar redirection to comply with wordpress.org policy requirements
94
-
95
- = 1.4.50 =
96
- * Updated to use the Twitter oAuth authentication protocol
97
- * Updated the tweetbadge to use the new Twitter Tweet Button
98
-
99
- = 1.4.49 =
100
- * Fixed Keyword Caching Issue for Pro Users
101
- * Fixed recording duplicate tweet issue for Pro Users
102
-
103
- = 1.4.48 =
104
- * Fixed a performance issue in Pretty Link affecting some users when viewing their dashboard
105
- * Fixed the custom menu auto-tweet issue affecting some Pretty Link Pro users
106
-
107
- = 1.4.47 =
108
- * Updated code for WP 3.0
109
- * Fixed tweetbadge indexing issue
110
- * Added an underscore to postmeta values
111
-
112
- = 1.4.46 =
113
- * Fixed a subdirectory redirection issue
114
-
115
- = 1.4.45 =
116
- * Refactored and Options code
117
- * Pro: Refactored Update code to work with the upcoming WordPress 3.0
118
- * Pro: Tweet Badge now loads asynchronously in an iFrame to prevent performance issues when updating multiple tweet badges simultaneously.
119
- * Pro: Enabled limit on number of keyword replacements to occur per page load
120
- * Pro: Cleaned up options code
121
- * Pro: Added keyword replacement to comments and feeds and an option to make all links into pretty links automatically.
122
-
123
- = 1.4.44 =
124
- * Fixed the phantom postmeta issue
125
-
126
- = 1.4.43 =
127
- * Added an enhanced CSV Hit Reports...
128
- * Added CSV IP History reports... (the history of each visitor by IP address)
129
- * Added CSV IP Origin reports... (the first time we see each visitor click a Pretty Link)
130
- * Separating CSV Reports into blocks of 5000 rows each ... this will help with performance in a major way and prevent locking ...
131
- * Added an option to use a prefixed element from your permalink structure (this is necessary for users who need an index.php as part of their permalink structure)
132
- * Fixed the pretty link nesting issue so larger slugs are matched first enabling users to create folder structures more efficiently
133
- * The Link Description is now showing up as the meta description for Pretty Bar'd and Cloaked Pretty Links
134
- * Altered Tweet badge so it shows up as an image which will help it stay consistent across sites and won't ever mess up the excerpts ever again
135
- * Cleaned up the front facing CSS for the tweet badge, social buttons and twitter comments
136
- * Checked the [tweetbadge] shortcode and the_tweetbadge() template tag and verified that they are working properly...
137
- * Fixed saving posts / pages issue... Now pages are saved & auto tweeted (if the option is set)...
138
-
139
- = 1.4.42 =
140
- * Fixed more pretty link path issues to easily handle pre-slug elements in custom permalink structures
141
- * Optimized php code executed in pretty link tracking
142
- * Replaced fsockopen with curl for validating urls and grabbing the target url title
143
-
144
- = 1.4.41 =
145
- * Fixed pretty link path issue
146
-
147
- = 1.4.40 =
148
- * Added support for Pre-Slug URL elements -- this will be helpful for those users who don't have rewrite working fully
149
- * Additional, unnecessary postmeta fields not being created anymore for pro users
150
- * Fixed auto pretty link creation and auto twitter posting on scheduled and xml-rpc post for pro users
151
- * Fixed twitter badge count issue -- it was reporting incorrect tweet results for some pro users on some posts
152
- * Added Option to show tweet badge and/or social buttons in the RSS Feed
153
-
154
- = 1.4.39 =
155
- * Fixed browsecap integration for users on PHP 5.3 or higher
156
- * Added new browsecap file to include android based phones in hit results
157
- * Fixed form submission issues affecting a small number of users
158
- * Fixed a pro update bug affecting some users
159
- * Fixed a bug affecting pro users more tag and keyword replacement
160
-
161
- = 1.4.38 =
162
- * Fixed some update and validation bugs affecting a small number of users
163
-
164
- = 1.4.36 =
165
- * Fixed pro export issue
166
- * Fixed html within shortcodes in keyword replacement issues for pro users
167
- * Fixed XHTML validation for pro users using keyword replacement
168
- * Added an email button to the social bar for pro users
169
- * Fixed update code for pro users to not display false update message
170
- * Fixed url utilities port configuration for all users
171
- * Fixed url validation issue for all users
172
-
173
- = 1.4.35 =
174
- * Made significant changes to the Pretty Link Pro update routines
175
- * Fixed several bugs with remote url reading
176
-
177
- = 1.4.34 =
178
- * Fixed a redirection issue for all users
179
-
180
- = 1.4.33 =
181
- * Added more support options for all users
182
- * Updated install
183
- * Added exclude tweet badge/comments & social media buttons for specific pages & posts to the page/post edit screen for pro users
184
-
185
- = 1.4.32 =
186
- * Optimized CSV download of hits
187
- * Optimized more SQL calls
188
- * Fixed keyword replacement bug on password protected posts for Pro Users
189
- * Fixed group issue on options page for Pro Users
190
-
191
- = 1.4.31 =
192
- * Fixed a bug in pretty link, pixel & cloaking redirection.
193
-
194
- = 1.4.30 =
195
- * Altered the where Pretty Links are redirected to put less burden on normal page loads
196
- * Optimized Group & Report SQL calls to be significantly faster
197
- * Added a shortcode & template tag for pro users to display their pretty links on pages & posts (the shortcode is [post-pretty-link] and the template tag is the_prettylink())
198
-
199
- = 1.4.29 =
200
- * Added some more support options
201
- * fixed some minor bugs in keyword replacement and pro options.
202
-
203
- = 1.4.28 =
204
- * Fixed a bug with link creation from the bookmarklet, post publishing and public link creation that was introduced in the last release
205
-
206
- = 1.4.27 =
207
- * Simplified SQL Calls and reduced the number of them that it takes to load a page
208
- * Modified tweets to be counted for each link -- even ones not associated with a post -- got rid of the url_alias feature
209
- * Streamlined database calls & fixed a bug in the api
210
- * Added the ability to tweet to multiple accounts...
211
- * Added tweetmeme count checking and added additional twitter account validation
212
-
213
- = 1.4.26 =
214
- * Fixed the html entity display issue for target urls
215
- * Reduced package size of Pretty Link for more reliable installation
216
- * Added Customizable Bookmarklet for Pro Users
217
-
218
- = 1.4.25 =
219
- * Fixed some bugs in the install
220
- * Added nofollows to links in the social bar & re-tweet badge
221
-
222
- = 1.4.23/24 =
223
- * Fixed an installation issue for PHP4 users
224
-
225
- = 1.4.22 =
226
- * Added known robot and unidentified browser filtering to Pretty Link stats
227
- * Added IP Address range definition to the Excluded IP address field
228
- * Fixed html formatting issue on the bookmarklet success page
229
- * Added the ability for Pro users to remove or alter the attribution link on the Pretty Bar
230
- * Added new shortcodes for Pro users to display the title, target url and social networking buttons for a newly created public pretty link
231
- * Enhanced the default success page for public link creation for pro users
232
- * Fixed the redirect-type not being set bug for pro users allowing public link creation
233
- * Fixed another php short-code bug affecting Pro users (thanks to Clay Loveless of KillerSoft for helping me with that one)
234
-
235
- = 1.4.21 =
236
- * Fixed UTF-8 issues
237
- * Enabled UTF-8 Pretty Link slugs
238
- * Enabled UTF-8 tweets for Pro users
239
- * Fixed several issues for users hosted on Windows
240
- * Added padding configuration to space the buttons on the social bar for Pro users
241
- * Fixed the html validation issues with the tweet badge and social buttons bar for Pro users
242
-
243
- = 1.4.20 =
244
- * Added IPv6 support for IP Address Exclusions
245
- * Added Twitter Comments post widget for Pro users
246
- * Added RSS feed support for the tweet badge for Pro users
247
-
248
- = 1.4.19 =
249
- * Fixed https image loading / path issue
250
- * Fixed bookmarklet javascript encoding issue
251
- * Fixed import / export issue for pro users
252
- * Added Hyves.nl and Sphinn to the social buttons bar
253
- * Added more placement options for the social buttons bar
254
- * Added a social buttons bar shortcode & template tag
255
-
256
- = 1.4.18 =
257
- * Added the Social Network Button Bar for Pro Users
258
-
259
- = 1.4.17 =
260
- * Fixed the php strict tags issue affecting some users
261
- * Fixed the click record issue affecting some IIS users
262
- * Added DOCTYPE line to Pretty Bar HTML
263
- * Elimitated Pro upgrade messages for Pro users
264
-
265
- = 1.4.16 =
266
- * Fixed PrliUrlUtils not found error affecting some users
267
- * Added instructions for installing the Pretty Link bookmarklet on the iPhone
268
- * Added a URL Alias feature to Pro to allow tweet counts to be aggregated and hence, more accurate
269
-
270
- = 1.4.15 =
271
- * Fixed the nested slug cookie issue.
272
-
273
- = 1.4.14 =
274
- * Fixed bookmarklet/fopen issue affecting some users
275
- * Fixed XML-RPC auto-tweeting of Posts
276
- * Fixed Scheduled auto-tweeting & link creation of Posts issue
277
- * Fixed bulk auto link creation issue
278
- * Added slug choice for your post
279
- * Added a twitter message formatting textarea on the post edit screen
280
-
281
- = 1.4.13 =
282
- * Fixed the option reset issue
283
-
284
- = 1.4.12 =
285
- * Added title detection
286
- * Added enhancements to the Pretty Link Bookmarklet
287
- * Added better support for IIS by redefining the fnmatch function if it isn't present
288
- * Changed the keyword replacement algorithm in Pro to replace links throughout the post when thresholds are set (instead of only linking to the top x keywords)
289
- * Fixed some issues surrounding keyword content caching in Pro
290
-
291
- == Upgrade Notice ==
292
-
293
- = 1.4.56 =
294
- * This release fixes several issues including full WordPress 3.1 and MultiSite compatibility. So everyone should upgrade to this release.
295
-
296
- = 1.4.55 =
297
- * Everyone should upgrade -- this fixes the CSV export issue with hits.
298
-
299
- = 1.4.53 =
300
- * Everyone should upgrade to this version. It fixes numerous bugs for all users -- including a memory_limit issue and some click tracking algorithm issues. In addition to the upgrade, users who have had performance issues with click tracking should also switch to simple click count tracking in "Pretty Link" -> "Options" -> "Reporting Options" ...
301
-
302
- = 1.4.52 =
303
- * Fixed bugs related to the cloaking and pretty bar redirection changes. This affected all Pretty Link users -- everyone should upgrade to this release.
304
-
305
- = 1.4.51 =
306
- * Removed cloaking & pretty bar redirection to comply with wordpress.org policy requirements
307
-
308
- = 1.4.50 =
309
- * If you are a pro user and use the twitter related features of Pretty Link Pro you need to update immediately -- non-pro users will be pretty much unchanged by this release
310
-
311
- = 1.4.49 =
312
- * Fixed some important bugs for pro users -- non-pro users will be pretty much unchanged by this release
313
-
314
- = 1.4.48 =
315
- Fixed some dashboard performance issues for Pretty Link users and a custom menu tweeting fix that was affecting some pro users.
316
 
317
- = 1.4.47 =
318
- Upgrade to make Pretty Link compatible with WordPress 3.0
319
 
320
- = 1.4.46 =
321
- If your wordpress website is in a subdirectory and you've had issues with your pretty links since the last release then this upgrade will fix it.
322
 
323
- = 1.4.45 =
324
- Bug fixes have been made in Pretty Link and several enhancements have been made it Pretty Link Pro.
325
 
326
- = 1.4.44 =
327
- All users -- especially pro users should upgrade to this new version -- it fixes the phantom postmeta issue
328
 
329
- = 1.4.43 =
330
- All users should upgrade to this new version -- several functional and performance related issues have been fixed for Pretty Link and Pretty Link Pro users.
1
+ === Pretty Link ===
2
  Contributors: supercleanse
3
+ Donate link: http://www.blairwilliams.com/pretty-link/donate/
4
+ Tags: links, link, url, urls, affiliate, affiliates, pretty, marketing, redirect, forward, plugin, twitter, tweet, rewrite, shorturl, hoplink, hop, shortlink, short, shorten, click, clicks, track, tracking, tiny, tinyurl, budurl, shrinking, domain, shrink, mask, masking, slug, slugs, admin, administration, stats, statistics, stat, statistic, cloaking, cloak, email, ajax, javascript, ui, csv, download, page, post, pro, professional, pages, posts, shortcode, seo, automation, keyword, replacement, replacements, widget, widgets, dashboard
5
+ Requires at least: 2.7.1
6
+ Tested up to: 2.8.3
7
+ Stable tag: 1.4.6
8
 
9
  Shrink, track and share any URL on the Internet from your WordPress website. Create short links suitable for Twitter using your own domain name!
10
 
11
  == Description ==
12
 
13
+ Shrink, track and share any URL on the Internet from your WordPress website. You can now shorten links using your own domain name (as opposed to using tinyurl.com, bit.ly, or any other link shrinking service)! In addition to creating clean links, Pretty Link tracks each hit on your URL and provides a full, detailed report of where the hit came from, the browser, os and host. Pretty Link is a killer plugin for people who want to mask their affiliate links, track clicks from emails, their links on Twitter to come from their own domain, or generally increase the reach of their website by spreading these links on forums or comments on other blogs.
14
 
15
+ = You can now get Pretty Link Pro - it's in Pre-Launch! =
16
 
17
+ Pretty Link Pro is an upgrade to Pretty Link that re-sets the bar for Link Management, Automation, Sharing and Tracking! You can learn more about it here:
18
 
19
  http://prettylinkpro.com
20
 
 
 
 
 
21
  = Examples =
22
 
23
  This is a link setup using Pretty Link that redirects to the Pretty Link Homepage where you can find more info about this Plugin:
24
 
25
  http://blairwilliams.com/pl
26
 
27
+ Here's a named Pretty Link (I used the slug 'thesis') that redirects to my affiliate link for diythemes.com -- only the best theme you can get for WordPress -- in my humble opinion :) :
28
 
29
+ http://blairwilliams.com/thesis
30
 
31
  Here's a link that Pretty Link generated a random slug for (similar to how bit.ly or tinyurl would do):
32
 
33
  http://blairwilliams.com/w7a
34
 
35
+ Here's a Pretty Link that uses the configurable Pretty Link PrettyBar:
36
+
37
+ http://blairwilliams.com/x0z
38
+
39
  = Features =
40
 
41
+ * Gives you the ability to create clean, simple URLs on your website that redirect to any other URL
42
  * Generates random 2-3 character slugs for your URL or allows you to name a custom slug for your URL
43
  * Tracks the Number of Hits per link
44
  * Tracks the Number of Unique Hits per link
47
  * Download hit details in CSV format
48
  * Intuitive Javascript / AJAX Admin User Interface
49
  * Pass custom parameters to your scripts through pretty link and still have full tracking ability
50
+ * Ability to rewrite these custom Parameters before forwarding to Target URL
51
+ * Setup Pretty Links as Tracking Pixels and track impressions
52
  * Exclude IP Addresses from Stats
53
  * Enables you to post your Pretty Links to Twitter directly from your WordPress admin
54
  * Enables you to send your Pretty Links via Email directly from your WordPress admin
57
  * Organize Links into Groups
58
  * Create nofollow/noindex links
59
  * Turn tracking on / off on each link
60
+ * Keep users on your site even when being redirected by using the PrettyBar which stays at the top of the page
61
+ * Ability to configure and skin the PrettyBar to mirror the look and feel of your site
62
+ * Hide the Target URL by loading it in a full-screen frame
63
+
64
+ = Pro Features =
65
+ You'll get the following additional features when you purchase Pretty Link Pro:
66
+
67
+ * Replace keywords throughout your blog with Pretty Links
68
+ * Replace URLs throughout your blog with Pretty Links
69
+ * Rotate up to 5 URLs from one Pretty Link
70
+ * Split Test these URL rotations for a Pretty Link
71
+ * Setup Conversion Reports
72
+ * Import / Export Pretty Links
73
+ * Automatically create Pretty Links for each Post / Page
74
+ * Automatically Tweet each Post / Page when it is Published
75
+ * Display a Tweet Badge on Pages and / or Posts that contains the number of tweets that this page has received
76
+ * Display a Re-Tweet button on every Page and / or Post that incorporates your twitter handle & Pretty Link into the ReTweet
77
+ * Lifetime Updates
78
 
79
  == Installation ==
80
 
84
 
85
  3. Make sure you have changed your permalink Common Settings in Settings -> Permalinks away from "Default" to something else. I prefer using custom and then "/%postname%/" for the simplest possible URL slugs.
86
 
87
+ = Release Notes =
88
+ [Pretty Link Change Log](http://blairwilliams.com/pretty-link/change-log "Pretty link Change Log")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
 
90
+ == Frequently Asked Questions ==
91
+ [Pretty Link FAQ](http://blairwilliams.com/pretty-link/pretty-link-faq "Pretty link FAQ")
92
 
93
+ = Developers =
94
+ [Pretty Link API](http://blairwilliams.com/pretty-link/api/ "Pretty link API")
95
 
 
 
96
 
97
+ == Screenshots ==
98
+ [Pretty Link Screenshots](http://blairwilliams.com/pretty-link "Pretty link Screenshots")
99
 
100
+ [Pretty Link Pro Screenshots](http://prettylinkpro.com "Pretty link Pro Screenshots")
 
{classes → trunk/classes}/controllers/PrliAppController.php RENAMED
@@ -67,7 +67,7 @@ class PrliAppController
67
 
68
  if( $upgrade_db ) {
69
  prli_install();
70
- wp_redirect("{$prli_blogurl}/wp-admin/admin.php?page=pretty-link/prli-links.php&message=" . urlencode(__('Your Database Has Been Successfully Upgraded.')));
71
  }
72
  else
73
  wp_redirect($prli_blogurl);
67
 
68
  if( $upgrade_db ) {
69
  prli_install();
70
+ wp_redirect("{$prli_blogurl}/wp-admin/admin.php?page=pretty-link/prli-links.php&message=" . urlencode(__('Your Database Has Been Successfully Upgraded.', 'pretty-link')));
71
  }
72
  else
73
  wp_redirect($prli_blogurl);
trunk/classes/models/PrliClick.php ADDED
@@ -0,0 +1,314 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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, $prli_link_meta;
97
+
98
+ $query = $wpdb->prepare("DELETE FROM {$prli_link_meta->table_name} WHERE meta_key=%s OR meta_key=%s", 'static-clicks', 'static-uniques');
99
+ $wpdb->query($query);
100
+
101
+ $query = "TRUNCATE TABLE {$this->table_name}";
102
+ return $wpdb->query($query);
103
+ }
104
+
105
+ /* This will delete all the clicks in the database by their age measured in days. */
106
+ function clear_clicks_by_age_in_days($days)
107
+ {
108
+ global $wpdb;
109
+
110
+ $days_in_seconds = $days * 24 * 60 * 60;
111
+ $oldest_time = time() - $days_in_seconds;
112
+
113
+ $num_records = $this->getRecordCount( " UNIX_TIMESTAMP(created_at) < {$oldest_time}" );
114
+
115
+ if($num_records)
116
+ {
117
+ $query = "DELETE FROM {$this->table_name} WHERE UNIX_TIMESTAMP(created_at) < %d";
118
+ $query = $wpdb->prepare( $query, $oldest_time );
119
+
120
+ $wpdb->query($query);
121
+ }
122
+
123
+ return $num_records;
124
+ }
125
+
126
+ function get_distinct_ip_count($where='')
127
+ {
128
+ global $wpdb, $prli_link, $prli_utils;
129
+ $where .= $this->get_exclude_where_clause( $where );
130
+ $where = $prli_utils->prepend_and_or_where(' WHERE', $where);
131
+ $query = 'SELECT COUNT(DISTINCT ip) FROM ' . $this->table_name . ' cl'. $where;
132
+ return $wpdb->get_var($query);
133
+ }
134
+
135
+ // Pagination Methods
136
+ function getRecordCount($where='')
137
+ {
138
+ global $wpdb, $prli_link, $prli_utils;
139
+ $where .= $this->get_exclude_where_clause( $where );
140
+ $where = $prli_utils->prepend_and_or_where(' WHERE', $where);
141
+ $query = 'SELECT COUNT(*) FROM ' . $this->table_name . ' cl'. $where;
142
+
143
+ return $wpdb->get_var($query);
144
+ }
145
+
146
+ function getPageCount($p_size, $where='')
147
+ {
148
+ return ceil((int)$this->getRecordCount($where) / (int)$p_size);
149
+ }
150
+
151
+ function getPage($current_p,$p_size, $where = '', $order = '',$include_stats=false)
152
+ {
153
+ global $wpdb, $prli_link, $prli_utils;
154
+ $end_index = $current_p * $p_size;
155
+ $start_index = $end_index - $p_size;
156
+ $where .= $this->get_exclude_where_clause( $where );
157
+ $where = $prli_utils->prepend_and_or_where(' AND', $where);
158
+ if($include_stats)
159
+ $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 . ';';
160
+ else
161
+ $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 . ';';
162
+ $results = $wpdb->get_results($query);
163
+ return $results;
164
+ }
165
+
166
+ function generateUniqueVisitorId($num_chars = 6)
167
+ {
168
+ global $wpdb, $prli_utils;
169
+
170
+ // We're doing a base 36 hash which is why we're always doing everything by 36
171
+ $max_vuid_value = pow(36,$num_chars);
172
+ $min_vuid_value = 37;
173
+ $vuid = base_convert( mt_rand($min_vuid_value,$max_vuid_value), 10, 36 );
174
+
175
+ $query = "SELECT DISTINCT vuid FROM ".$this->table_name;
176
+ $vuids = $wpdb->get_col($query,0);
177
+
178
+ // It is highly unlikely that we'll ever see 2 identical random vuids
179
+ // but just in case, here's some code to prevent collisions
180
+ while( in_array($vuid,$vuids) )
181
+ $vuid = base_convert( mt_rand($min_vuid_value,$max_vuid_value), 10, 36 );
182
+
183
+ return $vuid;
184
+ }
185
+
186
+ function get_counts_by_days($start_timestamp, $end_timestamp, $link_id = "all", $type = "all", $group = '')
187
+ {
188
+ global $wpdb, $prli_link;
189
+
190
+ $search_where = '';
191
+ $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' );
192
+
193
+ if($link_id != "all")
194
+ $query .= " AND link_id=$link_id";
195
+
196
+ if(!empty($group))
197
+ $query .= " AND link_id IN (SELECT id FROM " . $prli_link->table_name . " WHERE group_id=$group)";
198
+
199
+ if($type == "unique")
200
+ $query .= " AND first_click=1";
201
+
202
+ $query .= ' GROUP BY DATE(cl.created_at)';
203
+
204
+ $clicks_array = $wpdb->get_results($query);
205
+
206
+ $temp_array = array();
207
+ $counts_array = array();
208
+ $dates_array = array();
209
+
210
+ // Refactor Array for use later on
211
+ foreach($clicks_array as $c)
212
+ $temp_array[$c->cldate] = $c->clcount;
213
+
214
+ // Get the dates array
215
+ for($c = $start_timestamp; $c <= $end_timestamp; $c += 60*60*24)
216
+ $dates_array[] = date("Y-m-d",$c);
217
+
218
+ // Make sure counts array is in order and includes zero click days
219
+ foreach($dates_array as $date_str)
220
+ {
221
+ if(isset($temp_array[$date_str]))
222
+ $counts_array[$date_str] = $temp_array[$date_str];
223
+ else
224
+ $counts_array[$date_str] = 0;
225
+ }
226
+
227
+ return $counts_array;
228
+ }
229
+
230
+
231
+ function setupClickLineGraph($start_timestamp,$end_timestamp, $link_id = "all", $type = "all", $group = '')
232
+ {
233
+ global $wpdb, $prli_utils, $prli_link, $prli_group;
234
+
235
+ $dates_array = $this->get_counts_by_days($start_timestamp,$end_timestamp,$link_id,$type,$group);
236
+
237
+ $top_click_count = $prli_utils->getTopValue(array_values($dates_array));
238
+
239
+ if(!empty($group))
240
+ $link_slug = "group: '" . $wpdb->get_var("SELECT name FROM ".$prli_group->table_name." WHERE id=$group") . "'";
241
+ else if($link_id == "all")
242
+ $link_slug = "all links";
243
+ else
244
+ $link_slug = "'/".$wpdb->get_var("SELECT slug FROM ".$prli_link->table_name." WHERE id=$link_id") . "'";
245
+
246
+ if($type == "all")
247
+ $type_string = "All hits";
248
+ else
249
+ $type_string = "Unique hits";
250
+
251
+ $json_array = array(
252
+ "elements" => array( array(
253
+ "type" => "line",
254
+ "values" => array_values($dates_array),
255
+ "dot-style" => array(
256
+ "type" => "dot",
257
+ "dot-size" => 4,
258
+ "colour" => "#ffc94e",
259
+ "halo-size" => 1,
260
+ "tip" => "#val# Hits<br>#x_label#"
261
+ ),
262
+ "width" => 2
263
+ ) ),
264
+ "title" => array(
265
+ "text" => 'Pretty Link: '.$type_string.' on '.$link_slug. ' between ' . date("Y-n-j",$start_timestamp) . ' and ' . date("Y-n-j",$end_timestamp),
266
+ "style" => "font-size: 16px; font-weight: bold; color: #3030d0; text-align: center; padding-bottom: 5px;"
267
+ ),
268
+ "bg_colour" => "-1",
269
+ "y_axis" => array(
270
+ "min" => 0,
271
+ "max" => $top_click_count,
272
+ "steps" => (int)(($top_click_count>=10)?$top_click_count/10:1),
273
+ "colour" => "#A2ACBA"
274
+ ),
275
+ "x_axis" => array(
276
+ "colour" => "#A2ACBA",
277
+ "grid-colour" => "#ffefa7",
278
+ "offset" => false,
279
+ "steps" => 4,
280
+ "labels" => array(
281
+ "steps" => 2,
282
+ "rotate" => 25,
283
+ "colour" => "#000000",
284
+ "labels" => array_keys($dates_array)
285
+ )
286
+ )
287
+ );
288
+
289
+ return $prli_utils->prli_json_encode($json_array);
290
+ }
291
+
292
+
293
+ // Set defaults and grab get or post of each possible param
294
+ function get_params_array()
295
+ {
296
+ $values = array(
297
+ 'paged' => (isset($_GET['paged'])?$_GET['paged']:(isset($_POST['paged'])?$_POST['paged']:1)),
298
+ 'l' => (isset($_GET['l'])?$_GET['l']:(isset($_POST['l'])?$_POST['l']:'all')),
299
+ 'group' => (isset($_GET['group'])?$_GET['group']:(isset($_POST['group'])?$_POST['group']:'')),
300
+ 'ip' => (isset($_GET['ip'])?$_GET['ip']:(isset($_POST['ip'])?$_POST['ip']:'')),
301
+ 'vuid' => (isset($_GET['vuid'])?$_GET['vuid']:(isset($_POST['vuid'])?$_POST['vuid']:'')),
302
+ 'sdate' => (isset($_GET['sdate'])?$_GET['sdate']:(isset($_POST['sdate'])?$_POST['sdate']:'')),
303
+ 'edate' => (isset($_GET['edate'])?$_GET['edate']:(isset($_POST['edate'])?$_POST['edate']:'')),
304
+ 'type' => (isset($_GET['type'])?$_GET['type']:(isset($_POST['type'])?$_POST['type']:'all')),
305
+ 'search' => (isset($_GET['search'])?$_GET['search']:(isset($_POST['search'])?$_POST['search']:'')),
306
+ 'sort' => (isset($_GET['sort'])?$_GET['sort']:(isset($_POST['sort'])?$_POST['sort']:'')),
307
+ 'sdir' => (isset($_GET['sdir'])?$_GET['sdir']:(isset($_POST['sdir'])?$_POST['sdir']:''))
308
+ );
309
+
310
+ return $values;
311
+ }
312
+
313
+ }
314
+ ?>
trunk/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
+ ?>
trunk/classes/models/PrliLink.php ADDED
@@ -0,0 +1,473 @@