vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Small programming help (https://vborg.vbsupport.ru/showthread.php?t=181854)

CP, 06-08-2008 03:21 AM

Small programming help
 
PHP Code:

if ($vbulletin->userinfo['field8']) 

    if (
$vbulletin->options['globalignore']) 
    { 
        
$vbulletin->options['globalignore'] = $vbulletin->options['globalignore'] . " " $vbulletin->userinfo['field8']; 
    } 
    else 
    { 
        
$vbulletin->options['globalignore'] = $vbulletin->userinfo['field8']; 
    } 


Hi the above code was taken from a 3.5.4 hack but no longer works for 3.7.1, as you can see above its a very simple short code which presumably needs a few tweaks for it to work on a 3.7.1.

Field 8 you are seeing above is refering to a custom field which was created under each users profile.

I would really appreciate it if somebody could fix the above snippet for a 3.7.1,

Many thanks in advance!

Dismounted 06-08-2008 04:23 AM

What's the error?

The most obvious one is the lack of single quotes - as you can see, the whole block is parsed incorrectly, leading to the weird colours.

Boofo 06-08-2008 04:30 AM

He must not have copied that exactly as in the hack. The last field8 only has one quote which should be giving errors in the hack.

CP, 06-08-2008 12:44 PM

Quote:

Originally Posted by Dismounted (Post 1543751)
What's the error?

The most obvious one is the lack of single quotes - as you can see, the whole block is parsed incorrectly, leading to the weird colours.

There are no errors, nothing simply happens...

Looks pretty simple just needs tweaking.. i remember it working for vb 3.5.4.

[QUOTE=Boofo;1543754]He must not have copied that exactly as in the hack. The last field8 only has one quote which should be giving errors in the hack.[/QUOTE

The one quote was my error.. it has two, one on either side...

Field 8 is the custom field you make for the hack to apply to specific users of the forum. See below.

https://vborg.vbsupport.ru/showthread.php?t=109543

Thanks

Opserty 06-08-2008 12:47 PM

Lets play spot the difference!

Correct:
Code:

$vbulletin->userinfo['field8']
Incorrect:
Code:

$vbulletin->userinfo['field8]
First one to guess it wins a cookie :D

(I think all this sun is getting to me... :()

If it doesn't work after you changed it, then it is probably due to code changes elsewhere. Which would probably require a new modification.

CP, 06-08-2008 12:51 PM

Quote:

Originally Posted by Opserty (Post 1544051)
Lets play spot the difference!

Correct:
Code:

$vbulletin->userinfo['field8']
Incorrect:
Code:

$vbulletin->userinfo['field8]
First one to guess it wins a cookie :D

(I think all this sun is getting to me... :()

If it doesn't work after you changed it, then it is probably due to code changes elsewhere. Which would probably require a new modification.

Ive recitfied my initial post. It was actually my error when i had posted it. See my second post above.

:)

Opserty 06-08-2008 12:54 PM

Ah, you're second post hadn't appeared when I went to post mine :p

Boofo 06-08-2008 01:36 PM

So YOU say... ;)

CP, 06-08-2008 01:49 PM

Sorry for the confusion guys but the problem still remains it does not work! :(

My first post was a typo... :erm:

Dismounted 06-08-2008 03:30 PM

Where are you putting the code?

CP, 06-09-2008 02:24 AM

Quote:

Originally Posted by Dismounted (Post 1544166)
Where are you putting the code?

In the plugin area where you are able to add a new plugin by submitting the entire code. The button is called "Add New Plugin" Its in the plugin area.. and then the "hook location" is global_start.

Dismounted 06-09-2008 03:22 AM

Have you checked if field8 exists?

CP, 06-10-2008 08:58 PM

Quote:

Originally Posted by Dismounted (Post 1544656)
Have you checked if field8 exists?

Yep it all exists and it worked on 3.5.4 fine.

Now as the hack is pretty simple and straight forward i think it should work with vb 3.7 fine without any issues, however it dosent. I think it requires some tweaking somewhere...


All times are GMT. The time now is 06:38 AM.

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.01077 seconds
  • Memory Usage 1,743KB
  • 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_code_printable
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete