This repository has been archived by the owner on Mar 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
myLDlinker.php
76 lines (59 loc) · 2.31 KB
/
myLDlinker.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/*
Plugin Name: myLinksDump
Plugin URI: http://silvercover.wordpress.com/myLinksDump
Description: Plugin for displaying daily links.
Author: Hamed Takmil
Version: 1.4
Author URI: http://silvercover.wordpress.com
*/
/* Copyright 2010 Hamed Takmil aka silvercover
Email: ham55464@yahoo.com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
require_once("wp-load.php");
function update_counter() {
global $wpdb;
$wpdb->hide_errors();
$table = $wpdb->prefix."links_dump";
$link_id = intval($_GET['url']);
$sql_query = $wpdb->prepare("SELECT * FROM ".$table." WHERE link_id=".$link_id);
$url = $wpdb->get_row($sql_query, ARRAY_A);
$visits = $url['visits'] + 1;
//Update link vist counter
$sql_query = $wpdb->prepare("UPDATE ".$table." SET visits='".$visits."' WHERE link_id=".$_GET['url']." LIMIT 1");
$wpdb->query($sql_query);
//Redirect user to destination URL
if (get_option('ld_open_branding') == 0){
header("Location:".$url['url']);
}
?>
<html>
<head>
<title><?php echo get_option('ld_linkdump_title').":".$url['title'];?></title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
</head>
<frameset rows="30,*" frameborder="0">
<frame name="header" noresize="noresize" scrolling="no" src="<?php echo get_settings('siteurl').'/myLDbranding.php?url='.$_GET['url']; ?>" />
<frame name="main" src="<?php echo $url['url']; ?>" />
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>
</html>
<?php
}
update_counter();
?>