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
TgpX(SE) / 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"}

TradeX / 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

TradeX: See TubeX

TubeX / 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

TradeX: See TubeX

TgpX(SE) Discussion / Create a TUBE site driven by TGPX data
« on: August 06, 2012, 02:11:26 AM »
You can use TGPX to drive a very flexible and efficient tube site.  By adding a new field, (  flv_url for instance ), to your DB and importing readily available flash videos into your DB you can then present these vids using a bit of php code and a standalone video player.  I'm currently using JWPlayer for this, but you can use any player you choose.  Your landing page is created by TGPX and the PHP player page variables are driven from the landing page.

You can make the page as simple or as complex as you want, by adding ratings, views (click-tracking), and video tags (keywords, tags).  The main advantages of using TGPX to create mini-tube sites is that you can use it on any domain you have and the server load is much less than a TubeX install (or any other tube script install) would be.  One disadvantage is that you cannot easily provide for uploading videos, (maybe you can but thats way beyond my skills!) 

Of course, with TubeX open sourced now, that may still be your best bet.  I'm just letting you know that there are other options available.

Sample pages here:

Landing Page, by TPGX:

Any interested persons may request my current code if they want to play around with this.

TgpX(SE) Discussion / Useful SQL Queries (Repost)
« on: July 30, 2012, 04:10:46 AM »
sql string  
screw  Posted: 06-18-2008 10:34pm

With what sql string can I copy the contents of the gallery description field to the gallery keywords field ONLY if the keywords field is empty?
meicker  Posted: 06-19-2008 02:33am

update tx_galleries set keywords = description where keywords = ''

Thats it !


JMB-Jeremy  Posted: 06-19-2008 09:19am

The keywords value might also be NULL, so you would actually want to use this:

UPDATE `tx_galleries` SET `keywords`=`description` WHERE (`keywords`='' OR `keywords` IS NULL)
screw  Posted: 06-19-2008 12:15pm

double post  
screw  Posted: 06-22-2008 01:17pm

Thanks a lot.

There are two more sql strings that I'm looking for:

1. To append the text of the description field to the keywords field. In other words add the text without erasing the existing values in the keywords field.

2. To search the keywords field for duplicate words and leave only one of them. So that there are no more duplicates in the keywords field.  
JMB-Jeremy  Posted: 06-23-2008 10:07am

UPDATE `tx_galleries` SET `keywords`=CONCAT(`keywords`, ' ', `description`)
2. Sorry, there is not an SQL query you can run to do this.  
screw  Posted: 08-31-2008 06:04pm


And how do I change this
UPDATE `tx_galleries` SET `keywords`=CONCAT(`keywords`, ' ', `description`)to only append the description field to the keywords field if the keywords field has 4 or less values in it?
So 4 values or less in the keywords field, append description field.
More than 4 values in the keywords field, do nothing.  
JMB-Jeremy  Posted: 09-01-2008 10:19am

Sorry, there isn't a way to determine the number of keywords that have been set using only a MySQL query. The closest you can get is to check the length of the keywords field, which will tell you how many characters it currently contains. For example, to add the description to the keywords field when the keywords field contains less than 20 characters you would use this:

UPDATE `tx_galleries` SET `keywords`=CONCAT(`keywords`, ' ', `description`) WHERE LENGTH(`keywords`) < 20

TgpX(SE) Discussion / Alternative Search Term Usage (Repost)
« on: July 30, 2012, 04:01:13 AM »
JMB-Jeremy  Posted: 03-26-2009 07:57am

You can use the {$search_term} template value in the search-results.tpl template to display the search term that the user entered in meta tags, the title tag, etc. If you want to strip out special characters, you can use the {assign} template function like so:

{assign var=$search_term_stripped value=preg_replace('~[^a-z ]~i', '', $search_term)}
Then you can use {$search_term_stripped} to display the stripped value:


TgpX(SE) Discussion / Using The If Function (Repost)
« on: July 30, 2012, 03:54:58 AM »
stock5  Posted: 05-06-2009 05:50pm

If I have a page with two tags (tag1 and tag2), how can I match tag2 using {if}?

Something like this:

{if $page.tags == 'tag2'}

but it doesn't work..  
JMB-Jeremy  Posted: 05-07-2009 07:08am

You will need to use the strpos PHP function to check if a tag is contained in the tags value. Example:

{if strpos($page.tags,'tag2') !== false}
stock5  Posted: 05-25-2009 03:39pm

Thanks :) A related question: Does {if} support greater than, less than operators? Ex:

{if $page_galleries < '2'} do something {/if}  
JMB-Jeremy  Posted: 05-25-2009 07:55pm

Yes, it supports any of the operators that a regular PHP if tag allows.  
stock5  Posted: 05-25-2009 08:14pm

Any idea why this doesn't work:

{if $page_galleries < '2'} do something {/if}

when there's only 1 gallery displayed?  
JMB-Jeremy  Posted: 05-26-2009 07:00am

The $page_galleries is a special template value that is not calculated until after the page has been built, so it is not currently possible to use that value inside an {if} function.  
stock5  Posted: 05-26-2009 11:28am

Would it be possible to use {phpcode}?

For example:

if ($page_galleries < '2') echo "";
JMB-Jeremy  Posted: 05-26-2009 04:54pm

Sorry, that is not currently possible.  
stock5  Posted: 06-19-2009 01:22am

Hmm that's odd, it works with {phpcode} but not with {php} (I forgot htmlspecialchars which I assume is why it wasn't working). So TGPX values can be used in {phpcode} but not with {php}, is this correct?

edit: or is it just that $page.galleries can't be used in {php}, but others can?  
JMB-Jeremy  Posted: 06-19-2009 06:11am

It is not possible to use any of the template values inside a {phpcode} section, since those values are only valid during the building process and cannot be accessed after the page has been built. You can access them inside {php} sections, however because the $page_galleries template value is a special value that is one that will not work.  
stock5  Posted: 06-19-2009 11:22pm

That's odd. I'm seeing the opposite, template values work inside {phpcode} but not {php}. For instance, this code works:

if ('{$page_galleries|htmlspecialchars}' < '2') echo "
but this code doesn't

if ('{$page_galleries|htmlspecialchars}' < '2') echo "
I've tried it with other templates values with the same results. Any idea why?  
JMB-Jeremy  Posted: 06-20-2009 06:29am

Using the template variables in this manner isn't something that is officially supported by the template system. While you may find that it works in some cases, you should also be aware that you may get unexpected results or it may not work at all in future updates. Put simply: use at your own risk.  
stock5  Posted: 06-20-2009 04:16pm

Hmmm I see. The only reason I ask is because I'm currently using {phpcode} inside stock {foreach} functions, which works fine but I imagine it might stress the server if I had more visitors. But it sounds like it's not possible to use TGPX template values inside {php} so I guess I don't have a choice.

This may sound like a stupid question, but does {if} support the PHP function file_exists? If it does I could just do away with {php} and {phpcode} altogether.  
JMB-Jeremy  Posted: 06-21-2009 08:14am

Yes, you can use the file_exists PHP function in a TGPX {if} template function.  
stock5  Posted: 06-21-2009 09:04am

What am I doing wrong here? I can't seem to get this to work:

{if file_exists('test.php')} file exists {else} file does not exist {/if}
Thanks very much in advance.  
JMB-Jeremy  Posted: 06-22-2009 03:47pm

The template code is fine, however you should use a full directory path to the file since the working directory of the script while it is running the build process may not be the directory you expect.

{if file_exists('/full/directory/path/to/test.php')} file exists {else} file does not exist {/if}
stock5  Posted: 06-29-2009 01:40am

Awesome, that did it. Is it possible to use template variables inside the {if} statement? For instance,

{assign var=$fixed_pageurl value=str_replace('', '', $category.page_url)}
{if file_exists('../../{$fixed_pageurl}')} file exists {else} file does not exist {/if}
And congrats on on the release of tubex :) I think I'll pick up a copy later today.  
JMB-Jeremy  Posted: 06-29-2009 06:37am

Yes, that can be done with a small modification:

{if file_exists('../../' . $fixed_pageurl)}
stock5  Posted: 07-01-2009 03:57am

Thanks a lot, one last question: how do I append a filename to $fixed_pageurl? For example,

{if file_exists('../../' . $fixed_pageurl'index.php')}

if that makes sense..  
JMB-Jeremy  Posted: 07-01-2009 09:05am

The period character is used for string concatenation in PHP, so that would look like this:

