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

Reply
 
Thread Tools Display Modes
  #1  
Old 10-21-2009, 01:57 PM
BRotondi BRotondi is offline
 
Join Date: Sep 2008
Location: Zurich
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Thread tags observation

Hello

I'm using thread tags to categorize threads. So I want to log tag changes.

As a first step I tried to send me an email after each change. But i failted to create a plugin with something like
Code:
vbmail($vbulletin->options['webmasteremail'], "Tags Changed", 
"User: " . $vbulletin->userinfo['userid'] . "\r\n"
. "Forum: " . $threadinfo['forumid']) . "\r\n"
. "Thread: " . $threadinfo['threadid']) . "\r\n"
. "Title: " . $threadinfo['title']) . "\r\n"
. "------------------------------------" . "\r\n"
. "New tags:  " . $$$ . "\r\n"
. "Old tags: " .  $$$
, true);
Problem: Which hook and which file changes are necessary to make this run? It's quite complicated ...

Is there some code / addon or similar I could use? Or any idea?

Thanks for any help!

Bruno
Reply With Quote
  #2  
Old 10-21-2009, 02:13 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you are trying to log tag changes, then find the area in the code where tag changes are actually submitted and then pick a hook location there. Which pages have you been looking at to find hook locations?
Reply With Quote
  #3  
Old 10-21-2009, 02:15 PM
BRotondi BRotondi is offline
 
Join Date: Sep 2008
Location: Zurich
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

O.K. Got it:
Code:
// ##############################################################################
if ($_POST['do'] == 'managetags')
{
    //B
    $Btmp = $threadinfo['taglist'];

(...)

    //B
    $threadinfo = fetch_threadinfo($threadinfo['threadid'], false); // get updated tag list
    $threadinfo['taglistOld'] = $Btmp;

    ($hook = vBulletinHook::fetch_hook('threadtag_domanage_postdelete2')) ? eval($hook) : false;

    if ($vbulletin->GPC['ajax'])
    {
        //B $threadinfo = fetch_threadinfo($threadinfo['threadid'], false); // get updated tag list
Now you can Use threadtag_domanage_postdelete2 which has to be added in includes/xml/hooks_vbulletin.xml (after threadtag_domanage_postdelete)

Or are there any better ideas than manipulate the php and add a hook?

Thanks!
Bruno


--------------- Added 21 Oct 2009 at 17:17 ---------------

Thanks Lynne for you reply. I tried what you said, but its REALLY complicated... even impossible without code changes I think...
Reply With Quote
  #4  
Old 10-21-2009, 03:06 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why do you want to add another hook there? Why not just use threadtag_domange_postdelete ?
Reply With Quote
  #5  
Old 10-21-2009, 07:11 PM
BRotondi BRotondi is offline
 
Join Date: Sep 2008
Location: Zurich
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know, what threadtag_domange_postdelete is for. At this moment, the new tags are not verified and definitly set... these Lines MUST be executed, before I know if tags have been changed:
Code:
$vbulletin->GPC['ajax']
$threadinfo = fetch_threadinfo($threadinfo['threadid'], false); // get updated tag list
And after these... no hook will come any more...

Greetings, Bruno
Reply With Quote
  #6  
Old 10-21-2009, 08:19 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What is your overall idea of what you want done? Why do you need to be notified *before* the change? And do you expect the change to stop until you do something here? I would think that would be quite complicated to do.
Reply With Quote
  #7  
Old 10-22-2009, 05:26 AM
BRotondi BRotondi is offline
 
Join Date: Sep 2008
Location: Zurich
Posts: 346
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Lynne

Since a thread can have only one prefix, I use tags instead. So more security is necessary:
  • after some time only mods should be able to change (perhaps not necessary, first I want to see how the changes are made)
  • I want to log every change to get an idea how the users are managing the tags, to see when a good category (tag) has been deleted (only possible by mods) or a bad has been added (all users)
I added the 2nd hook instead of putting all the code there to minimize file changes ... perhaps I should better take the other approach and put all code there...

Thanks for your support!
Greetings, Bruno
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 09:42 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07015 seconds
  • Memory Usage 2,218KB
  • 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
  • (3)bbcode_code
  • (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