function get_tree_array(&$data, $parentId = 0)
{
    $category = array();
    foreach ($data as $key => $value) {
        if ($value['pid'] == $parentId) {
            unset($data[$key]);
            $value['child'] = category($data, $value['id']);
            $category[] = $value;
        }
    }
    return $category;
}
function form_mercado_pago()
{
    if (get_option('mercadopago_url_sucess') != '') {
        $url_sucess = get_option('mercadopago_url_sucess');
    } else {
        $url_sucess = get_site_url();
    }
    if (get_option('mercadopago_url_pending') != '') {
        $url_pending = get_option('mercadopago_url_pending');
    } else {
        $url_pending = get_site_url();
    }
    $output = '<br /><tr><td>';
    $output .= 'Client Id</td>';
    $output .= '<td><input name="mercadopago_client_id" type="text" value="' . get_option('mercadopago_client_id') . '"/></td></tr>';
    $output .= '<tr><td>Client Secret</td>';
    $output .= '<td><input name="mercadopago_client_secret" type="text" value="' . get_option('mercadopago_client_secret') . '"/></td></tr>';
    $output .= '<tr><td></td><td><small>To get fields above, follow: 
		<a href="https://www.mercadopago.com/mla/herramientas/aplicaciones" target="_blank">Argentina</a> or
		<a href="https://www.mercadopago.com/mlb/ferramentas/aplicacoes" target="_blank">Brasil</a> or <a href="https://www.mercadopago.com/mlm/herramientas/aplicaciones" target="_blank">Mexico</a> or <a href="https://www.mercadopago.com/mlv/herramientas/aplicaciones" target="_blank">Venezuela</a> <br /><br /></small></td></tr>';
    $output .= '<tr><td>Store Category</td>';
    $output .= '<td>' . category() . '</td></tr>';
    $output .= '<tr><td>Type Checkout</td>';
    $output .= '<td>' . type_checkout() . '</td></tr>';
    $output .= '<tr><td>Sandbox</td>';
    $output .= '<td>' . sandbox() . '</td></tr>';
    $output .= '<tr><td>Url Sucess Payment</td>';
    $output .= '<td><input name="mercadopago_url_sucess" type="text" value="' . $url_sucess . '"/></td></tr>';
    $output .= '<tr><td>Url Peding Payment</td>';
    $output .= '<td><input name="mercadopago_url_pending" type="text" value="' . $url_pending . '"/></td></tr>';
    $output .= '<tr><td></td><td><small>This is just the url where the custumer is redirect after his payment is done, you can set in both fields above any url of your site, but needs to be a <b>valid URL.</b>.<br /><br /> Please set your <b>instant payment notification</b> to receive your automatic order status changes at: 
		<a href="https://www.mercadopago.com/mla/herramientas/notificaciones" target="_blank">Argentina</a> or
		<a href="https://www.mercadopago.com/mlb/ferramentas/notificacoes" target="_blank">Brasil</a> or <a href="https://www.mercadopago.com/mlm/herramientas/notificaciones" target="_blank">Mexico</a> or <a href="https://www.mercadopago.com/mlv/herramientas/notificaciones" target="_blank">Venezuela</a><br />
		Set your url follwing this exemple: http://yourstore.com</b></small></td></tr>';
    $output .= '<tr><td>Store Country</td>';
    $output .= '<td>' . country() . '</td></tr>';
    $output .= '<tr><td>Currency</td>';
    $output .= '<td>' . currency() . '</td></tr>';
    $output .= '<tr><td></td><td><small>Select Real to Brasil, or Pesos or Dollar to Argentina</small></td></tr>';
    $output .= '<tr><td>Excluded methods</td>';
    $output .= '<td>' . methods(get_option('mercadopago_country')) . '</td></tr>';
    $output .= '<tr><td></td><td><small>SELECT only the methods that you <b>DO NOT</b>want to accept by MercadoPago<br />
		<br /><b>Attention: </b> Payment methods depends on what country your account was created, if you change the country,<b> save the module first</b> and just after that select the Exclude Payment Methods!
		<br /><br /><b>DO NOT</b> exclude All methods<br /><br /></small></td></tr>';
    $output .= '<tr><td>Limit Payments</td>';
    $output .= '<td>' . instalments() . '</td></tr>';
    $output .= '<tr><td></td><td><small>This option allow you to limit the maximum number of instalments of MercadoPago</small></td></tr>';
    $output .= '<tr><td>Debug mode</td>';
    $output .= '<td>' . debugs() . '</td></tr>';
    $output .= '<tr><td></td><td><small>Turn debug mode on to see erro log with your getting error on checkout</small></td></tr>';
    return $output;
}
function apply()
{
    global $cart;
    global $rawSequence;
    global $discount;
    global $couponExclude;
    $coupons = array_values(array_merge($cart['coupons']['pre'], $cart['coupons']['post']));
    for ($j = 0; $j < count($rawSequence); $j++) {
        for ($i = 0; $i < count($coupons); $i++) {
            if ($coupons[$i]['raw_type'] != $rawSequence[$j]) {
                continue;
            }
            switch ($coupons[$i]['type']) {
                case $discount['STORE_WIDE']:
                    store($cart, json_decode($coupons[$i]['params'], true), $coupons[$i]['raw_type'], $discount['STORE_WIDE']);
                    break;
                case $discount['CATEGORY_WIDE']:
                    category($cart, json_decode($coupons[$i]['params'], true), $discount['CATEGORY_WIDE']);
                    break;
                case $discount['BOGO']:
                    bogo($cart, json_decode($coupons[$i]['params'], true), $discount['BOGO'] | $discount['CATEGORY_WIDE']);
                    break;
                case $discount['GROUP_WISE']:
                    break;
                default:
            }
            array_splice($coupons, $i, 1);
            $exclude = $couponExclude[$rawSequence[$j]];
            for ($k = 0; $k < count($exclude); $k++) {
                for ($l = 0; $l < count($coupons); $l++) {
                    if ($coupons[$l]['raw_type'] != $exclude[$k]) {
                        continue;
                    }
                    array_splice($coupons, $i, 1);
                    $l--;
                }
            }
            $i = -1;
        }
    }
    return $cart;
}
echo isset($_POST['siteUrl']) ? $_POST['siteUrl'] : '';
?>
" placeholder="http://www.domain.com" required>
    </div>
	<div class="form-group">
		<label for="siteDescription">Site Description</label>
		<textarea id="siteDescription" name="siteDescription" maxlength="255" class="form-control" rows="5" required><?php 
echo isset($_POST['siteUrl']) ? $_POST['siteUrl'] : '';
?>
 </textarea>
        <div class="pull-right" id="textarea_feedback"></div>
	</div>
	<label for="disabledInput">Category</label>
	<fieldset disabled>
	    <input type="text" name="category" id="category" class="form-control" value='<?php 
echo categoryName(category());
?>
' required><br>
		<div class="alert alert-info">Navigate to your chosen category to submit your site</div>
	</fieldset>
    <div class="form-group text-center">
        <?php 
if (isset($warning)) {
    echo $warning;
}
?>
        <center><img id="captcha" src="securimage/securimage_show.php" alt="CAPTCHA Image" /></center><br>
        <input type="text" class="form-control" id="captcha_code" name="captcha_code" placeholder="Enter Captcha Code Here" size="10" maxlength="6" /><br>
        <a href="#" style="color:#3a87ad" class="alert alert-info btn-block" onclick="document.getElementById('captcha').src = 'securimage/securimage_show.php?' + Math.random(); return false">[ Different Image ]</a>
    </div>
<br>
Exemple #5
0
    $src .= "<br><center><a href=\"index.php?page=video_page&action=new\"><font color=steelblue><b>" . $language['VID_NEW'] . "</b></a></font></center><br>";
    for ($i = 0; $i < category(count); $i++) {
        $c = 0;
        $src .= "<center><span style=\"font-size:20pt;line-height:100%\">" . category(cat_not_eng, $i) . "</span></center><br>";
        $query2 = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM {$TABLE_PREFIX}videos where category='" . category(cat_eng, $i) . "' ORDER BY `number` DESC");
        $src .= "<center><table border=\"1\"><tr>";
        if ($query2) {
            while ($elementi = mysqli_fetch_object($query2)) {
                $c++;
                $z = $c - 1;
                if ($z % 6 == 0) {
                    $src .= "</tr>";
                }
                $imgarray = array("1", "2", "3", "default");
                $img = $imgarray[rand(0, count($imgarray) - 1)];
                $src .= "<td><center>" . substr($elementi->title, 0, 22) . "...</center><br><center><a href=\"index.php?page=video_page&id=" . $elementi->id . "\"><img title=\"{$elementi->title} (" . category(cat_not_eng, $i) . ")\" alt=\"{$elementi->title} (" . category(cat_not_eng, $i) . ")\" border=\"0\" src=\"https://img.youtube.com/vi/" . $elementi->id . "/" . $img . ".jpg\"></a><center><br></td>";
            }
        }
        if ($z % 6 == 0) {
            $src .= "<tr>";
        }
        $src .= "</tr></table></center>";
        if (!$c) {
            $src .= "<center><font color = red>" . $language['VID_EMPTY'] . "</font></center>";
        }
        $src .= "<hr>";
    }
}
$video_pagetpl = new bTemplate();
$video_pagetpl->set("language", $language);
$video_pagetpl->set("src", $src);
 function block_show($bid)
 {
     global $prefix, $db;
     include "header.php";
     GraphicAdmin();
     title("" . _BLOCKSADMIN . "");
     OpenTable2();
     $bid = intval($bid);
     $row = $db->sql_fetchrow($db->sql_query("select bid, bkey, title, content, url, bposition, blockfile from " . $prefix . "_blocks where bid='{$bid}'"));
     $bid = intval($row['bid']);
     $bkey = $row['bkey'];
     $title = $row['title'];
     $content = $row['content'];
     $url = $row['url'];
     $bposition = $row['bposition'];
     $blockfile = $row['blockfile'];
     if ($bkey == main) {
         mainblock();
     } elseif ($bkey == admin) {
         adminblock();
     } elseif ($bkey == modules) {
         modules_block();
     } elseif ($bkey == category) {
         category();
     } elseif ($bkey == userbox) {
         userblock();
     } elseif ($bkey == "") {
         if ($url == "") {
             if ($blockfile == "") {
                 if ($bposition == "c") {
                     themecenterbox($title, $content);
                 } else {
                     themesidebox($title, $content);
                 }
             } else {
                 if ($bposition == "c") {
                     blockfileinc($title, $blockfile, 1);
                 } else {
                     blockfileinc($title, $blockfile);
                 }
             }
         } else {
             headlines($bid);
         }
     }
     CloseTable2();
     echo "<br>";
     OpenTable();
     echo "<center><font class=\"option\"><b>" . _BLOCKSADMIN . ": " . _FUNCTIONS . "</b></font><br><br>" . "[ <a href=\"admin.php?op=ChangeStatus&bid={$bid}\">" . _ACTIVATE . "</a> | <a href=\"admin.php?op=BlocksEdit&bid={$bid}\">" . _EDIT . "</a> | ";
     if ($bkey == "") {
         echo "<a href=\"admin.php?op=BlocksDelete&bid={$bid}\">" . _DELETE . "</a> | ";
     } else {
         echo "" . _DELETE . " | ";
     }
     echo "<a href=\"admin.php?op=BlocksAdmin\">" . _BLOCKSADMIN . "</a> ]</center>";
     CloseTable();
     include "footer.php";
 }
                console.log(re);
            }
        });
        $filebox.val('');
    }
    function get_markup_icon( id, url ) {
        return "<img width='100%' fid='"+id+"' src='"+url+"'><span class='button delete-uploaded-file'>삭제</span>";
    }
</script>


<?php 
$location = new model\philocation\PhiLocation();
//print_r($location->eng_to_ko);
//print_r($location->ko_to_eng);
$cats = category()->search(['order_by' => 'code ASC', 'limit' => 9999, 'return' => 'array']);
function val($k)
{
    global $company;
    if (!$company) {
        return null;
    }
    return $company->get($k);
}
?>
<style>
    form.company-edit input {
        display:block;
    }
</style>
<form class="company-edit">
function parent()
{
    global $conn;
    $query = "SELECT parent_cat, cat_name FROM Categories WHERE cat_id = ?";
    $stm = $conn->prepare($query);
    $stm->execute(array(category()));
    $par_cat = $stm->fetch();
    return "<li class='active'><a href='category.php?cat=" . $par_cat['parent_cat'] . "'>" . $par_cat['cat_name'] . "</a></li>";
}
<?php

ini_set('max_execution_time', 2000);
require_once '../../../wp-load.php';
global $wpdb;
$feed_url = get_option('helios_feed_url');
if (!empty($feed_url)) {
    $stream = file_get_contents(get_option('helios_feed_url'));
    $stream = preg_replace("/<([a-z][a-z0-9]*)[^>]*?(\\/?)>/i", '<$1$2>', $stream);
    $x = toArray($stream);
    foreach ($x['Row'] as $entry) {
        $entry = $entry['Column'];
        $overview = formatText($entry[3]) != '' ? '<h3 class="heading overview">Overview:</h3>' : '';
        $responsibilities = formatText($entry[4]) != '' ? '<h3 class="heading responsibilities">Responsibilities:</h3>' : '';
        $qualifications = formatText($entry[5]) != '' ? '<h3 class="heading qualifications">Qualifications:</h3>' : '';
        $wpdb->insert($wpdb->prefix . HELIOS_TABLE, array('title' => $entry[0], 'location' => !empty($entry[1]) ? $entry[1] . ', ' . $entry[2] : '', 'description' => $overview . formatText($entry[3]) . $responsibilities . formatText($entry[4]) . $qualifications . formatText($entry[5]), 'category' => category($entry[6]), 'pubDate' => date("Y-m-d H:i:s", strtotime($entry[7])), 'locationCountry' => '', 'locationState' => !empty($entry[2]) ? $entry[2] : '', 'locationCity' => !empty($entry[1]) ? $entry[1] : '', 'reqId' => $entry[8], 'publishedStatus' => 'Y'));
    }
    echo '[{"msg":"Sync was successful."}]';
} else {
    echo '[{"msg":"An error occurred."}]';
}
function formatText($string)
{
    $string = str_replace('<h1>', '<p><strong>', $string);
    $string = str_replace('<h2>', '<p><strong>', $string);
    $string = str_replace('<h3>', '<p><strong>', $string);
    $string = str_replace('<h4>', '<p><strong>', $string);
    $string = str_replace('<h5>', '<p><strong>', $string);
    $string = str_replace('<h6>', '<p><strong>', $string);
    $string = str_replace('</h1>', '</strong></p>', $string);
    $string = str_replace('</h2>', '</strong></p>', $string);
         	<div class="col-md-3">
 <div class="dropdown">
 <button class="btn btn-danger dropdown-toggle change-drop" type="button" data-toggle="dropdown">Catatories
 <span class="caret"></span></button>
 <ul class="dropdown-menu">
  <?php 
category();
?>

    
  </ul>
</div>
</div>
<div class="col-md-9">
	
<!---slider start-->

<div id="carousel-example-generic" class="carousel slide change-slide" data-ride="carousel">
  <!-- Indicators -->
  <ol class="carousel-indicators">
    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
    <li data-target="#carousel-example-generic" data-slide-to="1"></li>
    <li data-target="#carousel-example-generic" data-slide-to="2"></li>
  </ol>

  <!-- Wrapper for slides -->
  <div class="carousel-inner" role="listbox">

    <div class="item active">
       <img src="images/iphone6.jpg" alt="Sorry not found">
      <div class="carousel-caption">
Exemple #11
0
 private function setPhilgoCategory($old_category, $new_category)
 {
     $c = category($new_category);
     if (empty($c)) {
         die("\nERROR: THIS ERROR MUST BE FIXED.\nNo category : {$new_category}");
     }
     $category_id = $c->getID();
     $companies = $this->loadQuery("category == 0 AND source='philgo' AND etc='{$old_category}'");
     if ($companies) {
         foreach ($companies as $com) {
             $com->put('category', $category_id);
         }
     }
 }
Exemple #12
0
 $status = "";
 $list = "";
 // Trim subject
 $subject = substru(trim(htmlspecialchars($row['subject'], ENT_QUOTES, 'UTF-8')), 0, $config['max_length']) . "&#8230;";
 // Build topic url
 $topic_url = "{$config['url_path']}/read.php?id={$row['id']}";
 // Topic starter data
 $topic_author = user_data($row['starter_id']);
 // Topic status
 if ($row['closed']) {
     $status = 'closed, ';
 }
 if ($row['sticky']) {
     $status .= 'sticky';
 }
 $categories = category();
 // Create the delete list
 foreach ($categories as $acat) {
     if ($acat['id'] == $row['category']) {
         continue;
     }
     if ($page) {
         $apage = "&page={$page}";
     }
     $list .= "<a href='{$config['url_path']}/admin.php?a=topics&update={$row['id']}&cat={$acat['id']}{$apage}'>{$acat['name']}</a>";
     if (end($categories) != $acat) {
         $list .= ", ";
     }
 }
 if (substr($list, -2) == ", ") {
     $list = substr($list, 0, -2);
Exemple #13
0
<?php

require_once '../config.php';
require_once '../functions.php';
// HEADER
include 'inc/header.php';
// INDEX_BOX
$index_box = file_get_contents('../templates/' . $path . '/index_box.php');
$categoriesObj = json_decode(file_get_contents('data/categories.json'));
$forumsObj = json_decode(file_get_contents('data/forums.json'));
$forumsArr;
$index_box = preg_replace_callback('/<\\!\\-\\-\\sBEGIN\\scatrow\\s\\-\\->([\\s\\S]+)<\\!\\-\\-\\sEND\\scatrow\\s\\-\\->/', function ($arg) {
    global $categoriesObj, $forumsArr;
    $catrow = $arg[1];
    $txt = '';
    foreach ($categoriesObj as $key => $value) {
        $forumsArr = $value->{'forums'};
        $row = str_replace('{catrow.tablehead.L_FORUM}', $value->{'name'}, $catrow);
        $row = preg_replace_callback('/<\\!\\-\\-\\sBEGIN\\sforumrow\\s\\-\\->([\\s\\S]+)<\\!\\-\\-\\sEND\\sforumrow\\s\\-\\->/', function ($ar) {
            global $forumsArr;
            $forumrow = $ar[1];
            return category($forumrow, $forumsArr);
        }, $row);
        $txt .= $row;
    }
    return $txt;
}, $index_box);
echo $index_box;
// FOOTER
include 'inc/footer.php';
Exemple #14
0
 function block_show($bid)
 {
     global $prefix, $db, $admin_file;
     include "header.php";
     GraphicAdmin();
     title("" . _BLOCKSADMIN . "");
     OpenTable();
     echo "<br><center>";
     $bid = intval($bid);
     $row = $db->sql_fetchrow($db->sql_query("select bid, bkey, title, content, url, active, bposition, blockfile from " . $prefix . "_blocks where bid='{$bid}'"));
     $bid = intval($row['bid']);
     $bkey = filter($row['bkey'], "nohtml");
     $title = filter($row['title'], "nohtml");
     $content = filter($row['content']);
     $url = filter($row['url'], "nohtml");
     $active = intval($row['active']);
     $bposition = filter($row['bposition'], "nohtml");
     $blockfile = filter($row['blockfile'], "nohtml");
     if ($bkey == "main") {
         mainblock();
     } elseif ($bkey == "admin") {
         adminblock();
     } elseif ($bkey == "modules") {
         modules_block();
     } elseif ($bkey == "category") {
         category();
     } elseif ($bkey == "userbox") {
         userblock();
     } elseif (empty($bkey)) {
         if (empty($url)) {
             if (empty($blockfile)) {
                 if ($bposition == "c") {
                     themecenterbox($title, $content);
                 } else {
                     themesidebox($title, $content);
                 }
             } else {
                 if ($bposition == "c") {
                     blockfileinc($title, $blockfile, 1);
                 } else {
                     blockfileinc($title, $blockfile);
                 }
             }
         } else {
             headlines($bid);
         }
     }
     echo "</center>";
     CloseTable();
     echo "<br>";
     OpenTable();
     if ($active == 1) {
         $act_chg = _DEACTIVATE;
     } elseif ($active == 0) {
         $act_chg = _ACTIVATE;
     }
     echo "<center><font class=\"option\"><b>" . _BLOCKSADMIN . ": " . _FUNCTIONS . "</b></font><br><br>" . "[ <a href=\"" . $admin_file . ".php?op=ChangeStatus&bid={$bid}\">{$act_chg}</a> | <a href=\"" . $admin_file . ".php?op=BlocksEdit&bid={$bid}\">" . _EDIT . "</a> | ";
     if (empty($bkey)) {
         echo "<a href=\"" . $admin_file . ".php?op=BlocksDelete&bid={$bid}\">" . _DELETE . "</a> | ";
     } else {
         echo "" . _DELETE . " | ";
     }
     echo "<a href=\"" . $admin_file . ".php?op=BlocksAdmin\">" . _BLOCKSADMIN . "</a> ]</center>";
     CloseTable();
     include "footer.php";
 }
Exemple #15
0
 public function categoryDelete()
 {
     $id = hi('id');
     if (empty($id)) {
         return ERROR(-457, 'Input category id');
     }
     $c = category()->load($id);
     if (empty($c)) {
         return ERROR(-458, "Category by that id - {$id} does not exists.");
     }
     category()->load($id)->delete();
     return SUCCESS();
 }
Exemple #16
0
    function edytor()
    {
        ob_end_clean();
        echo '
			<!DOCTYPE html>
			<html>
			<head>
			<title>Edytowanie</title>
			<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
			<link rel="stylesheet" type="text/css" href="style.css" />
			<link rel="stylesheet" type="text/css" href="css/apigui.css" />
			<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
			<style type="text/css">
			* {
			margin:0;
			}
			html,body {
				width:auto;
				min-width:0;
				overflow:hidden;
			}
			body {
				background:#60d4ff;
			}
			#header {
				padding-top:5px;
				background:#FFF;
				box-shadow:0px 0px 5px #CCC;
			}
			#content {
				color:#FFF;
				margin:0;
			}
			#image {
				position:absolute;
				z-index:-2;
				opacity:0.05;
				width:100%;
			}
			td, th {
				padding:3px;
				font-size:16px;
				text-shadow:1px 1px 0px #4190ad;
				color:#FFF;
			}
			th { font-weight:bold; font-size:16px !important; font-family:Arial; }
			td input {
				font-size:16px !important;
			}
			#save {
				position:absolute;
				bottom:0;
				left:0;
				background:#fafafa;
				padding:20px;
				width:100%;
			}
			.notify_div, #notify {
				width:360px !important;
				text-align:center;
				color:#2c2c2c;
				text-shadow:#fffc7d;
			}
			#notify {
				background:#fffec4;
				border-color:#fffc80;
				margin-left:-180px;
			}
			</style>
			</head>
			<body>
			<div id="apigui">
			';
        $query = mysql_query("SELECT * FROM `tentego_img` WHERE `id`=" . $_GET['id']);
        if (mysql_num_rows($query)) {
            if (isset($_POST['save'])) {
                if (mysql_query("UPDATE `tentego_img` SET `title`='" . htmlspecialchars($_POST['title'], ENT_QUOTES) . "', `cat`='" . $_POST['cat'] . "', `date`='" . $_POST['date'] . "', `src`='" . $_POST['src'] . "', `type`='" . $_POST['type'] . "', `source`='" . htmlspecialchars($_POST['source'], ENT_QUOTES) . "' WHERE `id`=" . $_GET['id'])) {
                    $query = mysql_query("SELECT * FROM `tentego_img` WHERE `id`=" . $_GET['id']);
                    kernel::make_notify("Zapisano.");
                } else {
                    kernel::make_notify("Bład podczas zapisu.");
                }
            }
            $img = mysql_fetch_array($query);
            $date = new DateTime($img['date']);
            function type($pattern, $array)
            {
                $type = array('Obrazek' => 'img', 'YouTube.com' => 'youtube', 'Vimeo' => 'vimeo');
                $return = NULL;
                foreach ($type as $name => $value) {
                    $text = str_replace("#NAME#", $name, $pattern);
                    if ($array['type'] == $value) {
                        $text = str_replace("#SELECTED#", ' selected="selected"', $text);
                    } else {
                        $text = str_replace("#SELECTED#", NULL, $text);
                    }
                    $text = str_replace("#TYPE#", $value, $text);
                    $return .= $text;
                }
                return $return;
            }
            function category($pattern, $value)
            {
                $return = NULL;
                $query = mysql_query("SELECT * FROM `tentego_img_cat`");
                while ($cat = mysql_fetch_array($query)) {
                    $text = str_replace("#NAME#", $cat['name'], $pattern);
                    if ($cat['id'] == $value) {
                        $text = str_replace("#SELECTED#", ' selected="selected"', $text);
                    } else {
                        $text = str_replace("#SELECTED#", NULL, $text);
                    }
                    $text = str_replace("#TYPE#", $cat['id'], $text);
                    $return .= $text;
                }
                return $return;
            }
            switch ($img['type']) {
                case 'img':
                    $thumb = '?go=manager&feature=thumb&img=../' . $this->img . '/' . $img['src'];
                    break;
                case 'youtube':
                    parse_str(parse_url($img['src'], PHP_URL_QUERY), $src);
                    $thumb = 'http://i1.ytimg.com/vi/' . $src['v'] . '/hqdefault.jpg';
                    break;
                case 'vimeo':
                    $url = parse_url($img['src'], PHP_URL_PATH);
                    $xml = simplexml_load_file("http://vimeo.com/api/v2/video" . $url . ".xml");
                    $thumb = $xml->video->thumbnail_large;
                    break;
            }
            echo '<form method="post" action="?go=manager&amp;feature=edit&amp;id=' . $img['id'] . '">';
            echo '
					<div id="content">
						<div style="width:100%; height:170px; background:url(' . $thumb . ') no-repeat center"></div>
						<table>
						<tr>
							<th>Tytuł:</th>
							<td><input type="text" name="title" value="' . $img['title'] . '" /></td>
						</tr>
						<tr>
							<th>Data:</th>
							<td><input type="text" name="date" value="' . $date->format('Y-m-d H:i:s') . '" /></td>
						</tr>
						<tr>
							<th>Adres:</th>
							<td><input type="text" name="src" value="' . $img['src'] . '" /></td>
						</tr>
						<tr>
							<th>Kategoria:</th>
							<td>
								<select name="cat">
								' . category('<option value="#TYPE#"#SELECTED#>#NAME#</option>', $img['cat']) . '
								</select>
							</td>
						</tr>
						<tr>
							<th>Typ:</th>
							<td>
								<select name="type">
								' . type('<option value="#TYPE#"#SELECTED#>#NAME#</option>', $img) . '
								</select>
							</td>
						</tr>
						<tr>
							<th>Źródło:</th>
							<td><input type="text" name="source" value="' . $img['source'] . '" /></td>
						</tr>
						</table>
						<div id="save"><input type="submit" name="save" value="Zapisz zmiany" /></div>
					</div>
				';
            echo '</form>';
        }
        echo '
			</div>
			<div id="notify"></div>
			</body>
			</html>
			';
        if (kernel::get_notify(NULL, 1) > 0) {
            echo '<script type="text/javascript">
					$(document).ready(function(){
						$("#notify").show().html(\'';
            echo kernel::get_notify(NULL, 0, "<div class=\"notify_div\">#CONTENT#</div>");
            echo '\').animate({"top":"-15px"}, 500);
					setTimeout(function(){ $("#notify").fadeOut() }, 30000);
					$("#notify").click(function() { $(this).fadeOut(); });
					});
					</script>';
        }
        kernel::destroy_notify();
        exit;
    }
