vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Major Additions - microCART: Shopping System for vB4 (https://vborg.vbsupport.ru/showthread.php?t=256723)

Reece^B 11-20-2012 07:03 PM

Is there manual updates in this thread?

starletclub 12-12-2012 05:40 PM

Warning: require_once([path]/includes/functions_wysiwyg.php) [function.require-once]: failed to open stream: No such file or directory in [path]/cart.php on line 71

Fatal error: require_once() [function.require]: Failed opening required '/home/*/public_html/*/*/functions_wysiwyg.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/*/public_html/*/cart.php on line 71

micheal332001 12-15-2012 10:45 AM

Quote:

Originally Posted by starletclub (Post 2390300)
Warning: require_once([path]/includes/functions_wysiwyg.php) [function.require-once]: failed to open stream: No such file or directory in [path]/cart.php on line 71

Fatal error: require_once() [function.require]: Failed opening required '/home/*/public_html/*/*/functions_wysiwyg.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/*/public_html/*/cart.php on line 71

edit the file and remove these 2 lines and all will be fine.

Fatal Hazard 12-15-2012 08:18 PM

Hi, I can't see the tab. It all looks like it is working but no tab shows

Any Ideas?

thanks in advance

Fatal Hazard 12-19-2012 03:03 PM

I can't seem to get the upload path right. I keep linking it to the downloads directory on my server but it still does not work.

Ichigo88 12-22-2012 07:10 PM

Hi!
the product its work perfectly on mu vb 4.2.0 patch 3.

but i have a small question!

how to change the user in other primary usergruop?
now the usergroup upgrade its make in addizional.

thanks inadvance

comunidadmh 12-24-2012 01:40 AM

Hello people!

I wanted to know if anyone knows of any mods (I'm willing to buy it) that allows the purchase and sale of items between users of a forum. As already known sites pagins buying and selling things. Anyone know of a mod like this?

sorry for my English, use google translator xD

Christos Teriakis 12-24-2012 09:23 AM

Quote:

Originally Posted by Ichigo88 (Post 2392279)
Hi!
the product its work perfectly on mu vb 4.2.0 patch 3.

but i have a small question!

how to change the user in other primary usergruop?
now the usergroup upgrade its make in addizional.

thanks inadvance

Even if I advice you to avoid changing primary usergroup, follow the steps below:

1.- With a text editor (like Notepad) open the file: microcart/functions.php

2.- Search for:
Code:

function promoteUser($transid, $userid)
3.- Replace the whole function:
Code:

function promoteUser($transid, $userid)
{
    global $vbulletin, $db;
    $boughtdate = date("Y-m-d");
    $orders = $db->query_read("SELECT * FROM ".TABLE_PREFIX."microcart_orders WHERE transid='$transid'");
    while  ($order = $db->fetch_array($orders)) {
            $productid = $order["productid"];
            $product = $db->query_first("SELECT * FROM ".TABLE_PREFIX."microcart_products WHERE id=$productid");
            $leng = $product[dlperiod]/2;
            $expiration = add_date($order[dend],$leng,0,0);
            $dend = date("Y-m-d", strtotime($expiration));
            $db->query_write("UPDATE ".TABLE_PREFIX."microcart_orders SET paiddate='$boughtdate', dend='$dend' WHERE transid='$transid'");
            $promousergroup = $product["promousergroup"];
            if ($promousergroup > 0)
            {
                $user = $db->query_first("SELECT membergroupids FROM ".TABLE_PREFIX."user WHERE userid=$userid");
                $groups = $user["membergroupids"];
                $groupids = explode(',', $groups);
                if (!in_array($promousergroup, $groupids))
                {
                    if (empty($groups))
                    {
                        $upgrade = $promousergroup;
                    } else {
                        $upgrade = $groups.','.$promousergroup;
                    }
                    $db->query_write("UPDATE ".TABLE_PREFIX."user SET membergroupids='$upgrade' WHERE userid=$userid");
                }
            }
    }
    return;
}

With this new code:
Code:

function promoteUser($transid, $userid)
{
    global $vbulletin, $db;
    $boughtdate = date("Y-m-d");
    $orders = $db->query_read("SELECT * FROM ".TABLE_PREFIX."microcart_orders WHERE transid='$transid'");
    while  ($order = $db->fetch_array($orders)) {
            $productid = $order["productid"];
            $product = $db->query_first("SELECT * FROM ".TABLE_PREFIX."microcart_products WHERE id=$productid");
            $leng = $product[dlperiod]/2;
            $expiration = add_date($order[dend],$leng,0,0);
            $dend = date("Y-m-d", strtotime($expiration));
            $db->query_write("UPDATE ".TABLE_PREFIX."microcart_orders SET paiddate='$boughtdate', dend='$dend' WHERE transid='$transid'");
            $promousergroup = $product["promousergroup"];
            if ($promousergroup > 0)
            {
                $db->query_write("UPDATE ".TABLE_PREFIX."user SET usergroupid='$promousergroup' WHERE userid=$userid");
            }
    }
    return;
}

4.- Search for:
Code:

function downgradeUser($transid, $userid)
5.- Replace the whole function:
Code:

function downgradeUser($transid, $userid)
{
    global $vbulletin, $db;
    $vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."microcart_invoices SET invoicestatus=7 WHERE transid='$transid'");
    $vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."microcart_orders SET paid=0 WHERE transid='$transid'");
    $orders = $vbulletin->db->query_read("SELECT * FROM ".TABLE_PREFIX."microcart_orders WHERE transid='$transid'");
    while  ($order = $vbulletin->db->fetch_array($orders)) {
            $productid = $order["productid"];
            $product = $vbulletin->db->query_first("SELECT * FROM ".TABLE_PREFIX."microcart_products WHERE id=$productid");
            $promousergroup = $product["promousergroup"];
            if ($promousergroup > 0)
            {
                $user = $vbulletin->db->query_first("SELECT membergroupids FROM ".TABLE_PREFIX."user WHERE userid=$userid");
                $groups = $user["membergroupids"];
                $groupids = explode(',', $groups);
                if (in_array($promousergroup,$groupids))
                {
                    $key = array_search($promousergroup, $groupids);
                    unset($groupids[$key]);
                    $downgrade = implode(',', $groupids);
                    $vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."user SET membergroupids='$downgrade' WHERE userid=$userid");
                }
            }
    }
    return;
}

