<div class="row"><span>Site ID: <span class="info"><span>To see your website ID, log into your <a href="//cj.com" target="_blank" style="color: #FFF;">cj.com</a> account, then go in section <i>Account</i> and select <i>Websites.</i></span></span></span><div><input type="text" name="site-id" value="' . htmlspecialchars(\query\main::get_option('cj_site-id')) . '" style="background: #F8E0E0;" required /></div></div> <div class="row"><span>Deals Expiration (days) <span class="info"><span>Deals and some coupons do have not set an expiration date. This will be set automatically after a number of days that you can define here. It can be changed in preview mode.</span></span>:</span><div><input type="number" name="exp" value="' . (int) \query\main::get_option('cj_exp') . '" min="1" max="1000" required /></div></div> <div class="row"><span>Items Per Page:</span><div><input type="number" name="ipp" value="' . (int) \query\main::get_option('cj_ipp') . '" min="1" max="100" required /></div></div> </div>'; echo '<input type="hidden" name="csrf" value="' . $csrf . '" /> <button class="btn">Save</button> </form><br><br><br> <div class="title"> <h2>Category Mapping</h2> <span>Category Mapping for Data Automation</span> </div>'; $cj = new \plugin\CJApi\inc\client(\query\main::get_option('cj_key')); $categories_cj = $cj->categories(); $category_mapping = \plugin\CJApi\inc\actions::listCategoryMapping(); foreach ($categories_cj as $category) { if (!isset($category_mapping[$category])) { $category_mapping[$category] = 0; } } $categories_while = \query\main::while_categories(array('max' => 0, 'show' => 'subcats')); echo '<select name="template_category" style="display:none;">'; foreach ($categories_while as $cat) { echo '<option value="' . $cat->ID . '">' . $cat->name . '</option>'; } echo '</select> <input type="button" value="OK" name="template_category_OK" style="display:none;"><input type="button" value="Cancel" name="template_category_Cancel" style="display:none;"> <form action="#" method="POST"> <div class="form-table">'; foreach ($category_mapping as $km => $vm) {
<button class="btn">Import all</button>'; echo '</div>'; if (isset($advertisers['advertisers']['advertiser'][0])) { $advs = $advertisers['advertisers']['advertiser']; } else { $advs[] = (array) $advertisers['advertisers']['advertiser']; } foreach ($advs as $item) { // check first if this store is imported on your website $imported = \plugin\CJApi\inc\import::store_imported($item['advertiser-id']); $imgdisp = NULL; if ($imported) { $imgdisp = \query\main::store_avatar($imported->image); } else { $imgdisp = \plugin\CJApi\inc\actions::find_cj_img($item['advertiser-id']); if ($imgdisp == '') { $imgdisp = \query\main::store_avatar(''); } } echo '<li> <input type="checkbox" name="id[' . $item['advertiser-id'] . ']"' . ($imported ? ' disabled' : '') . ' /> <div style="display: table;"> <img src="' . $imgdisp . '" alt="" style="width: 80px;" /> <div class="info-div"><h2>' . ($item['relationship-status'] !== 'joined' ? '<span class="msg-error">Not Joined</span> ' : '<span class="msg-success">Joined</span> ') . ($imported ? '<span class="msg-alert" title="Local name: ' . $imported->name . '">Imported</span> ' : '') . htmlspecialchars($item['advertiser-name']) . '</h2> URL: <a href="' . $item['program-url'] . '" target="_blank">' . (($url = urldecode($item['program-url'])) && strlen($url) > 50 ? substr($url, 0, 50) . '...' : $url) . '</a> <br /> Category: <b>' . implode(' → ', array_merge((array) $item['primary-category']['parent'], (array) $item['primary-category']['child'])) . '</b> <br /> <a href="javascript:void(0)" onclick="$(this).show_next({element:\'.store_more\', type:\'rightnext\'}); return false;">More/Less</a>