• 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)

Here is the updated version of RandomQuote Module. I was unable to import font color, so I left it as default. This one should work in all browsers.

Hey Xarcell, the quotes are not showing and the font is still default. All files uploaded as instructed into the /data/RandomQuotes directory, but nothing showing. Tested on both Google Chrome and Firefox. Any ideas?
 
Hey Xarcell, the quotes are not showing and the font is still default. All files uploaded as instructed into the /data/RandomQuotes directory, but nothing showing. Tested on both Google Chrome and Firefox. Any ideas?

Can I get a link to where it is installed so I can get a look at it?

NVM, Found it.
 
Hey Xarcell, the quotes are not showing and the font is still default. All files uploaded as instructed into the /data/RandomQuotes directory, but nothing showing. Tested on both Google Chrome and Firefox. Any ideas?

Try uninstalling, deleteing the RandomQuote directory, and FTP it up again, then reinstall. I'm going to look at alternatives to applying the CSS. Because it really isn't applied properly, but that the best I can do since that's the way modules are designed. I'm going to ask Jaxel if he will create a "header" and "body" sections of a module.

I'm tested and tested and double checked files. It works fine for me. I can only guess that the CSS code didn't get through, but at the same time it's possible you used an old version of the XML file. Please make sure you are using the right one.
 
Thanks....looks like the main reason mine wasn't working was because it was written assuming that the forum was installed at the root. So, I had to add the /forum in the code. :)
 
Thanks....looks like the main reason mine wasn't working was because it was written assuming that the forum was installed at the root. So, I had to add the /forum in the code. :)

;)

I'll see if I can find a way around that. It shouldn't matter if it's installed at the root or not.
 
Jaxel,

I saw your comment about creating a PHP module, but I haven't found it yet - still looking....
I would like to explore the ability to pull in "require" or execute actual PHP to build a module.
If I could do that, I could actually leave my current platform for xenforo today...

Here is an example of what I am trying to do:
Posted here: http://www.vbulletin.org/forum/showthread.php?t=234171
Using the scripts here: http://saratoga-weather.org/scripts-carterlake.php#advforecast

Could I get a hand finding your post about PHP modules? Thank!
 
I know the wiki has the option for a PHP page.
There is a drop down to select PHP vs HTML vs BBcodes.

see image:
xenporta-wiki-edit-pages-example-jpg.5320
 
I wonder if you could make a PHP page in the wiki and embed that wiki entry in XenPorta ?
XenCarta's [wiki] bbcode has a failsafe against non _view containers. By the nature of how blocks in XenPorta are modularized, they do not have a _view element. Without the _view element, you can't build from templates; thats why the more complex bbcode, quick require callback functions, such as quote, code, etc, don't have template styles when put into XenPorta's Recent News module.

So no, it would not be possible to use the [wiki] bbcode in the Recent News module.

If you are simply taking about writing a php script, and pull that into a normal block... look at EWRporta_Block_RecentNews to see how it's done.
 
Can someone help me with the code to just have a photo in a block I have a logo that I want to offer to use as a link and all I need it a simple block to hold the photo.
 
Can someone help me with the code to just have a photo in a block I have a logo that I want to offer to use as a link and all I need it a simple block to hold the photo.
Yes, or just a html-module where you can add whatever you want. I'm not sure how to create one, please help. :)
 
Help!
LOL...
OK so I am trying out the PHP module piece to add a weather script as a module box. This script does a variety of backend parsing and then renders a graphical forecast.
I built the php "block" which I tried using my VB format by calling an ob_start().
But it didn't work.
I then tried "returning" the ob_contents and I got output, but it was slammed to the top of the page instead of in the proper <div> in the block.
(which I recall in VB is a symptom of not using ob_start properly)
So I tried to assign the output to a varible like $weather and do something like this:
PHP:
$weather = ob_get_contents();
ob_end_clean();
$params = array('weather'  => $weather);
$response->params = array_merge($response->params,$params);
}
And in my XML do something like this:
HTML:
<div class="section">
 <div class="secondaryContent WeatherSmall" id="WeatherRecent">
 <h3>Current Weather</h3>
 <ul>
 <div>
 {xen:raw $weather}
 </div>
 </ul>
 <div style="clear: both;"></div>
 </div>
</div>
But unless I simply "echo" or return my output, I don't see anything.
So in my PHP block I have a bunch of rendering going on which I save in a varible $weather.
How do I then call this varible to properly render the output?
 
OK, I think I am getting closer...

OK, so I am including two php file in my block call.
Each include "returns" a global varible we'll say $weather.
The varible contains all the HTML code needed to display.
I also "return" the varible in the block call.

On my XML I am trying to call this varible in by doing:
HTML:
<div class="sectionMain">
    <div class="subHeading"><h3>Current Weather</h3></div>
 <div class="primaryContent">{$Weather.advisory_html}</div>
    <div class="secondaryContent">{$Weather.weather_html}</div>
 <div style="clear: both;"></div>
</div>

So if my PHP and XML file are called Weather
and the returned contents of the php scripts are: $advisory_html and $weather_html.
What is the proper format to call this in the XML?

Sorry, but having trouble figuring this out.
 
Here is php block:
PHP:
<?php
class EWRporta_Block_Weather extends XenForo_Model
  {
    public function getModule()
          {

$doPrintNWS = false;
chdir('/home4/thebooth/public_html/xx/weather/');
require_once '/home4/thebooth/public_html/xx/weather/advisories.php';
return $advisory_html
require_once  '/home4/thebooth/public_html/xx/weather/advforecast2.php';
return $weather_html
chdir('/home4/thebooth/public_html/xx/');
}
}
?>

Here is XML
HTML:
<?xml version="1.0" encoding="utf-8"?>
<module>
  <module_name>Weather</module_name>
  <module_cache>+10 minutes</module_cache>
  <module_settings></module_settings>
  <module_template><![CDATA[
<style>
.advisoryBoxnoactive {
  color: black;
  font-size: 12px;
  text-align: center;
  background-color: white;
  margin: 0 0 0 0;
  padding: .5em 0em .5em 0em;
  border: 1px dashed rgb(34,70,79);
}
.advisoryBox {
  color: black;
  font-size: 12px;
  text-align: center;
  background-color: #FFFF85;
  margin: 0 0 0 0;
  padding: .5em 0em .5em 0em;
  border: 0px dashed rgb(34,70,79);
}
.watchBox {
  color: black;
  font-size: 12px;
  text-align: center;
  background-color: #B3F7FF;
  margin: 0 0 0 0;
  padding: .5em 0em .5em 0em;
  border: 0px dashed rgb(34,70,79);
}
.warningBox {
  color: white;
  font-size: 13px;
  text-align: center;
  background-color: #E28080;
  margin: 0 0 0 0;
  padding: .5em 0em .5em 0em;
  border: 0px dashed rgb(255,255,255);
}
.warningBox a {
  color: white;
}
.tornadowarningBox {
  color: white;
  font-size: 13px;
  text-align: center;
  background-color: #CC0000;
  margin: 0 0 0 0;
  padding: .5em 0em .5em 0em;
  border: 1px dashed rgb(255,255,255);
}
.tornadowarningBox a {
  color: white;
}
</style>
<div class="sectionMain">
    <div class="subHeading"><h3>Current Weather</h3></div>
    <div class="primaryContent">{$Weather.advisory_html}</div>
    <div class="secondaryContent">{$Weather.weather_html}</div>
    <div style="clear: both;"></div>
</div>
]]></module_template>
</module>

Againt the two "require_once" scripts return pre-formatted HTML in the varibles $weather_html and $advisory_html
Normally I'd "echo" their output to the screen with and ob_start call. But I'd rather do it the correct way.
 
Top Bottom