With...:
Code:

function downgradeUser($transid, $userid)
{
    global $vbulletin, $db;
    $vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."microcart_invoices SET invoicestatus=7 WHERE transid='$transid'");
    $vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."microcart_orders SET paid=0 WHERE transid='$transid'");
    $orders = $vbulletin->db->query_read("SELECT * FROM ".TABLE_PREFIX."microcart_orders WHERE transid='$transid'");
    while  ($order = $vbulletin->db->fetch_array($orders)) {
            $productid = $order["productid"];
            $product = $vbulletin->db->query_first("SELECT * FROM ".TABLE_PREFIX."microcart_products WHERE id=$productid");
            $promousergroup = $product["promousergroup"];
            if ($promousergroup > 0)
            {
                $vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."user SET usergroupid='2' WHERE userid=$userid");
            }
    }
    return;
}

6.- Save and upload the functions.php at: microcart/

*** ATTENTION ***
Downgrading the user means that he is going to usergroup 2 (Registered Members). So if you're selling another product which also promotes the user to a higher usergroup, then the user will LOSTS that promotion. That's why using the additional usergoups is the best choice.

Chris

Ichigo88 12-26-2012 10:45 PM

thank you! work perfectly now!! :D best plug

Mark4865 01-01-2013 06:01 AM

anyone know how to change the size of the product block that appears in the main forum page, I just want to shorten mine a bit.

thanks in advance for any help


All times are GMT. The time now is 04:54 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.01542 seconds
  • Memory Usage 1,764KB
  • 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
  • (6)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
  • (2)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