vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Bitfields?? (https://vborg.vbsupport.ru/showthread.php?t=116909)

rogersnm 05-28-2006 08:37 AM

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.

Zachery 05-28-2006 09:02 AM

Like i commented before, you should really work on updating the real user permissions instead of a new one youu have added.

rogersnm 05-28-2006 09:13 AM

yes, but which user permission do you think i should work on?

Zachery 05-28-2006 09:15 AM

Since the permission to view or not view sigs already exists, you should update that one.

rogersnm 05-28-2006 09:17 AM

where? whats it's column name?

Zachery 05-28-2006 09:17 AM

Its not a column, its stored as a bitfield. Look its permission up in the user datamanager.

rogersnm 05-28-2006 03:18 PM

bump still the same question...

Zachery 05-29-2006 03:17 AM

Did you look at the user datamanager like I suggested?

rogersnm 05-29-2006 06:31 AM

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

Zachery 05-29-2006 06:58 AM

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 

:)


All times are GMT. The time now is 07:28 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.01206 seconds
  • Memory Usage 1,759KB
  • 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
  • (4)bbcode_php_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
  • (10)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