Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-06-27 06:32:24

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

r2453: if_first_article and if_last_article fail

By fail, I mean each article records true for both first and last article. The page template only contains <txp:article />. The default form is:

Form: default

<h2>
	<txp:title />
</h2>

	<txp:body />

	<txp:if_first_article>
		first
	</txp:if_first_article>

<br />

	<txp:if_last_article>
		last
	</txp:if_last_article>

<hr />

	<txp:link_to_prev>
		previous
	</txp:link_to_prev>

<br />

	<txp:link_to_next>
		next
	</txp:link_to_next>
<!-- Runtime:    0.0115 -->
<!-- Query time: 0.005291 -->
<!-- Queries: 15 -->
<!-- Memory: 2074Kb, <txp:link_to_next>
		next
	</txp:link_to_next> -->
<!-- txp tag trace: 
[SQL (0.000268): select name from txp_lang where lang='en-us' limit 1]
[SQL (0.002160): select name, data from txp_lang where lang='en-us' AND ( event='public' OR event='common')]
[SQL (0.000143): select name, code, version from txp_plugin where status = 1]
[SQL (0.000172): select ID, Section from textpattern where ID = 7 and Section = 'photos' and Status >= 4 limit 1]
[SQL (0.000142): select * from txp_section where name = 'photos' limit 1]
[SQL (0.000247): select *, unix_timestamp(Posted) as uPosted from textpattern where ID=7 and Status = 4]
[article 7]
[SQL (0.000186): select ID, Title, url_title, unix_timestamp(Posted) as uposted
			from textpattern where Posted > '2007-06-27 00:20:03' and Section = 'photos' and Status=4 and Posted < now() order by Posted asc limit 1]
[SQL (0.000292): select ID, Title, url_title, unix_timestamp(Posted) as uposted
			from textpattern where Posted < '2007-06-27 00:20:03' and Section = 'photos' and Status=4 and Posted < now() order by Posted desc limit 1]
[SQL (0.000176): select host from txp_log where ip='127.0.0.1' limit 1]
[SQL (0.000199): insert into txp_log set `time`=now(),page='/~jm/dev/cms/txp/photos/7/yet-another-post',ip='127.0.0.1',host='localhost',refer='',status='200',method='GET']
[SQL (0.000122): select user_html from txp_page where name='default']
[Page: default]
<txp:page_title/>
<txp:article/>
	[SQL (0.000232): select *, unix_timestamp(Posted) as uPosted from textpattern where ID = 7 and Status = 4 limit 1]
	[article 7]
	[SQL (0.000166): select Form from txp_form where name='default']
	[Form: default]
	<txp:title/>
	<txp:body/>
	<txp:if_first_article>
		[<txp:if_first_article>: true]
	</txp:if_first_article>
	<txp:if_last_article>
		[<txp:if_last_article>: true]
	</txp:if_last_article>
	<txp:link_to_prev>
		[SQL (0.000152): select ID as thisid, Section as section, Title as title, url_title, unix_timestamp(Posted) as posted from textpattern where ID = 6]
	</txp:link_to_prev>
	<txp:link_to_next>
	</txp:link_to_next>
[ ~~~ secondpass ~~~ ]
 -->

Diagnostics

Textpattern version: 4.0.4 (r2453)
Last Update: 2007-06-27 05:48:28/2007-06-16 21:22:07
Document root: /Users/jm/Sites/ (/Users/jm/Sites)
$path_to_site: /Users/jm/Sites/dev/cms/txp
Textpattern path: /Users/jm/Sites/dev/cms/txp/textpattern
Permanent link mode: section_id_title
Temporary directory path: /private/var/tmp
Site URL: localhost/~jm/dev/cms/txp
PHP version: 5.2.1
GD Image Library: version bundled (2.0.28 compatible), supported formats: GIF, JPG, PNG
Server Local Time: 2007-06-27 00:31:08
MySQL: 4.1.22-standard
Locale: en_US.UTF-8
Server: Apache/1.3.33 (Darwin) PHP/5.2.1
Apache version: Apache/1.3.33 (Darwin) PHP/5.2.1
PHP Server API: apache
RFC 2616 headers: 
Server OS: Darwin 8.10.1

.htaccess file contents: 
------------------------
#DirectoryIndex index.php index.html

#Options +FollowSymLinks
#Options -Indexes

<IfModule mod_rewrite.c>
	RewriteEngine On
	#RewriteBase /relative/web/path/

	RewriteCond %{REQUEST_FILENAME} -f [OR]
	RewriteCond %{REQUEST_FILENAME} -d
	RewriteRule ^(.+) - [PT,L]

	RewriteRule ^(.*) index.php
</IfModule>

#php_value register_globals 0
------------------------

Offline

#2 2007-06-27 07:17:01

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

Re: r2453: if_first_article and if_last_article fail

It’s doing what you told it to do: display one article. If you display only one article, it is both first and last on that page.

Offline

Board footer

Powered by FluxBB