ini_set("include_path", ("/home/b5000086/public_html/wiverhaus/pear/PEAR/:".ini_get("include_path")));
require_once "wiverhaus/includes/db.inc";
require_once "wiverhaus/includes/winestore.inc";
require_once "wiverhaus/includes/authenticate.inc";
require_once "wiverhaus/includes/template.inc";
require_once "HTML/Template/IT.php";
//echo("hola");
//session_start();
//if (isset($_SESSION["loginUsername"])) $cust_id = getCust_id($_SESSION["loginUsername"], $connection);else exit;
if (!($connection = @ mysql_connect($hostname, $username, $password))) die("Cannot connect");
if (!(mysql_select_db($databasename, $connection))) showerror();
$template = new HTML_Template_IT("./");
$template->loadTemplatefile("slideshow.tpl", true, true);
doMysqlclean($connection, "a", 1000 );
if($a==1){
$OPTS = "thumbStock0 100 thumbStock1 100 thumbStock2 100 thumbStock3 100 thumbStock4 100 thumbStock5 100 thumbStock6 100 thumbStock7 100 thumbStock8 100 thumbStock9 100";
$opts = explode(" ", $OPTS);
for ($i = 0, $cnt = count($opts); $i < $cnt; $i+=2){
doMysqlclean($connection, $opts[$i], $opts[$i+1]);
if(strlen($$opts[$i])>1 && !strpos($$opts[$i],"ank.gif")){
$template->setCurrentBlock("LISTBLOCK");
$template->setVariable("LISTBLOCKVALUE", "");
//echo($row["thumb0"]."
");
$template->parseCurrentBlock();
}
}
}
else{
$querylist = encrypt_decrypt('decrypt', $a);
if (!($result = @ mysql_query ($querylist, $connection))) showerror();
if (!mysql_num_rows($result)) exit;
//echo("querylist lengh=".strlen($querylist)."querylist= ".$querylist);
//echo("
num rows=".mysql_num_rows($result));
while ($row = mysql_fetch_array($result)){
if(strlen($row["thumb0"])>1 && !strpos($row["thumb0"],"ank.gif")){
$template->setCurrentBlock("LISTBLOCK");
$template->setVariable("LISTBLOCKVALUE", "");
//echo($row["thumb0"]."
");
$template->parseCurrentBlock();
}
}
}
$template->show();
function encrypt_decrypt($action, $string) {
$output = false;
$encrypt_method = "AES-256-CBC";
$secret_key = 'This is my secret key';
$secret_iv = 'This is my secret iv';
// hash
$key = hash('sha256', $secret_key);
// iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning
$iv = substr(hash('sha256', $secret_iv), 0, 16);
if( $action == 'encrypt' ) {encrypt_decrypt('decrypt', $encrypted_txt);
$output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);
$output = base64_encode($output);
}
else if( $action == 'decrypt' ){
$output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);
}
return $output;
}
?>