Exemple #1
0
function smartsection_items_recent_show($options)
{
    include_once XOOPS_ROOT_PATH . "/modules/smartsection/include/common.php";
    $myts =& MyTextSanitizer::getInstance();
    $smartModule =& smartsection_getModuleInfo();
    $block = array();
    $selectedcatids = explode(',', $options[0]);
    if (in_array(0, $selectedcatids)) {
        $allcats = true;
    } else {
        $allcats = false;
    }
    $sort = $options[1];
    $order = smartsection_getOrderBy($sort);
    $limit = $options[2];
    $smartsection_item_handler =& smartsection_gethandler('item');
    // creating the ITEM objects that belong to the selected category
    if ($allcats) {
        $criteria = null;
    } else {
        $criteria = new CriteriaCompo();
        $criteria->add(new Criteria('categoryid', '(' . $options[0] . ')', 'IN'));
    }
    $itemsObj = $smartsection_item_handler->getItems($limit, $start, array(_SSECTION_STATUS_PUBLISHED), -1, $sort, $order, '', true, $criteria, true);
    $totalItems = count($itemsObj);
    if ($itemsObj) {
        for ($i = 0; $i < $totalItems; $i++) {
            $newItems['itemid'] = $itemsObj[$i]->itemid();
            $newItems['title'] = $itemsObj[$i]->title();
            $newItems['categoryname'] = $itemsObj[$i]->getCategoryName();
            $newItems['categoryid'] = $itemsObj[$i]->categoryid();
            $newItems['date'] = $itemsObj[$i]->datesub();
            $newItems['poster'] = xoops_getLinkedUnameFromId($itemsObj[$i]->uid());
            $newItems['itemlink'] = $itemsObj[$i]->getItemLink(false, isset($options[3]) ? $options[3] : 65);
            $newItems['categorylink'] = $itemsObj[$i]->getCategoryLink();
            $block['items'][] = $newItems;
        }
        $block['lang_title'] = _MB_SSECTION_ITEMS;
        $block['lang_category'] = _MB_SSECTION_CATEGORY;
        $block['lang_poster'] = _MB_SSECTION_POSTEDBY;
        $block['lang_date'] = _MB_SSECTION_DATE;
        $modulename = $myts->makeTboxData4Show($smartModule->getVar('name'));
        $block['lang_visitItem'] = _MB_SSECTION_VISITITEM . " " . $modulename;
    }
    return $block;
}
Exemple #2
0
function smartsection_date_to_date_show($options)
{
    include_once XOOPS_ROOT_PATH . "/modules/smartsection/include/common.php";
    $myts =& MyTextSanitizer::getInstance();
    $smartModule =& smartsection_getModuleInfo();
    $block = array();
    $fromArray = explode('/', $options[0]);
    //month, day, year
    $fromStamp = mktime(0, 0, 0, $fromArray[0], $fromArray[1], $fromArray[2]);
    $untilArray = explode('/', $options[1]);
    $untilStamp = mktime(0, 0, 0, $untilArray[0], $untilArray[1], $untilArray[2]);
    $criteria = new CriteriaCompo();
    $criteria->add(new Criteria('datesub', $fromStamp, '>'));
    $criteria->add(new Criteria('datesub', $untilStamp, '<'));
    $criteria->setSort('datesub');
    $criteria->setOrder('DESC');
    $smartsection_item_handler =& smartsection_gethandler('item');
    // creating the ITEM objects that belong to the selected category
    $itemsObj = $smartsection_item_handler->getObjects($criteria);
    $totalItems = count($itemsObj);
    if ($itemsObj) {
        for ($i = 0; $i < $totalItems; $i++) {
            $newItems['itemid'] = $itemsObj[$i]->itemid();
            $newItems['title'] = $itemsObj[$i]->title();
            $newItems['categoryname'] = $itemsObj[$i]->getCategoryName();
            $newItems['categoryid'] = $itemsObj[$i]->categoryid();
            $newItems['date'] = $itemsObj[$i]->datesub();
            $newItems['poster'] = xoops_getLinkedUnameFromId($itemsObj[$i]->uid());
            $newItems['itemlink'] = $itemsObj[$i]->getItemLink(false, isset($options[3]) ? $options[3] : 65);
            $newItems['categorylink'] = $itemsObj[$i]->getCategoryLink();
            $block['items'][] = $newItems;
        }
        $block['lang_title'] = _MB_SSECTION_ITEMS;
        $block['lang_category'] = _MB_SSECTION_CATEGORY;
        $block['lang_poster'] = _MB_SSECTION_POSTEDBY;
        $block['lang_date'] = _MB_SSECTION_DATE;
        $modulename = $myts->makeTboxData4Show($smartModule->getVar('name'));
        $block['lang_visitItem'] = _MB_SSECTION_VISITITEM . " " . $modulename;
        $block['lang_articles_from_to'] = sprintf(_MB_SSECTION_ARTICLES_FROM_TO, $options[0], $options[1]);
    }
    return $block;
}
/**
* $Id: items_recent.php,v 1.2 2005/08/02 03:47:51 mauriciodelima Exp $
* Module: SmartSection
* Author: The SmartFactory <www.smartfactory.ca>
* Licence: GNU
*/
function b_items_recent_show($options)
{
    include_once XOOPS_ROOT_PATH . "/modules/smartsection/include/common.php";
    $myts =& MyTextSanitizer::getInstance();
    $smartModule =& ss_getModuleInfo();
    $block = array();
    if ($options[0] == 0) {
        $categoryid = -1;
    } else {
        $categoryid = $options[0];
    }
    $sort = $options[1];
    $order = smartsection_getOrderBy($sort);
    $limit = $options[2];
    $smartsection_item_handler =& ss_gethandler('item');
    // creating the ITEM objects that belong to the selected category
    $itemsObj = $smartsection_item_handler->getAllPublished($limit, 0, $categoryid, $sort, $order);
    $totalItems = count($itemsObj);
    if ($itemsObj) {
        for ($i = 0; $i < $totalItems; $i++) {
            $newItems['itemid'] = $itemsObj[$i]->itemid();
            $newItems['title'] = $itemsObj[$i]->title();
            $newItems['categoryname'] = $itemsObj[$i]->getCategoryName();
            $newItems['categoryid'] = $itemsObj[$i]->categoryid();
            $newItems['date'] = $itemsObj[$i]->datesub();
            $newItems['poster'] = xoops_getLinkedUnameFromId($itemsObj[$i]->uid());
            $block['items'][] = $newItems;
        }
        $block['lang_title'] = _MB_SS_ITEMS;
        $block['lang_category'] = _MB_SS_CATEGORY;
        $block['lang_poster'] = _MB_SS_POSTEDBY;
        $block['lang_date'] = _MB_SS_DATE;
        $modulename = $myts->makeTboxData4Show($smartModule->getVar('name'));
        $block['lang_visitItem'] = _MB_SS_VISITITEM . " " . $modulename;
    }
    return $block;
}
function b_marquee_smartsection($limit, $dateformat, $itemssize)
{
    include_once XOOPS_ROOT_PATH . '/modules/smartsection/include/common.php';
    $myts =& MyTextSanitizer::getInstance();
    $smartModule =& smartsection_getModuleInfo();
    $block = array();
    $categoryid = -1;
    $sort = 'datesub';
    $order = smartsection_getOrderBy($sort);
    $smartsection_item_handler =& smartsection_gethandler('item');
    $itemsObj = $smartsection_item_handler->getAllPublished($limit, 0, $categoryid, $sort, $order);
    $totalItems = count($itemsObj);
    if ($itemsObj) {
        for ($i = 0; $i < $totalItems; $i++) {
            if ($itemssize > 0) {
                $title = xoops_substr($itemsObj[$i]->title(), 0, $itemssize + 3);
            } else {
                $title = $itemsObj[$i]->title();
            }
            $block[] = array('date' => $itemsObj[$i]->datesub(), 'category' => $itemsObj[$i]->getCategoryName(), 'author' => xoops_getLinkedUnameFromId($itemsObj[$i]->uid()), 'title' => $title, 'link' => "<a href='" . XOOPS_URL . '/modules/smartsection/item.php?itemid=' . $itemsObj[$i]->itemid() . "'>" . $title . '</a>');
        }
    }
    return $block;
}
Exemple #5
0
function entryEdit( $entryID = '' )
	{
	global $xoopsUser,$xoopsConfig,$xoopsModuleConfig,$mydirname,$MYDIRNAME,$spaw_root,$cat_table,$ent_table,$xoopsGTicket; 
	$xoopsDB =& Database::getInstance();
	$xoopsModule = XoopsModule::getByDirname("$mydirname");
	$myts =& MyTextSanitizer::getInstance();

	$op = 'default';
	if ( !empty( $_GET['op'] ) ) $op = trim($_GET['op']);
	if ( !empty( $_POST['op'] ) ) $op = trim($_POST['op']);
	$entryID = !empty( $_GET['entryID'] ) ? intval($_GET['entryID']) : '';
	/**
	 * Clear all variables before we start
	 */
	if(!isset($block)) { $block = 0; }
	if(!isset($html)) { $html = 0; }
	if(!isset($smiley)) { $smiley = 0; }
	if(!isset($xcodes)) { $xcodes = 0; }
	if(!isset($breaks)) { $breaks = 0; }
	if(!isset($offline)) { $offline = 0; }
	if(!isset($submit)) { $submit = 0; }
	if(!isset($request)) { $request = 0; }
	if(!isset($notifypub)) { $notifypub = 0; }
	if(!isset($categoryID)) { $categoryID = 0; }
	if(!isset($term)) { $term = ""; }
	if(!isset($proc)) { $proc = ""; }
	if(!isset($definition)) 
		{
		$definition = constant("_AM_{$MYDIRNAME}_WRITEHERE");	
		}
	if(!isset($ref)) { $ref = ""; }
	if(!isset($url)) { $url = ""; }
	if(!isset($renewdate)) { $renewdate = 0; }
	if(!isset($datesub)) { $datesub = 0; }

	// If there is a parameter, and the id exists, retrieve data: were editing an entry
	if ( $entryID > 0 )
		{
		$result = $xoopsDB -> query( "SELECT categoryID, term, proc, definition, ref, url, uid, submit, datesub, html, smiley, xcodes, breaks, block, offline, notifypub, request FROM $ent_table WHERE entryID = '$entryID'" );
		list( $categoryID, $term, $proc, $definition, $ref, $url, $uid, $submit, $datesub, $html, $smiley, $xcodes, $breaks, $block, $offline, $notifypub, $request ) = $xoopsDB -> fetchrow( $result );

		if ( !$xoopsDB -> getRowsNum( $result ) )
			{
			redirect_header( "index.php", 1, constant("_AM_{$MYDIRNAME}_NOENTRYTOEDIT") );
			}

		$term = $myts -> htmlspecialchars($term);
		if ($proc)
			{
			list($temp,$proc) = explode(",",$proc);
			}
		$proc = $myts -> htmlSpecialChars($proc);
		$ref = $myts -> htmlSpecialChars($ref);
		$url = $myts -> htmlSpecialChars($url);

		$datesub = intval( $datesub );
		$block = intval( $block );
		$html = intval( $html );
		$smiley = intval( $smiley );
		$xcodes = intval( $xcodes );
		$breaks = intval( $breaks );
		$notifypub = intval( $notifypub );

		xoops_cp_header();
		adminMenu(2, constant("_AM_{$MYDIRNAME}_ENTRIES")."&nbsp;&raquo;&nbsp;".constant("_AM_{$MYDIRNAME}_MODIFY"));
		include('./mymenu.php');
		echo "<fieldset style='margin:1em 0em 0em 0em;border:1px solid #778;'><legend style='font-weight: bold; color: #900;'>" . constant("_AM_{$MYDIRNAME}_ENTRIES") . "</legend><br />\n";
		$sform = new XoopsThemeForm( constant("_AM_{$MYDIRNAME}_MODENTRY") . ": " .$myts -> htmlSpecialChars($term) , "op", xoops_getenv( 'PHP_SELF' ) );
		} 
	else // there's no parameter, so we're adding an entry
		{
		$result01 = $xoopsDB -> query( "SELECT COUNT(*) FROM $cat_table" );
		list( $totalcats ) = $xoopsDB -> fetchRow( $result01 );
		if ( $totalcats == 0 && $xoopsModuleConfig['multicats'] == 1 )
			{
			redirect_header( "index.php", 1, constant("_AM_{$MYDIRNAME}_NEEDONECOLUMN") );
			}
		xoops_cp_header();
		adminMenu(2, constant("_AM_{$MYDIRNAME}_ENTRIES")."&nbsp;&raquo;&nbsp;".constant("_AM_{$MYDIRNAME}_ADMINENTRYMNGMT"));
		include('./mymenu.php');
		echo "<fieldset style='margin:1em 0em 0em 0em;border:1px solid #778;'><legend style='font-weight: bold; color: #900;'>" . constant("_AM_{$MYDIRNAME}_ENTRIES") . "</legend><br />\n";
		$uid = $xoopsUser->getVar('uid');
		$sform = new XoopsThemeForm( constant("_AM_{$MYDIRNAME}_NEWENTRY"), "op", xoops_getenv( 'PHP_SELF' ) );
		$html = $smiley = $xcodes = $breaks = 1;
		}

	$sform -> setExtra( 'enctype="multipart/form-data"' );

	// Author selector
	ob_start();
	echo	xoops_getLinkedUnameFromId( intval($uid) );
	$sform -> addElement( new XoopsFormLabel( constant("_AM_{$MYDIRNAME}_AUTHOR"), ob_get_contents() ) );
	ob_end_clean();

	// Category selector
	if ($xoopsModuleConfig['multicats'] == 1)
		{
		$mytree = new XoopsTree( $cat_table, "categoryID" , "0" );

		ob_start();
//okino		$sform -> addElement( new XoopsFormHidden( 'categoryID', intval($categoryID) ) );
		$mytree -> makeMySelBox( "name", "weight", $categoryID );
		$sform -> addElement( new XoopsFormLabel( constant("_AM_{$MYDIRNAME}_CATNAME"), ob_get_contents() ) );
		ob_end_clean();
		}

	// Term, definition, reference and related URL
	$sform -> addElement( new XoopsFormText( constant("_AM_{$MYDIRNAME}_ENTRYTERM"), 'term', 50, 80, $term), true );
	$sform -> addElement( new XoopsFormText( constant("_AM_{$MYDIRNAME}_ENTRYPROC"), 'proc', 50, 80, $proc), true );

	if( !empty( $_GET['usespaw'] ) && $spaw_root )
		{
		// SPAW Config
		include_once $spaw_root."spaw_control.class.php";
		ob_start() ;
		$sw = new SPAW_Wysiwyg( 'definition', $definition, _LANGCODE, 'full', 'default', '100%', '400px' );
		$def_block = new XoopsFormLabel( constant("_AM_{$MYDIRNAME}_ENTRYDEF")."[<a href=\"".xoops_getenv( 'PHP_SELF')."?op=$op&amp;entryID=$entryID\" title=\"".constant("_AM_{$MYDIRNAME}_BB")."\">".constant("_AM_{$MYDIRNAME}_SPAWTOBB")."</a>]" , $sw->getHtml() ) ;
		ob_end_clean() ;
		}
	elseif( $spaw_root )
		{
		$def_block = new XoopsFormDhtmlTextArea( constant("_AM_{$MYDIRNAME}_ENTRYDEF")."[<a href=\"".xoops_getenv( 'PHP_SELF')."?op=$op&amp;entryID=$entryID&amp;usespaw=1\" title=\"".constant("_AM_{$MYDIRNAME}_SPAW")."\">".constant("_AM_{$MYDIRNAME}_BBTOSPAW")."</a>]", 'definition', $myts -> htmlSpecialChars($definition), 15, 60 );
		}
	else
		{
		$def_block = new XoopsFormDhtmlTextArea( constant("_AM_{$MYDIRNAME}_ENTRYDEF"), 'definition', $myts -> htmlSpecialChars($definition), 15, 60 );
		}
	if ($definition == constant("_AM_{$MYDIRNAME}_WRITEHERE"))
		{
		$def_block -> setExtra( 'onfocus="this.select()"' );
		}
	$sform -> addElement ( $def_block );

	if ($xoopsModuleConfig['allowedtypes'])
		{
		$butt_upfile = new XoopsFormButton( constant("_AM_{$MYDIRNAME}_UPFILES"), '', constant("_AM_{$MYDIRNAME}_UPLOADOPEN"), 'button' );
		$butt_upfile->setExtra('onclick="window.open (\'upload.php\', \'wbupload\', \'width=550,height=360,location=0,menubar=0,resizable=1,scrollbars=yes,status=1,toolbar=0\')"');
		$sform->addElement( $butt_upfile );
		}

	$sform -> addElement( new XoopsFormTextArea( constant("_AM_{$MYDIRNAME}_ENTRYREFERENCE"), 'ref', $ref, 5, 60 ), false );
	$sform -> addElement( new XoopsFormText( constant("_AM_{$MYDIRNAME}_ENTRYURL"), 'url', 50, 80, $url ), false );

	// Code to take entry offline, for maintenance purposes
	$offline_radio = new XoopsFormRadioYN(constant("_AM_{$MYDIRNAME}_SWITCHOFFLINE"), 'offline', intval($offline), ' '.constant("_AM_{$MYDIRNAME}_YES").'', ' '.constant("_AM_{$MYDIRNAME}_NO").'');
	$sform -> addElement($offline_radio);

	// Code to put entry in block
//	$block_radio = new XoopsFormRadioYN( _AM_XWORDS_BLOCK, 'block', $block , ' ' . _AM_XWORDS_YES . '', ' ' . _AM_XWORDS_NO . '' );
//	$sform -> addElement( $block_radio );

	if ( $entryID > 0)
		{
		$renewdate_checkbox = new XoopsFormCheckBox( constant("_AM_{$MYDIRNAME}_ENTRYCREATED")."<br /><span style='font-size: xx-small; font-weight: normal;'>(".constant("_AM_{$MYDIRNAME}_RENEWDATE_DEFAULT").formatTimestamp($datesub).")</span>", 'renewdate', $renewdate );
		$renewdate_checkbox -> addOption( 1, constant("_AM_{$MYDIRNAME}_RENEWDATE")."<br />".getSetTimeForm($datesub) );
		}
	else
		{
		$renewdate_checkbox = new XoopsFormCheckBox( constant("_AM_{$MYDIRNAME}_ENTRYCREATED")."<br /><span style='font-size: xx-small; font-weight: normal;'>(".constant("_AM_{$MYDIRNAME}_RENEWDATE_DEFAULT").formatTimestamp(time()).")</span>", 'renewdate', $renewdate );
		$renewdate_checkbox -> addOption( 1, constant("_AM_{$MYDIRNAME}_SETNEWDATE")."<br />".getSetTimeForm(time()) );
		}
	$sform -> addElement( $renewdate_checkbox );

	// VARIOUS OPTIONS
	$options_tray = new XoopsFormElementTray(constant("_AM_{$MYDIRNAME}_OPTIONS"),'<br />');

	$html_checkbox = new XoopsFormCheckBox( '', 'html', intval($html) );
	$html_checkbox -> addOption( 1, constant("_AM_{$MYDIRNAME}_DOHTML") );
	$options_tray -> addElement( $html_checkbox );

	$smiley_checkbox = new XoopsFormCheckBox( '', 'smiley', intval($smiley) );
	$smiley_checkbox -> addOption( 1, constant("_AM_{$MYDIRNAME}_DOSMILEY") );
	$options_tray -> addElement( $smiley_checkbox );

	$xcodes_checkbox = new XoopsFormCheckBox( '', 'xcodes', intval($xcodes) );
	$xcodes_checkbox -> addOption( 1, constant("_AM_{$MYDIRNAME}_DOXCODE") );
	$options_tray -> addElement( $xcodes_checkbox );

	$breaks_checkbox = new XoopsFormCheckBox( '', 'breaks', intval($breaks) );
	$breaks_checkbox -> addOption( 1, constant("_AM_{$MYDIRNAME}_BREAKS") );
	$options_tray -> addElement( $breaks_checkbox );
	$sform -> addElement( $options_tray );

	$button_tray = new XoopsFormElementTray( '', '' );
	$hidden = new XoopsFormHidden( 'op', 'addentry' );
	$button_tray -> addElement( $hidden );

	$hidden_date = new XoopsFormHidden( 'datesub', $datesub );
	$button_tray -> addElement( $hidden_date );

	$hidden_id = new XoopsFormHidden( 'entryID', $entryID );
	$button_tray -> addElement( $hidden_id );

	$hidden_uid = new XoopsFormHidden( 'uid', $uid );
	$button_tray -> addElement( $hidden_uid );

	$hidden_block = new XoopsFormHidden( 'block', $block );
	$button_tray -> addElement( $hidden_block );

	if ( !$entryID)
		{
		$hidden_renewdate = new XoopsFormHidden( 'renewdate', 1 );
		$button_tray -> addElement( $hidden_renewdate );
		}

	//PREVIEW(ver0.31)
	$butt_preview = new XoopsFormButton( '', '', constant("_AM_{$MYDIRNAME}_PREVIEWOPEN"), 'button' );
	$butt_preview->setExtra('onclick="document.op.action=\'../preview.php\';document.op.target=\'_blank\';document.op.submit();"');
	$button_tray->addElement( $butt_preview );

	if ( !$entryID ) // therez no entryID? Then its a new entry
		{
		$butt_create = new XoopsFormButton( '', '', constant("_AM_{$MYDIRNAME}_CREATE"), 'submit' );
		$butt_create->setExtra('onclick="document.op.action=\'./entry.php\';document.op.target=\'_self\';this.form.elements.op.value=\'addentry\'"');
		$button_tray->addElement( $butt_create );

		$butt_clear = new XoopsFormButton( '', '', constant("_AM_{$MYDIRNAME}_CLEAR"), 'reset' );
		$button_tray->addElement( $butt_clear );

		$butt_cancel = new XoopsFormButton( '', '', constant("_AM_{$MYDIRNAME}_CANCEL"), 'button' );
		$butt_cancel->setExtra('onclick="history.go(-1)"');
		$button_tray->addElement( $butt_cancel );
		} 
	else // else, were editing an existing entry
		{
		$butt_create = new XoopsFormButton( '', '', constant("_AM_{$MYDIRNAME}_MODIFY"), 'submit' );
		$butt_create->setExtra('onclick="document.op.action=\'./entry.php\';document.op.target=\'_self\';this.form.elements.op.value=\'addentry\'"');
		$button_tray->addElement( $butt_create );

		$butt_cancel = new XoopsFormButton( '', '', constant("_AM_{$MYDIRNAME}_CANCEL"), 'button' );
		$butt_cancel->setExtra('onclick="history.go(-1)"');
		$button_tray->addElement( $butt_cancel );
		}

	$button_tray->addElement( $xoopsGTicket->getTicketXoopsForm( __LINE__ ) );//GIJ
	$sform -> addElement( $button_tray );
	$sform -> display();

	unset( $hidden );
	echo "</fieldset>\n";
	xoops_cp_footer();
	}
$breadcrumbs->set(_MD_CCENTER_RECEPTION, "reception.php");
if ($xoopsDB->getRowsNum($res) > 1) {
    include XOOPS_ROOT_PATH . "/header.php";
    $xoopsOption['template_main'] = "ccenter_reception.html";
    $breadcrumbs->assign();
    $forms = array();
    $member_handler =& xoops_gethandler('member');
    $groups = $member_handler->getGroupList(new Criteria('groupid', XOOPS_GROUP_ANONYMOUS, '!='));
    while ($form = $xoopsDB->fetchArray($res)) {
        $form['title'] = htmlspecialchars($form['title']);
        $form['ltime'] = $form['ltime'] ? formatTimestamp($form['ltime']) : "";
        if ($form['priuid']) {
            if ($form['priuid'] < 0) {
                $form['contact'] = '[' . $groups[-$form['priuid']] . ']';
            } else {
                $form['contact'] = xoops_getLinkedUnameFromId($form['priuid']);
            }
        } elseif ($form['cgroup']) {
            $form['contact'] = '[' . $groups[$form['cgroup']] . ']';
        } else {
            $form['contact'] = _MD_CONTACT_NOTYET;
        }
        $forms[] = $form;
    }
    $xoopsTpl->assign('forms', $forms);
    include XOOPS_ROOT_PATH . "/footer.php";
    exit;
}
// check access permition
$form = $xoopsDB->fetchArray($res);
if (!cc_check_perm($form)) {
}
// recording contactee access time
$now = time();
if ($uid == $data['uid'] && $now > $data['atime']) {
    $xoopsDB->queryF("UPDATE " . CCMES . " SET atime={$now} WHERE msgid={$msgid}");
}
include XOOPS_ROOT_PATH . "/header.php";
$breadcrumbs = new XoopsBreadcrumbs(_MD_CCENTER_RECEPTION, 'reception.php');
$pass = isset($_GET['p']) ? $_GET['p'] : '';
$add = $pass ? "p=" . urlencode($pass) : "";
$to_uname = XoopsUser::getUnameFromId($data['touid']);
$res = $xoopsDB->query("SELECT * FROM " . FORMS . " WHERE formid=" . $data['fidref']);
$form = $xoopsDB->fetchArray($res);
$items = get_form_attribute($form['defs']);
$raws = unserialize_text($data['body']);
$values = cc_display_values($raws, $items, $data['msgid'], $add);
$data['comment'] = $myts->displayTarea($data['comment']);
$isadmin = $uid && $xoopsUser->isAdmin($xoopsModule->getVar('mid'));
$title = $data['title'];
if ($isadmin) {
    $breadcrumbs->set($title, "reception.php?form=" . $data['fidref']);
} else {
    $breadcrumbs->set($title, "index.php?form=" . $data['fidref']);
}
list($lab) = array_keys($raws);
$breadcrumbs->set($lab . ': ' . $raws[$lab], '');
$breadcrumbs->assign();
$has_mail = !empty($data['email']);
$xoopsTpl->assign(array('subject' => $title, 'sender' => xoops_getLinkedUnameFromId($data['uid']), 'sendto' => $data['touid'] ? xoops_getLinkedUnameFromId($data['touid']) : _MD_CONTACT_NOTYET, 'cdate' => formatTimestamp($data['ctime']), 'mdate' => myTimestamp($data['mtime'], 'l', _MD_TIME_UNIT), 'adate' => myTimestamp($data['atime'], 'l', _MD_TIME_UNIT), 'readit' => $data['atime'] >= $data['mtime'], 'data' => $data, 'items' => $values, 'status' => $msg_status[$data['status']], 'is_eval' => is_cc_evaluate($msgid, $uid, $pass), 'is_mine' => $data['touid'] == $uid, 'is_getmine' => $data['touid'] == 0 && $uid && in_array($data['cgroup'], $xoopsUser->getGroups()), 'own_status' => array_slice($msg_status, 1, $isadmin ? 4 : 3), 'xoops_pagetitle' => htmlspecialchars($xoopsModule->getVar('name') . " | " . $data['title']), 'has_mail' => $has_mail));
include XOOPS_ROOT_PATH . '/include/comment_view.php';
include XOOPS_ROOT_PATH . "/footer.php";
Exemple #8
0
echo "<td width='90' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_SUBMITTER") . "</b></td>";
echo "<td width='90' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_ENTRYCREATED") . "</b></td>";
echo "<td width='60' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_ACTION") . "</b></td>";
echo "</tr>";

$resultS1 = $xoopsDB -> query("SELECT COUNT(*) FROM $ent_table WHERE offline = '1'");
list( $numrows ) = $xoopsDB -> fetchRow( $resultS1 );

if ( $numrows > 0 ) // That is, if there ARE submitted entries in the system
	{
	$sql = "SELECT e.entryID, e.categoryID, e.term, e.uid, e.datesub, c.name FROM $ent_table e LEFT JOIN $cat_table c ON e.categoryID = c.categoryID WHERE offline = '1' ORDER BY datesub DESC";
	$resultS2 = $xoopsDB -> query( $sql, $xoopsModuleConfig['perpage'], $startsub );

	while ( list( $entryID, $categoryID, $term, $uid, $created, $name ) = $xoopsDB -> fetchrow( $resultS2 ) )
		{
		$sentby = xoops_getLinkedUnameFromId(intval($uid));
		$entryID = intval($entryID);
		$categoryID = intval($categoryID);
		$catname = $myts -> htmlSpecialChars( $name );
		$term = $myts -> htmlSpecialChars( $term );
		$created = formatTimestamp( $created, 's' );
		$modify = "<a href='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/admin/entry.php?op=mod&amp;entryID=" . $entryID . "'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/edit.gif' border='0' width='20' height='20' alt='".constant("_AM_{$MYDIRNAME}_EDITSUBM")."' /></a>";
		$delete = "<a href='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/admin/entry.php?op=del&amp;entryID=" . $entryID . "'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/delete.gif' border='0' width='20' height='20' alt='".constant("_AM_{$MYDIRNAME}_DELETESUBM")."' /></a>";
		echo "<tr>";
		echo "<td class='head' align='center'> $entryID </td>";
		if ($xoopsModuleConfig['multicats'] == 1)
			{
			echo "<td class='even' align='left'> $catname </td>";
			}
		echo "<td class='even' align='left'> $term </td>";
		echo "<td class='even' align='center'> $sentby </td>";
function cc_message_entry($data, $link = "message.php")
{
    global $msg_status;
    $id = $data['msgid'];
    return array('msgid' => $id, 'mdate' => myTimestamp($data['mtime'], 'm', _MD_TIME_UNIT), 'title' => "<a href='message.php?id={$id}'>" . $data['title'] . "</a>", 'uname' => xoops_getLinkedUnameFromId($data['uid']), 'status' => $msg_status[$data['status']], 'raw' => $data);
}
if (isset($_GET['m'])) {
    $month = intval($_GET['m']);
}
if (isset($_GET['d'])) {
    $day = intval($_GET['d']);
}
if (!isset($_GET['m']) && !isset($_GET['d']) && $day < $bdef) {
    $month--;
}
if (!isset($_GET['d']) && time() < mktime($hour, $min)) {
    $day--;
}
include XOOPS_ROOT_PATH . '/header.php';
$xoopsOption['template_main'] = 'logtick_summary.html';
if (preg_match('/^\\d+$/', $uid)) {
    $title = sprintf(_MD_LOGTICK_SUMMARY, xoops_getLinkedUnameFromId($uid));
} else {
    $title = _MD_LOGTICK_SUM;
}
set_logtick_breadcrumbs(array(strip_tags($title) => 'summary.php'));
$xoopsTpl->assign('title', $title);
$sums = array();
get_summary($sums, $uid);
$labs = array(_MD_SUM_TOTAL);
if (is_numeric($uid)) {
    $cond = "luid={$uid}";
} elseif (preg_match('/^\\d+(,\\d+)+$/', $uid)) {
    $cond = "luid IN ({$uid})";
} else {
    $cond = "1";
}
Exemple #11
0
         if (!empty($bu) && preg_match("/" . $bu . "/i", $uname)) {
             $errors[] .= _US_NAMERESERVED . "<br />";
             break;
         }
     }
     $count = 0;
     if ($uname) {
         $sql = sprintf('SELECT COUNT(*) FROM %s WHERE uname = %s', icms::$xoopsDB->prefix('users'), icms::$xoopsDB->quoteString(addslashes($uname)));
         $result = icms::$xoopsDB->query($sql);
         list($count) = icms::$xoopsDB->fetchRow($result);
         if ($count > 1) {
             $errors[] .= _US_NICKNAMETAKEN . "<br />";
         }
     }
 }
 $username = xoops_getLinkedUnameFromId($uid);
 $password = $oldpass = '';
 if (!empty($_POST['password'])) {
     $password = icms_core_DataFilter::stripSlashesGPC(trim($_POST['password']));
     $oldpass = !empty($_POST['old_password']) ? icms_core_DataFilter::stripSlashesGPC(trim($_POST['old_password'])) : '';
 }
 if ($password !== '' && $_POST['change_pass'] == 1) {
     $member_handler = icms::handler('icms_member');
     if (!$member_handler->loginUser(addslashes($uname), addslashes($oldpass))) {
         $errors[] = _US_BADPWD;
     }
     if (strlen($password) < $icmsConfigUser['minpass']) {
         $errors[] = sprintf(_US_PWDTOOSHORT, $icmsConfigUser['minpass']);
     }
     $vpass = '';
     if (!empty($_POST['vpass'])) {
Exemple #12
0
		list($temp,$proc) = explode(",",$proc);
		}
	$thisterm['proc'] = $myts -> makeTboxData4Show( $proc );

	if ( !$xoopsModuleConfig['linktermsposition'] )
		{
		$thisterm['definition'] = $myts->displayTarea( $definition, intval($html), intval($smiley), intval($xcodes), 1, intval($breaks) );
		$thisterm['linkedterms'] = $myts->getAutoLinkTerms( $definition, intval($html), $mydirname, $entryID, 0 );
		}
	else
		{
		$thisterm['definition'] = $myts->displayTarea( $definition, intval($html), intval($smiley), intval($xcodes), 1, intval($breaks), $mydirname, $entryID );
		}
	$thisterm['ref'] = $myts -> makeTboxData4Show( $ref );
	$thisterm['url'] = $myts->makeClickable(formatURL($url), $allowimage = 0);
	$thisterm['submitter'] = xoops_getLinkedUnameFromId ( intval($uid) );
	if ( $xoopsModuleConfig['strfformat'] )
		{
		$thisterm['datesub'] = $myts->makeTboxData4Show(formatTimestamp(xoops_getUserTimestamp(intval($datesub)), $xoopsModuleConfig['strfformat']));
		}
	else
		{
		$thisterm['datesub'] = formatTimestampJ(xoops_getUserTimestamp(intval($datesub)));
		}
	$thisterm['counter'] = intval($counter);
	$thisterm['block'] = intval($block);
	$thisterm['notifypub'] = intval($notifypub);
	$thisterm['dir'] = $xoopsModule->dirname();

	if ( $xoopsModuleConfig['multicats'] == 1 )
		{
Exemple #13
0
function entryz()
	{
	include_once( XOOPS_ROOT_PATH . '/class/pagenav.php' );
	global $cat_table,$ent_table,$xoopsConfig,$xoopsModuleConfig,$xoopsModule,$MYDIRNAME; 
	$xoopsDB =& Database::getInstance();
	$myts =& MyTextSanitizer::getInstance();

	$startsub = !empty( $_GET['startsub'] ) ? intval( $_GET['startsub'] ) : 0;
	$entryID = !empty( $_GET['entryID'] ) ? intval($_GET['entryID']) : 0;
	xoops_cp_header();
	adminMenu(0, constant("_AM_{$MYDIRNAME}_AUTHORIZE"));
	include('./mymenu.php');

	/* -- Code to show submitted entries -- */
	echo "<fieldset style='margin:1em 0em 0em 0em;border:1px solid #778;'><legend style='font-weight: bold; color: #900;'>" . constant("_AM_{$MYDIRNAME}_SHOWSUBMISSIONS") . "</legend><br />";

	echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'>";
	echo "<tr>";
	echo "<td width='40' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_ENTRYID") . "</b></td>";
	if ($xoopsModuleConfig['multicats'] == 1)
		{
		echo "<td width='20%' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_ENTRYCATNAME") . "</b></td>";
		$colspan = 6;
		}
	else
		{
		$colspan = 5;
		}
	echo "<td class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_ENTRYTERM") . "</b></td>";
	echo "<td width='90' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_SUBMITTER") . "</b></td>";
	echo "<td width='90' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_ENTRYCREATED") . "</b></td>";
	echo "<td width='60' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_ACTION") . "</b></td>";
	echo "</tr>";

	$resultS1 = $xoopsDB -> query("SELECT COUNT(*) FROM $ent_table WHERE submit = '1'");
	list( $numrows ) = $xoopsDB -> fetchRow( $resultS1 );

	if ( $numrows > 0 ) // That is, if there ARE submitted entries in the system
		{
		$sql = "SELECT e.entryID, e.categoryID, e.term, e.uid, e.datesub, c.name FROM $ent_table e LEFT JOIN $cat_table c ON e.categoryID = c.categoryID WHERE submit = '1' ORDER BY datesub DESC";
		$resultS2 = $xoopsDB -> query( $sql, $xoopsModuleConfig['perpage'], $startsub );

		while ( list( $entryID, $categoryID, $term, $uid, $created, $name ) = $xoopsDB -> fetchrow( $resultS2 ) )
			{
			$sentby = xoops_getLinkedUnameFromId(intval($uid));
			$entryID = intval($entryID);
			$categoryID = intval($categoryID);
			$catname = $myts -> htmlSpecialChars( $name );
			$term = $myts -> htmlSpecialChars( $term );
			$created = formatTimestamp( $created, 's' );
			$modify = "<a href='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/admin/submissions.php?op=mod&amp;entryID=" . $entryID . "'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/edit.gif' border='0' width='20' height='20' alt='".constant("_AM_{$MYDIRNAME}_EDITSUBM")."' /></a>";
			$delete = "<a href='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/admin/submissions.php?op=del&amp;entryID=" . $entryID . "'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/delete.gif' border='0' width='20' height='20' alt='".constant("_AM_{$MYDIRNAME}_DELETESUBM")."' /></a>";
			echo "<tr>";
			echo "<td class='head' align='center'> $entryID </td>";
			if ($xoopsModuleConfig['multicats'] == 1)
				{
				echo "<td class='even' align='left'> $catname </td>";
				}
			echo "<td class='even' align='left'> $term </td>";
			echo "<td class='even' align='center'> $sentby </td>";
			echo "<td class='even' align='center'> $created </td>";
			echo "<td class='even' align='center'> $modify $delete </td>";
			echo "</tr>";
			}
		}
	else // that is, $numrows = 0, therez no columns yet
		{
		echo "<tr>";
		echo "<td class='head' align='center' colspan='".$colspan."'>".constant("_AM_{$MYDIRNAME}_NOSUBMISSYET")."</td>";
		echo "</tr>";
		}
	echo "</table>";
	$pagenav = new XoopsPageNav( $numrows, $xoopsModuleConfig['perpage'], $startsub, 'startsub', 'entryID =' . $entryID );
	echo "<div style='text-align:right;'>" . $pagenav -> renderNav() . "</div>";
	echo "</fieldset>";
	echo "<br />";

	/* -- Code to show requested entries -- */
	echo "<fieldset style='margin:1em 0em 0em 0em;border:1px solid #778;'><legend style='font-weight: bold; color: #900;'>" . constant("_AM_{$MYDIRNAME}_SHOWREQUESTS") . "</legend><br />";

	echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'>";
	echo "<tr>";
	echo "<td width='40' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_ENTRYID") . "</b></td>";
	echo "<td class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_ENTRYTERM") . "</b></td>";
	echo "<td width='90' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_SUBMITTER") . "</b></td>";
	echo "<td width='90' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_ENTRYCREATED") . "</b></td>";
	echo "<td width='60' class='bg3' align='center'><b>" . constant("_AM_{$MYDIRNAME}_ACTION") . "</b></td>";
	echo "</tr>";

	$resultS2 = $xoopsDB -> query( "SELECT COUNT(*) FROM $ent_table WHERE request = '1'" );
	list( $numrowsX ) = $xoopsDB -> fetchRow( $resultS2 );

	if ( $numrowsX > 0 ) // That is, if there ARE unauthorized articles in the system
		{
		$sql4 = "SELECT entryID, term, uid, datesub FROM $ent_table WHERE request = '1' ORDER BY datesub DESC";
		$resultS4 = $xoopsDB -> query( $sql4, $xoopsModuleConfig['perpage'], $startsub );

		while ( list( $entryID, $term, $uid, $created) = $xoopsDB -> fetchrow( $resultS4 ) )
			{
			$sentby = xoops_getLinkedUnameFromId(intval($uid));
			$entryID = intval($entryID);
			$term = $myts -> htmlSpecialChars( $term );
			$created = formatTimestamp( $created, 's' );
			$modify = "<a href='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/admin/submissions.php?op=mod&amp;entryID=" . $entryID . "'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/edit.gif' border='0' width='20' height='20' alt='".constant("_AM_{$MYDIRNAME}_EDITSUBM")."' /></a>";
			$delete = "<a href='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/admin/submissions.php?op=del&amp;entryID=" . $entryID . "'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/delete.gif' border='0' width='20' height='20' alt='".constant("_AM_{$MYDIRNAME}_DELETESUBM")."' /></a>";
			echo "<tr>";
			echo "<td class='head' align='center'> $entryID </td>";
			echo "<td class='even' align='left'> $term </td>";
			echo "<td class='even' align='center'> $sentby </td>";
			echo "<td class='even' align='center'> $created </td>";
			echo "<td class='even' align='center'> $modify $delete </td>";
			echo "</tr>";
			}
		}
	else // that is, $numrows = 0, therez no columns yet
		{
		echo "<tr>";
		echo "<td class='head' align='center' colspan='5'>".constant("_AM_{$MYDIRNAME}_NOREQSYET")."</td>";
		echo "</tr>";
		}
	echo "</table>";
	$pagenav = new XoopsPageNav( $numrows, $xoopsModuleConfig['perpage'], $startsub, 'startsub', 'entryID =' . $entryID );
	echo "<div style='text-align:right;'>" . $pagenav -> renderNav() . "</div>";
	echo "</fieldset>";
	echo "<br />";

	xoops_cp_footer();
	}
function show_list($uid, $catid = "", $after = 0, $style = LT_STYLE_OWNER)
{
    global $xoopsDB, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsUser;
    require_once XOOPS_ROOT_PATH . '/class/template.php';
    require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
    $myts =& MyTextSanitizer::getInstance();
    $tpl = new XoopsTpl();
    $title = _MD_LOGTICK_TITLE;
    if (preg_match('/^\\d+(,\\d+)+$/', $uid)) {
        // show multiple user log
        $cond = "luid IN ({$uid})";
        $disp = true;
    } elseif ($uid) {
        // show a user log
        $cond = "luid={$uid}";
        $title = sprintf(_MD_LOGTICK_USER, xoops_getLinkedUnameFromId($uid));
        $disp = false;
    } else {
        // show any user log
        $cond = '1';
        $disp = true;
    }
    $now = time();
    $timestamp = _MD_SHOW_TIMESTAMP . " " . formatTimestamp($now, "m") . "<!-- now: <{$now}> -->";
    $tpl->assign(array('now' => $now, 'timestamp' => $timestamp, 'anonymous' => $xoopsConfig['anonymous'], 'showuser' => $disp, 'title' => $title));
    if (preg_match('/^\\d+(,\\d+)+$/', $catid)) {
        // show multiple categories
        $cond .= " AND pcat IN ({$catid})";
    } elseif ($catid) {
        // show a category
        $cond .= " AND pcat={$catid}";
    }
    $users = $xoopsDB->prefix('users');
    $res = $xoopsDB->query("SELECT count(*) FROM " . TLOG . " WHERE {$cond}");
    list($count) = $xoopsDB->fetchRow($res);
    $start = isset($_GET['start']) ? intval($_GET['start']) : 0;
    $max = $xoopsModuleConfig['maxlist'];
    $args = array();
    if ($uid) {
        $args[] = "uid={$uid}";
    }
    if ($catid) {
        $args[] = "catid={$catid}";
    }
    $nav = new XoopsPageNav($count, $max, $start, "start", join("&", $args));
    $euid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
    $upnew = $xoopsModuleConfig['newentry'];
    if ($euid) {
        $cond = "({$cond}) OR (luid={$euid} AND ({$now}-ltime)<={$upnew})";
    }
    $tpl->assign(array('pagenav' => $nav->renderNav(), 'count' => $count, 'maxpage' => intval(($count + $max - 1) / $max), 'current' => intval($start / $max) + 1));
    $res = $xoopsDB->query("SELECT l.*, cname, uname, user_avatar FROM " . TLOG . " l LEFT JOIN " . TCAT . " ON pcat=catid LEFT JOIN {$users} ON luid=uid WHERE {$cond} ORDER BY mtime DESC", $max, $start);
    $logs = array();
    if ($xoopsDB->getRowsNum($res)) {
        $ptime = new pastTime();
        while ($data = $xoopsDB->fetchArray($res)) {
            if ($after) {
                // check newer
                if ($after > $data['ltime']) {
                    return $timestamp;
                }
                $after = 0;
            }
            $data['span'] = $ptime->getSpan($data['lspan']);
            if ($now - $data['ltime'] < $upnew) {
                $data['class'] = ' new';
            }
            $data['mdate'] = $ptime->getDate($data['mtime']);
            $data['comment'] = $myts->displayTarea($data['comment']);
            if ($style == LT_STYLE_OWNER && $data['luid'] == $euid) {
                $data['comment'] .= " [<a href='editlog.php?logid=" . $data['logid'] . "'>" . _EDIT . "</a>]";
            }
            $data['cname'] = htmlspecialchars($data['cname']);
            $logs[] = $data;
        }
    }
    $tpl->assign('logs', $logs);
    return $tpl->fetch('db:logtick_result.html');
}
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <http://www.xoops.org/>                             //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
include '../../mainfile.php';
include 'functions.php';
$myts =& MyTextSanitizer::getInstance();
$com_itemid = isset($_GET['com_itemid']) ? intval($_GET['com_itemid']) : 0;
$data = cc_get_message($com_itemid);
$com_replytext = _POSTEDBY . '&nbsp;<b>' . xoops_getLinkedUnameFromId($data['uid']) . '</b>&nbsp;' . _DATE . '&nbsp;<b>' . formatTimestamp($data['mtime']) . '</b>
<br /><br />' . $myts->displayTarea($data['body']) . "<br/><br/>" . ($com_replytitle = $data['title']);
include XOOPS_ROOT_PATH . '/include/comment_new.php';
Exemple #16
0
function list_forms()
{
    global $xoopsDB, $xoopsUser;
    $dirname = basename(dirname(dirname(__FILE__)));
    $res = $xoopsDB->query("SELECT formid,title,count(msgid) nmes,priuid,cgroup,\nsum(if(status='-',1,0)) nwait,\nsum(if(status='a',1,0)) nwork,\nsum(if(status='b',1,0)) nreply,\nsum(if(status='c',1,0)) nclose,\nstore\nFROM " . FORMS . " LEFT JOIN " . CCMES . " ON fidref=formid AND status<>'x' GROUP BY formid");
    if (!$res || $xoopsDB->getRowsNum($res) == 0) {
        return false;
    }
    echo "<style>td.num { text-align: right; }</style>";
    echo "<table class='outer' border='0' cellspacing='1'>\n";
    echo "<tr><th>ID</th><th>" . _AM_FORM_TITLE . "</th><th>" . _AM_FORM_PRIM_CONTACT . "</th><th>" . _AM_MSG_COUNT . "</th><th>" . _AM_MSG_WAIT . "</th><th>" . _AM_MSG_WORK . "</th><th>" . _AM_MSG_REPLY . "</th><th>" . _AM_MSG_CLOSE . "</th><th>" . _AM_OPERATION . "</th></tr>\n";
    $n = 0;
    $mbase = XOOPS_URL . "/modules/{$dirname}";
    $ancfmt = "<td class='num'><a href='msgadm.php?stat=%s&formid=%d'>%d</a></td>\n";
    $nodata = "<td class='num'>--</td>";
    $msgs = array('- a b c' => 'nmes', '-' => 'nwait', 'a' => 'nwork', 'b' => 'nreply', 'c' => 'nclose');
    $member_handler =& xoops_gethandler('member');
    $groups = $member_handler->getGroupList(new Criteria('groupid', XOOPS_GROUP_ANONYMOUS, '!='));
    while ($data = $xoopsDB->fetchArray($res)) {
        $id = $data['formid'];
        $title = htmlspecialchars($data['title'], ENT_QUOTES);
        $url = "{$mbase}?form={$id}";
        $priuid = $data['priuid'];
        $form = $url;
        if ($priuid < 0) {
            $form .= "&amp;uid=" . $xoopsUser->getVar('uid');
            $contact = sprintf(_CC_FORM_PRIM_GROUP, $groups[-$priuid]);
        } elseif ($priuid) {
            $contact = xoops_getLinkedUnameFromId($priuid);
        } elseif ($form['cgroup']) {
            $contact = '[' . $groups[$data['cgroup']] . ']';
        } else {
            $contact = _MD_CONTACT_NOTYET;
        }
        $bg = $n++ % 2 ? 'even' : 'odd';
        $ope = "<a href='?formid={$id}'>" . _EDIT . "</a>" . " | <a href='?op=delete&formid={$id}'>" . _DELETE . "</a>" . " | <a href='{$mbase}/reception.php?form={$id}'>" . _AM_DETAIL . "</a>";
        echo "<tr class='{$bg}'><td>{$id}</td>\n<td><a href='{$form}' target='preview'>{$title}</a></td>\n<td>{$contact}</td>";
        foreach ($msgs as $stat => $name) {
            $value = $data[$name];
            if ($data['store'] == _DB_STORE_YES) {
                $value = sprintf($ancfmt, urlencode($stat), $id, $value);
            } else {
                $value = $value ? sprintf($ancfmt, urlencode($stat), $id, $value) : $nodata;
            }
            echo $value;
        }
        echo "<td>{$ope}</td></tr>\n";
    }
    echo "</table><hr/>\n";
    return true;
}
Exemple #17
0
        echo "<tr><th>ID</th><th>" . _MD_EXTENT_DATE . "</th><th>" . _AM_TITLE . "</th>" . "<th>" . _AM_POSTER . "</th><th>" . _MD_RESERV_PERSONS . "</th><th>" . _AM_RESERVATION . "</th></tr>\n";
        while ($data = $xoopsDB->fetchArray($result)) {
            $bg = $tags[$n++ % 2];
            $eid = $data['eid'];
            $exid = $data['exid'];
            $id = $eid;
            if ($exid) {
                $id .= '-' . $exid;
            }
            $param = 'eid=' . $eid;
            if ($exid) {
                $param .= '&sub=' . $exid;
            }
            $date = eventdate($data['exdate']);
            $title = "<a href='{$show}?{$param}'>" . $myts->makeTboxData4Show($data['title']) . "</a>";
            $uname = xoops_getLinkedUnameFromId($data['uid']);
            $reserved = $data['reserved'];
            if ($reserved) {
                $reserved = "<a href='{$receipt}?{$param}'>{$reserved}</a>";
            }
            echo "<tr class='{$bg}'><td>{$id}<td>{$date}</td><td>{$title}</td>" . "<td>{$uname}</td><td align='right'>" . $data['persons'] . "</td><td align='right'>{$reserved}</td></tr>\n";
        }
        echo "</table>";
        break;
}
xoops_cp_footer();
function show_categories()
{
    global $xoopsDB;
    $myts =& MyTextSanitizer::getInstance();
    $res = $xoopsDB->query('SELECT c.*,count(topicid) count, if (p.weight, p.weight, c.weight) ord1, if(p.weight IS NULL, -1, c.weight) ord2 FROM ' . CATBL . ' c LEFT JOIN ' . CATBL . ' p ON c.catpri=p.catid LEFT JOIN ' . EGTBL . ' ON c.catid=topicid GROUP BY c.catid ORDER BY ord1,ord2,c.catid');
Exemple #18
0
     break;
 case 'one':
     $xoopsOption['template_main'] = EGPREFIX . '_confirm.html';
     $xoopsTpl->assign('lang_title', _MD_RESERV_REC);
     $edit = "<a href='receipt.php?op=edit&rvid={$rvid}'>" . _EDIT . "</a>";
     $del = "<a href='reserv.php?op=cancel&rvid={$rvid}&back='>" . _MD_RESERV_DEL . "</a>";
     $items = array();
     $items[] = array('label' => _MD_RVID, 'value' => "{$rvid} &nbsp; [{$edit}] &nbsp; [{$del}]");
     if ($data['email']) {
         $items[] = array('label' => _MD_EMAIL, 'value' => $myts->displayTarea($data['email']));
     }
     if ($data['uid']) {
         $items[] = array('label' => _MD_UNAME, 'value' => display_username($data['uid'], true));
     }
     if ($rvdata['operator']) {
         $items[] = array('label' => _MD_RESERV_REGISTER, 'value' => xoops_getLinkedUnameFromId($rvdata['operator']));
     }
     $items[] = array('label' => _MD_STATUS, 'value' => $rv_stats[$data['status']]);
     $items[] = array('label' => _MD_ORDER_DATE, 'value' => formatTimestamp($data['rdate'], _MD_TIME_FMT));
     foreach (unserialize_text($rvdata['info']) as $lab => $v) {
         $items[] = array('label' => $lab, 'value' => $myts->displayTarea($v));
     }
     edit_eventdata($head);
     $xoopsTpl->assign('event', edit_eventdata($head));
     $xoopsTpl->assign('items', $items);
     $xoopsTpl->assign('submit', $backanc);
     break;
 default:
     $xoopsOption['template_main'] = EGPREFIX . '_receipt.html';
     $xoopsTpl->assign('lang_title', _MD_RESERVATION);
     $status = 0;