コード例 #1
0
ファイル: lib.php プロジェクト: ajv/Offline-Caching
/**
 *  This function is in lib and not in BlogInfo because entries being searched
 *   might be found in any number of blogs rather than just one.
 *
 *   $@param ...
 */
function blog_print_html_formatted_entries($postid, $filtertype, $filterselect, $tagid, $tag)
{
    global $CFG, $USER, $OUTPUT;
    $blogpage = optional_param('blogpage', 0, PARAM_INT);
    $bloglimit = optional_param('limit', get_user_preferences('blogpagesize', 10), PARAM_INT);
    $start = $blogpage * $bloglimit;
    $sitecontext = get_context_instance(CONTEXT_SYSTEM);
    $morelink = '<br />&nbsp;&nbsp;';
    $totalentries = get_viewable_entry_count($postid, $bloglimit, $start, $filtertype, $filterselect, $tagid, $tag, $sort = 'created DESC');
    $blogEntries = blog_fetch_entries($postid, $bloglimit, $start, $filtertype, $filterselect, $tagid, $tag, $sort = 'created DESC', true);
    $pagingbar = moodle_paging_bar::make($totalentries, $blogpage, $bloglimit, get_baseurl($filtertype, $filterselect));
    $pagingbar->pagevar = 'blogpage';
    echo $OUTPUT->paging_bar($pagingbar);
    if ($CFG->enablerssfeeds) {
        blog_rss_print_link($filtertype, $filterselect, $tag);
    }
    if (has_capability('moodle/blog:create', $sitecontext)) {
        //the user's blog is enabled and they are viewing their own blog
        $addlink = '<div class="addbloglink">';
        $addlink .= '<a href="' . $CFG->wwwroot . '/blog/edit.php?action=add' . '">' . get_string('addnewentry', 'blog') . '</a>';
        $addlink .= '</div>';
        echo $addlink;
    }
    if ($blogEntries) {
        $count = 0;
        foreach ($blogEntries as $blogEntry) {
            blog_print_entry($blogEntry, 'list', $filtertype, $filterselect);
            //print this entry.
            $count++;
        }
        $pagingbar = moodle_paging_bar::make($totalentries, $blogpage, $bloglimit, get_baseurl($filtertype, $filterselect));
        $pagingbar->pagevar = 'blogpage';
        echo $OUTPUT->paging_bar($pagingbar);
        if (!$count) {
            print '<br /><div style="text-align:center">' . get_string('noentriesyet', 'blog') . '</div><br />';
        }
        print $morelink . '<br />' . "\n";
        return;
    }
    $output = '<br /><div style="text-align:center">' . get_string('noentriesyet', 'blog') . '</div><br />';
    print $output;
}
コード例 #2
0
ファイル: wxch_check.php プロジェクト: will0306/bianli100
//检测抽奖次数
$query_sql = "SELECT `count` FROM `wxch_prize_count` WHERE `wxid` = '{$wxid}' AND `pid` = '{$pid}'";
$prize_count = $db->getOne($query_sql);
//
if ($prize_count >= $prize['num']) {
    $prize['num'] = 0;
} else {
    $prize['num'] = $prize['num'] - $prize_count;
}
$prize['pzfun'] = $db->getOne("SELECT `fun` FROM `wxch_prize` WHERE `pid` = '{$pid}' ");
$prize['nickname'] = $db->getOne("SELECT `nickname` FROM `wxch_user` WHERE `wxid` = '{$wxid}' ");
$base_url = $db->getOne("SELECT `cfg_value` FROM `wxch_cfg` WHERE `cfg_name` = 'baseurl' ");
$m_url = $db->getOne("SELECT `cfg_value` FROM `wxch_cfg` WHERE `cfg_name` = 'murl' ");
$go_contact = $base_url . $m_url . 'wxch_contact.php' . '?wxid=' . $wxid;
if (empty($m_url)) {
    $base_url = get_baseurl($db);
}
//prize 中奖记录
$prize_sql = "SELECT * FROM `wxch_prize_users` WHERE `yn` = 'yes' AND `prize_id` = '{$pid}' ORDER BY `dateline` DESC LIMIT 0,6";
$prize_users = $db->getAll($prize_sql);
//prize 奖品 数量
$sql = "SELECT * FROM `wxch_prize_append` WHERE `prize_id` = {$pid}";
$ret = $db->getAll($sql);
$i = 1;
foreach ($ret as $k => $v) {
    $wxchdata[$k] = $v;
    switch ($i) {
        case 1:
            $wxchdata[$k]['level'] = '一等奖';
            break;
        case 2:
コード例 #3
0
<?php

// Paths
$smartysh->config["path_code"] = "/_smartysh";
$smartysh->config["basepath"] = substr($_SERVER['SCRIPT_FILENAME'], 0, strrpos($_SERVER['SCRIPT_FILENAME'], $smartysh->config["path_code"]));
##$smartysh->config["basepath"] = "e:/www";
$smartysh->config["basepath_local"] = "file:///" . $smartysh->config["basepath"];
##$smartysh->config["basepath_local"] = "file:///e:/www";
$smartysh->config["baseurl"] = get_baseurl();
##$smartysh->config["baseurl"] = "http://localhost:8888";
$smartysh->config["code_path"] = $smartysh->config["basepath"] . $smartysh->config["path_code"];
$smartysh->config["basepath"] = $smartysh->config["basepath"];
$smartysh->config["frontpage_site"] = false;
# example: "/example_site"
$smartysh->config["build"] = true;
$smartysh->config["log"] = true;
$smartysh->config["live"] = false;
$smartysh->config["indent"] = "spaces";
// or tabs
$smartysh->config["indent_count"] = 2;
$smartysh->config["debug"] = false;
$smartysh->config["build_dir"] = "build";
$smartysh->config["path_build"] = $smartysh->config["build_dir"];
$smartysh->config["path_templates_layouts"] = "/templates/layouts";
$smartysh->config["path_templates_pages"] = "/templates/pages";
$smartysh->config["path_templates_partials"] = "/templates/partials";
$smartysh->config["path_images"] = "/images";
$smartysh->config["path_style"] = "/style";
$smartysh->config["path_scripts"] = "/scripts";
// SQLite database files
$smartysh->config["path_db"] = $smartysh->config["code_path"] . "/database/db";
コード例 #4
0
<?php

// Paths
$htmlwarrior->config['path_code'] = '/_html-warrior';
$htmlwarrior->config['basepath'] = substr($_SERVER['SCRIPT_FILENAME'], 0, strrpos($_SERVER['SCRIPT_FILENAME'], $htmlwarrior->config['path_code']));
##$htmlwarrior->config['basepath'] = 'e:/www';
$htmlwarrior->config['basepath_local'] = 'file:///' . $htmlwarrior->config['basepath'];
##$htmlwarrior->config['basepath_local'] = 'file:///e:/www';
$htmlwarrior->config['baseurl'] = get_baseurl();
##$htmlwarrior->config['baseurl'] = 'http://localhost:8888';
$htmlwarrior->config['code_path'] = $htmlwarrior->config['basepath'] . $htmlwarrior->config['path_code'];
$htmlwarrior->config['basepath'] = $htmlwarrior->config['basepath'];
$htmlwarrior->config['frontpage_site'] = false;
# example: '/example_site'
$htmlwarrior->config['build'] = true;
$htmlwarrior->config['log'] = true;
$htmlwarrior->config['live'] = false;
$htmlwarrior->config['error_page'] = false;
# example 'error' - which means error.tpl in templates/pages
$htmlwarrior->config['htmlwarrior_prefix'] = 'htmlwarrior';
$htmlwarrior->config['multilingual'] = false;
$htmlwarrior->config['lang_default'] = 'en';
$htmlwarrior->config['lang_cookie_name'] = $htmlwarrior->config['htmlwarrior_prefix'] . 'lang_default';
$htmlwarrior->config['langs_used'] = array('et' => 'eesti keeles', 'en' => 'in english');
$htmlwarrior->config['indent'] = 'spaces';
// or tabs
$htmlwarrior->config['indent_count'] = 2;
$htmlwarrior->config['debug'] = false;
$htmlwarrior->config['devmode'] = true;
# shov layer overlay, pagelist etc
$htmlwarrior->config['build_dir'] = 'build';