Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-03-30 07:38:21

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,907
Website GitHub Twitter

use forms to share content outside the main txp install.

Currently I am creating sections where I have the snippets I am sharing with other txp and punBB installs.
Within those sections I have txp tags.

This is the code I am using to import those snippets.

<?php include($DOCUMENT_ROOT . "http://my-txp-site.tld/ext-section/"); ?>

Is there a way to achieve the same results using forms instead?

Last edited by colak (2009-03-30 07:39:14)


Yiannis
——————————
neme.org | hblack.net | EMAP | A Sea change | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#2 2009-03-31 07:17:04

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,907
Website GitHub Twitter

Re: use forms to share content outside the main txp install.

I guess it cannot be done huh?


Yiannis
——————————
neme.org | hblack.net | EMAP | A Sea change | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#3 2009-03-31 07:26:30

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: use forms to share content outside the main txp install.

You want to have access to txp forms’ content from other non-txp php script?


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#4 2009-03-31 07:55:49

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,907
Website GitHub Twitter

Re: use forms to share content outside the main txp install.

the_ghost wrote:

You want to have access to txp forms’ content from other non-txp php script?

Hi Victor,

Yes and no. I’d like to have access to txp forms from other txp installs (one residing on another site) and punBB.


Yiannis
——————————
neme.org | hblack.net | EMAP | A Sea change | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#5 2009-03-31 08:21:51

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: use forms to share content outside the main txp install.

As far as other installs use other db-setting, at least tables prefix, i think the only way to pull forms from db is using php’s mysql_* functions. For inspiration you can look in txplib_db.php.

Another “geek-way” to do this is to use cnk_verisoning or hcg_templates and instead of looking into db you can pull forms from files. But this methods require some extra movements to keep files’ fresh – or switching your site to debug mode and reloading main-page, or manually export your pages-forms-css, for cnk_versioning and hcg_templates respectively.

Last edited by the_ghost (2009-03-31 08:24:05)


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#6 2009-03-31 09:24:25

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,907
Website GitHub Twitter

Re: use forms to share content outside the main txp install.

Hi Victor, thanks for responding to this.

As far as other installs use other db-setting, at least tables prefix, i think the only way to pull forms from db is using php’s mysql_* functions. For inspiration you can look in txplib_db.php.

It’s all Greek to me. :)

Another “geek-way” to do this is to use cnk_verisoning or hcg_templates and instead of looking into db you can pull forms from files. But this methods require some extra movements to keep files’ fresh – or switching your site to debug mode and reloading main-page, or manually export your pages-forms-css, for cnk_versioning and hcg_templates respectively.

So, basically there is no ‘easy’ method… I was thinking something like

<?php
$link = mysql_connect('mysqlhost', 'mysql_user', 'mysql_password');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
include($DOCUMENT_ROOT . "myform");

?>

excuse the coding errors:)

Last edited by colak (2009-03-31 09:24:39)


Yiannis
——————————
neme.org | hblack.net | EMAP | A Sea change | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#7 2009-03-31 23:37:24

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: use forms to share content outside the main txp install.

Not surethat simple include can help… AFAIK it tries to include php’s code from provided url. Try this site’s manual, it seems to be rather full and simple.


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#8 2009-04-01 08:52:52

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,907
Website GitHub Twitter

Re: use forms to share content outside the main txp install.

Thanks:) This is what I have but there are some problems as you can see.

  1. how do I slect the row/column for the particular form
  2. I’m still not certain if textpattern would parse the txp tags..
<?php
// Make a MySQL Connection
mysql_connect("localhost", "loginname", "loginpassword") or die(mysql_error());
mysql_select_db("test") or die(mysql_error());

// Retrieve all the data from the "example" table
$result = mysql_query("SELECT * FROM txp_form")
or die(mysql_error());  

// store the record of the "example" table into $row
$row = mysql_fetch_array( $result );
// Print out the contents of the entry 

echo "Name: ".$row['myformname'];

?>

Yiannis
——————————
neme.org | hblack.net | EMAP | A Sea change | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#9 2009-04-01 15:51:32

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: use forms to share content outside the main txp install.

You want parse txp tags in this forms outspace of textpattern?


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#10 2009-04-01 16:09:53

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,907
Website GitHub Twitter

Re: use forms to share content outside the main txp install.

the_ghost wrote:

You want parse txp tags in this forms outspace of textpattern?

Hi Victor, yes. Basically I am trying to figure out a way to merge some txp content though different txp powered sites and punBB. Faux sections does the work perfectly with the caveat of not being able to automate a sections menu.

> Edit: An example is our sitemap covers 2 sites, 3 txp installs and a punbb forum residing on a subdomain. Currently we use sections to merge the info together.
Another example is the menu in our forum where it is again included there and on neme.org from a txp section.

Last edited by colak (2009-04-01 16:19:49)


Yiannis
——————————
neme.org | hblack.net | EMAP | A Sea change | NeMe @ github
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB