Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2009-10-22 14:42:28
- CharlesCountyArtsAlliance
- New Member
- Registered: 2009-10-19
- Posts: 6
Tag error when including external php file in page
I’m running into trouble when including the php for an event calendar on my webpage. Using the following code:
<txp:php> include ("C:/wamp/www/new_ccaa_website/Code/php/calendarix_0_8_20080808/minical.php"); </txp:php>
I’m able to successfully include minical.php, which outputs a miniature calendar, into the sidebar of my homepage. The problem arises later in the code, when I tell TXP to output the form “footer” and it responds with this error message:
Tag error: <txp:output_form form=“footer”/> -> Textpattern Warning: Table ‘calendarix.txp_form’ doesn’t exist
I’m not even a novice at PHP, so I can’t begin to guess why it’s still trying to read from the calendarix table after I ended the include. Below is the tag trace, and more information from the error that TXP gives me at the top of the page.
<!-- Runtime: 0.1329 -->
<!-- Query time: 0.028356 -->
<!-- Queries: 16 -->
<!-- Memory: 3659Kb, <txp:output_form form="footer"/> -->
<!-- txp tag trace:
[SQL (0.010506868362427): select name, data from txp_lang where lang='en-us' AND ( event='public' OR event='common')]
[SQL (0.0045998096466064): select name, code, version from txp_plugin where status = 1 AND type IN (0,1) order by load_order]
[SQL (0.00086402893066406): select page, css from txp_section where name = 'default' limit 1]
[SQL (0.00061917304992676): select host from txp_log where ip='127.0.0.1' limit 1]
[SQL (0.0011279582977295): insert into txp_log set `time`=now(),page='/textpattern_408/',ip='127.0.0.1',host='localhost',refer='',status='200',method='GET']
[SQL (0.00074601173400879): select user_html from txp_page where name='default']
[Page: default]
<txp:output_form form="index-header"/>
[SQL (0.00052809715270996): select Form from txp_form where name='index-header']
[Form: index-header]
<txp:site_name/>
<txp:search_input section="search" button="Go"/>
[SQL (0.00039386749267578): select form from txp_form where `name` = 'search_input' limit 1]
<txp:link_to_home>
<txp:image id="3"/>
[SQL (0.00039291381835938): select * from txp_image where id = 3 limit 1]
</txp:link_to_home>
<txp:section_list wraptag="ul" break="li" sections="about-us,programs,events,news,contact" include_default="1" default_title="Home"/>
[SQL (0.00066304206848145): select name, title from txp_section where name in ('about-us','programs','events','news','contact') order by field(name, 'about-us','programs','events','news','contact')]
<txp:site_slogan/>
<txp:article_custom limit="7" section="news" form="article-list"/>
[SQL (0.0025451183319092): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and Section IN ('news') order by Posted desc limit 0, 7]
[article 19]
[SQL (0.00052380561828613): select Form from txp_form where name='article-list']
[Form: article-list]
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:permlink>
<txp:article_image thumbnail="1"/>
[SQL (0.0017499923706055): select * from txp_image where id = 4]
</txp:permlink>
<txp:excerpt/>
<txp:permlink>
</txp:permlink>
[article 18]
[Form: article-list]
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:permlink>
<txp:article_image thumbnail="1"/>
</txp:permlink>
<txp:excerpt/>
<txp:permlink>
</txp:permlink>
[article 17]
[Form: article-list]
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:permlink>
<txp:article_image thumbnail="1"/>
</txp:permlink>
<txp:excerpt/>
<txp:permlink>
</txp:permlink>
[article 12]
[Form: article-list]
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:permlink>
<txp:article_image thumbnail="1"/>
</txp:permlink>
<txp:excerpt/>
<txp:permlink>
</txp:permlink>
[article 14]
[Form: article-list]
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:permlink>
<txp:article_image thumbnail="1"/>
[SQL (0.00081110000610352): select * from txp_image where id = 5]
</txp:permlink>
<txp:excerpt/>
<txp:permlink>
</txp:permlink>
[article 13]
[Form: article-list]
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:permlink>
<txp:article_image thumbnail="1"/>
</txp:permlink>
<txp:excerpt/>
<txp:permlink>
</txp:permlink>
<txp:php>
</txp:php>
<txp:feed_link section="news">
</txp:feed_link>
<txp:output_form form="footer"/>
Tag error: <txp:output_form form="footer"/> -> Textpattern Warning: Table 'calendarix.txp_form' doesn't exist
select Form from txp_form where name='footer'
C:\wamp\www\textpattern_408\textpattern\lib\txplib_db.php:200 getRow() on line 85
[SQL (0.00085902214050293): select Form from txp_form where name='footer']
Tag error: <txp:output_form form="footer"/> -> Textpattern Notice: Form not found: footer on line 1598
[ ~~~ secondpass ~~~ ]
-->
Tag error: <txp:output_form form="footer"/> -> Textpattern Warning: Table 'calendarix.txp_form' doesn't exist
select Form from txp_form where name='footer'
C:\wamp\www\textpattern_408\textpattern\lib\txplib_db.php:200 getRow() on line 85
C:\wamp\www\textpattern_408\textpattern\lib\txplib_db.php:85 trigger_error()
C:\wamp\www\textpattern_408\textpattern\lib\txplib_db.php:261 safe_query()
C:\wamp\www\textpattern_408\textpattern\lib\txplib_db.php:200 getRow()
C:\wamp\www\textpattern_408\textpattern\lib\txplib_misc.php:1596 safe_row()
C:\wamp\www\textpattern_408\textpattern\lib\txplib_misc.php:1614 fetch_form()
C:\wamp\www\textpattern_408\textpattern\publish\taghandlers.php:266 parse_form()
C:\wamp\www\textpattern_408\textpattern\publish.php:1106 output_form()
C:\wamp\www\textpattern_408\textpattern\publish.php:1028 processTags()
C:\wamp\www\textpattern_408\textpattern\publish.php:506 parse()
C:\wamp\www\textpattern_408\index.php:45 textpattern()
Tag error: <txp:output_form form="footer"/> -> Textpattern Notice: Form not found: footer on line 1598
C:\wamp\www\textpattern_408\textpattern\lib\txplib_misc.php:1598 trigger_error()
C:\wamp\www\textpattern_408\textpattern\lib\txplib_misc.php:1614 fetch_form()
C:\wamp\www\textpattern_408\textpattern\publish\taghandlers.php:266 parse_form()
C:\wamp\www\textpattern_408\textpattern\publish.php:1106 output_form()
C:\wamp\www\textpattern_408\textpattern\publish.php:1028 processTags()
C:\wamp\www\textpattern_408\textpattern\publish.php:506 parse()
C:\wamp\www\textpattern_408\index.php:45 textpattern()
If anyone can help me figure out why this is happening, I’d be much obliged.
Offline
Re: Tag error when including external php file in page
CharlesCountyArtsAlliance wrote:
I’m not even a novice at PHP, so I can’t begin to guess why it’s still trying to read from the calendarix table after I ended the include.
If you over-write the database connection to a different database, and leave it open, it is going to use that connection for rest of the page.
Easiest fix is to move the calendar’s tables into Textpattern’s database and remove mysql connection from the code.
Or you can always look into TXP plugins, for example smd_calendar.
Offline
#3 2009-11-11 16:01:16
- ccschmitz
- New Member
- Registered: 2009-11-11
- Posts: 1
Re: Tag error when including external php file in page
I’m running into this same problem. Not being that comfortable with PHP and database management, I’m trying to find an alternative to copying over databases….
I tried closing the connection at the end of the included file (mysql_close($link)) but to no avail.
If you have any success, please let me know how you ended up fixing this.
Thanks!
Offline