コード例 #1
0
ファイル: basket.php プロジェクト: BackupTheBerlios/phreakpic
<?php

define("ROOT_PATH", '');
include_once './includes/common.inc.php';
include_once './classes/album_content.inc.php';
include_once './includes/functions.inc.php';
include_once './modules/pic_managment/interface.inc.php';
include_once './includes/template.inc.php';
$cookie = $_COOKIE[$config_vars['cookie_name'] . 'basket'];
$content_id_array = explode(':', $cookie);
for ($i = 0; $i < sizeof($content_id_array) - 1; $i++) {
    $content_obj = get_content_object_from_id($content_id_array[$i]);
    $contents[] = $content_obj;
}
include "includes/view_thumbs.php";
$nav_content['name'] = $lang['basket'];
$nav_string[] = $nav_content;
$smarty->assign('nav_string', $nav_string);
$smarty->display($userdata['photo_user_template'] . "/basket.tpl");
$template_end_time = getmicrotime();
$template_execution_time = $template_end_time - $end_time;
echo "execution_time: {$execution_time} seconds<br>";
echo "template_execution_time: {$template_execution_time} seconds<br>";
$execution_time = $end_time - $start_time + $template_execution_time;
echo "gesamt execution_time: {$execution_time} seconds<br>";
コード例 #2
0
ファイル: sync.php プロジェクト: BackupTheBerlios/phreakpic
    if ($calc_child_comments_amount != $cat->get_child_comments_amount()) {
        $missmatch['type'] = CHILD_COMMENTS_IN_CAT_AMOUNT;
        $missmatch['id'] = $cat->id;
        $missmatch['name'] = $cat->get_name();
        $missmatch['value'] = $cat->get_child_comments_amount();
        $missmatch['should_be'] = $calc_child_comments_amount;
        $missmatch_array[] = $missmatch;
    }
}
// get all content
$sql = "SELECT id FROM " . $config_vars['table_prefix'] . "content";
if (!($result = $db->sql_query($sql))) {
    message_die(GENERAL_ERROR, "Coudnt get content", '', __LINE__, __FILE__, $sql);
}
while ($row = $db->sql_fetchrow($result)) {
    $content = get_content_object_from_id($row['id']);
    if (is_object($content)) {
        $contentarray[] = $content;
    }
}
foreach ($contentarray as $content) {
    $calc_comments_amount = $content->calc_comments_amount();
    if ($calc_comments_amount != $content->get_comments_amount()) {
        $missmatch['type'] = CONTENT_COMMENTS_AMOUNT;
        $missmatch['id'] = $content->id;
        $missmatch['name'] = $content->get_name();
        $missmatch['value'] = $content->get_comments_amount();
        $missmatch['should_be'] = $calc_comments_amount;
        $missmatch_array[] = $missmatch;
    }
}
コード例 #3
0
    }
}
$smarty->assign('fields', $fields);
if ($submit or !$no_instand_submit) {
    // replace placeholder with data from params
    $sql = make_sql($HTTP_POST_VARS['returns']);
    //clear content array
    #	echo $sql;
    unset($contents);
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, "Error in sql", '', __LINE__, __FILE__, $sql);
    }
    //fill content array with result from query
    while ($row = $db->sql_fetchrow($result)) {
        if (is_object(get_content_object_from_id($row[0]))) {
            $new_content = get_content_object_from_id($row[0]);
            $arr_keys = array_keys($row);
            for ($i = 3; $i < sizeof($arr_keys); $i += 2) {
                $new_content->add_params[$arr_keys[$i]] = $row[$arr_keys[$i]];
            }
            $contents[] = $new_content;
        }
    }
    // save contents array for view_content next and back buttons
    $HTTP_SESSION_VARS['contents'] = $contents;
    // save link back to the thumbs for view_content
    $HTTP_SESSION_VARS['thumb_link'] = "view_custom_searches.php?query={$query}&submit=old";
    $smarty->assign('thumb_link', $HTTP_SESSION_VARS['thumb_link']);
    // also the setted params
    $HTTP_SESSION_VARS['rets'] = $HTTP_POST_VARS['returns'];
    include "includes/view_thumbs.php";
コード例 #4
0
<?php

define("ROOT_PATH", '');
include_once "includes/common.inc.php";
include_once './includes/template.inc.php';
include_once './classes/user_feedback.inc.php';
include_once './modules/pic_managment/interface.inc.php';
session_start();
stop_view($HTTP_SESSION_VARS['view_start'], $HTTP_SESSION_VARS['view_content_id']);
$HTTP_SESSION_VARS['view_start'] = 0;
$HTTP_SESSION_VARS['view_content_id'] = 0;
$smarty->assign('mode', $HTTP_GET_VARS['mode']);
$smarty->assign('type', $HTTP_GET_VARS['type']);
if ($content_id != '') {
    $content_obj = get_content_object_from_id($content_id);
    $smarty->assign('oontent_html', $content_obj->get_html());
    $smarty->assign('oontent_id', $content_id);
    $smarty->assign('oontent_id_string', "&content_id={$content_id}");
}
// get parent comments
$class = $HTTP_GET_VARS['type'] . "_comment";
// get root comment
$root_parent_id = $HTTP_GET_VARS['parent_id'];
while ($root_parent_id != 0) {
    $parent_comment = new $class();
    $parent_comment->generate_from_id($root_parent_id);
    $root_parent_id = $parent_comment->get_parent_id();
    $root_id = $parent_comment->id;
}
if ($root_id != 0) {
    $root_comment = new $class();
コード例 #5
0
include_once './includes/template.inc.php';
include_once './classes/error.inc.php';
include_once './classes/album_content.inc.php';
include_once './classes/meta.inc.php';
include_once './modules/pic_managment/interface.inc.php';
include_once './classes/categorie.inc.php';
include_once './includes/functions.inc.php';
include_once 'classes/user_feedback.inc.php';
session_start();
stop_view($HTTP_SESSION_VARS['view_start'], $HTTP_SESSION_VARS['view_content_id']);
$HTTP_SESSION_VARS['view_start'] = 0;
$HTTP_SESSION_VARS['view_content_id'] = 0;
// proceed comments
$comment_type = 'content';
include 'includes/proceed_comment.inc.php';
$content = get_content_object_from_id($HTTP_GET_VARS['content_id']);
if (!is_object($content)) {
    $error = new phreak_error(E_ERROR, INFORMATION, __LINE__, __FILE__, 'content_not_existing', $this->id, 0, 0, $sql);
    $error->commit();
    // 	error_report(INFORMATION, 'content_not_existing' , __LINE__, __FILE__);
}
// if there is no cat_id assigned take the first cat of the content
$ids = $content->get_cat_ids();
if (!in_array($HTTP_GET_VARS['cat_id'], $ids)) {
    $HTTP_GET_VARS['cat_id'] = $ids[0];
}
//get previous and next content and display the thumbnail if aviable
// $surrounding_content = $content->get_surrounding_content($HTTP_GET_VARS['cat_id']);
if (isset($HTTP_SESSION_VARS['contents'])) {
    $smarty->assign('content_amount', sizeof($HTTP_SESSION_VARS['contents']));
    if (isset($HTTP_GET_VARS['place_in_content_array'])) {