Exemple #17
0
        render_submenu();
        last10($objDb, true);
        break;
    case 2:
        // Search
        render_submenu();
        render_search();
        if (isset($_GET["keywords"]) && trim($_GET["keywords"]) != "") {
            search($objDb, $_GET["keywords"]);
        }
        break;
    case 3:
        // Category
        render_submenu();
        render_category($objDb);
        if (isset($_GET["category"])) {
            category($objDb, $_GET["category"]);
        } else {
            category($objDb, 0);
        }
        break;
    case 4:
        // Timeline
        // Show a line with graphs indicating amount of data on a date, normalize it by the most found amount
        render_timeline($objDb);
        break;
}
?>
	</body>
</html>
Exemple #18
0
/**
 * Allows updating of topics, stuck or closed, and posts
 * @global array
 * @global array
 * @global resource
 * @param integer $id post we are editing
 * @param string $topic post subject
 * @param string $content post content
 * @param integer $reply id of topic we are replying to
 * @param boolean $sticky are we sticking it to the top?
 * @param boolean $closed are we closing it?
 * @return string|int
 */
function update($id, $category, $topic, $content, $sticky = false, $closed = false)
{
    global $config, $user_data, $database;
    // The time. milliseconds / seconds may change.
    $time = time();
    // Is the id numeric?
    if (!alpha($id, 'numeric')) {
        return lang_parse('error_given_not_numeric', array(lang('post') . " " . lang('id')));
    }
    // Grab the data for the update.
    $post_data = topic($id);
    // Check to see if the post or topic was found.
    if (!$post_data) {
        return lang('error_post_missing');
    }
    // Pre-Parse
    $topic = strip_repeat($topic);
    // Can't update a replies category!
    if ($post_data['reply']) {
        $category = $post_data['category'];
    }
    // Check validity of category as numeric
    if (!alpha($category, 'numeric')) {
        return lang('error_invalid_category');
    }
    // Check to see if category exists
    $category = category($category);
    if (!$category) {
        return lang('error_invalid_category');
    }
    // Check category settings against user
    if (!$user_data['admin']) {
        if ($category['aop'] && $post_data['reply']) {
            if (!$user_data['admin'] || !$user_data['moderator']) {
                return lang('error_invalid_category');
            }
        }
        if ($category['aot'] && !$post_data['reply']) {
            if ($user_data['id'] != $category['aot']) {
                return lang('error_invalid_category');
            }
        }
    }
    // Is the user currently logged in? If not we can't update return error.
    if ($_SESSION['logged_in']) {
        // Editing a topic not post
        if ($post_data['reply'] == 0) {
            // Is there a topic?
            if ($topic == "") {
                return lang_parse('error_no_given', array(lang('username')));
            }
        } else {
            // If there was no topic put re: on it.
            if ($topic == "") {
                $topic = "re:";
            }
        }
        // Is the subject valid?
        if (!alpha($topic, 'alpha-extra')) {
            return lang_parse('error_invalid_chars', array(lang('subject')));
        }
        // Did they give us any content to work with?
        if ($content != "") {
            if (!is_string(length($content, $config['message_minimum_length'], $config['message_max_length']))) {
                // Check to see if the user is an admin and able to sticky / close the topic
                if ($_SESSION['admin'] || $_SESSION['moderator']) {
                    // Sticky
                    $sticky = $sticky ? '1' : '0';
                    // Closed
                    $closed = $closed ? '1' : '0';
                    // Admin functions
                    update_field($id, 'sticky', $sticky);
                    update_field($id, 'closed', $closed);
                }
                // Parsing
                $topic = $database->escape($topic);
                $content = $database->escape($content);
                // Update the post already inside of the database with the new data
                $result = $database->query("UPDATE `forum` SET `category`='{$category['id']}', `subject`='{$topic}', `message`='{$content}', `updated`='{$time}', `replies`='{$replies}' WHERE id = '{$id}'") or die(mysql_error());
                // Did it work?
                if ($result) {
                    // Update replies with category
                    if ($category != $post_data['category'] && !$post_data['reply']) {
                        $database->query("UPDATE `forum` SET `category`='{$category['id']}' WHERE `reply` = {$id}");
                    }
                    return true;
                } else {
                    return false;
                }
            } else {
                return lang_parse('error_message_length', array($config['message_max_length'], $config['message_minimum_length']));
            }
        } else {
            return lang_parse('error_no_given', array(lang('message')));
        }
    } else {
        return lang('error_not_logged');
    }
}
Exemple #19
0
        }
    } else {
        $reply = 0;
        // New topic
        $title = lang('posting_new_topic');
    }
}
// Clean the subject
if (isset($_POST['subject'])) {
    $subject = field_clean($_POST['subject']);
}
// Get the category from the url
if (isset($_GET['category'])) {
    if (alpha($_GET['category'], 'numeric') && category($_GET['category'])) {
        $current_category = $_GET['category'];
        $category_data = category($_GET['category']);
    } else {
        $current_category = 0;
    }
} else {
    $current_category = 0;
}
// Forum navigation
include $config['template_path'] . "navigation.php";
?>

