Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-05-04 07:47:58

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

python anyone? - 2 questions

Does anyone know what the equivalent of

<?php include($DOCUMENT_ROOT . "http://www.somesite.tld/something/"); ?>
<?php @include_once( $_SERVER["DOCUMENT_ROOT"]."/slimstat/inc.stats.php" ); ?>

be in python?
Working to integrate reBlog in NeMe. It unfortunately seems to be using python which I know nothing about.

… or am i approaching this from a totally wrong angle?

Last edited by colak (2008-05-04 07:59:00)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#2 2008-05-04 15:51:08

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: python anyone? - 2 questions

That depends. If you have Python Server Pages as part of mod_python, then:

<%@ include file='filename'>

Offline

#3 2008-05-04 17:06:59

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: python anyone? - 2 questions

An all rounder!!!

Thanks sooo much Mary. I’m not sure if txd has Python Server Pages but I’m sure they do as reBlog is working just fine. The problem of course is to find a way to integrate some of txp’s content to reBlog. Static links and styling I worked out but I am trying to dynamically fetch some txp content into the templates. Another spring another software to learn.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2008-05-05 14:35:58

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: python anyone? - 2 questions

I’m slightly lost…

The templating system for reblog uses proprietary tags which although seem simple enough I am yet to grasp how I could include some dynamic content from the rest of the neme site.

Digging into it I found that there is a file called ClientController.class.php which calls the template.

...
return $this->generateResponse($RB, 'out/page-html.tpl');

Does anybody know the php needed to split that template so as to have something like

return $this->generateResponse($RB, 'out/page-top-html.tpl');
include($DOCUMENT_ROOT . "http://www.neme.org/something_from_neme/");
return $this->generateResponse($RB, 'out/page-bottom-html.tpl');

where the ‘include’ is the dynamic content and the 3 lines constitute the ‘out’ page?

Last edited by colak (2008-05-05 15:05:49)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2008-05-12 12:35:37

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: python anyone? - 2 questions

It’s a slow day today in the forum so hopefully someone will have some time to advice me on the above.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#6 2008-05-14 20:38:24

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: python anyone? - 2 questions

Yiannis – are you just including slimstat? If so, just use slimstat.js in your page-top-html.tpl – it won’t track bots or visitors with JS-disabled though.

Last edited by jm (2008-05-14 20:38:49)

Offline

#7 2008-05-26 15:20:12

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: python anyone? - 2 questions

Hi JM, did not notice your post before.

I have nevertheless worked it out.

Reblog uses php, python and smarty for the templating system which basically means that the code I was looking for was: {include_php file='/path/to/file.php'}. Simple once I worked it out but a real head scratcher before then. It was the first time I encountered the smarty ‘script/language(?)’ and I did not recognise it so I thought that they were using a proprietary language.

Last edited by colak (2008-05-26 15:22:04)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB