vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Major Additions - Point Market System 3.1x (https://vborg.vbsupport.ru/showthread.php?t=232676)

jacob115 02-26-2010 12:08 PM

I am working on some codes and have a question. I am editing my point store to make it work perfectly for me, but I have a question. Here is the code for changing username:
Code:

// *********** Change Username ************
    if ($itembuy[marketid] == 13) {
            $findother = $vbulletin->db->query_read("SELECT * from " . TABLE_PREFIX . "user where username='".addslashes($new_username)."'");
            $findother = $vbulletin->db->fetch_array($findother);
        if ($findother)  {
            $error = 10; // Someone has that username.
        }
        $minchar = $vbulletin->options[minuserlength];
        $maxchar = $vbulletin->options[maxuserlength];
        if ($minchar > strlen($new_username)) {
            $error = 11;
        }
        if ($maxchar < strlen($new_username)) {
            $error = 12;
        }
        if ($error == 0) {
            $vbulletin->db->query_read("update " . TABLE_PREFIX . "user set `username`='".addslashes($new_username)."', `$pointfield`=$points-$amount where userid='$userid'");
            $vbulletin->db->query_read("insert into " . TABLE_PREFIX . "market_transactions set `date`='$time', marketid='$itembuy[marketid]', userid='$userid', affecteduser='$userid', amount='$amount'");
            $points = $points - $amount;
            $purchases = $purchases+1;
        }
    }
//

I understand I need to change the market ID, but what would the code be to add a specific usergroup (chosen by me, not user, like I would specify the additional usergroup in the code)

Thanks!

fly 02-26-2010 12:40 PM

I'm no SQL expert, but I'd think this would work. You'd obviously need to remove all the stuff that deals with username, as well...

Code:

$vbulletin->db->query_read("update " . TABLE_PREFIX . "user set `membergroupids`='6', `$pointfield`=$points-$amount where userid='$userid'");
Don't run that, as it will add the user to the admin group if I'm correct.

jacob115 02-26-2010 07:15 PM

That doesn't seem to work, can I have a full code with it so I can replace the entire thing. Maybe there is another thing bothering it.

Thanks!

TheMayhem 02-27-2010 10:42 PM

Quote:

Originally Posted by jacob115 (Post 1991944)
I am working on some codes and have a question. I am editing my point store to make it work perfectly for me, but I have a question. Here is the code for changing username:
Code:

// *********** Change Username ************
    if ($itembuy[marketid] == 13) {
            $findother = $vbulletin->db->query_read("SELECT * from " . TABLE_PREFIX . "user where username='".addslashes($new_username)."'");
            $findother = $vbulletin->db->fetch_array($findother);
        if ($findother)  {
            $error = 10; // Someone has that username.
        }
        $minchar = $vbulletin->options[minuserlength];
        $maxchar = $vbulletin->options[maxuserlength];
        if ($minchar > strlen($new_username)) {
            $error = 11;
        }
        if ($maxchar < strlen($new_username)) {
            $error = 12;
        }
        if ($error == 0) {
            $vbulletin->db->query_read("update " . TABLE_PREFIX . "user set `username`='".addslashes($new_username)."', `$pointfield`=$points-$amount where userid='$userid'");
            $vbulletin->db->query_read("insert into " . TABLE_PREFIX . "market_transactions set `date`='$time', marketid='$itembuy[marketid]', userid='$userid', affecteduser='$userid', amount='$amount'");
            $points = $points - $amount;
            $purchases = $purchases+1;
        }
    }
//

I understand I need to change the market ID, but what would the code be to add a specific usergroup (chosen by me, not user, like I would specify the additional usergroup in the code)

Thanks!

I'll have the code for you to do this shortly, mostly because Additional Usergroups is one of the new options to the Point Market items to be purchased. :)

jacob115 02-28-2010 12:53 AM

Do you mean you will give me the specific code to do it or it will be in the next version of the Point Market System?

If it is the next version of Point Market System, is there anyway I could be a beta tester?

Thanks!!

DigitalDark 02-28-2010 05:54 PM

It could be possible to purchase permissions in order to access certain forums. It would be a great idea. Thanks!

argothiusz 02-28-2010 06:53 PM

Quote:

It could be possible to purchase permissions in order to access certain forums. It would be a great idea. Thanks!
Here is your answer "mostly because Additional Usergroups is one of the new options to the Point Market items to be purchased." Make a forum, assign new usergroup to it then make that usergroup available for purchase ^_^ and there you go :D

maidos 02-28-2010 07:08 PM

is it possible to create an own purchase merchandise. i want to create a entry fee of a contest which will cost them points but theres no given option to that

maidos 02-28-2010 07:13 PM

and maybe also allow user to purchase a usergroup?

Forum Lover 02-28-2010 09:52 PM

Still tagged and waiting for your v1.1.0 release. Any ETA mate?


All times are GMT. The time now is 04:08 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.02457 seconds
  • Memory Usage 1,747KB
  • 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
  • (4)pagenav_pagelink
  • (4)pagenav_pagelinkrel
  • (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