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


PHP News::getUploadURL方法代码示例

本文整理汇总了PHP中News::getUploadURL方法的典型用法代码示例。如果您正苦于以下问题:PHP News::getUploadURL方法的具体用法?PHP News::getUploadURL怎么用?PHP News::getUploadURL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在News的用法示例。


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

示例1: getSingleBlockByType

function getSingleBlockByType($module)
{
    $objType = new NewsType();
    $cat_data = $objType->getByModuleName($module);
    //var_dump($cat_datas);
    //$cat_data='';
    $id = $cat_data['news01uin'];
    $objNews = new News();
    $prefix = $objNews->getPrefix();
    //'news02';
    $data = $objNews->getByType($id, 1, 5);
    $uploadUrl = UPLOADS . $objNews->getUploadURL() . 'thumb/';
    //var_dump($data);
    ?>
                <div class="col-md-4">
					<div class="internal-news">
						<h2>
                            <a href="<?php 
    echo getSiteLink('News', '', '', $cat_data['news01' . 'uin'], $cat_data['news01' . 'title']);
    ?>
"><?php 
    echo $cat_data['news01' . 'title'];
    ?>
</a>
                        
                        </h2>
					</div>
					<div class="news-blog">
						
						<div class="media">
                            <?php 
    $list = '';
    $list2 = '';
    ?>
                            <?php 
    $ct = 0;
    foreach ($data as $row) {
        ?>
                                <?php 
        if ($ct < 1) {
            ?>
                                    <h3>
                                        <a href="<?php 
            echo getSiteLink('News', '', '', $cat_data['news01' . 'uin'], $cat_data['news01' . 'title']);
            ?>
">
                                        <?php 
            echo $row['news02title'];
            ?>
                                        </a>
                                    </h3>
        							<div class="media-left"> 
                                    <?php 
            echo LoadMyImage($uploadUrl, $row[$prefix . 'file'], $row[$prefix . 'title']);
            ?>
                                     
                                    </div>
        							<div class="media-body"> <a href="#"></a>
        								<p>
                                            <?php 
            echo clipMyText($row[$prefix . 'detail'], 200);
            ?>
                                        </p>
        							</div>
                                <?php 
        } else {
            $list2 .= '<li><a href="' . getSiteLink('NewsArticle', '', $row[$objNews->getPrefix() . 'title'], $row[$objNews->getPrefix() . 'uin']) . '">' . $row['news02title'] . '</a></li>';
        }
        ?>
                            <?php 
        $ct++;
    }
    ?>
							<div class="news-item-blog">
								<ul>
								    <?php 
    echo $list2;
    ?>
									
                                </ul>
							</div>
						</div>
					</div>
				</div>             
<?php 
}
开发者ID:arunrajthala,项目名称:leapers,代码行数:86,代码来源:block_controller.php

示例2: NOW

$per = $_GET['per'];
$where = '';
if ($_GET['where'] != '') {
    if ($_GET['where'] == 'POPULAR') {
        $where = $prefix . 'hits>0 and ' . $prefix . 'date between  DATE_ADD(NOW(), INTERVAL -30 DAY) AND NOW()';
        $order = $prefix . 'hits desc';
    } else {
        $where = $prefix . $_GET['where'];
    }
}
//echo $where;die();
//echo $page;
$objNews = new News();
$_data = $objNews->get($where, $order, $per, $page);
//var_dump($_data);die();
$uploadUrl = UPLOADS . $objNews->getUploadURL() . 'thumb/';
foreach ($_data as $row) {
    ?>
<div class="news-items  clearfix">
    <?php 
    echo LoadMyImage($uploadUrl, $row[$prefix . 'file'], $row[$prefix . 'title'], 'img-responsive');
    ?>
     
    <div class="shadow">
      <h5><a href="<?php 
    echo getSiteLink('NewsArticle', '', $row[$prefix . 'title'], $row[$prefix . 'uin']);
    ?>
">
        <?php 
    echo $row[$prefix . 'title'];
    ?>
开发者ID:arunrajthala,项目名称:leapers,代码行数:31,代码来源:NewsList.php

示例3:

$newsType = $objCat->getById($Type);
$data['module_Title'] = $newsType['news01title'];
if (isset($_GET['_Id'])) {
    $id = $_GET['_Id'];
    $data['_data'] = $obj->getByID($id);
} else {
    $data['_data'] = $obj->get(array('news01uin' => $Type));
    $data['list_fields'] = $obj->getListField();
}
//$data['_extraModule'] = array(array('Commitments', 'Commit&action=Commitlist'));
$data['prefix'] = $obj->getPrefix();
$field_list = $obj->getUpdateFields();
$_data = $obj->getByID($id);
//$data['obj']=$obj;
$data['lists'] = $obj->getListField();
$upload_dir = UPLOADS_DIR . $obj->getUploadURL();
$data['upload_dir'] = $upload_dir;
$data['uploadUrl'] = '../uploads/' . $obj->getUploadURL();
/***************** END of these fields are required ************************************/
/**
 *  $fields_post :: This list is the list of all fields which are affected while inserting in database 
 **/
/**
 *  $fields_edit :: This list is the list of all fields which are affected while updating database 
 **/
/**
 *  generalprocess :: This will handle CRUD model
 **/
include_once ADMIN_TPL_MODULE . 'includes/generalprocess_v3.php';
/**
 *  other Process :: You can add code here for further Special  processing
开发者ID:arunrajthala,项目名称:leapers,代码行数:31,代码来源:News.php


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