Intechnic
Users Developers
Home / Forums / In-Portal CMS / General In-Portal Discussions / count detail insted of visit / Topic Posts

In-Portal Forum

This is a place for users of In-Portal to ask questions, discuss various topics, and interact with other members of the In-Portal Community. Please report bugs through the Bugs Team (not the Forum). If you are interested in contributing or joining one of the many Teams for In-Portal, please check out the Contribute section of the website.
 

In-Portal Forum

count detail insted of visit (5)


Posted: 08/12/2005 5:25:00 PM

Reply Quoted  


Hello,

inlink count each time a visit to the site is made, and innews count how many time the detail page of an article was viewed.

As I am not using inlink as a URL directory, is it possible to make inlink act as innews and count the times the detail page of a link was viewed?

Regards,

Posted: 08/13/2005 6:08:02 PM

Reply Quoted  


tariq wrote:08/12/2005 5:25:00 PM
Hello,

inlink count each time a visit to the site is made, and innews count how many time the detail page of an article was viewed.

As I am not using inlink as a URL directory, is it possible to make inlink act as innews and count the times the detail page of a link was viewed?

Regards,


Hello Tariq,

Yeah, I thinkit's possible. We use standard method $this->Increment("Hits", true); to increase counters for all types and it's only matter when to call it. For example with Articles it's called when we load the entiry body of that Article. Any place I can take a look at your site in order to see how this can be used there?

Thanks.

Posted: 08/13/2005 7:26:01 PM

Reply Quoted  


Hello Dmitry,

Yes, please do http://almirkaz.com/index.php

The front-end is in arabic and I made some custom tpls, I want to count inlink/detail.tpl & inlink/print.tpl

Thanks

[Edited By tariq on 08/13/05 7:49:24 PM]

Posted: 08/15/2005 9:30:19 AM

Reply Quoted  


tariq wrote:08/13/2005 7:26:01 PM
Hello Dmitry,

Yes, please do http://almirkaz.com/index.php

The front-end is in arabic and I made some custom tpls, I want to count inlink/detail.tpl & inlink/print.tpl

Thanks

[Edited By tariq on 08/13/05 7:49:24 PM]


Hello,

Open in-link/parser.php and find the following function l_link_detail. This is how it should look like:

function l_link_detail($attribs = array())
{
  global $objLinkList;

  $t = $attribs["_itemtemplate"
  if(strlen($t))
  {
    $LinkId = int)$attribs["_linkid"
    if($LinkId)
    {
      $link = $objLinkList->GetItem($LinkId);
    }
    else
      $link = $objLinkList->GetCurrentItem();
    if(is_object($link))
    {
      $o = $link->ParseTemplate($t);
      $link->Increment("Hits", true);
    }
  }
  return $o;
}



Now any time you call for <inp:l_link_detail _ItemTemplate="..." /> it will increase that link counter.

Thanks.

[Edited By Dmitry on 08/15/05 9:32:35 AM]

Posted: 08/15/2005 4:45:23 PM

Reply Quoted  


Dmitry wrote:08/15/2005 9:30:19 AM
tariq wrote:08/13/2005 7:26:01 PM
Hello Dmitry,

Yes, please do http://almirkaz.com/index.php

The front-end is in arabic and I made some custom tpls, I want to count inlink/detail.tpl & inlink/print.tpl

Thanks

[Edited By tariq on 08/13/05 7:49:24 PM]


Hello,

Open in-link/parser.php and find the following function l_link_detail. This is how it should look like:

function l_link_detail($attribs = array())
{
  global $objLinkList;

  $t = $attribs["_itemtemplate"
  if(strlen($t))
  {
    $LinkId = int)$attribs["_linkid"
    if($LinkId)
    {
      $link = $objLinkList->GetItem($LinkId);
    }
    else
      $link = $objLinkList->GetCurrentItem();
    if(is_object($link))
    {
      $o = $link->ParseTemplate($t);
      $link->Increment("Hits", true);
    }
  }
  return $o;
}



Now any time you call for <inp:l_link_detail _ItemTemplate="..." /> it will increase that link counter.

Thanks.

[Edited By Dmitry on 08/15/05 9:32:35 AM]



Thanks, worked GREAT

[Edited By tariq on 08/15/05 5:02:47 PM]