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
|
<?php
/**
* @version $Header: /cvsroot/bitweaver/_bit_blogs/send_post.php,v 1.3 2005/07/17 17:35:56 squareing Exp $
* @package blogs
* @subpackage functions
*/
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
/**
* required setup
*/
require_once( '../bit_setup_inc.php' );
include_once( BLOGS_PKG_PATH.'BitBlog.php' );
$gBitSystem->verifyPermission( 'bit_p_read_blog' );
if (!isset($_REQUEST["post_id"])) {
$gBitSystem->fatalError( 'No post indicated' );
}
include_once( BLOGS_PKG_PATH.'lookup_post_inc.php' );
$smarty->assign('post_info', $gContent->mInfo );
//Build absolute URI for this
$parts = parse_url($_SERVER['REQUEST_URI']);
$uri = httpPrefix(). $parts['path'] . '?blog_id=' . $gContent->mInfo['blog_id'] . '&post_id=' . $gContent->mInfo['post_id'];
$uri2 = httpPrefix(). $parts['path'] . '/' . $gContent->mInfo['blog_id'] . '/' . $gContent->mInfo['post_id'];
$smarty->assign('uri', $uri);
$smarty->assign('uri2', $uri2);
$smarty->assign( 'parsed_data', $gContent->parseData() );
$smarty->assign('individual', 'n');
if ($gBitUser->object_has_one_permission($gContent->mInfo["blog_id"], 'blog')) {
$smarty->assign('individual', 'y');
if (!$gBitUser->isAdmin()) {
// Now get all the permissions that are set for this content type
$perms = $gBitUser->getPermissions('', 'blogs');
foreach( array_keys( $perms ) as $permName ) {
if ($gBitUser->object_has_permission( $user, $_REQUEST["blog_id"], 'blog', $permName ) ) {
$$permName = 'y';
$smarty->assign( $permName, 'y');
} else {
$$permName = 'n';
$smarty->assign( $permName, 'n');
}
}
}
}
if ($gBitUser->hasPermission( 'bit_p_blog_admin' )) {
$bit_p_create_blogs = 'y';
$smarty->assign('bit_p_create_blogs', 'y');
$bit_p_blog_post = 'y';
$smarty->assign('bit_p_blog_post', 'y');
$bit_p_read_blog = 'y';
$smarty->assign('bit_p_read_blog', 'y');
}
$smarty->assign('ownsblog', $gContent->isBlogOwner() );
if ($feature_blogposts_comments == 'y') {
$comments_vars = array(
'post_id',
'offset',
'find',
'sort_mode'
);
$comments_prefix_var = 'post:';
$comments_object_var = 'post_id';
include_once ( LIBERTY_PKG_PATH.'comments_inc.php' );
}
$section = 'blogs';
if ($feature_theme_control == 'y') {
$cat_type = 'blog';
$cat_objid = $_REQUEST['blog_id'];
include( THEMES_PKG_PATH.'tc_inc.php' );
}
if (!isset($_REQUEST['addresses'])) {
$_REQUEST['addresses'] = '';
}
$smarty->assign('addresses', $_REQUEST['addresses']);
$smarty->assign('sent', 'n');
if (isset($_REQUEST['send'])) {
$emails = explode(',', $_REQUEST['addresses']);
$foo = parse_url($_SERVER["REQUEST_URI"]);
$machine = httpPrefix(). $gContent->getDisplayLink();
foreach ($emails as $email) {
$smarty->assign('mail_site', $_SERVER["SERVER_NAME"]);
$smarty->assign('mail_user', $gBitUser->getDisplayName() );
$smarty->assign('mail_title', $gContent->mInfo['title'] ? $gContent->mInfo['title'] : date("d/m/Y [h:i]", $gContent->mInfo['created']));
$smarty->assign('mail_machine', $machine);
$mail_data = $smarty->fetch('bitpackage:blogs/blogs_send_link.tpl');
@mail($email, tra('Post recommendation at'). ' ' . $_SERVER["SERVER_NAME"], $mail_data,
"From: ".$gBitSystem->getPreference( 'sender_email' )."\r\nContent-type: text/plain;charset=utf-8\r\n");
}
$smarty->assign('sent', 'y');
}
$gBitSystem->setBrowserTitle("Send Blog Post: ".$gContent->mInfo['title']);
// Display the template
$gBitSystem->display( 'bitpackage:blogs/send_blog_post.tpl');
?>
|