Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-05-18 08:31:51

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355
Website

aks_article : Extended article_custom tag

aks_article

v0.3 download link / homepage

Change log

v0.1 plugin was writen for testing Feature Idea <txp:else />
v0.2+ plugin is completely rewritten

Changes v0.2.4:
  • added support <txp:else />
  • added attributes category1, category2, where (sql syntax)
  • extend attribute status to status list
Changes v0.2.5:
  • Inside form:
    • zebra-lines feature, useful for zebra-coloring lines
    • active-line feature, useful for set class=“active”
    • get current line number
  • Return txp:variables:
    • displayed articles
    • rest articles (limit – displayed), useful for additional call to aks_article
    • next count for second zebra call
Changes v0.2.6:
  • Prev/Next carousel feature – show nearest articles.
  • Multi-column feature.
Changes v0.2.7
  • Attribute time added new value 'all' equivalent as time="any"' and expired="1" (this remove time check condition from sql query)
  • New experimental attribute list allow to generate a list of articles with minimal impact on mysql. This support ONLY <txp:title /> and <txp:permlink /> tags inside form.
    • New experimental attribute listfield used with list attribute.
Changes v0.2.8
  • Shorthand for list attribute
Changes v0.2.9
  • Added search feature (based on MySQL FULLTEXT search) – useful for get related articles

More documentation and examples

Last edited by makss (2016-07-02 15:16:24)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#2 2012-05-22 08:55:45

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355
Website

Re: aks_article : Extended article_custom tag

aks_article v.0.2.4

This plugin is completely rewritten. First post updated.

Last edited by makss (2016-01-16 18:58:55)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#3 2012-05-22 10:47:38

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

Re: aks_article : Extended article_custom tag

Although I was trying to do this using native tags, your plugin would do just nicely :)

Thanks makss.


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 2012-05-22 12:10:52

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,310

Re: aks_article : Extended article_custom tag

where="custom_1 > custom_2+custom_3"

status="hidden,5,live"

OMG, thanks! Long live makss!


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#5 2012-05-22 13:01:21

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,539
Website GitHub Twitter

Re: aks_article : Extended article_custom tag

Ah cool now i can use category2 in my website structure!

Thanks makss

Offline

#6 2012-05-23 01:30:33

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: aks_article : Extended article_custom tag

Very nice thanks

Offline

#7 2012-08-31 11:07:20

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355
Website

Re: aks_article : Extended article_custom tag

Changes aks_article v0.2.5:

  • Inside form:
    • zebra-lines feature, useful for zebra-coloring lines
    • active-line feature, useful for set class=“active”
    • get current line number
  • Return txp:variables:
    • displayed articles
    • rest articles (limit – displayed), useful for additional call to aks_article
    • next count for second zebra call

Example zebra/active/count features

<txp:aks_article category2="mycat" limit="10" sort="title" wraptag="ul" zebra="3">
	<li class="zebra<txp:aks_article_zebra /><txp:if_aks_article_active value=" active" />">
		<txp:aks_article_count  /> <txp:title />
	</li>
</txp:aks_article>
Displayed: <txp:variable name="aks_article_count" /> articles
Limit - Displayed = <txp:variable name="aks_article_rest" /> articles

HTML output:

<ul>
<li class="zebra0"> 1 King</li>
<li class="zebra1"> 2 La Bonne Maison</li>
<li class="zebra2"> 3 Marmaris</li>
<li class="zebra0 active"> 4 Paradise</li>
<li class="zebra1"> 5 Relax</li>
<li class="zebra2"> 6 Sunrise</li>
</ul>
Displayed: 6 articles
Limit - Displayed = 4 articles

and additional call for rest 4 articles with other conditions

<txp:if_variable name="aks_article_rest" />
	<txp:aks_article category2="othercat" zebra="3"
		limit='<txp:variable name="aks_article_rest" />'
		zebra_next='<txp:variable name="aks_article_zebra_next" />'
	 />
</txp:if_variable>

know bug – not stored last zebra color for second call aks_articleFIXED, zebra_next attribute

Last edited by makss (2016-01-16 18:59:26)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#8 2012-09-04 09:35:53

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355
Website

Re: aks_article : Extended article_custom tag

Changes aks_article v0.2.6:

New: Prev/Next carousel feature – show nearest articles by sort order.

Sample:
** prev_article-2
** prev_article-1
** prev_article
** current_article
** next_article
** next_article+1
** next_article+2

New: Multi-column feature.

Sample:

<table><tr>
<td>
	1 article
	2 article
	3 article
</td>
<td>
	4 article
	5 article
	6 article
</td>
<td>
	7 article
	8 article
	9 article
</td>
</tr></table>

Last edited by makss (2016-01-16 18:59:49)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#9 2012-09-04 13:18:31

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: aks_article : Extended article_custom tag

Interesting and usefull for some projects, makss ! Thanks !

Any news on rss_unlimited categories for 4.5 ?

Offline

#10 2012-09-05 14:17:55

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355
Website

Re: aks_article : Extended article_custom tag

jpdupont wrote:

Any news on rss_unlimited categories for 4.5 ?

Perhaps now it’s working…


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#11 2012-10-31 17:21:41

feragnoli
Member
From: the hague
Registered: 2005-02-10
Posts: 150

Re: aks_article : Extended article_custom tag

hello,
many thanks for your work and your plugins.

is it possible to prevent the carousel feature from loading old articles as ‘next’ ones?
right now, if the current article is the last article posted, the carousel produces this:

  • prev_article-1
  • prev_article
  • current_article
  • next_article ( last article posted )
  • next_article+1 ( oldest article posted )

thanks you.


what was that again…?

Offline

#12 2013-10-23 08:28:49

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355
Website

Re: aks_article : Extended article_custom tag

Changes aks_article v0.2.7:

  • New experimental attribute list allow to generate a list of articles with minimal impact on mysql. This support ONLY <txp:title /> and <txp:permlink /> tags inside form.
    • New experimental attribute listfield used with list attribute.
  • Attribute time added new value 'all' equivalent as time="any"' and expired="1" (this remove time check condition from sql query)

Background:

Conducted revision their sites, they used a lot of simple lists of related articles. Based on article_custom/aks_article.
I noticed that these lists (sql queries) are not cached in the internal cache mysql.

For sample:

<txp:aks_article section="ua" category2="bus2" limit="50" break=" "><a href="<txp:permlink />"><txp:title /></a></txp:aks_article>

executes the query:

Query_time: 0.014056 Lock_time: 0.000229 Rows_sent: 24 Rows_examined: 253 Rows_affected: 0 Rows_read: 253
Bytes_sent: 1020721 Tmp_tables: 0 Tmp_disk_tables: 0 Tmp_table_sizes: 0
QC_Hit: No Full_scan: No Full_join: No Tmp_table: No Tmp_table_on_disk: No
Filesort: Yes Filesort_on_disk: No Merge_passes: 0
SET timestamp=1382443356;
select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from txp_textpattern as textpattern where Status IN (4) and Posted <= now() and (now() <= Expires or Expires = ’0000-00-00 00:00:00’) and Category2 IN (‘bus2’) and Section IN (‘ua’) order by Posted desc limit 0, 50;

Bytes_sent: 1020721 bytes – This query returns all fields, but really I only need ID,Title,url_title,Section
QC_Hit: No – Do not use the internal cache mysql. Because the query is a function now() and fields type `text`.

New code:

<txp:aks_article section="ua" category2="bus2" limit="50" time="all" list="permlink" break=" " />

Query_time: 0.000056 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0 Rows_affected: 0 Rows_read: 0
Bytes_sent: 1776 Tmp_tables: 0 Tmp_disk_tables: 0 Tmp_table_sizes: 0
QC_Hit: Yes Full_scan: No Full_join: No Tmp_table: No Tmp_table_on_disk: No
Filesort: No Filesort_on_disk: No Merge_passes: 0
SET timestamp=1382443818;
select ID,Title,url_title,Section,Category1,Category2 from txp_textpattern as textpattern where Status IN (4) and Category2 IN (‘bus2’) and Section IN (‘ua’) order by Posted desc limit 0, 50;

Last edited by makss (2016-01-16 19:00:26)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

Board footer

Powered by FluxBB