Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-16-2011, 07:04 PM
ExcelFox ExcelFox is offline
 
Join Date: Apr 2011
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 09-16-2011, 10:23 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why not just use the Forum Permissions to make it so other usergroups cannot read the threads in that forum?
Reply With Quote
  #3  
Old 09-17-2011, 02:51 AM
ExcelFox ExcelFox is offline
 
Join Date: Apr 2011
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)}
Reply With Quote
  #4  
Old 09-17-2011, 03:17 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 09-17-2011, 01:10 PM
ExcelFox ExcelFox is offline
 
Join Date: Apr 2011
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #6  
Old 09-17-2011, 03:43 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
if (is_member_of($touser,6)) 
Not sure if that would work, but if you have a test site then you can test it out.

edit: You said you modified the phrase and added that in? Hmmm, I would not have thought that php would work in it. :/
Reply With Quote
  #7  
Old 03-25-2012, 12:13 AM
ORP ORP is offline
 
Join Date: Mar 2004
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:02 PM.


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.04454 seconds
  • Memory Usage 2,213KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete