/** * Crawl * * Crawls /posted/ renaming directories and html files for pretty urls. * * @param int * @return array */ public function crawl($from = 0) { $this->benchmark->mark('crawl_start'); $root = './posted/'; $absolute_root = realpath($root); log_message('debug', 'Absolute Root: ' . $absolute_root); $this->load->helper('naming'); $this->load->helper('file'); $posts = get_dir_file_info($root, $top_level_only = true); log_message('debug', 'Posts:: ' . json_encode($posts)); $this->benchmark->mark('post_loop_start'); /** * Loop through directories in the $root directory formatting directory * names for pretty URLs as well as renaming .html files to * 'index.html'. */ foreach ($posts as $post) { $post_files = get_filenames($root . $post['name'], $prepend_paths = true); log_message('debug', 'Post Files:: ' . json_encode($post_files)); /** * Rename html files to index.html */ foreach ($post_files as $filename) { $filename = str_replace($absolute_root, '', $filename); log_message('debug', 'Filename: ' . $filename); $file_info = PATHINFO($root . $filename); log_message('debug', 'Fileinfo: ' . json_encode($file_info)); if ($file_info['extension'] == 'html' && $file_info['filename'] == 'index') { break; } elseif ($file_info['extension'] == 'html') { rename($root . $filename, $file_info['dirname'] . '/' . 'index.html'); break; } } rename($root . $post['name'], $root . format_url($post['name'])); $post_dirs[] = format_url($post['name']); } $this->benchmark->mark('post_loop_end'); // $posts = get_dir_file_info( $root, $top_level_only = true ); $posts = $this->_fetch_posts($root); log_message('debug', 'Fetched Posts:: ' . json_encode($posts)); $this->benchmark->mark('crawl_end'); return $posts; }
$artists[] = $name; $website_link = get_field('ac-artist-website', $d->ID); if (!empty($website_link)) { $links[$name]['website'] = format_url($website_link); } $facebook_link = get_field('ac-artist-facebook', $d->ID); if (!empty($facebook_link)) { $links[$name]['facebook'] = format_url($facebook_link); } $bandcamp_link = get_field('ac-artist-bandcamp', $d->ID); if (!empty($bandcamp_link)) { $links[$name]['bandcamp'] = format_url($bandcamp_link); } $soundcloud_link = get_field('ac-artist-soundcloud', $d->ID); if (!empty($soundcloud_link)) { $links[$name]['soundcloud'] = format_url($soundcloud_link); } } $sku = $product->get_sku(); $title = get_release_attribute_value($post->ID, 'release-title'); ?> <div itemtype="<?php echo woocommerce_get_product_schema(); ?> " id="product-<?php the_ID(); ?> " class="release-page"> <div class="release-content">
$comment_user_email_save = ""; $comment_user_mailform_link = ""; $comment_user_email_button = ""; $comment_user_homepage_button = ""; $comment_user_icq_button = ""; $comment_user_profile_button = ""; $comment_user_status_img = REPLACE_EMPTY; $comment_user_name = format_text($comment_row[$i]['comment_user_name'], 2); $comment_user_info = $lang['userlevel_guest']; $comment_user_id = $comment_row[$i]['user_id']; if (isset($comment_row[$i][$user_table_fields['user_name']]) && $comment_user_id != GUEST) { $comment_user_name = format_text($comment_row[$i][$user_table_fields['user_name']], 2); $comment_user_profile_link = !empty($url_show_profile) ? $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_show_profile)) : $site_sess->url(ROOT_PATH . "member.php?action=showprofile&" . URL_USER_ID . "=" . $comment_user_id); $comment_user_profile_button = "<a href=\"" . $comment_user_profile_link . "\"><img src=\"" . get_gallery_image("profile.gif") . "\" border=\"0\" alt=\"" . $comment_user_name . "\" /></a>"; $comment_user_status_img = $comment_row[$i][$user_table_fields['user_lastaction']] >= time() - 300 && (isset($comment_row[$i][$user_table_fields['user_invisible']]) && $comment_row[$i][$user_table_fields['user_invisible']] == 0 || $user_info['user_level'] == ADMIN) ? "<img src=\"" . get_gallery_image("user_online.gif") . "\" border=\"0\" alt=\"Online\" />" : "<img src=\"" . get_gallery_image("user_offline.gif") . "\" border=\"0\" alt=\"Offline\" />"; $comment_user_homepage = isset($comment_row[$i][$user_table_fields['user_homepage']]) ? format_url($comment_row[$i][$user_table_fields['user_homepage']]) : ""; if (!empty($comment_user_homepage)) { $comment_user_homepage_button = "<a href=\"" . $comment_user_homepage . "\" target=\"_blank\"><img src=\"" . get_gallery_image("homepage.gif") . "\" border=\"0\" alt=\"" . $comment_user_homepage . "\" /></a>"; } $comment_user_icq = isset($comment_row[$i][$user_table_fields['user_icq']]) ? format_text($comment_row[$i][$user_table_fields['user_icq']]) : ""; if (!empty($comment_user_icq)) { $comment_user_icq_button = "<a href=\"http://www.icq.com/people/about_me.php?uin=" . $comment_user_icq . "\" target=\"_blank\"><img src=\"http://status.icq.com/online.gif?icq=" . $comment_user_icq . "&img=5\" width=\"18\" height=\"18\" border=\"0\" alt=\"" . $comment_user_icq . "\" /></a>"; } if (!empty($comment_row[$i][$user_table_fields['user_email']]) && (!isset($comment_row[$i][$user_table_fields['user_showemail']]) || isset($comment_row[$i][$user_table_fields['user_showemail']]) && $comment_row[$i][$user_table_fields['user_showemail']] == 1)) { $comment_user_email = format_text($comment_row[$i][$user_table_fields['user_email']]); $comment_user_email_save = format_text(str_replace("@", " at ", $comment_row[$i][$user_table_fields['user_email']])); if (!empty($url_mailform)) { $comment_user_mailform_link = $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_mailform)); } else { $comment_user_mailform_link = $site_sess->url(ROOT_PATH . "member.php?action=mailform&" . URL_USER_ID . "=" . $comment_user_id); }
<tr> <th width="40"><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');"></th> <th width="40" align="center">ID</th> <th >专辑信息</th> <th width="160"><?php echo L('operations_manage')?></th> </tr> </thead> <tbody> <?php if(is_array($infos)){ foreach($infos as $info){ ?> <tr> <td align="center" width="40"><input class="inputcheckbox" <?php if (!empty($imported) && in_array($info['id'], $imported)){?>disabled<?php }?> name="id[]" value="<?php echo $info['id'];?>" type="checkbox"></td> <td width="40" align="center"><?php echo $info['id']?></td> <td><div class="col-left mr10" style="width:146px; height:112px"><img src="<?php echo format_url($info['coverurl'])?>" width="146" height="112" style="border:1px solid #eee" align="left"></div> <div class="col-auto"> <h2 class="title-1 f14 lh28 mb6 blue"><?php echo $info['title']?></h2> <div class="lh22"><?php echo $info['desc']?></div> <p class="gray4"><?php echo L('create_time')?>:<?php echo format::date(substr(trim($info['createtime']), 0, 10), 1)?></p> <p class="gray4">播放次数:<?php echo $info['videocount']?></p> </div> </td> <td align="center"><span style="height:22"><?php if (!empty($imported) && in_array($info['id'], $imported)){?><font color="red">专辑已载入<?php } else {?><a href='?m=special&c=album&a=import&id=<?php echo $info['id']?>&page=<?php echo $_GET['page'];?>&pc_hash=<?php echo $_GET['pc_hash'];?>'>载入此专辑</a><?php }?></span><br /><span style="height:22"><a href="?m=special&c=album&a=content_list&id=<?php echo $info['id']?>&menuid=<?php echo $_GET['menuid']?>&pc_hash=<?php echo $_GET['pc_hash'];?>">查看专辑下的视频</a></span></td> </tr> <?php } } ?> </tbody> </table>
$videoid = $video_store['videoid']; } if (!$cat_info) { echo json_encode(array('msg' => 'Add Success', 'code' => '200')); exit; } //根据栏目信息取得站点id及模型id $siteid = $cat_info['siteid']; $modelid = $cat_info['modelid']; //根据模型id,得到视频字段名 $r = $model_field->get_one(array('modelid' => $modelid, 'formtype' => 'video'), 'field'); $fieldname = $r['field']; if ($_POST['posid']) { $data['posids'][] = $_POST['posid']; } $data['thumb'] = safe_replace(format_url($_POST['picpath'])); $data[$fieldname] = 1; //组合POST数据 $_POST[$fieldname . '_video'][1] = array('videoid' => $videoid, 'listorder' => 1); $data['status'] = $video_data['status'] == 21 || $_POST['status'] == 1 ? 99 : 1; //调用内容模型 if (strtolower(CHARSET) != 'utf-8') { $data = array_iconv($data, 'utf-8', 'gbk'); } $content->set_model($modelid); $cid = $content->add_content($data); //更新对应关系 //$content_video_db = pc_base::load_model('video_content_model'); //$content_video_db->insert(array('contentid'=>$cid, 'videoid'=>$videoid, 'modelid'=>$modelid, 'listorder'=>1)); //更新点击次数 if ($_POST['playnum']) {
echo json_encode(array('msg' => 'Video\'s title not empty', 'code' => 3)); exit; } $content = $_POST['desc'] ? addslashes($_POST['desc']) : ''; $data['description'] = $video_data['description'] = substr($content, 0, 255); $data['keywords'] = $video_data['keywords'] = $_POST['tag'] ? addslashes($_POST['tag']) : ''; $vid = $video_data['vid'] = $_POST['vid']; if (!$vid) { echo json_encode(array('msg' => 'Vid do not empty', 'code' => 4)); exit; } //先将视频加入到视频库中,并取得videoid //判断vid是否已经存在视频库中 if (!($video_store = $video_store_db->get_one(array('vid' => $vid)))) { $video_data['status'] = $_POST['status'] ? intval($_POST['status']) : 21; $video_data['picpath'] = safe_replace(format_url($_POST['picPath'])); $video_data['addtime'] = intval(substr($_POST['uploadTime'], 0, 10)); $video_data['timelen'] = intval($_POST['videoTime']); $video_data['size'] = intval($_POST['videoSize']); if (strtolower(CHARSET) != 'utf-8') { $video_data = array_iconv($video_data, 'utf-8', 'gbk'); } $videoid = $video_store_db->insert($video_data, true); } else { $videoid = $video_store['vid']; } //构建special_content表数据字段 $res = $type_db->get_one(array('parentid' => $data['specialid'], 'module' => 'special'), 'typeid', 'listorder ASC'); $data['typeid'] = $res['typeid']; $data['thumb'] = $video_data['picpath']; $data['videoid'] = $videoid;
/** * 执行视频导入 */ public function doimport() { $importdata = $_POST['importdata']; $select_category = intval($_POST['select_category']); //栏目ID $is_category = intval($_POST['is_category']); //是否导入栏目 $siteid = get_siteid(); $ids = $_POST['ids']; $datas = array(); if (is_array($ids)) { foreach ($_POST['importdata'] as $vv) { //重组勾选数据 if (in_array($vv['vid'], $ids)) { $datas[] = $vv; } } $video_store_db = pc_base::load_model('video_store_model'); $content_model = pc_base::load_model('content_model'); $content_model->set_catid($select_category); $CATEGORYS = getcache('category_content_' . $siteid, 'commons'); $modelid = $CATEGORYS[$select_category]['modelid']; // 所选视频栏目对应的modelid $model_field = pc_base::load_model('sitemodel_field_model'); $r = $model_field->get_one(array('modelid' => $modelid, 'formtype' => 'video'), 'field'); $fieldname = $r['field']; //查出视频字段 //导入推荐位使用 $this->push = push_factory::get_instance()->get_api('admin'); //循环勾选数据,进行请求ku6vms入库接口进行入库,成功后插入本系统对应栏目,并自动进行video_content对应关系 $new_s = array(); foreach ($datas as $data) { $data['cid'] = $select_category; $data['import'] = 1; $data['channelid'] = 1; $return_data = array(); $return_data = $this->ku6api->vms_add($data); //插入VMS,返回能播放使用的vid //$new_s[] = $return_data; $vid = $return_data['vid']; if (!$vid) { showmessage('导入VMS系统时,发生错误!', HTTP_REFERER); } //入本机视频库 $video_data = array(); $video_data['title'] = str_cut($data['title'], 80, false); $video_data['vid'] = $vid; $video_data['keywords'] = str_cut($data['tag'], 36); $video_data['description'] = str_cut($data['desc'], 200); $video_data['status'] = $data['status']; $video_data['addtime'] = $data['uploadtime'] ? substr($data['uploadtime'], 0, 10) : SYS_TIME; $video_data['picpath'] = safe_replace(format_url($data['picpath'])); $video_data['timelen'] = intval($data['timelen']); $video_data['size'] = intval($data['size']); $video_data['channelid'] = 1; $videoid = $video_store_db->insert($video_data, true); //插入视频库 if ($is_category == 1) { //视频直接发布到指定栏目 //组合POST数据 //根据模型id,得到视频字段名 $content_data = array(); $content_data[$fieldname] = 1; $content_data['catid'] = $select_category; $content_data['title'] = str_cut($data['title'], 80, ' '); $content_data['content'] = $data['desc']; $content_data['description'] = str_cut($data['desc'], 198, ' '); $content_data['keywords'] = str_cut($data['tag'], 38, ' '); $content_data = array_filter($content_data, 'rtrim'); $content_data['thumb'] = $data['picpath']; $content_data['status'] = 99; //组合POST数据,入库时会自动对应关系 $_POST[$fieldname . '_video'][1] = array('videoid' => $videoid, 'listorder' => 1); //调接口,插入数据库 $cid = $content_model->add_content($content_data); //入推荐位 $position = $_POST['sub']['posid']; if ($position) { $info = array(); //组成提交信息数据 $pos_content_data = $content_data; $pos_content_data['id'] = $cid; $pos_content_data['inputtime'] = SYS_TIME; $pos_content_data['updatetime'] = SYS_TIME; $info[$cid] = $pos_content_data; //信息数据 $pos_array = array(); //推荐位ID,要求是数组下面使用 $pos_array[] = $position; $post_array = ''; //position 所用 $post_array['modelid'] = $modelid; $post_array['catid'] = $select_category; $post_array['id'] = $cid; $post_array['posid'] = $pos_array; $post_array['dosubmit'] = '提交'; $post_array['pc_hash'] = $_GET['pc_hash']; $this->push->position_list($info, $post_array); //调用admin position_list()方法 } //更新点击次数 if ($data['viewcount']) { $views = intval($data['viewcount']); $hitsid = 'c-' . $modelid . '-' . $cid; $count = pc_base::load_model('hits_model'); $count->update(array('views' => $views), array('hitsid' => $hitsid)); } } } $page = intval($_POST['page']) + 1; if ($_POST['fenlei'] || $_POST['keyword']) { $forward = "?m=video&c=video&a=import_ku6video&menuid=" . $_POST['menuid'] . "&fenlei=" . $_POST['fenlei'] . "&srctype=" . $_POST['srctype'] . "&videotime=" . $_POST['videotime'] . "&keyword=" . $_POST['keyword'] . "&dosubmit=%CB%D1%CB%&page=" . $page; } else { $forward = "?m=video&c=video&a=import_ku6video&menuid=" . $_POST['menuid']; } showmessage('KU6视频导入成功,正在返回!', $forward); } else { showmessage('请选择要导入的视频!', HTTP_REFERER); } }
/** * Function importfalbum * 将专辑载入到专题 * @param array $info 专辑详细信息 */ public function importfalbum($info = array()) { static $siteid, $sitelists; if (!$siteid) { $siteid = get_siteid(); } if (!$sitelists) { $sitelists = getcache('sitelist', 'commons'); } pc_base::load_sys_func('iconv'); if (is_array($info)) { $username = param::get_cookie('admin_username'); $userid = param::get_cookie('userid'); $arr = array('siteid' => $siteid, 'aid' => $info['id'], 'title' => $info['title'], 'thumb' => format_url($info['coverurl']), 'banner' => format_url($info['coverurl']), 'description' => $info['desc'], 'ishtml' => 0, 'ispage' => 0, 'style' => 'default', 'index_template' => 'index_video', 'list_template' => 'list_video', 'show_template' => 'show_video', 'username' => $username, 'userid' => $userid, 'createtime' => SYS_TIME, 'isvideo' => 1); //将数据插入到专题表中 $arr = new_html_special_chars($arr); $specialid = $this->db->insert($arr, true); $url = $sitelists[$siteid]['domain'] . 'index.php?m=special&c=index&id=' . $specialid; $this->db->update(array('url' => $url), array('id' => $specialid)); //组合子分类数组 $letters = gbk_to_pinyin($info['title']); $type_info = array('siteid' => $siteid, 'module' => 'special', 'modelid' => 0, 'name' => new_html_special_chars($info['title']), 'parentid' => $specialid, 'typedir' => strtolower(implode('', $letters)), 'listorder' => 1); $typeid = $this->type_db->insert($type_info, true); $url = $sitelists[$siteid]['domain'] . 'index.php?m=special&c=index&a=type&specialid=' . $specialid . '&typeid=' . $typeid; $this->type_db->update(array('url' => $url), array('typeid' => $typeid)); return $specialid; } else { return false; } }
$info['pick'] = get_pick_info(); if ($info['pick']['rules_hash']) { pload('F:rules'); $info['rules'] = get_rules_info($info['pick']['rules_hash']); } $is_hava = $info['rules'] ? milu_lang('hava_system_rules') : milu_lang('no_hava_system_rules'); $args = array('type' => milu_lang('dxc_rules'), 'author' => $_G['setting']['bbname'], 'rules_name' => $info['pick']['name'], 'rule_desc' => $is_hava); $info['version'] = PICK_VERSION; exportfile($info, $info['pick']['name'], $args); break; case 'show_article_info': $arr['title'] = format_url($_GET['title']); $arr['content'] = format_url($_GET['content']); $arr['article_get_type'] = $_GET['article_get_type']; $arr['url_page_range'] = $_GET['url_page_range']; $arr['page_link_rules'] = format_url($_GET['page_link_rules']); $url_range_type = $_GET['url_range_type']; $page_test_url = $_GET['page_test_url']; $arr['url'] = $_GET['url']; $arr['auto'] = $_GET['auto']; $page_get_type = $_GET['page_get_type']; $range_arr = get_url_range($arr['url_page_range']); if ($page_test_url) { $link_arr[0] = $page_test_url; } else { if ($url_range_type == 'page') { if ($page_get_type == 'dom') { $link_arr = dom_page_link($range_arr[0], $arr); } else { $link_arr = regexp_page_link($range_arr[0], $arr['page_link_rules']); }
function create_variable() { global $_G; ob_clean(); ob_end_flush(); $url = format_url($_GET['url']); $rid = $_GET['rid']; $arr = explode('(*)', $url); $count = count($arr); $data = get_rules_info($rid); $url_var = unserialize($data['url_var']); for ($i = 1; $i < $count; $i++) { if ($url_var[$i]['var_type'][$i] == 'select' || $url_var[$i]['var_type'][$i] == 'selects') { $show_keyword = "display:none"; } else { $show_ext = "display:none"; } if ($url_var[$i]['var_type'][$i] == 'text') { $select_text = 'selected="selected"'; } if ($url_var[$i]['var_type'][$i] == 'textarea') { $select_textarea = 'selected="selected"'; } if ($url_var[$i]['var_type'][$i] == 'select') { $select_select = 'selected="selected"'; } if ($url_var[$i]['var_type'][$i] == 'selects') { $select_selects = 'selected="selected"'; } if ($url_var[$i]['var_ext_keyword'][$i] == 1) { $check_box = 'checked="checked" '; } $html .= '<tr class="hover"><td><input name="url_var[' . $i . '][var_title][' . $i . ']" type="text" value="' . $url_var[$i]['var_title'][$i] . '" class="shorttxt" id="var_title[' . $i . ']" size="15"></td><td><select class="var_ext_select_' . $i . '" onchange="show_var_ext(this.value, ' . $i . ')" name="url_var[' . $i . '][var_type][' . $i . ']" id="var_type[' . $i . ']"> <option ' . $select_text . ' value="text" selected="">' . milu_lang('text') . '(text)</option> <option ' . $select_textarea . ' value="textarea">' . milu_lang('textarea') . '(textarea)</option> <option ' . $select_select . ' value="select">' . milu_lang('select') . '(select)</option> <option ' . $select_selects . ' value="selects">' . milu_lang('selects') . '(selects)</option> </select></td> <td> <label id="var_keyword_' . $i . '" style="' . $show_keyword . '"> <input ' . $check_box . ' name="url_var[' . $i . '][var_ext_keyword][' . $i . ']" type="checkbox" id="var_ext_keyword[' . $i . ']" value="checkbox" />' . milu_lang('open_keyword') . '</label> <div id="var_select_' . $i . '" style="' . $show_ext . '"><textarea style="float:left" rows="6" ondblclick="textareasize(this, 1)" onkeyup="textareasize(this, 0)" name="url_var[' . $i . '][var_ext_select][' . $i . ']" id="var_ext_select[' . $i . ']" cols="50" class="tarea">' . $url_var[$i]['var_ext_select'][$i] . '</textarea> <span style="float:left"> <em>' . milu_lang('desc_demo') . '</em> </span></div></td> <td><textarea rows="6" ondblclick="textareasize(this, 1)" onkeyup="textareasize(this, 0)" name="url_var[' . $i . '][var_desc][' . $i . ']" id="var_desc' . $i . '" cols="50" class="tarea">' . $url_var[$i]['var_desc'][$i] . '</textarea></td> </tr>'; unset($show_keyword, $show_ext, $select_text, $select_textarea, $select_select, $select_selects); } echo $html; define(FOOTERDISABLED, false); exit; }
} } $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . 'work/work.php?' . api_get_cidreq(), 'name' => get_lang('StudentPublications')); $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . 'work/work_list.php?' . api_get_cidreq() . '&id=' . $work_id, 'name' => $parent_data['title']); // form title $form_title = get_lang('UploadADocument'); $interbreadcrumb[] = array('url' => '#', 'name' => $form_title); $form = new FormValidator('form', 'POST', api_get_self() . "?" . api_get_cidreq() . "&id=" . $work_id . "&gradebook=" . Security::remove_XSS($_GET['gradebook']) . "&origin={$origin}", '', array('enctype' => "multipart/form-data")); $form->addElement('header', $form_title); $show_progress_bar = false; if ($submitGroupWorkUrl) { // For user coming from group space to publish his work $realUrl = str_replace($_configuration['root_sys'], api_get_path(WEB_PATH), str_replace("\\", '/', realpath($submitGroupWorkUrl))); $form->addElement('hidden', 'newWorkUrl', $submitGroupWorkUrl); $text_document = $form->addElement('text', 'document', get_lang('Document')); $defaults['document'] = '<a href="' . format_url($submitGroupWorkUrl) . '">' . $realUrl . '</a>'; $text_document->freeze(); } else { // else standard upload option $form->addElement('file', 'file', get_lang('UploadADocument'), 'size="40" onchange="updateDocumentTitle(this.value)"'); $show_progress_bar = true; } $form->addElement('hidden', 'id', $work_id); $form->addElement('hidden', 'contains_file', 0, array('id' => 'contains_file_id')); $form->addElement('text', 'title', get_lang('Title'), array('id' => 'file_upload', 'class' => 'span4')); $form->add_html_editor('description', get_lang('Description'), false, false, getWorkDescriptionToolbar()); $form->addElement('hidden', 'active', 1); $form->addElement('hidden', 'accepted', 1); $form->addElement('hidden', 'sec_token', $token); $text = get_lang('Send'); $class = 'upload';
public function getRichInfo($p) { if (!$p) { return NULL; } $cache_key = 'content_rich_' . $p['id']; if ($result = S($cache_key)) { return $result; } $p['category_name'] = D("Category")->getFieldById($p['category_id'], 'title'); $tags = D("Tag")->getByObject($p['id']); $p['tags'] = $tags[$p['id']]; if ($p['author_id']) { $p['author'] = D('Author')->getById($p['author_id']); $p['author_name'] = $p['author']['name']; } if ($p['source_id']) { $p['source_name'] = D('Source')->where(array('id' => $p['source_id']))->getField('name'); } $p['update_user'] = D("User")->field('password', true)->getById($p['update_user_id']); $p['create_user'] = D("User")->field('password', true)->getById($p['create_user_id']); $p['link'] = format_url($p['external_url']); if (!$p['link']) { $p['link'] = '/content/' . $p['id']; } // files if ($p['model_id'] == 5) { $p['files'] = D('FileMapping')->getMapping($p['id'], 'content'); } if ($p['model_id'] == 2) { $p['pictures'] = D('PictureMapping')->getMapping($p['id'], 'content'); } $p['address'] = explode('///', $p['address']); $p['gallery'] = D('PictureMapping')->getMapping($p['id'], 'content'); // Extend $p['extend'] = M("ContentExtend")->where('content_id=' . $p['id'])->getField('name,value'); // parent if ($p['parent_id'] && $p['parent_id'] != $p['id']) { $p['parent'] = $this->getPageById($p['parent_id']); } //取child page $children_pages = $this->where(array('parent_id' => $p['id'], 'status' => 2))->order('weight desc, publish_time desc')->select(); if ($children_pages) { //extend foreach ($children_pages as $key => $child_page) { $children_pages[$key]['extend'] = D("ContentExtend")->where('content_id=' . $child_page['id'])->getField('name,value'); $children_pages[$key]['update_user'] = D("User")->getById($child_page['update_user_id']); $children_pages[$key]['create_user'] = D("User")->field('password', true)->getById($child_page['create_user_id']); $children_pages[$key]['gallery'] = D('PictureMapping')->getMapping($child_page['id'], 'content'); $children_pages[$key]['link'] = format_url($children_pages[$key]['external_url']); if (!$child_page['link']) { $children_pages[$key]['link'] = '/content/' . $children_pages[$key]['id']; } if ($child_page['author_id']) { $children_pages[$key]['author_name'] = D('Author')->where('id=%d', $children_pages[$key]['author_id'])->getField('name'); } } $p['children_pages'] = $children_pages; } //更新当前文章的子文章数 if ($p['child_content_count'] != count($children_pages)) { M('Content')->where('id=%d', intval($p['id']))->setField('child_content_count', count($children_pages)); } S($cache_key, $p); return $p; }
function fileManageDisplayFile(&$fileManage, $uid, $is_adminOfCourse, $lock, $language, $webDir) { //Aadido por Fernando Acero Martin include "{$webDir}/miguel/lang/spanish/trad4all.inc.php"; include "{$webDir}/miguel/lang/{$language}/trad4all.inc.php"; include "{$webDir}/miguel/lang/spanish/document.inc.php"; include "{$webDir}/miguel/lang/{$language}/document.inc.php"; $lFileListCount = count($fileManage->fileList); for ($i = 0; $i < $lFileListCount; $i++) { $cmdFileName = $fileManage->fileList[$i]['id']; $image = choose_image($fileManage->fileList[$i]['titre']); $size = format_file_size($fileManage->fileList[$i]['size']); $date = format_date($fileManage->fileList[$i]['date']); $pathFileName = format_url($GLOBALS[currentCourseID] . '/' . $fileManage->modName . $fileManage->fileList[$i]['path']); $dspFileName = htmlentities($fileManage->fileList[$i]['titre']); $commentFile = $fileManage->fileList[$i]['comment']; $visibilityStatus = $fileManage->fileList[$i]['visibility']; if ($fileManage->modName != 'document') { $lockStatus = $fileManage->fileList[$i]['lock']; $UIDFile = $fileManage->fileList[$i]['uid']; $GIDFile = $fileManage->fileList[$i]['gid']; } else { $lockStatus = 1; } //Indetec: Elige el estilo de la tupla en función d la visibilidad y el bloqueo. if ($visibilityStatus == 'i') { $style = " class=\"invisible\""; //Si no somos administradores o dueños y es una tupla invisible pasamos a la siguiente if (!$is_adminOfCourse && $uid != $UIDFile && $GIDFile != $fileManage->gid) { continue; } } else { $style = ""; } echo "<tr align=\"center\"{$style}>\n"; echo "<td align=\"left\">\n"; echo "<a href=\"" . $GLOBALS[urlServer] . $pathFileName . "\" {$style} target=\"top\">\n"; echo "<img src=\"" . $GLOBALS[urlServer] . "/miguel/image/filemanager/{$image}\" border=\"0\" hspace=\"5\" alt=\"\">\n"; echo $dspFileName . "\n"; echo "</a>\n"; /*** size ***/ echo "<td><small>{$size}</small></td>\n"; /*** date ***/ echo "<td><small>{$date}</small></td>\n"; if (isset($uid)) { /*** delete command ***/ //Indetec: Solo puede borrar si no está bloqueado y es el dueño o es el administrador del curso(profesor). if ($lockStatus == 1 && ($GIDFile == $fileManage->gid || $UIDFile == $uid || $is_adminOfCourse)) { echo "<td><a href=\"" . $_SERVER[PHP_SELF] . "?delete={$cmdFileName}\" onClick=\"return confirmation('" . addslashes($dspFileName) . "');\"><img src=\"" . $GLOBALS[urlServer] . "/miguel/image/filemanager/delete.png\" border=\"0\" alt=\"{$langDelete}\" title=\"{$langToolTipDelete}\"></a></td>\n"; } else { echo "<td></td>"; } if ($lockStatus == 1 && $is_adminOfCourse) { echo "<td><a href=\"" . $_SERVER[PHP_SELF] . "?move={$cmdFileName}\"><img src=\"" . $GLOBALS[urlServer] . "/miguel/image/filemanager/move.png\" border=\"0\" alt=\"{$langMove}\" title=\"{$langToolTipMove}\"></a></td>\n"; } else { echo "</td><td>"; } //Indetec: En caso de no estar bloqueado y ser dueño o ser profesor if ($lockStatus == 1 && ($GIDFile == $fileManage->gid || $UIDFile == $uid || $is_adminOfCourse)) { /*** rename command ***/ echo "<td><a href=\"" . $_SERVER[PHP_SELF] . "?rename={$cmdFileName}\"><img src=\"" . $GLOBALS[urlServer] . "/miguel/image/filemanager/rename.png\" border=\"0\" alt=\"{$langRename}\" title=\"{$langToolTipRename}\"></a></td>\n"; /*** comment command ***/ echo "<td><a href=\"" . $_SERVER[PHP_SELF] . "?comment={$cmdFileName}\"><img src=\"" . $GLOBALS[urlServer] . "/miguel/image/filemanager/comment.png\" border=\"0\" alt=\"{$langComment}\" title=\"{$langToolTipComment}\"></a></td>\n"; } else { echo "<td><td>"; } if ($is_adminOfCourse) { // if theache /*** visibility command ***/ if ($visibilityStatus == "i") { echo "<td><a href=\"" . $_SERVER[PHP_SELF] . "?mkVisibl={$cmdFileName}\"><img src=\"" . $GLOBALS[urlServer] . "/miguel/image/filemanager/invisible.png\" border=\"0\" alt=\"{$langVisible}\" title=\"{$langToolTipVisible}\"></a>\n</td>\n"; } else { echo "<td><a href=\"" . $_SERVER[PHP_SELF] . "?mkInvisibl={$cmdFileName}\"><img src=\"" . $GLOBALS[urlServer] . "/miguel/image/filemanager/visible.png\" border=\"0\" alt=\"{$langInvisible}\" title=\"{$langToolTipInvisible}\"></a></td>\n"; } /*** Indetec: Lock command ***/ if ($lock) { if ($lockStatus == 1) { echo "<td><a href=\"" . $_SERVER[PHP_SELF] . "?mkUnLock={$cmdFileName}\"><img src=\"" . $GLOBALS[urlServer] . "/miguel/image/filemanager/lock.png\" border=\"0\" alt=\"{$langLock}\" title=\"{$langToolTipUnlock}\"></a>\n</td>\n"; } else { echo "<td><a href=\"" . $_SERVER[PHP_SELF] . "?mkLock=" . $cmdFileName . "\"><img src=\"" . $GLOBALS[urlServer] . "/miguel/image/filemanager/unlock.png\" border=\"0\" alt=\"{$langUnlock}\" title=\"{$langToolTipLock}\"></a></td>\n"; } } } else { echo "<td><td>"; } } else { echo "<td colspan=\"5\"></td>"; } echo "</tr>\n"; /*** comments ***/ if ($commentFile != '') { $commentFile = htmlentities($commentFile); $commentFile = nl2br($commentFile); echo "<tr align=\"left\">\n"; echo "<td colspan=\"8\">\n"; echo "<div class=\"comment\">"; echo $commentFile; echo "</div>\n"; echo "</td>\n"; echo "</tr>\n"; } } }
function CreateTopic($xanonpost, $subject, $comment, $pid, $sid, $host_name, $mode, $order, $thold, $posttype) { global $module_name, $user, $userinfo, $EditedMessage, $cookie, $AllowableHTML, $ultramode, $prefix, $anonpost, $articlecomm, $db; cookiedecode($user); $author = FixQuotes($author); $subject = FixQuotes(filter_text($subject, "nohtml")); $comment = format_url($comment); if ($posttype == "exttrans") { $comment = FixQuotes(nl2br(htmlspecialchars(check_words($comment)))); } elseif ($posttype == "plaintext") { $comment = FixQuotes(nl2br(filter_text($comment))); } else { $comment = FixQuotes(filter_text($comment)); } if (is_user($user)) { getusrinfo($user); } if (is_user($user) && !$xanonpost) { getusrinfo($user); $name = $userinfo[username]; $email = $userinfo[femail]; $url = $userinfo[user_website]; $score = 1; } else { $name = ""; $email = ""; $url = ""; $score = 0; } $ip = $_SERVER["REMOTE_HOST"]; if (empty($ip)) { $ip = $_SERVER["REMOTE_ADDR"]; } $fake = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_stories WHERE sid='{$sid}'")); $comment = trim($comment); $comment = stripslashes($comment); if ($fake == 1 and $articlecomm == 1) { if ($anonpost == 0 and is_user($user) or $anonpost == 1) { $db->sql_query("INSERT INTO " . $prefix . "_comments VALUES (NULL, '{$pid}', '{$sid}', now(), '{$name}', '{$email}', '{$url}', '{$ip}', '{$subject}', '{$comment}', '{$score}', '0')"); $db->sql_query("UPDATE " . $prefix . "_stories SET comments=comments+1 WHERE sid='{$sid}'"); update_points(5); if ($ultramode) { ultramode(); } } else { echo "Nice try..."; die; } } else { include "header.php"; echo "According to my records, the topic you are trying " . "to reply to does not exist. If you're just trying to be " . "annoying, well then too bad."; include "footer.php"; die; } if (isset($cookie[4])) { $options .= "&mode={$cookie['4']}"; } else { $options .= "&mode=thread"; } if (isset($cookie[5])) { $options .= "&order={$cookie['5']}"; } else { $options .= "&order=0"; } if (isset($cookie[6])) { $options .= "&thold={$cookie['6']}"; } else { $options .= "&thold=0"; } Header("Location: modules.php?name={$module_name}&file=article&sid={$sid}{$options}"); }
public function helpHtmlLink($options) { echo "<a href='" . $options["module"] . "/" . format_url($options["seotext"]) . "-" . $options["id"] . "'>" . $options["text"] . "</a>"; }
function CreateTopic($xanonpost, $subject, $comment, $pid, $pollID, $host_name, $mode, $order, $thold) { global $userinfo, $user, $userinfo, $EditedMessage, $cookie, $prefix, $pollcomm, $anonpost, $db, $module_name, $user_prefix; if (!isset($mode) or empty($mode)) { if (isset($userinfo['umode'])) { $mode = $userinfo['umode']; } else { $mode = "thread"; } } if (!isset($order) or empty($order)) { if (isset($userinfo['uorder'])) { $order = $userinfo['uorder']; } else { $order = 0; } } if (!isset($thold) or empty($thold)) { if (isset($userinfo['thold'])) { $thold = $userinfo['thold']; } else { $thold = 0; } } $pollID = intval($pollID); $pid = intval($pid); $author = filter($author, "nohtml", 1); $subject = filter($subject, "nohtml", 1); $comment = format_url($comment); $comment = filter($comment, "", 1); if (is_user($user) && !$xanonpost) { $name = $userinfo['username']; $email = $userinfo['femail']; $url = $userinfo['user_website']; $score = 1; } else { $name = ""; $email = ""; $url = ""; $score = 0; } if (!isset($ip)) { $ip = $_SERVER['REMOTE_ADDR']; } $pollID = intval($pollID); $result = $db->sql_query("select count(*) from " . $prefix . "_poll_desc where pollID='{$pollID}'"); $fake = $db->sql_numrows($result); if ($fake == 1) { if ($anonpost == 0 and is_user($user) or $anonpost == 1) { if (is_user($user)) { $krow = $db->sql_fetchrow($db->sql_query("SELECT karma FROM " . $user_prefix . "_users WHERE username='******'")); $koptions = "&mode=" . $mode . "&order=" . $order . "&thold=" . $thold; if ($krow['karma'] == 2) { $db->sql_query("INSERT INTO " . $prefix . "_pollcomments_moderated VALUES (NULL, '{$pid}', '{$pollID}', now(), '{$name}', '{$email}', '{$url}', '{$ip}', '{$subject}', '{$comment}', '{$score}', '0', '0')"); include_once "header.php"; title("" . _MODERATEDTITLE . ""); OpenTable(); echo "<center>" . _COMMENTMODERATED . ""; echo "<br><br><a href=\"modules.php?name={$module_name}&op=results&pollID={$pollID}{$koptions}\">" . _MODERATEDTITLE . "</a>"; CloseTable(); include_once "footer.php"; die; } elseif ($krow['karma'] == 3) { Header("Location: modules.php?name={$module_name}&op=results&pollID={$pollID}{$koptions}"); die; } } $db->sql_query("insert into " . $prefix . "_pollcomments values (NULL, '{$pid}', '{$pollID}', now(), '{$name}', '{$email}', '{$url}', '{$ip}', '{$subject}', '{$comment}', '{$score}', '0', '0')"); $db->sql_query("UPDATE " . $prefix . "_poll_desc SET comments=comments+1 WHERE pollID='{$pollID}'"); update_points(9); } else { die("Nice try..."); } } else { include_once "header.php"; echo "According to my records, the topic you are trying " . "to reply to does not exist. If you're just trying to be " . "annoying, well then too bad."; include_once "footer.php"; die; } if ($pollcomm == 1) { $options = "&mode=" . $mode . "&order=" . $order . "&thold=" . $thold; Header("Location: modules.php?name={$module_name}&op=results&pollID={$pollID}{$options}"); } }
function get_member_info() { $info_str = milu_lang('member_field_str'); $url = format_url($_GET['url']); $test_uid = intval(format_url($_GET['test_uid'])); $uid_range = $test_uid ? $test_uid : format_url($_GET['uid_range']); $login_cookie = format_cookie($_GET['login_cookie']); $uid_arr = get_data_range($uid_range); $arr = get_user_url_arr($url, $uid_arr['list']); $test_url = $arr[0]['url']; if (!$test_url) { show_pick_window(milu_lang('get_link_list_test'), milu_lang('no_set_uidurl'), array('w' => 620, 'h' => '400', 'f' => 1)); } $content = get_contents($test_url, array('cookie' => $login_cookie)); if ($content == -1) { show_pick_window(milu_lang('get_link_list_test'), milu_lang('check_user_url'), array('w' => 620, 'h' => '400', 'f' => 1)); } $info_arr = dom_get_manytext($content, 'div#ct div.mn li'); //获取用户名 preg_match_all('/<title>(.*)' . milu_lang('the_user_info') . '/i', $content, $matchs); $re_arr[milu_lang('user_name')] = $matchs[1][0]; if (!$info_arr) { show_pick_window(milu_lang('get_link_list_test'), milu_lang('pick_must_set_cookie'), array('w' => 620, 'h' => '400', 'f' => 1)); } $info_field_arr = explode('|', $info_str); $i = 0; foreach ((array) $info_arr as $k => $v) { foreach ($info_field_arr as $k2 => $v2) { $v2_arr = format_wrap($v2, '@@'); $v2 = $v2_arr[1]; if (strexists($v, $v2)) { $value = str_replace('<em>' . $v2 . '</em>', '', $v); if (strexists($v2, 'IP')) { $value = str_replace(' -', '', $value); } $re_arr[$v2] = trim($value); } } } $output .= '<p>' . milu_lang('the_test_url') . ' : <a target="_brank" href="' . $test_url . '">' . $test_url . '</a></p></br>'; $output .= '<table class="tb tb2">'; foreach ((array) $re_arr as $k => $v) { $output .= '<tr><td>' . $k . ' : </td><td>' . $v . '</td></tr>'; } $output .= '</table>'; show_pick_window(milu_lang('get_link_list_test'), $output, array('w' => 620, 'h' => '400', 'f' => 1)); }
<tbody> <?php if (is_array($infos)) { $n = 0; foreach ($infos as $info) { $n++; ?> <?php if ($n % 3 == 1) { ?> <tr><?php } ?> <td><div class="col-left mr10" style="width:146px; height:112px"><img src="<?php echo format_url($info['video']['picPath']); ?> " width="146" height="112" style="border:1px solid #eee" align="left" title="<?php echo $info['video']['title']; ?> "></div> <div class="col-auto"> <h2 class="title-1 f14 lh28 mb6 blue" title="<?php echo $info['video']['title']; ?> "><?php echo str_cut($info['video']['title'], 26); ?> </h2> <div class="lh22"><?php echo $info['video']['desc'];
$content = $site_template->parse_template("member_lostpassword"); } //----------------------------------------------------- //--- Edit Profile ------------------------------------ //----------------------------------------------------- $update_process = 0; $new_email_msg = ""; if ($action == "updateprofile") { $txt_clickstream = $lang['control_panel']; if ($user_info['user_level'] == GUEST) { show_error_page($lang['no_permission']); exit; } $user_email = isset($HTTP_POST_VARS['user_email']) ? un_htmlspecialchars(trim($HTTP_POST_VARS['user_email'])) : ""; $user_email2 = isset($HTTP_POST_VARS['user_email2']) ? un_htmlspecialchars(trim($HTTP_POST_VARS['user_email2'])) : ""; $user_homepage = isset($HTTP_POST_VARS['user_homepage']) ? format_url(un_htmlspecialchars(trim($HTTP_POST_VARS['user_homepage']))) : ""; $user_icq = isset($HTTP_POST_VARS['user_icq']) ? intval(trim($HTTP_POST_VARS['user_icq'])) ? intval(trim($HTTP_POST_VARS['user_icq'])) : "" : ""; $user_showemail = isset($HTTP_POST_VARS['user_showemail']) ? intval($HTTP_POST_VARS['user_showemail']) : 0; $user_allowemails = isset($HTTP_POST_VARS['user_allowemails']) ? intval($HTTP_POST_VARS['user_allowemails']) : 0; $user_invisible = isset($HTTP_POST_VARS['user_invisible']) ? intval($HTTP_POST_VARS['user_invisible']) : 0; $error = 0; if ($user_info['user_email'] != $user_email && ($checkuser = $site_db->query_firstrow("SELECT " . get_user_table_field("", "user_id") . " FROM " . USERS_TABLE . " WHERE " . get_user_table_field("", "user_email") . " = '{$user_email}' AND " . get_user_table_field("", "user_id") . " <> '" . $user_info['user_id'] . "'"))) { if ($checkuser[$user_table_fields['user_id']] != $user_info['user_id']) { $msg .= ($msg != "" ? "<br />" : "") . $lang['email_exists']; $error = 1; } } if ($user_email != $user_email2) { $msg .= ($msg != "" ? "<br />" : "") . $lang['update_email_confirm_error']; $error = 1; }
<td align="center" width="40"><input class="inputcheckbox" <?php if (!empty($imported) && in_array($info['id'], $imported)) { ?> disabled<?php } ?> name="id[]" value="<?php echo $info['id']; ?> " type="checkbox"></td> <td width="40" align="center"><?php echo $info['id']; ?> </td> <td><div class="col-left mr10" style="width:146px; height:112px"><img src="<?php echo format_url($info['coverurl']); ?> " width="146" height="112" style="border:1px solid #eee" align="left"></div> <div class="col-auto"> <h2 class="title-1 f14 lh28 mb6 blue"><?php echo $info['title']; ?> </h2> <div class="lh22"><?php echo $info['desc']; ?> </div> <p class="gray4"><?php echo L('create_time'); ?> :<?php
function format_post_urls($fieldnames) { //takes a comma-separated list of POST keys and formats them as NULLs or urls global $_POST; error_debug("<b>format_post_urls</b> for " . $fieldnames); $fields = array_post_fields($fieldnames); foreach ($fields as $field) { $_POST[$field] = format_null(format_url($_POST[$field])); } }
$headers .= "Content-Transfer-Encoding: quoted-printable"; mail($comments_address, $subject, $c_msg, $headers); if ($_POST['bakecookie'] == 'on') { setcookie("blogatron_author", "{$c_author}", time() + 3600 * 24 * 365, "/"); setcookie("blogatron_email", "{$c_email}", time() + 3600 * 24 * 365, "/"); setcookie("blogatron_url", "{$c_url}", time() + 3600 * 24 * 365, "/"); } if ($_POST['bakecookie'] == 'off') { setcookie("blogatron_author", "", time() - 3600 * 24, "/"); setcookie("blogatron_email", "", time() - 3600 * 24, "/"); setcookie("blogatron_url", "", time() - 3600 * 24, "/"); } $c_text = strip_tags($c_text, '<a><b><em><q><del>'); $c_author = format_comment($c_author); $c_email = format_email($c_email); $c_url = format_url($c_url); $date = time() + $offset * 3600; $sql = "\n\t\t\tINSERT INTO comments set \n\t\t\tc_author = ('{$c_author}'),\n\t\t\tc_text = ('{$c_text}'),\n\t\t\tc_email = ('{$c_email}'),\n\t\t\tc_url = ('{$c_url}'),\n\t\t\tc_ip = ('{$c_ip}'),\n\t\t\tdate = ('{$date}'),\n\t\t\teid = ('{$eid}')"; if (!($result = @mysql_query($sql))) { print "<p>Der skete en fejl: " . mysql_error() . "</p>"; print "<p>{$sql}</p>"; } header("Location: {$comment_url}#c"); } } else { print_header(". {$blog_title} | kukabuxilah .", "stil.css", $domain_name, $description, $key_words, $dc_title, $install_path); ?> <div id="container"> <div id="top"> <div id="banner2"> <div style="float: right"></div>
if( $row["remote"] ){ $link = url_merge(str_replace(FTP_ROOT,FTP_SITE,$row['name'])); $name = str_replace(FTP_ROOT,'',$row['name']); }else{ $link = (VI_BASE.$row['name']); $name = $row['name']; } */ if ($row["remote"]) { $link = url_merge(str_replace(FTP_ROOT, FTP_SITE, $row['name'])); $name = str_replace(FTP_ROOT, '', $row['name']); } else { $name = $link = $row['name']; } echo "<tr class='" . zebra($i, array("line", "band")) . "'>"; echo "<td><input name='id' type='checkbox' class='checkbox' id='id' value='" . $row['id'] . "'></td>"; echo '<td title="' . $row['name'] . '" id="file-' . $row['id'] . '"><var data-type="type" data-link="?s=type&q=' . $row["type"] . '">' . $row["type"] . '</var><a id="url-' . $row['id'] . '" href="' . $link . '" target="_blank">' . format_url($row['name'], 40) . '</a></td>'; echo "<td><a href='?s=account&q=" . urlencode($row['account']) . "'>" . $row['account'] . "</a></td>"; echo "<td>" . $row["input"] . "</td>"; echo "<td>" . sizecount($row["size"]) . "</td>"; echo "<td><a href='?r=" . $row["remote"] . "'>" . $_G['project']['attach'][$row["remote"]] . "</a></td>"; echo "<td>" . ($row["width"] ? $row["width"] . "*" . $row["height"] : "") . "</td>"; echo "<td>" . date("Y-m-d H:i:s", $row['dateline']) . "</td>"; echo '<td><button type="button" class="normal" data-url="?action=delete&list=' . $row["id"] . '">删除</button></td>'; } echo ' <tr class="tfoot"> <td colspan="9"><a href="javascript:$(\'list\').value = setAll(\'#table tbody tr input\',true); void(0);">全选</a> / <a href="javascript:$(\'list\').value = setAll(\'#table tbody tr input\',false); void(0);">全不选</a> / <a href="javascript:$(\'list\').value = setAll(\'#table tbody tr input\',\'anti\'); void(0);">反选</a> - <a href="javascript:if(confirm(\'确定要删除所选吗?\')){post-form(\'post-form\',\'delete\');}void(0);">删除所选</a></td> </tr> </table> ';
function account_user($uname) { global $user, $theme; function module($name, $module, $username) { global $theme; if ($module["user"] && ($block = $module["user"]($username, "user", "view"))) { if ($block["content"]) { $theme->box($block["subject"], $block["content"]); } } } if ($user->id && $user->userid == $uname) { $output .= "<TABLE BORDER=\"0\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n"; $output .= " <TR><TD ALIGN=\"right\"><B>" . t("Username") . ":</B></TD><TD>{$user->userid}</TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\"><B>" . t("E-mail") . ":</B></TD><TD>" . format_email($user->fake_email) . "</A></TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\"><B>" . t("Homepage") . ":</B></TD><TD>" . format_url($user->url) . "</TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\" VALIGN=\"top\"><B>" . t("Bio") . ":</B></TD><TD>" . check_output($user->bio) . "</TD></TR>\n"; $output .= " <TR><TD ALIGN=\"right\" VALIGN=\"top\"><B>" . t("Signature") . ":</B></TD><TD>" . check_output($user->signature) . "</TD></TR>\n"; $output .= "</TABLE>\n"; // Display account information: $theme->header(); $theme->box(t("Personal information"), $output); $theme->footer(); } elseif ($uname && ($account = account_get_user($uname))) { $block1 .= "<TABLE BORDER=\"0\" CELLPADDING=\"1\" CELLSPACING=\"1\">\n"; $block1 .= " <TR><TD ALIGN=\"right\"><B>" . t("Username") . ":</B></TD><TD>{$account->userid}</TD></TR>\n"; $block1 .= " <TR><TD ALIGN=\"right\"><B>" . t("E-mail") . ":</B></TD><TD>" . format_email($account->fake_email) . "</TD></TR>\n"; $block1 .= " <TR><TD ALIGN=\"right\"><B>" . t("Homepage") . ":</B></TD><TD>" . format_url($account->url) . "</TD></TR>\n"; $block1 .= " <TR><TD ALIGN=\"right\"><B>" . t("Bio") . ":</B></TD><TD>" . check_output($account->bio) . "</TD></TR>\n"; $block1 .= "</TABLE>\n"; $result = db_query("SELECT c.cid, c.pid, c.lid, c.subject, c.timestamp, s.subject AS story FROM comments c LEFT JOIN users u ON u.id = c.author LEFT JOIN stories s ON s.id = c.lid WHERE u.userid = '{$uname}' AND s.status = 2 AND c.link = 'story' AND s.timestamp > " . (time() - 1209600) . " ORDER BY cid DESC LIMIT 10"); while ($comment = db_fetch_object($result)) { $block2 .= "<TABLE BORDER=\"0\" CELLPADDING=\"1\" CELLSPACING=\"1\">\n"; $block2 .= " <TR><TD ALIGN=\"right\"><B>" . t("Comment") . ":</B></TD><TD><A HREF=\"story.php?id={$comment->lid}&cid={$comment->cid}&pid={$comment->pid}#{$comment->cid}\">" . check_output($comment->subject) . "</A></TD></TR>\n"; $block2 .= " <TR><TD ALIGN=\"right\"><B>" . t("Date") . ":</B></TD><TD>" . format_date($comment->timestamp) . "</TD></TR>\n"; $block2 .= " <TR><TD ALIGN=\"right\"><B>" . t("Story") . ":</B></TD><TD><A HREF=\"story.php?id={$comment->lid}\">" . check_output($comment->story) . "</A></TD></TR>\n"; $block2 .= "</TABLE>\n"; $block2 .= "<P>\n"; $comments++; } // Display account information: $theme->header(); if ($block1) { $theme->box(strtr(t("%a's user information"), array("%a" => $uname)), $block1); } if ($block2) { $theme->box(strtr(t("%a has posted %b recently"), array("%a" => $uname, "%b" => format_plural($comments, "comment", "comments"))), $block2); } module_iterate("module", $uname); $theme->footer(); } else { // Display login form: $theme->header(); $theme->box(t("Create user account"), account_create()); $theme->box(t("E-mail new password"), account_email()); $theme->footer(); } }
/** * Creates a file containing an html redirection to a given url * * @author Hugues Peeters <*****@*****.**> * @param string $filePath * @param string $url * @return void */ function create_link_file($filePath, $url) { $fileContent = '<html>' . '<head>' . '<meta http-equiv="content-Type" content="text/html;charset=' . get_locale('charset') . '">' . '<meta http-equiv="refresh" content="0;url=' . format_url($url) . '">' . '</head>' . '<body>' . '<div align="center">' . '<a href="' . format_url($url) . '">' . $url . '</a>' . '</div>' . '</body>' . '</html>'; create_file($filePath, $fileContent); }
function CreateTopic($xanonpost, $subject, $comment, $pid, $pollID, $host_name, $mode, $order, $thold, $posttype) { global $user, $userinfo, $EditedMessage, $cookie, $prefix, $pollcomm, $anonpost, $db, $module_name; $author = FixQuotes($author); $subject = FixQuotes(filter_text($subject, "nohtml")); $comment = format_url($comment); if ($posttype == "exttrans") { $comment = FixQuotes(nl2br(htmlspecialchars(check_words($comment)))); } elseif ($posttype == "plaintext") { $comment = FixQuotes(nl2br(filter_text($comment))); } else { $comment = FixQuotes(filter_text($comment)); } if (is_user($user)) { getusrinfo($user); } if (is_user($user) && !$xanonpost) { getusrinfo($user); $name = $userinfo[username]; $email = $userinfo[femail]; $url = $userinfo[user_website]; $score = 1; } else { $name = ""; $email = ""; $url = ""; $score = 0; } $ip = $_SERVER["REMOTE_HOST"]; if (empty($ip)) { $ip = $_SERVER["REMOTE_ADDR"]; } $pollID = intval($pollID); $result = $db->sql_query("select count(*) from " . $prefix . "_poll_desc where pollID='{$pollID}'"); $fake = $db->sql_numrows($result); if ($fake == 1) { if ($anonpost == 0 and is_user($user) or $anonpost == 1) { $db->sql_query("insert into " . $prefix . "_pollcomments values (NULL, '{$pid}', '{$pollID}', now(), '{$name}', '{$email}', '{$url}', '{$ip}', '{$subject}', '{$comment}', '{$score}', '0')"); update_points(9); } else { echo "Nice try..."; die; } } else { include "header.php"; echo "According to my records, the topic you are trying " . "to reply to does not exist. If you're just trying to be " . "annoying, well then too bad."; include "footer.php"; die; } if ($pollcomm == 1) { if (isset($cookie[4])) { $options .= "&mode={$cookie['4']}"; } else { $options .= "&mode=thread"; } if (isset($cookie[5])) { $options .= "&order={$cookie['5']}"; } else { $options .= "&order=0"; } if (isset($cookie[6])) { $options .= "&thold={$cookie['6']}"; } else { $options .= "&thold=0"; } } else { $options = ""; } Header("Location: modules.php?name={$module_name}&op=results&pollID={$pollID}{$options}"); }
/** * function update_video_status_from_vms * 视频状态改变接口 * @param array $get 视频信息 */ public function update_video_status_from_vms() { if (is_array($_GET) && !empty($_GET)) { $size = $_GET['size']; $timelen = intval($_GET['timelen']); $status = intval($_GET['ku6status']); $vid = $_GET['vid']; $picpath = format_url($_GET['picpath']); //验证数据 /* 验证vid */ if (!$vid) { return json_encode(array('status' => '101', 'msg' => 'vid not allowed to be empty')); } /* 验证视频大小 */ if ($size < 100) { return json_encode(array('status' => '103', 'msg' => 'size incorrect')); } /* 验证视频时长 */ if ($timelen < 1) { return json_encode(array('status' => '104', 'msg' => 'timelen incorrect')); } $db = pc_base::load_model('video_store_model'); $r = $db->get_one(array('vid' => $vid)); if ($r) { $db->update(array('size' => $size, 'picpath' => $picpath, 'status' => $status), array('vid' => $vid)); if ($status == 21) { $r = $video_store_db->get_one(array('vid' => $vid), 'videoid'); //取出videoid,以便下面操作 $videoid = $r['videoid']; /** * 加载视频内容对应关系数据模型,检索与删除视频相关的内容。 * 在对应关系表中找出对应的内容id,并更新内容的静态页 */ $video_content_db = pc_base::load_model('video_content_model'); $result = $video_content_db->select(array('videoid' => $videoid)); if (is_array($result) && !empty($result)) { //加载更新html类 $html = pc_base::load_app_class('html', 'content'); $content_db = pc_base::load_model('content_model'); $url = pc_base::load_app_class('url', 'content'); foreach ($result as $rs) { $modelid = intval($rs['modelid']); $contentid = intval($rs['contentid']); $content_db->set_model($modelid); $content_db->update(array('status' => 99), array('id' => $contentid)); $table_name = $content_db->table_name; $r1 = $content_db->get_one(array('id' => $contentid)); /** * 判断如果内容页生成了静态页,则更新静态页 */ if (ishtml($r1['catid'])) { $content_db->table_name = $table_name . '_data'; $r2 = $content_db->get_one(array('id' => $contentid)); $r = array_merge($r1, $r2); unset($r1, $r2); if ($r['upgrade']) { $urls[1] = $r['url']; } else { $urls = $url->show($r['id'], '', $r['catid'], $r['inputtime']); } $html->show($urls[1], $r, 0, 'edit'); } else { continue; } } } } elseif ($data['status'] < 0 || $data['status'] == 24) { $r = $video_store_db->get_one(array('vid' => $vid), 'videoid'); //取出videoid,以便下面操作 $videoid = $r['videoid']; //$video_store_db->delete(array('vid'=>$vid)); //删除此视频 /** * 加载视频内容对应关系数据模型,检索与删除视频相关的内容。 * 在对应关系表中解除关系,并更新内容的静态页 */ $video_content_db = pc_base::load_model('video_content_model'); $result = $video_content_db->select(array('videoid' => $videoid)); if (is_array($result) && !empty($result)) { //加载更新html类 $html = pc_base::load_app_class('html', 'content'); $content_db = pc_base::load_model('content_model'); $url = pc_base::load_app_class('url', 'content'); foreach ($result as $rs) { $modelid = intval($rs['modelid']); $contentid = intval($rs['contentid']); $video_content_db->delete(array('videoid' => $videoid, 'contentid' => $contentid, 'modelid' => $modelid)); $content_db->set_model($modelid); $table_name = $content_db->table_name; $r1 = $content_db->get_one(array('id' => $contentid)); /** * 判断如果内容页生成了静态页,则更新静态页 */ if (ishtml($r1['catid'])) { $content_db->table_name = $table_name . '_data'; $r2 = $content_db->get_one(array('id' => $contentid)); $r = array_merge($rs, $r2); unset($r1, $r2); if ($r['upgrade']) { $urls[1] = $r['url']; } else { $urls = $url->show($r['id'], '', $r['catid'], $r['inputtime']); } $html->show($urls[1], $r, 0, 'edit'); } else { continue; } } } } return json_encode(array('status' => '200', 'msg' => 'Success')); } else { return json_encode(array('status' => '107', 'msg' => 'Data is empty!')); } } json_encode(array('status' => '107', 'msg' => 'Data is empty!')); }
function pick_match_rules() { $url = format_url($_GET['url']); d_s(); $content = get_contents($url); $v = match_rules($url, $content, 2, 0); if (!$v || !is_array($v)) { $v = pick_match_coloud_rules($url); if ($v['data_type'] == 1) { pload('F:rules'); $v = $v['data']; rules_add($v); del_search_index(2); } } if (!$v || !is_array($v)) { return 'no'; } $re_arr = array($v['rules_type'], $v['rules_hash']); return json_encode($re_arr); }
<form name="myform" action="?m=special&c=album&a=import" method="post"> <table width="100%" cellspacing="0" class="table-list nHover"> <thead> <tr> <th width="33%"> </th><th width="33%"> </th><th width="33%"> </th> </tr> </thead> <tbody> <?php if(is_array($infos)){ $n = 0; foreach($infos as $info){ $n++; ?> <?php if($n%3==1){?><tr><?php }?> <td><div class="col-left mr10" style="width:146px; height:112px"><img src="<?php echo format_url($info['video']['picPath'])?>" width="146" height="112" style="border:1px solid #eee" align="left" title="<?php echo $info['video']['title'];?>"></div> <div class="col-auto"> <h2 class="title-1 f14 lh28 mb6 blue" title="<?php echo $info['video']['title'];?>"><?php echo str_cut($info['video']['title'], 26)?></h2> <div class="lh22"><?php echo $info['video']['desc']?></div> <p class="gray4">上传时间:<?php echo format::date(substr(trim($info['video']['uploadTime']), 0, 10), 1)?></p> <p class="gray4">播放次数:<?php echo $info['video']['videoTime']?></p> </div> </td> <?php if($n%3==0){?></tr><?php }?> <?php } } ?> </tbody> </table>
function CreateTopic($xanonpost, $subject, $comment, $pid, $sid, $host_name, $mode, $order, $thold) { global $module_name, $user, $userinfo, $EditedMessage, $cookie, $AllowableHTML, $ultramode, $user_prefix, $prefix, $anonpost, $articlecomm, $db, $sitename; cookiedecode($user); getusrinfo($user); $sid = intval($sid); $pid = intval($pid); $author = filter($author, "nohtml", 1); $subject = filter($subject, "nohtml", 1); $comment = format_url($comment); $comment = filter($comment, "", 1); if (empty($subject) or empty($comment)) { include "header.php"; title("{$sitename} - " . _COMMENTSSYSTEM . ""); OpenTable(); echo "<center>" . _COMMENTPOSTERROR . "<br><br>" . _GOBACK . "</center>"; CloseTable(); include "footer.php"; fdie(); } //$comment = filter($comment); if (is_user($user) and !$xanonpost) { $name = $userinfo['username']; $email = $userinfo['femail']; $url = $userinfo['user_website']; $score = 1; } else { $name = ""; $email = ""; $url = ""; $score = 0; } if (!isset($ip)) { $ip = $_SERVER['REMOTE_ADDR']; } $fake = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_stories WHERE sid='{$sid}'")); $comment = trim($comment); $comment = filter($comment, "", 1); if ($fake == 1 and $articlecomm == 1) { if ($anonpost == 0 and is_user($user) or $anonpost == 1) { if (is_user($user)) { $krow = $db->sql_fetchrow($db->sql_query("SELECT karma FROM " . $user_prefix . "_users WHERE username='******'")); $koptions = ""; $koptions .= "&mode=" . $mode; $koptions .= "&order=" . $order; $koptions .= "&thold=" . $thold; if ($krow['karma'] == 2) { $db->sql_query("INSERT INTO " . $prefix . "_comments_moderated VALUES (NULL, '{$pid}', '{$sid}', now(), '{$name}', '{$email}', '{$url}', '{$ip}', '{$subject}', '{$comment}', '{$score}', '0', '0')"); include "header.php"; title(_MODERATEDTITLE); OpenTable(); echo "<center>" . _COMMENTMODERATED . ""; echo "<br><br><a href=\"modules.php?name={$module_name}&file=article&sid={$sid}{$koptions}\">" . _MODERATEDRETURN . "</a>"; CloseTable(); include "footer.php"; fdie(); } elseif ($krow['karma'] == 3) { Header("Location: modules.php?name={$module_name}&file=article&sid={$sid}{$koptions}"); fdie(); } } $db->sql_query("INSERT INTO " . $prefix . "_comments VALUES (NULL, '{$pid}', '{$sid}', now(), '{$name}', '{$email}', '{$url}', '{$ip}', '{$subject}', '{$comment}', '{$score}', '0', '0')"); $db->sql_query("UPDATE " . $prefix . "_stories SET comments=comments+1 WHERE sid='{$sid}'"); update_points(5); if ($ultramode) { ultramode(); } } else { die("Nice try.."); } } else { include "header.php"; echo "According to my records, the topic you are trying " . "to reply to does not exist. If you're just trying to be " . "annoying, well then too bad."; include "footer.php"; fdie(); } $options = ""; $options .= "&mode=" . $mode; $options .= "&order=" . $order; $options .= "&thold=" . $thold; Header("Location: modules.php?name={$module_name}&file=article&sid={$sid}{$options}"); }