Ejemplo n.º 1
0
<?php

/**
 * @version $Header$
 * @package blogs
 * @subpackage modules
 */
/**
 * required setup
 */
include_once BLOGS_PKG_PATH . 'BitBlog.php';
//require_once( USERS_PKG_PATH.'BitUser.php' );
global $gQueryUserId, $module_rows, $moduleParams;
$listHash['max_records'] = $module_rows;
$listHash['sort_mode'] = !empty($moduleParams['module_params']['sort_mode']) ? $moduleParams['module_params']['sort_mode'] : 'created_desc';
BitUser::userCollection($moduleParams['module_params'], $listHash);
$blog = new BitBlog();
if ($modBlogs = $blog->getList($listHash)) {
    foreach (array_keys($modBlogs) as $b) {
        $modBlogs[$b]['post'] = $blog->getPost(array('blog_id' => $modBlogs[$b]['blog_id']));
    }
    $_template->tpl_vars['modBlogs'] = new Smarty_variable($modBlogs);
}
$moduleTitle = !empty($moduleParams['title']) ? $moduleParams['title'] : 'Blog Roll';
$_template->tpl_vars['moduleTitle'] = new Smarty_variable($moduleTitle);
Ejemplo n.º 2
0
<?php

// $Header$
// get a list of blogs for the selection of the home blog
require_once BLOGS_PKG_PATH . 'BitBlog.php';
$blog = new BitBlog();
$listHash['sort_mode'] = 'created_desc';
$blogList = $blog->getList($listHash);
$gBitSmarty->assignByRef('blogList', $blogList);
if (!empty($_REQUEST["set_blog_home"])) {
    $blog_home = @BitBase::verifyId($_REQUEST['blog_home']) ? $_REQUEST['blog_home'] : NULL;
    $gBitSystem->storeConfig("blog_home", $blog_home, BLOGS_PKG_NAME);
    $gBitSmarty->assign('blog_home', $blog_home);
}
$formBlogLists = array("blog_list_title" => array('label' => 'Title'), "blog_list_description" => array('label' => 'Description'), "blog_list_created" => array('label' => 'Creation date'), "blog_list_lastmodif" => array('label' => 'Last modification time'), "blog_list_user" => array('label' => 'Creator', 'note' => 'The creator of a particular blog.'), "blog_list_posts" => array('label' => 'Posts', 'note' => 'Number of posts submitted to any given blog.'), "blog_list_visits" => array('label' => 'Visits', 'note' => 'Number of times a given blog has been visited.'));
$gBitSmarty->assign('formBlogLists', $formBlogLists);
$formBlogFeatures = array("blog_rankings" => array('label' => 'Rankings', 'note' => 'Enable the use of rankings based on page hits.'), "blog_posts_comments" => array('label' => 'Blog Post Comments', 'note' => 'Allow the addition of comments to blog posts.'), "blog_posts_autosplit" => array('label' => 'Use 2 Text Fields To Auto Split Blog Posts', 'note' => 'Display two text fields when editing a post, for intro and read more sections. Disabling will display one text field and requires use of ...split... to create a read more section'), "blog_ajax_more" => array('label' => 'Ajax Read More', 'note' => 'Ajax the "read more" text inline into the short description lists of posts.'), "blog_show_image" => array('label' => 'Auto Display Primary Attachment', 'note' => 'Blog posts can automatically display any attachment, typically an image, that is marked as the "Primary Attachment" during editing. This is especially useful for automatically inserting a photograph into a post.'), "blog_hide_empty_usr_list" => array('label' => 'Hide empty blog message on user pages', 'note' => 'Enable to hide the "No Records Found" on user\'s blog rolls'));
$gBitSmarty->assign('formBlogFeatures', $formBlogFeatures);
$formBlogInputs = array("blog_top_post_count" => array('label' => 'Top Post Count', 'note' => 'How many posts per blog in the rankings should be shown.'));
$gBitSmarty->assign('formBlogInputs', $formBlogInputs);
$processForm = set_tab();
if ($processForm) {
    $blogToggles = array_merge($formBlogLists, $formBlogFeatures);
    foreach ($blogToggles as $item => $data) {
        simple_set_toggle($item, BLOGS_PKG_NAME);
    }
    /** @TODO: Fix. Lazy error handling to ensure numeric. **/
    $gBitSystem->storeConfig("blog_top_post_count", isset($_REQUEST["blog_top_post_count"]) && is_numeric($_REQUEST["blog_top_post_count"]) ? $_REQUEST["blog_top_post_count"] : "3");
    $gBitSystem->storeConfig("blog_posts_max_list", isset($_REQUEST["blog_posts_max_list"]) && is_numeric($_REQUEST["blog_posts_max_list"]) ? $_REQUEST["blog_posts_max_list"] : "10");
    $gBitSystem->storeConfig("blog_posts_comments", isset($_REQUEST["blog_posts_comments"]) ? 'y' : 'n', BLOGS_PKG_NAME);
    $gBitSystem->storeConfig("blog_list_order", $_REQUEST["blog_list_order"], BLOGS_PKG_NAME);
Ejemplo n.º 3
0
        $formHash['blog_content_id'] = $_REQUEST['blog_content_id'];
        $msgHash = array('label' => 'Remove Crossposting of Blog Post:', 'confirm_item' => $gContent->getTitle(), 'warning' => tra('This will remove the crossposting of the above blog post.'), 'error' => tra('This cannot be undone!'));
        $gBitSystem->confirmDialog($formHash, $msgHash);
    }
} elseif (isset($_REQUEST["blog_content_id"])) {
    //if we are not removing the post but have received a blog_content_id then we want to edit its note, so load it up
    $crosspost = $gContent->loadPostMap($gContent->mInfo['content_id'], $_REQUEST["blog_content_id"]);
    $gBitSmarty->assign('crosspost', $crosspost);
    $gBitSmarty->assign('blog_content_id', $_REQUEST['blog_content_id']);
}
$post_id = $gContent->mPostId;
$gBitSmarty->assign('post_id', $gContent->mPostId);
$parsed_data = $gContent->parseData();
$gBitSmarty->assign('parsed_data', $parsed_data);
$gBitSmarty->assign('post_info', $gContent->mInfo);
// Get List of available blogs
$listHash = array();
$listHash['sort_mode'] = 'title_desc';
if (!$gBitUser->hasPermission('p_blogs_admin')) {
    $blogs = $gBlog->getList($listHash);
    $listHash['user_id'] = $gBitUser->mUserId;
    $listHash['content_perm_name'] = 'p_blogs_post';
}
$blogs = $gBlog->getList($listHash);
$availableBlogs = array();
foreach (array_keys($blogs) as $blogContentId) {
    $availableBlogs[$blogContentId] = $blogs[$blogContentId]['title'];
}
$gBitSmarty->assign('availableBlogs', $availableBlogs);
$gBitSmarty->assignByRef('blogs', $blogs['data']);
$gBitSystem->display('bitpackage:blogs/crosspost.tpl', tra("Crosspost Blog Post"), array('display_mode' => 'display'));
Ejemplo n.º 4
0
<?php

