We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15309
    • 30 Posts
    hi,

    i am looking to find a solution to below.

    how to show no. of documents that are restricted to a site visitor.

    i mean i need a website visitor to register to view all the pages... but need to highlight that i have 100’s of documents of his interest.. so that he gets a hint , and a reason to register. but can read or view only a bunch of it when not logged in.

    is there a way to get it work..??
      • 4310
      • 2,310 Posts
      This snippet would do it, not very elegant but quick!
      <?php
      $output = '';
      $count = mysql_query ('SELECT COUNT(*) FROM `modx_site_content` WHERE `privateweb` = 1');
      $pcount = mysql_fetch_array ($count, MYSQL_NUM);
      $pagecount = number_format ($pcount[0]);
      $output .='<h1>Total restricted documents '.$pagecount.'</h1>';
      return $output;
      ?>