Page 1 of 1

Data Feed questions

Posted: Fri Dec 16, 2005 6:44 pm
by Edwin Jeffords
Okay heres the deal.  Im building a sports handicapper website.  The cms is configured and templates built, etc.

Our data (lines, game matchups, etc) comes from a 3rd party data feed. I assumed I could add the code to a template and it would run.  Unfortunately, that was an incorrect assumption.

The code is below:


";
      echo "$data";
  } else {
      echo "System Configuration error.";
  }

?>


Seems simple enough, but it wouldnt run from within the template, so i created a function in cmsms and called it {feed}  This appropriately shows the data when the page is loaded.  You can see a version of this here:  http://www.thewinningadvantage.com/cms/ ... ernt_Lines

My problem is that the code refers to an external file (sportsdata.php)  so even though the above link looks correct, nothing works once you click on a link.  The navigation goes outside of the CMS and references this sportsdata.php page, which i have built with the same template.  But since this page is not part of the CMS, none of the call tags work such as {cmsmodule module='PHPLayers'} or {footer}, etc.

Any ideas.  This shouldnt be this hard, but I think Im making it hard on my self.

I basically just need the cms to recognize that code and use it for the content on certain pages.  ANY help would be appreciated.

Thanks

Re: Data Feed questions

Posted: Fri Dec 16, 2005 10:17 pm
by alby
Edwin Jeffords wrote: ...................
The code is below:


<?php
$host = 'feed.bettorinfo.com/serials';
$serial = 'XXXXXXXXXXXXXXXXXXXX';
...................
Insert password, serial and other it's a bad idea..  :o
Al

Re: Data Feed questions

Posted: Mon Dec 19, 2005 4:55 pm
by Piratos
Works fine:



[attachment deleted by admin]

Re: Data Feed questions

Posted: Mon Dec 19, 2005 4:57 pm
by Piratos
And this is the code :

Code: Select all

<?php


function smarty_cms_function_test($params, &$smarty) {
global $gCms;
$host = 'feed.bettorinfo.com/serials';
   $serial = 'JP5J5-J8XCI-CNKPH-F85BN-485BF';

   $data = @implode('', @file("http://$host/$serial/loader.src?$QUERY_STRING")
);
   if ($data) {
      echo "<link href=\"procappers.css\" rel=\"stylesheet\"
type=\"text/css\">";
      echo "$data";
   } else {
      echo "<b class=\"feeddata\">System Configuration error.</b>";
   }


}


?>

Re: Data Feed questions

Posted: Mon Dec 19, 2005 6:39 pm
by Piratos
Here is the complete working code:

Code: Select all

<?php


function smarty_cms_function_test($params, &$smarty) {
global $gCms;
  $x=array_keys($_GET);
  $ii=count($x);
  $i=0;
  $link2="";
  foreach ($x as $one)
  { $i++;
    if ($i>1) $link2 .=$one.'='.$_GET[$one];
    if ($i<$ii && $i>1) $link2 .="&";
  }

  $host = 'feed.bettorinfo.com/serials';
   $serial = 'JP5J5-J8XCI-CNKPH-F85BN-485BF';
   $data = @implode('', @file("http://$host/$serial/loader.src?$link2"));
   $data =str_replace('sportsdata.php?', 'index.php?page=Home&',$data);

   if ($data) {
      echo "$data";
   } else {
      echo "<b class=\"feeddata\">System Configuration error.</b>";
   }


}


?>


[attachment deleted by admin]