function db_template_cms($tpl_name, &$tpl_source, $smarty_obj) { global $lang_active; global $set; $source = new SelectEntrys(); // if ($cms_data == "") { $source->cols = $_GET["section"]; $source->table = 'cms'; $source->condition = " lang = '{$lang_active}' "; $source->limit = "1"; //if ($IE) $tpl_source = "<br>"; $tpl_source .= $source->row(); unset($source); // print_r($tpl_source); //TODO cache: check if it is older than 3 days and then refresh it and update cache object. otherwise leave it require_once 'replace.php'; $tpl_source = replaceBBcode($tpl_source, $set[0]["width_images"], 0); // if (mod_memcache == 1) $memcache->set('cms_ '.$_GET["section"], $tpl_source, false, memcache_duration); // else $_SESSION['cms_data'][$_GET["section"]] = $tpl_source; // } return empty($tpl_source) ? false : true; }
function db_template_blocks($tpl_name, &$tpl_source, &$smarty_obj) { // include('./settings/config.php'); include './settings/template.php'; $source = new SelectEntrys(); $source->cols = 'id, block, tpl_name, status'; $source->table = 'blocks'; $source->order = 'id'; $source->multiSelect = "1"; $tpl_array = $source->row(); $tpl_source = "<form method='post' name='form'>"; $tpl_source .= $tpl_main_start; $tpl_source .= $tpl_head_start; $tpl_source .= $set_head_000; $tpl_source .= $tpl_head_end; $tpl_source .= "<table align='center' class='table_011'><tr>"; $count = 1; foreach ($tpl_array as $array1 => $array2) { if ($array2["status"] == 1) { $check_status = "checked"; } else { $check_status = ""; } $tpl_source .= "<td>"; $tpl_source .= $array2["tpl_name"]; //if ($array2["block"] == 'reference') $tpl_source .= ' (2)'; $tpl_source .= "</td><td>"; $tpl_source .= "<input type='checkbox' {$check_status} name='block_status[{$array2['id']}]' class='check_001'>"; $tpl_source .= "<input type='hidden' name='block_id[]' value='{$array2['id']}'>"; $tpl_source .= " </td>"; if ($count % 5 == 0 && $count < count($tpl_array)) { $tpl_source .= "</tr><tr>"; } $count++; } $tpl_source .= "</tr></table>"; unset($source); return empty($tpl_source) ? false : true; }
<?php $blog = new SelectEntrys(); $blog->cols = "ID, permalink, title_EN, message_EN, category, pinterest_picture, pinterest_text, click_action, popup_title, url, fb_likes, fb_comments, visibility"; $blog->table = $tbl_blog; $blog->condition = "is_book = '{$is_book}'"; if ($user_data['admin'] == 0) { $blog->condition = $blog->condition . " AND visibility = '1' "; } $blog->order = 'date DESC'; $blog->multiSelect = 1; $ay_blog = $blog->row(); $count = 0; foreach ($ay_blog as $b_items) { $ay_blog[$count]['title_ser'] = urlencode($b_items['title_EN']); $ay_blog[$count]['text_ser'] = urlencode($b_items['pinterest_text']); $ay_blog[$count]['cat_str'] = $blog_getcat[$b_items['category']]; $count++; }
<?php /* XAJAX - asynchronous call: retrieve updated data */ require_once 'lib/functions/convert_date.php'; $goals = new SelectEntrys(); $goals->cols = "ID, goal, progress, created, achieved"; $goals->table = $tbl_goals; $goals->condition = " userID = '" . $user_data['ID'] . "' "; if (!isset($goals_order)) { $goals->order = 'created DESC'; } else { $goals->order = $goals_order; } if (isset($goals_show_landing) == true) { $goals->limit = 1; } //$goals->limit = 10; $goals->multiSelect = 1; $ay_goals = $goals->row(); $count = 0; if (isset($ay_goals[0])) { foreach ($ay_goals as $res2) { $ay_goals[$count]["created"] = convert_date($res2["created"], 0, $getmonth); $ay_goals[$count]["achieved"] = convert_date($res2["achieved"], 0, $getmonth); $count++; } }
$bd_scale_c->cols = "date"; $bd_scale_c->distinct = 1; $bd_scale_c->table = $tbl_bd_scale_results; $bd_scale_c->condition = "userID = '" . $user_data['ID'] . "' "; $bd_scale_c->order = 'date'; $bd_scale_c->multiSelect = 1; $bd_scale_dates = $bd_scale_c->row(); if (!isset($bd_scale_dates[0])) { $total_entries = 0; } else { $total_entries = count($bd_scale_dates); } $date_string = ""; //if at least one entry exists if (isset($bd_scale_dates[0])) { $bd_scale_r = new SelectEntrys(); //$select_dates[] = ""; //$final_scores[] = ''; //sum up points for total score for each date entry if ($total_entries > 0) { // foreach($bd_scale_dates as $key => $value) $select_dates[] = substr($value["date"],0,10); for ($i = 1; $i <= $total_entries; $i++) { $x = $i - 1; $bd_scale_r->cols = "itemID, value, date"; $bd_scale_r->table = $tbl_bd_scale_results; $bd_scale_r->condition = "userID = '" . $user_data['ID'] . "' && date = '" . $bd_scale_dates[$x]['date'] . "'"; $bd_scale_r->order = 'itemID'; $bd_scale_r->multiSelect = 1; $ay_items = $bd_scale_r->row(); $final_scores[] = $ay_items[0]['value'] + $ay_items[1]['value'] + $ay_items[2]['value'] + $ay_items[3]['value'] + $ay_items[4]['value'] + $ay_items[5]['value'] + $ay_items[6]['value'] + $ay_items[7]['value'] + $ay_items[8]['value'] + $ay_items[9]['value'] + $ay_items[10]['value'] + $ay_items[11]['value'] + $ay_items[12]['value'] + $ay_items[13]['value'] + $ay_items[14]['value'] + $ay_items[15]['value'] + $ay_items[16]['value'] + $ay_items[17]['value'] + $ay_items[18]['value'] + $ay_items[19]['value'] + $ay_items[20]['value'] + $ay_items[21]['value'] + $ay_items[22]['value'] + $ay_items[23]['value'] + $ay_items[24]['value']; unset($ay_items);
<?php $upd_data = new ModifyEntry(); $upd_data->table = $tbl_users; $upd_data->condition = " id = '" . $user_data['ID'] . "' "; $upd_data->changes = " fb_ID = '0', fb_name = '' "; $upd_data->update(); unset($upd_data); $friends_delete = new ModifyEntry(); $friends_delete->table = $tbl_friends; $friends_delete->condition = " userID = '" . $user_data['ID'] . "' "; $friends_delete->delete(); unset($friends_delete); $prep_trigger = new SelectEntrys(); $prep_trigger->cols = 'userID'; $prep_trigger->table = $tbl_friends; $prep_trigger->condition = " friendID = '" . $user_data['ID'] . "' "; $prep_trigger->multiSelect = '1'; $ay_trigger = $prep_trigger->row(); if ($ay_trigger !== false) { foreach ($ay_trigger as $key => $value) { $arr[] = $value['userID']; } $str_trigger = implode(",", $arr); $set_trigger = new ModifyEntry(); $set_trigger->table = $tbl_users; $set_trigger->condition = " ID IN ({$str_trigger}) "; $set_trigger->changes = " trigger_friends = 1 "; $set_trigger->update(); unset($set_trigger); }
<?php //activation.html?c=bebf08f7af79422ced07be79c2f2f5c0&t=13140575844e52ed70736d2 if ($logon_true != 1) { if (isset($_GET['e']) and $_GET['e'] == 'success') { $tpl->assign('e', "success"); } else { if (isset($_POST['reg_submit'])) { $birthday = $_POST['born_y'] . "-" . $_POST['born_m'] . "-" . $_POST['born_d']; $f_cats = new SelectEntrys(); $f_cats->cols = 'ID'; $f_cats->table = $tbl_flash_categories; $f_cats->order = 'ID'; $f_cats->multiSelect = '1'; $cats = $f_cats->row(); //same for sections_public if needed foreach ($cats as $key => $value) { $arr[] = $value['ID']; } $str_cats = implode(",", $arr); $upd_data = new ModifyEntry(); $upd_data->table = $tbl_users; $upd_data->condition = " UserToken = '" . $_POST['t'] . "' "; $upd_data->changes = " nationality = '" . $_POST['nationality'] . "', residence = '" . $_POST['residence'] . "', gender = '" . $_POST['gender'] . "', birthday = '{$birthday}', flash_categories_visible = '{$str_cats}', activation_code = '' "; $upd_data->update(); unset($upd_data); header("Location:" . ROOT_DIR . "register/activation.html?t=" . $_POST['t'] . "&e=success"); } else { if (isset($_GET['c']) && isset($_GET['t'])) { $validity_check = new CheckExist(); $validity_check->tableE = $tbl_users;
/**************************/ /* Check if links are available in the selected category */ if ($_GET['cid'] > 0) { $links = new CheckExist(); $links->tableE = $tbl_links; if ($Myadmin == "1") { $links->conditionE = " cid = '{$_GET['cid']}' "; } else { $links->conditionE = " cid = '{$_GET['cid']}' AND visibility = '1' "; } $links_total = $links->exist(); unset($links); } /**************************/ /* Load :: Link section */ $links = new SelectEntrys(); $links->cols = ' id, cid, link, description, description_EN, position, visibility '; $links->table = $tbl_links; $links->order = "cid, position"; if ($Myadmin != "1") { $links->condition = "visibility = '1' "; } $links->multiSelect = '1'; $array_l = $links->row(); unset($links); foreach ($array_l as $array1 => $array2) { $array[$array2["cid"]][$array2["id"]] = array('id' => $array2["id"], 'cid' => $array2["cid"], 'link' => $array2["link"], 'description' => $array2["description"], 'description_EN' => $array2["description_EN"], 'position' => $array2["position"], 'visibility' => $array2["visibility"]); } if ($_GET['cid'] > 0) { $cid_active = $_GET['cid']; } else {
$fileicon3 = substr($filename3, strlen($filename3) - 3); $filenumbers = 0; if ($file1) { $filenumbers++; } if ($file2) { $filenumbers++; } if ($file3) { $filenumbers++; } } if ($module != 'admin') { $result["date_formatted"] = convert_date($result["date_formatted"], ''); /* Print :: SELECT :: Comments */ $comments = new SelectEntrys(); $comments->cols = "id, bid, time, name, comment, lang"; $comments->table = $tbl_blog_comments; $comments->condition = "bid = '{$id}' AND deleted = '0'"; $comments->order = "time DESC"; $comments->limit = "0, " . $set[0]['perpage_comments']; $comments->multiSelect = 1; if ($comments->row()) { $array_com[] = $comments->row(); } unset($comments); /******************************************/ require_once './lib/exist.php'; $comments_exist = new CheckExist(); $comments_exist->tableE = $tbl_blog_comments; $comments_exist->conditionE = "bid = '{$id}' AND deleted = '0'";
<?php if ($block["products"]["status"] == 1) { if ($pid != "") { /* Print :: SELECT */ $products = new SelectEntrys(); $products->cols = "ID, id_handler, category, name_DE, description_DE, name_EN, description_EN, OS, price, external"; $products->table = $tbl_products; $products->condition = " id_handler = '{$pid}' "; $products->multiSelect = '1'; $ay_products = $products->row(); require_once './lib/replace.php'; $ay_products[0]['description_DE'] = replaceBBcode($ay_products[0]['description_DE'], $set[0]["width_images"], 1); $ay_products[0]['description_EN'] = replaceBBcode($ay_products[0]['description_EN'], $set[0]["width_images"], 1); if ($ay_products[0]['ID'] > 0) { $path = "media/images/products/screenshots/" . $ay_products[0]['id_handler'] . "/"; $tpl->assign("total_screens", countfiles($path)); $tpl->assign("array", $ay_products); $tpl->display("products/details.tpl"); } else { $tpl->display("block_deactivated.tpl"); } /******************************************/ /* Delete :: Object SELECT */ unset($products); /******************************************/ } } else { $tpl->display("block_deactivated.tpl"); }
<?php /* Load :: Database connection */ require_once "../../dbCon.php"; /******************************************/ /* Get Setting Values */ include '../../settings/tables.php'; require_once '../../lib/select.php'; $settings = new SelectEntrys(); $settings->cols = 'root_dir'; $settings->table = $tbl_settings; $settings->condition = " id = '1' "; $settings->multiSelect = 1; $set = $settings->row(); unset($settings); define("ROOT_DIR", $set[0]["root_dir"]); /******************************************/ /* Initialize and Load :: Choosen Language */ if (!$_COOKIE["lang"]) { switch (substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)) { case 'de': $lang_browser = "DE"; break; case 'en': $lang_browser = "EN"; break; default: $lang_browser = "DE"; } } if ($_COOKIE["lang"] == '2' || $lang_browser == 'DE') {
<?php if (isset($preview)) { $msg_form = stripslashes($_POST["message"]); $array[] = array('message' => $msg_form); $tpl->assign('array', $array); $tpl->assign('cms_site', true); $tpl->display('formular/form_main.tpl'); } else { /* Create Object :: SELECT */ $cms = new SelectEntrys(); $cms->cols = "{$cms_content}"; $cms->table = $tbl_cms; $cms->condition = " lang = '{$lang_active}' "; $cms->order = ''; $cms->limit = ""; $cms->module = "cms"; $cms->template = 'formular/form_main.tpl'; $cms->row(); unset($cms); /******************************************/ }
function selectdata($table, $data) { //global $tpl; global $memcache; global $l; global $tpl; global $user_data; global $getmonth; $objResponse = new xajaxResponse(); //include('settings/template.php'); include 'settings/tables.php'; if ($user_data == '') { require_once 'lib/functions/get_userdata.php'; } if ($table == $tbl_diary) { if ($data == 'clear_filter') { include "././lib/functions/fetch_diary.php"; } else { $selected_month = mysql_real_escape_string($data['month']); $selected_year = mysql_real_escape_string($data['year']); //$mysqldate = date( 'Y-m-d H:i:s', time() ); $start_date = date("Y-m-d H:i:s", mktime(0, 0, 0, $selected_month, 1, $selected_year)); $end_date = date("Y-m-d H:i:s", mktime(23, 59, 59, $selected_month + 1, 0, $selected_year)); //The last day of any given month can be expressed as the "0" day of the next month //strtotime("+1 month", $myTimestamp); //select new entry $diary = new SelectEntrys(); $diary->cols = "ID, entry, date, picture"; $diary->table = $tbl_diary; $diary->condition = " userID = '" . $user_data['ID'] . "' AND date >= '" . $start_date . "' AND date <= '" . $end_date . "' "; $diary->order = 'date DESC'; //$diary->limit = 10; $diary->multiSelect = 1; $ay_diary = $diary->row(); if (isset($ay_diary[0])) { require_once 'lib/functions/convert_date.php'; $count = 0; foreach ($ay_diary as $date_format) { $ay_diary[$count]["date"] = convert_date($date_format['date'], 0, $getmonth); $count++; } } } //refresh content //include("lib/functions/fetch_diary.php"); $tpl->assign('ay_diary', $ay_diary); //TODO why is this needed now!? $tpl->assign('user_data', $user_data); //if at least one entry exists if (isset($ay_diary[0])) { $tpl->assign('at_least_one_entry', 1); } else { $tpl->assign('at_least_one_entry', 0); } $html = $tpl->fetch("modules/home/diary_entries.tpl"); $objResponse->assign("diary_entries", "innerHTML", $html); // if ($data == 'clear_filter') { $objResponse->includeScript("js/pinterest.js"); $objResponse->call("m_reload"); // } } return $objResponse; }
} else { if ($_GET[gid] && $_GET[pid]) { /* Display selected picture */ $pictureid = $_GET[pid] - 1; $picture = $pictures[$pictureid]; $destination = $dir_images . $picture; $tpl->assign('picture', $destination); $tpl->display('gallery/showpicture.tpl'); } else { if (!empty($_POST['submit_del']) && $logon_true == '1' && $str) { /* Create Object :: DELETE */ require_once './lib/modify.php'; $gallery = new ModifyEntry(); /******************************************/ /* Create Object :: SELECT */ $getfolder = new SelectEntrys(); /******************************************/ /* Create Object :: Readdirectory */ $thumbs = new readdirectory(); /******************************************/ /* Print :: SELECT */ $getfolder->cols = 'folder'; $getfolder->table = $tbl_gallery; $getfolder->condition = " id = '{$_POST['gid']}' "; $getfolder->order = ''; $getfolder->limit = "1"; $getfolder->module = ''; $getfolder->template = ''; $folder = $getfolder->row(); /******************************************/ /* Delete :: Object SELECT */
unset($GetPage); $page = $newer_entries / $set[0]['perpage_blog']; $page = floor($page); $page++; header("Location:" . ROOT_DIR . "blog/" . $_POST['id'] . "/"); /******************************************/ } else { if (isset($preview)) { include "modules/blog/output.php"; include 'modules/blog/preview.php'; $tpl->assign('array', $array); $tpl->display("formular/form_main.tpl"); $tpl->display('blog/preview.tpl'); } else { /* Create Object :: SELECT */ $blog = new SelectEntrys(); /******************************************/ /* Print :: SELECT */ $blog->cols = "id, title_DE, message_DE, title_EN, message_EN, date, DATE_FORMAT(date,'%d. %m %Y') as date_formatted, file1, file2, file3, filename1, filename2, filename3, visibility, comments"; $blog->table = $tbl_blog; $blog->condition = " id = '{$_GET['nid']}' "; $blog->order = ''; $blog->limit = ""; $blog->module = 'blog'; $blog->template = 'formular/form_main.tpl'; $blog->row(); /******************************************/ /* Delete :: Object SELECT */ unset($blog); /******************************************/ }
<<?php $ref = new SelectEntrys(); $ref->cols = 'link, description'; $ref->table = $tbl_ref; $ref->order = 'position'; $ref->multiSelect = '1'; $ref->row(); $tpl->assign('array_ref', $ref->row()); unset($ref); $tpl->display("quicklinks.tpl");
<?php /* XAJAX - asynchronous call: retrieve updated data */ //TODO convert date require_once 'lib/functions/convert_date.php'; /* Print :: SELECT */ $thoughts = new SelectEntrys(); $thoughts->cols = "ID, thought, response, action, status"; $thoughts->table = $tbl_distorted_thoughts; if (isset($thoughts_landing) == true) { $thoughts->condition = " userID = '" . $user_data['ID'] . "' AND status = '0' OR userID = '" . $user_data['ID'] . "' AND status = '1' "; $thoughts->order = 'RAND()'; $thoughts->limit = 1; } else { $thoughts->condition = " userID = '" . $user_data['ID'] . "' "; $thoughts->order = 'status, created DESC'; } $thoughts->multiSelect = 1; $ay_thoughts = $thoughts->row(); /******************************************/
<?php /* Retrieve user_array */ //retrieve from database if not found in cache if ($user_data == "") { $token_identifier = mysql_real_escape_string($l['token']); $usr_data = new SelectEntrys(); //$usr_data->token = $l["token"]; $usr_data->cols = 'ID, UserToken, UserEmail, UserPass, admin, firstname, language, last_online_time, description, personal_goal, diary_start_month, diary_start_year, bd_latest_score, da_latest_score'; $usr_data->condition = "UserToken = '{$token_identifier}' "; $usr_data->multiSelect = '1'; $ay_user = $usr_data->row(); unset($usr_data); //store object in cache if (mod_memcache == 1) { $memcache->set($mem_key1, $ay_user[0], false, memcache_duration); } else { $_SESSION['$mem_key1'] = $ay_user[0]; } $user_data = $ay_user[0]; } //print_r($user_data); $tpl->assign('user_data', $user_data); $diff_actual = time() - strtotime($user_data['last_online_time']); //update last_online_time of the user if ($diff_actual > diff_max) { $upd_data = new ModifyEntry(); $upd_data->table = $tbl_users; $upd_data->condition = " ID = '" . $user_data['ID'] . "' "; $upd_data->changes = " last_online_time = '{$mysqldate}' "; $upd_data->update();
<?php if ($block["references"]["status"] == 1) { if (!isset($_GET['cat'])) { $_GET['cat'] = 'iPhone'; } $ref = new SelectEntrys(); $ref->cols = "ID, company, url, smallsize"; $ref->table = $tbl_ref; $ref->condition = " category = '" . $_GET['cat'] . "' AND visibility = '1' "; $ref->multiSelect = '1'; $ay_ref = $ref->row(); if ($_GET['cat'] != 'iPhone' && $_GET['cat'] != 'iPad' && $_GET['cat'] != 'android' && $_GET['cat'] != 'services') { $tpl->display("block_deactivated.tpl"); } else { $rest = count($ay_ref) % 4; $tpl->assign("array", $ay_ref); $tpl->assign("total_n", count($ay_ref)); $tpl->assign("rest", $rest); $tpl->assign("foo", 1); $tpl->display("references/index.tpl"); } } else { $tpl->display("block_deactivated.tpl"); }
<?php $favorites = new SelectEntrys(); $favorites->cols = "{$tbl_favorites}.flashID, {$tbl_flashes}.question"; $favorites->table = $tbl_favorites; $favorites->join = " LEFT JOIN {$tbl_flashes} ON ({$tbl_flashes}.ID = {$tbl_favorites}.flashID) "; $favorites->condition = " {$tbl_favorites}.userID = '" . $user_data['ID'] . "' "; $favorites->order = "{$tbl_favorites}.time DESC"; $favorites->limit = $per_page_favorites; $favorites->multiSelect = 1; $ay_favorites = $favorites->row(); $tpl->assign('ay_favorites', $ay_favorites); $n_fav = new CheckExist(); $n_fav->tableE = $tbl_favorites; $n_fav->conditionE = " userID = '" . $user_data['ID'] . "' "; $n_fav = $n_fav->exist(); $number_of_fav = $n_fav; $total_pages = ceil($number_of_fav / $per_page_favorites); $tpl->assign('total_pages', "{$total_pages}"); $tpl->assign('total', $number_of_fav); $tpl->assign('category', "favorites"); unset($ay_favorites);
function get_gallery_title($tbl_gallery, $gid) { require_once 'lib/select.php'; $gal_title = new SelectEntrys(); $gal_title->cols = ' title, title_EN '; $gal_title->table = $tbl_gallery; $gal_title->condition = " id = '{$gid}' "; $gal_title->multiSelect = 1; $gal_titles = $gal_title->row(); unset($gal_title); return $gal_titles; }
if (is_dir($dir_folder)) { $folder = new readdirectory(); $folder->results = $Tfolder; $subfolder = $folder->checkformat(''); if (count($subfolder) == 0) { $extended = 'true'; } unset($folder); } else { $no_folder = $editgallery_select1 . " «" . $Tfolder[0] . "» " . $editgallery_select2; array_unshift($results, $no_folder); $extended = 'true'; } /*****************************/ /* Print :: SELECT */ $gallery = new SelectEntrys(); $gallery->cols = 'id, title, title_EN, description, description_EN, folder, date, visibility'; $gallery->table = $tbl_gallery; $gallery->condition = " id = '{$_GET['gid']}' "; $gallery->order = ''; $gallery->limit = "1"; $gallery->module = 'gallery'; $gallery->template = 'admin/editgallery.tpl'; $gallery->subfolders = $results; $gallery->extended = $extended; $gallery->row(); /******************************************/ /* Delete :: Object SELECT */ unset($gallery); /******************************************/ }
$usr_data->cols = 'ID, UserToken, UserEmail, UserPass, flash_categories_visible, fb_ID, fb_name, sections_public, language, last_online_time'; $usr_data->multiSelect = '1'; $ay_user = $usr_data->getUserData(); unset($usr_data); if ($trigger_f == 1) { $mem_key1 = "user_data_" . $l["token"]; $memcache->delete($mem_key1); $upd_data = new ModifyEntry(); $upd_data->table = $tbl_users; $upd_data->condition = " ID = '" . $ay_user[0]['ID'] . "' "; $upd_data->changes = " trigger_friends = '0' "; $upd_data->update(); unset($upd_data); } if ($ay_user[0]['fb_ID'] != 0) { $get_friends = new SelectEntrys(); $get_friends->cols = 'fb_ID, friendID, fb_name, restricted'; $get_friends->table = $tbl_friends; $get_friends->condition = " userID = '" . $ay_user[0]['ID'] . "' AND friendID > 0 "; $get_friends->order = 'fb_name'; $get_friends->multiSelect = '1'; $friends_new = $get_friends->row(); if ($friends_new !== false) { $ay_user[0]['fb_friends'] = $friends_new; } else { $ay_user[0]['fb_friends'] = array(); } unset($members); unset($friends); } else { $ay_user[0]['fb_friends'] = array();
if ($_GET['module'] != 'flash') { $ay_cats_active = explode(",", $user_data['flash_categories_visible']); $flash_cats = new CheckExist(); $flash_cats->tableE = $tbl_flash_categories; $n_flash_cats = $flash_cats->exist(); for ($i = 1; $i <= $n_flash_cats; $i++) { if (in_array($i, $ay_cats_active)) { $tpl->assign('flash_cat_' . $i, "checked='checked'"); } else { $tpl->assign('flash_cat_' . $i, ""); } } } if ($user_data['flash_categories_visible'] != "" || $_GET['module'] == 'flash') { $cats = $user_data['flash_categories_visible']; $flashes = new SelectEntrys(); $flashes->cols = 'ID, section, category, type, question, likes, dislikes, opt1, opt2, opt3, opt4, opt5, opt6, opt7, opt8, opt9, opt10, opt1_votes, opt2_votes, opt3_votes, opt4_votes, opt5_votes, opt6_votes, opt7_votes, opt8_votes, opt9_votes, opt10_votes'; $flashes->table = $tbl_flashes; if ($_GET['module'] == 'flash') { $flashes->condition = "category = {$cid}"; } else { $flashes->condition = "category IN ({$cats})"; } $flashes->order = 'CreateDate DESC'; $flashes->limit = $per_page_flashes; $flashes->multiSelect = '1'; $ay_flashes = $flashes->row(); if ($ay_flashes == "") { $ay_flashes = array(); } } else {
<?php $tpl->assign("Myadmin", $Myadmin); /* LOGIN ACTION */ if (isset($login)) { include 'modules/logon/login.php'; } else { if (isset($logout)) { include 'modules/logon/logout.php'; } else { if ($logon_true == '1' && $str) { /* Get UserName */ $name = new SelectEntrys(); $name->cols = 'UserName'; $name->table = $tbl_users; $name->condition = " UserID = '{$str['1']}' "; $name->order = ''; $name->limit = "1"; $name->module = ''; $name->template = ''; $loginname = $name->row(); unset($name); /******************************************/ /* Load :: Logoutbox */ $tpl->assign('loginname', $loginname); $tpl->display("logon/logout.tpl"); /******************************************/ } else { if ($module == 'admin') { /* Load :: Loginbox */ $tpl->display("logon/login.tpl");
<?php $f_top_rated = new SelectEntrys(); $f_top_rated->cols = 'ID, question, rating'; $f_top_rated->table = $tbl_flashes; $f_top_rated->order = 'rating DESC'; if ($_GET['module'] == 'flash') { $f_top_rated->condition = "category = {$cid}"; } $f_top_rated->limit = 5; $f_top_rated->multiSelect = '1'; $ay_f_top_rated = $f_top_rated->row(); $f_top_voted = new SelectEntrys(); $f_top_voted->cols = 'ID, question, total_votes'; $f_top_voted->table = $tbl_flashes; $f_top_voted->order = 'total_votes DESC'; if ($_GET['module'] == 'flash') { $f_top_voted->condition = "category = {$cid}"; } $f_top_voted->limit = 5; $f_top_voted->multiSelect = '1'; $ay_f_top_voted = $f_top_voted->row(); $tpl->assign('ay_f_top_rated', $ay_f_top_rated); $tpl->assign('ay_f_top_voted', $ay_f_top_voted);
$already_voted->condition = " flashID = '" . $_GET['flashID'] . "' AND userID = '" . $user_data['ID'] . "' "; $already_voted = $already_voted->row(); if ($already_voted !== false) { $tpl->assign('already_voted', $already_voted[0]); } if ($user_data['fb_ID'] != 0) { foreach ($user_data['fb_friends'] as $key => $value) { foreach ($value as $key2 => $value2) { if ($key2 == 'fb_ID') { $ay_friends[] = $value2; } } } $str_friends = implode(", ", $ay_friends); /* remove those that restrict me ... if I deselect s.o. --> save my ID in his userdata */ $friends_vote = new SelectEntrys(); $friends_vote->cols = " {$tbl_users}.fb_ID, {$tbl_flash_results}.opt "; $friends_vote->table = "{$tbl_users}"; $friends_vote->join = " LEFT JOIN {$tbl_flash_results} ON ({$tbl_users}.ID = {$tbl_flash_results}.userID) "; $friends_vote->condition = " {$tbl_users}.fb_ID IN ({$str_friends}) AND {$tbl_flash_results}.flashID = '" . $_GET['flashID'] . "' "; $friends_vote->order = "{$tbl_flash_results}.opt"; $friends_vote->multiSelect = '1'; $ay_friends_vote = $friends_vote->row(); if ($ay_friends_vote !== false) { foreach ($ay_friends_vote as $key => $value) { $arr_friends_vote[$value['opt']][] = $value['fb_ID']; } } else { $arr_friends_vote = array(); } $tpl->assign('ay_friends_vote', $arr_friends_vote);
<?php if ($block["team"]["status"] == 1) { /* Print :: SELECT */ $teamlist = new SelectEntrys(); $teamlist->table = $tbl_team; $teamlist->cols = 'id, firstname, lastname'; $teamlist->condition = " visibility = '1' AND category = 'management' "; $teamlist->multiSelect = '1'; $ay_teamlist = $teamlist->row(); $teamlist->order = 'lastname'; $teamlist->condition = " visibility = '1' AND category = 'development' "; $teamlist->multiSelect = '1'; $ay_teamlist2 = $teamlist->row(); unset($teamlist); $teamlist = new SelectEntrys(); $teamlist->table = $tbl_team; $teamlist->cols = 'id, firstname, lastname'; $teamlist->order = 'position'; $teamlist->condition = " visibility = '1' AND category = 'marketing' "; $teamlist->multiSelect = '1'; $ay_teamlist3 = $teamlist->row(); //require_once('./lib/replace.php'); $_GET["cat"] = "about"; require_once './lib/tpl_dbaccess.php'; $tpl->registerResource("db", array("db_template_cms", "db_timestamp", "db_secure", "db_trusted")); //$blaaa = $tpl->fetch('db:index.tpl'); $tpl->assign("array_list", $ay_teamlist); $tpl->assign("array_list2", $ay_teamlist2); $tpl->assign("array_list3", $ay_teamlist3); $tpl->display("team/list.tpl");
<?php $products = new SelectEntrys(); $products->cols = "id_handler, name_DE, name_EN"; $products->table = $tbl_products; $products->multiSelect = '1'; $ay_products = $products->row(); $services = new SelectEntrys(); $services->cols = "id_handler, name"; $services->table = $tbl_services; $services->multiSelect = '1'; $ay_services = $services->row(); foreach ($ay_products as $new_arr) { if ($lang_active == 'DE') { $arr_products[$new_arr["id_handler"]] = $new_arr['name_DE']; } else { if ($lang_active == 'EN') { $arr_products[$new_arr["id_handler"]] = $new_arr['name_EN']; } } } foreach ($ay_services as $new_arr2) { $arr_services[$new_arr2['id_handler']] = $new_arr2['name']; } $tpl->assign("arr_products", $arr_products); $tpl->assign("arr_services", $arr_services); /* Delete :: Object SELECT */ unset($products); $tpl->display("mainframe.tpl"); /******************************************/
$b_comments->condition = "deleted = '0'"; $b_comments->limit = '5'; $b_comments->multiSelect = '1'; $array_blog_comments = $b_comments->row(); unset($b_comments); if ($array_blog_comments != "" && isset($array_blog_comments) && count($array_blog_comments) > 0) { for ($b = 0; $b < count($array_blog_comments); $b++) { $bid = $array_blog_comments[$b]['bid']; $single_array[] = $array_blog_comments[$b]['bid']; $array_comments[$b]['bid'] = $array_blog_comments[$b]['bid']; $array_comments[$b]['comment_numbers'] = $array_blog_comments[$b]['COUNT(id)']; $array_comments[$b]['comment_time'] = convert_date_comments($array_blog_comments[$b]['MAXtime']); $array_comments[$b]['comment_time'] = substr($array_comments[$b]['comment_time'], 0, strlen($array_comments[$b]['comment_time']) - 8); } $string_bids = implode(",", $single_array); $b_title = new SelectEntrys(); $b_title->cols = 'id, title_DE, title_EN, date'; $b_title->table = $tbl_blog; $b_title->condition = "id IN ({$string_bids})"; $b_title->multiSelect = '1'; $array_b_titles = $b_title->row(); for ($b = 0; $b < count($array_b_titles); $b++) { $date = $array_b_titles[$b]['date']; $get_page = new CheckExist(); $get_page->tableE = $tbl_blog; $get_page->conditionE = " date > '{$date}' "; $_page = $get_page->exist(); unset($get_page); $bid = $array_b_titles[$b]['id']; $final_page = floor($_page / $set[0]['perpage_blog']) + 1; $array_b[$bid]['title_DE'] = $array_b_titles[$b]['title_DE'];