private function _getList($map, $page = 1, $r = 20)
 {
     $questionModel = new QuestionModel();
     $questionAnswerModel = new QuestionAnswerModel();
     list($list, $totalCount) = $questionModel->getListPageByMap($map, $page, 'create_time desc', $r, '*');
     foreach ($list as &$val) {
         $val['info'] = msubstr(op_t($val['description']), 0, 200);
         $val['img'] = get_pic($val['description']);
         $val['user'] = query_user(array('uid', 'space_url', 'nickname'), $val['uid']);
         if ($val['best_answer']) {
             $val['best_answer_info'] = $questionAnswerModel->getData(array('id' => $val['best_answer'], 'status' => 1));
         } else {
             $val['best_answer_info'] = $questionAnswerModel->getData(array('question_id' => $val['id'], 'status' => 1), 'support desc');
         }
         if ($val['best_answer_info']) {
             $val['best_answer_info']['content'] = msubstr(op_t($val['best_answer_info']['content']), 0, 200);
         }
     }
     return array($list, $totalCount);
 }
 private function _getList($map, $limit, $order)
 {
     $questionModel = new QuestionModel();
     $questionAnswerModel = new QuestionAnswerModel();
     $list = $questionModel->getList($map, '*', $limit, $order);
     foreach ($list as &$val) {
         $val['info'] = msubstr(op_t($val['description']), 0, 200);
         $val['img'] = get_pic($val['description']);
         $val['user'] = query_user(array('uid', 'space_url', 'nickname', 'avatar64'), $val['uid']);
         if ($val['best_answer']) {
             $val['best_answer_info'] = $questionAnswerModel->getData(array('id' => $val['best_answer'], 'status' => 1));
         } else {
             $val['best_answer_info'] = $questionAnswerModel->getData(array('question_id' => $val['id'], 'status' => 1), 'support desc');
         }
         if ($val['best_answer_info']) {
             $val['best_answer_info']['content'] = msubstr(op_t($val['best_answer_info']['content']), 0, 200);
         }
     }
     return $list;
 }
예제 #3
0
 /**
  * 获取我的回答列表
  * @param int $uid
  * @param int $page
  * @param string $order
  * @param int $r
  * @param string $field
  * @return array
  * @author 郑钟良<*****@*****.**>
  */
 public function getMyListPage($uid = 0, $page = 1, $order = 'support desc,create_time desc', $r = 10, $field = '*')
 {
     !$uid && ($uid = is_login());
     $questionModel = D('Question/Question');
     $map['uid'] = $uid;
     $map['status'] = 1;
     $totalCount = $this->where($map)->count();
     if ($totalCount) {
         $list = $this->where($map)->page($page, $r)->order($order)->field($field)->select();
         $contentHandler = new ContentHandlerModel();
         foreach ($list as &$val) {
             $val['content'] = $contentHandler->displayHtmlContent($val['content']);
             $val['question'] = $questionModel->getData($val['question_id']);
             $val['question']['info'] = msubstr(op_t($val['question']['description']), 0, 200);
             $val['question']['img'] = get_pic($val['question']['description']);
         }
     }
     return array($list, $totalCount);
 }
예제 #4
0
function get_jumpgate($sid)
{
    global $uid;
    global $map_info;
    if (!in_array($sid, $map_info->get_possible_scan_systems()) && !in_array($sid, $map_info->get_all_fleet_scans())) {
        return false;
    }
    // BUTTON Definitionen
    $buttonShape = "button_circle_30x30_shadow";
    $system_info = $map_info->get_system($sid);
    $j_pid = get_pid_of_jumpgate($sid);
    // pid des jumpgates
    $j_uname = get_name_by_uid($j_uid);
    // name des jumpgatebesitzers
    $sth = mysql_query("select prod_id from jumpgates where pid='{$j_pid}'");
    if (!$sth || mysql_num_rows($sth) == 0) {
        return 0;
    }
    list($j_prodid) = mysql_fetch_row($sth);
    $j_prodname = get_name_by_prod_id($j_prodid);
    $j_pic = PIC_ROOT . get_pic($j_prodid);
    // Ok, Buttons kreieren und in $new_button[] speichern
    $new_button = array();
    $new_button[] = create_button($buttonShape, "button_face_info", "alert('not yet implemented')", 0, "show info");
    $new_header = create_header($j_pic, "Jumpgate in " . $system_info["name"], "", "", "");
    // Button in das Header Tag einfügen
    for ($i = 0; $i < sizeof($new_button); $i++) {
        $new_header .= $new_button[$i];
    }
    $new_header .= "</SR_HEAD>";
    echo "newItemBox\n";
    // nötig um zu ermitteln wie der inhalt behnadelt werden soll!
    echo $new_header;
}
function get_pic($name, $recurse = 1)
{
    global $module_name;
    $basepath = "{$name}";
    if (file_exists("{$basepath}.png")) {
        echo "<img src=\"{$basepath}.png\" class=\"images\" />";
    } else {
        if (file_exists("{$basepath}.jpg")) {
            echo "<img src=\"{$basepath}.jpg\" class=\"images\" />";
        } else {
            if (file_exists("{$basepath}.gif")) {
                echo "<img src=\"{$basepath}.gif\" class=\"images\" />";
            } else {
                if ($recurse == 1) {
                    $basepath = dirname($name) . "/nopic";
                    get_pic($basepath, 0);
                }
            }
        }
    }
}
예제 #6
0
 public function get_lite($C)
 {
     $C['iurl'] or $C['iurl'] = (array) iURL::get('category', $C);
     $category = array();
     $category['name'] = $C['name'];
     $category['description'] = $C['description'];
     $category['subname'] = $C['subname'];
     $category['sname'] = $C['subname'];
     // $category['pic']         = $C['pic'];
     $category['navArray'] = $this->get_nav($C);
     $category['url'] = $C['iurl']['href'];
     $category['link'] = "<a href='{$C['url']}'>{$C['name']}</a>";
     $category['pic'] = is_array($C['pic']) ? $C['pic'] : get_pic($C['pic']);
     $category['mpic'] = is_array($C['mpic']) ? $C['mpic'] : get_pic($C['mpic']);
     $category['spic'] = is_array($C['spic']) ? $C['spic'] : get_pic($C['spic']);
     if ($C['rootid']) {
         $_parent = iCache::get('iCMS/category/' . $C['rootid']);
         $category['parent'] = $this->get_lite($_parent);
         unset($_parent);
     }
     $category['nav'] = '';
     krsort($category['navArray']);
     if ($category['navArray']) {
         foreach ($category['navArray'] as $key => $value) {
             $category['nav'] .= "<li><a href='{$value['href']}'>{$value['name']}</a><span class=\"divider\">" . iPHP::lang('iCMS:navTag') . "</span></li>";
         }
     }
     return $category;
 }
예제 #7
0
function list_fleet_ships($ships)
{
    if (is_array($ships)) {
        for ($i = 0; $i < sizeof($ships); $i++) {
            $ship = each($ships);
            $ship_name = get_name_by_prod_id($ship[0]);
            if ($ship[1][1]) {
                $ship_reload = "<img src=\"" . PIC_ROOT . "fleet_icon_refuel.jpg\" height=\"15\" border=\"0\" alt=\"refueling\" />" . $ship[1][1] . " weeks";
            } else {
                $ship_reload = "";
            }
            $ship_pic = "<img src=\"" . (PIC_ROOT . get_pic($ship[0])) . "\" border=\"0\" alt=\"" . $ship_name . "\" width=\"15\" height=\"15\" />";
            table_text_open();
            table_text_design("&middot;", "15", "center", "", "text");
            table_text_design($ship_pic, "15", "", "", "text");
            table_text_design($ship_name, "170", "", "", "text");
            table_text_design("count: " . $ship[1][0], "200", "", "", "text");
            table_text_design($ship_reload, "100", "", "2", "text");
            table_text_close();
        }
    }
}
예제 #8
0
function map_short($mapid)
{
    $link = baselink();
    global $coddb;
    global $game;
    global $separatorline;
    global $t;
    // table names from config
    global $m;
    // map aliases
    global $text;
    $query = "SELECT * \n            FROM {$t['maps']}\n            WHERE id = {$mapid}\n            LIMIT 1";
    $result = $coddb->sql_query($query);
    $row = $coddb->sql_fetchrow($result);
    echo "<table class=\"outertable\" width=\"100%\">";
    if (isset($m[$row['name']])) {
        echo "  <tr><td colspan=\"3\" align=\"center\" valign=\"top\">" . $m[$row['name']] . "</td></tr><tr class=\"innertable\"><td valign=\"top\" width=\"150\">";
    } else {
        echo "  <tr><td colspan=\"3\" align=\"center\" valign=\"top\">{$row['name']}</td></tr><tr class=\"innertable\"><td valign=\"top\" width=\"150\">";
    }
    echo "    <table width=\"150\">";
    echo "      <tr><td class=\"innertable\">" . $text["totkill"] . "</td><td align=\"center\" class=\"innertable\">{$row['kills']}</td></tr>";
    echo "      <tr><td class=\"innertable\">" . $text["totteamkill"] . "</td><td align=\"center\" class=\"innertable\">{$row['teamkills']}</td></tr>";
    echo "      <tr><td class=\"innertable\">" . $text["totsuicide"] . "</td><td align=\"center\" class=\"innertable\">{$row['suicides']}</td></tr>";
    echo "    </table>";
    echo "  </td><td width=\"50\" valign=\"top\">";
    // catch cod1, coduo and cod2 in one imagefolder
    if ($game == "cod1" && !file_exists("images/maps/cod1/")) {
        $gamename = "cod2";
    } elseif ($game == "coduo" && !file_exists("images/maps/coduo/")) {
        $gamename = "cod2";
    } else {
        $gamename = $game;
    }
    get_pic("images/maps/{$gamename}/middle/{$row['name']}");
    echo "  </td><td valign=\"top\" class=\"tiny\">";
    get_desc("map/{$row['name']}");
    echo "  </td></tr>";
    echo "</table>";
}
 /**
  * 帖子发布跟编辑。
  */
 public function doEdit()
 {
     $aPostId = I('post.post_id', 0, 'intval');
     $aGroupId = I('post.group_id', 0, 'intval');
     $aTitle = I('post.title', '', 'text');
     $aCategory = I('post.category', 0, 'intval');
     $attach_ids = I('post.attach_ids', '', 'text');
     if ($attach_ids) {
         $aContent = I('post.content', '', 'filter_content');
         $img_ids = explode(',', $attach_ids);
         //把图片和内容结合
         //    dump($img_ids);
         foreach ($img_ids as &$v) {
             $v = D('Picture')->where(array('status' => 1))->getById($v);
             if (!is_bool(strpos($v['path'], 'http://'))) {
                 $v = $v['path'];
             } else {
                 $v = getRootUrl() . substr($v['path'], 1);
             }
             $v = '<p><img src="' . $v . '" style=""/></p><br>';
         }
         $img_ids = implode('', $img_ids);
         $aContent = $img_ids . $aContent;
         $contentHandler = new ContentHandlerModel();
         $aContent = $contentHandler->filterHtmlContent($aContent);
         //把图片和内容结合END
     } else {
         $aContent = I('post.content', '', 'filter_content');
     }
     if (is_joined($aGroupId) != 1) {
         $this->error('您无发布帖子权限');
     }
     //判断是不是编辑模式
     $isEdit = $aPostId ? true : false;
     //如果是编辑模式,确认当前用户能编辑帖子
     $this->requireLogin();
     $this->requireGroupExists($aGroupId);
     if ($isEdit) {
         $this->requirePostExists($aPostId);
         $this->checkActionLimit('edit_group_post', 'GroupPost', $aPostId, is_login(), true);
         $this->checkAuth('Group/Index/edit', get_post_admin($aPostId), '您无编辑帖子权限');
     } else {
         $this->checkActionLimit('add_group_post', 'GroupPost', 0, is_login(), true);
         $this->checkAuth('Group/Index/addPost', -1, '您无添加帖子权限');
     }
     if (empty($aGroupId)) {
         $this->error('请选择帖子所在的群组');
     }
     if (empty($aTitle)) {
         $this->error('请填写帖子标题');
     }
     if (empty($aContent)) {
         $this->error('请填写帖子内容');
     }
     $model = M('GroupPost');
     $cover = get_pic($aContent);
     $cover = $cover == null ? '' : $cover;
     $len = modC('SUMMARY_LENGTH', 50);
     if ($isEdit) {
         $data = array('id' => $aPostId, 'title' => $aTitle, 'summary' => mb_substr(text($aContent), 0, $len, 'utf-8'), 'cover' => $cover, 'content' => $aContent, 'parse' => 0, 'group_id' => $aGroupId, 'cate_id' => $aCategory);
         $result = $model->editPost($data);
         //添加到最新动态
         $dynamic['group_id'] = $aGroupId;
         $dynamic['uid'] = is_login();
         $dynamic['type'] = 'update_post';
         $dynamic['row_id'] = $aPostId;
         M('GroupDynamic')->addDynamic($dynamic);
         if (!$result) {
             $this->error('编辑失败:' . $model->getError());
         }
     } else {
         $data = array('uid' => is_login(), 'title' => $aTitle, 'summary' => mb_substr(text($aContent), 0, $len, 'utf-8'), 'cover' => $cover, 'content' => $aContent, 'parse' => 0, 'group_id' => $aGroupId, 'cate_id' => $aCategory);
         $result = $model->createPost($data);
         if (!$result) {
             $this->error('发表失败。');
         }
         $aPostId = $result;
         //添加到最新动态
         $dynamic['group_id'] = $aGroupId;
         $dynamic['uid'] = is_login();
         $dynamic['type'] = 'post';
         $dynamic['row_id'] = $aPostId;
         M('GroupDynamic')->addDynamic($dynamic);
         //增加活跃度
         M('Group')->where(array('id' => $aGroupId))->setInc('activity');
         M('GroupMember')->where(array('group_id' => $aGroupId, 'uid' => is_login()))->setInc('activity');
     }
     //实现发布帖子发布图片轻博客(公共内容)
     $group = M('Group')->getGroup($aGroupId);
     $this->sendWeibo($aPostId, $isEdit, $group);
     //显示成功消息
     $message = $isEdit ? '编辑成功。' : '发表成功。' . cookie('score_tip');
     $this->success($message, U('Group/Index/detail', array('id' => $aPostId)));
 }
예제 #10
0
    echo get_pic();
    ?>
<br><br>
<table border="0">
<form method="post" action="login.php" name="login">
	<input type="hidden" name="form_sent" value="1">
	<tr>
		<td align="right">Username:</td>
		<td><input type="text" name="form_username"></td>
	</tr>
	<tr>
		<td align="right">Password:</td>
		<td><input type="password" name="form_password"></td>
	</tr>
	<tr align="center"><td colspan="2"><input type="submit" name="submit" value="Login"></td></tr>
</form>
</table>
<?php 
    require 'end.php';
}
$links[] = '<a href="admin.php">Main</a>';
$links[] = '<a href="user.php">User Control</a>';
$links[] = '<a href="list.php">Userlist</a>';
$links[] = '<a href="search.php">Search</a>';
$links[] = '<a href="login.php?act=logout">Logout</a>';
echo implode(' | ', $links);
?>
<br><br><?php 
echo get_pic();
?>
<br><br>
예제 #11
0
function fleet_info()
{
    global $pid;
    global $uid;
    global $skin;
    $sth = mysql_query("select uid from planets where id={$pid} and uid={$uid}");
    if (!$sth) {
        show_error("Database failure!");
        return 0;
    }
    if (mysql_num_rows($sth) == 0) {
        show_error("Databaser failure!");
        return 0;
    }
    $fids = get_fids_by_pid($pid, $uid);
    if (!$fids) {
        show_message("You have no fleet on this planet");
    } else {
        table_start("center", "500");
        table_head_text(array("Ships in orbit"), "3");
        table_text_open("head");
        for ($i = 0; $i < sizeof($fids); $i++) {
            $fleet = new fleet($fids[$i]);
            table_text_open("head");
            table_text_design($fleet->name, "80", "", "", "head");
            table_text_design("Name", "300", "center", "", "smallhead");
            table_text_design("Count", "100", "center", "", "smallhead");
            table_text_close();
            while (list($prod_id, $ships_arr) = each($fleet->ships)) {
                $sth = mysql_query("select manual from production where prod_id={$prod_id}");
                if (!$sth) {
                    show_error("Database failure!");
                    return 0;
                }
                $manual = mysql_fetch_array($sth);
                table_text_open("text", "center");
                table_text_design("<a href='" . $manual["manual"] . "' target=\"_blank\"><img src='arts/" . get_pic($prod_id) . "' border='0' alt='" . get_description($prod_id) . "' align='center'></a><br><a href=\"" . $PHP_SELF . "?act=print_ship_info&prod_id=" . $prod_id . "\">Info</a>", "80", "", "", "text");
                table_text_design(get_name_by_prod_id($prod_id), "300", "", "", "text");
                table_text_design($ships_arr[0], "100", "", "", "text");
                table_text_close();
            }
        }
        table_end();
    }
    $sth3 = mysql_query("select * from s_production as sp,production as p where sp.planet_id='" . $pid . "' and p.prod_id=sp.prod_id order by sp.time,sp.prod_id");
    table_start("center", "500");
    fleet($sth3);
    table_end();
}
예제 #12
0
<?php

/**
 * 详细信息
 * @author 潘洪学 panliu888@gmail.com
 * @create_date	2011-10
 */
include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'init.php';
Passport::RequireLogin();
$task = new Task();
$id = intval($_GET['id']);
$TEMPLATE['data'] = $task->get($id);
$TEMPLATE['data']['pic'] = get_pic($TEMPLATE['data']['pic']);
/**
* 	const OK	= 100;	// 发送成功
	const DELETE_OK		= -10;	// 取消的
	const DELETE_ERR	= -20;
	const DELETE_TASK	= -30;
	const ERROR	= -1;	// 发送失败
	const TASK	= 0;	// 定时任务
	const EXECING= 1;	// 正在执行任务
	const TASK_EDIT = 2; // 修改中
*/
switch ($TEMPLATE['data']['status']) {
    case Task::OK:
        $TEMPLATE['data']['status_text'] = '发送成功';
        break;
    case Task::DELETE_OK:
        $TEMPLATE['data']['status_text'] = '从发送成功列表删除';
        break;
    case Task::DELETE_ERR:
예제 #13
0
function article_next($vars)
{
    // if($vars['param']){
    //     $vars+= $vars['param'];
    //     unset($vars['param']);
    // }
    empty($vars['order']) && ($vars['order'] = 'n');
    $cache_time = isset($vars['time']) ? (int) $vars['time'] : -1;
    if (isset($vars['cid'])) {
        $sql = " AND `cid`='{$vars['cid']}' ";
    }
    if ($vars['order'] == 'p') {
        $sql .= " AND `id` < '{$vars['id']}' ORDER BY id DESC LIMIT 1";
    } else {
        if ($vars['order'] == 'n') {
            $sql .= " AND `id` > '{$vars['id']}' ORDER BY id ASC LIMIT 1";
        }
    }
    $hash = md5($sql);
    if ($vars['cache']) {
        $cache = iPHP_DEVICE . '/article/' . $hash;
        $array = iCache::get($cache);
    }
    if (empty($array)) {
        $rs = iDB::row("SELECT * FROM `#iCMS@__article` WHERE `status`='1' {$sql}");
        if ($rs) {
            $category = iCache::get('iCMS/category/' . $rs->cid);
            $array = array('title' => $rs->title, 'pic' => get_pic($rs->pic), 'url' => iURL::get('article', array((array) $rs, $category))->href);
        }
        iCache::set($cache, $array, $cache_time);
    }
    return $array;
}
예제 #14
0
function get_fleet_pic($fid)
{
    if ($admiral = get_admiral($fid)) {
        $its_pic = ADMIRAL_ROOT . get_admiral_pic($admiral);
    } else {
        $strongest_ship = get_strongest_ship_by_fid($fid);
        $its_pic = PIC_ROOT . get_pic($strongest_ship);
    }
    return $its_pic;
}
예제 #15
0
파일: article.app.php 프로젝트: Junred/iCMS
 public function value($article, $art_data = "", $vars = array(), $page = 1, $tpl = false)
 {
     $article['appid'] = iCMS_APP_ARTICLE;
     $categoryApp = iPHP::app("category");
     $category = $categoryApp->category($article['cid'], false);
     if ($tpl) {
         $category or iPHP::throw404('运行出错!找不到该文章的栏目缓存<b>cid:' . $article['cid'] . '</b> 请更新栏目缓存或者确认栏目是否存在', 10002);
     } else {
         if (empty($category)) {
             return false;
         }
     }
     if ($category['status'] == 0) {
         return false;
     }
     if (iPHP::$iTPL_MODE == "html" && $tpl && (strstr($category['contentRule'], '{PHP}') || $category['outurl'] || $category['mode'] == "0")) {
         return false;
     }
     $_iurlArray = array($article, $category);
     $article['iurl'] = iURL::get('article', $_iurlArray, $page);
     $article['url'] = $article['iurl']->href;
     $article['link'] = "<a href='{$article['url']}'>{$article['title']}</a>";
     $tpl && $category['mode'] == '1' && iCMS::gotohtml($article['iurl']->path, $article['iurl']->href);
     if ($vars['category_lite']) {
         $article['category'] = $categoryApp->get_lite($category);
     } else {
         $article['category'] = $category;
     }
     $this->taoke = false;
     if ($art_data) {
         $pkey = intval($page - 1);
         $pageurl = $article['iurl']->pageurl;
         if ($article['chapter']) {
             $chapterArray = $art_data;
             $count = count($chapterArray);
             $adid = $chapterArray[$pkey]['id'];
             $art_data = iDB::row("SELECT body,subtitle FROM `#iCMS@__article_data` WHERE aid='" . (int) $article['id'] . "' AND id='" . (int) $adid . "' LIMIT 1;", ARRAY_A);
         }
         $art_data['body'] = $this->ubb($art_data['body']);
         preg_match_all("/<img.*?src\\s*=[\"|'|\\s]*(http:\\/\\/.*?\\.(gif|jpg|jpeg|bmp|png)).*?>/is", $art_data['body'], $pic_array);
         $p_array = array_unique($pic_array[1]);
         if ($p_array) {
             foreach ($p_array as $key => $_pic) {
                 $article['pics'][$key] = trim($_pic);
             }
         }
         if (substr($art_data['body'], 0, 19) == '#--iCMS.Markdown--#') {
             // $art_data['body']    = iPHP::Markdown($art_data['body']);
             $art_data['body'] = substr($art_data['body'], 19);
             $article['markdown'] = ture;
         }
         if ($article['chapter']) {
             $article['body'] = $art_data['body'];
         } else {
             $body = explode('#--iCMS.PageBreak--#', $art_data['body']);
             $count = count($body);
             $article['body'] = $body[$pkey];
         }
         $total = $count + intval(iCMS::$config['article']['pageno_incr']);
         $article['body'] = $this->keywords($article['body']);
         $article['body'] = $this->taoke($article['body']);
         $article['taoke'] = $this->taoke;
         $article['subtitle'] = $art_data['subtitle'];
         unset($body, $art_data);
         $pageArray = array();
         if ($total > 1) {
             iPHP::loadClass("Pages");
             $_GLOBALS_iPage = $GLOBALS['iPage'];
             $category['mode'] && iCMS::set_html_url($article['iurl']);
             $pageconf = array('page_name' => 'p', 'url' => $pageurl, 'total' => $total, 'perpage' => 1, 'nowindex' => (int) $_GET['p'], 'lang' => iPHP::lang(iPHP_APP . ':page'));
             if ($article['chapter']) {
                 foreach ((array) $chapterArray as $key => $value) {
                     $pageconf['titles'][$key + 1] = $value['subtitle'];
                 }
             }
             $iPages = new iPages($pageconf);
             unset($GLOBALS['iPage']);
             $GLOBALS['iPage'] = $_GLOBALS_iPage;
             unset($_GLOBALS_iPage);
             $pageArray['list'] = $iPages->list_page();
             $pageArray['index'] = $iPages->first_page('array');
             $pageArray['prev'] = $iPages->prev_page('array');
             $pageArray['next'] = $iPages->next_page('array');
             $pageArray['endof'] = $iPages->last_page('array');
             $pagenav = $iPages->show(0);
             $pagetext = $iPages->show(10);
         }
         $article['page'] = array('pn' => $page, 'total' => $total, 'count' => $count, 'current' => $page, 'nav' => $pagenav, 'pageurl' => $pageurl, 'text' => $pagetext, 'PAGES' => $iPages, 'args' => iS::escapeStr($_GET['pageargs']), 'first' => $page == "1" ? true : false, 'last' => $page == $count ? true : false, 'end' => $page == $total ? true : false) + $pageArray;
         $next_url = $pageArray['next']['url'];
         unset($pagenav, $pagetext, $iPages, $pageArray);
         if ($pic_array[0]) {
             $img_array = array_unique($pic_array[0]);
             foreach ($img_array as $key => $img) {
                 $img = str_replace('<img', '<img title="' . $article['title'] . '" alt="' . $article['title'] . '"', $img);
                 if (iCMS::$config['article']['pic_center']) {
                     $img_replace[$key] = '<p align="center">' . $img . '</p>';
                 } else {
                     $img_replace[$key] = $img;
                 }
                 if (iCMS::$config['article']['pic_next'] && $count > 1) {
                     $clicknext = '<a href="' . $next_url . '"><b>' . iPHP::lang('iCMS:article:clicknext') . '</b></a>';
                     $clickimg = '<a href="' . $next_url . '" title="' . $article['title'] . '" class="img">' . $img . '</a>';
                     if (iCMS::$config['article']['pic_center']) {
                         $img_replace[$key] = '<p align="center">' . $clicknext . '</p>';
                         $img_replace[$key] .= '<p align="center">' . $clickimg . '</p>';
                     } else {
                         $img_replace[$key] = '<p>' . $clicknext . '</p>';
                         $img_replace[$key] .= '<p>' . $clickimg . '</p>';
                     }
                 }
             }
             $article['body'] = str_replace($img_array, $img_replace, $article['body']);
         }
     }
     if ($vars['tags']) {
         $article['tags_fname'] = $category['name'];
         if ($article['tags']) {
             $tagApp = iPHP::app("tag");
             $tagArray = $tagApp->get_array($article['tags']);
             $article['tag_array'] = array();
             foreach ((array) $tagArray as $tk => $tag) {
                 $article['tag_array'][$tk] = $tag;
                 $article['tags_link'] .= $tag['link'];
                 $tag_name_array[] = $tag['name'];
             }
             $tag_name_array && ($article['tags_fname'] = $tag_name_array[0]);
             unset($tagApp, $tagArray, $tag_name_array);
         }
     }
     if ($vars['meta']) {
         if ($article['metadata']) {
             $article['meta'] = unserialize($article['metadata']);
             unset($article['metadata']);
         }
     }
     if ($vars['user']) {
         iPHP::app('user.class', 'static');
         if ($article['postype']) {
             $article['user'] = user::empty_info($article['userid'], '#' . $article['editor']);
         } else {
             $article['user'] = user::info($article['userid'], $article['author']);
         }
     }
     if (strstr($article['source'], '||')) {
         list($s_name, $s_url) = explode('||', $article['source']);
         $article['source'] = '<a href="' . $s_url . '" target="_blank">' . $s_name . '</a>';
     }
     if (strstr($article['author'], '||')) {
         list($a_name, $a_url) = explode('||', $article['author']);
         $article['author'] = '<a href="' . $a_url . '" target="_blank">' . $a_name . '</a>';
     }
     $article['hits'] = array('script' => iCMS_API . '?app=article&do=hits&cid=' . $article['cid'] . '&id=' . $article['id'], 'count' => $article['hits'], 'today' => $article['hits_today'], 'yday' => $article['hits_yday'], 'week' => $article['hits_week'], 'month' => $article['hits_month']);
     $article['comment'] = array('url' => iCMS_API . "?app=article&do=comment&appid={$article['appid']}&iid={$article['id']}&cid={$article['cid']}", 'count' => $article['comments']);
     if ($article['picdata']) {
         $picdata = unserialize($article['picdata']);
     }
     unset($article['picdata']);
     $article['pic'] = get_pic($article['pic'], $picdata['b'], get_twh($vars['btw'], $vars['bth']));
     $article['mpic'] = get_pic($article['mpic'], $picdata['m'], get_twh($vars['mtw'], $vars['mth']));
     $article['spic'] = get_pic($article['spic'], $picdata['s'], get_twh($vars['stw'], $vars['sth']));
     $article['param'] = array("appid" => $article['appid'], "iid" => $article['id'], "cid" => $article['cid'], "suid" => $article['userid'], "title" => $article['title'], "url" => $article['url']);
     return $article;
 }
예제 #16
0
 public function doEdit()
 {
     $aPostId = I('post.post_id', 0, 'intval');
     $aGroupId = I('post.group_id', 0, 'intval');
     $aTitle = I('post.title', '', 'text');
     $aContent = I('post.content', '', 'filter_content');
     $aCategory = I('post.category', 0, 'intval');
     if (is_joined($aGroupId) != 1) {
         $this->error('您无编辑帖子权限');
     }
     //判断是不是编辑模式
     $isEdit = $aPostId ? true : false;
     //如果是编辑模式,确认当前用户能编辑帖子
     $this->requireLogin();
     $this->requireGroupExists($aGroupId);
     if ($isEdit) {
         $this->requirePostExists($aPostId);
         $this->checkActionLimit('edit_group_post', 'GroupPost', $aPostId, is_login(), true);
         $this->checkAuth('Group/Index/edit', get_post_admin($aPostId), '您无编辑帖子权限');
     } else {
         $this->checkActionLimit('add_group_post', 'GroupPost', 0, is_login(), true);
         $this->checkAuth('Group/Index/addPost', -1, '您无添加帖子权限');
     }
     if (empty($aGroupId)) {
         $this->error('请选择帖子所在的群组');
     }
     if (empty($aTitle)) {
         $this->error('请填写帖子标题');
     }
     if (empty($aContent)) {
         $this->error('请填写帖子内容');
     }
     $model = D('GroupPost');
     $cover = get_pic($aContent);
     $cover = $cover == null ? '' : $cover;
     $len = modC('SUMMARY_LENGTH', 50);
     if ($isEdit) {
         $data = array('id' => $aPostId, 'title' => $aTitle, 'summary' => mb_substr(text($aContent), 0, $len, 'utf-8'), 'cover' => $cover, 'content' => $aContent, 'parse' => 0, 'group_id' => $aGroupId, 'cate_id' => $aCategory);
         $result = $model->editPost($data);
         //添加到最新动态
         $dynamic['group_id'] = $aGroupId;
         $dynamic['uid'] = is_login();
         $dynamic['type'] = 'update_post';
         $dynamic['row_id'] = $aPostId;
         D('GroupDynamic')->addDynamic($dynamic);
         if (!$result) {
             $this->error('编辑失败:' . $model->getError());
         }
     } else {
         $data = array('uid' => is_login(), 'title' => $aTitle, 'summary' => mb_substr(text($aContent), 0, $len, 'utf-8'), 'cover' => $cover, 'content' => $aContent, 'parse' => 0, 'group_id' => $aGroupId, 'cate_id' => $aCategory);
         $result = $model->createPost($data);
         if (!$result) {
             $this->error('发表失败。');
         }
         $aPostId = $result;
         //添加到最新动态
         $dynamic['group_id'] = $aGroupId;
         $dynamic['uid'] = is_login();
         $dynamic['type'] = 'post';
         $dynamic['row_id'] = $aPostId;
         D('GroupDynamic')->addDynamic($dynamic);
         //增加活跃度
         D('Group')->where(array('id' => $aGroupId))->setInc('activity');
         D('GroupMember')->where(array('group_id' => $aGroupId, 'uid' => is_login()))->setInc('activity');
     }
     //实现发布帖子发布图片微博(公共内容)
     $group = D('Group')->getGroup($aGroupId);
     $this->sendWeibo($aPostId, $isEdit, $group);
     //显示成功消息
     $message = $isEdit ? '编辑成功。' : '发表成功。' . cookie('score_tip');
     $this->success($message, U('Group/Index/detail', array('id' => $aPostId)));
 }
예제 #17
0
    	<h1 align="center">Your Orders </h1>
    <input type="button" class="btn btn-info" value="ADD ANOTHER ORDER" onClick="window.location='orderproduct.php'"  class="table-condensed"/>
    </div>
    	<div style="color:#F00"></div>
    	
		<table  align="center" border="0" class="table-condensed"  cellpadding="13px" cellspacing="1px" style="font-family:Arial; font-size:16px; >
    	
		<?php 
if (is_array($_SESSION['cart'])) {
    echo '<tr class="table-condensed" style="font-weight:bold"><td>Product</td><td>Name</td><td>Price</td><td>Qty</td><td>Amount</td><td>Options</td></tr>';
    $max = count($_SESSION['cart']);
    for ($i = 0; $i < $max; $i++) {
        $pid = $_SESSION['cart'][$i]['productid'];
        $q = $_SESSION['cart'][$i]['qty'];
        $pname = get_product_name($pid);
        $pic = get_pic($pid);
        if ($q == 0) {
            continue;
        }
        ?>
              
            		<tr bgcolor="transparent"><td><img src="<?php 
        echo $pic;
        ?>
" width="100" height="100"></td><td><?php 
        echo $pname;
        ?>
</td>
                    <td>$<?php 
        echo get_price($pid);
        ?>
예제 #18
0
파일: tag.app.php 프로젝트: sunhk25/iCMS
 public function value($tag)
 {
     $categoryApp = iPHP::app("category");
     if ($tag['cid']) {
         $category = $categoryApp->category($tag['cid'], false);
         $tag['category'] = $categoryApp->get_lite($category);
     }
     if ($tag['tcid']) {
         $tag_category = $categoryApp->category($tag['tcid'], false);
         $tag['tag_category'] = $categoryApp->get_lite($tag_category);
     }
     $tag['iurl'] = iURL::get('tag', array($tag, $category, $tag_category));
     $tag['url'] or $tag['url'] = $tag['iurl']->href;
     $tag['link'] = '<a href="' . $tag['url'] . '" class="tag" target="_blank">' . $tag['name'] . '</a>';
     if ($category['mode'] && stripos($tag['url'], '.php?') === false) {
         iCMS::set_html_url($tag['iurl']);
     }
     $tag['metadata'] && ($tag['meta'] = json_decode($tag['metadata']));
     $tag['related'] && ($tag['relArray'] = explode(',', $tag['related']));
     $tag['appid'] = iCMS_APP_TAG;
     $tag['pic'] = get_pic($tag['pic']);
     $tag['bpic'] = get_pic($tag['bpic']);
     $tag['mpic'] = get_pic($tag['mpic']);
     $tag['spic'] = get_pic($tag['spic']);
     return $tag;
 }
예제 #19
0
 public function value($article, $art_data = "", $vars = array(), $page = 1, $tpl = false)
 {
     $article['appid'] = iCMS_APP_ARTICLE;
     $categoryApp = iPHP::app("category");
     $category = $categoryApp->category($article['cid'], false);
     if ($tpl) {
         $category or iPHP::throw404('运行出错!找不到该文章的栏目缓存<b>cid:' . $article['cid'] . '</b> 请更新栏目缓存或者确认栏目是否存在', 10002);
     } else {
         if (empty($category)) {
             return false;
         }
     }
     if ($category['status'] == 0) {
         return false;
     }
     if (iPHP::$iTPL_MODE == "html" && $tpl && (strstr($category['contentRule'], '{PHP}') || $category['outurl'] || $category['mode'] == "0")) {
         return false;
     }
     $_iurlArray = array($article, $category);
     $article['iurl'] = iURL::get('article', $_iurlArray, $page);
     $article['url'] = $article['iurl']->href;
     $article['link'] = "<a href='{$article['url']}'>{$article['title']}</a>";
     $tpl && $category['mode'] == '1' && iCMS::gotohtml($article['iurl']->path, $article['iurl']->href);
     if ($vars['category_lite']) {
         $article['category'] = $categoryApp->get_lite($category);
     } else {
         $article['category'] = $category;
     }
     $this->taoke = false;
     if ($art_data) {
         $pageurl = $article['iurl']->pageurl;
         // if(strpos($art_data['body'], '#--iCMS.ArticleData--#')!==false){
         //     iPHP::app('article.table');
         //     $art_data['body'] = articleTable::get_text($article['id']);
         // }
         $art_data['body'] = $this->ubb($art_data['body']);
         preg_match_all("/<img.*?src\\s*=[\"|'|\\s]*(http:\\/\\/.*?\\.(gif|jpg|jpeg|bmp|png)).*?>/is", $art_data['body'], $pic_array);
         $p_array = array_unique($pic_array[1]);
         if ($p_array) {
             foreach ($p_array as $key => $_pic) {
                 $article['pics'][$key] = trim($_pic);
             }
         }
         if (strpos($art_data['body'], '#--iCMS.Markdown--#') !== false) {
             $art_data['body'] = iPHP::Markdown($art_data['body']);
         }
         $body = explode('#--iCMS.PageBreak--#', $art_data['body']);
         $count = count($body);
         $total = $count + intval(iCMS::$config['article']['pageno_incr']);
         $article['body'] = $this->keywords($body[intval($page - 1)]);
         $article['body'] = $this->taoke($article['body']);
         $article['subtitle'] = $art_data['subtitle'];
         $article['taoke'] = $this->taoke;
         unset($art_data);
         if ($total > 1) {
             $flag = 0;
             $num_nav = '';
             for ($i = $page - 3; $i <= $page - 1; $i++) {
                 if ($i < 1) {
                     continue;
                 }
                 $num_nav .= "<a href='" . iPHP::p2num($pageurl, $i) . "' target='_self'>{$i}</a>";
                 $flag++;
             }
             $num_nav .= '<span class="current">' . $page . '</span>';
             for ($i = $page + 1; $i <= $total; $i++) {
                 $num_nav .= "<a href='" . iPHP::p2num($pageurl, $i) . "' target='_self'>{$i}</a>";
                 $flag++;
                 if ($flag == 6) {
                     break;
                 }
             }
             $index_nav = '<a href="' . $article['url'] . '" class="first" target="_self">' . iPHP::lang('iCMS:page:index') . '</a>';
             $prev_url = iPHP::p2num($pageurl, $page - 1 > 1 ? $page - 1 : 1);
             $prev_nav = '<a href="' . $prev_url . '" class="prev" target="_self">' . iPHP::lang('iCMS:page:prev') . '</a>';
             $next_url = iPHP::p2num($pageurl, $total - $page > 0 ? $page + 1 : $page);
             $next_nav = '<a href="' . $next_url . '" class="next" target="_self">' . iPHP::lang('iCMS:page:next') . '</a>';
             $end_nav = '<a href="' . iPHP::p2num($pageurl, $total) . '" class="end" target="_self">共' . $total . '页</a>';
             $text_nav = $index_nav . $prev_nav . '<span class="current">第' . $page . '页</span>' . $next_nav . $end_nav;
             $pagenav = $index_nav . $prev_nav . $num_nav . $next_nav . $end_nav;
         }
         $article['page'] = array('total' => $total, 'count' => $count, 'current' => $page, 'num' => $num_nav, 'text' => $text_nav, 'nav' => $pagenav, 'prev' => $prev_url, 'next' => $next_url, 'pageurl' => $pageurl, 'last' => $page == $count ? true : false, 'end' => $page == $total ? true : false);
         unset($index_nav, $prev_nav, $num_nav, $next_nav, $end_nav, $pagenav);
         //var_dump($page,$total,$count);
         if ($pic_array[0]) {
             $img_array = array_unique($pic_array[0]);
             foreach ($img_array as $key => $img) {
                 $img = str_replace('<img', '<img title="' . $article['title'] . '" alt="' . $article['title'] . '"', $img);
                 if (iCMS::$config['article']['pic_center']) {
                     $img_replace[$key] = '<p align="center">' . $img . '</p>';
                 } else {
                     $img_replace[$key] = $img;
                 }
                 if (iCMS::$config['article']['pic_next'] && $count > 1) {
                     $clicknext = '<a href="' . $next_url . '"><b>' . iPHP::lang('iCMS:article:clicknext') . '</b></a>';
                     $clickimg = '<a href="' . $next_url . '" title="' . $article['title'] . '" class="img">' . $img . '</a>';
                     if (iCMS::$config['article']['pic_center']) {
                         $img_replace[$key] = '<p align="center">' . $clicknext . '</p>';
                         $img_replace[$key] .= '<p align="center">' . $clickimg . '</p>';
                     } else {
                         $img_replace[$key] = '<p>' . $clicknext . '</p>';
                         $img_replace[$key] .= '<p>' . $clickimg . '</p>';
                     }
                 }
             }
             $article['body'] = str_replace($img_array, $img_replace, $article['body']);
         }
     }
     if ($vars['prev_next'] && iCMS::$config['article']['prev_next']) {
         //上一篇
         $prev_cache = iPHP_DEVICE . '/article/' . $article['id'] . '/prev';
         $prev_array = iCache::get($prev_cache);
         if (empty($prev_array)) {
             $prev_array = array('empty' => true, 'title' => iPHP::lang('iCMS:article:first'), 'pic' => array(), 'url' => 'javascript:;');
             $prevrs = iDB::row("SELECT * FROM `#iCMS@__article` WHERE `id` < '{$article['id']}' AND `cid`='{$article['cid']}' AND `status`='1' order by id DESC LIMIT 1;");
             if ($prevrs) {
                 $prev_array = array('empty' => false, 'title' => $prevrs->title, 'pic' => get_pic($prevrs->pic), 'url' => iURL::get('article', array((array) $prevrs, $category))->href);
             }
             iCache::set($prev_cache, $prev_array);
         }
         $article['prev'] = $prev_array;
         //下一篇
         $next_cache = iPHP_DEVICE . '/article/' . $article['id'] . '/next';
         $next_array = iCache::get($next_cache);
         if (empty($next_array)) {
             $next_array = array('empty' => true, 'title' => iPHP::lang('iCMS:article:last'), 'pic' => array(), 'url' => 'javascript:;');
             $nextrs = iDB::row("SELECT * FROM `#iCMS@__article` WHERE `id` > '{$article['id']}'  and `cid`='{$article['cid']}' AND `status`='1' order by id ASC LIMIT 1;");
             if ($nextrs) {
                 $next_array = array('empty' => false, 'title' => $nextrs->title, 'pic' => get_pic($nextrs->pic), 'url' => iURL::get('article', array((array) $nextrs, $category))->href);
             }
             iCache::set($next_cache, $next_array);
         }
         $article['next'] = $next_array;
     }
     if ($vars['tags']) {
         $article['tags_fname'] = $category['name'];
         if ($article['tags']) {
             $tagApp = iPHP::app("tag");
             $tagArray = $tagApp->get_array($article['tags']);
             $article['tag_array'] = array();
             foreach ((array) $tagArray as $tk => $tag) {
                 $article['tag_array'][$tk]['name'] = $tag['name'];
                 $article['tag_array'][$tk]['url'] = $tag['url'];
                 $article['tag_array'][$tk]['link'] = $tag['link'];
                 $article['tags_link'] .= $tag['link'];
                 $tag_name_array[] = $tag['name'];
             }
             $tag_name_array && ($article['tags_fname'] = $tag_name_array[0]);
             unset($tagApp, $tagArray, $tag_name_array);
         }
     }
     if ($vars['meta']) {
         if ($article['metadata']) {
             $article['meta'] = unserialize($article['metadata']);
             unset($article['metadata']);
         }
     }
     if ($vars['user']) {
         iPHP::app('user.class', 'static');
         if ($article['postype']) {
             $article['user'] = user::empty_info($article['userid'], '#' . $article['editor']);
         } else {
             $article['user'] = user::info($article['userid'], $article['author']);
         }
     }
     if (strstr($article['source'], '||')) {
         list($s_name, $s_url) = explode('||', $article['source']);
         $article['source'] = '<a href="' . $s_url . '" target="_blank">' . $s_name . '</a>';
     }
     if (strstr($article['author'], '||')) {
         list($a_name, $a_url) = explode('||', $article['author']);
         $article['author'] = '<a href="' . $a_url . '" target="_blank">' . $a_name . '</a>';
     }
     $article['hits'] = array('script' => iCMS_API . '?app=article&do=hits&cid=' . $article['cid'] . '&id=' . $article['id'], 'count' => $article['hits'], 'today' => $article['hits_today'], 'yday' => $article['hits_yday'], 'week' => $article['hits_week'], 'month' => $article['hits_month']);
     $article['comment'] = array('url' => iCMS_API . "?app=article&do=comment&appid={$article['appid']}&iid={$article['id']}&cid={$article['cid']}", 'count' => $article['comments']);
     if ($article['picdata']) {
         $picdata = unserialize($article['picdata']);
     }
     unset($article['picdata']);
     $article['pic'] = get_pic($article['pic'], $picdata['b'], get_twh($vars['btw'], $vars['bth']));
     $article['mpic'] = get_pic($article['mpic'], $picdata['m'], get_twh($vars['mtw'], $vars['mth']));
     $article['spic'] = get_pic($article['spic'], $picdata['s'], get_twh($vars['stw'], $vars['sth']));
     $article['param'] = array("appid" => $article['appid'], "iid" => $article['id'], "cid" => $article['cid'], "suid" => $article['userid'], "title" => $article['title'], "url" => $article['url']);
     return $article;
 }
예제 #20
0
<?php

$results = "";
$obchkltests = array('421', '416');
$obchkl = get_form_6($ordersid, $obchkltests, $dbh);
$urea = get_form_6($ordersid, array('376'), $dbh);
$biochem = get_form_6($ordersid, array('26', '40'), $dbh);
$point3 = get_3($ordersid, $dbh);
$head = "\\SetWatermarkText{" . $watermark . "}\n";
$head .= "\\vspace{-10px} \\flushleft \\normalsize Биоматериал: \\,КРОВЬ ИЗ ВЕНЫ\n\n~~~~~~~~~~~~~~~~~~~~МОЧА\n\n~~~~~~~~~~~~~~~~~~~~CОСКОБ\\vspace{-3px}";
$head .= "\\begin{center} \\Large \\textbf{ПМО Комплекс для женщин (3 точки)} \\end{center}\n\n\\textbf{\\large{Общеклинические исследования}}\n\n";
$head .= $obchkl . "\n\n" . $urea . "\n\n\\vspace{0.3cm}";
$head .= "\\textbf{\\large{Биохимические исследования}}\n\n";
$head .= $biochem . "\n\\vspace{0.3cm}\n\n";
$head .= "\\vspace{1cm} \\textbf{\\large{Общеклинические исследования отделяемого мочеполовых органов (клеточный состав микрофлора 3 точки) }}\n\n";
$head .= $point3 . "\n\n\\vspace{-0.3cm}";
$pic = get_pic($ordersid, $dbh);
$head .= "\\textbf{\\center\\large{Цитологические исследования}}\n\n\\vspace{0.3cm}";
$head .= $pic . "\n\n";
//исследования проводили...
$end = "\\vspace{0.5cm}\\normalsize\\textbf{Исследования проводили:}\n\n";
$end .= "Общеклинические исследования: " . getApprUserTests($ordersid, '421,416,376', $dbh) . "\n\n";
$end .= "Биохимические исследования: " . getApprUserTests($ordersid, '26,40', $dbh) . "\n\n";
$end .= "Общеклинические исследования отделяемых мочеполовых органов: " . getApprUserTests($ordersid, '743', $dbh) . "\n\n";
$end .= "Цитологические исследования: " . getApprUserTests($ordersid, '403', $dbh) . "\n\n";
$apprdate = find_apprdate($ordersid, $dbh);
$end .= "\\flushright Дата выдачи: " . $apprdate;
$response = $head . $end;
예제 #21
0
    }
    echo "</p><p><a href='config.php'>Back to configuration</a></p></body></html>\n";
    echo "\n--ThisRandomString\n";
}
if (!isset($iamincluded)) {
    if (isset($_GET['cover'])) {
        get_cover();
    } else {
        if (isset($_GET['review'])) {
            get_review();
        } else {
            if (isset($_GET['lyric'])) {
                get_lyric();
            } else {
                if (isset($_GET['pic'])) {
                    get_pic();
                } else {
                    if (isset($_GET['housecleaning'])) {
                        do_houseclean();
                    } else {
                        if (isset($_GET['plrecommend'])) {
                            get_recommendations_from_playlist();
                        } else {
                            header("Content-Type: text/xml; charset=UTF-8");
                            $xml = array_to_xml(array("result" => "what do you want?"));
                            echo $xml->asXML();
                            exit;
                        }
                    }
                }
            }