function admin_manage_table() { // Get our options and see if we're handling a form submission. global $_adsensem, $_adsensem_networks; ?> <div class="wrap"> <h2>Manage Ad Units</h2> <ul class="subsubsub"><li><a href='' class="current">Show Ads</a> |</li><li><a href='?page=adsense-manager-manage-ads&pagesub=create_new' >Create New Ad</a></li></ul> <!--<p>Below are your currently created Ads. Remember to set your <strong>Google Adsense ID</strong> at <a href="<?php echo get_bloginfo('wpurl'); ?> /wp-admin/options-general.php?page=adsense-manager-options">Options » AdSense Manager</a></p>--> <form action="" method="post" id="adsensem-config-manage" enctype="multipart/form-data"> <input type="hidden" name="adsensem-mode" id="adsensem-submit" value="manage"> <input type="hidden" name="adsensem-action" id="adsensem-action"> <input type="hidden" name="adsensem-action-target" id="adsensem-action-target"> <table id="manage-ads" class="widefat"> <thead> <tr style="height:3em;vertical-align:middle;"><th style="text-align:left;" scope="col">Name</th><th style="text-aling:center">Slot</th><th colspan="5" style="width:50px;">Colours</th><th>Format</th><th>Alternate</th><th>Notes</th><th style="width:100px;">Modify</th><th style="width:120px;"></th><th>DA</th></tr> </thead> <?php $previous_network = ''; if (is_array($_adsensem['ads'])) { foreach ($_adsensem['ads'] as $name => $ad) { if ($ad->network() !== $previous_network) { adsensem_admin::admin_manage_network_header($ad->network()); $previous_network = $ad->network(); $shade = 0; } /* The below hides ads from other networks while editing a given network */ //if(($_POST['adsensem-edit-network']!='') && ($ad['network']!=$_POST['adsensem-edit-network'])){continue;} ?> <tr class="adrow shade_<?php echo $shade; $shade = $shade == 1 ? 0 : 1; ?> "> <td><span class="adrow_name"><?php echo htmlspecialchars($name, ENT_QUOTES); ?> </span></td> <td <?php if (!array_key_exists('slot', $ad->p) && !array_key_exists('channel', $ad->p)) { echo 'class="disabled"'; } ?> style="text-align:center"><?php echo htmlspecialchars($ad->p['slot'], ENT_QUOTES); if ($ad->p['channel'] != '') { echo htmlspecialchars('/' . $ad->p['channel'], ENT_QUOTES); } ?> </td> <?php if (array_key_exists('color-border', $ad->p)) { ?> <td style="width:9px;background-color:#<?php echo htmlspecialchars($ad->p['color-border'], ENT_QUOTES); ?> "> </td> <td style="width:9px;background-color:#<?php echo htmlspecialchars($ad->p['color-title'], ENT_QUOTES); ?> "> </td> <td style="width:9px;background-color:#<?php echo htmlspecialchars($ad->p['color-bg'], ENT_QUOTES); ?> "> </td> <td style="width:9px;background-color:#<?php echo htmlspecialchars($ad->p['color-text'], ENT_QUOTES); ?> "> </td> <td class="colcor" style="width:9px;background-color:#<?php echo htmlspecialchars($ad->p['color-link'], ENT_QUOTES); ?> "> </td> <?php } else { ?> <td colspan="5" class="disabled"></td><?php } ?> <td style="text-align:center;"><?php echo htmlspecialchars($ad->p['adformat'], ENT_QUOTES); ?> </td> <td style="text-align:center"><?php echo htmlspecialchars($ad->p['alternate-ad'], ENT_QUOTES); ?> </td> <td style="text-align:center"><?php echo htmlspecialchars($ad->p['notes'], ENT_QUOTES); ?> </td> <td class="network_admin"> <input name="adsensem-edit" class="button" type="submit" value="Edit Settings" onClick="document.getElementById('adsensem-action').value='edit unit'; document.getElementById('adsensem-action-target').value='<?php echo $name; ?> ';"> </td> <td class="network_admin"><input class="button" name="adsensem-copy" type="submit" value="Copy" onClick="document.getElementById('adsensem-action').value='copy unit';document.getElementById('adsensem-action-target').value='<?php echo $name; ?> ';" title="Copy to new Ad unit"><?php if ($name != $_adsensem['default-ad']) { ?> <input class="button" name="adsensem-delete" type="submit" value="Delete" onClick="if(confirm('Delete <?php echo $name; ?> ?')){document.getElementById('adsensem-action').value='delete unit'; document.getElementById('adsensem-action-target').value='<?php echo $name; ?> ';} else {return false;}"></td><?php } ?> </td> <td><input class="button" onClick="document.getElementById('adsensem-action').value='set default'; this.form.submit();" name="adsensem-default-name" type="radio" value="<?php echo $name; ?> "<?php if ($name == $_adsensem['default-ad']) { ?> checked <?php } ?> ></td> </tr> <?php } } ?> </table> <p>Earn even more with <a href="http://www.text-link-ads.com/?ref=55499" target="_blank">Text Link Ads</a> and <a href="http://www.inlinks.com/?ref=211569" target="_blank">InLinks!</a></p> <p>By changing the <strong>Network</strong> settings you can update all Ads on a network at once. <br /><strong>Default Ad</strong> indicates which Ad will be displayed in any space on your site where no specific ID is used. </p> <p>Ads can be included in <strong>templates</strong> using <code><?php adsensem_ad('name'); ?></code> or <code><?php adsensem_ad(); ?></code> for the default Ad.<br /> Ads can be inserted into <strong>posts / pages</strong> using <code>[ad#name]</code> or <code>[ad]</code> for the default Ad. <br/> Note that the old <code><!--adsense#name--></code> style still works if you prefer it.</p> </form> </div> <?php }