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


PHP format_url函数代码示例

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


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

示例1: crawl

 /**
  * 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;
 }
开发者ID:ralphsaunders,项目名称:payload,代码行数:52,代码来源:posts_model.php

示例2: get_field

    $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">
开发者ID:philiprey,项目名称:ac,代码行数:31,代码来源:content-single-product.php

示例3: format_text

 $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&amp;" . 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&amp;" . URL_USER_ID . "=" . $comment_user_id);
         }
开发者ID:abhinay100,项目名称:fourimages_app,代码行数:31,代码来源:details.php

示例4: L

            <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>
开发者ID:panhongsheng,项目名称:zl_cms,代码行数:31,代码来源:album_list.tpl.php

示例5: json_encode

    $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']) {
开发者ID:baowzh,项目名称:renfang,代码行数:31,代码来源:add_video.php

示例6: json_encode

    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;
开发者ID:ahmatjan,项目名称:huluphp,代码行数:31,代码来源:add_album_video.php

示例7: doimport

 /**
  * 执行视频导入 
  */
 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'];
//.........这里部分代码省略.........
开发者ID:boylzj,项目名称:omguitar,代码行数:101,代码来源:import.php

示例8: importfalbum

 /**
  * 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;
     }
 }
开发者ID:ahmatjan,项目名称:huluphp,代码行数:35,代码来源:special_api.class.php

示例9: get_pick_info

     $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']);
             }
开发者ID:edmundwong,项目名称:V604,代码行数:31,代码来源:picker_manage.inc.php

示例10: create_variable

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;
}
开发者ID:edmundwong,项目名称:V604,代码行数:51,代码来源:function.rules.php

示例11: array

    }
}
$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';
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:upload.php

示例12: getRichInfo

 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;
 }
开发者ID:Germey,项目名称:SimpleCMS,代码行数:66,代码来源:ContentModel.class.php

示例13: fileManageDisplayFile

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";
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:migueloo,代码行数:101,代码来源:fileManageLib.inc.php

示例14: CreateTopic

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}");
}
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:71,代码来源:comments.php

示例15: helpHtmlLink

 public function helpHtmlLink($options)
 {
     echo "<a href='" . $options["module"] . "/" . format_url($options["seotext"]) . "-" . $options["id"] . "'>" . $options["text"] . "</a>";
 }
开发者ID:weyoz,项目名称:partiel-dev,代码行数:4,代码来源:CoreView.php


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