{if file_exists('../../' . $fixed_pageurl . 'index.php')}

axljayangel  Posted: 10-19-2009 08:35pm

Hello Jeremy,

That's great! May I also ask you one last question? I have a database of galleries where I wish to add a single tag to all galleries. May I ask what would be the raw query string to use? I looked up the Quick Tasks but it seems not possible to do so with it. Thank you!

Kind Regards,
A.J. Angel  
JMB-Jeremy  Posted: 10-20-2009 06:01am

The raw query would look like this:

UPDATE `tx_galleries` SET `tags`=IF(`tags`='', 'newtag', CONCAT(`tags`, ' newtag'));

Where newtag is the tag that you want added to all of your galleries.  
axljayangel  Posted: 10-20-2009 07:08pm

Hello Jeremy,

Shouldn't the code be the following instead?

UPDATE tx_galleries SET `tags`=IF(`tags`='', 'newtag', CONCAT(`tags`, ' newtag'));
Kind Regards,
A.J. Angel  
JMB-Jeremy  Posted: 10-20-2009 08:21pm

Yes it should!

TubeX / How To Regenerate Popular Tags
« on: July 23, 2012, 12:22:06 PM »
In the Utilities directory of your TubeX download there is a script called rebuild-tags.php.

Upload this file to your admin directory and execute the script.

TubeX / How To Change The Default Thumbnail Size
« on: July 18, 2012, 08:07:44 PM »
I am attempting to repost the info here, but for now here is a link:

TubeX / Modification of the GLOBAL Tag List
« on: July 18, 2012, 04:39:01 PM »
This bit of code generates a list of 50 popular tags capatilized and comma-seperated, and sorted by frequency:
Code: [Select]
{tags var=$tags sort=&quot;frequency DESC&quot; alphabetize=true amount=50 minscore=100 maxscore=200}

{foreach var=$tag from=$tags counter=$i}
{assign var=$tag_text code=ucwords(str_replace(array('_'), ' ', $tag.tag))}
<a href=&quot;{$g_config.base_uri}/tag/{$tag.tag}&quot;  class=&quot;tag-{$tag.score}&quot;>{$tag_text}</a>{if $i < 50}, {/if}

If you want to remove the commas, delete the counter=$i code and change the anchor tag by removing the {if} conditional at the end:
Code: [Select]

For all lower case, change ucwords to strtolower

Thanks Dred!

TradeX Discussion / Tracking incoming hits with TubeX
« on: July 16, 2012, 10:29:42 PM »
Place in you global-header template if possible

{nocache}{php} include ("/ FULL-SERVER-PATH-TO /tx/in.php"); {/php}{/nocache}

For example:
{nocache}{php} include ("/home/user/public_html/tx/in.php"); {/php}{/nocache}

TubeX Discussion / Export TubeX Users?
« on: June 21, 2012, 04:31:28 AM »
Quote from: NekoiSlav

