Textpattern Forum

You are not logged in. Register | Login | Help

#21 2009-05-19 17:56:25

molly
Member
From: Virginia
Registered: 2004-08-15
Posts: 44
Website

Re: rah_external_output

FireFusion wrote:

Great this is very useful.
Am using it to output my iCal feed and slideshow XML (rather then using up more sections).

FireFusion, I would love to know more about this if you have the time. I am trying to output content from a Google calendar into this page: www.beerrun.com/test. Used an rss feed program, but that only outputs events that already happened, not future events.

Offline

#22 2009-06-08 05:19:02

Gocom
Developer
Registered: 2006-07-14
Posts: 4,465
Website

Re: rah_external_output

A new version 0.4 of rah_external_output released. Update comes with a bug fix. Changelog:

  • Fixed forgotten insert query escaping.

Change is as big as one word, doSlash. Somehow code missed it. I strongly recommend updating before using saving any output with the plugin’s editor.

More info and downloads


Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />

Offline

#23 2009-07-05 17:48:32

FireFusion
Member
Registered: 2005-05-10
Posts: 698

Re: rah_external_output

Hi Gocom,

I can’t get this working with adi_gps no matter where i put it in the load order. Am trying to assign a category for my slideshow through get variable.

<txp:smd_gallery category='<txp:adi_gps name="image_cat" />'  limit="9999" sort="date">
{grouptagstart}
<image source="{id}{ext}" thumbnail="{id}t{ext}" title="{name}" description="{caption}" link="{alt}" />
{grouptagend}
</txp:smd_gallery>

	</contents>
</album>

Offline

#24 2009-07-05 17:51:23

FireFusion
Member
Registered: 2005-05-10
Posts: 698

Re: rah_external_output

molly wrote:

FireFusion wrote:

Great this is very useful.
Am using it to output my iCal feed and slideshow XML (rather then using up more sections).

FireFusion, I would love to know more about this if you have the time. I am trying to output content from a Google calendar into this page: www.beerrun.com/test. Used an rss feed program, but that only outputs events that already happened, not future events.

I use this plus smd_calendar

BEGIN:VCALENDAR
VERSION:2.0
X-WR-CALNAME:<txp:site_name /> Calendar
PRODID:-//Apple Computer, Inc//iCal 1.5//EN
METHOD:PUBLISH
X-WR-TIMEZONE:Europe/London
<txp:smd_article_event time="future" limit="1000" section="courses" stepfield="custom_1" skipfield="custom_2" extrafield="custom_3">

BEGIN:VEVENT
DTSTART:<txp:posted format="%Y%m%dT%H%M%S" />
DTEND:<txp:posted format="%Y%m%d" /><txp:expires format="T%H%M%S" />
SUMMARY:<txp:title />

END:VEVENT
</txp:smd_article_event>
END:VCALENDAR

Offline

#25 2009-07-05 19:01:04

Gocom
Developer
Registered: 2006-07-14
Posts: 4,465
Website

Re: rah_external_output

FireFusion wrote:

I can’t get this working with adi_gps no matter where i put it in the load order. Am trying to assign a category for my slideshow through get variable.

  1. Make sure that the GET variable is assigned into the slideshow script (and into the rah_external_output’s url).
  2. Make sure that adi_gps is loaded before rah_external_output kills (load order is higher).
  3. Make sure that adi_gps doesn’t use $pretext or etc. TXP’s global arrays. We are not on section page, so those aren’t set. Plugins are loaded before TXP’s $pretext global.

Last edited by Gocom (2009-07-05 19:02:39)


Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />

Offline

#26 2009-07-05 20:01:52

FireFusion
Member
Registered: 2005-05-10
Posts: 698

Re: rah_external_output

1. Done
2. Done
3. Nope

/*
	adi_gps - Extract GET & POST variables

	Written by Adi Gilbert

	Released under the GNU General Public License

	Version history:
	0.1		- initial release

*/

function adi_gps($atts) {

	extract(lAtts(array(
		'name'			=> '',	// a single GET/POST var
		'new'			=> '',	// new variable name
		'txpvar'		=> '1',	// set as a TXP variable or not
		'post'			=> '0',	// extract POST vars or not
		'quiet'			=> '0',	// return value or not
		'global'		=> '1', // make vars global or not
		'escape'		=> '',	// escape HTML entities or not
		'decode'		=> '0',	// perform a urldecode or not
		'list'			=> '0', // list variable names and values
		'debug'			=> '0',
	), $atts));

	if ($name == '') { // no single var specified, so all vars extracted
		$quiet = 1; // force quiet mode
		$new = ''; // disable var rename
		$get_list = array_keys($_GET);
		$post ?
			$post_list = array_keys($_POST) : $post_list = array();
		$name_list = array_merge($get_list,$post_list);
	}
	else
		$name_list[] = $name;

	$debug_list = 'adi_gps variables';
	foreach ($name_list as $index => $name) {
		$value = gps($name); // extract value
		if ($decode) // convert %chars
			$value = urldecode($value);
		if ($escape == 'html') // encode chars (e.g. ampersand becomes &amp;)
			$value = htmlentities($value);
		if ($new) // rename var (single var mode only)
			$name = $new;
		if ($txpvar) // create TXP variable
			parse('<txp:variable name="'.$name.'" value="'.$value.'"/>');
		if ($global) // make the variable global
			$GLOBALS[$name] = $value;
		if ($list)
			$debug_list .= ":$name=$value";
	}

	if ($debug) {
		echo 'SUPPLIED ATTRIBUTES:<br/>';
		dmp($atts);
		echo "GET VARS:<br/>";
		dmp($_GET);
		echo "POST VARS:<br/>";
		dmp($_POST);
		echo "ADI_GPS VAR LIST:<br/>";
		dmp($name_list);
		echo "ALL TXP VARS:<br/>";
		dmp($GLOBALS['variable']);
	}

	if ($list)
		return $debug_list.'<br/>';
	else
		if ($quiet) // don't report value
			return '';
		else // return value
			return $value;
}

:)

Last edited by FireFusion (2009-07-05 20:02:16)

Offline

#27 2009-08-07 19:15:23

johnstephens
Plugin Author
From: Harrisonburg, VA
Registered: 2008-06-01
Posts: 820
Website

Re: rah_external_output

This is an awesome plugin. One warning: External output doesn’t work if your site’s production status is set to “Debugging”. I just spent 45 minutes trying to chase down a non-existent js bug or plugin collision with the site in “Debugging”— when I switched it to “Testing” or “Live” it worked perfectly again (this occurred in Textpattern 4.0.8).

Offline

#28 2009-08-07 23:12:39

Gocom
Developer
Registered: 2006-07-14
Posts: 4,465
Website

Re: rah_external_output

johnstephens wrote:

This is an awesome plugin. One warning: External output doesn’t work if your site’s production status is set to “Debugging”. I just spent 45 minutes trying to chase down a non-existent js bug or plugin collision with the site in “Debugging”— when I switched it to “Testing” or “Live” it worked perfectly again (this occurred in Textpattern 4.0.8).

If you use the plugin, you might get some “errors” specially in the Debugging mode. This is caused by the fact that the plugin outputs the content in a non section/any context. All plugins/code/tags that hook or do something that requires section or something similiar, might cause problems.

What is the error message?

Last edited by Gocom (2009-08-07 23:13:15)


Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />

Offline

#29 2010-02-11 19:21:53

lovetheg
New Member
Registered: 2010-02-11
Posts: 5

Re: rah_external_output

Hi,
I’d like to use this plugin to display the dynamic navigation bar I use in my textpattern pages on external (static) php pages elsewhere in the same domain. So I’ve copied the form code and made an external snippet, which then looks OK through URL given via the ‘view’ link in the plugin.

My question is, how do I then pull that code into my php file, I tried…

<?php include($DOCUMENT_ROOT . "http://my-txp-site.tld/?rah_external_output=nav-form"); ?>

…as suggested previously in this thread but it did seem not work. and also…

<?php include("http://my-txp-site.tld/?rah_external_output=template1"); ?>

…still no joy? Can you give me some help as I’m completely stuck!

Thanks,
Dan

Offline

#30 2010-02-14 16:44:21

lovetheg
New Member
Registered: 2010-02-11
Posts: 5

Re: rah_external_output

Bump! Can anyway help with my previous post? Would really like to use this.
Thanks muchly.

Offline

Board footer

Powered by FluxBB