vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Possible or not? (https://vborg.vbsupport.ru/showthread.php?t=154707)

Sune24 08-12-2007 10:03 PM

Quote:

Originally Posted by Andrew Green (Post 1316024)
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!

Paul M 08-12-2007 10:36 PM

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);
}


Sune24 08-13-2007 01:02 AM

Quote:

Originally Posted by Paul M (Post 1316180)
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? :)

Dismounted 08-13-2007 06:10 AM

The datamanager (Paul's method) is the suggested way to do it, merely because it updates all the caches, etc.

Sune24 08-14-2007 08:53 PM

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? :confused::confused:

(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.

Sune24 08-20-2007 10:45 PM

Any help would really be appreciated! :)


All times are GMT. The time now is 03:55 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.01004 seconds
  • Memory Usage 1,728KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete