diff options
| author | bitweaver.org <bitweaver@users.sourceforge.net> | 2005-06-19 03:57:42 +0000 |
|---|---|---|
| committer | bitweaver.org <bitweaver@users.sourceforge.net> | 2005-06-19 03:57:42 +0000 |
| commit | 48f33945f41e0b30628d8d7941fe8d62e88ac97b (patch) | |
| tree | 5d624eda3cf1bd0cdc9e788fbbba5c70a3ddb0e4 /send_post.php | |
| download | blogs-48f33945f41e0b30628d8d7941fe8d62e88ac97b.tar.gz blogs-48f33945f41e0b30628d8d7941fe8d62e88ac97b.tar.bz2 blogs-48f33945f41e0b30628d8d7941fe8d62e88ac97b.zip | |
IMPORT TikiPro CLYDE FINAL
Diffstat (limited to 'send_post.php')
| -rw-r--r-- | send_post.php | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/send_post.php b/send_post.php new file mode 100644 index 0000000..3abe52e --- /dev/null +++ b/send_post.php @@ -0,0 +1,120 @@ +<?php + +// $Header: /cvsroot/bitweaver/_bit_blogs/send_post.php,v 1.1 2005/06/19 03:57:42 bitweaver Exp $ + +// 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. + +// Initialization +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') { + $maxComments = $gBitSystem->getPreference( 'blog_comments_per_page' ); + $comments_default_ordering = $blog_comments_default_ordering; + $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'); + +?> |
