Skip to content
This repository
Newer
Older
100644 146 lines (122 sloc) 4.277 kb
d07f25e8 »
2008-08-26 git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
1 <?php
2 /**
3 *
4 * @package Icy Phoenix
5 * @version $Id$
6 * @copyright (c) 2008 Icy Phoenix
7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
8 *
9 */
10
11 define('CT_SECLEVEL', 'MEDIUM');
12 $ct_ignoregvar = array('');
b7a59d90 »
2010-05-17 New poll system and minor bug fixes.
13 define('IN_ICYPHOENIX', true);
06ce0f8d »
2008-09-14 Brand new version...
14 if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
15 if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
16 include(IP_ROOT_PATH . 'common.' . PHP_EXT);
dbcd6a46 »
2009-12-30 Added a function to generate topics pagination and integrated where n…
17 include_once(IP_ROOT_PATH . 'includes/functions_post.' . PHP_EXT);
d07f25e8 »
2008-08-26 git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
18
4094590b »
2009-03-11 Update to RC version
19 // Start session management
09f38bc8 »
2011-03-31 Another milestone almost achieved for new Icy Phoenix version: user/s…
20 $user->session_begin();
d164727c »
2011-09-23 First implementation of the new permissions system in CMS.
21 $auth->acl($user->data);
09f38bc8 »
2011-03-31 Another milestone almost achieved for new Icy Phoenix version: user/s…
22 $user->setup();
4094590b »
2009-03-11 Update to RC version
23 // End session management
24
a4ea299f »
2010-03-20 First commit with UTF-8 modifications, almost all files have been edi…
25 $topic_title = request_var('topic_title', '', true);
9dea0d46 »
2008-10-30 New Icy Phoenix structure.
26 $topic_id = request_var('topic_id', 0);
a4ea299f »
2010-03-20 First commit with UTF-8 modifications, almost all files have been edi…
27 $friendname = request_var('friendname', '', true);
28 $message = request_var('message', '', true);
dc92d293 »
2010-02-14 Some bugs fixed:
29 $PHP_SELF = $_SERVER['SCRIPT_NAME'];
d07f25e8 »
2008-08-26 git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
30
09f38bc8 »
2011-03-31 Another milestone almost achieved for new Icy Phoenix version: user/s…
31 if (!$user->data['session_logged_in'])
d07f25e8 »
2008-08-26 git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
32 {
2d81429c »
2009-10-26 New Icy Phoenix version based on some new core functions.php
33 redirect(append_sid(CMS_PAGE_LOGIN . '?redirect=' . 'tellafriend.' . PHP_EXT . '&topic_title=' . urlencode($topic_title) . '&topic_id=' . $topic_id, true));
d07f25e8 »
2008-08-26 git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
34 }
35
2d81429c »
2009-10-26 New Icy Phoenix version based on some new core functions.php
36 if (($config['url_rw'] == true) || ($config['url_rw_guests'] == true))
9dea0d46 »
2008-10-30 New Icy Phoenix structure.
37 {
38 $topic_link = create_server_url() . make_url_friendly($topic_title) . '-vt' . $topic_id . '.html';
39 }
40 else
41 {
2d81429c »
2009-10-26 New Icy Phoenix version based on some new core functions.php
42 $topic_link = create_server_url() . CMS_PAGE_VIEWTOPIC . '?' . POST_TOPIC_URL . '=' . $topic_id;
9dea0d46 »
2008-10-30 New Icy Phoenix structure.
43 }
44
a4ea299f »
2010-03-20 First commit with UTF-8 modifications, almost all files have been edi…
45 $mail_body = str_replace("{TOPIC}", htmlspecialchars_decode($topic_title), $lang['TELL_FRIEND_BODY']);
9dea0d46 »
2008-10-30 New Icy Phoenix structure.
46 $mail_body = str_replace("{LINK}", $topic_link, $mail_body);
2d81429c »
2009-10-26 New Icy Phoenix version based on some new core functions.php
47 $mail_body = str_replace("{SITENAME}", $config['sitename'], $mail_body);
d07f25e8 »
2008-08-26 git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
48
49 $template->assign_vars(array(
50 'SUBMIT_ACTION' => append_sid($PHP_SELF, true),
51 'L_SUBMIT' => $lang['Send_email'],
2d81429c »
2009-10-26 New Icy Phoenix version based on some new core functions.php
52 'SITENAME' => $config['sitename'],
4094590b »
2009-03-11 Update to RC version
53
09f38bc8 »
2011-03-31 Another milestone almost achieved for new Icy Phoenix version: user/s…
54 'SENDER_NAME' => $user->data['username'],
55 'SENDER_MAIL' => $user->data['user_email'],
4094590b »
2009-03-11 Update to RC version
56
57 'L_TELL_FRIEND_BODY' => $mail_body,
58
a4ea299f »
2010-03-20 First commit with UTF-8 modifications, almost all files have been edi…
59 'TOPIC_TITLE' => $topic_title,
4094590b »
2009-03-11 Update to RC version
60 'TOPIC_ID' => $topic_id,
61 'TOPIC_LINK' => $topic_link,
d07f25e8 »
2008-08-26 git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
62 )
63 );
64
65 /**************/
4094590b »
2009-03-11 Update to RC version
66 if (isset($_POST['submit']))
d07f25e8 »
2008-08-26 git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
67 {
68 $error = false;
69
a4ea299f »
2010-03-20 First commit with UTF-8 modifications, almost all files have been edi…
70 $friendemail = request_var('friendemail', '', true);
71 $friendname = request_var('friendname', '', true);
acc8decc »
2010-05-08 Improved classes for managing files and images, fixed a couple of bug…
72 $topic_title = request_var('topic_title', '', true);
73 $message = request_var('message', '', true);
74 // We need to check if HTML emails are enabled so we can correctly escape content and linebreaks
75 if (!empty($config['html_email']))
76 {
77 $message = nl2br(str_replace($topic_link, ('<a href="' . $topic_link . '">' . $topic_link . '</a>'), $message));
78 }
79 else
80 {
81 $message = htmlspecialchars_decode($message, ENT_COMPAT);
82 }
a4ea299f »
2010-03-20 First commit with UTF-8 modifications, almost all files have been edi…
83
84 if (!empty($friendemail) && (strpos($friendemail, '@') > 0))
d07f25e8 »
2008-08-26 git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
85 {
a4ea299f »
2010-03-20 First commit with UTF-8 modifications, almost all files have been edi…
86 if (empty($friendname))
d07f25e8 »
2008-08-26 git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
87 {
a4ea299f »
2010-03-20 First commit with UTF-8 modifications, almost all files have been edi…
88 $friendname = substr($friendemail, 0, strpos($friendemail, '@'));
d07f25e8 »
2008-08-26 git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
89 }
90 }
91 else
92 {
93 $error = true;
94 $error_msg = $lang['Tell_Friend_Wrong_Email'];
95 }
96
4094590b »
2009-03-11 Update to RC version
97 if (!$error)
d07f25e8 »
2008-08-26 git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
98 {
06ce0f8d »
2008-09-14 Brand new version...
99 include(IP_ROOT_PATH . 'includes/emailer.' . PHP_EXT);
43b6f20d »
2010-04-04 Other bugs fixed about UTF-8:
100 $emailer = new emailer();
d07f25e8 »
2008-08-26 git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
101
43b6f20d »
2010-04-04 Other bugs fixed about UTF-8:
102 $emailer->headers('X-AntiAbuse: Board servername - ' . trim($config['server_name']));
09f38bc8 »
2011-03-31 Another milestone almost achieved for new Icy Phoenix version: user/s…
103 $emailer->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
104 $emailer->headers('X-AntiAbuse: Username - ' . $user->data['username']);
105 $emailer->headers('X-AntiAbuse: User IP - ' . $user_ip);
d07f25e8 »
2008-08-26 git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
106
107 $emailer->use_template('tellafriend_email', $user_lang);
43b6f20d »
2010-04-04 Other bugs fixed about UTF-8:
108 $emailer->to($friendemail, $friendname);
09f38bc8 »
2011-03-31 Another milestone almost achieved for new Icy Phoenix version: user/s…
109 $emailer->from($user->data['user_email']);
110 $emailer->replyto($user->data['user_email']);
a4ea299f »
2010-03-20 First commit with UTF-8 modifications, almost all files have been edi…
111 $emailer->set_subject($topic_title);
d07f25e8 »
2008-08-26 git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
112
113 $emailer->assign_vars(array(
2d81429c »
2009-10-26 New Icy Phoenix version based on some new core functions.php
114 'SITENAME' => $config['sitename'],
115 'BOARD_EMAIL' => $config['board_email'],
09f38bc8 »
2011-03-31 Another milestone almost achieved for new Icy Phoenix version: user/s…
116 'FROM_USERNAME' => $user->data['username'],
d07f25e8 »
2008-08-26 git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
117 'TO_USERNAME' => $friendname,
118 'MESSAGE' => $message
119 )
120 );
121 $emailer->send();
122 $emailer->reset();
123
2d81429c »
2009-10-26 New Icy Phoenix version based on some new core functions.php
124 $redirect_url = append_sid(CMS_PAGE_FORUM);
9dea0d46 »
2008-10-30 New Icy Phoenix structure.
125 meta_refresh(5, $redirect_url);
d07f25e8 »
2008-08-26 git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
126
2d81429c »
2009-10-26 New Icy Phoenix version based on some new core functions.php
127 $message = $lang['Email_sent'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid(CMS_PAGE_FORUM) . '">', '</a>');
d07f25e8 »
2008-08-26 git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
128
129 message_die(GENERAL_MESSAGE, $message);
130 }
131
132 if ($error)
133 {
134 $template->set_filenames(array('reg_header' => 'error_body.tpl'));
135 $template->assign_vars(array(
136 'ERROR_MESSAGE' => $error_msg
137 )
138 );
139 $template->assign_var_from_handle('ERROR_BOX', 'reg_header');
140 }
141
142 }
143
2d81429c »
2009-10-26 New Icy Phoenix version based on some new core functions.php
144 full_page_generation('tellafriend_body.tpl', '', '', '');
d07f25e8 »
2008-08-26 git-svn-id: http://svn.assembla.com/svn/icy_phoenix/ip/trunk@29 e0e46…
145
146 ?>
Something went wrong with that request. Please try again.