给AVS添加描述(how to add a description to a video)
2015-10-20 20:36
363 查看
UPDATE
you might need edit few files.
1. add the input field to the tpl file: /templates/frontend/yourcolor/upload_video.tpl
name the field as description
<div class="separator">
<label for="description">Description:</label>
<textarea name="description" id="upload_video_description">{$video.description} </textarea><br />
<span class="expl">Description of video required.</span><br />
<span id="video_tags_error" class="error" style="display: none;">{t c='upload.video_description_empty'}</span>
</div>
2. edit : modules/upload/video.php
below this : $anonymous = $filter->get('video_anonymous');
add: $description = $filter->get('description');
below this: channel = " .$category. ", keyword = '" .mysql_real_escape_string($keywords). "',
add: description = '".mysql_real_escape_string($description)."',
3. edit video.php
find: $sql = "SELECT v.VID, v.UID, v.title, v.channel, v.keyword, v.viewnumber, v.type,
replace with: $sql = "SELECT v.VID, v.UID, v.title, v.channel, v.keyword, v.viewnumber, v.type, v.description,
4. edit: /templates/frontend/yourcolor/video.tpl
find:
<div class="video_addtime">
{insert name=time_range assign=addtime time=$video.addtime}
{$addtime}
</div>
below that add:
<div>
Description: {$video.description}
</div>
step 5
edit:
templates/backend/default/videos_edit.tpl
below
<label for="keyword">Keywords (tags): </label>
<textarea name="keyword">{$video[0].keyword}</textarea><br>
add:
<label for="description">Description: </label>
<textarea name="description">{$video[0].description}</textarea><br>
step 6
edit
siteadmin/modules/videos/edit.php
below:
$keyword = trim($_POST['keyword']);
add:
$description = trim($_POST['description']);
- next -
below:
elseif ( strlen($keyword) < 3 )
$errors[] = 'Video keyword(tags) field cannot be blank!';
add:
elseif ( strlen($description) < 3 )
$errors[] = 'Video Description field cannot be blank!';
- next -
AFTER:
keyword = '" .mysql_real_escape_string($keyword). "',
ADD:
description = '" .mysql_real_escape_string($description). "',
step 7
edit
templates/frontend/your color/edit.tpl
find:
<div class="separator">
<label for="upload_video_keywords">{t c='global.tags'}:</label>
<textarea name="keyword" id="upload_video_keywords">{$video.keyword}</textarea><br />
<span class="expl">{t c='upload.tags_expl'}</span><br />
<span id="video_tags_error" class="error" style="display: none;">{t c='upload.video_tags_empty'}</span>
</div>
add below:
<div class="separator">
<label for="description">Description:</label>
<textarea name="description" id="upload_video_description">{$video.description } </textarea><br />
<span class="expl">Description of video required.</span><br />
<span id="video_tags_error" class="error" style="display: none;">{t c='upload.video_description_empty'}</span>
</div>
step 8
edit
public html/edit.php
find
$thumb = $filter->get('thumb', 'INTEGER');
add below
$description = $filter->get('description');
find
if ( $keyword == '' ) {
$errors[] = $lang['upload.video_tags_empty'];
} else {
$keyword = prepare_string($keyword, false);
}
add below
if ( $description == '' ) {
$errors[] = $lang['upload.video_description_empty'];
}
find
keyword = '".mysql_real_escape_string($keyword)."',
add below
description = '".mysql_real_escape_string($description)."'
step 9
edit
public_html/language/en_US.lang.php
find
$lang['upload.video_file_empty'] = 'Please selected a video file!';
add after
$lang['upload.video_description_empty'] = 'Please enter a video description!';
THIS LAST STEP WITH THE LANGUAGE NEEDS TO BE DONE WITH ALL THE LANGUAGES YOU WILL BE USING
thats all, i'm not including any css part so you might have to adjust the position of the css layout your self. You can do this also for games, by default the game table inside the database dont have description field, you might try to add it your self.
Hope that help, good luck.
This needs to be done in the file 2 times.
Quote
4. edit: /templates/frontend/yourcolor/video.tpl
find:
<div class="video_addtime">
{insert name=time_range assign=addtime time=$video.addtime}
{$addtime}
</div>
below that add:
<div>
Description: {$video.description}
</div>
you might need edit few files.
1. add the input field to the tpl file: /templates/frontend/yourcolor/upload_video.tpl
name the field as description
<div class="separator">
<label for="description">Description:</label>
<textarea name="description" id="upload_video_description">{$video.description} </textarea><br />
<span class="expl">Description of video required.</span><br />
<span id="video_tags_error" class="error" style="display: none;">{t c='upload.video_description_empty'}</span>
</div>
2. edit : modules/upload/video.php
below this : $anonymous = $filter->get('video_anonymous');
add: $description = $filter->get('description');
below this: channel = " .$category. ", keyword = '" .mysql_real_escape_string($keywords). "',
add: description = '".mysql_real_escape_string($description)."',
3. edit video.php
find: $sql = "SELECT v.VID, v.UID, v.title, v.channel, v.keyword, v.viewnumber, v.type,
replace with: $sql = "SELECT v.VID, v.UID, v.title, v.channel, v.keyword, v.viewnumber, v.type, v.description,
4. edit: /templates/frontend/yourcolor/video.tpl
find:
<div class="video_addtime">
{insert name=time_range assign=addtime time=$video.addtime}
{$addtime}
</div>
below that add:
<div>
Description: {$video.description}
</div>
step 5
edit:
templates/backend/default/videos_edit.tpl
below
<label for="keyword">Keywords (tags): </label>
<textarea name="keyword">{$video[0].keyword}</textarea><br>
add:
<label for="description">Description: </label>
<textarea name="description">{$video[0].description}</textarea><br>
step 6
edit
siteadmin/modules/videos/edit.php
below:
$keyword = trim($_POST['keyword']);
add:
$description = trim($_POST['description']);
- next -
below:
elseif ( strlen($keyword) < 3 )
$errors[] = 'Video keyword(tags) field cannot be blank!';
add:
elseif ( strlen($description) < 3 )
$errors[] = 'Video Description field cannot be blank!';
- next -
AFTER:
keyword = '" .mysql_real_escape_string($keyword). "',
ADD:
description = '" .mysql_real_escape_string($description). "',
step 7
edit
templates/frontend/your color/edit.tpl
find:
<div class="separator">
<label for="upload_video_keywords">{t c='global.tags'}:</label>
<textarea name="keyword" id="upload_video_keywords">{$video.keyword}</textarea><br />
<span class="expl">{t c='upload.tags_expl'}</span><br />
<span id="video_tags_error" class="error" style="display: none;">{t c='upload.video_tags_empty'}</span>
</div>
add below:
<div class="separator">
<label for="description">Description:</label>
<textarea name="description" id="upload_video_description">{$video.description } </textarea><br />
<span class="expl">Description of video required.</span><br />
<span id="video_tags_error" class="error" style="display: none;">{t c='upload.video_description_empty'}</span>
</div>
step 8
edit
public html/edit.php
find
$thumb = $filter->get('thumb', 'INTEGER');
add below
$description = $filter->get('description');
find
if ( $keyword == '' ) {
$errors[] = $lang['upload.video_tags_empty'];
} else {
$keyword = prepare_string($keyword, false);
}
add below
if ( $description == '' ) {
$errors[] = $lang['upload.video_description_empty'];
}
find
keyword = '".mysql_real_escape_string($keyword)."',
add below
description = '".mysql_real_escape_string($description)."'
step 9
edit
public_html/language/en_US.lang.php
find
$lang['upload.video_file_empty'] = 'Please selected a video file!';
add after
$lang['upload.video_description_empty'] = 'Please enter a video description!';
THIS LAST STEP WITH THE LANGUAGE NEEDS TO BE DONE WITH ALL THE LANGUAGES YOU WILL BE USING
thats all, i'm not including any css part so you might have to adjust the position of the css layout your self. You can do this also for games, by default the game table inside the database dont have description field, you might try to add it your self.
Hope that help, good luck.
This needs to be done in the file 2 times.
Quote
4. edit: /templates/frontend/yourcolor/video.tpl
find:
<div class="video_addtime">
{insert name=time_range assign=addtime time=$video.addtime}
{$addtime}
</div>
below that add:
<div>
Description: {$video.description}
</div>
相关文章推荐
- 剑指Offer--复杂链表的复制
- Extjs之RowNumberer
- Java中自定义有序不重复的集合——SetList
- UILabel高度自适应
- 用同一台PC的两个网口实现Iperf的server端和client端
- SQL Server 2008等登录用户只能看到自己的数据库设置办法
- 冒泡排序
- 简单利用HUDText插件实现血条和怪物伤害减血效果
- 代码审查时,发现功能实现的原因,而不仅仅是挑毛病(转)
- (原创)c#学习笔记04--流程控制01--布尔逻辑03--运算符优先级
- Android中分类的ListView实现
- 如何在Mac电脑上安装汉化破解版的DreamWearver CC
- 初探oVirt-使用cloud-init
- VirtualBox或VM Ware只能安装32位系统的解决办法
- linux c ping 实现
- JS事件
- 第六周项目二 建立链栈算法库
- CentOS 6.3 32位静默安装Oracle 11g r2详细教程
- hibernate.cfg.xml配置文件和hbm.xml配置文件
- Servlet学习笔记--生成网站表单验证码