<?php 
if ($preview) {
    include $config['template_path'] . "forum/preview.php";
}
?>
Exemple #20
0
function pixopoint_menu($pixo_which = 1)
{
    echo '
<!-- Multi-level Navigational Plugin by PixoPoint Web Development ... http://pixopoint.com/multi-level-navigation/ -->
';
    // Checks to see if theme CSS should be used and serves different HTML if isn't - so that theme CSS won't mess up plugin CSS
    if (get_option('suckerfish_generator') == 'Theme CSS') {
        echo '
<div id="menu_wrapper' . $pixo_which . '">
	<div id="menu' . $pixo_which . '">
';
    } else {
        echo '
<div id="pixopoint_menu_wrapper' . $pixo_which . '">
	<div id="pixopoint_menu' . $pixo_which . '">
';
    }
    if (get_option('suckerfish_titletags') == 'on') {
        ob_start();
    }
    // Main menu option
    if ($pixo_which == '1') {
        ?>
		<ul class="sf-menu" id="suckerfishnav"><?php 
        global $suckerfish_menuitem;
        foreach ($suckerfish_menuitem as $key => $menuitem) {
            switch ($menuitem) {
                case "Pages":
                    pages();
                    break;
                case "Pages (single dropdown)":
                    pagesdropdown();
                    break;
                case "Categories":
                    category();
                    break;
                case "Categories (single dropdown)":
                    categoriesdropdown();
                    break;
                case "Home":
                    home();
                    break;
                case "Links - no categories":
                    blogroll();
                    break;
                case "Links - no categories (single dropdown)":
                    blogrolldropdown();
                    break;
                case "Links - with categories":
                    blogrollcategories();
                    break;
                case "Links - with categories (single dropdown)":
                    blogrollcategoriesdropdown();
                    break;
                case "Archives - months":
                    archivesmonths();
                    break;
                case "Archives - years":
                    archivesyears();
                    break;
                case "Archives - months (single dropdown)":
                    archivesmonthsdropdown();
                    break;
                case "Archives - years (single dropdown)":
                    archivesyearsdropdown();
                    break;
                case "Recent Comments (single dropdown)":
                    recentcomments();
                    break;
                case "Custom 1":
                    custom();
                    break;
                case "Custom 2":
                    custom2();
                    break;
                case "Custom 3":
                    custom3();
                    break;
                case "Custom 4":
                    custom4();
                    break;
                case "Recent Posts (single dropdown)":
                    recentposts();
                    break;
            }
        }
    }
    // Second menu option
    if ($pixo_which == '2') {
        ?>
		<ul class="sf-menu" id="suckerfishnav_2"><?php 
        global $suckerfish_2_menuitem;
        foreach ($suckerfish_2_menuitem as $key => $menuitem) {
            switch ($menuitem) {
                case "Pages":
                    pages();
                    break;
                case "Pages (single dropdown)":
                    pagesdropdown();
                    break;
                case "Categories":
                    category();
                    break;
                case "Categories (single dropdown)":
                    categoriesdropdown();
                    break;
                case "Home":
                    home();
                    break;
                case "Links - no categories":
                    blogroll();
                    break;
                case "Links - no categories (single dropdown)":
                    blogrolldropdown();
                    break;
                case "Links - with categories":
                    blogrollcategories();
                    break;
                case "Links - with categories (single dropdown)":
                    blogrollcategoriesdropdown();
                    break;
                case "Archives - months":
                    archivesmonths();
                    break;
                case "Archives - years":
                    archivesyears();
                    break;
                case "Archives - months (single dropdown)":
                    archivesmonthsdropdown();
                    break;
                case "Archives - years (single dropdown)":
                    archivesyearsdropdown();
                    break;
                case "Recent Comments (single dropdown)":
                    recentcomments();
                    break;
                case "Custom 1":
                    custom();
                    break;
                case "Custom 2":
                    custom2();
                    break;
                case "Custom 3":
                    custom3();
                    break;
                case "Custom 4":
                    custom4();
                    break;
                case "Recent Posts (single dropdown)":
                    recentposts();
                    break;
            }
        }
    }
    if (get_option('suckerfish_titletags') == 'on') {
        $pixo_menucontents = ob_get_contents();
        ob_end_clean();
        $pixo_menucontents = preg_replace('/title=\\"(.*?)\\"/', '', $pixo_menucontents);
        $pixo_menucontents = preg_replace('/title=\'(.*?)\'/', '', $pixo_menucontents);
        echo $pixo_menucontents;
    }
    ?>
</ul>
	</div>
</div>
<?php 
}
Exemple #21
0
/**
 * Updates categories data
 * @global resource
 * @param $id category id
 * @param $key category sql key
 * @param $value category sql key value
 * @return boolean
 */
function delete_category($id, $method)
{
    global $database;
    // Check the id
    if (!alpha($id, 'numeric')) {
        return 'INVALID_ID';
    }
    if (!$method) {
        return 'INVALID_METHOD';
    }
    // Update
    $result = $database->query("DELETE FROM `categories` WHERE `id`='{$id}'");
    if ($result) {
        if ($method == 'all') {
            // Delete all posts in this category
            $result = $database->query("DELETE FROM `forum` WHERE `category`='{$id}'");
            if ($result) {
                return "DELETED_POSTS";
            } else {
                return "DELETING_POSTS";
            }
        }
        if (alpha($method, 'numeric') && $method != 0) {
            if (!category($method)) {
                return 'INVALID_CATEGORY';
            }
            // Delete all posts in this category
            $result = $database->query("UPDATE `forum` SET `category` = '{$method}' WHERE `category`='{$id}'");
            if ($result) {
                return "MOVED_POSTS";
            } else {
                return "MOVING_POSTS";
            }
        }
    } else {
        return "DELETING_CATEGORY";
    }
}
Exemple #22
0
<?php

$category = category(hi('cid'));
$category_name = $category->code;
$category_comment = $category->value;
$category_id = $category->id;
$count_company = company()->count("category={$category_id}");
?>
    <style>
        .companies {

        }
        .companies .company {
            margin:.4em 0;
            background-color:#efefef;
        }
    </style>
    <h2>
        <?php 
echo $category->code;
?>
    </h2>
    <h3>
        <?php 
echo $category->value;
?>
    </h3>
    <div class="desc">
        총 <?php 
echo $count_company;
?>
Exemple #23
-1
                </div>
            </td>
            <td align="right">
                <div class="js-stools clearfix">
                    <?php 
if ($this->isPro) {
    ?>
                        <?php 
    echo $this->loadTemplate('pro_filters');
    ?>
                    <?php 
}
?>

                    <?php 
echo category('cate_id', 'com_osdownloads', $this->flt->cate_id, "onchange='this.form.submit();'", 'title', $size = 1, $sel_cat = 1);
?>
                </div>
            </td>
        </tr>
    </table>
    <table class="adminlist table table-striped" width="100%" border="0">
        <thead>
            <tr>
                <th class="hidden-phone"><input type="checkbox" onclick="Joomla.checkAll(this)" title="check All" value="" name="checkall-toggle" /> </th>
                <th class="has-context span6"><?php 
echo JHTML::_('grid.sort', 'COM_OSDOWNLOADS_NAME', 'email.email', @$this->lists['order_Dir'], @$this->lists['order']);
?>
 </th>
                <?php 
if ($this->isPro) {
Exemple #24
-1
<?php

$cats = category()->loadAllArray();
?>
<style>
    .row .code {
        background-color:#f0f0f0;
    }
    .row .icon {
        display:inline-block;
        width:60px;
        height:60px;
    }
    .row .icon img {
        width:100%;
    }
</style>
<h1>Company category list</h1>
<div class="list">
    <?php 
foreach ($cats as $cat) {
    ?>
    <div class="row" rid="<?php 
    echo $cat['id'];
    ?>
">

        <div class="content">
            <span class="icon"><?php 
    $file = data()->load("gid='company-category' AND code='{$cat['id']}'");
    if ($file) {
Exemple #25
-1
		{
			alert('<?php 
echo lang('alert_product_related');
?>
');
		}
	}
}

function add_category()
{
	//if the related product is not already a related product, add it
	if($('#categories_'+$('#category_list').val()).length == 0 && $('#category_list').val() != null)
	{
		<?php 
$new_item = str_replace(array("\n", "\t", "\r"), '', category("'+\$('#category_list').val()+'", "'+\$('#category_item_'+\$('#category_list').val()).html()+'"));
?>
		var category = '<?php 
echo $new_item;
?>
';
		$('#categories_container').append(category);
		run_category_query();
	}
}


function remove_related_product(id)
{
	if(confirm('<?php 
echo lang('confirm_remove_related');
Exemple #26
-1
    include $config['template_path'] . 'forum/post.php';
}
// Normal Topics
if (is_array($posts)) {
    $count = 0;
    $author = "";
    // Loop through the topic
    foreach ($posts as $post) {
        // First post showing~
        $author = user_data($post['starter_id']);
        // The authors avatar if they have one
        $avatar_url = get_avatar($author['id']);
        // Not the starter
        $starter = false;
        // Category
        $category = category($post['category']);
        // The template
        include $config['template_path'] . 'forum/post.php';
    }
}
// Are we logged in and can we quick reply?
if ($_SESSION['logged_in'] && !$topic['closed'] && $config['allow_quick_reply']) {
    $_POST['qsubject'] = "Re: {$topic['subject']}";
    /**
     * Include quick reply template
     */
    include $config['template_path'] . 'forum/quick-reply.php';
}
/**
 * Include footer template
 */
Exemple #27
-2
category("Planet Busts", $base, "planet_busts");
category("Planet Levels Busted", $base, "planet_bust_levels");
category("Damage Done to Planets", array_merge($base, array("Experience Gained, / 4")), "planet_damage");
category("Port Raids", $base, "port_raids");
category("Port Levels Raided", $base, "port_raid_levels");
category("Damage Done to Ports", array_merge($base, array("Experience Gained, / 20")), "port_damage");
category("Sectors Explored", $base, "sectors_explored");
category("Goods Traded", $base, "goods_traded");
category("Trade Profit", array_merge($base, array("Per Good Traded, / goods_traded", "Per Experience Traded, / experience_traded")), "trade_profit");
category("Trade Sales", array_merge($base, array("Per Good Traded, / goods_traded", "Per Experience Traded, / experience_traded")), "trade_sales");
category("Experience Traded", array_merge($base, array("Per Good Traded, / goods_traded")), "experience_traded");
category("Bounties Collected", $base, "bounties_claimed");
category("Credits from Bounties Collected", array_merge($base, array("Per Bounty Claimed, / bounties_claimed")), "bounty_amount_claimed");
category("Bounties Place on Player", $base, "bounty_amount_on");
category("Military Payment Claimed", $base, "military_claimed");
category("Damage Done to Other Players", array_merge($base, array("Per Kill, / kills", "Experience Gained, / 4")), "player_damage");
category("Experience Gained from Killing", array_merge($base, array("Per Kill, / kills")), "kill_exp");
category("Money Gained from Killing", $base, "money_gained");
category("Experience of Players Killed", array_merge($base, array("Per Kill, / kills")), "traders_killed_exp");
category("Cost of Ships Killed", $base, "killed_ships");
category("Cost of Ships Died In", $base, "died_ships");
category("Mines Bought", $base, "mines");
category("Combat Drones Bought", $base, "combat_drones");
category("Scout Drones", $base, "scout_drones");
category("Forces Bought", $base, "mines + combat_drones + scout_drones");
category("Blackjack Winnings", array_merge($base, array("To Losings, / blackjack_lose")), "blackjack_win");
category("Blackjack Loses", $base, "blackjack_lose");
category("Lotto Winnings", $base, "lotto");
category("Drinks at Bars", $base, "drinks");
category("Turns Since Last Death", $base, "turns_used");
print "</table></div>";