{IF_CATALOGUE_ENTRY_EXISTS}


{+START,IF_EMPTY,{$PHOTO}}
… You can add a photo …
{+END}
{+START,IF_EMPTY,{$AVATAR}}
… You can add an avatar …
{+END}
What I'd like to do next is find out if they posted in a Specific CATALOGUE. To do that, there would be an ENTRY into that Specific CATALOGUE in ce_submitter (I think) that matches the Member's ID. If such an ENTRY exists, then they posted in that CATALOGUE. If it didn't, then I can print something that says "You can Post in CATALOGUE X"
I tried these Tempcode commands:
{$CATALOGUE_ENTRY_BACKREFS,1}
{$CATALOGUE_ENTRY_FIELD_VALUE,1,0}
{$CATALOGUE_ENTRY_FIELD_VALUE_PLAIN,1,0}
{$CATALOGUE_ENTRY_FOR,download,3}
{$CATALOGUE_ENTRY_ALL_FIELD_VALUES,1}
They are probably returning arrays or something, because they don't print anything out on return to the Tempcode page I put them in.
I can do this in PHP, but I'd have to turn on the ability to use PHP in Tempcode pages, and if I do that, it kind of diminishes the value of Tempcode. Can I get a better understanding of what these Tempcode commands return, so that I can see if one of them will tell me if the current Member has posted something to a Specific CATALOGUE.
Ultimately, if this Tempcode doesn't exist, it would be pretty handy to have something like this:
{+START,IF_EMPTY,{$CATALOGUE_ENTRY_MATCHES,<catalogue name>,<col>,<value>}}
<p>You still haven't posted in our blah database</p>
{+END}


{$CATALOGUE_ENTRY_BACKREFS,1} additionally assumes that there is another catalogue entry with a field referencing entry #1.
{$CATALOGUE_ENTRY_FOR,download,3} is assuming there is a download #3 and that you have defined at least one custom downloads field, and download #3 was added/edited subsequent to that field being created.
None of the symbols are related specifically to querying for a particular member. Mostly it's catalogue entry #1 regardless of whether the current user was the original submitter of that entry.
To amuse myself, I did work out a way you can do it:
Code
{$IS_NON_EMPTY,{$BLOCK,block=main_multi_content,render_if_empty=0,param=catalogue_entry,max=1,filter=ce_submitter={$MEMBER}}}
However, that is awful and I definitely do not recommend it

I'll see if I can suggest something better.
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.


content_count.tar
This will tell you how many catalogue entries the current user has:
{$CONTENT_COUNT,catalogue_entry,ce_submitter={$MEMBER}}
So if it is non-zero then it means they have entries.
You can query any Composr content type (find content type codenames by looking to see what files are in sources/hooks/content_meta_aware) with any Filtercode string you want.
ce_submitter is literally the field name in the catalogue_entries table.
I like my symbol, I'll add it to tracker for consideration in core for future versions.
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.


{$CONTENT_COUNT,catalogue_entry,ce_submitter={$MEMBER} AND c_name=links}
{$CONTENT_COUNT,catalogue_entry,ce_submitter={$MEMBER} AND c_name=faqs}
{$CONTENT_COUNT,catalogue_entry,ce_submitter={$MEMBER} AND c_name=recipes}
So that it more selectively counts the number of catalogue entries in different catalogues?


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.


For Quizzes: it looks like sources/hooks/systems/content_meta_aware/quiz.php looks at cms_quizzes and so it doesn't contain information about who took a quiz. I don't see anything else in this folder that talks about table cms_quiz_entries with col q_member. So to gather the data about who took a quiz, I'd need to do something like sources/hooks/systems/content_meta_aware/quiz.php and change the table in it and the fields appropriately and rename it to something and add it to sources_custom/hooks/systems/content_meta_aware/quiz_results.php and then I can…
{+START,IF,{$LT,{$CONTENT_COUNT,quiz_results,q_member={$MEMBER}},1}}
<p>You should take a quiz.</p>
{+END}
That sounds about correct?


You'd be better off customising the symbol or making a new one.
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.