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

Reply
 
Thread Tools Display Modes
  #1  
Old 05-28-2006, 08:37 AM
rogersnm rogersnm is offline
 
Join Date: Apr 2006
Location: Cyberspace, UK
Posts: 729
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Bitfields??

I need to work on a mod which i have already made but i need to make it ajaxed the original mod is here:
https://vborg.vbsupport.ru/showthread.php?t=116902

i would like to learn ajax as well all the code is written for the normal version i just need someone to tell me how and where to change it (or do it for me) to make it ajax supported.

Currently it You click on the link and it goes through to page which has an if on it:
PHP Code:
if ($vbulletin->userinfo[sig])
{
                        
$userid $vbulletin->userinfo[userid];
                        
$db->query_write("UPDATE " TABLE_PREFIX "user
                                SET sig='0'
                                WHERE userid='
$userid'
                        "
);
}
else
{
                        
$userid $vbulletin->userinfo[userid];
                        
$db->query_write("UPDATE " TABLE_PREFIX "user
                                SET sig='1'
                                WHERE userid='
$userid'
                        "
);

and then around the signature code i have:
PHP Code:
<if condition="$bbuserinfo[sig] == 0">
        <!-- 
sig -->
        
Signature Code
        
<!-- / sig -->
</if> 
I need it so when you click on the link it runs the sql query on the page it is on and then updates it via ajax.

I don't think it'll be to hard (he hopes).

Regards,
Nick.
Reply With Quote
  #2  
Old 05-28-2006, 09:02 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Like i commented before, you should really work on updating the real user permissions instead of a new one youu have added.
Reply With Quote
  #3  
Old 05-28-2006, 09:13 AM
rogersnm rogersnm is offline
 
Join Date: Apr 2006
Location: Cyberspace, UK
Posts: 729
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes, but which user permission do you think i should work on?
Reply With Quote
  #4  
Old 05-28-2006, 09:15 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Since the permission to view or not view sigs already exists, you should update that one.
Reply With Quote
  #5  
Old 05-28-2006, 09:17 AM
rogersnm rogersnm is offline
 
Join Date: Apr 2006
Location: Cyberspace, UK
Posts: 729
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

where? whats it's column name?
Reply With Quote
  #6  
Old 05-28-2006, 09:17 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Its not a column, its stored as a bitfield. Look its permission up in the user datamanager.
Reply With Quote
  #7  
Old 05-28-2006, 03:18 PM
rogersnm rogersnm is offline
 
Join Date: Apr 2006
Location: Cyberspace, UK
Posts: 729
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump still the same question...
Reply With Quote
  #8  
Old 05-29-2006, 03:17 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you look at the user datamanager like I suggested?
Reply With Quote
  #9  
Old 05-29-2006, 06:31 AM
rogersnm rogersnm is offline
 
Join Date: Apr 2006
Location: Cyberspace, UK
Posts: 729
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

everyone i asked just didn't know ie. the administrator of vbhackers (Deaths) can you tell me where it is or point me to a tutorial....
and tell em what to put in a file to retrieve the bitfield value ie:
PHP Code:
$sigpermission who_knows
Regards,
Nick
Reply With Quote
  #10  
Old 05-29-2006, 06:58 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The setting is stored in the options field in the user table. the option is stored as a bitfield. You can lookup what bitfields do what in includes/xml/bitfield_vbulletin.xml

PHP Code:
            <group name="useroptions">
                <
bitfield name="showsignatures">1</bitfield>
                <
bitfield name="showavatars">2</bitfield>
                <
bitfield name="showimages">4</bitfield>
                <
bitfield name="coppauser">8</bitfield>
                <
bitfield name="adminemail">16</bitfield>
                <
bitfield name="showvcard">32</bitfield>
                <
bitfield name="dstauto">64</bitfield>
                <
bitfield name="dstonoff">128</bitfield>
                <
bitfield name="showemail">256</bitfield>
                <
bitfield name="invisible">512</bitfield>
                <
bitfield name="showreputation">1024</bitfield>
                <
bitfield name="receivepm">2048</bitfield>
                <
bitfield name="emailonpm">4096</bitfield>
                <
bitfield name="hasaccessmask">8192</bitfield>
                <
bitfield name="postorder">32768</bitfield>
                <
bitfield name="showbirthdays">65536</bitfield>
                <
bitfield name="noactivationmails">262144</bitfield>
            </
group 
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 05:24 PM.


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.04686 seconds
  • Memory Usage 2,277KB
  • 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
  • (4)bbcode_php
  • (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
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete