AdultsVideoPress
  • Home
  • Features
  • Demo
  • Download
  • Contact Us
  • Developers

Blog

Include Pages

Posted by admin on November 1, 2011 in Developers Doc, Themes

Themes : _includes/

_includes/ contains template pages that are meant to be included

- _includes/404.html

show 404 message when page is not available

- _includes/captcha.html

The captcha page

- _includes/error.html

Show errors in the page

- _includes/success.html

Show success in the page

- _includes/google-analytics.html

Show the google analytics code on the site if it was set in the admin

Read More
No Comments

Other Pages

Posted by admin on November 1, 2011 in Developers Doc, Themes

Themes Other Pages

Beside the five main pages: home, videos, watch, channels and contact; AVP contains other pages

for contact, terms of service etc…

- maintenance.html

A page that show the maintenance page.
Whenever the site is not online, a maintenance page will be displayed

- privacy.html

The privacy page

- terms.html

The terms of service page

Read More
No Comments

Edit Channels Page

Posted by admin on November 1, 2011 in Developers Doc, Themes

Themes: channels.html

The Channel page is a simple page that displays all your active channels

- ChannelsIterators

ChannelsIterator is a each statement that holds data for each channel, to access
the channels, use the Simplate each statement <spl-each>

- Variables

{@Channel} : The channel name
{@Url} : The video search url
{@ChannelEncoded} : The url encoded channel name. To use with url
{@ClsSelected} : return “selected” if the channel name is in the url. Use to select a channel

- Example

<ul>
<spl-each ChannelsIterator >
<li><a href=”{@Url}” title=”Views videos in Channel {@Channel}”>{@Channel}</a></li>
</spl-each>
</ul>

Read More
No Comments

Edit Contact Page

Posted by admin on November 1, 2011 in Developers Doc, Themes

Themes contact.html

The contact page is form that allow visitors to submit request to the admin.

- Submit the form

To submit the form, it must have POST as method <form method=”POST”>
The “action” can stay blank so it refers to the contact page itself.  <form method=”POST”>

Must contain the following fields:

Name    : <input type=”text” name=”Name”>
Email   : <input type=”text” name=”Email”>
Subject : <input type=”text” name=”Subject”>
Content : <textarea name=”Content”></textarea>

- Captcha
To prevent being spam, we provide a captcha code to integrate with your site.
To insert it <spl-include src=”@PageCaptcha” />. This will display the captcha box.

- Post Error

When a form is submitted with error, it will return all the field back with their value
and display the error.

To show the error on the page: <spl-include src=”@PageError” />

Field errors

{@ContactName} : The contact name that was submitted
{@ContactEmail} : The email
{@ContactSubject} : The subject
{@ContactContent} : The content

- Post Success

When a post has been sent successfully, it will return a message to user saying thank you
To show that page, insert: <spl-include src=”@PageSuccess” />

- Example of a contact page

<h2>Contact Us</h2>

<spl-include src=”@PageError” />
<spl-include src=”@PageSuccess” />

<h3>Use the form below to get in touch with us</h3>

<form id=”Contact-Form” method=”POST”>

<label>Name</label><br>
<input type=”text” name=”Name” value=”{@ContactName}”>
<br><br>

<label>Email</label><br>
<input type=”text” name=”Email” value=”{@ContactEmail}”>
<br><br>

<label>Subject</label><br>
<input type=”text” name=”Subject” value=”{@ContactSubject}”>
<br><br>

<label>Message</label><br>
<textarea name=”Content”>{@ContactContent}</textarea>
<br><br>

<spl-include src=”@PageCaptcha” />

<div onclick=”$(‘#Contact-Form’).submit()”>Send Message</div>

</form>

Read More
No Comments

Edit Watch Page

Posted by admin on November 1, 2011 in Developers Doc, Themes

Themes: watch.html

The watch page displays a single video to watch

- Variables

{@Title} : Title of the video
{@Duration} : The duration
{@VideoId} : The video id
{@Thumbnail} : The main thumbnail
{@VideoThumbnail}: The video thumbnail. Will create a rotation of thumbnails
{@TotalViews} : Total views
{@TotalLikes} : Total likes
{@TotalDislikes} : Total dislikes
{@TotalShares} : Total times videos has been shared
{@TotalComments} : Total comments
{@WatchUrl} : The url to watch it on the site.
{@VideoPlayer} : The video player

- Example of a simple watch page

<h1>{@Title}</h1>

<div>
{@VideoPlayer}
</div>

- Resize the video player

By default the video player will have a set size. But it can be resize by settings some
variables in the settings.json file

In the field: Config
set VideoPlayerWidth and VideoPlayerHeight size

Config:{
VideoPlayerWidth:650,
VideoPlayerHeight:350
}

=== ADVANCED ===

- Results Error

An error can occur when no video is found, or there is a internal error in the system.

To display the error use the include error page tag:

<spl-include src=”@PageError” />

It will only be display when there is an error

- Show results only when there is no error on the page

To show results only when there is no error, we will put our results inside of a Simplate
if statement <spl-if> with the variable _Errors being null

<spl-if _Errors.null() >

[The content here]

</spl-if>

- Example of complete watch page

<!– SHOW ERRORS –>
<spl-include src=”@PageError” />

<!– NO ERRORS ON THE PAGE –>
<spl-if _Errors.null() >

<h1>{@Title}</h1>

<!– VIDEO PLACEHOLDER –>
<div>
{@VideoPlayer}
</div>

</spl-if>

Read More
No Comments

Edit Videos Page

Posted by admin on November 1, 2011 in Developers Doc, Themes

Themes: videos.html

The videos page shows a list of 20 video thumbnails per page. The videos
may be the result of a search, a tag, a channel, or show everything by default.

- VideosIterator

The video results are held in a Simplate iterator with the name “VideosIterator”. To access each video entry we will use the <spl-each> tag.

- Example

<spl-each VideosIterator >

<div>

<div>

<div>
<a href=”{@WatchUrl}” title=”{@Title}”>{@VideoThumbnail}</a>
</div>

<div><a href=”{@WatchUrl}” title=”{@Title}”>{@Title.truncate(40)}…</a></div>

</div>

<div>
{@Duration} min
</div>

</div>

</spl-each>

- Video variables for the iterator

{@Title} : Title
{@Duration} : The duration
{@VideoId} : The video id
{@Thumbnail} : The main thumbnail
{@VideoThumbnail}: The video thumbnail. Will create a rotations of thumbnails
{@TotalViews} : Total views
{@TotalLikes} : Total likes
{@TotalDislikes} : Total dislikes
{@TotalShares} : Total times videos has been shared
{@TotalComments} : Total comments
{@WatchUrl} : The url to watch it on the site.

- Other variables that is not in the iterator

{@ResultsDescription} : A description of the results.
{@SearchKeyword} : If the results came from a search, it will have the search keyword
{@TotalResults} : Total videos found

- Pagination

Pagination lets you navigate on multiple pages. A pre-formed Pagination is already created

{@TemplatePagination} : Display the pagination

=== ADVANCED ===

- Results Error

An error can occur when no video is found, or there is a internal error in the system.

To display the error use the include error page tag:

<spl-include src=”@PageError” />

It will only be display when there is an error

- Show results only when there is no error on the page

To show results only when there is no error, we will put our results inside of a Simplate
if statement <spl-if> with the variable _Errors being null

<spl-if _Errors.null() >

[The content here]

</spl-if>

- An example of a complete videos page, which makes sure there is no error,
and will iterate over VideosIterator

<!– SHOW ERRORS –>
<spl-include src=”@PageError” />

<!– NO ERRORS FOUND –>
<spl-if _Errors.null() >

<!– SHOW A DESCRIPTION –>
<div>
<h1>{@ResultsDescription.truncate(45)} <span> ({@TotalResults}) </span></h1>
</div>

<!– Loop thru VideosIterator –>
<spl-each VideosIterator >

<div>

<div>

<div>
<a href=”{@WatchUrl}” title=”{@Title}”>{@VideoThumbnail}</a>
</div>

<div><a href=”{@WatchUrl}” title=”{@Title}”>{@Title.truncate(40)}…</a></div>

</div>

<div>
{@Duration} min
</div>

</div>

</spl-each>

<div></div>

<!– PAGINATION –>
<div class=”">
{@TemplatePagination}
</div>

</spl-if>

Read More
No Comments

Edit Homepage

Posted by admin on November 1, 2011 in Developers Doc, Themes

Themes home.html

This the main home page of the AVP

It’s more like a mashup of widgets and other stuff welcoming visitors to your site

You can set the Videos Page as the home if you want to display all videos upon
coming on the site.
To do so, login to your avp-admin, go to: Advanced and select Videos Page under homepage

Read More
No Comments

Layout

Posted by admin on November 1, 2011 in Developers Doc, Themes

Themes have a basic layout: Header – Body – Footer. And these three are wrapped in Container

- Layouts Page Name

To include a layout, we use the Simplate include statemnt <spl-include>

And each layout name start with Layout:

@LayoutHeader : The header page
@LayoutBody : The body
@LayoutFooter : The footer
@PageContent    : This the content of the page being accessed. Must be included in body.html

——————————————————————————–

-
_layout/container.html

The container is the HTML Body which includes the LayoutHeader

- Example of container.html

This container will include the LayoutHeader and the LayoutBody

<HTML>

<spl-include src=”@LayoutHeader” />

<spl-include src=”@LayoutBody” />

</HTML>

——————————————————————————–

-
_layout/header.html

Contain the site’s header

<HEAD>
<meta name=”RATING” content=”RTA-5042-1996-1400-1577-RTA” />
<META NAME=”Copyright” CONTENT=”{@CurrentYear} {@SiteName}”>
<META NAME=”revisit-after” CONTENT=”1 days”>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″/>
{@PageMetaTags}

{@PageOpenGraphMetaTags}

<title>{@PageTitle} | {@SiteName} </title>

<!– REQUIRED TO MAKE AJAX CALL –>
<script>
var AVPUrlPath = “{@AVPUrlPath}”
var AVPRootDir = “{@AVPRootDir}”
</script>

<!– LOAD AVP Grid and basic css –>
<link href=”{@AssetsDir}/css/grid.css” rel=”stylesheet” type=”text/css” />
<link href=”{@AssetsDir}/css/avp.css” rel=”stylesheet” type=”text/css” />

<!– JQUERY IS REQUIRED. Request it from google –>
<script type=”text/javascript” src=”//ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js”></script>

<!– AVP JS SCRIPTS IS REQUIRED TO LOAD ALL THE AVP FUNCTIONALITIES, SUCH AS: Thumbnail preview, loading widgets, load adslots etc… –>
<script src=”http://cdn.adultsvideopress.com/avp.js.php”></script>

<!– IF A DEFAULT GET THE DEFAULT THEME CSS IF IT EXITS –>
<spl-if _ThemeIsLoaded.is(true) >
<link href=”{@ThemeCSSDir}/style.css” rel=”stylesheet” type=”text/css” />
</spl-if>

<!– IF GOOGLE ANALYTICS IS SET IN THE ADMIN, IT WILL LOAD –>
<spl-include src=”_includes/google-analytics.html” />

</HEAD>

——————————————————————————–

-
_layout/body.html

The body layout can be designed to match your preferences. When editing your own
theme this is the only layout page to edit. No need to update header.

** REQUIRED
The body page must include content so it can displayed. Otherwise you will not
have the content available but a blank page

@PageContent

- Example

<BODY>

<!– SITE CONTENT –>
<div>

<!– LIST CHANNELS –>
<div>
<spl-include src=”_includes/channels-list.html” />
</div>

<div>

<!– REQUIRED – INCLUDE THE MAIN VIEW –>
<spl-include src=”@PageContent” />

</div>

</div>

<!– INCLUDE FOOTER –>
<spl-include src=”@LayoutFooter” />

</BODY>

——————————————————————————–

-
_layout/footer.html

The footer of the site’s footer.

Please support us by adding {@APVPowered} to show a Powered by AVP link.

<!– FOOTER –>

<div>
<div id=”AVP-Footer”>

<div>
{@SiteCopyrightInfo} |
<a href=”{@AVPUrlPath}/” title=”Home”>Home</a> |
<a href=”{@AVPUrlPath}/videos/”  title=”Home”>Videos</a> |
<a href=”{@AVPUrlPath}/channels/”  title=”Home”>Channels</a> |
<a href=”{@AVPUrlPath}/contact/” rel=”nofollow” title=”Contact Us”>Contact Us</a> |
<a href=”{@AVPUrlPath}/terms/”  rel=”nofollow” title=”Terms of Service”>Terms</a> |
<a href=”{@AVPUrlPath}/privacy/”  rel=”nofollow” title=”Privacy”>Privacy</a>
</div>

<div>
{@AVPPowered}
</div>

<div></div>

<div>
<img src=”{@ImgDir}/rta.gif” >
</div>

</div>
</div>

Read More
No Comments

Global Variables

Posted by admin on November 1, 2011 in Developers Doc, Themes

Global Variables are variables that are available everywhere in your template page.

Variables use the Simplate tag format {@VariableName}

Let say we have a variable called SiteName and it has Yahoo.com as value,

Using {@SiteName} in your template, will display Yahoo.com.

- Global Variables in each iterator

When iterating over a set of data with Simplate each function <spl-each> and want
to access variable that is not in iteration but outside (out of scope variable),
you can access them by add a colon after the @. So in an each
{@:SiteName} will refer as the global one, while {@SiteName} will not return anything.

Global Variables:

{@SiteName}     : Site name
{@SiteBanner}       : Site banner. Will show the banner img if exists or the Site name if empty
{@SiteBannerSrc}    : The source of the banner image of the file
{@SiteUrl} : The url of the site
{@SiteDescription} : Site description
{@SiteKeywords} : Site’s keywords
{@SiteContactEmail} : Contact email that was set in  avp-admin
{@SiteGoogleAnalyticsId} : If specified, will show the Analytics
{@SiteCopyrightInfo} : The copyright info of the site
{@_SiteGoogleNalytics} : Your site’s google analytics id

{@AVPUrlPath} : Your site’s url to put with links.
{@AVPRootDir} : The base root directory of AVP
{@AssetsDir}  : The assets directory. Assets contains js, css, images files, etc

{@AVPPowered} : A link saying powered by AdultsVideoPress.
{@AVPName}    : AVP Name

Read More
No Comments

Quick Start to Create Widgets

Posted by admin on October 22, 2011 in Developers Doc, Widgets
Read More
No Comments
« Older Entries

Archives

  • November 2011
  • October 2011
  • Home
  • Features
  • Demo
  • Download
  • Contact Us
  • Developers
  • Blog
  • Community

AdultsVideoPress is provided by Forni.ca and LalasCouch.