-
Notifications
You must be signed in to change notification settings - Fork 9
/
contact-me-blog.php
135 lines (77 loc) · 4.04 KB
/
contact-me-blog.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?php
session_start();
require 'class.base.php';
$base_instance=new base();
$username=isset($_REQUEST['username']) ? $_REQUEST['username'] : exit;
if (_SHORT_URLS==1) { $about_me_link=_HOMEPAGE.'/user-'.$username; }
else { $about_me_link=_HOMEPAGE.'/show-about-me.php?username='.$username; }
$name=isset($_POST['name']) ? $_POST['name'] : '';
$email=isset($_POST['email']) ? $_POST['email'] : '';
$request=isset($_POST['request']) ? $_POST['request'] : '';
$number=isset($_POST['number']) ? (int)$_POST['number'] : '';
$data=$base_instance->get_data('SELECT ID,email FROM organizer_user WHERE username="'.sql_safe($username).'"');
if (!$data) { exit; }
$userid=$data[1]->ID;
$email_blogger=$data[1]->email;
#
$head='<meta name="robots" content="noindex,follow">
<link rel="alternate" type="application/rss+xml" title="Blog of '.$username.'" href="show-blog-public-rss.php?user='.$userid.'">';
$title='Contact me - Blog of '.$username;
#
$data=$base_instance->get_data("SELECT * FROM {$base_instance->entity['BLOG']['CATEGORY']} WHERE user=$userid");
$categories='';
for ($index=1; $index <= sizeof($data); $index++) {
if (_SHORT_URLS==1) { $url=_HOMEPAGE.'/blog-'.$username.'-'.$data[$index]->ID.'-1.html'; }
else { $url=_HOMEPAGE.'/show-blog-public.php?username='.$username.'&cat='.$data[$index]->ID; }
$categories.='<li><a href="'.$url.'">'.$data[$index]->title.'</a></li>';
}
if (_SHORT_URLS==1) { $url_blog=_HOMEPAGE.'/blog-'.$username; }
else { $url_blog=_HOMEPAGE.'/show-blog-public.php?username='.$username; }
$categories.='<li><a href="'.$url_blog.'">Show all</a></li>';
#
$search_form='<form action="show-blog-public.php" method="post">
<input type="hidden" name="username" value="'.$username.'">
<font size="1">Blog Search:</font><br>
<input type="text" name="text_search" size="10" onFocus="this.select()">
<input type="submit" value="Go"></form><br><br>';
$rss_feed='<a href="show-blog-public-rss.php?user='.$userid.'"><img src="'._HOMEPAGE.'/pics/rss.jpg" border="0" alt="RSS Feed"> RSS Feed</a><p>';
$scrollbar='';
#
if (isset($_POST['save'])) {
$error='';
if (empty($name)) { $error.='<li> Please enter your name'; }
if (empty($email)) { $error.='<li> Please enter your email'; }
if (empty($request)) { $error.='<li> No text to send'; }
if (!empty($number)) {
if (isset($_SESSION['image_random_value'])) { $image_random_value=$_SESSION['image_random_value']; } else { $image_random_value=''; }
if (md5($number)!=$image_random_value) { $error.='<li> You entered the wrong number, please try again'; }
} else { $error.='<li> Please enter the shown number'; }
if (!$error) {
$mailheaders="From: $email\n";
$mailheaders.="Reply-To: $email\n";
$msg="Full Name: $name\nEmail: $email\nRequest: $request\n";
mail($email_blogger,'Blog Contact (Blue Smiley Organizer)',$msg,$mailheaders);
$main='Thank you for your email.';
require 'template-blog.html'; exit;
}
}
#
if (!empty($error)) { $msg='<font color="#ff0000"><ul>'.$error.'</ul></font>'; }
else { $msg='<h1>Contact Me</h1>'; }
$main=$msg.'
<form action="'.$_SERVER['PHP_SELF'].'" method="post">
<input type="Hidden" name="username" value="'.$username.'">
<table cellpadding="5" cellspacing="7" bgcolor="#ffffff" style="border:1px solid #dcdcdc">
<tr><td align="left"><b>Name:</b> <input type="text" name="name" size="35" value="'.$name.'"></td></tr>
<tr><td align="left"><b>Email:</b> <input type="text" name="email" size="35" value="'.$email.'"></td></tr>
<tr><td colspan=2 align="left"> <textarea rows=10 cols=40 name="request" wrap>'.$request.'</textarea></td></tr>
<tr><td align="left"><b>Enter Number:</b> <input name="number" type="text" id="number" value=""></td></tr>
<tr><td colspan="2">
<img src="image-verification.php" border="1">
</td></tr>
<tr><td colspan=2 align="center"><input type="SUBMIT" value="Send Email" name="save"></td></tr></form></td></tr></table>
<br><br>';
if (_SHORT_URLS==1) { $about_me_link=_HOMEPAGE.'/user-'.$username; }
else { $about_me_link=_HOMEPAGE.'/show-about-me.php?username='.$username; }
require 'template-blog.html';
?>