Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2010-09-29 17:24:52
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Offset sorting question
Hi amavai, can you post a tag trace of the page where it doesn’t work?
I am sure you don’t need a plugin to do what you want.
Last edited by els (2010-09-29 17:25:28)
Offline
#14 2010-09-29 18:21:36
- amavai
- Member
- Registered: 2009-08-25
- Posts: 37
Re: Offset sorting question
Hi Els,
I was working with the tag trace ( debugging mode) to see errors on the site. I have fix all of them( one, specifically with other form that involve adi_cat_menu) and now it doesn’t output nothing..
So, probably will help to know what is in my entire page blog..
This is my blog page:
<txp:output_form form="header-blog"/>
<txp:output_form form="logo-lang"/>
<txp:output_form form="main-menu"/>
<div id="titulos_bg">
<h1>Título Blog</h1>
</div>
<div id="col_left" class="t-main">
<txp:if_section name="tag">
<div id="post-b">
<txp:tru_tags_if_tag_search>
<h1>Tag: <txp:tru_tags_tag_parameter striphyphens="1" /></h1>
<br />
<txp:tru_tags_handler section="blog" form="tag_results" noarticles="/tag/" status="live" />
<txp:else />
<h1>Todas las etiquetas</h1>
<br />
<txp:tru_tags_cloud wraptag="ul" break="li" minpercent="120" maxpercent="120" />
</txp:tru_tags_if_tag_search>
</div>
</txp:if_section>
<txp:if_individual_article>
<txp:output_form form="custom_4" />
<txp:else />
<txp:article form="custom_1" limit="1"/>
<div id="post-b">
<txp:article form="custom_2" limit="1" />
</div>
</txp:if_individual_article>
</div>
<txp:output_form form="righ-blog"/>
</div>
</div>
<txp:output_form form="footer"/>
</div>
</body>
</html>
Now I put on the if_individual_article tag, a new form , custom_4 wich have the problem:
This is custom_4:
<txp:article form="cus-indiv" />
<div id="post-b">
<txp:article_custom form="second-post-model" limit="3" section="blog" offset="1" sort="Posted asc" />
</div>
Here, I played around in all the possibles ways, adding and taking out offset, sort, section… can I use instead section category1 and category 2.?. probably the system cant mach both categories.. As I describe, on the main page of the blog, I use two styles, which are sorted by category ( big-post and small-post) and what I pretend, is to use section blog ( all those articles are in the same section) to display all the articles under this section, blog.. My objective is on the individual page, to have an archive of all the articles (just to clarify..)
Many thanks again Els for your time!
Amavai
Offline
#15 2010-09-29 21:06:02
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Offset sorting question
Seriously, I want to help you, but without the tag trace it’s hard to tell where it goes wrong.
Offline
#16 2010-09-30 10:30:16
- amavai
- Member
- Registered: 2009-08-25
- Posts: 37
Re: Offset sorting question
Hi Els, sorry, I was my fault because I was looking for it on the browser and It appear on the source code.
This is the tag trace for the main page“blog”.
<!-- Runtime: 0.0561 -->
<!-- Query time: 0.011530 -->
<!-- Queries: 50 -->
<!-- Memory: 7368Kb, <txp:tru_tags_from_article /> -->
<!-- txp tag trace:
[SQL (0.0001540184021): select name, data from txp_lang where lang='en-gb' AND ( event='public' OR event='common')]
[SQL (0.00139093399048): select name, code, version from txp_plugin where status = 1 AND type IN (0,1) order by load_order]
[SQL (0.000119924545288): select version from txp_plugin where status = 1 AND name='sed_section_fields']
[SQL (5.69820404053E-5): select version from txp_plugin where status = 1 AND name='cnk_section_tree']
[SQL (0.000108003616333): select name, val from txp_prefs where prefs_id=1 AND user_name='']
[SQL (0.000108957290649): select title from txp_section where name='blog']
[SQL (7.60555267334E-5): select name from txp_section where `name` like 'blog' limit 1]
[SQL (7.20024108887E-5): select page, css from txp_section where name = 'blog' limit 1]
[SQL (0.000689029693604): select host from txp_log where ip='90.163.214.155' limit 1]
[SQL (0.000339031219482): insert into txp_log set `time`=now(),page='/blog',ip='90.163.214.155',host='90.163.214.155',refer='',status='200',method='GET']
[SQL (6.60419464111E-5): select user_html from txp_page where name='blog']
[Page: blog]
<txp:output_form form="header-blog"/>
[SQL (0.000110149383545): select Form from txp_form where name='header-blog']
[Form: header-blog]
<txp:if_section name="tag">
[<txp:if_section name="tag">: false]
<txp:if_individual_article>
[<txp:if_individual_article>: false]
<txp:site_name />
<txp:section title="1" />
[SQL (7.79628753662E-5): select title from txp_section where name='blog']
</txp:if_individual_article>
</txp:if_section>
<txp:rss_live_search_js />
<txp:feed_link flavor="atom" format="link" label="Atom" />
<txp:feed_link flavor="rss" format="link" label="RSS" />
<txp:output_form form="logo-lang"/>
[SQL (8.60691070557E-5): select Form from txp_form where name='logo-lang']
[Form: logo-lang]
<txp:output_form form="main-menu"/>
[SQL (7.41481781006E-5): select Form from txp_form where name='main-menu']
[Form: main-menu]
<txp:if_section name="tag">
[<txp:if_section name="tag">: false]
</txp:if_section>
<txp:if_individual_article>
[<txp:if_individual_article>: false]
<txp:article form="custom_1" limit="1"/>
[SQL (0.000693082809448): select count(*) from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('blog')]
[SQL (0.000427007675171): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('blog') order by Posted desc limit 0, 1]
[article 15]
[SQL (9.91821289062E-5): select Form from txp_form where name='custom_1']
[Form: custom_1]
<txp:article_custom form="main-post-model" category="big-post" limit="2" />
[SQL (0.000764846801758): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('big-post') or Category2 IN ('big-post')) order by Posted desc limit 0, 2]
[article 6]
[SQL (8.39233398438E-5): select Form from txp_form where name='main-post-model']
[Form: main-post-model]
<txp:permlink />
<txp:title />
<txp:author/>
[SQL (5.50746917725E-5): select RealName from txp_users where `name` = 'la5e' limit 1]
<txp:posted />
<txp:permlink />
<txp:article_image />
[SQL (6.38961791992E-5): select * from txp_image where id = 26]
<txp:rss_auto_excerpt words="45" overrideexcerpt="1" linktext="Seguir leyendo »" />
<txp:tru_tags_if_has_tags>
[SQL (8.58306884766E-5): select Keywords from textpattern where ID='6' AND Keywords <> '']
[<txp:tru_tags_if_has_tags>: true]
<txp:tru_tags_from_article />
[SQL (8.41617584229E-5): select name from txp_section where searchable != '1']
[SQL (0.000298023223877): select Keywords from textpattern where Keywords <> ''and Section != '' and Status >= '4' and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00')]
</txp:tru_tags_if_has_tags>
[article 5]
[Form: main-post-model]
<txp:permlink />
<txp:title />
<txp:author/>
<txp:posted />
<txp:permlink />
<txp:article_image />
[SQL (9.10758972168E-5): select * from txp_image where id = 25]
<txp:rss_auto_excerpt words="45" overrideexcerpt="1" linktext="Seguir leyendo »" />
<txp:tru_tags_if_has_tags>
[SQL (5.69820404053E-5): select Keywords from textpattern where ID='5' AND Keywords <> '']
[<txp:tru_tags_if_has_tags>: true]
<txp:tru_tags_from_article />
[SQL (5.60283660889E-5): select name from txp_section where searchable != '1']
[SQL (0.000246047973633): select Keywords from textpattern where Keywords <> ''and Section != '' and Status >= '4' and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00')]
</txp:tru_tags_if_has_tags>
<txp:article form="custom_2" limit="1" />
[SQL (0.000370979309082): select count(*) from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('blog')]
[SQL (0.000411033630371): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('blog') order by Posted desc limit 0, 1]
[article 15]
[SQL (6.79492950439E-5): select Form from txp_form where name='custom_2']
[Form: custom_2]
<txp:article_custom form="second-post-model" category="small-post" limit="3" />
[SQL (0.000489950180054): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('small-post') or Category2 IN ('small-post')) order by Posted desc limit 0, 3]
[article 15]
[SQL (7.29560852051E-5): select Form from txp_form where name='second-post-model']
[Form: second-post-model]
<txp:article_image thumbnail="1" />
[SQL (6.60419464111E-5): select * from txp_image where id = 26]
<txp:permlink />
<txp:title />
<txp:rss_auto_excerpt words="20" overrideexcerpt="1" linktext=" " />
[article 14]
[Form: second-post-model]
<txp:article_image thumbnail="1" />
[SQL (0.000115871429443): select * from txp_image where id = 26]
<txp:permlink />
<txp:title />
<txp:rss_auto_excerpt words="20" overrideexcerpt="1" linktext=" " />
[article 7]
[Form: second-post-model]
<txp:article_image thumbnail="1" />
[SQL (0.000123977661133): select * from txp_image where id = 24]
<txp:permlink />
<txp:title />
<txp:rss_auto_excerpt words="20" overrideexcerpt="1" linktext=" " />
</txp:if_individual_article>
<txp:output_form form="righ-blog"/>
[SQL (8.60691070557E-5): select Form from txp_form where name='righ-blog']
[Form: righ-blog]
<txp:rss_live_search max="10" inputvalue="Escribe aquí..." inputsize="30" showbutton="0" label="Buscador inteligente" notfound="No encontrado" searchto="search" />
<txp:feed_link label="RSS" />
<txp:feed_link flavor="atom" label="Atom" />
<txp:adi_cat_menu categories="comunicacion,eventos,marketing,rrpp" link="0" wraptag="ul" />
[SQL (7.48634338379E-5): select name, title from txp_category where type = 'article' and name in ('comunicacion','eventos','marketing','rrpp') order by field(name, 'comunicacion','eventos','marketing','rrpp')]
<txp:article_custom category="comunicacion" form="adi_cat_menu_articles" />
[SQL (0.000514984130859): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('comunicacion') or Category2 IN ('comunicacion')) order by Posted desc limit 0, 10]
[article 15]
[SQL (6.8187713623E-5): select Form from txp_form where name='adi_cat_menu_articles']
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 14]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 6]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 2]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:article_custom category="eventos" form="adi_cat_menu_articles" />
[SQL (0.00054407119751): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('eventos') or Category2 IN ('eventos')) order by Posted desc limit 0, 10]
[article 5]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:article_custom category="marketing" form="adi_cat_menu_articles" />
[SQL (0.000507116317749): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('marketing') or Category2 IN ('marketing')) order by Posted desc limit 0, 10]
[article 4]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:article_custom category="rrpp" form="adi_cat_menu_articles" />
[SQL (0.00046706199646): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('rrpp') or Category2 IN ('rrpp')) order by Posted desc limit 0, 10]
[article 3]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:tru_tags_cloud wraptag="p" minpercent="100" maxpercent="110" />
[SQL (6.69956207275E-5): select name from txp_section where searchable != '1']
[SQL (0.000224828720093): select Keywords from textpattern where Keywords <> ''and Section != '' and Status >= '4' and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00')]
[SQL (0.000102996826172): select name from txp_section where searchable != '1']
[SQL (0.000317811965942): select Keywords from textpattern where Keywords <> ''and Section != '' and Status >= '4' and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00')]
<txp:output_form form="footer"/>
[SQL (7.79628753662E-5): select Form from txp_form where name='footer']
[Form: footer]
[ ~~~ secondpass ~~~ ]
-->
And this is the tagtrace for my individual article page: ( Where the problem is)
<!-- Runtime: 0.0603 -->
<!-- Query time: 0.010539 -->
<!-- Queries: 44 -->
<!-- Memory: 7305Kb, <txp:title/> -->
<!-- txp tag trace:
[SQL (0.0001540184021): select name, data from txp_lang where lang='en-gb' AND ( event='public' OR event='common')]
[SQL (0.00133204460144): select name, code, version from txp_plugin where status = 1 AND type IN (0,1) order by load_order]
[SQL (0.000163793563843): select version from txp_plugin where status = 1 AND name='sed_section_fields']
[SQL (0.000121831893921): select version from txp_plugin where status = 1 AND name='cnk_section_tree']
[SQL (0.000110864639282): select name, val from txp_prefs where prefs_id=1 AND user_name='']
[SQL (8.20159912109E-5): select title from txp_section where name='blog']
[SQL (0.000382900238037): select ID,Section from textpattern where url_title like 'otra-entrada-en-el-blog-de-la-5a' AND Section='blog' and Status >= 4 limit 1]
[SQL (6.103515625E-5): select page, css from txp_section where name = 'blog' limit 1]
[SQL (0.000294923782349): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where ID=4 and Status in (4,5)]
[article 4]
[SQL (0.000404119491577): select ID, Title, url_title, unix_timestamp(Posted) as uposted
from textpattern where Posted > '2010-09-20 16:09:40' and Section = 'blog' and Status=4 and Posted < now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') order by Posted asc limit 1]
[SQL (0.000478029251099): select ID, Title, url_title, unix_timestamp(Posted) as uposted
from textpattern where Posted < '2010-09-20 16:09:40' and Section = 'blog' and Status=4 and Posted < now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') order by Posted desc limit 1]
[SQL (0.000581979751587): select host from txp_log where ip='90.163.214.155' limit 1]
[SQL (0.00033712387085): insert into txp_log set `time`=now(),page='/blog/otra-entrada-en-el-blog-de-la-5a',ip='90.163.214.155',host='90.163.214.155',refer='',status='200',method='GET']
[SQL (8.20159912109E-5): select user_html from txp_page where name='blog']
[Page: blog]
<txp:output_form form="header-blog"/>
[SQL (7.79628753662E-5): select Form from txp_form where name='header-blog']
[Form: header-blog]
<txp:if_section name="tag">
[<txp:if_section name="tag">: false]
<txp:if_individual_article>
[<txp:if_individual_article>: true]
<txp:site_name />
<txp:section title="1" />
[SQL (6.89029693604E-5): select title from txp_section where name='blog']
<txp:title />
</txp:if_individual_article>
</txp:if_section>
<txp:rss_live_search_js />
<txp:feed_link flavor="atom" format="link" label="Atom" />
<txp:feed_link flavor="rss" format="link" label="RSS" />
<txp:output_form form="logo-lang"/>
[SQL (0.000107049942017): select Form from txp_form where name='logo-lang']
[Form: logo-lang]
<txp:output_form form="main-menu"/>
[SQL (8.20159912109E-5): select Form from txp_form where name='main-menu']
[Form: main-menu]
<txp:if_section name="tag">
[<txp:if_section name="tag">: false]
</txp:if_section>
<txp:if_individual_article>
[<txp:if_individual_article>: true]
<txp:output_form form="custom_4" />
[SQL (5.29289245605E-5): select Form from txp_form where name='custom_4']
[Form: custom_4]
<txp:article form="cus-indiv" />
[SQL (6.41345977783E-5): select Form from txp_form where name='cus-indiv']
[Form: cus-indiv]
<txp:permlink />
<txp:title />
<txp:author/>
[SQL (5.3882598877E-5): select RealName from txp_users where `name` = 'la5e' limit 1]
<txp:posted />
<txp:permlink />
<txp:article_image />
[SQL (8.08238983154E-5): select * from txp_image where id = 24]
<txp:body />
<txp:tru_tags_if_has_tags>
[SQL (0.000220060348511): select Keywords from textpattern where ID='4' AND Keywords <> '']
[<txp:tru_tags_if_has_tags>: true]
<txp:tru_tags_from_article />
[SQL (9.3936920166E-5): select name from txp_section where searchable != '1']
[SQL (0.000313997268677): select Keywords from textpattern where Keywords <> ''and Section != '' and Status >= '4' and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00')]
</txp:tru_tags_if_has_tags>
<txp:output_form form="fb_comments" />
[SQL (6.19888305664E-5): select Form from txp_form where name='fb_comments']
[Form: fb_comments]
<txp:article_id />
<txp:permlink />
<txp:title />
<txp:article_custom form="second-post-model" limit="3" section="blog" offset="1" sort="Posted asc" />
[SQL (0.000690937042236): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('blog') order by Posted asc limit 1, 3]
[article 3]
[SQL (6.103515625E-5): select Form from txp_form where name='second-post-model']
[Form: second-post-model]
<txp:article_image thumbnail="1" />
[SQL (5.88893890381E-5): select * from txp_image where id = 23]
<txp:permlink />
<txp:title />
<txp:rss_auto_excerpt words="20" overrideexcerpt="1" linktext=" " />
[article 4]
[Form: second-post-model]
<txp:article_image thumbnail="1" />
[SQL (0.000102043151855): select * from txp_image where id = 24]
<txp:permlink />
<txp:title />
<txp:rss_auto_excerpt words="20" overrideexcerpt="1" linktext=" " />
[article 5]
[Form: second-post-model]
<txp:article_image thumbnail="1" />
[SQL (8.10623168945E-5): select * from txp_image where id = 25]
<txp:permlink />
<txp:title />
<txp:rss_auto_excerpt words="20" overrideexcerpt="1" linktext=" " />
</txp:if_individual_article>
<txp:output_form form="righ-blog"/>
[SQL (8.89301300049E-5): select Form from txp_form where name='righ-blog']
[Form: righ-blog]
<txp:rss_live_search max="10" inputvalue="Escribe aquí..." inputsize="30" showbutton="0" label="Buscador inteligente" notfound="No encontrado" searchto="search" />
<txp:feed_link label="RSS" />
<txp:feed_link flavor="atom" label="Atom" />
<txp:adi_cat_menu categories="comunicacion,eventos,marketing,rrpp" link="0" wraptag="ul" />
[SQL (9.10758972168E-5): select name, title from txp_category where type = 'article' and name in ('comunicacion','eventos','marketing','rrpp') order by field(name, 'comunicacion','eventos','marketing','rrpp')]
<txp:article_custom category="comunicacion" form="adi_cat_menu_articles" />
[SQL (0.000615835189819): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('comunicacion') or Category2 IN ('comunicacion')) order by Posted desc limit 0, 10]
[article 15]
[SQL (6.98566436768E-5): select Form from txp_form where name='adi_cat_menu_articles']
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 14]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 6]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 2]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:article_custom category="eventos" form="adi_cat_menu_articles" />
[SQL (0.000595808029175): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('eventos') or Category2 IN ('eventos')) order by Posted desc limit 0, 10]
[article 5]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:article_custom category="marketing" form="adi_cat_menu_articles" />
[SQL (0.00062894821167): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('marketing') or Category2 IN ('marketing')) order by Posted desc limit 0, 10]
[article 4]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: true]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:article_custom category="rrpp" form="adi_cat_menu_articles" />
[SQL (0.000711917877197): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('rrpp') or Category2 IN ('rrpp')) order by Posted desc limit 0, 10]
[article 3]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:tru_tags_cloud wraptag="p" minpercent="100" maxpercent="110" />
[SQL (6.60419464111E-5): select name from txp_section where searchable != '1']
[SQL (0.000287055969238): select Keywords from textpattern where Keywords <> ''and Section != '' and Status >= '4' and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00')]
[SQL (5.79357147217E-5): select name from txp_section where searchable != '1']
[SQL (0.000217914581299): select Keywords from textpattern where Keywords <> ''and Section != '' and Status >= '4' and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00')]
<txp:output_form form="footer"/>
[SQL (9.3936920166E-5): select Form from txp_form where name='footer']
[Form: footer]
[ ~~~ secondpass ~~~ ]
-->
Thank you very much again!
(And sorry for the missunderstood. I never use this code in this way… )
Last edited by amavai (2010-09-30 10:34:44)
Offline
#17 2010-09-30 17:04:52
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Offset sorting question
Thank you amavai :) This code is doing what it should do; there is no way the article_custom tag can ‘know’ which individual article is being displayed, so it displays article 4 twice.
Now can you put the code I posted here in your form ‘second-post-model’, and post the individual article’s tag trace again?
Offline
#18 2010-09-30 18:21:08
- amavai
- Member
- Registered: 2009-08-25
- Posts: 37
Re: Offset sorting question
Hi Els! nice to know that you are still there!:)
Ok, here is the code of my indivial article page:
<!-- Runtime: 0.0502 -->
<!-- Query time: 0.009659 -->
<!-- Queries: 41 -->
<!-- Memory: 7794Kb, <txp:title/> -->
<!-- txp tag trace:
[SQL (0.000168085098267): select name, data from txp_lang where lang='en-gb' AND ( event='public' OR event='common')]
[SQL (0.00124788284302): select name, code, version from txp_plugin where status = 1 AND type IN (0,1) order by load_order]
[SQL (0.000100135803223): select version from txp_plugin where status = 1 AND name='sed_section_fields']
[SQL (5.88893890381E-5): select version from txp_plugin where status = 1 AND name='cnk_section_tree']
[SQL (0.00012993812561): select name, val from txp_prefs where prefs_id=1 AND user_name='']
[SQL (0.000101804733276): select title from txp_section where name='blog']
[SQL (6.31809234619E-5): select ID,Section from textpattern where url_title like 'presencia-intitucional-en-las-convocatorias' AND Section='blog' and Status >= 4 limit 1]
[SQL (5.10215759277E-5): select page, css from txp_section where name = 'blog' limit 1]
[SQL (7.79628753662E-5): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where ID=5 and Status in (4,5)]
[article 5]
[SQL (0.000516891479492): select ID, Title, url_title, unix_timestamp(Posted) as uposted
from textpattern where Posted > '2010-09-20 16:10:17' and Section = 'blog' and Status=4 and Posted < now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') order by Posted asc limit 1]
[SQL (0.000312089920044): select ID, Title, url_title, unix_timestamp(Posted) as uposted
from textpattern where Posted < '2010-09-20 16:10:17' and Section = 'blog' and Status=4 and Posted < now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') order by Posted desc limit 1]
[SQL (0.000982999801636): select host from txp_log where ip='90.163.214.155' limit 1]
[SQL (0.000262975692749): insert into txp_log set `time`=now(),page='/blog/presencia-intitucional-en-las-convocatorias',ip='90.163.214.155',host='90.163.214.155',refer='',status='200',method='GET']
[SQL (9.51290130615E-5): select user_html from txp_page where name='blog']
[Page: blog]
<txp:output_form form="header-blog"/>
[SQL (8.20159912109E-5): select Form from txp_form where name='header-blog']
[Form: header-blog]
<txp:if_section name="tag">
[<txp:if_section name="tag">: false]
<txp:if_individual_article>
[<txp:if_individual_article>: true]
<txp:site_name />
<txp:section title="1" />
[SQL (7.20024108887E-5): select title from txp_section where name='blog']
<txp:title />
</txp:if_individual_article>
</txp:if_section>
<txp:rss_live_search_js />
<txp:feed_link flavor="atom" format="link" label="Atom" />
<txp:feed_link flavor="rss" format="link" label="RSS" />
<txp:output_form form="logo-lang"/>
[SQL (7.89165496826E-5): select Form from txp_form where name='logo-lang']
[Form: logo-lang]
<txp:output_form form="main-menu"/>
[SQL (7.60555267334E-5): select Form from txp_form where name='main-menu']
[Form: main-menu]
<txp:if_section name="tag">
[<txp:if_section name="tag">: false]
</txp:if_section>
<txp:if_individual_article>
[<txp:if_individual_article>: true]
<txp:output_form form="custom_4" />
[SQL (6.79492950439E-5): select Form from txp_form where name='custom_4']
[Form: custom_4]
<txp:article form="cus-indiv" />
[SQL (7.29560852051E-5): select Form from txp_form where name='cus-indiv']
[Form: cus-indiv]
<txp:permlink />
<txp:title />
<txp:author/>
[SQL (6.48498535156E-5): select RealName from txp_users where `name` = 'la5e' limit 1]
<txp:posted />
<txp:permlink />
<txp:article_image />
[SQL (8.10623168945E-5): select * from txp_image where id = 25]
<txp:body />
<txp:tru_tags_if_has_tags>
[SQL (5.22136688232E-5): select Keywords from textpattern where ID='5' AND Keywords <> '']
[<txp:tru_tags_if_has_tags>: true]
<txp:tru_tags_from_article />
[SQL (7.89165496826E-5): select name from txp_section where searchable != '1']
[SQL (0.000566005706787): select Keywords from textpattern where Keywords <> ''and Section != '' and Status >= '4' and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00')]
</txp:tru_tags_if_has_tags>
<txp:output_form form="fb_comments" />
[SQL (7.9870223999E-5): select Form from txp_form where name='fb_comments']
[Form: fb_comments]
<txp:article_id />
<txp:permlink />
<txp:title />
<txp:article_custom form="second-post-model" limit="3" section="blog" offset="1" sort="Posted asc" />
[SQL (0.000516891479492): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('blog') order by Posted asc limit 1, 3]
[article 3]
[SQL (8.70227813721E-5): select Form from txp_form where name='second-post-model']
[Form: second-post-model]
<txp:if_individual_article>
[<txp:if_individual_article>: false]
</txp:if_individual_article>
[article 4]
[Form: second-post-model]
<txp:if_individual_article>
[<txp:if_individual_article>: false]
</txp:if_individual_article>
[article 5]
[Form: second-post-model]
<txp:if_individual_article>
[<txp:if_individual_article>: false]
</txp:if_individual_article>
</txp:if_individual_article>
<txp:output_form form="righ-blog"/>
[SQL (9.01222229004E-5): select Form from txp_form where name='righ-blog']
[Form: righ-blog]
<txp:rss_live_search max="10" inputvalue="Escribe aquí..." inputsize="30" showbutton="0" label="Buscador inteligente" notfound="No encontrado" searchto="search" />
<txp:feed_link label="RSS" />
<txp:feed_link flavor="atom" label="Atom" />
<txp:adi_cat_menu categories="comunicacion,eventos,marketing,rrpp" link="0" wraptag="ul" />
[SQL (9.70363616943E-5): select name, title from txp_category where type = 'article' and name in ('comunicacion','eventos','marketing','rrpp') order by field(name, 'comunicacion','eventos','marketing','rrpp')]
<txp:article_custom category="comunicacion" form="adi_cat_menu_articles" />
[SQL (0.000650882720947): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('comunicacion') or Category2 IN ('comunicacion')) order by Posted desc limit 0, 10]
[article 15]
[SQL (8.70227813721E-5): select Form from txp_form where name='adi_cat_menu_articles']
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 14]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 6]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 2]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:article_custom category="eventos" form="adi_cat_menu_articles" />
[SQL (0.000546932220459): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('eventos') or Category2 IN ('eventos')) order by Posted desc limit 0, 10]
[article 5]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: true]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:article_custom category="marketing" form="adi_cat_menu_articles" />
[SQL (0.00049901008606): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('marketing') or Category2 IN ('marketing')) order by Posted desc limit 0, 10]
[article 4]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:article_custom category="rrpp" form="adi_cat_menu_articles" />
[SQL (0.000511884689331): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('rrpp') or Category2 IN ('rrpp')) order by Posted desc limit 0, 10]
[article 3]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:tru_tags_cloud wraptag="p" minpercent="100" maxpercent="110" />
[SQL (8.89301300049E-5): select name from txp_section where searchable != '1']
[SQL (0.000297069549561): select Keywords from textpattern where Keywords <> ''and Section != '' and Status >= '4' and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00')]
[SQL (7.5101852417E-5): select name from txp_section where searchable != '1']
[SQL (0.000336885452271): select Keywords from textpattern where Keywords <> ''and Section != '' and Status >= '4' and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00')]
<txp:output_form form="footer"/>
[SQL (7.89165496826E-5): select Form from txp_form where name='footer']
[Form: footer]
[ ~~~ secondpass ~~~ ]
-->
Just to let you know, now is not displaying nothing. The “archive group” is hide.. Hope that helps! Could be something regarding the categories? I am lost, honestly..
Many thanks!
Amavai
Offline
#19 2010-09-30 19:40:09
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Offset sorting question
Aha, I think I see what the problem is. What happens if you remove the if_individual_article tags from your form ‘second-post-model’? So make it like this:
<txp:if_article_id id='<txp:article_id />'>
<txp:else />
<div class="p-secoblog">
<txp:article_image thumbnail="1" />
<h4><a href="<txp:permlink />"><txp:title /></a></h4>
<txp:rss_auto_excerpt words="20" overrideexcerpt="1" wraptag="p" linktext=" " />
</div>
</txp:if_article_id>
Offline
#20 2010-10-01 07:41:37
- amavai
- Member
- Registered: 2009-08-25
- Posts: 37
Re: Offset sorting question
Hello!
Here is the tag trace with your code:
<!-- Runtime: 0.0530 -->
<!-- Query time: 0.008958 -->
<!-- Queries: 41 -->
<!-- Memory: 7795Kb, <txp:title/> -->
<!-- txp tag trace:
[SQL (0.000176191329956): select name, data from txp_lang where lang='en-gb' AND ( event='public' OR event='common')]
[SQL (0.00121402740479): select name, code, version from txp_plugin where status = 1 AND type IN (0,1) order by load_order]
[SQL (8.79764556885E-5): select version from txp_plugin where status = 1 AND name='sed_section_fields']
[SQL (7.20024108887E-5): select version from txp_plugin where status = 1 AND name='cnk_section_tree']
[SQL (0.000144004821777): select name, val from txp_prefs where prefs_id=1 AND user_name='']
[SQL (8.51154327393E-5): select title from txp_section where name='blog']
[SQL (8.01086425781E-5): select ID,Section from textpattern where url_title like 'otra-entrada-en-el-blog-de-la-5a' AND Section='blog' and Status >= 4 limit 1]
[SQL (9.70363616943E-5): select page, css from txp_section where name = 'blog' limit 1]
[SQL (8.60691070557E-5): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where ID=4 and Status in (4,5)]
[article 4]
[SQL (0.00052809715271): select ID, Title, url_title, unix_timestamp(Posted) as uposted
from textpattern where Posted > '2010-09-20 16:09:40' and Section = 'blog' and Status=4 and Posted < now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') order by Posted asc limit 1]
[SQL (0.000345945358276): select ID, Title, url_title, unix_timestamp(Posted) as uposted
from textpattern where Posted < '2010-09-20 16:09:40' and Section = 'blog' and Status=4 and Posted < now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') order by Posted desc limit 1]
[SQL (0.000497817993164): select host from txp_log where ip='90.163.214.155' limit 1]
[SQL (0.000287055969238): insert into txp_log set `time`=now(),page='/blog/otra-entrada-en-el-blog-de-la-5a',ip='90.163.214.155',host='90.163.214.155',refer='',status='200',method='GET']
[SQL (7.79628753662E-5): select user_html from txp_page where name='blog']
[Page: blog]
<txp:output_form form="header-blog"/>
[SQL (7.60555267334E-5): select Form from txp_form where name='header-blog']
[Form: header-blog]
<txp:if_section name="tag">
[<txp:if_section name="tag">: false]
<txp:if_individual_article>
[<txp:if_individual_article>: true]
<txp:site_name />
<txp:section title="1" />
[SQL (6.79492950439E-5): select title from txp_section where name='blog']
<txp:title />
</txp:if_individual_article>
</txp:if_section>
<txp:rss_live_search_js />
<txp:feed_link flavor="atom" format="link" label="Atom" />
<txp:feed_link flavor="rss" format="link" label="RSS" />
<txp:output_form form="logo-lang"/>
[SQL (6.29425048828E-5): select Form from txp_form where name='logo-lang']
[Form: logo-lang]
<txp:output_form form="main-menu"/>
[SQL (5.00679016113E-5): select Form from txp_form where name='main-menu']
[Form: main-menu]
<txp:if_section name="tag">
[<txp:if_section name="tag">: false]
</txp:if_section>
<txp:if_individual_article>
[<txp:if_individual_article>: true]
<txp:output_form form="custom_4" />
[SQL (5.19752502441E-5): select Form from txp_form where name='custom_4']
[Form: custom_4]
<txp:article form="cus-indiv" />
[SQL (6.103515625E-5): select Form from txp_form where name='cus-indiv']
[Form: cus-indiv]
<txp:permlink />
<txp:title />
<txp:author/>
[SQL (5.50746917725E-5): select RealName from txp_users where `name` = 'la5e' limit 1]
<txp:posted />
<txp:permlink />
<txp:article_image />
[SQL (6.79492950439E-5): select * from txp_image where id = 24]
<txp:body />
<txp:tru_tags_if_has_tags>
[SQL (5.10215759277E-5): select Keywords from textpattern where ID='4' AND Keywords <> '']
[<txp:tru_tags_if_has_tags>: true]
<txp:tru_tags_from_article />
[SQL (6.91413879395E-5): select name from txp_section where searchable != '1']
[SQL (0.000447988510132): select Keywords from textpattern where Keywords <> ''and Section != '' and Status >= '4' and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00')]
</txp:tru_tags_if_has_tags>
<txp:output_form form="fb_comments" />
[SQL (9.79900360107E-5): select Form from txp_form where name='fb_comments']
[Form: fb_comments]
<txp:article_id />
<txp:permlink />
<txp:title />
<txp:article_custom form="second-post-model" limit="3" section="blog" offset="1" sort="Posted asc" />
[SQL (0.000555992126465): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('blog') order by Posted asc limit 1, 3]
[article 3]
[SQL (7.9870223999E-5): select Form from txp_form where name='second-post-model']
[Form: second-post-model]
<txp:if_article_id id='<txp:article_id />'>
[attribute 'id']
<txp:article_id />
[/attribute]
[<txp:if_article_id id='<txp:article_id />'>: true]
</txp:if_article_id>
[article 4]
[Form: second-post-model]
<txp:if_article_id id='<txp:article_id />'>
[attribute 'id']
<txp:article_id />
[/attribute]
[<txp:if_article_id id='<txp:article_id />'>: true]
</txp:if_article_id>
[article 5]
[Form: second-post-model]
<txp:if_article_id id='<txp:article_id />'>
[attribute 'id']
<txp:article_id />
[/attribute]
[<txp:if_article_id id='<txp:article_id />'>: true]
</txp:if_article_id>
</txp:if_individual_article>
<txp:output_form form="righ-blog"/>
[SQL (9.20295715332E-5): select Form from txp_form where name='righ-blog']
[Form: righ-blog]
<txp:rss_live_search max="10" inputvalue="Escribe aquí..." inputsize="30" showbutton="0" label="Buscador inteligente" notfound="No encontrado" searchto="search" />
<txp:feed_link label="RSS" />
<txp:feed_link flavor="atom" label="Atom" />
<txp:adi_cat_menu categories="comunicacion,eventos,marketing,rrpp" link="0" wraptag="ul" />
[SQL (8.9168548584E-5): select name, title from txp_category where type = 'article' and name in ('comunicacion','eventos','marketing','rrpp') order by field(name, 'comunicacion','eventos','marketing','rrpp')]
<txp:article_custom category="comunicacion" form="adi_cat_menu_articles" />
[SQL (0.000638961791992): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('comunicacion') or Category2 IN ('comunicacion')) order by Posted desc limit 0, 10]
[article 15]
[SQL (8.01086425781E-5): select Form from txp_form where name='adi_cat_menu_articles']
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 14]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 6]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 2]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:article_custom category="eventos" form="adi_cat_menu_articles" />
[SQL (0.000512838363647): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('eventos') or Category2 IN ('eventos')) order by Posted desc limit 0, 10]
[article 5]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:article_custom category="marketing" form="adi_cat_menu_articles" />
[SQL (0.000488042831421): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('marketing') or Category2 IN ('marketing')) order by Posted desc limit 0, 10]
[article 4]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: true]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:article_custom category="rrpp" form="adi_cat_menu_articles" />
[SQL (0.000497102737427): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('rrpp') or Category2 IN ('rrpp')) order by Posted desc limit 0, 10]
[article 3]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:tru_tags_cloud wraptag="p" minpercent="100" maxpercent="110" />
[SQL (8.79764556885E-5): select name from txp_section where searchable != '1']
[SQL (0.000307083129883): select Keywords from textpattern where Keywords <> ''and Section != '' and Status >= '4' and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00')]
[SQL (8.60691070557E-5): select name from txp_section where searchable != '1']
[SQL (0.000319957733154): select Keywords from textpattern where Keywords <> ''and Section != '' and Status >= '4' and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00')]
<txp:output_form form="footer"/>
[SQL (6.98566436768E-5): select Form from txp_form where name='footer']
[Form: footer]
[ ~~~ secondpass ~~~ ]
-->
The archive is sitll hide.. but, if I change your single quote ‘ ‘ for the double quotes “” I receive information, but like as the beginning, with the article repeating…
This is the form that works with the double quotes :
<txp:if_article_id id="<txp:article_id />">
<txp:else />
<div class="p-secoblog">
<txp:article_image thumbnail="1" />
<h4><a href="<txp:permlink />"><txp:title /></a></h4>
<txp:rss_auto_excerpt words="20" overrideexcerpt="1" wraptag="p" linktext=" " />
</div>
</txp:if_article_id>
And this is the tag trace :
<!-- Runtime: 0.0641 -->
<!-- Query time: 0.009079 -->
<!-- Queries: 44 -->
<!-- Memory: 7813Kb, <txp:title/> -->
<!-- txp tag trace:
[SQL (0.000180959701538): select name, data from txp_lang where lang='en-gb' AND ( event='public' OR event='common')]
[SQL (0.00137090682983): select name, code, version from txp_plugin where status = 1 AND type IN (0,1) order by load_order]
[SQL (0.000117063522339): select version from txp_plugin where status = 1 AND name='sed_section_fields']
[SQL (9.29832458496E-5): select version from txp_plugin where status = 1 AND name='cnk_section_tree']
[SQL (0.000148057937622): select name, val from txp_prefs where prefs_id=1 AND user_name='']
[SQL (0.000101089477539): select title from txp_section where name='blog']
[SQL (9.98973846436E-5): select ID,Section from textpattern where url_title like 'otra-entrada-en-el-blog-de-la-5a' AND Section='blog' and Status >= 4 limit 1]
[SQL (5.29289245605E-5): select page, css from txp_section where name = 'blog' limit 1]
[SQL (7.89165496826E-5): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where ID=4 and Status in (4,5)]
[article 4]
[SQL (0.000615119934082): select ID, Title, url_title, unix_timestamp(Posted) as uposted
from textpattern where Posted > '2010-09-20 16:09:40' and Section = 'blog' and Status=4 and Posted < now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') order by Posted asc limit 1]
[SQL (0.000320911407471): select ID, Title, url_title, unix_timestamp(Posted) as uposted
from textpattern where Posted < '2010-09-20 16:09:40' and Section = 'blog' and Status=4 and Posted < now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') order by Posted desc limit 1]
[SQL (0.000383138656616): select host from txp_log where ip='90.163.214.155' limit 1]
[SQL (0.000227928161621): insert into txp_log set `time`=now(),page='/blog/otra-entrada-en-el-blog-de-la-5a',ip='90.163.214.155',host='90.163.214.155',refer='',status='200',method='GET']
[SQL (8.79764556885E-5): select user_html from txp_page where name='blog']
[Page: blog]
<txp:output_form form="header-blog"/>
[SQL (8.01086425781E-5): select Form from txp_form where name='header-blog']
[Form: header-blog]
<txp:if_section name="tag">
[<txp:if_section name="tag">: false]
<txp:if_individual_article>
[<txp:if_individual_article>: true]
<txp:site_name />
<txp:section title="1" />
[SQL (5.50746917725E-5): select title from txp_section where name='blog']
<txp:title />
</txp:if_individual_article>
</txp:if_section>
<txp:rss_live_search_js />
<txp:feed_link flavor="atom" format="link" label="Atom" />
<txp:feed_link flavor="rss" format="link" label="RSS" />
<txp:output_form form="logo-lang"/>
[SQL (5.50746917725E-5): select Form from txp_form where name='logo-lang']
[Form: logo-lang]
<txp:output_form form="main-menu"/>
[SQL (5.10215759277E-5): select Form from txp_form where name='main-menu']
[Form: main-menu]
<txp:if_section name="tag">
[<txp:if_section name="tag">: false]
</txp:if_section>
<txp:if_individual_article>
[<txp:if_individual_article>: true]
<txp:output_form form="custom_4" />
[SQL (6.38961791992E-5): select Form from txp_form where name='custom_4']
[Form: custom_4]
<txp:article form="cus-indiv" />
[SQL (8.58306884766E-5): select Form from txp_form where name='cus-indiv']
[Form: cus-indiv]
<txp:permlink />
<txp:title />
<txp:author/>
[SQL (5.69820404053E-5): select RealName from txp_users where `name` = 'la5e' limit 1]
<txp:posted />
<txp:permlink />
<txp:article_image />
[SQL (6.60419464111E-5): select * from txp_image where id = 24]
<txp:body />
<txp:tru_tags_if_has_tags>
[SQL (5.3882598877E-5): select Keywords from textpattern where ID='4' AND Keywords <> '']
[<txp:tru_tags_if_has_tags>: true]
<txp:tru_tags_from_article />
[SQL (7.70092010498E-5): select name from txp_section where searchable != '1']
[SQL (0.000308036804199): select Keywords from textpattern where Keywords <> ''and Section != '' and Status >= '4' and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00')]
</txp:tru_tags_if_has_tags>
<txp:output_form form="fb_comments" />
[SQL (6.8187713623E-5): select Form from txp_form where name='fb_comments']
[Form: fb_comments]
<txp:article_id />
<txp:permlink />
<txp:title />
<txp:article_custom form="second-post-model" limit="3" section="blog" offset="1" sort="Posted asc" />
[SQL (0.000461101531982): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('blog') order by Posted asc limit 1, 3]
[article 3]
[SQL (6.00814819336E-5): select Form from txp_form where name='second-post-model']
[Form: second-post-model]
<txp:if_article_id id="<txp:article_id />">
[<txp:if_article_id id="<txp:article_id />">: false]
<txp:article_image thumbnail="1" />
[SQL (6.41345977783E-5): select * from txp_image where id = 23]
<txp:permlink />
<txp:title />
<txp:rss_auto_excerpt words="20" overrideexcerpt="1" wraptag="p" linktext=" " />
Tag error: <txp:rss_auto_excerpt words="20" overrideexcerpt="1" wraptag="p" linktext=" " /> -> Textpattern Notice: Unknown tag attribute: wraptag on line 699
</txp:if_article_id>
[article 4]
[Form: second-post-model]
<txp:if_article_id id="<txp:article_id />">
[<txp:if_article_id id="<txp:article_id />">: false]
<txp:article_image thumbnail="1" />
[SQL (8.58306884766E-5): select * from txp_image where id = 24]
<txp:permlink />
<txp:title />
<txp:rss_auto_excerpt words="20" overrideexcerpt="1" wraptag="p" linktext=" " />
Tag error: <txp:rss_auto_excerpt words="20" overrideexcerpt="1" wraptag="p" linktext=" " /> -> Textpattern Notice: Unknown tag attribute: wraptag on line 699
</txp:if_article_id>
[article 5]
[Form: second-post-model]
<txp:if_article_id id="<txp:article_id />">
[<txp:if_article_id id="<txp:article_id />">: false]
<txp:article_image thumbnail="1" />
[SQL (8.79764556885E-5): select * from txp_image where id = 25]
<txp:permlink />
<txp:title />
<txp:rss_auto_excerpt words="20" overrideexcerpt="1" wraptag="p" linktext=" " />
Tag error: <txp:rss_auto_excerpt words="20" overrideexcerpt="1" wraptag="p" linktext=" " /> -> Textpattern Notice: Unknown tag attribute: wraptag on line 699
</txp:if_article_id>
</txp:if_individual_article>
<txp:output_form form="righ-blog"/>
[SQL (0.000105857849121): select Form from txp_form where name='righ-blog']
[Form: righ-blog]
<txp:rss_live_search max="10" inputvalue="Escribe aquí..." inputsize="30" showbutton="0" label="Buscador inteligente" notfound="No encontrado" searchto="search" />
<txp:feed_link label="RSS" />
<txp:feed_link flavor="atom" label="Atom" />
<txp:adi_cat_menu categories="comunicacion,eventos,marketing,rrpp" link="0" wraptag="ul" />
[SQL (9.10758972168E-5): select name, title from txp_category where type = 'article' and name in ('comunicacion','eventos','marketing','rrpp') order by field(name, 'comunicacion','eventos','marketing','rrpp')]
<txp:article_custom category="comunicacion" form="adi_cat_menu_articles" />
[SQL (0.000539064407349): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('comunicacion') or Category2 IN ('comunicacion')) order by Posted desc limit 0, 10]
[article 15]
[SQL (5.91278076172E-5): select Form from txp_form where name='adi_cat_menu_articles']
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 14]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 6]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
[article 2]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:article_custom category="eventos" form="adi_cat_menu_articles" />
[SQL (0.000699996948242): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('eventos') or Category2 IN ('eventos')) order by Posted desc limit 0, 10]
[article 5]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:article_custom category="marketing" form="adi_cat_menu_articles" />
[SQL (0.00055193901062): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('marketing') or Category2 IN ('marketing')) order by Posted desc limit 0, 10]
[article 4]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: true]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:article_custom category="rrpp" form="adi_cat_menu_articles" />
[SQL (0.000480175018311): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and (Category1 IN ('rrpp') or Category2 IN ('rrpp')) order by Posted desc limit 0, 10]
[article 3]
[Form: adi_cat_menu_articles]
<txp:adi_cat_menu_if>
[<txp:adi_cat_menu_if>: false]
</txp:adi_cat_menu_if>
<txp:permlink>
<txp:title/>
</txp:permlink>
<txp:tru_tags_cloud wraptag="p" minpercent="100" maxpercent="110" />
[SQL (7.48634338379E-5): select name from txp_section where searchable != '1']
[SQL (0.000256061553955): select Keywords from textpattern where Keywords <> ''and Section != '' and Status >= '4' and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00')]
[SQL (7.70092010498E-5): select name from txp_section where searchable != '1']
[SQL (0.000240802764893): select Keywords from textpattern where Keywords <> ''and Section != '' and Status >= '4' and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00')]
<txp:output_form form="footer"/>
[SQL (9.20295715332E-5): select Form from txp_form where name='footer']
[Form: footer]
[ ~~~ secondpass ~~~ ]
-->
BUT this time, with the double quotes, in the debugging mode, appear more code on the top of the page.
Tag error: <txp:rss_auto_excerpt words="20" overrideexcerpt="1" wraptag="p" linktext=" " /> -> Textpattern Notice: Unknown tag attribute: wraptag on line 699
textpattern/lib/txplib_misc.php:699 trigger_error()
textpattern/lib/txplib_misc.php(594) : eval()'d code:28 lAtts()
textpattern/publish.php:1106 rss_auto_excerpt()
textpattern/publish.php:1028 processTags()
textpattern/publish/taghandlers.php:1479 parse()
textpattern/publish.php:1106 if_article_id()
textpattern/publish.php:1041 processTags()
textpattern/lib/txplib_misc.php:1621 parse()
textpattern/publish.php:786 parse_form()
textpattern/publish.php:903 doArticles()
Tag error: <txp:rss_auto_excerpt words="20" overrideexcerpt="1" wraptag="p" linktext=" " /> -> Textpattern Notice: Unknown tag attribute: wraptag on line 699
textpattern/lib/txplib_misc.php:699 trigger_error()
textpattern/lib/txplib_misc.php(594) : eval()'d code:28 lAtts()
textpattern/publish.php:1106 rss_auto_excerpt()
textpattern/publish.php:1028 processTags()
textpattern/publish/taghandlers.php:1479 parse()
textpattern/publish.php:1106 if_article_id()
textpattern/publish.php:1041 processTags()
textpattern/lib/txplib_misc.php:1621 parse()
textpattern/publish.php:786 parse_form()
textpattern/publish.php:903 doArticles()
Tag error: <txp:rss_auto_excerpt words="20" overrideexcerpt="1" wraptag="p" linktext=" " /> -> Textpattern Notice: Unknown tag attribute: wraptag on line 699
textpattern/lib/txplib_misc.php:699 trigger_error()
textpattern/lib/txplib_misc.php(594) : eval()'d code:28 lAtts()
textpattern/publish.php:1106 rss_auto_excerpt()
textpattern/publish.php:1028 processTags()
textpattern/publish/taghandlers.php:1479 parse()
textpattern/publish.php:1106 if_article_id()
textpattern/publish.php:1041 processTags()
textpattern/lib/txplib_misc.php:1621 parse()
textpattern/publish.php:786 parse_form()
textpattern/publish.php:903 doArticles()
As far as I can understand from this, there are some errors with the rss_auto_excerpt, If I use <txp:excerpt/> they disappear.. Of course I can sacrify the rss_auto_excerpt plugin if is necessary!
Hope that helps!
Thank you very much!
Amavai
Offline
#21 2010-10-01 09:43:47
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Offset sorting question
Sorry to make you go through all this trouble, Amavai! Can you try this in your form second-post-model please?
<txp:if_article_id>
<txp:else />
<div class="p-secoblog">
<txp:article_image thumbnail="1" />
<h4><a href="<txp:permlink />"><txp:title /></a></h4>
<txp:rss_auto_excerpt words="20" overrideexcerpt="1" wraptag="p" linktext=" " />
</div>
</txp:if_article_id>
Offline
#22 2010-10-01 11:11:36
- amavai
- Member
- Registered: 2009-08-25
- Posts: 37
Re: Offset sorting question
Hi Els!! Yes! its working!! thank you!!
So, <txp:if_article_id> works like the offset attribute in the sense that is taking all the articles as an entire list, nice to know, I will gonna play around to try to understand it.
Just a little detail, but I think that I take from you a lot of time.. I will put the final resolution on the first post, but there is an small problem that I cant understand..
Sometimes (normally) on the individual article page, the archive is displaying 4 posts ( with no repetition!!) but, in other articles are displaying only 3.. I don’t know why..
But again, this is an small detail comparing to the main problem..
Thank you so very much Els!
Offline
#23 2010-10-01 11:41:48
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Offset sorting question
amavai wrote:
So, <txp:if_article_id> works like the offset attribute in the sense that is taking all the articles as an entire list, nice to know, I will gonna play around to try to understand it.
Yes, it takes all articles, and if the id equals the id of the individual article, it doesn’t display anything for that article. But it needs to be in individual article context, so either in an individual article form or – like in this case – inside if_individual_article tags. The reason that it took me so long before I got it right, is that I overlooked that <txp:article_id />
calls the id of the article that is being displayed by the article_custom tag, and not the individual article’s id. So it always returns true, and displays nothing…
Sometimes (normally) on the individual article page, the archive is displaying 4 posts ( with no repetition!!) but, in other articles are displaying only 3.. I don’t know why..
Is it possible that you still have the offset
attribute in the article_custom tag? If so, remove it.
Offline