vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Need help (https://vborg.vbsupport.ru/showthread.php?t=46392)

Roody 12-05-2002 12:47 PM

Need help
 
I have made two posts about this, but havent received any help so far, so Im providing those posts in here. Here is my situation. I am currently running a hack that shows the number of threads/posts since a persons last visit. The problem with the hack is, that it isnt done at member level meaning people who dont have permission to see certain forums are still having the hack tell them that posts are there to be seen when they arent.

Naturally this is a bit confusing, and I could use any help that someone could provide. Here is the link where I have been trying to obtain help. Thanks

Link

N9ne 12-05-2002 03:08 PM

I don't understand...do you want something that will cut out the new posts and threads of a private forum which the user cannot access?

NTLDR 12-05-2002 03:50 PM

If you have moderation on for forums or users then this is why, you need to add:

[SQL]AND visible=1[/SQL]

To the WHERE clause of both the queries you add to index.php

Roody 12-05-2002 04:14 PM

ok here is what I mean. lets say you are a basic member on my boards. When you click on the new posts/new thread hack which lists exactly how many are new since your last visit if your permissions arent set to see all the forums then even if it lists posts as being new it may come up saying that their is no more new ones.

My questions is, is there a way to incorporate this hack on the member level so the hack correctly shows new posts and threads based on a person's permissions?

As for your post NTDLR..im not sure I follow if what you showed me will do this? Does it?

Erwin 12-06-2002 02:37 AM

In your query, put what NTLDR wrote after the WHERE section of that query, so that only posts visible to the user is counted.

Roody 12-06-2002 11:32 AM

ok thanks Erwin for clearing that up for me. I was a little confused with what NTDLR was saying.

Roody 12-08-2002 05:43 PM

ok guys i finally got this up and running, but i got the following error when I ran that query:

Error

SQL-query :

AND visible = 1

MySQL said:

You have an error in your SQL syntax near 'AND visible = 1' at line 1

Dean C 12-08-2002 06:11 PM

[sql]
AND visible = '1'
[/sql]

That should be part of the query

You shouldn't have the apostrophes in those positions

- miSt

Roody 12-08-2002 07:08 PM

I actually did it without apostrophes also Mist, and received the same error. Any other ideas?

NTLDR 12-08-2002 07:15 PM

Can you post the entire query from the PHP file here?

Roody 12-08-2002 07:18 PM

ok I used this query : AND visible=1

and got this result: Error

SQL-query :

AND visible = 1

MySQL said:

You have an error in your SQL syntax near 'AND visible = 1' at line 1

word of note - I got this error when I did it with apostrophes and without.

NTLDR 12-08-2002 07:21 PM

The problem is:

[sql]AND visible = 1 [/sql]

Isn't a query. Post the origional code that you were trying to change so we can see how it needs to be changed :)

Roody 12-08-2002 07:24 PM

ok im confused now. I asked in my very first post in this thread what needed to be done so that the new thread/new posts hack would read at a member level instead of the way it currently does.

at the moment when a person clicks on the new threads/posts link that shows how many new threads/posts are there its possible even if it lists new ones that they wont see them due to permissions. When I asked how I could put it at a member level I was told to run a query like this: AND visible=1

NTLDR 12-08-2002 07:35 PM

Quote:

Originally posted by Roody
When I asked how I could put it at a member level I was told to run a query like this: AND visible=1
No where in this thread were you told to run that query (as its only part of one).

This is the PHP to add instead:

PHP Code:

$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE visible=1 AND lastpost > '$bbuserinfo[lastvisit]'");
$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE visible=1 AND dateline > '$bbuserinfo[lastvisit]'"); 

This will take care of posts in the moderation queue, however taking forum permissions into account invloves significate changes to index.php which can't be posted here.

Roody 12-08-2002 07:37 PM

ok sorry about that NTDLR. I apparently misunderstood since this stuff is a little over my head. As for your php info, is that what I put in my index.php in place of the current changes to it to achieve this hack?

Also, what is it again that this code will specifically do?

oh and one last question where do i find out about the kind of changes to be done to index.php that cant be posted here?

NTLDR 12-08-2002 08:07 PM

No problem, yes just replace the code with that I posted above.

That will remove new posts and threads in the count that arn't visible on the forums, ie in a moderation queue.

Looking at the permissions it looks harder than I first thought, I remember now trying to do this in the past. If its just a few forums then you can manually add them to not be included, however if you have many different access levels above 2 or more, then the amount of code increses quite a bit and IMO probably wouldn't be worth it.

Roody 12-09-2002 07:04 PM

ok NTLDR. here is an update on this situation. I installed that line of code on my test forums. Then using the Admin account I made a post in a private forum, and then I signed into a regular "Registered" user account that didn't have permissions to see the forum where the admin account posted in.

Unfortunately it listed the regular "Registered" user account as having a new thread/post, but when I clicked on that link I got the following message: "Sorry - no matches. Please try some different terms."

Any suggestions on my next move? Did I misunderstand something here?

NTLDR 12-09-2002 08:59 PM

That only excludes posts in the moderation queue. With alot a lot of hacking and changes (which I've never got to work) you can get forum permissions to apply automatically.

Which leaves 2 choices IMO, 1, Leave it as is 2, manually exclude every forum thats private for all users (or non-mods/admins).

Roody 12-09-2002 09:12 PM

Quote:

Originally posted by NTLDR
That only excludes posts in the moderation queue.

2, manually exclude every forum thats private for all users (or non-mods/admins).

okay, here is my newbie questions. explain the moderation queue thing. im guessing this is the function that if enabled would prevent users from having posts applied to the forums until moderated by an admin? Second, im not sure Im following how to manually exclude a forum that is private for all non-mods admin. Can you break this down for me some?

Roody 12-10-2002 12:29 PM

Im bumping this up to make sure someone sees my question. :)

Roody 12-11-2002 10:00 AM

bump again

Roody 12-12-2002 02:06 AM

and again...

Roody 12-13-2002 12:17 AM

I really could use the help if anyone can give it. thx

Roody 12-14-2002 01:20 PM

ok now im really not sure why all my help went away. here for hoping they come back


All times are GMT. The time now is 06:07 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01162 seconds
  • Memory Usage 1,765KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (24)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete