Ejemplo n.º 1
0
<?php

// $Id$
//
if (!empty($_REQUEST['user_id']) && $_REQUEST['user_id'] != $gBitUser->mUserId) {
    $gQueryUser = new BitPermUser($_REQUEST['user_id']);
    $gQueryUser->load();
} else {
    $gQueryUser =& $gBitUser;
}
define('NAVBAR_TITLE', tra('Products by') . ' ' . $gQueryUser->getDisplayName(FALSE));
define('HEADING_TITLE', tra('Products by') . ' ' . $gQueryUser->getDisplayName(FALSE));
require_once DIR_FS_MODULES . 'require_languages.php';
$breadcrumb->add(NAVBAR_TITLE);
if ($gQueryUser->mUserId == $gBitUser->mUserId) {
    $listHash['all_status'] = TRUE;
}
$listHash['user_id'] = $gQueryUser->mUserId;
$listHash['thumbnail_size'] = 'small';
/* The cool bitweaver way will have to happen later... - spiderr */
$listHash['user_id'] = $gQueryUser->mUserId;
$userProducts = $gBitProduct->getList($listHash);
$gBitProduct->invokeServices('content_list_function', $listHash);
$gBitSmarty->assign('listProducts', $userProducts);
$gBitSmarty->assign('listTitle', tra('Products by') . ' ' . $gQueryUser->getDisplayName(TRUE));
$gBitSmarty->assign('listInfo', $listHash);
$gBitSmarty->assign_by_ref('gQueryUser', $gQueryUser);
print $gBitSmarty->fetch('bitpackage:bitcommerce/list_products.tpl');
Ejemplo n.º 2
0
 function store($pParamHash)
 {
     if ($this->verify($pParamHash)) {
         global $gBitSystem, $gBitSmarty;
         $now = $gBitSystem->getUTCTime();
         $shoutSum = md5($pParamHash['shout_message']);
         if (!empty($pParamHash['shout_id'])) {
             // since this is an update, we need to make sure the cache file is removed
             $this->mCache->expungeCacheFile($pParamHash['shout_id']);
             $bindvars = array($pParamHash['shout_message'], $shoutSum, (int) $pParamHash['shout_id']);
             $query = "UPDATE `" . BIT_DB_PREFIX . "shoutbox` SET `shout_message`=?, `shout_sum`=?\n\t\t\t\t\t\t  WHERE `shout_id`=?";
         } else {
             $query = "DELETE FROM `" . BIT_DB_PREFIX . "shoutbox` where `shout_user_id`=? and `shout_time`=? and `shout_sum`=?";
             $bindvars = array($pParamHash['shout_user_id'], (int) $now, $shoutSum);
             $this->mDb->query($query, $bindvars);
             $query = "INSERT INTO `" . BIT_DB_PREFIX . "shoutbox`( `shout_message`, `shout_user_id`, `to_user_id`, `shout_time`, `shout_sum`, `shout_ip`) VALUES (?,?,?,?,?,?)";
             $bindvars = array($pParamHash['shout_message'], $pParamHash['shout_user_id'], $pParamHash['to_user_id'], (int) $now, $shoutSum, $_SERVER['REMOTE_ADDR']);
             // inform the user user that a message has been posted
             if ($pParamHash['to_user_id'] != ROOT_USER_ID && $pParamHash['to_user_id'] != ANONYMOUS_USER_ID && $gBitSystem->isFeatureActive('shoutbox_email_notice')) {
                 $gToUser = new BitPermUser($pParamHash['to_user_id']);
                 $gToUser->load();
                 $gFromUser = new BitPermUser($pParamHash['shout_user_id']);
                 $gFromUser->load();
                 $gBitSmarty->assign('fromUser', $gFromUser->getDisplayName(TRUE));
                 $gBitSmarty->assign('sendShoutMessage', $pParamHash['shout_message']);
                 $mail_data = $gBitSmarty->fetch('bitpackage:shoutbox/shoutbox_send_notice.tpl');
                 $headers = 'MIME-Version: 1.0' . "\r\n";
                 $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
                 $headers .= "From: " . $gBitSystem->getConfig('site_sender_email') . "\r\n";
                 mail($gToUser->mInfo['email'], tra('A new shoutbox message for you at') . ' ' . $_SERVER["SERVER_NAME"] . ' ' . date('Y-m-d'), $mail_data, $headers);
             }
         }
         $result = $this->mDb->query($query, $bindvars);
     }
     return count($this->mErrors) == 0;
 }