本文整理汇总了PHP中tpl_cycle函数的典型用法代码示例。如果您正苦于以下问题:PHP tpl_cycle函数的具体用法?PHP tpl_cycle怎么用?PHP tpl_cycle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tpl_cycle函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: eventRmcommonGetFeedsList
public function eventRmcommonGetFeedsList($feeds)
{
load_mod_locale('bxpress');
include_once XOOPS_ROOT_PATH . '/modules/bxpress/class/bxfunctions.class.php';
include_once XOOPS_ROOT_PATH . '/modules/bxpress/class/bxforum.class.php';
$module = RMModules::load_module('bxpress');
$config = RMSettings::module_settings('bxpress');
$url = XOOPS_URL . '/' . ($config->urlmode ? $config->htbase : 'modules/bxpress') . '/';
$bxFunc = new bXFunctions();
$data = array('title' => $module->name(), 'url' => $url, 'module' => 'bxpress');
$options[] = array('title' => __('All Recent Messages', 'bxpress'), 'params' => 'show=all', 'description' => __('Show all recent messages', 'bxpress'));
$forums = $bxFunc->forumList('', false);
$table = '<table cellpadding="2" cellspacing="2" width="100%"><tr class="even">';
$count = 0;
foreach ($forums as $forum) {
if ($count >= 3) {
$count = 0;
$table .= '</tr><tr class="' . tpl_cycle("odd,even") . '">';
}
$table .= '<td width="33%"><a href="' . XOOPS_URL . '/backend.php?action=showfeed&mod=bxpress&show=forum&forum=' . $forum['id'] . '">' . $forum['title'] . '</a></td>';
$count++;
}
$table .= '</tr></table>';
$options[] = array('title' => __('Posts by forum', 'bxpress'), 'description' => __('Select a forum to see the messages posted recently.', 'bxpress') . ' <a href="javascript:;" onclick="$(\'#bxforums-feed\').slideToggle(\'slow\');">Show Forums</a>
<div id="bxforums-feed" style="padding: 10px; display: none;">' . $table . '</div>');
unset($forums);
$feed = array('data' => $data, 'options' => $options);
$feeds[] = $feed;
return $feeds;
}
示例2: foreach
</span>
</td>
</tr>
<?php
}
?>
<?php
$class = 'odd';
$qstring = '';
foreach (RMTemplate::get()->get_vars() as $var => $value) {
$qstring .= $qstring == '' ? $var . '=' . $value : '&' . $var . '=' . $value;
}
foreach ($users as $user) {
?>
<tr class="<?php
echo tpl_cycle('even,odd');
echo $user['level'] <= 0 ? ' user_inactive' : '';
?>
" valign="top">
<td class="text-center"><input type="checkbox" name="ids[]" id="item-<?php
echo $user['uid'];
?>
" value="<?php
echo $user['uid'];
?>
" /></td>
<td class="text-center"><?php
echo $user['uid'];
?>
</td>
<td nowrap="nowrap">
示例3: _e
if (empty($used_blocks)) {
?>
<tr class="even" align="center" id="tr-empty">
<td colspan="5"><?php
_e('There are not blocks configured with this options.', 'rmcommon');
?>
</td>
</tr>
<?php
}
?>
<?php
foreach ($used_blocks as $block) {
?>
<tr valign="top" class="<?php
echo tpl_cycle("even,odd");
?>
" id="tr-<?php
echo $block['id'];
?>
">
<td align="center"><input type="checkbox" name="ids[]" id="item-<?php
echo $block['id'];
?>
" /></td>
<td>
<strong><?php
echo $block['title'];
?>
</strong>
<span class="description"><?php
示例4: load_modules_page
function load_modules_page()
{
global $xoopsLogger, $xoopsSecurity;
error_reporting(0);
$xoopsLogger->activated = false;
if (!$xoopsSecurity->check(true, rmc_server_var($_POST, 'token', ''))) {
echo __("Sorry, you don't have access to this page", 'rmcommon');
echo "<br /><a href='javascript:;' onclick='location.reload();'>" . __('Click here to refresh', 'rmcommon') . "</a>";
die;
}
$db = XoopsDatabaseFactory::getDatabaseConnection();
$sql = "SELECT * FROM " . $db->prefix("modules") . " ORDER BY `name`";
$result = $db->query($sql);
$installed_dirs = array();
while ($row = $db->fetchArray($result)) {
$installed_dirs[] = $row['dirname'];
}
require_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
$dirlist = XoopsLists::getModulesList();
$available_mods = array();
$module_handler = xoops_gethandler('module');
foreach ($dirlist as $file) {
clearstatcache();
$file = trim($file);
if (!in_array($file, $installed_dirs)) {
$module =& $module_handler->create();
if (!$module->loadInfo($file, false)) {
continue;
}
$available_mods[] = $module;
unset($module);
}
}
unset($dirlist);
unset($module_handler);
$limit = 10;
$tpages = ceil(count($available_mods) / $limit);
$page = rmc_server_var($_POST, 'page', 1);
if ($page > $tpages) {
$page = 1;
}
$start = ($page <= 0 ? 0 : $page - 1) * $limit;
$nav = new RMPageNav(count($available_mods), $limit, $page, 3);
$nav->target_url('javascript:;" onclick="load_page({PAGE_NUM});');
// Event for available modules
$available_mods = RMEvents::get()->run_event('rmcommon.available.modules', $available_mods);
$end = $page * $limit;
if ($end > count($available_mods)) {
$end = count($available_mods);
}
ob_start();
?>
<div class="rmc_widget_content_reduced rmc_modules_widget">
<img id="img-load" src="images/loading.gif" style="display: none; margin: 15px auto;" />
<div id="mods-widget-container">
<?php
for ($i = $start; $i < $end; $i++) {
?>
<?php
$mod = $available_mods[$i];
?>
<div class="<?php
echo tpl_cycle("even,odd");
?>
">
<a href="modules.php?action=install&dir=<?php
echo $mod->getInfo('dirname');
?>
" class="rmc_mod_img" style="background: url(<?php
echo XOOPS_URL;
?>
/modules/<?php
echo $mod->getInfo('dirname');
?>
/<?php
echo $mod->getInfo('image');
?>
) no-repeat center;"><span> </span></a>
<strong><a href="modules.php?action=install&dir=<?php
echo $mod->getInfo('dirname');
?>
"><?php
echo $mod->getInfo('name');
?>
</a></strong>
<span class="rmc_available_options">
<a href="modules.php?action=install&dir=<?php
echo $mod->getInfo('dirname');
?>
"><?php
_e('Install', 'rmcommon');
?>
</a> |
<a href="javascript:;" onclick="show_module_info('<?php
echo $mod->getInfo('dirname');
?>
');"><?php
_e('More info', 'rmcommon');
?>
</a>
//.........这里部分代码省略.........
示例5: rmc_available_mods
function rmc_available_mods()
{
global $available_mods, $xoopsSecurity;
$ret['title'] = __('Available Modules', 'rmcommon');
$ret['icon'] = RMCURL . '/images/modules.png';
$limit = 10;
$tpages = ceil(count($available_mods) / $limit);
$nav = new RMPageNav(count($available_mods), $limit, 1, 3);
$nav->target_url('javascript:;" onclick="load_page({PAGE_NUM});');
ob_start();
$i = 0;
?>
<div class="rmc_widget_content_reduced rmc_modules_widget">
<img id="img-load" src="images/loading.gif" style="display: none; margin: 15px auto;" />
<div id="mods-widget-container">
<?php
foreach ($available_mods as $mod) {
?>
<?php
if ($i == $limit) {
break;
}
?>
<div class="<?php
echo tpl_cycle("even,odd");
?>
">
<a href="modules.php?action=install&dir=<?php
echo $mod->getInfo('dirname');
?>
" class="rmc_mod_img" style="background: url(<?php
echo XOOPS_URL;
?>
/modules/<?php
echo $mod->getInfo('dirname');
?>
/<?php
echo $mod->getInfo('image');
?>
) no-repeat center;"><span> </span></a>
<strong><a href="modules.php?action=install&dir=<?php
echo $mod->getInfo('dirname');
?>
"><?php
echo $mod->getInfo('name');
?>
</a></strong>
<span class="rmc_available_options">
<a href="modules.php?action=install&dir=<?php
echo $mod->getInfo('dirname');
?>
"><?php
_e('Install', 'rmcommon');
?>
</a> |
<a href="javascript:;" onclick="show_module_info('<?php
echo $mod->getInfo('dirname');
?>
');"><?php
_e('More info', 'rmcommon');
?>
</a>
</span>
<span class="rmc_mod_info" id="mod-<?php
echo $mod->getInfo('dirname');
?>
">
<?php
_e('Version:', 'rmcommon');
?>
<?php
if ($mod->getInfo('rmnative')) {
?>
<?php
echo RMUtilities::format_version($mod->getInfo('rmversion'));
?>
<?php
} else {
?>
<?php
echo $mod->getInfo('version');
?>
<?php
}
?>
<br />
<?php
_e('Author:', 'rmcommon');
?>
<?php
echo substr(strip_tags($mod->getInfo('author')), 0, 12);
?>
</span>
</div>
<?php
$i++;
}
?>
<?php
//.........这里部分代码省略.........
示例6: eventRmcommonGetFeedsList
/**
* Return the feed options to show in RSS Center
*/
public function eventRmcommonGetFeedsList($feeds)
{
include_once XOOPS_ROOT_PATH . '/modules/mywords/class/mwfunctions.php';
load_mod_locale('mywords');
$module = RMFunctions::load_module('mywords');
$config = RMUtilities::module_config('mywords');
$data = array('title' => $module->name(), 'url' => XOOPS_URL . $config['basepath'], 'module' => 'mywords');
$options[] = array('title' => __('All Recent Posts', 'mywords'), 'params' => 'show=all', 'description' => __('Show all recent posts', 'mywords'));
$categories = array();
MWFunctions::categos_list($categories);
$table = '<table cellpadding="2" cellspacing="2" width="100%"><tr class="even">';
$count = 0;
foreach ($categories as $cat) {
if ($count >= 3) {
$count = 0;
$table .= '</tr><tr class="' . tpl_cycle("odd,even") . '">';
}
$table .= '<td width="33%"><a href="' . XOOPS_URL . '/backend.php?action=showfeed&mod=mywords&show=cat&cat=' . $cat['id_cat'] . '">' . $cat['name'] . '</a></td>';
$count++;
}
$table .= '</tr></table>';
$options[] = array('title' => __('Posts by category', 'mywords'), 'description' => __('Select a category to see the posts published recently.', 'mywords') . ' <a href="javascript:;" onclick="$(\'#categories-feed\').slideToggle(\'slow\');">Show Categories</a>
<div id="categories-feed" style="padding: 10px; display: none;">' . $table . '</div>');
unset($categories);
$tags = MWFunctions::get_tags("*", '', '', 99);
$table = '<table cellpadding="2" cellspacing="2" width="100%"><tr class="even">';
$count = 0;
foreach ($tags as $tag) {
if ($count >= 3) {
$count = 0;
$table .= '</tr><tr class="' . tpl_cycle("odd,even") . '">';
}
$table .= '<td width="33%"><a href="' . XOOPS_URL . '/backend.php?action=showfeed&mod=mywords&show=tag&tag=' . $tag['id_tag'] . '">' . $tag['tag'] . '</a></td>';
$count++;
}
$table .= '</tr></table>';
$options[] = array('title' => __('Show posts by tag', 'mywords'), 'description' => __('Select a tag to see the posts published recently.', 'mywords') . ' <a href="javascript:;" onclick="$(\'#tags-feed\').slideToggle(\'slow\');">Show Tags</a>
<div id="tags-feed" style="padding: 10px; display: none;">' . $table . '</div>');
unset($tags);
$db = XoopsDatabaseFactory::getDatabaseConnection();
$sql = "SELECT * FROM " . $db->prefix("mw_editors") . " ORDER BY name";
$result = $db->query($sql);
$editors = array();
while ($row = $db->fetchArray($result)) {
$editors[] = $row;
}
asort($editors);
$table = '<table cellpadding="2" cellspacing="2" width="100%"><tr class="even">';
$count = 0;
foreach ($editors as $ed) {
if ($count >= 3) {
$count = 0;
$table .= '</tr><tr class="' . tpl_cycle("odd,even") . '">';
}
$table .= '<td width="33%"><a href="' . XOOPS_URL . '/backend.php?action=showfeed&mod=mywords&show=author&author=' . $ed['id_editor'] . '">' . $ed['name'] . '</a></td>';
$count++;
}
$table .= '</tr></table>';
$options[] = array('title' => __('Show posts by author', 'mywords'), 'description' => __('Select an author to see the posts published recently.', 'mywords') . ' <a href="javascript:;" onclick="$(\'#editor-feed\').slideToggle(\'slow\');">Show Authors</a>
<div id="editor-feed" style="padding: 10px; display: none;">' . $table . '</div>');
unset($editors);
unset($table);
RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.min.js');
RMTemplate::get()->add_script(RMCURL . '/include/js/jquery-ui.min.js');
$feed = array('data' => $data, 'options' => $options);
$feeds[] = $feed;
return $feeds;
}
示例7: rd_print_sections
function rd_print_sections($sections, $id, $table = true)
{
if ($table) {
foreach ($sections as $section) {
?>
<tr align="center" valign="top" class="<?php
echo tpl_cycle("even,odd");
?>
" id="sec-<?php
echo $section['parent'];
?>
-<?php
echo $section['id'];
?>
">
<td align="left">
<strong><?php
echo $section['number'];
?>
.
<a href="?action=edit&sec=<?php
echo $section['id'];
?>
&id=<?php
echo $id;
?>
"><?php
echo $section['title'];
?>
</a></strong>
<span class="rmc_options">
<a href="./sections.php?action=edit&sec=<?php
echo $section['id'];
?>
&id=<?php
echo $id;
?>
"><?php
_e('Edit', 'docs');
?>
</a> |
<a href="./sections.php?action=delete&sec=<?php
echo $section['id'];
?>
&id=<?php
echo $id;
?>
" onclick="return confirm('<?php
echo sprintf(__("Do you really wish to delete %s?", 'docs'), $section['title']);
?>
');"><?php
_e('Delete', 'docs');
?>
</a> |
<a href="?action=new&id=<?php
echo $id;
?>
&parent=<?php
echo $section['id'];
?>
"><?php
_e('Add Section', 'docs');
?>
</a> |
<a href="<?php
echo $section['link'];
?>
">View</a>
</span>
</td>
<td><?php
echo $section['author_name'];
?>
</td>
<td><?php
echo $section['created'];
?>
</td>
<td><?php
echo $section['modified'];
?>
</td>
<td><?php
echo $section['comments'];
?>
</td>
</tr>
<?php
rd_print_sections($section['sections'], $id);
}
} else {
?>
<?php
if (!empty($sections)) {
?>
<ol>
<?php
foreach ($sections as $section) {
?>
<li id="list_<?php
//.........这里部分代码省略.........
示例8: foreach
<table class="outer" cellspacing="0" width="100%">
<tr class="even resources_list">
<?php
$i = 0;
foreach ($resources as $res) {
if ($i > 1) {
$i = 0;
?>
</tr><tr class="<?php
echo tpl_cycle("odd,even");
?>
resources_list">
<?php
}
?>
<td class="even"><a href="?id=<?php
echo $res['id'];
?>
"><?php
echo $res['title'];
?>
</a></td>
<?php
$i++;
}
?>
</tr>
<tr class="foot">
<td colspan="2"><?php
echo $nav->render(false);
?>