I wanted to start a new thread but I have no rights to do this (don't know why). That's why I'm sending you PM.

Is there any way to export all TubeX users with their passwords? I need this because I installed another tube script and I want to import all tubex users into my new script.


I'm sure there is a way to do this as the info is contained in a standard MySQL database.  However I do not know exactly how.

The following link may be of help.

You can build a dynamic PHP page served by your TGPX database.  The beauty of this is that the page is not built beforehand, the galleries are pulled from the database when the link is accessed.  New galleries and, in fact, new category pages are added simply by adding data to the DB.  The page is cached on the server so that a page is never 'created' more that once every set amount of time (currently 6 hours).  After that time only then will the DB be accessed to create a new page which will then be served to all those who click the link during the current time period.


Code for niche.php
Purpose:  Main file for displaying the galleries page.  Used with the t variable to indicate which category to display.  Defaults to Hardcore category if t is missing or invalid.  Also handles page cacheing and provides the html for genrating the webpage itself.  Uses PHP code snips to specify the category being view as well as in the <head> section for search engine optimization.
Code: [Select]
 $page = $_GET['t'];

  // set $page variable defaults to Hardcore category if GET variable is invalid or missing
   if((!isset($_GET['t'])) || (empty($_GET['t'])))
       $page = 'Hardcore';

   // $category is used on web pages
   $category = $page;

   $page = preg_replace('/\s+/','',ucwords($page));

   // Define path and name of cached file 

   $cachefile = '_cache/' . $page . md5('$page');

   // How long to keep cache file? 

   $cachetime = 6 * 3600;     

   // Is cache file still fresh? If so, serve it.     

   if (file_exists($cachefile) && time() - $cachetime < filemtime($cachefile)) { 




   // if no file or too old, render and capture HTML page. 


   $categ = ucwords($category);


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<TITLE>Kick Ass <?PHP echo $categ; ?> Porn  -  Beautiful Sexy Hardcore Amateur Fucking Pics Movie!</TITLE>
<META NAME="description" CONTENT="Sexy <?PHP echo $categ; ?> Amateur Girls Fucking Hardcore Pics Movie">
<META NAME="keywords" CONTENT="<?PHP echo $categ; ?>,black,white,ebony,pics,movie,sexy,hardcore,public">

<link rel="stylesheet" type="text/css" href="style.css" />

<base target="_blank" />

<div id="main-content" style="max-width:1200px;">

<div id="centered-content" class="max-width" style="margin-top:0; text-align:center;">

<div id='wrapper'>
while ($i < min($num, 30 )) {


print "<li><a href='click.php?c=$categ&id=$id_num&u=$id_url'  target='_blank'><img src='$id_prev' height='180px' width='180px' /></a>


<!-- END centered-content -->
<!-- END main-content -->



     // Save the cached content to a file 

     $fp = fopen($cachefile, 'w'); 

     fwrite($fp, ob_get_contents()); 



     // Send browser output 



Code for xconnect.php ( called by niche.php )
Purpose: Accesses the TGPX database.  Checks for a valid category hash tag which is required to retrieve the desired galleries.
Code: [Select]
// this file name - xconnect.php

// prepare DB for access

@mysql_select_db($database) or die('Error encountered with connection: '.mysql_error());

// find hash tag for desired category
$query = "SELECT *,`tx_categories`.`tag` FROM `tx_categories` WHERE `name` = '$categ' LIMIT 0, 30 ";


// check if valid hash tag found - erase bad cachefile name if not

if ($num == 0)
   $cachefile = '/home/public_html/_cache/Hardcore_cached_page';

   if (file_exists($cachefile)) { 


     exit;  }

   $categ = 'Hardcore';
   $taghash = '1c800aa97116d9afd83204d65d50199a';

// select galleries for chosen category
$query = "SELECT *,`tx_galleries`.`gallery_id` AS `gallery_id` FROM `tx_galleries` LEFT JOIN `tx_gallery_previews` ON `tx_gallery_previews`.`gallery_id`=`tx_galleries`.`gallery_id` LEFT JOIN `tx_gallery_used_page` ON `tx_gallery_used_page`.`gallery_id`=`tx_galleries`.`gallery_id` WHERE `tx_gallery_used_page`.`gallery_id` IS NULL AND `has_preview`=1 AND MATCH(`categories`) AGAINST ('$taghash' IN BOOLEAN MODE) AND `status` IN ('used','holding','approved') ORDER BY RAND() LIMIT 60";



if ($num == 0)
   echo "No results in this category";


Code for erasebadcache.php ( called by xconnect.php )
Purpose:  When a category request is made through niche.php, a cachefile is created.  If this cachefile is determined to be invalid ( not a current or correct category ),  it is erased so you dont end up with a bunch of junk files in your _cache/ directory.
Code: [Select]
 // If bad cachefile exists, delete it.

   $cachefile = 'home/public_html/' . $cachefile;

   if (file_exists($cachefile)) {



Sample pages can be accessed here: or or boobs


It has come to my attention that, in some cases, your hosts malware detection scanner could be quarantining essential templates in your TubeX compiled directory.

Quote from thread at JMBSoft's support forum:

I FOUND the answer to our problem.

Its your host - or to be speciific - its your hosts malware detection scanner that is the culprit.

from my hosting company support team:
" files getting quarantined have an encoded payload embedded in the file.
{HEX}base64.inject.unclassed.6 : /YOUR DOMAINS ROOT HTML FOLDER/templates/_compiled/global-header.tpl => /usr/local/maldetect/quarantine/global-header.tpl.18436 "

THE SOLUTION - ask your hosting company to please exclude the "_compiled" folder from the malicious code detection scans.  

The full post can be found here:

Thanks guestcam

Pages: 1 2 3