Forum for discussing general topics related to Couch.
5 posts Page 1 of 1
Hi, all

I have a cloanable data-bound page, by which register member can submit there data, a register member (member module) can submit unlimited record per day using this page.

as a example a@gmail.com submit 2 nos. record (data) today and b@gmail.com submit 5 record (data) today.
a@gmail submit total 10 record (data) in this month and b@gmail.com submit 35 record (data) in this month.

It displaying a list entry of a@gmail.com or b@gmail.com using
Code: Select all
<cms:if y_email == k_member_email >
where y_email is a editable name of cloanable page. when after they are login.

Now I like to show a summary list eg. of a@gmail.com
10/7/2016-9 post
20/8/2016- 2 post
22/8/2016- 4 post
24/8/2016 -4 post
July Month - 9 post
August Month-10 post

Need your help.

Thanks
Subhamoy
Hi Subhamoy,

Normally we use the <cms:archives /> tag to create this type of listing.
However, in your case we need to total only posts associated with a particular user so it won't be of much use.

There is no out-of-the box solution, I am sorry.
Tweaking the SQL query used by cms:archives to make it incorporate the new condition and then executing the modified query through <cms:query /> tag could be one way of creating this summary list.
Hi, KK Sir
Thanks for you advice.,
Subhamoy
Just a Quick idea maybe it helps. Some time ago I needed a list of invoices sorted and grouped by date and used this code.
Code: Select all
<cms:archives masterpage='sales.php' type='monthly'> 
   <div class="row">
    <div class="panel"><strong><cms:date k_archive_date format='F Y' /></strong></div>
     <div class="large-12 columns">
     
      <cms:pages masterpage='companies.php' custom_field="sales.php::company=ANY" start_on=k_archive_date stop_before=k_next_archive_date>
     
       <cms:set statusopen='0' 'global'/>
       <cms:set Inopen='0' 'global'/>
       
         <cms:reverse_related_pages 'company' masterpage='sales.php' folder='open-invoices'>
            <cms:set statusopen=k_total_records 'global'/>
         </cms:reverse_related_pages>
     
          <cms:if statusopen gt '0'>
           <a href="<cms:show k_page_link />"><p><strong><cms:show k_page_title /></strong></p></a>
         <cms:reverse_related_pages 'company' masterpage='sales.php' folder='open-invoices' start_on=k_archive_date stop_before=k_next_archive_date>

           <p><a href="<cms:show k_page_link />">In<cms:show invoice_number /> <cms:show k_page_title /></a> -
           Date: <cms:date k_page_date format='d-m-Y'/> - Invoice total: <cms:number_format invoice_sum decimal_precision='2' decimal_character=',' thousands_separator='.'/>
           </p>
           <cms:set Inopencount="<cms:show invoice_sum />"/>
           <cms:set Inopen="<cms:add Inopen Inopencount/>" 'global'/>
         </cms:reverse_related_pages>
         <p align="right"><strong><cms:number_format Inopen decimal_precision='2' decimal_character=',' thousands_separator='.'/> €</strong></p>
         <hr/>
         </cms:if>
      </cms:pages>
     
     </div>
     
   </div>
</cms:archives>



I'm not sure but looping the <cms:archives /> and using <cms:reverse_related_pages/> within this loop could work for you.
<cms:set statusopen=k_total_records 'global'/> gave me the total count I needed in this case.
I load frameworks and write bugs on top of them, after that I rearrange the code so that it looks like a cool product.
Thanks Tomarnst ,
for the code you provide, I will try with it.

Subhamoy
5 posts Page 1 of 1