当前位置: 首页>>代码示例>>PHP>>正文


PHP mosFormatDate函数代码示例

本文整理汇总了PHP中mosFormatDate函数的典型用法代码示例。如果您正苦于以下问题:PHP mosFormatDate函数的具体用法?PHP mosFormatDate怎么用?PHP mosFormatDate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了mosFormatDate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: saveContent

/**
* Saves the content item an edit form submit
* @param database A database connector object
*/
function saveContent($sectionid, $task)
{
    global $database, $my, $mainframe, $mosConfig_offset;
    $menu = mosGetParam($_POST, 'menu', 'mainmenu');
    $menuid = mosGetParam($_POST, 'menuid', 0);
    $row = new mosContent($database);
    if (!$row->bind($_POST)) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    $isNew = $row->id < 1;
    if ($isNew) {
        //$row->created		= $row->created ? $row->created : date( "Y-m-d H:i:s" );
        $row->created = $row->created ? mosFormatDate($row->created, '%Y-%m-%d %H:%M:%S', -$mosConfig_offset * 60 * 60) : date("Y-m-d H:i:s");
        $row->created_by = $row->created_by ? $row->created_by : $my->id;
    } else {
        $row->modified = date("Y-m-d H:i:s");
        $row->modified_by = $my->id;
    }
    if (strlen(trim($row->publish_up)) <= 10) {
        $row->publish_up .= " 00:00:00";
    }
    $row->publish_up = mosFormatDate($row->publish_up, '%Y-%m-%d %H:%M:%S', -$mosConfig_offset);
    if (trim($row->publish_down) == T_("Never")) {
        $row->publish_down = "0000-00-00 00:00:00";
    }
    $row->state = mosGetParam($_REQUEST, 'published', 0);
    $params = mosGetParam($_POST, 'params', '');
    if (is_array($params)) {
        $txt = array();
        foreach ($params as $k => $v) {
            $txt[] = "{$k}={$v}";
        }
        $row->attribs = implode("\n", $txt);
    }
    // code cleaner for xhtml transitional compliance
    $row->introtext = str_replace('<br>', '<br />', $row->introtext);
    $row->fulltext = str_replace('<br>', '<br />', $row->fulltext);
    // remove <br /> take being automatically added to empty fulltext
    $length = strlen($row->fulltext) < 9;
    $search = strstr($row->fulltext, '<br />');
    if ($length && $search) {
        $row->fulltext = NULL;
    }
    if (!$row->check()) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    $row->version++;
    if (!$row->store()) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    // manage frontpage items
    require_once $mainframe->getPath('class', 'com_frontpage');
    $fp = new mosFrontPage($database);
    if (mosGetParam($_REQUEST, 'frontpage', 0)) {
        // toggles go to first place
        if (!$fp->load($row->id)) {
            // new entry
            $database->setQuery("INSERT INTO #__content_frontpage VALUES ('{$row->id}','1')");
            if (!$database->query()) {
                echo "<script> alert('" . $database->stderr() . "');</script>\n";
                exit;
            }
            $fp->ordering = 1;
        }
    } else {
        // no frontpage mask
        if (!$fp->delete($row->id)) {
            $msg .= $fp->stderr();
        }
        $fp->ordering = 0;
    }
    $fp->updateOrder();
    $row->checkin();
    $row->updateOrder("catid='{$row->catid}' AND state >= 0");
    $redirect = mosGetParam($_POST, 'redirect', $sectionid);
    switch ($task) {
        case 'go2menu':
            mosRedirect('index2.php?option=com_menus&menutype=' . $menu);
            break;
        case 'go2menuitem':
            mosRedirect('index2.php?option=com_menus&menutype=' . $menu . '&task=edit&hidemainmenu=1&id=' . $menuid);
            break;
        case 'menulink':
            menuLink($redirect, $row->id);
            break;
        case 'resethits':
            resethits($redirect, $row->id);
            break;
        case 'apply':
            $msg = T_('Successfully Saved changes to Item: ') . $row->title;
            mosRedirect('index2.php?option=com_content&sectionid=' . $redirect . '&task=edit&hidemainmenu=1&id=' . $row->id, $msg);
        case 'save':
        default:
//.........这里部分代码省略.........
开发者ID:jwest00724,项目名称:mambo,代码行数:101,代码来源:admin.content.php

示例2: checkedOut

 function checkedOut(&$row, $overlib = 1)
 {
     $hover = '';
     if ($overlib) {
         $date = mosFormatDate($row->checked_out_time, '%A, %d %B %Y');
         $time = mosFormatDate($row->checked_out_time, '%H:%M');
         $checked_out_text = '<table>';
         $checked_out_text .= '<tr><td>' . $row->editor . '</td></tr>';
         $checked_out_text .= '<tr><td>' . $date . '</td></tr>';
         $checked_out_text .= '<tr><td>' . $time . '</td></tr>';
         $checked_out_text .= '</table>';
         $hover = 'onMouseOver="return overlib(\'' . $checked_out_text . '\', CAPTION, \'' . T_('Checked Out') . '\', BELOW, RIGHT);" onMouseOut="return nd();"';
     }
     $checked = '<img src="images/checked_out.png" ' . $hover . '/>';
     return $checked;
 }
开发者ID:jwest00724,项目名称:mambo,代码行数:16,代码来源:mamboHTML.php

示例3: save

/**
* Saves the typed content item
*/
function save($option, $task)
{
    global $database, $my, $mosConfig_offset;
    josSpoofCheck();
    $nullDate = $database->getNullDate();
    $menu = strval(mosGetParam($_POST, 'menu', 'mainmenu'));
    $menuid = intval(mosGetParam($_POST, 'menuid', 0));
    $row = new mosContent($database);
    if (!$row->bind($_POST)) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    if ($row->id) {
        $row->modified = date('Y-m-d H:i:s');
        $row->modified_by = $my->id;
    }
    $row->created_by = $row->created_by ? $row->created_by : $my->id;
    if ($row->created && strlen(trim($row->created)) <= 10) {
        $row->created .= ' 00:00:00';
    }
    $row->created = $row->created ? mosFormatDate($row->created, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset) : date('Y-m-d H:i:s');
    if (strlen(trim($row->publish_up)) <= 10) {
        $row->publish_up .= ' 00:00:00';
    }
    $row->publish_up = mosFormatDate($row->publish_up, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset);
    if (trim($row->publish_down) == 'Never' || trim($row->publish_down) == '') {
        $row->publish_down = $nullDate;
    } else {
        if (strlen(trim($row->publish_down)) <= 10) {
            $row->publish_down .= ' 00:00:00';
        }
        $row->publish_down = mosFormatDate($row->publish_down, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset);
    }
    $row->state = intval(mosGetParam($_REQUEST, 'published', 0));
    // Save Parameters
    $params = mosGetParam($_POST, 'params', '');
    if (is_array($params)) {
        $txt = array();
        foreach ($params as $k => $v) {
            $txt[] = "{$k}={$v}";
        }
        $row->attribs = implode("\n", $txt);
    }
    // code cleaner for xhtml transitional compliance
    $row->introtext = str_replace('<br>', '<br />', $row->introtext);
    $row->title = ampReplace($row->title);
    if (!$row->check()) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    if (!$row->store()) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    $row->checkin();
    // clean any existing cache files
    mosCache::cleanCache('com_content');
    switch ($task) {
        case 'go2menu':
            mosRedirect('index2.php?option=com_menus&menutype=' . $menu);
            break;
        case 'go2menuitem':
            mosRedirect('index2.php?option=com_menus&menutype=' . $menu . '&task=edit&hidemainmenu=1&id=' . $menuid);
            break;
        case 'menulink':
            menuLink($option, $row->id);
            break;
        case 'resethits':
            resethits($option, $row->id);
            break;
        case 'save':
            $msg = 'Typed Content Item saved';
            mosRedirect('index2.php?option=' . $option, $msg);
            break;
        case 'apply':
        default:
            $msg = 'Changes to Typed Content Item saved';
            mosRedirect('index2.php?option=' . $option . '&task=edit&hidemainmenu=1&id=' . $row->id, $msg);
            break;
    }
}
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:84,代码来源:admin.typedcontent.php

示例4: defined

defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
global $mosConfig_offset;
$count = intval($params->get('count', 10));
$moduleclass_sfx = $params->get('moduleclass_sfx');
$now = date('Y-m-d H:i:s', time() + $mosConfig_offset * 60 * 60);
$query = "SELECT MONTH(created) AS created_month, created, id, sectionid, title, YEAR(created) AS created_year" . "\n FROM #__content" . "\n WHERE ( state='-1' AND checked_out='0' AND sectionid > '0' )" . "\n GROUP BY created_year DESC, created_month DESC LIMIT {$count}";
$database->setQuery($query);
$rows = $database->loadObjectList();
if (is_array($rows)) {
    ?>
<ul>
<?php 
    foreach ($rows as $row) {
        $created_month = mosFormatDate($row->created, "%m");
        $month_name = mosFormatDate($row->created, "%B");
        $created_year = mosFormatDate($row->created, "%Y");
        $link = sefRelToAbs('index.php?option=com_content&amp;task=archivecategory&amp;year=' . $created_year . '&amp;month=' . $created_month . '&amp;module=1');
        $text = $month_name . ', ' . $created_year;
        ?>
	<li>
	<a href="<?php 
        echo $link;
        ?>
">
	<?php 
        echo $text;
        ?>
	</a>
	</li>
	<?php 
    }
开发者ID:jwest00724,项目名称:mambo,代码行数:31,代码来源:mod_archive.php

示例5: formatDate

 public static function formatDate($date = 'now', $format = null, $offset = null)
 {
     if ($format == 'DATETIME_FORMAT') {
         $format = null;
     }
     if (JCOMMENTS_JVERSION != '1.0') {
         if (empty($format)) {
             $format = JText::_('DATE_FORMAT_LC1');
         }
         if (JCOMMENTS_JVERSION == '1.7') {
             return JHTML::_('date', $date, $format);
         } else {
             return JHTML::_('date', $date, $format, $offset);
         }
     } else {
         if (!is_string($date)) {
             $date = strftime($format, (int) $date);
         }
         return mosFormatDate($date, $format, $offset);
     }
 }
开发者ID:carmerin,项目名称:cesae-web,代码行数:21,代码来源:jcomments.class.php

示例6: AuthorDateLine

function AuthorDateLine(&$row, &$params)
{
    global $database;
    $text = '';
    if ($params->get('author')) {
        // Display Author name
        //Find Author Name
        $users_rows = new mosUser($database);
        $users_rows->load($row->created_by);
        $row->author = $users_rows->name;
        $row->usertype = $users_rows->usertype;
        if ($row->usertype == 'administrator' || $row->usertype == 'superadministrator') {
            $text .= "\n";
            $text .= _WRITTEN_BY . ' ' . ($row->created_by_alias ? $row->created_by_alias : $row->author);
        } else {
            $text .= "\n";
            $text .= _AUTHOR_BY . ' ' . ($row->created_by_alias ? $row->created_by_alias : $row->author);
        }
    }
    if ($params->get('createdate') && $params->get('author')) {
        // Display Separator
        $text .= "\n";
    }
    if ($params->get('createdate')) {
        // Display Created Date
        if (intval($row->created)) {
            $create_date = mosFormatDate($row->created);
            $text .= $create_date;
        }
    }
    if ($params->get('modifydate') && ($params->get('author') || $params->get('createdate'))) {
        // Display Separator
        $text .= "\n";
    }
    if ($params->get('modifydate')) {
        // Display Modified Date
        if (intval($row->modified)) {
            $mod_date = mosFormatDate($row->modified);
            $text .= _LAST_UPDATED . ' ' . $mod_date;
        }
    }
    $text .= "\n\n";
    return $text;
}
开发者ID:patricmutwiri,项目名称:joomlaclube,代码行数:44,代码来源:pdf.php

示例7: _showTabPermissions

    function _showTabPermissions(&$row, &$lists, &$last, &$created)
    {
        ?>
    	<table class="adminform">
    	<tr>
			<th colspan="2"><?php 
        echo _DML_TITLE_DOCPERMISSIONS;
        ?>
</th>
		<tr>
    	<tr>
    		<td width="250" align="right"><?php 
        echo _DML_OWNER;
        ?>
</td>
    		<td>
    		<?php 
        echo $lists['viewer'];
        echo DOCMAN_Utils::mosToolTip(_DML_OWNER_TOOLTIP . '</span>', _DML_OWNER);
        ?>
        	</td>
    	</tr>
    	<tr>
    		<td valign="top" align="right"><?php 
        echo _DML_MAINTAINER;
        ?>
</td>
    		<td>
    		<?php 
        echo $lists['maintainer'];
        echo DOCMAN_Utils::mosToolTip(_DML_MANT_TOOLTIP . '</span>', _DML_MAINTAINER);
        ?>
        	</td>
    	</tr>
    	<tr>
    		<td valign="top" align="right"><?php 
        echo _DML_CREATED_BY;
        ?>
</td>
    		<td>[<?php 
        echo $created[0]->name;
        ?>
] <i>on
    		<?php 
        echo mosFormatDate($row->dmdate_published);
        ?>
    		</i> </td>
    	</tr>
    	<tr>
    		<td valign="top" align="right"><?php 
        echo _DML_UPDATED_BY;
        ?>
</td>
    		<td>[<?php 
        echo $last[0]->name;
        ?>
]
    		<?php 
        if ($row->dmlastupdateon) {
            echo " <i>on " . mosFormatDate($row->dmlastupdateon);
        }
        ?>
    		</i>
    		</td>
    	</tr>
    	</table>
    	<?php 
    }
开发者ID:RangerWalt,项目名称:ecci,代码行数:68,代码来源:documents.html.php

示例8: saveContent

/**
* Saves the content item an edit form submit
* @param database A database connector object
*/
function saveContent($sectionid, $task)
{
    global $database, $my, $mainframe, $mosConfig_offset;
    josSpoofCheck();
    $menu = strval(mosGetParam($_POST, 'menu', 'mainmenu'));
    $menuid = intval(mosGetParam($_POST, 'menuid', 0));
    $nullDate = $database->getNullDate();
    $row = new mosContent($database);
    if (!$row->bind($_POST)) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    // sanitise id field
    $row->id = (int) $row->id;
    if ($row->id) {
        $row->modified = date('Y-m-d H:i:s');
        $row->modified_by = $my->id;
    }
    $row->created_by = $row->created_by ? $row->created_by : $my->id;
    if ($row->created && strlen(trim($row->created)) <= 10) {
        $row->created .= ' 00:00:00';
    }
    $row->created = $row->created ? mosFormatDate($row->created, '%Y-%m-%d %H:%M:%S', -$mosConfig_offset) : date('Y-m-d H:i:s');
    if (strlen(trim($row->publish_up)) <= 10) {
        $row->publish_up .= ' 00:00:00';
    }
    $row->publish_up = mosFormatDate($row->publish_up, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset);
    if (trim($row->publish_down) == 'Never' || trim($row->publish_down) == '') {
        $row->publish_down = $nullDate;
    } else {
        if (strlen(trim($row->publish_down)) <= 10) {
            $row->publish_down .= ' 00:00:00';
        }
        $row->publish_down = mosFormatDate($row->publish_down, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset);
    }
    $row->state = intval(mosGetParam($_REQUEST, 'published', 0));
    $params = mosGetParam($_POST, 'params', '');
    if (is_array($params)) {
        $txt = array();
        foreach ($params as $k => $v) {
            if (get_magic_quotes_gpc()) {
                $v = stripslashes($v);
            }
            $txt[] = "{$k}={$v}";
        }
        $row->attribs = implode("\n", $txt);
    }
    // code cleaner for xhtml transitional compliance
    $row->introtext = str_replace('<br>', '<br />', $row->introtext);
    $row->fulltext = str_replace('<br>', '<br />', $row->fulltext);
    // remove <br /> take being automatically added to empty fulltext
    $length = strlen($row->fulltext) < 9;
    $search = strstr($row->fulltext, '<br />');
    if ($length && $search) {
        $row->fulltext = NULL;
    }
    $row->title = ampReplace($row->title);
    if (!$row->check()) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    $row->version++;
    if (!$row->store()) {
        echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
        exit;
    }
    // manage frontpage items
    require_once $mainframe->getPath('class', 'com_frontpage');
    $fp = new mosFrontPage($database);
    if (intval(mosGetParam($_REQUEST, 'frontpage', 0))) {
        // toggles go to first place
        if (!$fp->load((int) $row->id)) {
            // new entry
            $query = "INSERT INTO #__content_frontpage" . "\n VALUES ( " . (int) $row->id . ", 1 )";
            $database->setQuery($query);
            if (!$database->query()) {
                echo "<script> alert('" . $database->stderr() . "');</script>\n";
                exit;
            }
            $fp->ordering = 1;
        }
    } else {
        // no frontpage mask
        if (!$fp->delete((int) $row->id)) {
            $msg .= $fp->stderr();
        }
        $fp->ordering = 0;
    }
    $fp->updateOrder();
    $row->checkin();
    $row->updateOrder("catid = " . (int) $row->catid . " AND state >= 0");
    // clean any existing cache files
    mosCache::cleanCache('com_content');
    $redirect = mosGetParam($_POST, 'redirect', $sectionid);
    switch ($task) {
        case 'go2menu':
//.........这里部分代码省略.........
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:101,代码来源:admin.content.php

示例9: showUsers


//.........这里部分代码省略.........
			</th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $img = $row->block ? 'publish_x.png' : 'tick.png';
            $task = $row->block ? 'unblock' : 'block';
            $alt = $row->block ? $adminLanguage->A_COMP_STAT_ENABLED : $adminLanguage->A_COMP_USERS_BLOCKED;
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
			<td>
			<?php 
            echo $i + 1 + $pageNav->limitstart;
            ?>
			</td>
			<td>
			<?php 
            echo mosHTML::idBox($i, $row->id);
            ?>
			</td>
			<td>
			<a href="#edit" onClick="return listItemTask('cb<?php 
            echo $i;
            ?>
','edit')">
			<?php 
            echo $row->name;
            ?>
			</a>
			</td>
			<td>
			<?php 
            echo $row->username;
            ?>
			</td>
			<td align="center">
			<?php 
            echo $row->loggedin ? '<img src="images/tick.png" width="12" height="12" border="0" alt="" />' : '';
            ?>
			</td>
			<td>
			<?php 
            echo $row->groupname;
            ?>
			</td>
			<td>
			<a href="mailto:<?php 
            echo $row->email;
            ?>
">
			<?php 
            echo $row->email;
            ?>
			</a>
			</td>
			<td>
			<?php 
            echo mosFormatDate($row->lastvisitDate, "%Y-%m-%d %H:%M:%S");
            ?>
			</td>
			<td width="10%">
			<a href="javascript: void(0);" onClick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task;
            ?>
')">
			<img src="images/<?php 
            echo $img;
            ?>
" width="12" height="12" border="0" alt="<?php 
            echo $alt;
            ?>
" />
			</a>
			</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>
		<?php 
        echo $pageNav->getListFooter();
        ?>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		</form>
		<?php 
    }
开发者ID:cwcw,项目名称:cms,代码行数:101,代码来源:admin.users.html.php

示例10: dofreePDF

function dofreePDF($database)
{
    global $mosConfig_live_site, $mosConfig_sitename, $mosConfig_offset, $mosConfig_hideCreateDate, $mosConfig_hideAuthor, $mosConfig_hideModifyDate;
    $id = intval(mosGetParam($_REQUEST, 'id', 1));
    // Access check
    global $gid;
    $now = date('Y-m-d H:i:s', time() + $mosConfig_offset * 60 * 60);
    $query = "SELECT COUNT(a.id)" . "\n FROM #__content AS a" . "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid" . "\n LEFT JOIN #__sections AS s ON s.id = cc.section AND s.scope='content'" . "\n LEFT JOIN #__users AS u ON u.id = a.created_by" . "\n LEFT JOIN #__content_rating AS v ON a.id = v.content_id" . "\n LEFT JOIN #__groups AS g ON a.access = g.id" . "\n WHERE a.id='" . $id . "' " . "\n AND (a.state = '1' OR a.state = '-1')" . "\n AND (publish_up = '0000-00-00 00:00:00' OR publish_up <= '{$now}')" . "\n AND (publish_down = '0000-00-00 00:00:00' OR publish_down >= '{$now}')" . "\n AND a.access <= " . intval($gid);
    $database->setQuery($query);
    if (!$database->loadResult()) {
        exit(T_('You are not authorized to view this resource.'));
    }
    include 'includes/class.ezpdf.php';
    $row = new mosContent($database);
    $row->load($id);
    //Find Author Name
    $users_rows = new mosUser($database);
    $users_rows->load($row->created_by);
    $row->author = $users_rows->name;
    $row->usertype = $users_rows->usertype;
    // Ugly but needed to get rid of all the stuff the PDF class cant handle
    $row->fulltext = str_replace('<p>', "\n\n", $row->fulltext);
    $row->fulltext = str_replace('<P>', "\n\n", $row->fulltext);
    $row->fulltext = str_replace('<br />', "\n", $row->fulltext);
    $row->fulltext = str_replace('<br>', "\n", $row->fulltext);
    $row->fulltext = str_replace('<BR />', "\n", $row->fulltext);
    $row->fulltext = str_replace('<BR>', "\n", $row->fulltext);
    $row->fulltext = str_replace('<li>', "\n - ", $row->fulltext);
    $row->fulltext = str_replace('<LI>', "\n - ", $row->fulltext);
    $row->fulltext = strip_tags($row->fulltext);
    $row->fulltext = str_replace('{mosimage}', '', $row->fulltext);
    $row->fulltext = str_replace('{mospagebreak}', '', $row->fulltext);
    $row->fulltext = decodeHTML($row->fulltext);
    $row->introtext = str_replace('<p>', "\n\n", $row->introtext);
    $row->introtext = str_replace('<P>', "\n\n", $row->introtext);
    $row->introtext = str_replace('<li>', "\n - ", $row->introtext);
    $row->introtext = str_replace('<LI>', "\n - ", $row->introtext);
    $row->introtext = strip_tags($row->introtext);
    $row->introtext = str_replace('{mosimage}', '', $row->introtext);
    $row->introtext = str_replace('{mospagebreak}', '', $row->introtext);
    $row->introtext = decodeHTML($row->introtext);
    $pdf =& new Cezpdf('a4', 'P');
    //A4 Portrait
    $pdf->ezSetCmMargins(2, 1.5, 1, 1);
    $pdf->selectFont('./fonts/Helvetica.afm');
    //choose font
    $all = $pdf->openObject();
    $pdf->saveState();
    $pdf->setStrokeColor(0, 0, 0, 1);
    // footer
    $pdf->line(10, 40, 578, 40);
    $pdf->line(10, 822, 578, 822);
    $pdf->addText(30, 34, 6, $mosConfig_live_site . ' - ' . $mosConfig_sitename);
    $pdf->addText(250, 34, 6, T_('Powered by Mambo'));
    $pdf->addText(450, 34, 6, T_('Generated:') . date('j F, Y, H:i', time() + $mosConfig_offset * 60 * 60));
    $pdf->restoreState();
    $pdf->closeObject();
    $pdf->addObject($all, 'all');
    $pdf->ezSetDy(30);
    $txt1 = $row->title;
    $pdf->ezText($txt1, 14);
    $txt2 = NULL;
    $mod_date = NULL;
    $create_date = NULL;
    if (intval($row->modified) != 0) {
        $mod_date = mosFormatDate($row->modified);
    }
    if (intval($row->created) != 0) {
        $create_date = mosFormatDate($row->created);
    }
    if ($mosConfig_hideCreateDate == '0') {
        $txt2 .= '(' . $create_date . ') - ';
    }
    if ($mosConfig_hideAuthor == "0") {
        if ($row->author != '' && $mosConfig_hideAuthor == '0') {
            if ($row->usertype == 'administrator' || $row->usertype == 'superadministrator') {
                $txt2 .= T_('Written by') . ' ' . ($row->created_by_alias ? $row->created_by_alias : $row->author);
            } else {
                $txt2 .= T_('Contributed by') . ' ' . ($row->created_by_alias ? $row->created_by_alias : $row->author);
            }
        }
    }
    if ($mosConfig_hideModifyDate == "0") {
        $txt2 .= ' - ' . T_('Last Updated') . ' (' . $mod_date . ') ';
    }
    $txt2 .= "\n\n";
    $pdf->ezText($txt2, 8);
    $txt3 = $row->introtext . "\n" . $row->fulltext;
    $pdf->ezText($txt3, 10);
    $pdf->ezStream();
}
开发者ID:jwest00724,项目名称:mambo,代码行数:91,代码来源:pdf.php

示例11: dofreePDF

function dofreePDF($database)
{
    global $mosConfig_live_site, $mosConfig_sitename, $mosConfig_offset, $mosConfig_hideCreateDate, $mosConfig_hideAuthor, $mosConfig_hideModifyDate;
    $id = intval(mosGetParam($_REQUEST, 'id', 1));
    include 'includes/class.ezpdf.php';
    $row = new mosContent($database);
    $row->load($id);
    //Find Author Name
    $users_rows = new mosUser($database);
    $users_rows->load($row->created_by);
    $row->author = $users_rows->name;
    $row->usertype = $users_rows->usertype;
    // Ugly but needed to get rid of all the stuff the PDF class cant handle
    $row->fulltext = str_replace('<p>', "\n\n", $row->fulltext);
    $row->fulltext = str_replace('<P>', "\n\n", $row->fulltext);
    $row->fulltext = str_replace('<br />', "\n", $row->fulltext);
    $row->fulltext = str_replace('<br>', "\n", $row->fulltext);
    $row->fulltext = str_replace('<BR />', "\n", $row->fulltext);
    $row->fulltext = str_replace('<BR>', "\n", $row->fulltext);
    $row->fulltext = str_replace('<li>', "\n - ", $row->fulltext);
    $row->fulltext = str_replace('<LI>', "\n - ", $row->fulltext);
    $row->fulltext = strip_tags($row->fulltext);
    $row->fulltext = str_replace('{mosimage}', '', $row->fulltext);
    $row->fulltext = str_replace('{mospagebreak}', '', $row->fulltext);
    $row->fulltext = decodeHTML($row->fulltext);
    $row->introtext = str_replace('<p>', "\n\n", $row->introtext);
    $row->introtext = str_replace('<P>', "\n\n", $row->introtext);
    $row->introtext = str_replace('<li>', "\n - ", $row->introtext);
    $row->introtext = str_replace('<LI>', "\n - ", $row->introtext);
    $row->introtext = strip_tags($row->introtext);
    $row->introtext = str_replace('{mosimage}', '', $row->introtext);
    $row->introtext = str_replace('{mospagebreak}', '', $row->introtext);
    $row->introtext = decodeHTML($row->introtext);
    $pdf =& new Cezpdf('a4', 'P');
    //A4 Portrait
    $pdf->ezSetCmMargins(2, 1.5, 1, 1);
    $pdf->selectFont('./fonts/Helvetica.afm');
    //choose font
    $all = $pdf->openObject();
    $pdf->saveState();
    $pdf->setStrokeColor(0, 0, 0, 1);
    // footer
    $pdf->line(10, 40, 578, 40);
    $pdf->line(10, 822, 578, 822);
    $pdf->addText(30, 34, 6, $mosConfig_live_site . ' - ' . $mosConfig_sitename);
    $pdf->addText(250, 34, 6, 'Powered by Mambo');
    $pdf->addText(450, 34, 6, 'Generated: ' . date('j F, Y, H:i', time() + $mosConfig_offset * 60 * 60));
    $pdf->restoreState();
    $pdf->closeObject();
    $pdf->addObject($all, 'all');
    $pdf->ezSetDy(30);
    $txt1 = $row->title;
    $pdf->ezText($txt1, 14);
    $txt2 = NULL;
    $mod_date = NULL;
    $create_date = NULL;
    if (intval($row->modified) != 0) {
        $mod_date = mosFormatDate($row->modified);
    }
    if (intval($row->created) != 0) {
        $create_date = mosFormatDate($row->created);
    }
    if ($mosConfig_hideCreateDate == '0') {
        $txt2 .= '(' . $create_date . ') - ';
    }
    if ($mosConfig_hideAuthor == "0") {
        if ($row->author != '' && $mosConfig_hideAuthor == '0') {
            if ($row->usertype == 'administrator' || $row->usertype == 'superadministrator') {
                $txt2 .= _WRITTEN_BY . ' ' . ($row->created_by_alias ? $row->created_by_alias : $row->author);
            } else {
                $txt2 .= _AUTHOR_BY . ' ' . ($row->created_by_alias ? $row->created_by_alias : $row->author);
            }
        }
    }
    if ($mosConfig_hideModifyDate == "0") {
        $txt2 .= ' - ' . _LAST_UPDATED . ' (' . $mod_date . ') ';
    }
    $txt2 .= "\n\n";
    $pdf->ezText($txt2, 8);
    $txt3 = $row->introtext . "\n" . $row->fulltext;
    $pdf->ezText($txt3, 10);
    $pdf->ezStream();
}
开发者ID:cwcw,项目名称:cms,代码行数:83,代码来源:pdf.php

示例12: checkedOut

 function checkedOut(&$row, $overlib = 1)
 {
     $hover = '';
     if ($overlib) {
         $date = mosFormatDate($row->checked_out_time, '%A, %d %B %Y');
         $time = mosFormatDate($row->checked_out_time, '%H:%M');
         $editor = addslashes(htmlspecialchars(html_entity_decode($row->editor, ENT_QUOTES)));
         $checked_out_text = '<table>';
         $checked_out_text .= '<tr><td>' . $editor . '</td></tr>';
         $checked_out_text .= '<tr><td>' . $date . '</td></tr>';
         $checked_out_text .= '<tr><td>' . $time . '</td></tr>';
         $checked_out_text .= '</table>';
         $hover = 'onMouseOver="return overlib(\'' . $checked_out_text . '\', CAPTION, \'Bloqueado\', BELOW, RIGHT);" onMouseOut="return nd();"';
     }
     $checked = '<img src="images/checked_out.png" ' . $hover . '/>';
     return $checked;
 }
开发者ID:patricmutwiri,项目名称:joomlaclube,代码行数:17,代码来源:joomla.php

示例13: showUsers


//.........这里部分代码省略.........
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $img = $row->block ? 'publish_x.png' : 'tick.png';
            $task = $row->block ? 'unblock' : 'block';
            $alt = $row->block ? 'Enabled' : 'Blocked';
            $link = 'index2.php?option=com_users&amp;task=editA&amp;id=' . $row->id . '&amp;hidemainmenu=1';
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td>
				<?php 
            echo $i + 1 + $pageNav->limitstart;
            ?>
				</td>
				<td>
				<?php 
            echo mosHTML::idBox($i, $row->id);
            ?>
				</td>
				<td>
				<a href="<?php 
            echo $link;
            ?>
">
				<?php 
            echo $row->name;
            ?>
				</a>
				</td>
				<td align="center">
				<?php 
            echo $row->loggedin ? '<img src="images/tick.png" width="12" height="12" border="0" alt="" />' : '';
            ?>
				</td>
				<td>
				<a href="javascript: void(0);" onClick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task;
            ?>
')">
				<img src="images/<?php 
            echo $img;
            ?>
" width="12" height="12" border="0" alt="<?php 
            echo $alt;
            ?>
" />
				</a>
				</td>
				<td>
				<?php 
            echo $row->username;
            ?>
				</td>
				<td>
				<?php 
            echo $row->groupname;
            ?>
				</td>
				<td>
				<a href="mailto:<?php 
            echo $row->email;
            ?>
">
				<?php 
            echo $row->email;
            ?>
				</a>
				</td>
				<td nowrap="nowrap">
				<?php 
            echo mosFormatDate($row->lastvisitDate, "%Y-%m-%d %H:%M:%S");
            ?>
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>
		<?php 
        echo $pageNav->getListFooter();
        ?>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />
		</form>
		<?php 
    }
开发者ID:jwest00724,项目名称:mambo,代码行数:101,代码来源:admin.users.html.php

示例14: edit

    function edit(&$row, &$images, &$lists, &$params, $option, &$menus)
    {
        global $database;
        mosMakeHtmlSafe($row);
        $create_date = null;
        $mod_date = null;
        $nullDate = $database->getNullDate();
        if ($row->created != $nullDate) {
            $create_date = mosFormatDate($row->created, '%A, %d %B %Y %H:%M', '0');
        }
        if ($row->modified != $nullDate) {
            $mod_date = mosFormatDate($row->modified, '%A, %d %B %Y %H:%M', '0');
        }
        $tabs = new mosTabs(1);
        // used to hide "Reset Hits" when hits = 0
        if (!$row->hits) {
            $visibility = "style='display: none; visibility: hidden;'";
        } else {
            $visibility = "";
        }
        mosCommonHTML::loadOverlib();
        mosCommonHTML::loadCalendar();
        ?>
		<script language="javascript" type="text/javascript">
		var folderimages = new Array;
		<?php 
        $i = 0;
        foreach ($images as $k => $items) {
            foreach ($items as $v) {
                echo "folderimages[" . $i++ . "] = new Array( '{$k}','" . addslashes($v->value) . "','" . addslashes($v->text) . "' );\t";
            }
        }
        ?>
		function submitbutton(pressbutton) {
			var form = document.adminForm;
			if (pressbutton == 'cancel') {
				submitform( pressbutton );
				return;
			}

			if ( pressbutton ==' resethits' ) {
				if (confirm('Tem certeza que deseja reiniciar o contador de Acessos ? \nQualquer alteração não salva deste conteúdo será perdida.')){
					submitform( pressbutton );
					return;
				} else {
					return;
				}
			}

			if ( pressbutton == 'menulink' ) {
				if ( form.menuselect.value == "" ) {
					alert( "Por favor, selecione um menu" );
					return;
				} else if ( form.link_name.value == "" ) {
					alert( "Por favor, informe um nome para este item do menu" );
					return;
				}
			}

			var temp = new Array;
			for (var i=0, n=form.imagelist.options.length; i < n; i++) {
				temp[i] = form.imagelist.options[i].value;
			}
			form.images.value = temp.join( '\n' );

			try {
				document.adminForm.onsubmit();
			}
			catch(e){}
			if (trim(form.title.value) == ""){
				alert( "Item de conteúdo deve possuir um título" );
			} else if (trim(form.name.value) == ""){
				alert( "Item de conteúdo deve possuir um nome" );
			} else {
				if ( form.reset_hits.checked ) {
					form.hits.value = 0;
				} else {
				}
				<?php 
        getEditorContents('editor1', 'introtext');
        ?>
				submitform( pressbutton );
			}
		}
		</script>

		<table class="adminheading">
		<tr>
			<th class="edit">
			Item de Conteúdo Estático:
			<small>
			<?php 
        echo $row->id ? 'Editar' : 'Novo';
        ?>
			</small>
			</th>
		</tr>
		</table>

		<form action="index2.php" method="post" name="adminForm">
//.........这里部分代码省略.........
开发者ID:patricmutwiri,项目名称:joomlaclube,代码行数:101,代码来源:admin.typedcontent.html.php

示例15: JLMS_showCertificatesList


//.........这里部分代码省略.........
        echo _JLMS_CERTS_TYPE;
        ?>
</th>
						</tr>
					</thead>
					<tfoot>
						<tr>
							<td colspan="8">
							<?php 
        echo $pageNav->getListFooter();
        ?>
							</td>
						</tr>
					</tfoot>
					<tbody>
					<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row = $rows[$i];
            ?>
						<tr class="<?php 
            echo "row{$k}";
            ?>
">
							<td align="center"><?php 
            echo $pageNav->rowNumber($i);
            ?>
</td>
							<td><?php 
            echo $row->uniq_id;
            ?>
</td>
							<td><?php 
            echo mosFormatDate($row->crtf_date, '%Y-%m-%d');
            ?>
</td>
							<td><?php 
            $usually = true;
            if (!$row->cur_user) {
                echo "<span style='color:red'>" . _JLMS_CERTS_USER_REMOVED . "</span><br />";
                $usually = false;
            } elseif ($row->cur_name != $row->name || $row->cur_username != $row->username) {
                echo "<span style='color:green'>{$row->cur_name} ({$row->cur_username})</span><br />";
                $usually = false;
            }
            if (!$usually) {
                echo _JLMS_CERTS_PRINTED_AS . " <span style='color:red'>";
            }
            echo $row->name . " (" . $row->username . ")";
            if (!$usually) {
                echo "</span>";
            }
            ?>
							</td>
							<td><?php 
            $usually = true;
            if (!$row->course_name) {
                $row->course_name = $row->cur_course_name;
            }
            if (!$row->cur_course_name) {
                echo "<span style='color:red'>" . _JLMS_CERTS_REMOVED . "</span><br />";
                $usually = false;
            } elseif ($row->cur_course_name != $row->course_name) {
                echo "<span style='color:green'>{$row->cur_course_name}</span><br />";
                $usually = false;
            }
开发者ID:parkmi,项目名称:dolschool14,代码行数:67,代码来源:admin.joomla_lms.html.php


注:本文中的mosFormatDate函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。