• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[8wayRun.Com] XenPorta (Module Add-Ons)

Those are not valid returns. When you return, you return $Weather, so you'll need to make an array with elements:
Code:
<?php
class EWRporta_Block_Weather extends XenForo_Model
{
	public function getModule()
	{
		$doPrintNWS = false;

		require_once '/home4/thebooth/public_html/xx/weather/advisories.php';
		require_once '/home4/thebooth/public_html/xx/weather/advforecast2.php';

		return array(
			'advisory_html' => $advisory_html,
			'weather_html' => $weather_html,
		);
	}
}

In fact, you should post the contents of those two required files...
 
OK, here is a complete insert of the entire php call which I included both PHP files into the block call.
There are three sections....

The advisory call which output $advisory_html
The weather call which outputs $weather_html
Then both scripts functions which are simply included at the end.

SCRATCH......... I had to delete a majority of the code to get it to post. I tried to leave those areas which seemed to impact rendering....

PHP:
<?php
class EWRporta_Block_Weather extends XenForo_Model
  {
    function getModule()
          {
chdir('/home4/thebooth/public_html/xxxx/weather/');
//==================================================================================
//Begin Advisory Script
//==================================================================================
$invalid_zone = 0;
if (!preg_match("/^[a-z]{2}[C|Z][0-9]{3}$/i", $Zone)) {
  $invalid_zone = 1; // valid zone syntax from $DefaultZone setting
}
if (isset($_GET['zone']) && preg_match("/^[a-z]{2}[C|Z][0-9]{3}$/i", $_GET['zone'])) {
  $Zone = $_GET['zone'];  // valid zone syntax from input
} else if (isset ($_GET['zone']) && !preg_match("/^[a-z]{2}[C|Z][0-9]{3}$/i", $_GET['zone'])) {
  $invalid_zone = 1;  // invalid zone syntax from input
}
if (isset ($_GET['detailpage']) ) {
  $detailpage = $_GET['detailpage'];
}
if (isset($detailpage) ) {
  $t = parse_url(urldecode($detailpage));
  if (isset ($t['path'])) {
    $t['path'] = htmlspecialchars(strip_tags($t['path']));
    $t['path'] = preg_replace('/[^A-Za-z0-9-._]/i','', $t['path']); // character filter
    $Status .= "<!-- detailpage\n" . $t['path'] . " -->\n";
    $hurlURL = $t['path'];
  }
}
if (isset ($_GET['cache']) and strtolower($_GET['cache']) == 'refresh') {
  $refetchSeconds = 1;
}
$Zone = strtoupper(preg_replace('/[^A-Za-z0-9]/i', '', $Zone));
$RSS_URL = "http://www.weather.gov/alerts-beta/wwaatmget.php?x=$Zone";
$t = pathinfo($PHP_SELF);
$Program = $t['basename'];
$cacheName = preg_replace('|\.txt$|i', "-$Zone.txt", $cacheName);
$Status = "<!-- $Version -->\n";
$html = '';

if (!$invalid_zone) {

}
else {
  $Status .= "<!-- getting new file from $RSS_URL -->\n";
  if (!function_exists('curl_init')) {
    $xml = GrabURLWithoutHangingTW($RSS_URL);
  }
  else {
    $xml = curl_fetch_file($RSS_URL,0);
  }
  $Status .= $curl_debug;
  $curl_debug = '';
  $xml = str_replace("cap:", 'cap_', $xml);
  $junk = 'n/a';
  if (preg_match("/\r\n\r\n/", $xml)) {
    list($junk, $xml) = explode("\r\n\r\n", $xml, 2);
  }
  if ($xml == '') {
    $xml = $junk;    // curl method does not have the headers
    $junk = 'n/a';
  }
  if (preg_match("/invalid zone/i", $xml)) {
    $xml = 'invalid zone';
  }
  if ($xml != 'invalid zone') { // not going to be a valid data return, do not cache it
    $fp = fopen('/home4/thebooth/public_html/xxxx/weather/advisory-VAZ055.txt', "w");
    if ($fp) {
      $write = fputs($fp, $xml);
      fclose($fp);
      $Status .= "<!-- cache saved to $cacheName -->\n";
    }
    else {
      $Status .= "<!-- unable to write $cacheName -->\n";
    }
  }
  if (strlen($xml) < 300 && $xml != 'invalid zone') {  // not going to be a valid data return, do cache it
    $Status .= "<!-- HTML characters length = " . strlen($xml) . " -->\n";
    $Status .= "<!-- HTML headers received: " . htmlspecialchars(strip_tags(trim($junk))) . " -->\n";
    $Status .= "<!-- HTML received: " . htmlspecialchars(strip_tags(str_replace('-->','',trim($xml)))) . " -->\n";
    $get_file_failed = 1;
  }
}
} else {
  $xml = 'invalid zone';
}

if ($xml == 'invalid zone') {
      $advisory_html = "${string}${Status}<div class=\"advisoryBoxnoactive\">Top Warning Information Unavailable, invalid advisory zone selected.</div>\n";
}
else if ($get_file_failed == 1) {
      $advisory_html = "${string}${Status}" . graceful_error();
}
else if ($get_file_failed == 2) {
      $advisory_html = "${string}${Status}<div class=\"advisoryBoxnoactive\">Top Warning Information Unavailable, cache file conflict, view source for details.</div>";
}
else {
  $advisory_html = advisory_main_code();
}
$advisory_html .= "<!-- zone=$Zone -->\n";
//------------------------------------------------------------------------
return "$advisory_html";
//------------------------------------------------------------------------

//=========================================================================
//Begin the Weather Script
//=========================================================================

///etc.......
          $weather_html = "
                <div>
                    <table style='font-size:9px;' width='100%'>
                        <tr align='center' valign='top'>
                            <td>{xen:raw $forecasticons[0]}</td>
                            <td>{xen:raw $forecasticons[1]}</td>
                            <td>{xen:raw $forecasticons[2]}</td>
                            <td>{xen:raw $forecasticons[3]}</td>
                            <td>{xen:raw $forecasticons[4]}</td>
                            <td>{xen:raw $forecasticons[5]}</td>
                            <td>{xen:raw $forecasticons[6]}</td>
                        </tr>
                        <tr align='center' valign='top'>
                            <td>{xen:raw $forecasttemp[0]}</td>
                            <td>{xen:raw $forecasttemp[1]}</td>
                            <td>{xen:raw $forecasttemp[2]}</td>
                            <td>{xen:raw $forecasttemp[3]}</td>
                            <td>{xen:raw $forecasttemp[4]}</td>
                            <td>{xen:raw $forecasttemp[5]}</td>
                            <td>{xen:raw $forecasttemp[6]}</td>
                        </tr>
                    </table>
                </div>
                <div>
                    <table>
                        <tr>
                            <td colspan=7><hr/></td>
                        </tr>
                        <tr>
                            <td><b>{xen:raw $forecasttitles[0]}</b></td>
                            <td></td>
                            <td colspan=5>{xen:raw $forecasttext[0]}</td>
                        </tr>
                        <tr>
                            <td colspan=7><hr/></td>
                        </tr>
                        <tr>
                            <td><b>{xen:raw $forecasttitles[1]}</b></td>
                            <td></td>
                            <td colspan=5>{xen:raw $forecasttext[1]}</td>
                        </tr>
                        <tr>
                            <td colspan=7><hr/></td>
                        </tr>
                        <tr>
                            <td><b>{xen:raw $forecasttitles[2]}</b></td>
                            <td></td>
                            <td colspan=5>{xen:raw $forecasttext[2]}</td>
                        </tr>
                        <tr>
                        <tr>
                            <td colspan=7><hr/></td>
                        </tr>
                        <tr>
                            <td><b>{xen:raw $forecasttitles[3]}</b></td>
                            <td></td>
                            <td colspan=5>{xen:raw $forecasttext[3]}</td>
                        </tr>
                        <tr>
                        <tr>
                            <td colspan=7><hr/></td>
                        </tr>
                        <tr>
                            <td><b>{xen:raw $forecasttitles[4]}</b></td>
                            <td></td>
                            <td colspan=5>{xen:raw $forecasttext[4]}</td>
                        </tr>
                        <tr>
                        <tr>
                            <td colspan=7><hr/></td>
                        </tr>
                        <tr>
                            <td><b>{xen:raw $forecasttitles[5]}</b></td>
                            <td></td>
                            <td colspan=5>{xen:raw $forecasttext[5]}</td>
                        </tr>
                        <tr>
                            <td colspan=7><hr/></td>
                        </tr>
                        <tr>
                            <td><b>{xen:raw $forecasttitles[6]}</b></td>
                            <td></td>
                            <td colspan=5>{xen:raw $forecasttext[6]}</td>
                        </tr>
                </div>";
//------------------------------------------------------------------------------------------
return "$weather_html";
//------------------------------------------------------------------------------------------
chdir('/home4/thebooth/public_html/xxxx/');
}
}
//-------------------------------------------------------------------------------------------
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<functions>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
?>
 
OK!
Using your code it appears I am closer...
I now have the raw HTML displayed in the areas.... I figure a xen:raw will fix that?
Trying it now...
 
You would be better constructing it as follows... without any requires:
Code:
<?php
class EWRporta_Block_Weather extends XenForo_Model
{
	public function getModule()
	{
		return array(
			'advisory_html' => $this->getAdvisory,
			'weather_html' => $this->getWeather,
		);
	}

	public function getAdvisory()
	{
		$invalid_zone = 0;
		if (!preg_match("/^[a-z]{2}[C|Z][0-9]{3}$/i", $Zone)) {
		  $invalid_zone = 1; // valid zone syntax from $DefaultZone setting
		}
		if (isset($_GET['zone']) && preg_match("/^[a-z]{2}[C|Z][0-9]{3}$/i", $_GET['zone'])) {
		  $Zone = $_GET['zone'];  // valid zone syntax from input
		} else if (isset ($_GET['zone']) && !preg_match("/^[a-z]{2}[C|Z][0-9]{3}$/i", $_GET['zone'])) {
		  $invalid_zone = 1;  // invalid zone syntax from input
		}
		if (isset ($_GET['detailpage']) ) {
		  $detailpage = $_GET['detailpage'];
		}
		if (isset($detailpage) ) {
		  $t = parse_url(urldecode($detailpage));
		  if (isset ($t['path'])) {
			$t['path'] = htmlspecialchars(strip_tags($t['path']));
			$t['path'] = preg_replace('/[^A-Za-z0-9-._]/i','', $t['path']); // character filter
			$Status .= "<!-- detailpage\n" . $t['path'] . " -->\n";
			$hurlURL = $t['path'];
		  }
		}
		if (isset ($_GET['cache']) and strtolower($_GET['cache']) == 'refresh') {
		  $refetchSeconds = 1;
		}
		$Zone = strtoupper(preg_replace('/[^A-Za-z0-9]/i', '', $Zone));
		$RSS_URL = "http://www.weather.gov/alerts-beta/wwaatmget.php?x=$Zone";
		$t = pathinfo($PHP_SELF);
		$Program = $t['basename'];
		$cacheName = preg_replace('|\.txt$|i', "-$Zone.txt", $cacheName);
		$Status = "<!-- $Version -->\n";
		$html = '';

		if (!$invalid_zone) {

		}
		else {
		  $Status .= "<!-- getting new file from $RSS_URL -->\n";
		  if (!function_exists('curl_init')) {
			$xml = GrabURLWithoutHangingTW($RSS_URL);
		  }
		  else {
			$xml = curl_fetch_file($RSS_URL,0);
		  }
		  $Status .= $curl_debug;
		  $curl_debug = '';
		  $xml = str_replace("cap:", 'cap_', $xml);
		  $junk = 'n/a';
		  if (preg_match("/\r\n\r\n/", $xml)) {
			list($junk, $xml) = explode("\r\n\r\n", $xml, 2);
		  }
		  if ($xml == '') {
			$xml = $junk;    // curl method does not have the headers
			$junk = 'n/a';
		  }
		  if (preg_match("/invalid zone/i", $xml)) {
			$xml = 'invalid zone';
		  }
		  if ($xml != 'invalid zone') { // not going to be a valid data return, do not cache it
			$fp = fopen('/home4/thebooth/public_html/xxxx/weather/advisory-VAZ055.txt', "w");
			if ($fp) {
			  $write = fputs($fp, $xml);
			  fclose($fp);
			  $Status .= "<!-- cache saved to $cacheName -->\n";
			}
			else {
			  $Status .= "<!-- unable to write $cacheName -->\n";
			}
		  }
		  if (strlen($xml) < 300 && $xml != 'invalid zone') {  // not going to be a valid data return, do cache it
			$Status .= "<!-- HTML characters length = " . strlen($xml) . " -->\n";
			$Status .= "<!-- HTML headers received: " . htmlspecialchars(strip_tags(trim($junk))) . " -->\n";
			$Status .= "<!-- HTML received: " . htmlspecialchars(strip_tags(str_replace('-->','',trim($xml)))) . " -->\n";
			$get_file_failed = 1;
		  }
		}
		} else {
		  $xml = 'invalid zone';
		}

		if ($xml == 'invalid zone') {
			  $advisory_html = "${string}${Status}<div class=\"advisoryBoxnoactive\">Top Warning Information Unavailable, invalid advisory zone selected.</div>\n";
		}
		else if ($get_file_failed == 1) {
			  $advisory_html = "${string}${Status}" . graceful_error();
		}
		else if ($get_file_failed == 2) {
			  $advisory_html = "${string}${Status}<div class=\"advisoryBoxnoactive\">Top Warning Information Unavailable, cache file conflict, view source for details.</div>";
		}
		else {
		  $advisory_html = advisory_main_code();
		}
		$advisory_html .= "<!-- zone=$Zone -->\n";

		return "$advisory_html";
	}

	public function getWeather()
	{
		$weather_html = "
			<div>
				<table style='font-size:9px;' width='100%'>
					<tr align='center' valign='top'>
						<td>{xen:raw $forecasticons[0]}</td>
						<td>{xen:raw $forecasticons[1]}</td>
						<td>{xen:raw $forecasticons[2]}</td>
						<td>{xen:raw $forecasticons[3]}</td>
						<td>{xen:raw $forecasticons[4]}</td>
						<td>{xen:raw $forecasticons[5]}</td>
						<td>{xen:raw $forecasticons[6]}</td>
					</tr>
					<tr align='center' valign='top'>
						<td>{xen:raw $forecasttemp[0]}</td>
						<td>{xen:raw $forecasttemp[1]}</td>
						<td>{xen:raw $forecasttemp[2]}</td>
						<td>{xen:raw $forecasttemp[3]}</td>
						<td>{xen:raw $forecasttemp[4]}</td>
						<td>{xen:raw $forecasttemp[5]}</td>
						<td>{xen:raw $forecasttemp[6]}</td>
					</tr>
				</table>
			</div>
			<div>
				<table>
					<tr>
						<td colspan=7><hr/></td>
					</tr>
					<tr>
						<td><b>{xen:raw $forecasttitles[0]}</b></td>
						<td></td>
						<td colspan=5>{xen:raw $forecasttext[0]}</td>
					</tr>
					<tr>
						<td colspan=7><hr/></td>
					</tr>
					<tr>
						<td><b>{xen:raw $forecasttitles[1]}</b></td>
						<td></td>
						<td colspan=5>{xen:raw $forecasttext[1]}</td>
					</tr>
					<tr>
						<td colspan=7><hr/></td>
					</tr>
					<tr>
						<td><b>{xen:raw $forecasttitles[2]}</b></td>
						<td></td>
						<td colspan=5>{xen:raw $forecasttext[2]}</td>
					</tr>
					<tr>
					<tr>
						<td colspan=7><hr/></td>
					</tr>
					<tr>
						<td><b>{xen:raw $forecasttitles[3]}</b></td>
						<td></td>
						<td colspan=5>{xen:raw $forecasttext[3]}</td>
					</tr>
					<tr>
					<tr>
						<td colspan=7><hr/></td>
					</tr>
					<tr>
						<td><b>{xen:raw $forecasttitles[4]}</b></td>
						<td></td>
						<td colspan=5>{xen:raw $forecasttext[4]}</td>
					</tr>
					<tr>
					<tr>
						<td colspan=7><hr/></td>
					</tr>
					<tr>
						<td><b>{xen:raw $forecasttitles[5]}</b></td>
						<td></td>
						<td colspan=5>{xen:raw $forecasttext[5]}</td>
					</tr>
					<tr>
						<td colspan=7><hr/></td>
					</tr>
					<tr>
						<td><b>{xen:raw $forecasttitles[6]}</b></td>
						<td></td>
						<td colspan=5>{xen:raw $forecasttext[6]}</td>
					</tr>
			</div>";

		return "$weather_html";
	}
}
However, keep in mind that your code is inherently BROKEN. First of all, the variable $Zone doesn't exist when it's first checked in your advisory function. Secondly, the entire weather function doesn't work. You cant build template variable calls within a function; they can only be built within a template view class. Instead of parsing the HTML through the function like this, why don't you just put the HTML into the template?

