We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1330
    • 79 Posts
    Even with 1.1 I still get the following error. Any ideas?
    Warning: include_once(/home/dcs/public_html/assets/snippets/AdsManager/AdsManager.inc.php) [function.include-once]: failed to open stream: No such file or directory in /home/dcs/public_html/manager/processors/execute_module.processor.php(98) : eval()'d code on line 30
    
    Warning: include_once() [function.include]: Failed opening '/home/dcs/public_html/assets/snippets/AdsManager/AdsManager.inc.php' for inclusion (include_path='/home/dcs/public_html/manager/includes/') in /home/dcs/public_html/manager/processors/execute_module.processor.php(98) : eval()'d code on line 30
    
    Fatal error: Class 'AdsManager' not found in /home/dcs/public_html/manager/processors/execute_module.processor.php(98) : eval()'d code on line 32


    _Edit_: Issue resolved by renaming folder and file with capital A and M.
    Now I hit another problem it wont install.

    CODE ZIXO: Graphical advertisement manegement
    Warning! Ads manager is not yet installed.
    
    During the installation process, 3 mysql tables will be created and a folder for banner placement [/assets/snipplets/AdsManager/banners].
    
      • 1343 ☆ A M B ☆
      • 2,213 Posts
      The buttons such as the install button fail to work in Firefox.

      I didn’t take much time to look into the cause, but did notice validation errors and cleared up quite a few of them in hopes of fixing the problem. It didn’t fix the problem, but here is the manager.php file with improved validation:

      Anyways hopefully someone can put this to use. In the meantime any ideas on how to resolve the issue with buttons not working in firefox?

      Thanks
      AMDbuilder

      //<?
      //////////////////////////////////////////////////////
      //
      //         AdsManager by CODE ZIXO
      //
      //		   GPL license
      //
      /////////////////////////////////////////////////////
      
      
      
      global $theme;
      global $_lang;
      global $siteURL;
      global $base_path;
      
      $basePath = $modx->config['base_path'];
      $siteURL = $modx->config['site_url'];
      
      //-- get theme
      $tb_prefix = $modx->db->config['table_prefix'];
      $theme = $modx->db->select('setting_value', '`' . $tb_prefix . 'system_settings`', 'setting_name=\'manager_theme\'', '');
      $theme = $modx->db->getRow($theme);
      $theme = ($theme['setting_value'] <> '') ? '/' . $theme['setting_value'] : '';
      
      //-- setup initial vars
      $output = '';
      
      //-- include php files
      include_once $base_path.'manager/includes/controls/datagrid.class.php';
      include_once $base_path.'assets/snippets/adsmanager/adsmanager.inc.php';
      
      $rotator = new AdsManager();
      
      //-- get POST vars
      $mode = (isset ($_POST['mode'])) ? (int)$_POST['mode'] : 1;
      $id   = (isset ($_POST['idd'])) ? (int)$_POST['idd'] : 1;
      $from = (isset ($_POST['from'])) ? $_POST['from'] : '';
      $to   = (isset ($_POST['to'])) ? $_POST['to'] : '';
      
      //-- process POST actions if required
      
      $output .= ' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html '.($modx->config['manager_direction'] == 'rtl' ? 'dir="rtl"' : '').' lang="'.$modx->config['manager_lang_attribute'].'" xml:lang="'.$modx->config['manager_lang_attribute'].'"> 
      		<head>
                      <title>Ads management</title> 
      		<script type="text/javascript">var MODX_MEDIA_PATH = "media";</script>
      		<link rel="stylesheet" type="text/css" href="media/style' . $theme . '/style.css" /> 
      		<link rel="stylesheet" type="text/css" href="media/style' . $theme . '/coolButtons2.css" /> 
      		<link rel="stylesheet" type="text/css" href="media/style' . $theme . '/tabs.css"/> 
      		<link rel="stylesheet" type="text/css" href="../assets/snippets/adsmanager/datepicker.css"/> 
       		<script type="text/javascript" src="../assets/snippets/adsmanager/MooTools.js"></script>	
      		<script type="text/javascript" src="../assets/snippets/adsmanager/DatePicker.js"></script>	
      		<script type="text/javascript">
      			function goto(id)
      			{
      				$("mode").value = id;
      				$("ussr").submit();
      			}
      			
      			function edit(id)
      			{
      				$("idd").value = id;
      				goto(3);
      			}
      			
      			function save()
      			{
      				goto(4);
      			}			
      			
      			function add()
      			{
      				goto(6);
      			}
      			
      			function banner_delete()
      			{
      				if (confirm("Are you sure ?"))
      				{
      					goto(9);
      				}
      			}
      			
      			function set_dates(begin, end)
      			{
      				$("from").value = begin;
      				$("to").value = end;
      			}
      		</script>
      
      		</head><body><form name="ussr" id="ussr" method="post" action="#" enctype="multipart/form-data" style="padding:30px;">';
      $output .= '
      <div class="sectionHeader"><h2><a href="http://code.zixo.ru/">CODE ZIXO:</a> Graphical advertisement manegement</h2></div>
      <div class="sectionBody">
      ';		
      
      
      if ($mode != 8)
      	if (!($rotator->db_table_exists($rotator->db_prefix.'ads'))) { $mode = 7; }
      
      
      
      
      if ($mode == 1) {  /// active banners list
      	
      	if (isset($_POST['from']))	{
      		$start = $_POST['from'];
      	} else {$start = "2008-01-01";}
      	if (isset($_POST['to'])) 	{
      		$end = $_POST['to'];
      	}   else {$end   = date('Y-m-d');}
      	
      	$output.=
      "
      <h2>List of enabled banners</h2>
      
      Form 
      <input type='text' name='from' id='from' class='DatePicker' 
      alt='{format:\"yyyy-mm-dd\", yearStart:2015, yearRange:10, yearOrder: \"desc\"}' 
      value='$start' />
      to 
      <input type='text' name='to' id='to' class='DatePicker' 
      alt='{format:\"yyyy-mm-dd\", yearStart:2015, yearRange:10, yearOrder: \"desc\"}' 
      value='$end' />
       
      <input type='hidden' name='idd' id='idd'>
      <input type='hidden' name='mode' id='mode'>
                
      <input type='button' value='Update' onclick='javascript:goto(1);'>
      <br /><br />
      <table class='grid'>
      <tr>
      <td class='gridHeader'>Name</td>
      <td class='gridHeader'>Tags</td>
      <td class='gridHeader'>Views</td>
      <td class='gridHeader'>Clicks</td>
      <td class='gridHeader'>CTR</td>
      </tr>
      ";
      		if (isset($_POST['from'])) {
      			$stat = $rotator->get_banner_stats($start, $end, '1');
      		} else {
      			$stat = $rotator->get_banner_stats('', '', '1');
      		}
      		
      		foreach ($stat as $s)
      		{
      			$output .= "
      			<tr>
      			<td><a href='javascript:edit(\"".$s['id']."\");'>".$s['title']."</a></td>
      			<td>".$s['tags']."</td>
      			<td>".$s['bshow']."</td>
      			<td>".$s['bclick']."</td>
      			<td>".$s['ctr']."</td>
      			</tr>
      			";
      		}
      		$output .= '</table>';
      		$output .= '<br /><br/> <input type="button" value="Add banner" onclick="javascript:goto(5);">';
      		$output .= '<input type="button" value="List of disabled baners" onclick="javascript:set_dates(\'\', \'\');goto(2);">';
      } else if ($mode == 2) {  /// disabled banners
      	
      	if (isset($_POST['from']))	{
      		$start = $_POST['from'];
      	} else {$start = "2008-01-01";}
      	if (isset($_POST['to'])) 	{
      		$end = $_POST['to'];
      	}   else {$end   = date('Y-m-d');}
      	
      	$output.=
      "
      <h2>Disabled list</h2>
      
      Form 
      <input type='text' name='from' id='from' class='DatePicker' 
      alt='{format:\"yyyy-mm-dd\", yearStart:2015, yearRange:10, yearOrder: \"desc\"}' 
      value='$start' />
      to 
      <input type='text' name='to' id='to' class='DatePicker' 
      alt='{format:\"yyyy-mm-dd\", yearStart:2015, yearRange:10, yearOrder: \"desc\"}' 
      value='$end' />
      
      <input type='hidden' name='idd' id='idd'>
      <input type='hidden' name='mode' id='mode'>
                
      <input type='button' value='Update' onclick='javascript:goto(2);'>
      <br /><br />
      <table class='grid'>
      <tr>
      <td class='gridHeader'>Name</td>
      <td class='gridHeader'>Tags</td>
      <td class='gridHeader'>Views</td>
      <td class='gridHeader'>Clicks</td>
      <td class='gridHeader'>CTR</td>
      </tr>
      ";
      		if (isset($_POST['from'])) {
      			$stat = $rotator->get_banner_stats($start, $end, '0');
      		} else {
      			$stat = $rotator->get_banner_stats('', '', '0');
      		}
      		
      		foreach ($stat as $s)
      		{
      			$output .= "
      			<tr>
      			<td><a href='javascript:edit(\"".$s['id']."\");'>".$s['title']."</a></td>
      			<td>".$s['filter']."</td>
      			<td>".$s['bshow']."</td>
      			<td>".$s['bclick']."</td>
      			<td>".$s['ctr']."</td>
      			</tr>
      			";
      		}
      		$output .= '</table>';
      		$output .= '<br /><br/> <input type=button value="Add" onclick="javascript:goto(5);">';
      		$output .= '<input type=button value="List of enabled banners" onclick="set_dates(\'\', \'\');javascript:goto(1);">';	
      
      } else if ($mode == 3) {  /// edit
      
      	$banner = $rotator->get_banner($id);
      	$img = $banner['img'];
      	$filter = $banner['filter'];
      	$link = $banner['link'];
      	$title = $banner['title'];
      	$width = $banner['width'];
      	$height = $banner['height'];
      	$active = $banner['active'];
      	
      	$output .= 
      	"
      	<input type='hidden' name='idd' id='idd' value='$id'>
      	<input type='hidden' name='mode' id='mode'>
      	<input type='hidden' name='active' id='active' value='$active'>
      	<img src='$img' alt='not found'><br /><br />
      	<table class=grid>
      	<tr><td class='gridHeader'>Image:</td><td> <input type='text' name='img' id='img' value='$img' size='60' /></tr>
      	<tr><td class='gridHeader'>Title:</td><td> <input type='text' name='title' id='title' value='$title' /></tr>
      	<tr><td class='gridHeader'>Link:</td><td>   <input type='text' name='link' id='link' value='$link' size='60' /></tr>
      	<tr><td class='gridHeader'>Width:</td><td> <input type=text name=width id=width value='$width' /></tr>
      	<tr><td class='gridHeader'>Height:</td><td> <input type='text' name='height' id='height' value='$height' /></tr>
      	<tr><td class='gridHeader'>Tags:</td><td> <input type='text' name='filter' id='filter' value='$filter' /></tr>
      	</table><br /><br />
      	<h3>Clicks</h3>
      	<table class='grid'>
      	<tr>
      		<td class='gridHeader'>Date:</td>
      		<td class='gridHeader'>IP:</td>
      	</tr>
      ";
      	$output .= $rotator->show_clicks($id);
      	$output .= 
      "
      	</table><br /><br />
      
      	<input type='button' onclick='save();' value='Save'>
      	";
      
      	if ($active == '1')
      	{
      		$output .= "<input type='button' onclick='$(\"active\").value=\"0\"; save();' value='Disable'>";
      	} else {
      		$output .= "<input type='button' onclick='$(\"active\").value=\"1\"; save();' value='Enable'>";
      	}
      	
      	if ($active == '0') 
      	{	$output .= '<input type="button" value="Delete" onclick="javascript:banner_delete();"><br /><br/> ';}
      
      	$output .= "<input type='button' onclick='goto(1);' value='Go back'>";
      	
      } else if ($mode == 4) {  /// save
      	$img = $_POST['img'];
      	$filter = $_POST['filter'];
      	$link = $_POST['link'];
      	$title = $_POST['title'];
      	$width = $_POST['width'];
      	$height = $_POST['height'];
      	$active = $_POST['active'];
      
      	$rotator->save_banner($id, $title, $img, $width, $height, $link, $active, $filter);
      	echo "
      	<input type='hidden' name='mode' id='mode' value='1'>
      	<script type='text/javascript'>$('ussr').submit();</script>
      	";	
      } else if ($mode == 5) { /// new
      $output .= 
      	"
      	<input type='hidden' name='mode' id='mode'>
      	<input type='hidden' name='active' id='active' value='1'>
      	<table class='grid'>
      	<tr><th>Image (GIF, PNG, JPG, SWF):</th><td> <input type='text' name='img' id='img' size='60' /><br \>
      	<input type='hidden' name='MAX_FILE_SIZE' value='100000' />
      	<input name='userfile' type='file' />
      	</tr>
      	<tr><td class='gridHeader'>Width:</td><td> <input type=text name=width id=width></tr>
      	<tr><td class='gridHeader'>Height:</td><td> <input type=text name=height id=height></tr>
      	<tr><td class='gridHeader'>Title:</td><td> <input type=text name=title id=title></tr>
      	<tr><td class='gridHeader'>Link:</td><td>   <input type=text name=link id=link size=60></tr>
      	<tr><td class='gridHeader'>Tags:</td><td> <input type=text name=filter id=filter></tr>
      	</table><br /><br />
      	<input type=button onclick='add();' value='Save'>
      	<input type=button onclick='goto(1);' value='Go back'>	
      	";
      } else if ($mode == 6) { // save new
              $baseURL = $_SERVER['REQUEST_URI'];
              $baseURL = substr($baseURL, 0, strpos($baseURL, '/manager/'));	
      	if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
                      $img = $rotator->banners_path . '/' . $_FILES['userfile']['name'];
      		$dir = $basePath . $img;
      		move_uploaded_file($_FILES['userfile']['tmp_name'], $dir );
      	} else {
                      $baseURL = '';
      		$img = $_POST['img'];
      	}
      	
      	if (file_exists($dir))
      	{
      		$filter = $_POST['filter'];
      		$link = $_POST['link'];
      		$title = $_POST['title'];
      		$width = $_POST['width'];
      		$height = $_POST['height'];
      		$active = $_POST['active'];
      
      		$rotator->add_banner($title, $baseURL.$img, $width, $height, $link, $active, $filter);
      	
      		echo "
      		<input type='hidden' name='mode' id='mode' value='1'>
      		<script type='text/javascript'>$('ussr').submit();</script>
      		";	
      	} else {
      		echo "
      		<input type='hidden' name='mode' id='mode' value='1'>
      		<h2>Cannot add banner! Check if [/assets/snipplets/adsmanager/banners]
      		exist and if it is writeable!
      		</h2>
      	    <input type='button' onclick='goto(8);' value='Go back'>	
      		";
      	}
      } else if ($mode == 7) { // prepare for install
      	$output .= '<h2>Warning! Ads manager is not yet installed.</h2>
      	<input type="hidden" name="mode" id="mode" />
      	<p>
      	During the installation process, three mysql tables will be created and a folder for
      	banner placement [/assets/snipplets/adsmanager/banners]. <br /><br />
      	<input type="button" onclick="goto(8);" value="Start the installation" />	
      	</p>	
      	';
      //	$output .= $rotator->install();	
      } else if ($mode == 8) { // installation
      	$output .= '<h2>Installation finished!</h2>
      	<p>Please, make sure the [/assets/snipplets/adsmanager/banners] is writeable!</p>
      <input type="hidden" name="mode" id="mode" /><br /><br />
      	';
      	$output .= $rotator->install();
      	$output .= '<br /><br />
          <input type="button" onclick="goto(1);" value="Go to the Ads Manager" />	
      	';	
      } else if ($mode == 9) { // delete
      
      	$rotator->delete_banner($id);
      
      	echo "
      	<input type='hidden' name='mode' id='mode' value='1' />
      	<script type='text/javascript'>$('ussr').submit();</script>
      	";	
      
      }
      
      $output.='</div></form></body></html>';
      return $output;
      
      
      //?>
        Patrick | Server Wrangler
        About Me: Website | Tweets |  MODX Hosting
        • 13137
        • 204 Posts
        Strange, Im using FF 3.04, and install and all buttons seem to work for me.

        Will take a look at your addition too though.
          • 25969
          • 118 Posts
          If you use something like Adblock Plus, you’ll need to whitelist any website you’re using this with because resources won’t link up due to ad-stripping.
            • 13137
            • 204 Posts
            Possibly another idea for the future could be vertical and horizontal options..

            that way you could run sets and an ad group would grab only from one type of ad.

            just thinking out laud.
              • 25969
              • 118 Posts
              Quote from: islander at Feb 14, 2009, 05:03 AM
              Possibly another idea for the future could be vertical and horizontal options, that way you could run sets and an ad group would grab only from one type of ad, just thinking out laud.
              I mentioned that earlier too but I’d say that’s what the unfinished tags/filters are for which would be a more flexible option.
                • 25969
                • 118 Posts
                Quote from: sal at Feb 13, 2009, 10:46 PM
                If you use something like Adblock Plus, you’ll need to whitelist any website you’re using this with because resources won’t link up due to ad-stripping.
                I’m just RQ this as it’s why some would have had problems earlier with buttons not working.

                Anyone work out why the view counts go crazy with this? That function is definitely not in a usable state.
                  • 20289
                  • 958 Posts
                  Cool, I’ll test it out and compare with what i have in my box, Maybe there will be a second to this tool wink
                    [img]http://i10.tinypic.com/52c4eir.gif[/img][/td]
                    [td][Wiki] [Persian support forum]
                    [SVN] [RTL SVN Branch] [bugs] [FishEye+Crucible] [Learn MODx!] | [My Google Code]
                    [font=tahoma][برای دسترسی به راهنمای فارسی به [url=http://www.modxcms.ir]
                    • 26260
                    • 12 Posts
                    Quote from: sal at Feb 14, 2009, 06:22 AM

                    Quote from: islander at Feb 14, 2009, 05:03 AM
                    Possibly another idea for the future could be vertical and horizontal options, that way you could run sets and an ad group would grab only from one type of ad, just thinking out laud.
                    I mentioned that earlier too but I’d say that’s what the unfinished tags/filters are for which would be a more flexible option.
                    ... Any news on this?... I would hate to tinker with adding such options, if someone else is allready doing the job.

                    Besides... have anyone thought about using several "AdsDisplay" in the same template?.. like one for a top-banner, one for a skyscraper or two, to the right, and several minor ads inside the content for instance?

                    This would require some sort of control/setting in the template’s snippet-call, that determines which "kind-of-ad" each accomodates. And off course, the AdsManager would have to record "kind-of-ad" for each entry... which might be a good use of the unfinished "tag" attribute I guess.

                    Also, it would be nice, if the engine never displays the same ad twice on one page, as long as there are enough ads in the system to avoid it.

                    Anyway... is someone working on this?

                    PS:
                    I have just encountered a problem with .swf-files, which won’t display (neither in the AdsManager nor in the finished page output), and the outputted code looks a bit hmmm... "off"... but I’m not used to embedding swf, so it might just be me.
                    Does anybody know anything about this?

                    PPS:
                    I also noticed, that the "Title"-attribute entered in the Manager, becomes the "alt"-attribute in the output... which seems counter intuitive to me.
                    Likewise, I’m having trouble with the way the actual address for the ad-link is "masked" as an internal link on the site (i.e.: MySite.com/adsmanager.inc.php?ad=2)... this is not nice to visitors wanting to click... they should have the ability to see beforehand, where they will be sent off to.
                      Creativity is 1% inspiration and 99% perspiration.
                      • 1330
                      • 79 Posts
                      I am having an issue with the ad image loading.  The link is working but the image wont load and it will only pull ad #1 rather then the full list of ads.
                      http://www.shawnmangeot.com/index.php?id=41

                      Edit: corrected by adding size. Would prefer this function be disabled so you do not have to add it.
                      Though it is still only showing 1 ad.