/**
 * @version $Header$
 * @package blogs
 * @subpackage modules
 */
/**
 * required setup
 */
include_once BLOGS_PKG_PATH . 'BitBlog.php';
//require_once( USERS_PKG_PATH.'BitUser.php' );
global $gQueryUserId, $moduleParams;
//$params = $moduleParams['module_params'];
$listHash['max_records'] = $moduleParams['module_rows'];
$listHash['sort_mode'] = 'last_modified_desc';
BitUser::userCollection($moduleParams, $listHash);
$blog = new BitBlog();
$ranking = $blog->getList($listHash);
$_template->tpl_vars['modLastModifiedBlogs'] = new Smarty_variable($ranking);
Ejemplo n.º 5
0
<?php

/**
 * @version $Header$
 * @package blogs
 * @subpackage modules
 */
/**
 * required setup
 */
include_once BLOGS_PKG_PATH . 'BitBlog.php';
//require_once( USERS_PKG_PATH.'BitUser.php' );
global $gQueryUserId, $module_rows, $module_params;
$listHash['max_records'] = $module_rows;
$listHash['sort_mode'] = 'created_desc';
BitUser::userCollection($module_params, $listHash);
$blog = new BitBlog();
$_template->tpl_vars['modLastCreatedBlogs'] = new Smarty_variable($blog->getList($listHash));