Ejemplo n.º 1
0
/**
 * $Id: search.inc.php,v 1.3 2005/04/19 18:21:14 fx2024 Exp $
 * Module: SmartMedia
 * Author: The SmartFactory <www.smartfactory.ca>
 * Licence: GNU
 */
function smartclient_search($queryarray, $andor, $limit, $offset, $userid)
{
    // This must contain the name of the folder in which reside SmartClient
    if (!defined("SMARTCLIENT_DIRNAME")) {
        define("SMARTCLIENT_DIRNAME", 'smartclient');
    }
    include_once XOOPS_ROOT_PATH . '/modules/' . SMARTCLIENT_DIRNAME . '/include/common.php';
    $ret = array();
    if (!isset($client_handler)) {
        $client_handler =& smartclient_gethandler('client');
    }
    // Searching the clients
    $clients_result = $client_handler->getObjectsForSearch($queryarray, $andor, $limit, $offset, $userid);
    if ($queryarray == '') {
        $keywords = '';
        $hightlight_key = '';
    } else {
        $keywords = implode('+', $queryarray);
        $hightlight_key = "&amp;keywords=" . $keywords;
    }
    foreach ($clients_result as $result) {
        $item['image'] = "images/links/client.gif";
        $item['link'] = "client.php?id=" . $result['id'] . $hightlight_key;
        $item['title'] = "" . $result['title'];
        $item['time'] = "";
        $item['uid'] = "";
        $ret[] = $item;
        unset($item);
    }
    return $ret;
}
Ejemplo n.º 2
0
function b_marquee_smartclient($limit, $dateformat, $itemssize)
{
    $block = array();
    if (!defined("SMARTCLIENT_DIRNAME")) {
        define("SMARTCLIENT_DIRNAME", 'smartclient');
    }
    include_once XOOPS_ROOT_PATH . "/modules/" . SMARTCLIENT_DIRNAME . "/include/common.php";
    // Creating the client handler object
    $client_handler =& smartclient_gethandler('client');
    $clientsObj =& $client_handler->getClients($limit, 0, _SCLIENT_STATUS_ACTIVE, 'title', 'ASC');
    if ($clientsObj) {
        for ($i = 0; $i < count($clientsObj); $i++) {
            if ($itemssize > 0) {
                $title = xoops_substr($clientsObj[$i]->title(), 0, $itemssize);
            } else {
                $title = $clientsObj[$i]->title();
            }
            $block[] = array('date' => '', 'category' => '', 'author' => '', 'title' => $title, 'link' => "<a href='" . XOOPS_URL . '/modules/smartclient/client.php?id=' . $clientsObj[$i]->id() . "'>" . $title . '</a>');
        }
    }
    return $block;
}
Ejemplo n.º 3
0
<?php

/**
 * $Id: common.php,v 1.4 2005/04/19 18:20:56 fx2024 Exp $
 * Module: SmartClient
 * Author: The SmartFactory <www.smartfactory.ca>
 * Licence: GNU
 */
// This must contain the name of the folder in which reside SmartClient
if (!defined("SMARTCLIENT_DIRNAME")) {
    define("SMARTCLIENT_DIRNAME", 'smartclient');
}
if (!defined("SMARTCLIENT_URL")) {
    define("SMARTCLIENT_URL", XOOPS_URL . '/modules/' . SMARTCLIENT_DIRNAME . '/');
}
if (!defined("SMARTCLIENT_ROOT_PATH")) {
    define("SMARTCLIENT_ROOT_PATH", XOOPS_ROOT_PATH . '/modules/' . SMARTCLIENT_DIRNAME . '/');
}
include_once SMARTCLIENT_ROOT_PATH . "include/functions.php";
include_once SMARTCLIENT_ROOT_PATH . "class/keyhighlighter.class.php";
// Creating the client handler object
$client_handler =& smartclient_gethandler('client');
Ejemplo n.º 4
0
<?php

/**
 * $Id: index.php,v 1.6 2005/05/26 15:26:15 fx2024 Exp $
 * Module: SmartClient
 * Author: The SmartFactory <www.smartfactory.ca>
 * Licence: GNU
 */
include "header.php";
$xoopsOption['template_main'] = 'smartclient_index.html';
include XOOPS_ROOT_PATH . "/header.php";
include "footer.php";
global $myts;
// Creating the client handler object
$client_handler =& smartclient_gethandler('client', SMARTCLIENT_DIRNAME);
// At which record shall we start
$start = isset($_GET['start']) ? intval($_GET['start']) : 0;
$clients_total = $client_handler->getClientCount();
$clientsObj =& $client_handler->getClients($xoopsModuleConfig['perpage_user'], $start, _SCLIENT_STATUS_ACTIVE, $xoopsModuleConfig['index_sortby'], $xoopsModuleConfig['index_orderby']);
$clients_total_onpage = count($clientsObj);
$clients = array();
if ($clientsObj) {
    for ($i = 0; $i < $clients_total_onpage; $i++) {
        $client = array();
        $client = $clientsObj[$i]->toArray();
        $clients[] = $client;
    }
}
$xoopsTpl->assign('clients', $clients);
// Clients Navigation Bar
$pagenav = new XoopsPageNav($clients_total, $xoopsModuleConfig['perpage_user'], $start, 'start', '');
Ejemplo n.º 5
0
/**
 * $Id: clients_list.php,v 1.3 2005/04/23 13:20:10 malanciault Exp $
 * Module: SmartClient
 * Author: The SmartFactory <www.smartfactory.ca>
 * Licence: GNU
 */
function b_clients_list_show($options)
{
    // This must contain the name of the folder in which reside SmartClient
    if (!defined("SMARTCLIENT_DIRNAME")) {
        define("SMARTCLIENT_DIRNAME", 'smartclient');
    }
    include_once XOOPS_ROOT_PATH . "/modules/" . SMARTCLIENT_DIRNAME . "/include/common.php";
    // Creating the client handler object
    $client_handler =& smartclient_gethandler('client');
    if ($options[2]) {
        // Randomize
        $clientsObj =& $client_handler->getClients(0, 0, _SCLIENT_STATUS_ACTIVE);
        if (count($clientsObj) > 1) {
            $key_arr = array_keys($clientsObj);
            $key_rand = array_rand($key_arr, count($key_arr));
            for ($i = 0; $i < count($clientsObj) && $i < $options[3]; $i++) {
                $newObjs[$i] = $clientsObj[$key_rand[$i]];
            }
            $clientsObj = $newObjs;
        }
    } else {
        $clientsObj =& $client_handler->getClients($options[3], 0, _SCLIENT_STATUS_ACTIVE, $options[5], $options[6]);
        if (count($clientsObj) > 1 && $options[2] == 1) {
            $key_arr = array_keys($clientsObj);
            $key_rand = array_rand($key_arr, count($key_arr));
            for ($i = 0; $i < count($clientsObj); $i++) {
                $newObjs[$i] = $clientsObj[$key_rand[$i]];
            }
            $clientsObj = $newObjs;
        }
    }
    $block = array();
    if ($clientsObj) {
        for ($i = 0; $i < count($clientsObj); $i++) {
            $client['id'] = $clientsObj[$i]->id();
            $client['urllink'] = $clientsObj[$i]->getUrlLink('block');
            if ($clientsObj[$i]->image() && ($options[4] == 1 || $options[4] == 3)) {
                $client['image'] = $clientsObj[$i]->getImageUrl();
            }
            if ($clientsObj[$i]->image() && ($options[4] == 2 || $options[4] == 3)) {
                $client['title'] = $clientsObj[$i]->title();
            } else {
                $client['title'] = '';
            }
            $smartConfig =& smartclient_getModuleConfig();
            $image_info = smartclient_imageResize($clientsObj[$i]->getImagePath(), $smartConfig['img_max_width'], $smartConfig['img_max_height']);
            $client['img_attr'] = $image_info[3];
            $client['extendedInfo'] = $clientsObj[$i]->extentedInfo();
            $block['clients'][] = $client;
        }
        if ($options[0] == 1) {
            $block['insertBr'] = true;
        }
        if ($options[1] == 1) {
            $block['fadeImage'] = 'style="filter:alpha(opacity=20);" onmouseover="nereidFade(this,100,30,5)" onmouseout="nereidFade(this,50,30,5)"';
        }
        $block['see_all'] = $options[7];
        $block['lang_see_all'] = _MB_SCLIENT_LANG_SEE_ALL;
        $block['smartclient_url'] = SMARTCLIENT_URL;
    }
    return $block;
}