Welcome to Geeklog, Anonymous Wednesday, January 08 2025 @ 09:43 pm EST

Geeklog Forums

Staticpages and Stats


Status: offline

RickW

Forum User
Full Member
Registered: 01/28/04
Posts: 240
Location:United States
I have staticpages I'm using for some Intro blocks on my topic pages. I'm not linking to them by themselves, and I don't have it checked to add to menu. But they show up on my stats page and in my search results.

Is there any way I can hide them as results?
www.antisource.com
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Set the permissions accordingly.

bye, Dirk
 Quote

Status: offline

RickW

Forum User
Full Member
Registered: 01/28/04
Posts: 240
Location:United States
Ohhhh I'm not the brightest bulb in the pack today. Thanks.

edit:
Oops, that doesn't work. Well it does, but too good. If I remove permissions for Anonymous and Members, it does remove it from stats and search results, but also removes it from the top of my topic page I have it assigned to.
www.antisource.com
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
So what you really want is an option for static pages not to show up in the stats when they're used as center blocks, correct?

Shouldn't be too hard to add a AND (sp_centerblock = 0) in the code for the static page's stats function somewhere ...

bye, Dirk
 Quote

Status: offline

RickW

Forum User
Full Member
Registered: 01/28/04
Posts: 240
Location:United States
Anybody have an idea where to add the statement that Dirk suggested?

Would it be easier to just exclude staticpages from stats and searches? If so, how can do I that?
www.antisource.com
 Quote

Status: offline

drshakagee

Forum User
Full Member
Registered: 10/01/03
Posts: 231
Should work if you change line 122 of the staticpages functions.inc to look like this:
Text Formatted Code
$result = DB_query ("SELECT sp_id,sp_title,sp_hits FROM {$_TABLES['staticpage']} WHERE sp_hits > 0 AND (sp_centerblock = 0)" . $perms . ' ORDER BY sp_hits DESC LIMIT 10');
 

Yes I am mental.
 Quote

Status: offline

RickW

Forum User
Full Member
Registered: 01/28/04
Posts: 240
Location:United States
Thank you, that works. What change do I have to make to exclude them from search results?
www.antisource.com
 Quote

Status: offline

drshakagee

Forum User
Full Member
Registered: 10/01/03
Posts: 231
I just did a little test and it looks like this will work for the searching (just did a little test so test it out yourself, all my staticpages are php which I don't think works well with the searching) change line 251 in the staticpages functions.inc
from this:
Text Formatted Code

    $sql    .= " ORDER BY sp_date desc";

 

to this:

Text Formatted Code
$sql    .= "AND (sp_centerblock = 0) ORDER BY sp_date desc";

 

Yes I am mental.
 Quote

Status: offline

RickW

Forum User
Full Member
Registered: 01/28/04
Posts: 240
Location:United States
Thank you very much, that works. Its a deal - shaking hands
www.antisource.com
 Quote

All times are EST. The time is now 09:43 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content