The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Contents of New Post or New Thread to be displayed only if user is an Admin
Hi,
Could anybody help me with a code snippet that will only show the content of the new post/thread if the user is an Admin/Mod. For all other users, the new post/thread mail should only contain the URL to the new post/thread. Regards, ExcelFox |
#2
|
||||
|
||||
Why not just use the Forum Permissions to make it so other usergroups cannot read the threads in that forum?
|
#3
|
|||
|
|||
Lynne, thanks for reverting. I should have clarified my OP.
What I was looking for, is to have the new post email when there is a new post notification for a subscribed thread, to contain only the text that there is a new post, and that ..... is the url. And only if it is an admin/mod, send the content of the post as well. Like if usergroupid=1 { (send entire content of new post) else (send only the notification, along with the URL)} |
#4
|
||||
|
||||
You will need to look at the file includes/functions_digest.php . Do a search for "pagetext" in that file and you'll see where it is defined. There is a hook just under there, digest_thread_post, where you may edit that variable before the phrase digestpostbit is used to create the message.
|
#5
|
|||
|
|||
Thanks Lynne. I wasn't able to decipher the code, so I modified the notify phrase, and added the following line
if ($touser[username] = 'Admin ABC' OR $touser[username] = 'Mod DEF') { Here is the message that has just been posted: *************** $pagetext *************** } and it worked. Wasn't sure if $touser[usergroupid] = 6 would work, so didn't use that. Having said that, if one were to know the ERD of the database, it would have been a bit more easier for a lot of people. Any idea where I could get that Lynne? |
#6
|
||||
|
||||
We do not have an ERD posted anywhere of the database. (Don't know why, as it would have helped when I was just starting to code!).
You could probably try: PHP Code:
edit: You said you modified the phrase and added that in? Hmmm, I would not have thought that php would work in it. :/ |
#7
|
|||
|
|||
Any idea why VB would not add this as an option to send the text of the message in the email or not?
I still have users answering emails for posts or PM's and it is such a waste. I would simply like to notify them that they have a PM or someone has replied to a thread they have subscribed to; without the text of the PM message or the reply. Sure makes sense to me. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|