Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[plugin] [ORPHAN] glx_if: some conditional tags
Version: 0.7
Download: glx_if
Updated to 0.7
Since 0.6.6 this plugin should work in txp 4. Please report any bugs.
Maybe this sort of things could be done some other way, but this helped me, so I hope it could be of any help to someone else to :)
This plugin comes with 11 different conditional tags.
glx_if_frontpage
If we are on the websites frontpage
glx_if_not_frontpage
If we are not on the websites frontpage, searchpage or category list. hmmm this could be the same as if_individual_article, well i cant remember why i did this one. But it is there for you to play with.
glx_if_section_frontpage
If we are on a sections frontpage
glx_if_not_section_frontpage
If we are not on the sections frontpage but in a section
glx_if_search
If the user are doing a search
glx_if_not_search
If a search not have been attempted
glx_if_category_list
If we are on a category list
glx_if_comments_open
If comments are open for this article
glx_if_comments_closed
If comments are closed for this article
glx_if_comments_closed_comments
If comments are closed for this article, but there are comments left before
glx_if_comments_count
Oputput text if comments are equal to something
You can see some examples and more info here
edit: new version 0.6.4
Copy/Paste Plugin
YToxMDp7czo0OiJuYW1lIjtzOjY6ImdseF9pZiI7czo2OiJhdXRob3IiO3M6MTM6IkpvaGFuIE5pbHNzb24iO3M6MTA6ImF1dGhvcl91cmkiO3M6MjU6Imh0dHA6Ly9qb2hhbi5nYWxheGVuLm5ldC8iO3M6NzoidmVyc2lvbiI7czozOiIwLjciO3M6MTE6ImRlc2NyaXB0aW9uIjtzOjIxOiJTb21lIGNvbmRpdGlvbmFsIHRhZ3MiO3M6NDoiaGVscCI7czo3MDI1OiI8aDE+Z2x4X2lmPC9oMT4KCgk8cD5UaGlzIHBsdWdpbiBjb21lcyB3aXRoIDExIGRpZmZlcmVudCBjb25kaXRpb25hbCB0YWdzLiBNb3N0IG9mIHRoZW0gY291bGQgYmUgdXNlZCBpbiBlaXRoZXIgYSBwYWdlIHRlbXBsYXRlIG9yIGluIGEgZm9ybS48L3A+CgoJPHA+PGEgaHJlZj0iI2dseF9pZl9mcm9udHBhZ2UiPmdseF9pZl9mcm9udHBhZ2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G5vCmNvbW1lbnRzIGFscmVhZHkuIEl0IGlzIGZhbHNlIGFzIGRlZmF1bHQKKi8KZnVuY3Rpb24gZ2x4X2lmX2NvbW1lbnRzX2Nsb3NlZCgkYXR0cywgJHRoaW5nKQp7CiAgICBpZiAoaXNfYXJyYXkoJGF0dHMpKSBleHRyYWN0KCRhdHRzKTsKICAgIGdsb2JhbCAkdGhpc2FydGljbGU7CiAgICAkaWdub3JlQ29tbWVudHMgPSAoZW1wdHkoJGlnbm9yZWNvbW1lbnRzKSkgPyBmYWxzZSA6IHRydWU7CiAgICAkaWQgPSAkdGhpc2FydGljbGVbInRoaXNpZCJdOwogICAgJG91dHB1dCA9ICIiOwogICAgJHJzID0gc2FmZV9yb3coIioiLCAidGV4dHBhdHRlcm4iLCAiSUQ9ICRpZCBBTkQgQW5ub3RhdGU9MCIpOwogICAgaWYgKCRycykKICAgIHsKICAgICAgICBpZiAoJGlnbm9yZUNvbW1lbnRzKQogICAgICAgIHsKICAgICAgICAgICAgJHJzMiA9IHNhZmVfcm93KCJDT1VOVCggZGlzY3Vzc2lkICkgQVMgbnVtX29mX2NvbW1lbnRzIiwgInR4cF9kaXNjdXNzIiwgInBhcmVudGlkID0gJGlkIik7CiAgICAgICAgICAgIGlmICgkcnMyKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBpZiAoJHJzMlswXSA9PSAwKQogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICRvdXRwdXQgPSBwYXJzZSgkdGhpbmcpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UKICAgICAgICB7CiAgICAgICAgICAgICRvdXRwdXQgPSBwYXJzZSgkdGhpbmcpOwogICAgICAgIH0KICAgIH0KICAgIHJldHVybiAkb3V0cHV0Owp9CgovKgpJZiB0aGlzIHRhZyBpcyBub3QgZW5jbG9zZWQgd2l0aCBvdGhlciB0YWdzIG9yIHRleHQgaXQgd2lsbCBvdXRwdXQKa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gICAgICAkb3V0cHV0ID0gcGFyc2UoJHRoaW5nKTsKICAgICAgICBicmVhazsKICAgICAgICBjYXNlICJsZXNzX3RoYW4iOgogICAgICAgICAgICBpZiAoJHZhbHVlIDwgJHRoaXNhcnRpY2xlWydjb21tZW50c19jb3VudCddKQogICAgICAgICAgICAkb3V0cHV0ID0gcGFyc2UoJHRoaW5nKTsKICAgICAgICBicmVhazsKICAgICAgICBjYXNlICJncmVhdGVyX3RoYW4iOgogICAgICAgICAgICBpZiAoJHZhbHVlIDwgJHRoaXNhcnRpY2xlWydjb21tZW50c19jb3VudCddKQogICAgICAgICAgICAkb3V0cHV0ID0gcGFyc2UoJHRoaW5nKTsKICAgICAgICBicmVhazsKICAgICAgICBjYXNlICJsZXNzX3RoYW5fb3JfZXF1YWxfdG8iOgogICAgICAgICAgICBpZiAoJHZhbHVlIDw9ICR0aGlzYXJ0aWNsZVsnY29tbWVudHNfY291bnQnXSkKICAgICAgICAgICAgJG91dHB1dCA9IHBhcnNlKCR0aGluZyk7CiAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAiZ3JlYXRlcl90aGFuX29yX2VxdWFsX3RvIjoKICAgICAgICAgICAgaWYgKCR2YWx1ZSA+PSAkdGhpc2FydGljbGVbJ2NvbW1lbnRzX2NvdW50J10pCiAgICAgICAgICAgICRvdXRwdXQgPSBwYXJzZSgkdGhpbmcpOwogICAgICAgIGJyZWFrOwogICAgfQoKICAgIHJldHVybiAkb3V0cHV0Owp9CgpmdW5jdGlvbiBnbHhfaWZfaW1hZ2VfZGlzcGxheSgkYXR0cywgJHRoaW5nKQp7CiAgICBnbG9iYWwgJHA7CiAgICByZXR1cm4gcGFyc2UoRXZhbEVsc2UoJHRoaW5nLCAhZW1wdHkoJHApKSk7Cn0KZnVuY3Rpb24gZ2x4X2lmX25vdF9pbWFnZV9kaXNwbGF5KCRhdHRzLCAkdGhpbmcpCnsKICAgIGdsb2JhbCAkcDsKICAgIHJldHVybiBwYXJzZShFdmFsRWxzZSgkdGhpbmcsIGVtcHR5KCRwKSkpOwp9CiI7czo0OiJ0eXBlIjtzOjE6IjAiO3M6NToib3JkZXIiO3M6MToiNSI7czozOiJtZDUiO3M6MzI6IjA4MmFjZmZiM2UyMjAyYmM0M2M1YzUzNGIzNzU1N2I5Ijt9
Last edited by osei (2005-09-28 20:19:52)
Johan Nilsson
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
thank you! :)
textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
New version 0.4 now includes
- glx_if_comments_open
- glx_if_comments_closed
Hope the bugs has been sorted out now.
Johan Nilsson
Offline
#4 2004-10-27 20:12:03
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: [plugin] [ORPHAN] glx_if: some conditional tags
Not sure if this is possible, but what about if_comments_closed_comments
i.e. comments are closed but there are some comments from when comments were open.
Thanks for all your hard work.
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
lee: i was actually thinking of that when i just wrote the if_comments_closed, well i see what i can do.
Johan Nilsson
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
so i was wondering… we have an “if comments” tag.. what about an “if category”?
so you could have “this article is filed in thoughts”
but if it has no category, then it wouldn’t print the “this article….”
^ that’s what i’m really looking to be able to do.
it might also be interesting to have it identify specific categories, so that you could print phrases specific to particular categoies.
i thought this request might be related to this glx_if plugin… otherwise i’ll humbly post a new separate thread for a new plugin request…
thank you much… the glx_if plugin really is very helpful, btw, osei.
Last edited by alicson (2004-10-28 06:23:01)
textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
> so you could have “this article is filed in thoughts” but if it has no category, then it wouldn’t print the “this article….” ^ that’s what i’m really looking to be able to do.
Sencer has written a plugin asy_category_tags that i use on my own site that does this, hmm i think it isnt printing the “this article….”
> it might also be interesting to have it identify specific categories, so that you could print phrases specific to particular categoies.
isnt there already an if_category tag?
> thank you much… the glx_if plugin really is very helpful, btw, osei.
no problem :)
Last edited by osei (2004-10-28 09:43:26)
Johan Nilsson
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
I have now updated <code>glx_if<code> to version 0.5
glx_if_comments_closed_comments
If comments are closed for this article, but there are comments left before
I also had to rebuild the glx_if_comments_close tag to make it work with glx_if_comments_closed_comments
To glx_if_comments_closed you could use the attribute <code>ignorecomments=“false”</code> to ignore if comments have been left before. This is very handy if you want this tag to work with if_comments_closed_comments, by deafult it is set to true and will work like it did in version 0.4
Version 0.4 is still available if something went wront with this update.
Johan Nilsson
Offline
#9 2004-10-28 10:32:49
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: [plugin] [ORPHAN] glx_if: some conditional tags
You’ve been very busy! Thanks for all the new plugins there very useful, especially the latest addition.
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
> osei wrote:
Sencer has written a plugin asy_category_tags that i use on my own site that does this, hmm i think it isnt printing the “this article….”
wow. i really have no excuse for why i missed that. i actually have used the “asy_category_list” part of the plugin… i had misread/misunderstood the “asy_category_tags” tag, though. i’ll try it out :)
sorry for my oversight! and thank you for pointing it out..
and again for the glx_if
textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation
Offline
Re: [plugin] [ORPHAN] glx_if: some conditional tags
no problemos, it is very easy to miss plugins here…
glad you like the glx_if plugin :)
Johan Nilsson
Offline
#12 2004-10-31 22:26:05
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: [plugin] [ORPHAN] glx_if: some conditional tags
osei you’re probably sick to death of “if’s” by now. But the following would be nice if you feel like it/have the time.
glx_if_comments_eq0 (equal)
glx_if_comments_eq1
glx_if_comments_mt1 (more than)
Sorry to push it .
best, Lee.
Offline