If you need help debugging your code to get it to function properly, create a thread in the development help forum.
 
I will gladly appreciate help in making this code work better (in fact it is a modified version of weather scripts from saratoga-weather.org)

However...

I have been successful with some minor formatting issues...

Here is kinda what I was trying to achieve....

As for the above post being broken - correct, I tried to mention the xenforo 10000 character limit caused me to delete 50% of the code.
 

Attachments

  • weather.webp
    weather.webp
    39.9 KB · Views: 60
Hey Jaxel! Thanks for all your help. I had to resort to my included files for some portions - but...
I finally have everything working that I wanted - you can see here: http://potomacboaters.com/portal/
Granted I have some formatting issues to work out - but it works for now...

I would be more than happy to submit the code behind this mess (and I mean mess)....
I would like to see something like this usable for everyone and not so hard-coded.

Let me know if anyone is interested...
This is a combination of advisory and forecast scripts from saratoga-weather.org
Two custom scripts for parsing NOAA reports
My reports from my XTide generator
and the tabs are Dynamic Drive....
 
Should the Events Module have a Title Called EVENTS ? It's hard to tell what they are otherwise.
At the end of all things such as Posts, Events, Recent Status Updates ... should there be [MORE] Links ?
 
Should the Events Module have a Title Called EVENTS ? It's hard to tell what they are otherwise.
At the end of all things such as Posts, Events, Recent Status Updates ... should there be [MORE] Links ?

Where did you snag the events module? I've been looking for it. Saw it mentioned but thought it wasn't released yet.... :-)
 
Question:
What is the best practise for reading and writing dynamic files?
For example my weather script... It pulls in a new forecast (txt) and reads the contents.
Seems xenForo has some protections in place for various directories and I'd like to make a working mod that functions properly and stores everything correctly.

also

Can I take a module setting and pass it back to the php block?
I was thinking I could ask the user to input a weather "zone" and then pass the zone value back to the php block to get the correct forcast.
 
However, keep in mind that your code is inherently BROKEN. First of all, the variable $Zone doesn't exist when it's first checked in your advisory function. Secondly, the entire weather function doesn't work. You cant build template variable calls within a function; they can only be built within a template view class. Instead of parsing the HTML through the function like this, why don't you just put the HTML into the template?

If you need help debugging your code to get it to function properly, create a thread in the development help forum.


Jaxel,

Love the new releases! I am having trouble with two modules. The latest News module isn't showing a preview of my posts. Did I do something wrong?

And then I added the Events module, but every time I add it the portal becomes unavailable. I have tried deleting the module, but it wont let me. I did add the module BEFORE upgrading the Events addon. Would that have something to do with it?
 
Jaxel,

Love the new releases! I am having trouble with two modules. The latest News module isn't showing a preview of my posts. Did I do something wrong?

And then I added the Events module, but every time I add it the portal becomes unavailable. I have tried deleting the module, but it wont let me. I did add the module BEFORE upgrading the Events addon. Would that have something to do with it?
With the news module, make sure you import the new XML file. As I said, it was rewritten.

With the events module, as long as you have the new events addon, it should work.
 
With the news module, make sure you import the new XML file. As I said, it was rewritten.

With the events module, as long as you have the new events addon, it should work.

Tried working with both. Not going so hot. Tried removing XenPortal completely to readd and it wouldnt let me. Any idea what I am doing wrong?
 
OK,
I got my routines finished and I like how they turned out.
A few lessons learned I thought I'd share - perhaps common sense but....

1. If you plan to pass a variable to your block (like some HTML from an included from a PHP file), I had to declare that variable as a global in the block PHP.
2. The save of the cache for modules does not like the "degree" symbol at all. Will result in a database error.
3. If you going to have a module write a file to your system (like an RSS feed or in my case a downloaded weather report), it would be best to save that block of code as a PHP file and include it.
I ran into some issues having the block PHP code writing files. Again, prolly doing something wrong, but I'd have a file in /data/ work great - if I copy/pasted the code in the block PHP - error.

Thanks again!
All I need now is the gallery and I'm back in the game!
 
Tried working with both. Not going so hot. Tried removing XenPortal completely to readd and it wouldnt let me. Any idea what I am doing wrong?

I too have problems.
The News only says ... Continue
The Events causes crash on /portal/ page.
 
Perhaps my module is a bit to specialized, but I am going to post what I did so others might be able to use it. I have mentioned previously what I am using in prior posts, so I won't repeat.

Here is my PHP Block code:
PHP:
<?php
class EWRporta_Block_Outlook extends XenForo_Model
   {
    public function getModule()
          {
  global $alert_html,$weather_html,$tide_html,$rss_html,$pdf_html,$tabs_html,$xfURL,$xfPATH,$xfDATA;
  $xfURL="[URL]http://".$_SERVER['HTTP_HOST'[/URL]];
  $xfPATH=$_SERVER['DOCUMENT_ROOT'];
  $xfDATA=$xfPATH."/data/weather/";
 //Advisory
        $DefaultZone = 'VAZ055'; // set to your NOAA zone
        $detailpage  = 'advisories.php'; // overrides $hurlURL setting
        $doSummary   = 1;  // display alert links only, not full alert details
        $includeOnly = 1;  // include mode
        $noprint     = 1;  // required for echo $advisory_html output
        chdir($xfDATA);
        require_once 'advisory.php';
           if (preg_match("|There are no active|i",$advisory_html) ||
            preg_match("|Advisory Information Unavailable|i",$advisory_html)) {
            $alert_html = '<div class="advisoryBoxnoactive">' .$advisory_html .'</div>';
            }else{
            $alert_html = '<div class="advisoryBox">' . $advisory_html .'</div>';
            };
             
             
 //TAB 0 :: Weather            
  $doPrintNWS = false; //Remove the NWS Header Title and no output
  chdir($xfDATA);
  require_once 'advforecast2.php';
   $weather_html = "
    <table style='font-size:9px;' width='100%'>
     <tr align='center' valign='top'>
      <td>$forecasticons[0]</td>
      <td>$forecasticons[1]</td>
      <td>$forecasticons[2]</td>
      <td>$forecasticons[3]</td>
      <td>$forecasticons[4]</td>
      <td>$forecasticons[5]</td>
      <td>$forecasticons[6]</td>
     </tr>
     <tr align='center' valign='top'>
      <td>$forecasttemp[0]</td>
      <td>$forecasttemp[1]</td>
      <td>$forecasttemp[2]</td>
      <td>$forecasttemp[3]</td>
      <td>$forecasttemp[4]</td>
      <td>$forecasttemp[5]</td>
      <td>$forecasttemp[6]</td>
     </tr>
    </table>
    <table>
     <tr>
      <td colspan=7><hr/></td>
     </tr>
     <tr>
      <td><b>$forecasttitles[0]</b></td><td></td><td colspan=5>$forecasttext[0]</td>
     </tr>
     <tr>
      <td colspan=7><hr/></td>
     </tr>
     <tr>
      <td><b>$forecasttitles[1]</b></td><td></td><td colspan=5>$forecasttext[1]</td>
     </tr>
     <tr>
      <td colspan=7><hr/></td>
     </tr>
     <tr>
      <td><b>$forecasttitles[2]</b></td><td></td><td colspan=5>$forecasttext[2]</td>
     </tr>
     <tr>
     <tr>
      <td colspan=7><hr/></td>
     </tr>
     <tr>
      <td><b>$forecasttitles[3]</b></td><td></td><td colspan=5>$forecasttext[3]</td>
     </tr>
     <tr>
     <tr>
      <td colspan=7><hr/></td>
     </tr>
     <tr>
      <td><b>$forecasttitles[4]</b></td><td></td><td colspan=5>$forecasttext[4]</td>
     </tr>
     <tr>
     <tr>
      <td colspan=7><hr/></td>
     </tr>
     <tr>
      <td><b>$forecasttitles[5]</b></td><td></td><td colspan=5>$forecasttext[5]</td>
     </tr>
     <tr>
      <td colspan=7><hr/></td>
     </tr>
     <tr>
      <td><b>$forecasttitles[6]</b></td><td></td><td colspan=5>$forecasttext[6]</td>
     </tr>
                </table>";
   
   $weather_html = '<div id="tides0" class="tabcontent" style = "font-size: 11px; color:black;">'.$weather_html.'</div>';
 
 
 //TAB 1 :: River
 chdir($xfDATA);
 require_once 'river.php';
 
 
 //TAB 2-6 :: Tides 2=Alexandria, 3=PineyPoint, 4=Lowercedarpoint, 5=AquiaCreek, 6=IndianHead
 chdir($xfDATA);
 require_once 'tides.php';
    
 //Assemble Package
 
 //PDF
 $pdf_html = '<hr/><center><a href='.$xfURL.'/data/tide/aquia.pdf" target="_blank"><img src = "[URL]http://xx/images/attach/pdf.gif[/URL]" border=0 /> Printable Aquia Creek Tide Report</a></center></hr/>';
 
 //Alert Header combined with PDF
 $alert_html = $alert_html.$pdf_html;
 
 //Tabs Menu
 $tabs_html ='
   <div id="tides" class="indentmenu">
   <ul>
   <li><a href="#" rel="tides0" class="selected">Weather</a></li>
   <li><a href="#" rel="tides1">Potomac</a></li>
   <li><a href="#" rel="tides2">Alexandria</a></li>
   <li><a href="#" rel="tides3">St Marys</a></li>
   <li><a href="#" rel="tides4">301</a></li>
   <li><a href="#" rel="tides5">Aquia</a></li>
   <li><a href="#" rel="tides6">Occoquan</a></li>
   </ul>
   <br style="clear: left" />
   </div>';
 //Add CSS Calls  
 $tabs_html = '
 <link rel="stylesheet" type="text/css" href="'.$xfURL.'/data/weather/alert.css" />
    <link rel="stylesheet" type="text/css" href="'.$xfURL.'/data/weather/tabcontent.css" />'.$tabs_html;
 
 //Add Tabs
 $tabs_html = $tabs_html.$weather_html.$river_html.$tide_html;
 
 //Add JS Calls
 $tabs_html = $tabs_html.'
 <script type="text/javascript" src="'.$xfURL.'/data/weather/tabcontent.js"></script>
 <script type="text/javascript">
 var mytides=new ddtabcontent("tides")
 mytides.setpersist(true)
 mytides.setselectedClassTarget("link")
 mytides.init()
 </script>';
 return array(
 'alert_html' => $alert_html,
 'tabs_html' => $tabs_html,
  );
   }
 }
