![]() |
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 |
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?
|
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 |
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? |
In your query, put what NTLDR wrote after the WHERE section of that query, so that only posts visible to the user is counted.
|
ok thanks Erwin for clearing that up for me. I was a little confused with what NTDLR was saying.
|
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 |
[sql]
AND visible = '1' [/sql] That should be part of the query You shouldn't have the apostrophes in those positions - miSt |
I actually did it without apostrophes also Mist, and received the same error. Any other ideas?
|
Can you post the entire query from the PHP file here?
|
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. |
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 :) |
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 |
Quote:
This is the PHP to add instead: PHP Code:
|
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? |
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. |
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? |
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). |
Quote:
|
Im bumping this up to make sure someone sees my question. :)
|
bump again
|
and again...
|
I really could use the help if anyone can give it. thx
|
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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|