
02.03.2010, 14:16
|
|
Benutzer
|
|
Registriert seit: 28.11.2008
Beiträge: 51
|
|
DIE DA
Unter PAGES
http://www.yapedo.de da könnt ihr das sehen...
PHP-Code:
<?php
/*
#########################################################################
# xt:Commerce VEYTON 4.0 Enterprise
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright 2010 xt:Commerce GmbH. All Rights Reserved.
# This file may not be redistributed in whole or significant part.
# Content of this file is Protected By International Copyright Laws.
#
# ~~~~~~~~~ xt:Commerce VEYTON 4.0 Enterprise IS NOT FREE SOFTWARE ~~~~~~~~~~~~~~~~
#
# [url=http://www.xt-commerce.com]xt:Commerce Shopsoftware VEYTON 4.0[/url]
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# @version $Id: xt_blog.php 113 2010-02-27 12:15:37Z mzanier $
# @copyright xt:Commerce GmbH, [url=http://www.xt-commerce.com]xt:Commerce Shopsoftware VEYTON 4.0[/url]
#
# @author Mario Zanier, xt:Commerce GmbH [email]mzanier@xt-commerce.com[/email]
#
# @author Uwe Boeckers
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# xt:Commerce GmbH, Eduard Bodem Gasse 6, 6020 Innsbruck (AUSTRIA)
# [email]office@xt-commerce.com[/email]
#
#########################################################################
*/
defined('_VALID_CALL') or die('Direct Access is not allowed.');
if (isset($xtPlugin->active_modules['xt_blog'])){
include_once _SRV_WEBROOT.'plugins/xt_blog/classes/class.xt_blog_helper.php';
$blog_helper = new xt_blog_helper();
$current_page = (int)$blog_helper->getReqValue('next_page');
$blog_header = array();
$blog_header['title'] = PLUGIN_BLOG_TITLE;
$blog_header['description'] = PLUGIN_BLOG_DESCRIPTION;
$blog_header['link_list'] = $xtLink->_link(array('page'=>'blog', 'params' => 'next_page='.$current_page));
$blog_header['show_comments'] = true;
$blog_header['show_login_link'] = false;
$blog_header['comment_form'] = false;
$blog_header['feed_actual_page'] = $current_page;
if (is_object($brotkrumen)) $brotkrumen->_addItem($xtLink->_link(array('page'=>'blog')),TEXT_XT_BLOG);
$blog_helper->cron_action();
//if(isset($page->page_action) && $page->page_action != ''){
switch ($page->page_action) {
case 'feed_rss2' :
$BlogCat= (int)$blog_helper->getReqValue('bc', 0);
$BlogDeep = (int)$blog_helper->getReqValue('bd', 99);
$blog_messages = $blog_helper->get_messages($BlogCat, $BlogDeep);
$blog_header['feed_count'] = $blog_messages['count'];
$blog_header['feed_pages'] = $blog_messages['pages'];
$blog_header['feed_total'] = $blog_messages['total'];
$blog_header['feed_actual_page'] = $blog_messages['actual_page'];
$blog_header['feed_last_page'] = $blog_messages['last_pagel'];
$web = $blog_helper->gen_feed($blog_messages['data'], $blog_header, 'feed_rss2.html');
header("Content-type: application/rss+xml; charset: utf-8");
echo $web;
$display_output = false;
break;
case 'feed_atom' :
$BlogCat= (int)$blog_helper->getReqValue('bc', 0);
$BlogDeep = (int)$blog_helper->getReqValue('bd', 99);
$blog_messages = $blog_helper->get_messages($BlogCat, $BlogDeep);
$blog_header['feed_count'] = $blog_messages['count'];
$blog_header['feed_pages'] = $blog_messages['pages'];
$blog_header['feed_total'] = $blog_messages['total'];
$blog_header['feed_actual_page'] = $blog_messages['actual_page'];
$blog_header['feed_last_page'] = $blog_messages['last_pagel'];
$web = $blog_helper->gen_feed($blog_messages['data'], $blog_header, 'feed_atom.html');
header("Content-type: application/atom+xml; charset: utf-8");
echo $web;
$display_output = false;
break;
case 'message' :
// Umstellunf auf blog_message_id wegen SEO Feld link_id
$bmid= (int)$blog_helper->getReqValue('bmid');
$sql = 'select * from '.TABLE_BLOG_MESSAGE.' where blog_message_id="'.(int)$bmid.'" limit 1;';
$message = $db->getRow($sql);
$message_id = $message['blog_message_id'];
if($blog_header['show_comments'] == true) {
$arr_comments = $blog_helper->getComments($message_id);
$message['arr_comments'] = $arr_comments;
}
$web = $blog_helper->gen_feed(array($message), $blog_header, 'message.html');
$page_data = $web;
break;
case 'comment_form' :
// Umstellunf auf blog_message_id wegen SEO Feld link_id
$bmid= (int)$blog_helper->getReqValue('bmid');
$sql = 'select * from '.TABLE_BLOG_MESSAGE.' where blog_message_id="'.(int)$bmid.'" limit 1;';
$message = $db->getRow($sql);
$message_id = $message['blog_message_id'];
$blog_header['show_comments'] = false;
if((PLUGIN_BLOG_GUEST_COMMENT == 'true') or (!empty($_SESSION['registered_customer']))){
$blog_header['comment_form'] = true;
} else {
// nicht angemeldet und kein Public_comments = true;
$blog_header['comment_form'] = false;
$blog_header['show_login_link'] = true;
// check if logged in, if not, set snap and redirect
$tmp_link = $xtLink->_link(array('page'=>'blog','paction' => 'comment_form', 'params'=>'bmid='.(int)$bmid.'&next_page='.$current_page));
$brotkrumen->_setSnapshot($tmp_link);
$info->_addInfoSession(TEXT_XT_BLOG_COMMENT_ERROR_LOGIN,'error');
$tmp_link = $xtLink->_link(array('page'=>'customer','paction'=>'login'));
$xtLink->_redirect($tmp_link);
}
$web = $blog_helper->gen_feed(array($message), $blog_header, 'add_comment.html');
$page_data = $web;
break;
case 'add_comment' :
// Umstellunf auf blog_message_id wegen SEO Feld link_id
$bmid= (int)$blog_helper->getReqValue('bmid');
$sql = 'select * from '.TABLE_BLOG_MESSAGE.' where blog_message_id="'.(int)$bmid.'" limit 1;';
$message = $db->getRow($sql);
$message_id = $message['blog_message_id'];
$new_comment_text = $blog_helper->getReqValue('blog_comment_text');
if(empty($_SESSION['registered_customer'])) {
$new_comment_username = 'GAST';
} else {
$new_comment_username = substr(trim($_SESSION['customer']->customer_default_address['customers_firstname']), 0, 1);
if($new_comment_username != '') {
$new_comment_username .= '. ';
}
$new_comment_username .= $_SESSION['customer']->customer_default_address['customers_lastname'];
}
$blog_helper->addComment($message_id, $new_comment_username, $new_comment_text);
$info->_addInfo(TEXT_BLOG_COMMENTAR_ADDED, 'info');
if($blog_header['show_comments'] == true) {
$arr_comments = $blog_helper->getComments($message_id);
$message['arr_comments'] = $arr_comments;
}
$web = $blog_helper->gen_feed(array($message), $blog_header, 'message.html');
$page_data = $web;
break;
default :
$BlogCat= (int)$blog_helper->getReqValue('bc', 0);
$BlogDeep = (int)$blog_helper->getReqValue('bd', 99);
$BlogMax = (int)$blog_helper->getReqValue('bm', PLUGIN_BLOG_PAGE_MAX);
if($params['cat'] != '' ) $BlogCat= (int)$params['cat'];
if($params['deep'] != '' ) $BlogDeep = (int)$params['deep'];
if($params['max'] != '' ) $BlogMax = (int)$params['max'];
$blog_messages = $blog_helper->get_messages($BlogCat, $BlogDeep,$BlogMax);
if ($blog_messages['total']==0 && is_object($info)) {
$info->_addInfo(TEXT_BLOG_CATEGORIES_NO_MESSAGES,'info');
}
$blog_header['feed_count'] = $blog_messages['count'];
$blog_header['feed_pages'] = $blog_messages['pages'];
$blog_header['feed_total'] = $blog_messages['total'];
$blog_header['feed_actual_page'] = $blog_messages['actual_page'];
$blog_header['feed_last_page'] = $blog_messages['last_page'];
$rss_feeds = array();
$rss_feeds[] = array('title' => 'RSS2 Feed abonieren', 'link' => $xtLink->_link(array('page'=>'blog', 'paction'=>'feed_rss2')));
$rss_feeds[] = array('title' => 'Atom Feed abonieren', 'link' => $xtLink->_link(array('page'=>'blog', 'paction'=>'feed_atom')));
$blog_header['rss_feeds']=$rss_feeds;
$web = $blog_helper->gen_feed($blog_messages['data'], $blog_header, 'feed_web.html');
$page_data = $web;
break;
}
}
?>
Geändert von Yapedo (02.03.2010 um 14:26 Uhr)
|