Exemplo n.º 1
0
function folders_posttype_in_admin_menu()
{
    global $globOptions, $folder_types, $menu;
    if (empty($folder_types)) {
        return;
    }
    foreach ($folder_types as $type) {
        $itemKey = searchForId($type, $menu);
        switch (true) {
            case $type == 'attachment':
                $itemKey = 10;
                $edit = 'upload.php';
                break;
            case $type === 'post':
                $edit = 'edit.php';
                $itemKey = 5;
                break;
            default:
                $edit = 'edit.php';
                break;
        }
        $folder = $type == 'attachment' ? 'media' : $type;
        $upper = $type == 'attachment' ? 'Media' : ucwords(str_replace(array('-', '_'), ' ', $type));
        if ($type == 'page') {
            $tax_slug = 'folder';
        } else {
            $tax_slug = $folder . '_folder';
        }
        if ($type == 'attachment') {
            add_menu_page('Media Folders', 'Media Folders', 'publish_pages', "edit-tags.php?taxonomy=media_folder&post_type=attachment", false, 'dashicons-portfolio', "{$itemKey}.5");
        } else {
            add_menu_page($upper . ' Folders', "{$upper} Folders", 'publish_pages', "{$edit}?post_type={$type}&{$tax_slug}", false, 'dashicons-portfolio', "{$itemKey}.5");
        }
        add_submenu_page("{$edit}?post_type={$type}&{$tax_slug}", 'Add/Edit Folders', 'Add/Edit Folders', 'publish_pages', "edit-tags.php?taxonomy={$tax_slug}&post_type={$type}", false);
        $tax_obj = get_taxonomy($tax_slug);
        $tax_name = $tax_obj->labels->name;
        $terms = get_terms($tax_slug);
        if ($terms) {
            foreach ($terms as $term) {
                if ($type == 'attachment') {
                    add_submenu_page("edit-tags.php?taxonomy=media_folder&post_type=attachment", $term->name, $term->name, 'publish_pages', "{$edit}?taxonomy=media_folder&term={$term->slug}", false);
                } else {
                    add_submenu_page("{$edit}?post_type={$type}&{$tax_slug}", $term->name, $term->name, 'publish_pages', "{$edit}?post_type={$type}&{$tax_slug}={$term->slug}", false);
                }
            }
        }
        remove_submenu_page("{$edit}", "edit-tags.php?taxonomy=post_folder");
        remove_submenu_page("{$edit}?post_type={$type}", "edit-tags.php?taxonomy={$tax_slug}&post_type={$type}");
        remove_submenu_page("{$edit}", "edit-tags.php?taxonomy={$tax_slug}&post_type={$type}");
    }
}
{
    foreach ($array as $key => $val) {
        if ($val['COTTAGE_URL'] === $id) {
            return $key;
        }
    }
    return null;
}
$blacklist = array();
$url = "http://www.coastandcountry.co.uk/cottage-details/";
scraperwiki::attach("coastandcountrycouk");
# get an array of the cottage data to scrape
$cottData = scraperwiki::select("COTTAGE_URL, PRICE_HIGH, PRICE_LOW from 'coastandcountrycouk'.SWDATA order by COTTAGE_URL");
$placeholder = scraperwiki::get_var("cottID");
if ($placeholder != "") {
    $index = searchForId($placeholder, $cottData);
    $cottData = array_splice($cottData, $index);
}
require 'scraperwiki/simple_html_dom.php';
$dom = new simple_html_dom();
foreach ($cottData as $value) {
    scraperwiki::save_var("cottID", $value['COTTAGE_URL']);
    // check the cottage url against the blacklist
    foreach ($blacklist as $blItem) {
        if ($value['COTTAGE_URL'] == $blItem) {
            continue 2;
        }
    }
    //load the page into the scraper
    $html = scraperWiki::scrape($url . $value['COTTAGE_URL']);
    $dom->load($html);
//set lang
$arrLang = array('nederlands' => 'nl', 'engels' => 'en');
//set depth
$arrDepth = array('1' => '0', '2' => '10', '3' => '20', '4' => '30', '5' => '40', '6' => '50', '7' => '60', '8' => '70', '9' => '80', '10' => '90', '50' => '490');
//function to get client id
function searchForId($client, $array)
{
    foreach ($array as $key => $val) {
        if ($val['client'] === $client) {
            return $key;
        }
    }
    return null;
}
//get details data by client
$selectedClient = searchForId('Kardex', $arrData);
$keywords = $arrData[$selectedClient]['keywords'];
$url = $arrData[$selectedClient]['url'];
$country = $arrData[$selectedClient]['country'];
$CCTLD = $arrCCTLD[$country];
$language = $arrData[$selectedClient]['lang'];
$lng = $arrLang[$language];
$arrKeywords = explode(',', $keywords);
// save per date
$now = getdate();
//print_r($now);
$saveDate = $now;
$showDate = $arrWDay[$now['wday']] . ' - ' . $now['mday'] . '/' . $now['mon'] . '/' . $now['year'] . ' - ' . $now['hours'] . ':' . $now['minutes'];
//echo($showDate);
function delay()
{
//voorzie keuze veld (braaf zijn = delay functie)
//niveau's instellen? > niet te diep of blijft eeuwige loop
//http://www.planckendael.be/ > at en dot
//data
$arrData = array('0' => array('klant' => 'Wijs', 'thema' => 'online marketing', 'keywords' => 'seo, sea, web analytics', 'sites' => 'proximedia.be, reference.be, the-aim.be'));
//klant opzoeken op basis van naam
function searchForId($client, $array)
{
    foreach ($array as $key => $val) {
        if ($val['klant'] === $client) {
            return $key;
        }
    }
    return null;
}
$selectedClient = searchForId('Wijs', $arrData);
$thema = $arrData[$selectedClient]['thema'];
$keywords = $arrData[$selectedClient]['keywords'];
$sites = $arrData[$selectedClient]['sites'];
$arrKeywords = explode(',', $keywords);
$arrSites = explode(',', $sites);
/*********************************************************** to do ********************************************************/
//delay function toevoegen?
//settings
$minDelay = '5';
//sec
$maxDelay = '10';
//sec
function delay()
{
    global $minDelay, $maxDelay;
Exemplo n.º 5
0
//set ccTLD
$arrCCTLD = array('belgium' => 'be');
//stuff we need to ruse
//function to get client id
function searchForId($client, $array)
{
    foreach ($array as $key => $val) {
        if ($val['client'] === $client) {
            return $key;
        }
    }
    return null;
}
//Start hacking
//get details data by client
$selectedClient = searchForId('Dries Bultynck', $arrData);
$keywords = $arrData[$selectedClient]['keywords'];
$url = $arrData[$selectedClient]['url'];
$arrKeywords = explode(',', $keywords);
/*
foreach($arrKeywords as $keyword){
    echo($keyword);
}
*/
//herken url met matched url > zo ja > schrijf weg in array met keyword + ranking
// save per date
$now = getdate();
//print_r($now);
$saveDate = $now;
$showDate = $arrWDay[$now['wday']] . ' - ' . $now['mday'] . '/' . $now['mon'] . '/' . $now['year'] . ' - ' . $now['hours'] . ':' . $now['minutes'];
//echo($showDate);
Exemplo n.º 6
0
// echo "<pre>"; print_r($data['exsocial']);
?>
				
				<form id="socialForm" action="sclcontroller.php" method="post">
					<!-- start id-form -->
					<?php 
if (count($data['rows'][0]) > 0) {
    ?>
					<table border="0" width="100%" cellpadding="0" cellspacing="0"  id="id-form">
					<?php 
    foreach (array_chunk($data['rows'], 2) as $row) {
        ?>
					    <tr>
					    <?php 
        foreach ($row as $value) {
            $selectedKey = $data['exsocial'] ? searchForId($value['mp_id'], $data['exsocial']) : NULL;
            if ($selectedKey >= 0) {
                $exvalue = @$data['exsocial'][$selectedKey]['social_link'];
            }
            ?>
					    	<th><?php 
            echo $value['mp_name'];
            ?>
:</th>
					        <td><input type="url" class="inp-form" name="social_media[<?php 
            echo $value['mp_id'];
            ?>
]" value="<?php 
            if ($exvalue) {
                echo $exvalue;
            }
Exemplo n.º 7
0
}
/*****************   Schedule booking ***************************/
//echo date('Y-m-d H:i:s');
$query = "SELECT car_schedule_booking.*,\n       car_sdrt_schedule.*,\n       car_sdrt_cost.*,\n       car_sdrt_schedule.start_time,\n       car_sdrt_schedule.schedule_date\n  FROM    (   car_schedule_booking car_schedule_booking\n           INNER JOIN\n              car_sdrt_schedule car_sdrt_schedule\n           ON (car_schedule_booking.schedule_id =\n                  car_sdrt_schedule.schedule_id))\n       INNER JOIN\n          car_sdrt_cost car_sdrt_cost\n       ON (car_schedule_booking.sbooking_id = car_sdrt_cost.sbooking_id)\n WHERE car_schedule_booking.sms_notify=0 AND car_schedule_booking.booking_status=3 AND (car_sdrt_schedule.start_time > '" . $formatDate1 . "') AND (car_sdrt_schedule.start_time < '" . $formatDate2 . "')\n       AND(car_sdrt_schedule.schedule_date >='" . $entrydate . "')";
//echo $query."<br>";
$result = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
    $user_info = get_all_table_info_by_id('a3m_account', 'id', $row['user_id']);
    //echo "phone=".$user_mobile['phone'];
    if ($user_info['phone']) {
        $user_pickup_node = get_node_id_from_pickup_point($row['pickup_point']);
        $all_node_arrival_time_array = get_all_node_arrival_time_of_a_route($row['route_id'], $row['start_node'], $row['start_time']);
        //echo "<pre>";
        //print_r($all_node_arrival_time_array);
        //echo "</pre>";
        $pickup_node_array_key = searchForId($user_pickup_node, $all_node_arrival_time_array);
        //echo "Pickup Node:".$user_pickup_node.", Pickup point:".$row['pickup_point'].", Pickup time:". $all_node_arrival_time_array[$pickup_node_array_key]['node_arrival_time'];
        $msg = "Hi, " . $user_info['username'] . ", We will pickup you from " . get_pickup_point_name_from_id($row['pickup_point']) . " at " . $all_node_arrival_time_array[$pickup_node_array_key]['node_arrival_time'] . " (Approximately). Your fare is " . $row['fare_cost'] . " TK";
        echo $msg . ", ";
        $mydata = array('SSW02301120151012', '01974726227', $user_info['phone'], $msg, date('Y-m-d H:i:s'), 'SSW');
        $serialized = rawurlencode(serialize($mydata));
        $apisaid = file_get_contents('http://gramweb.com/gccsmsserver/index.php?smsdata=' . $serialized);
        $update_sql = "UPDATE car_schedule_booking SET sms_notify=1 WHERE sbooking_id = " . $row['sbooking_id'];
        mysql_query($update_sql) or die(mysql_error());
    }
}
function get_all_node_arrival_time_of_a_route($route_id, $first_passenger_pickup_node, $first_passenger_first_node_arrival_time)
{
    $all_node_arrival_time_of_a_route = array();
    $time_to_minus = 0;
    $time_to_minus2 = 0;
Exemplo n.º 8
0
						
                        <div class="row">
                        	<div class="col-lg-12">
                            	<div class="form-group">

                            		<select class="form-control select2-list"  multiple required id="air_cat" name="air_cat[]">
                                    	<?php 
if ($query_air_cat->num_rows() != 0) {
    foreach ($query_air_cat->result() as $air_cat) {
        ?>
                                    	<option value="<?php 
        echo $air_cat->id;
        ?>
" <?php 
        echo searchForId($air_cat->id, $man_cat);
        if (searchForId($air_cat->id, $man_cat) == 1) {
            ?>
 selected="selected"<?php 
        }
        ?>
><?php 
        echo stripslashes($air_cat->title);
        ?>
</option>
 
                                        	<?php 
    }
    ?>
                                        <?php 
}
?>
Exemplo n.º 9
0
    foreach ($array as $key => $val) {
        if ($val['char'] === $id) {
            return true;
        }
    }
    return false;
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $method = preg_replace('#[^a-zA-Z]#', '', $_GET['method']);
    if ($method == 'setupAdd') {
        if (empty($_POST['user_char'])) {
            $_SESSION['error'] = 'Sorry, you tried to add an invisible person.';
            header('Location: ' . $_SERVER['PHP_SELF'] . '');
            exit;
        }
        if (searchForId($_POST['user_char'], $_SESSION['suicideSetupCharacters'])) {
            $_SESSION['error'] = 'Sorry, that user is already in the Setup List.';
            header('Location: ' . $_SERVER['PHP_SELF'] . '');
            exit;
        }
        $sp_userChar = preg_replace('#[^a-zA-Z0-9\\-\\040]#', '', $_POST['user_char']);
        // Check if user is in the Suicide List
        $sql = "SELECT user_char,pos FROM suicide WHERE user_char='{$sp_userChar}'";
        $que = mysqli_query($con, $sql);
        $row = mysqli_fetch_row($que);
        if ($row[0] == '') {
            $_SESSION['error'] = 'Sorry, that user is not in the Suicide List. ' . mysqli_error($con) . '';
            header('Location: ' . $_SERVER['PHP_SELF'] . '');
            exit;
        }
        array_push($_SESSION['suicideSetupCharacters'], array("char" => $row[0], "posi" => $row[1]));
//set lang
$arrLang = array('nederlands' => 'nl', 'engels' => 'en');
//set depth
$arrDepth = array('1' => '0', '2' => '10', '3' => '20', '4' => '30', '5' => '40', '6' => '50', '7' => '60', '8' => '70', '9' => '80', '10' => '90', '11' => '690');
//function to get client id
function searchForId($client, $array)
{
    foreach ($array as $key => $val) {
        if ($val['client'] === $client) {
            return $key;
        }
    }
    return null;
}
//get details data by client
$selectedClient = searchForId('Braem', $arrData);
$keywords = $arrData[$selectedClient]['keywords'];
$url = $arrData[$selectedClient]['url'];
$country = $arrData[$selectedClient]['country'];
$CCTLD = $arrCCTLD[$country];
$language = $arrData[$selectedClient]['lang'];
$lng = $arrLang[$language];
//$arrKeywords = explode(',',$keywords);
$arrKeywords = preg_split('/[,]+/', $keywords);
//print_r($arrKeywords);
// save per date
$now = getdate();
//print_r($now);
$saveDate = $now;
$showDate = $arrWDay[$now['wday']] . ' - ' . $now['mday'] . '/' . $now['mon'] . '/' . $now['year'] . ' - ' . $now['hours'] . ':' . $now['minutes'];
//echo($showDate);
//data
$arrData = array('0' => array('client' => 'Wijs', 'urls' => 'wijs.be', 'depth' => '0'), '1' => array('client' => 'Catena', 'urls' => 'cyclingnews.com', 'depth' => '2'));
//stuff we need to ruse
//function to get client id
function searchForId($client, $array)
{
    foreach ($array as $key => $val) {
        if ($val['client'] === $client) {
            return $key;
        }
    }
    return null;
}
//Start hacking
//get details data by client
$selectedClient = searchForId('Catena', $arrData);
$url = $arrData[$selectedClient]['urls'];
$arrUrls = explode(',', $url);
function delay()
{
    global $minDelay, $maxDelay;
    $delay = rand($minDelay, $maxDelay);
    sleep($delay);
    //controle voor seconden vertraging
    //$newNow = getdate();
    //echo $newNow['hours'].':'.$newNow['minutes'].':'.$newNow['seconds'];
}
//scrape top 10 bing voor linked urls
//run door top 100
//run door set met links
/*