1
acegamer
news 1.44 don't count for webmasters or admins
  • 2006/10/7 10:10

  • acegamer

  • Not too shy to talk

  • Posts: 162

  • Since: 2005/7/11


Hello, i have a question about how to activate in news 1.44 the counter for also webmasters en admins.

Because now he don't count it :s
Only for members and annou... vistors.


Thx

AceG.

2
acegamer
Re: news 1.44 don't count for webmasters or admins
  • 2006/10/8 9:20

  • acegamer

  • Not too shy to talk

  • Posts: 162

  • Since: 2005/7/11


Someone ?

3
wizanda
Re: news 1.44 don't count for webmasters or admins
  • 2006/10/8 9:52

  • wizanda

  • Home away from home

  • Posts: 1585

  • Since: 2004/3/21


Sorry was going to say the other day ask Hervé Thouzard as it is his module...I normally go to his site and post there...helps him to find what you are seeking....

4
acegamer
Re: news 1.44 don't count for webmasters or admins
  • 2006/10/8 11:26

  • acegamer

  • Not too shy to talk

  • Posts: 162

  • Since: 2005/7/11


I already have done that...
but i get no anwser

5
tcnet
Re: news 1.44 don't count for webmasters or admins
  • 2006/10/8 18:32

  • tcnet

  • Friend of XOOPS

  • Posts: 297

  • Since: 2006/5/12


edit modules/news/article.php somewhere around line 158

/**
 * update counter only when viewing top page and when you are not the author or an admin
 */
if (empty($_GET['com_id']) && $storypage == 0) {
  if(
is_object($xoopsUser)) {
     if( (
$xoopsUser->getVar('uid')==$article->uid()) || is_admin_group()) {
     } else {
      
$article->updateCounter();
     }
   } else {
     
$article->updateCounter();
   }
}

to
/** HACKED to include admin in counter
 * update counter only when viewing top page and when you are not the author
 */
if (empty($_GET['com_id']) && $storypage == 0) {
  if(
is_object($xoopsUser)) {
     if( (
$xoopsUser->getVar('uid')==$article->uid()){
     } else {
      
$article->updateCounter();
     }
   } else {
     
$article->updateCounter();
   }
}

6
acegamer
Re: news 1.44 don't count for webmasters or admins
  • 2006/10/8 20:04

  • acegamer

  • Not too shy to talk

  • Posts: 162

  • Since: 2005/7/11


Quote:

tcnet wrote:
edit modules/news/article.php somewhere around line 158

/**
 * update counter only when viewing top page and when you are not the author or an admin
 */
if (empty($_GET['com_id']) && $storypage == 0) {
  if(
is_object($xoopsUser)) {
     if( (
$xoopsUser->getVar('uid')==$article->uid()) || is_admin_group()) {
     } else {
      
$article->updateCounter();
     }
   } else {
     
$article->updateCounter();
   }
}

to
/** HACKED to include admin in counter
 * update counter only when viewing top page and when you are not the author
 */
if (empty($_GET['com_id']) && $storypage == 0) {
  if(
is_object($xoopsUser)) {
     if( (
$xoopsUser->getVar('uid')==$article->uid()){
     } else {
      
$article->updateCounter();
     }
   } else {
     
$article->updateCounter();
   }
}


I get this error Quote:
Parse error: syntax error, unexpected '{' in /mounted-storage/home24b/sub001/sc22304-CAED/www/modules/news/article.php on line 163

7
tcnet
Re: news 1.44 don't count for webmasters or admins
  • 2006/10/8 21:50

  • tcnet

  • Friend of XOOPS

  • Posts: 297

  • Since: 2006/5/12


Try this one. It works locally on XOOPS 2.2.4

/**
 * update counter only when viewing top page and when you are not the author
 */
if (empty($_GET['com_id']) && $storypage == 0) {
    if(
is_object($xoopsUser)) {
        if( 
$xoopsUser->getVar('uid')==$article->uid()) {
        } else {
            
$article->updateCounter();
            }
    } else {
        
$article->updateCounter();
    }
}

8
hervet
Re: news 1.44 don't count for webmasters or admins
  • 2006/10/9 9:10

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Quote:

acegamer wrote:
I already have done that...
but i get no anwser

Hum !
You had to wait 2 DAYS !
Please be patient and take the time to say thank you !

9
acegamer
Re: news 1.44 don't count for webmasters or admins
  • 2006/10/9 16:22

  • acegamer

  • Not too shy to talk

  • Posts: 162

  • Since: 2005/7/11


Edit the file article.php, find this line :
if( ($xoopsUser->getVar('uid')==$article->uid()) || news_is_admin_group()) {


and after it insert :

$article->updateCounter();



thats it ;)

Thanks

Tonight my new website will be launched in Holland And Belgium ;)

Login

Who's Online

217 user(s) are online (152 user(s) are browsing Support Forums)


Members: 0


Guests: 217


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits