<?php
####################################################################################
##                                      WARNING!                                  ##
##                                                                                ##
##             This script is copyrighted to Free Monthly Websites.               ##
##               Duplication, selling, or transferring of this script             ##
##              is a violation of the copyright and purchase agreement.           ##
##                   Please read the Terms and Conditions here:                   ##
##   https://freemonthlywebsites2.com/legal/Copyright_Terms_and_Conditions.pdf    ##
##      Any violation of these terms will be dealt with serious legal action!     ##
##                                                                                ##
####################################################################################
error_reporting(0);
ini_set('display_errors','off');
      session_start();

       if($_SESSION['logged_in']!=true)
	     {
			header("location:index.php?flag=2");
			exit;
	     }
	   
	   $filename="settings/advert_settings.txt";
		
		if($handle = @fopen($filename, 'r')) 
		  {
			 $contents = fread($handle, filesize($filename));
             fclose($handle);
		     $argument_arr=explode("#_1_#",$contents);
			 $advert_arr=explode("#_1_#",$contents);
		  }
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Language" content="en-gb">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Admin Control Panel</title>
<link href="css/admin_style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
#help_advert { display:none; }
#help_cbid { display:none; }
#help_keyword { display:none; }
#help_disp_alternate { display:none; }
#help_adsense_pub { display:none; }
#help_adsense_ch { display:none; }
#help_display_top_nav  { display:none; }
#help_display_bot_nav  { display:none; }
#help_display_inline { display:none; }
-->
</style>
<script type="text/javascript">
function mm_showHide(id)
{
    a=document.getElementById(id);
    if(a.style.display != 'none' && a.style.display != 'block') a.style.display='none';
    if(a.style.display == 'block') {
        a.style.display='none';
    }
    else {
        a.style.display='block';
    }
    return false;
}
function mm_showHide1(id)
{
    a=document.getElementById(id);
    if(a.style.display != 'none' && a.style.display != 'block') a.style.display='none';
    if(a.style.display == 'block') {
        //a.style.display='none';
    }
    else {
        a.style.display='block';
		what_hide = 'cbar';
		$(what_hide+"1").style.display='none';
		$(what_hide+"2").style.display='none';
		$(what_hide+"3").style.display='none';
		$(what_hide+"4").style.display='none';
		what_hide = 'adsense';
		$(what_hide+"1").style.display='none';
		$(what_hide+"2").style.display='none';
		$(what_hide+"3").style.display='none';
		$(what_hide+"4").style.display='none';
    }
    return false;
}
</script>
</head>
<body>
<table width="914" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td height="160" colspan="3" align="center" valign="middle" class="header">
	</td>
  </tr>
  <tr>
    <td colspan="3" align="center" valign="top" class="main_mid"><table width="888" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="3" height="5" class="table_topl">&nbsp;</td>
        <td width="220" height="5" class="table_top">&nbsp;</td>
        <td width="5" class="table_topr">&nbsp;</td>
        <td width="1" rowspan="3">&nbsp;</td>
        <td width="3" class="table_topl">&nbsp;</td>
        <td width="645" class="table_top">&nbsp;</td>
        <td width="5" height="5" class="table_topr">&nbsp;</td>
      </tr>
      <tr>
        <td width="3" class="table_left">&nbsp;</td>
        <td width="220" align="center" valign="top"><table width="215" border="0" align="left" cellpadding="0" cellspacing="0">
          <tr>
            <td width="215" height="80" colspan="2" align="center" valign="middle" class="admin_button"><a href="../" target="_blank"><strong>View Your Website</strong></a></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="welcome.php"><strong>Home</strong></a></td>
            </tr>
          <tr>
            <td height="60" colspan="2" align="center" valign="middle"><img src="images/bulletaro_dn.gif" width="13" height="9" hspace="10"><span class="style1">Standard Settings</span><img src="images/bulletaro_dn.gif" width="13" height="9" hspace="10"></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="admin_settings.php"><strong>Admin Settings</strong></a></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="personal_settings.php"><strong>Personal Settings</strong></a></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="website_settings.php"><strong>Basic Website Settings</strong></a></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="seo_settings.php"><strong>S.E.O Settings</strong></a></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="theme_settings.php"><strong>Theme Settings</strong></a></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="advert_settings.php"><strong>Advert Settings</strong></a></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="affiliate_settings.php"><strong>Affiliate Settings</strong></a></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="optin_settings.php"><strong>Optin Form Settings</strong></a></td>
          </tr>
          <tr>
            <td height="60" colspan="2" align="center" valign="middle"><img src="images/bulletaro_dn.gif" width="13" height="9" hspace="10"><span class="style1">Article Settings</span><img src="images/bulletaro_dn.gif" width="13" height="9" hspace="10"></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="add_content_pages.php"><strong>Add/Remove Article Pages</strong></a></td>
          </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="edit_content_pages.php"><strong>Edit Article Pages</strong></a></td>
          </tr>
          <tr>
            <td height="60" colspan="2" align="center" valign="middle"><img src="images/bulletaro_dn.gif" width="13" height="9" hspace="10"><span class="style1">Other</span><img src="images/bulletaro_dn.gif" width="13" height="9" hspace="10"></td>
          </tr>

          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="https://freemonthlywebsites2.com/legal/Copyright_Terms_and_Conditions.pdf" target="_blank"><strong>Terms and Conditions</strong></a></td>
          </tr>
          <tr>
            <td height="30" colspan="2" align="center" valign="middle">&nbsp;</td>
            </tr>
          <tr>
            <td height="45" colspan="2" align="center" valign="middle" class="admin_button"><a href="logout.php"><strong>Logout</strong></a></td>
          </tr>
          <tr>
            <td height="30" colspan="2" align="center" valign="middle">&nbsp;</td>
          </tr>
        </table>
        <td width="5" class="table_right">&nbsp;</td>
        <td width="3" class="table_left">&nbsp;</td>
        <td width="645" align="center" valign="top"><table width="645" border="0" align="center" cellpadding="0" cellspacing="0">
          <form name="frm" action="file_io.php" method="post" onSubmit="return chk()">
            <input type="hidden" name="do_type" value="advert_settings_write">
            <input type="hidden" name="keyword" value="<?php echo $argument_arr['1']; ?>">	
            <tr>
              <td height="50" colspan="2" align="center" valign="middle" class="title1">Advert Settings </td>
            </tr>
            <?php
		if($_REQUEST['flag']==1)
		  {
?>
            <tr>
              <td height="50" colspan="2" align="center" valign="middle" class="title1">&gt;&gt; <span class="style3">Data saved successfully</span> &lt;&lt;</td>
            </tr>
            <?php
		}
?>
            
            <tr>
              <td width="345" height="90" align="center" valign="middle" class="main2"><label>Select Which Adverts You Would Like to Display:</label></td>
              <td width="345" height="90" align="left" valign="middle" class="main2">
                <select name="advert" id="advert" onChange="awgr_do_change();">
                <option value="cbar"<?php if($advert_arr['0']=='cbar') echo "selected"; ?>>ClickBank Ad Rotator</option>
                <option value="adsense"<?php if($advert_arr['0']=='adsense') echo "selected"; ?>>AdSense</option>
                <option value="other" onClick="mm_showHide1('help_disp_alternate');" <?php if($advert_arr['0']=='other') echo "selected"; ?>>Other</option>
                            </select>
              <script>
                function awgr_do_change()
                {
                	q = document.getElementById('advert');
                	if(q.selectedIndex==0) //cbar
                	{
						awgr_show_hide('cbar', 'adsense');
		 			    a.style.display='none';						
                	}
                	if(q.selectedIndex==1) //adsense
                	{
                		awgr_show_hide('adsense', 'cbar');
		 			    a.style.display='none';						
                	}
                	if(q.selectedIndex==2) //Other
                	{
						mm_showHide1('help_disp_alternate');
					}
                }
              	function awgr_show_hide(what_show, what_hide)
              	{
              		
              		$(what_show+"1").style.display='table-row';
              		$(what_show+"2").style.display='table-row';
              		$(what_show+"3").style.display='table-row';
              		$(what_show+"4").style.display='table-row';
              		$(what_hide+"1").style.display='none';
              		$(what_hide+"2").style.display='none';
              		$(what_hide+"3").style.display='none';
              		$(what_hide+"4").style.display='none';
              	}
              	function $(id) { return document.getElementById(id); }
              	//var selected=0; //aveber
              	f=window.onload;
              	window.onload=function() {
              		if(f) f();
              		awgr_do_change();              		
              	};
              	
              </script> 
              <a href="#" onClick="mm_showHide('help_advert');return false;"><img src="images/help.gif" width="21" height="21" hspace="8" border="0" align="top"></a>                             </td>
            </tr>
            <tr id="cbar5">
              <td colspan="2" align="center" valign="middle" class="main2"><div class="userhelp_cell" id="help_advert">
                  <p><br>
                    Select which form of adverts you wish to display on your site.<br>
                    <br>
                  </p>
              </div></td>
            </tr>
            <tr id="cbar3">
            </tr>
            <tr id="cbar4">
            </tr>
            <tr id="cbar1">
              <td height="50" align="center" valign="middle" class="main2">Your ClickBank Nickname/ID:</td>
              <td height="50" align="left" valign="middle" class="main2"><input name="cbid" type="text" value="<?php echo $argument_arr['2']; ?>" style="width:270px">
                <a href="#" onClick="mm_showHide('help_cbid');return false;"><img src="images/help.gif" width="21" height="21" hspace="8" border="0" align="top"></a></td>
            </tr>
            <tr id="cbar2">
              <td colspan="2" align="center" valign="middle" class="main2"><div class="userhelp_cell" id="help_cbid">
                  <p><br>
                    You will need to join ClickBank in order to get your ClickBank Nickname/ID.</p>
                  <p>You can join ClickBank from <a href="https://hop.clickbank.net/?affiliate=fmwebs&vendor=reseller" target="_blank"><u>here</u>.</a> <strong></strong></p>
                  <p>You will choose your desired Nickname/ID upon creating an account, simply place it above.
                    <br>
                    <br>
                  </p>
                  </div></td>
            </tr>
            <tr id="adsense1">
              <td height="50" align="center" valign="middle" class="main2">Your Adsense Pub Code:</td>
              <td height="50" align="left" valign="middle" class="main2"><input name="adsense_pub" type="text" id="adsense_pub" value="<?php echo $argument_arr['3']; ?>" style="width:270px">
                <a href="#" onClick="mm_showHide('help_adsense_pub');return false;"><img src="images/help.gif" width="21" height="21" hspace="8" border="0" align="top"></a></td>
            </tr>
            <tr id="adsense2">
              <td colspan="2" align="center" valign="middle" class="main2"><div class="userhelp_cell" id="help_adsense_pub">
                  <p><br>
                    You will need to join Google's AdSense program in order to get your AdSense Pub code.</p>
                  <p>Before you apply to AdSense, ensure you have already chosen a domain name and web hosting.<br>
                  We recommend you place your edited website online before applying.</p>
                  <p>You can view our recommended web host provider <a href="https://freemonthlywebsites2.com/special/bluehost" target="_blank"><u>here</u></a>.<br>
                      <br>
                    Once you have your web hosting you will then need to upload your website.</p>
                  <p>Once you have uploaded your website to your domain, you must then make sure you add/edit as much content as you can within your site to make it <b>unique</b>.<br>
                    <b>*Note*</b> If you do not change anything in your website, then Google may refuse your AdSense account for not being unique.</p>
                  <p>Once you are happy with your website then you can apply for Google AdSense from <a href="https://www.google.com/adsense/" target="_blank"><u>here</u></a>.</p>
                  <p>Please ensure you read Google's terms before signing up.</p>
                  <p>Once you have been accepted by Google for AdSense, simply log into your account with your username and password supplied to you by Google AdSense <a href="https://www.google.com/adsense/login/" target="_blank"><u>here</u>.</a><br>
                      <br>
                    (if you cannot remember your username and password,<br>
                    please use the lost password link or contact Google AdSense)</p>
                  <p>Once you are inside your AdSense members area, you will see your 'pub code' in the top right hand corner,<br>
                    it will look similar to this: <strong>pub-012345678901234</strong>.<br>
                    You can now copy this code to the AdSense Pub code field above to allow your personal Google Ads to show on your website.</p>
                  <p><b>*Note*</b> Please DO NOT enter anything into the 'Your Adsense Pub Code' field until you have received your Adsense Pub Code   from Google or your application will be refused by Google AdSense.<br>
                    <br>
                    <br>
                  </p>
                  </div></td>
            </tr>
            <tr id="adsense3">
              <td height="50" align="center" valign="middle" class="main2">Your Adsense Channel Code:<br>
(if required)</td>
              <td height="50" align="left" valign="middle" class="main2"><input name="adsense_ch" type="text" id="adsense_ch" value="<?php echo $argument_arr['4']; ?>" style="width:270px">
                <a href="#" onClick="mm_showHide('help_adsense_ch');return false;"><img src="images/help.gif" width="21" height="21" hspace="8" border="0" align="top"></a></td>
            </tr>
            <tr id="adsense4">
              <td colspan="2" align="center" valign="middle" class="main2"><div class="userhelp_cell" id="help_adsense_ch">
                  <p><br>
                    This is only needed if you are very familiar with AdSense and you have set up multiple channels for multiple websites for tracking purposes.</p>
                  <p>Please <a href="https://www.google.com/adsense/login/" target="_blank"><u>login</u></a> to your Google AdSense account to learn more about Channels.</p>
                  <p>If you are unsure just leave it blank.
                    <br>
                    <br>
                  </p>
                  </div></td>
            </tr>
            <tr id="wz3">
              <td colspan="2" align="center" valign="middle" class="main2">&nbsp;</td>
            </tr>
            <tr id="wz4">
              <td colspan="2" align="center" valign="middle" class="main2">&nbsp;</td>
            </tr>
            <tr>
              <td colspan="2" align="center" valign="middle" class="main2"><div align="center" id="help_disp_alternate">Your Alternate Advert Code (for top and bottom ads, max. 770px wide):<br>
                  <textarea name="other" style="width:500px" rows="12" id="other"><?php echo $argument_arr['5']; ?></textarea>
                      <p><br>
                      This can be anything you like, it will be displayed in the top and bottom advert bar locations.</p>
                      <p>You may use HTML code here if required.</p>
                      <p>Keep checking your site to make sure it looks OK.</p><br>
                      <p>Your Alternate Advert Code (for inline ads, max. 300px wide):<br>
                        <textarea name="other_inline" style="width:500px" rows="12" id="other_inline"><?php echo $argument_arr['9']; ?></textarea>
</p>
                      <p><br>
                        This can be anything you like, it will be displayed within the article text on all pages.</p>
                      <p>You may use HTML code here if required.</p>
                      <p>Keep checking your site to make sure it looks OK.<br>
                        <br>
                        <br>
                      </p>
                      </div></td>
            </tr>
            <tr>
              <td height="50" align="center" valign="middle" class="main2">Display Top Horizontal Advert Bar:</td>
              <td height="50" align="left" valign="middle" class="main2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  <input name="display_top_nav" type="checkbox" id="display_top_nav" value="1" <?php
		  if($argument_arr['6']==1)
		  {
			  echo "checked";
		  }
		  ?>>
                <a href="#" onClick="mm_showHide('help_display_top_nav');return false;"><img src="images/help.gif" width="21" height="21" hspace="8" border="0" align="top"></a></td>
            </tr>
            <tr>
              <td colspan="2" align="center" valign="middle" class="main2"><div class="userhelp_cell" id="help_display_top_nav">
                  <p><br>
                    Tick this box to display the top horizontal advert bar.<br>
                    <br>
                    <br>
                  </p>
              </div></td>
            </tr>
            <tr>
              <td height="50" align="center" valign="middle" class="main2">Display Bottom Horizontal Advert Bar:</td>
              <td height="50" align="left" valign="middle" class="main2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  <input name="display_bot_nav" type="checkbox" id="display_bot_nav" value="1" <?php
		  if($argument_arr['7']==1)
		  {
			  echo "checked";
		  }
		  ?>>
                <a href="#" onClick="mm_showHide('help_display_bot_nav');return false;"><img src="images/help.gif" width="21" height="21" hspace="8" border="0" align="top"></a></td>
            </tr>
            <tr>
              <td colspan="2" align="center" valign="middle" class="main2"><div class="userhelp_cell" id="help_display_bot_nav">
                  <p><br>
                    Tick this box to display the bottom horizontal advert bar.<br>
                    <br>
                    <br>
                  </p>
              </div></td>
            </tr>
            <tr>
              <td height="50" align="center" valign="middle" class="main2">Display Inline Adverts:</td>
              <td height="50" align="left" valign="middle" class="main2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  <input name="display_inline" type="checkbox" id="display_inline" value="1" <?php
		  if($argument_arr['8']==1)
		  {
			  echo "checked";
		  }
		  ?>>
                <a href="#" onClick="mm_showHide('help_display_inline');return false;"><img src="images/help.gif" width="21" height="21" hspace="8" border="0" align="top"></a></td>
            </tr>
            <tr>
              <td colspan="2" align="center" valign="middle" class="main2"><div class="userhelp_cell" id="help_display_inline">
                  <p><br>
                    Tick this box to display adverts that are built into the article content of the site.<br>
                    <br>
                    <br>
                  </p>
              </div></td>
            </tr>
            
            
            
            <tr>
              <td height="50" align="center" valign="middle" class="main2">&nbsp;</td>
              <td height="50" align="center" valign="middle" class="main2">&nbsp;</td>
            </tr>
            
            <tr>
              <td height="50" colspan="2" align="center" valign="middle" class="main2"><p>
                  <input type="submit" name="Submit" value="Save Advert Settings">
              </p></td>
            </tr>
          </form>
        </table></td>
        <td width="5" class="table_right">&nbsp;</td>
      </tr>
      <tr>
        <td width="3" height="6" class="table_botl">&nbsp;</td>
        <td width="220" height="6" class="table_bot">&nbsp;</td>
        <td width="5" class="table_botr">&nbsp;</td>
        <td width="3" class="table_botl">&nbsp;</td>
        <td width="645" class="table_bot">&nbsp;</td>
        <td width="5" height="6" class="table_botr">&nbsp;</td>
      </tr>
    </table></td>
  </tr> 
  <tr>
    <td height="60" colspan="3" align="center" valign="middle" class="footer">    </td>
  </tr>
  <tr class="footer_bg">
    <td width="8" height="30">&nbsp;</td>
    <td width="898" height="30"><table width="898" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td align="center" valign="middle" class="copyright">Copyright &copy; <a href="https://freemonthlywebsites2.com" target="_blank">Free Monthly Websites 2.0</a>. All Rights Reserved.</td>
      </tr>
      <tr>
        <td align="center" valign="middle" class="powered">Powered By: <a href="https://freemonthlywebsites2.com" target="_blank">Free Monthly Websites 2.0</a></td>
      </tr>
    </table></td>
    <td width="8" height="30">&nbsp;</td>
  </tr>
</table>
</body>
</html>