?>

Here is my XML module
PHP:
<?xml version="1.0" encoding="utf-8"?>
<module>
  <module_name>Outlook</module_name>
  <module_cache>+10 minutes</module_cache>
  <module_settings/>
  <module_template><![CDATA[
<div class="sectionMain">
    <div class="subHeading"><h3>Current Marine Outlook</h3></div>
 <div class="primaryContent">{xen:raw $Outlook.alert_html}</div>
    <div class="secondaryContent">{xen:raw $Outlook.tabs_html}</div>
 <div class="sectionFooter">Data provided by NOAA and xTide</div>
 <div style="clear: both;"></div>
</div>
]]>
</module_template>
</module>
 

Attachments

  • 1.webp
    1.webp
    62 KB · Views: 38
  • 2.webp
    2.webp
    62.8 KB · Views: 31
  • 3.webp
    3.webp
    50.8 KB · Views: 29
Module import checks for spaces, but still loads the module.
Can't delete due to URL error...
Deleted via database...
 
Code:
<?xml version="1.0" encoding="utf-8"?>
<module>
  <module_name>Opening_Text</module_name>
  <module_settings></module_settings>
  <module_cache>+1 day</module_cache>
  <module_template><![CDATA[<div class="section">
    <div class="secondaryContent">
        <h1><center><B>Welcome to Diesel Events!</B></center></h1>
        <div>Diesel Events is a new Forum designed for people that love the power of Diesel! From Drag Racing to Tractor Pulling we cover

it all.. If it's happening in the diesel world, it's happening here! </div>
    </div>
</div>]]></module_template>
</module>
Trying to make a simple text mod for the portal page... I am stumped on how to make this mod use the css from the site... Any help would be very appreciated....
 
Code:
<?xml version="1.0" encoding="utf-8"?>
<module>
  <module_name>Opening_Text</module_name>
  <module_settings></module_settings>
  <module_cache>+1 day</module_cache>
  <module_template><![CDATA[<div class="section">
    <div class="secondaryContent">
        <h1><center><B>Welcome to Diesel Events!</B></center></h1>
        <div>Diesel Events is a new Forum designed for people that love the power of Diesel! From Drag Racing to Tractor Pulling we cover

it all.. If it's happening in the diesel world, it's happening here! </div>
    </div>
</div>]]></module_template>
</module>
Trying to make a simple text mod for the portal page... I am stumped on how to make this mod use the css from the site... Any help would be very appreciated....

Try something like this(made need tweaking):

Code:
<div class="messageText ugc baseHtml">
    <div class="secondaryContent">
        <h1><center><B>Welcome to Diesel Events!</B></center></h1>
        <div>Diesel Events is a new Forum designed for people that love the power of Diesel! From Drag Racing to Tractor Pulling we cover

it all.. If it's happening in the diesel world, it's happening here! </div>
    </div>
</div>
 
Top Bottom