Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 08-12-2007, 10:03 PM
Sune24 Sune24 is offline
 
Join Date: Mar 2006
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Andrew Green View Post
Create a new posticon group in the control panel, set all the permissions to "no", (except maybe administrator / supermods)

Add the icon you want to use for official threads, make a note of its id number

Add a plugin for newpost_complete

Code:
if(is_member_of($vbulletin->userinfo, X))
{
   $vbulletin->db->query("
   UPDATE ". TABLE_PREFIX . "thread
   SET iconid = Y
   WHERE threadid = $threadinfo[threadid]
   ");
}
X is the usergroup you want to trigger this, Y is the iconid for the official icon.

It will override the icon already in use with the official one for the thread when someone from usergroup X makes a post in it.

Really appreciate you taking time on this.
I followed your instructions and it worked like a charm - now when I make a reply in a thread, the icon automaticly changes to the iconID I set in ur code.

Thanks a lot!
Reply With Quote
  #12  
Old 08-12-2007, 10:36 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

or if you want to use the datamanager, try this ;

Code:
if(is_member_of($vbulletin->userinfo, X))
{
	$thread =& datamanager_init('Thread', $vbulletin, ERRTYPE_SILENT, 'threadpost');
	$thread->set_existing($threadinfo);
	$thread->set('iconid', Y);
	$thread->save();
	unset($thread);
}
Reply With Quote
  #13  
Old 08-13-2007, 01:02 AM
Sune24 Sune24 is offline
 
Join Date: Mar 2006
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M View Post
or if you want to use the datamanager, try this ;

Code:
if(is_member_of($vbulletin->userinfo, X))
{
	$thread =& datamanager_init('Thread', $vbulletin, ERRTYPE_SILENT, 'threadpost');
	$thread->set_existing($threadinfo);
	$thread->set('iconid', Y);
	$thread->save();
	unset($thread);
}
I'm a newbie hehe :/

Can I ask you what the difference is between your code and Andrew's?
I mean ofc I can see the code is different, but other than the obvious, can you tell me whats the difference? Is your code more smooth for the server etc?
Reply With Quote
  #14  
Old 08-13-2007, 06:10 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The datamanager (Paul's method) is the suggested way to do it, merely because it updates all the caches, etc.
Reply With Quote
  #15  
Old 08-14-2007, 08:53 PM
Sune24 Sune24 is offline
 
Join Date: Mar 2006
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For some reason this code stopped working...

It worked perfect for 24hours, then just stopped working...
I've posted in 4-5 different threads on different boards and the icon remains the default one.

I'm the only super-admin with access to the plugin-codes and I've not changed anything, only double and tripple checked that the code is still there as it was the first 24hours where it worked fine.

I'm using the datamanage code from Paul M.

Any ideas why it would stop working?

(add) Tried Andrews code and that works.
However Paul M's code also worked like a charm the first 24hours, so I'm really confused, and wonder if Andrew's code will also only work temporarely hehe.
Reply With Quote
  #16  
Old 08-20-2007, 10:45 PM
Sune24 Sune24 is offline
 
Join Date: Mar 2006
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any help would really be appreciated!
Reply With Quote
Reply

Thread Tools
Display Modes

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 02:03 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.03538 seconds
  • Memory Usage 2,206KB
  • Queries Executed 13 (?)
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
  • (3)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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_postinfo_query
  • fetch_postinfo
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete