Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - a4evermedia

Pages: 1 2 3
16
TubeX / 4-Column List of Categories
« on: May 23, 2012, 06:14:47 PM »
4-Column List of Categories


Quote
{categories var=$categories amount=all order=name}
{assign var=$per_column value=ceil(count($categories)/4)}







{foreach var=$category from=$categories counter=$counter}
{$category.name|htmlspecialchars}


{if $counter % $per_column == 0}

{/if}
{/foreach}

17
TgpX(SE) / Make Hidden Category "Really" Hidden
« on: May 18, 2012, 04:38:12 PM »
Although the hidden categories do not show up in the url's category list, all hidden categories still show up in the drop-down list for the search function. How do I filter out the hidden cats in this drop-down list?

Answer:You can change the template code for the category <select> field to this:

Code: [Select]
<select name=&quot;c&quot;>
  <option value=&quot;&quot;>All Categories</option>
  {foreach var=$sc from=$search_categories}
  {if $sc.hidden == 0}
  <option value=&quot;{$sc.tag|htmlspecialchars}&quot;>{$sc.name|htmlspecialchars}</option>
  {/if}
  {/foreach}
</select>

Thanks Jeremy

18
TradeX Discussion / Use TradeX to Skim on TubeX Video thumbs?
« on: May 14, 2012, 01:30:37 AM »
Yes, that can be done and is just a matter of adding the out.php code to your TubeX templates. For example, on the index.tpl template the default link code looks like this:

Code: [Select]
 <a href="{$g_config.base_uri}/video/{$video.video_id}/{$video.title|t_urlify(7)}"> 

Updating it to use TradeX with a 70% skim would look like this (assuming TradeX installed in the tx directory of your site):

Code: [Select]
 <a href="/tx/out.php?s=70&u={$g_config.base_url}/video/{$video.video_id}/{$video.title|t_urlify(7)}"> 


19
TubeX / Search and Replace Tags
« on: May 10, 2012, 09:09:43 AM »
You might need to edit your video tags to be consistent.

This can be easily done with this Raw SQL query.

UPDATE `tbx_video` SET `tags`= REPLACE(`tags`,'cumshot ','cumshots ')

This Raw SQL Query searches the field 'tags' and replaces the word 'cumshot' with the word 'cumshots'

Note: You can also replace the search field "tags" with "title" or "description" and do replacements in those fields.

The general format of this command is:
UPDATE table SET field = REPLACE(field, 'oldstring', 'newstring')

You will get a notification of how many lines were changed after using this command.

More info:
http://www.sqlteam.com/article/using-replace-in-an-update-statement

http://stackoverflow.com/questions/814548/how-to-replace-a-string-in-a-sql-server-table-column

20
TgpX(SE) / Expanding search.php
« on: May 06, 2012, 06:26:15 PM »
By default, search.php references only keywords and descriptions. 

To expand the search parameters to include tags, and titles make the following edits.

In your search.php script, locate line 64

Code: [Select]
$search_wheres = array('MATCH(`description`,`keywords`) AGAINST(? IN BOOLEAN MODE)', '`status` IN (?,?)');

Add 'tags' and `title` to the MATCH function;

Code: [Select]
$search_wheres = array('MATCH(`description`,`keywords`,`tags`,`title`) AGAINST(? IN BOOLEAN MODE)', '`status` IN (?,?)');

Now when search.php is accessed, it will search the tags, titles, keywords and descriptions.


21
TubeX Discussion / Listing Categories In 6 Equal Columns
« on: April 30, 2012, 05:20:17 AM »
I am looking for an efficient way to list categories in 6 columns.  Any suggestions would be greatly appreciated.

22
TubeX / Capitalized, Comma-seperated VIDEO Tag List
« on: April 30, 2012, 04:35:57 AM »
In the default video-watch.tpl, tags are presented in lower case, single word, space-seperated terms.  For those the want to use capatalized, comma-seperated, multi-word terms, I believe the following code snippet will work for you.

This code supports multi-word tags which must be seperated by an underscore character '_' in the script.  Meaning that when you add the tag in the administration module you must seperate the words with an underscore character like this, 'group_sex'.  These '_' characters are removed for display and each seperated word is then capitalized. Each (multi-word) tag is then seperated by a comma for display. 

Code: [Select]
{assign var=$tags code=explode(' ', $video.tags)}
{assign var=$numtags code=count($tags)}
{foreach var=$tag from=$tags counter=$i}
{assign var=$tag_text code=ucwords(str_replace(array('_'), ' ', $tag))}
<a href="{$g_config.base_uri}/tag/{$tag}/">{$tag_text}</a>{if $i < $numtags}, {/if}
{/foreach}

Thanks CrazyAl

Please post comments and questions about customizing this code in TubeX General Discussion.

23
TgpX(SE) / Lost Your Password?
« on: April 29, 2012, 04:16:04 PM »
TubeX: For security purposes, the control panel passwords cannot be retrieved. You can, however, use the reset-access.php utility script included with the software to generate a new superuser account. Upload this file to the admin directory of your TubeX installation and bring it up in your browser. Be sure to remove this file after you have the new account created.

TGPX: Same as above
http://yoursite.com/tgpx/admin/docs/utilities.html

TradeX: See TubeX

24
TubeX / Customizing Your TubeX Categories Page
« on: April 29, 2012, 01:52:28 PM »
The following code will allow you to effortlessly customize your TubeX categories.tpl page.  This code does two things for you;

1. Randomizes the display of category names for the purpose of adding some variety.

2. Grabs random images for display in each category that has at least one video.  If you have no videos in a category, the default 'no-preview' thumb will appear.  So you won't need to spend time searching for representative category images to upload.

SAMPLE PAGE

Code: [Select]
{foreach var=$category from=$categories counter=$counter}
    {videos var=$videos amount=1 category=$category.category_id sort=RAND()}
    {assign var=$video code=$videos[0]}
    <span class="video">
       <div class="video-container">
       <a target="_blank"  href="http://www.yoursite.com/tubex/category/{$category.url_name}/">
          <img src=&quot;{if $video.thumbnail}{$video.thumbnail}{else}{$g_config.no_preview}{/if}" class="video-thumb" title="{$category.name}" />
       </a>
         <div class="text-center">
           <a target="_blank" href="http://www.yoursite.com/tubex/category/{$category.url_name}/" class="fs110">{$category.name}</a> <br />
         </div>
       </div>
    </span>
{/foreach}

25
LinkX / Banner Rotation Within LinkX
« on: April 21, 2012, 11:21:29 AM »
You can use the advertisements section of LinkX to have banners rotate on page loads.

Use tags to limit category displays.


Code: [Select]
{nocache}{ad tags=fordbanners pagedupes=false weight=&quot;=1&quot;}{/nocache}

{nocache}{ad tags=dodgebanners pagedupes=false weight=&quot;=1&quot;}{/nocache}



Thanks Smutty

26
TgpX(SE) / Feed Keywords/Tags To search.php
« on: April 21, 2012, 11:15:13 AM »
You can split your keywords into separate tags/keywords and then search them with your search.php script.

Code: [Select]
{assign var= $link.keywords value=explode(' ', $link.keywords)}
{foreach var= $keyword from= $link.keywords}
<a href="{$config.base_url}/search.php?s={$keyword}">{$keyword|htmlspecialchars}</a>
{/foreach}

Thanks clit

27
TubeX / Trimming Descriptions
« on: April 21, 2012, 10:47:03 AM »
If you've got some long gallery descriptions that you want to fit in a table without wrapping, you can trim them down to a specific length using a bit of template code

Trim gallery descriptions to 50 characters
Code: [Select]
{$gallery.description|substr::0::50|htmlspecialchars|trim}


Trim gallery descriptions to 50 characters and add an ellipsis (...) to the end to indicate descriptions that have been trimmed
Code: [Select]
{$gallery.description|substr::0::50|htmlspecialchars|trim}{if strlen($gallery.description) > 50}...{/if}


You can trim your descriptions and convert their text case at the same time.

Trim gallery descriptions to 50 characters and convert first letter of each word to upper case
Code: [Select]
{$gallery.description|substr::0::50|strtolower|ucwords|htmlspecialchars|trim}


Thanks Jeremy and duno

28
TgpX(SE) / Uniform Description Text Case
« on: April 21, 2012, 10:38:01 AM »
If your gallery descriptions are not uniform with their use of text case you can convert them using a few different template modifiers.

All letters upper case
Code: [Select]
{$gallery.description|strtoupper|htmlspecialchars}


All letters lower case
Code: [Select]
{$gallery.description|strtolower|htmlspecialchars}


First letter upper case, all others lower case
Code: [Select]
{$gallery.description|strtolower|ucfirst|htmlspecialchars}


First letter of each word upper case, all others lower case
Code: [Select]
{$gallery.description|strtolower|ucwords|htmlspecialchars}


More info:  http://php.net/manual/en/function.ucwords.php

Thanks Jeremy

29
TubeX / Category Specific, Tag Specific Text Link Blocks
« on: April 20, 2012, 10:44:18 AM »
Did you know that you can use the TubeX Banner function to easily add specific ( or random ) text-link blocks to your pages?

Just add your anchor tags and text into the banner html box.  Then use the {banner} function to select the code for display.

For instance, to select a text or text-link block based on the category value of your page, you would place this code where you want the block inserted.

{banner zone="Text Link Block" tags=$category.name}

This assumes that you have created a text-link block for each category you use.  If not, you can use conditionals to a choose default or random block for categories for which you have not yet created a text-link block.

Code: [Select]
<div id="textlinks">

{capture var=$banner}{banner zone="Text Link Block" tags=$category.name}{/capture}
         
   {if empty($banner)}
      {banner zone="Text Link Block" tags="default" sort="`times_displayed` ASC"}
   {else}
      {banner zone="Text Link Block" tags=$category.name sort="`times_displayed` ASC"}
   {/if}

</div>

This assumes that you have at least one text link block tagged with default.

Please post your requests for customizing this code.

30
TubeX / Toplist Integration Into TGPX / TubeX Templates
« on: April 19, 2012, 10:50:26 PM »
Easily integrate any file (almost) into your TGPX / TubeX templates using the {file} function for TubeX, or the {include} function for TGPX.

Used most often with toplist files and any text or text-link files:

Ex: {file filename="/SERVER-PATH-TO/toplist.html"}

Pages: 1 2 3
anything