Ejemplo n.º 1
0
    }
    if ($text == "") {
        $return = '<a href="' . $link . '" ' . $title . '><img src="' . $ita_linkImage . '" width="61" height="16" ' . $title . ' /></a>';
    } else {
        $return = '<a href="' . $link . '" ' . $title . '>' . $text . '</a>';
    }
    return $return;
}
add_shortcode('itunes', 'ita_link');
if (preg_match('/\\/wp-admin\\//', $_SERVER['REQUEST_URI'])) {
    // just load in admin
    wp_enqueue_script('jquery-ui-dialog');
    wp_enqueue_style('ita-jquery-ui', plugins_url('/itunes-affiliate-link-maker/ita-jquery-ui.css'), array(), '0.11', 'screen');
    require_once dirname(__FILE__) . '/ita.class.admin.php';
    $ita =& new ita();
    if (ita::setting('ita-cleanup') == '1') {
        register_deactivation_hook(WP_PLUGIN_DIR . '/itunes-affiliate-link-maker/itunes-affiliate.php', array(&$ita, 'italm_deactivate'));
    }
    register_uninstall_hook(WP_PLUGIN_DIR . '/itunes-affiliate-link-maker/itunes-affiliate.php', array(&$ita, 'italm_uninstall'));
    register_activation_hook(WP_PLUGIN_DIR . '/itunes-affiliate-link-maker/itunes-affiliate.php', array(&$ita, 'italm_install'));
    $plugin_dir = basename(dirname(WP_PLUGIN_DIR . '/itunes-affiliate-link-maker/itunes-affiliate.php'));
    load_plugin_textdomain('italm', '', $plugin_dir);
} else {
    if (itabase::setting('ita-maskenable') == '1') {
        $urlCheck = '/(' . itabase::setting('ita-maskurl') . ')(\\/[A-Z,a-z,0-9,_,-,(,),%-]*)*?$/';
        if (preg_match($urlCheck, $_SERVER['REQUEST_URI'])) {
            require_once dirname(__FILE__) . '/ita.class.public.php';
            $itaPub = new itapub();
            remove_action('template_redirect', 'redirect_canonical');
            add_filter('request', array(&$itaPub, 'ita_request'));
            add_action('template_redirect', array(&$itaPub, 'ita_linkredir'));
  <tr>
    <th scope="col" width="482" ><?php 
_e('Name');
?>
</th>
    <th scope="col" ><?php 
_e('Date');
?>
</th>
  </tr>
</table>
    <div id="ita-results-scroll">
<table class="ita-results" id="ita-results-body" width="100%">
<?php 
$i = 0;
$ita_linkImage = ita::setting('ita-linkimage');
foreach ($queryRes as $result) {
    ?>
    <tr>
      <td width="70%"<?php 
    echo $i == 0 ? ' class="odd"' : '';
    ?>
><a href="<?php 
    echo $result->linkUrl;
    ?>
" onClick="italm_linkIt('<?php 
    echo $result->linkName;
    ?>
',this.href,'<?php 
    echo $ita_linkImage;
    ?>
Ejemplo n.º 3
0
 /**
  * Talks to iTMS API, gets JSON response, dislays table in iFrame
  * exits.
  */
 function ita_handle_search()
 {
     global $wpdb;
     if (isset($_POST['ita-omg']) || isset($_GET['ita-omg'])) {
         $tableName = $wpdb->prefix . 'italm';
         $page = 0;
         $perPage = 20;
         if (isset($_GET['ita-pg'])) {
             $page = intval($_GET['ita-pg']) - 1;
         }
         $pageLimit = $page * $perPage;
         if (!isset($_POST['ita-term']) || $_POST['ita-term'] == "") {
             $queryRes = $wpdb->get_results('SELECT * FROM ' . $tableName . ' ORDER BY updateTime DESC LIMIT ' . $pageLimit . ',' . $perPage, OBJECT);
             if (sizeof($queryRes) < 1) {
                 die('No history to display');
             } else {
                 include ita_getDisplayTemplate("itms-result-history.php");
             }
         } else {
             if (isset($_POST['ita-album-only'])) {
                 $albumOnly = true;
             } else {
                 $albumOnly = false;
             }
             if (isset($_POST['ita-media'])) {
                 $media = $_POST['ita-media'];
             } else {
                 $media = 'all';
             }
             if (isset($_POST['ita-country'])) {
                 $country = $_POST['ita-country'];
             } else {
                 $country = ita::setting('ita_country');
             }
             if (isset($_POST['ita-entity'])) {
                 $entity = $_POST['ita-entity'];
             } else {
                 $entity = "";
             }
             $term = $_POST['ita-term'];
             $itms = new itms();
             $results = $itms->getResults($term, $media, $country, $entity);
             $resArr = $results->results;
             include ita_getDisplayTemplate("itms-results.php");
         }
         exit;
     }
 }
Ejemplo n.º 4
0
<head>
<title>iTunes Link Maker Plugin for Wordpress Output - <?php 
echo $term;
?>
</title>
<script type='text/javascript' src='<?php 
echo get_option('site_url');
?>
/wp-includes/js/tw-sack.js?ver=1.6.1'></script>
<script type="text/javascript" language="javascript" src="<?php 
echo get_option('site_url');
?>
/wp-content/plugins/itunes-affiliate-link-maker/templates/common.js">
</script>
<script type="text/javascript" language="javascript">var italmLinkImage='<?php 
echo ita::setting('ita-linkimage');
?>
';</script>
<link rel="stylesheet" type="text/css" href="<?php 
echo get_option('site_url');
?>
/wp-content/plugins/itunes-affiliate-link-maker/templates/common.css">
</head>
<body>
<table class="ita-results" id="ita-results-head" width="100%">
    <!-- headings for results, populated by javascript -->
</table>
    <div id="ita-results-scroll">
<table class="ita-results" id="ita-results-body" width="100%">
<?php 
if (sizeof($resArr) < 1) {