vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Can't get a CDP to work for the life of me. (vBexperience) (https://vborg.vbsupport.ru/showthread.php?t=232331)

joshskeety 01-06-2010 10:43 AM

Can't get a CDP to work for the life of me. (vBexperience)
 
No matter what I do I can't get this CDP to award points or achievements for users who have vBookie cash. Here is the code:
Code:

<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="xpvbookie" active="1">
        <title>vBExperience Vbookie Points</title>
        <description>Example of use of vBExperience Hooks to include a custom data provider</description>
        <version>1.2.0</version>
        <dependencies>
                <dependency dependencytype="product" parentproductid="xperience38" minversion="3.8.0" maxversion="" />
        </dependencies>
        <codes>
                        <code version="1.0.0">
                                <installcode><![CDATA[                       
if (!field_exists('xperience_stats', 'points_misc_vbookie')) $vbulletin->db->query_write("ALTER TABLE " . TABLE_PREFIX . "xperience_stats ADD points_misc_vbookie BIGINT DEFAULT '0'");

function field_exists($table, $field)
{
        global $vbulletin;
        return ($vbulletin->db->num_rows($vbulletin->db->query_read("SHOW COLUMNS FROM `" . TABLE_PREFIX .$table."` LIKE '".$field."'"))> 0);
}
                                ]]></installcode>
                                <uninstallcode><![CDATA[
if (field_exists('xperience_stats', 'points_misc_vbookie')) $vbulletin->db->query_write("ALTER TABLE " . TABLE_PREFIX . "xperience_stats DROP points_misc_vbookie");

function field_exists($table, $field)
{
        global $vbulletin;
        return ($vbulletin->db->num_rows($vbulletin->db->query_read("SHOW COLUMNS FROM `" . TABLE_PREFIX .$table."` LIKE '".$field."'"))> 0);
}]]></uninstallcode>
                        </code>
        </codes>
        <templates>
        <template name="xpvbookie_profile" templatetype="template" date="1205333644" username="Phalynx" version="1.0.0"><![CDATA[
                <if condition="$xperience_points_misc_vbookie<>0"><li><span class="shade">$vbphrase[xperience_points_misc_vbookie]:</span> $xperience_points_misc_vbookie/li></if>
]]></template>       
        </templates>
        <plugins>
                <plugin active="1" executionorder="5">
                        <title>vBExperience Vbookie Points (xperience_calcdata)</title>
                        <hookname>xperience_calcdata</hookname>
                        <phpcode><![CDATA[
if ($vbulletin->options['xperience_points_vbookie'] > 0)
{
        if ($DoDebug==1) echo "<br/>Vbookie Points";
       
        $attq = $vbulletin->db->query_read("SELECT
                vbookie_cash
                FROM " . TABLE_PREFIX . "user
                WHERE userid=".$user['userid']."
               
               
        if ($vbulletin->db->num_rows($attq) > 0)
        {
                $att = $vbulletin->db->fetch_array($attq);
       
                $xperience['count_misc_vbookie'] = $att['sum_cash'] * $vbulletin->options['xperience_points_vbookie'];
                $xperience['count_misc'] += $xperience['count_misc_vbookie'];

        }
}
]]></phpcode>
                </plugin>
                <plugin active="1" executionorder="5">
                        <title><![CDATA[vBExperience Vbookie Points (xperience_earn_misc)]]]></title>
                        <hookname>xperience_earn_misc</hookname>
                        <phpcode><![CDATA[
        $earnpoints .= ResolveAssociation("xperience_points_vbookie, "", "points_misc_vbookie");
                        ]]></phpcode>
                </plugin>
                <plugin active="1" executionorder="5">
                        <title><![CDATA[vBExperience Vbookie Points (xperience_memberprofile)]]]></title>
                        <hookname>xperience_memberprofile</hookname>
                        <phpcode><![CDATA[
global $vbphrase;
$xperience_points_misc_vbookie = vb_number_format($stat_q['points_misc_vbookie']);
eval('$this->block_data[xperience_points_misc_tpl] .= " ' . fetch_template('xpvbookie_profile') . '";');
                        ]]></phpcode>
                </plugin>
                <plugin active="1" executionorder="5">
                <title>vBExperience Vbookie Points (cache_templates)</title>
                <hookname>cache_templates</hookname>
                <phpcode><![CDATA[
if ($vbulletin->options['xperience_enabled']) {
  $globaltemplates = array_merge($globaltemplates, array(
      'xpvbookie_profile'
  ));
}
]]></phpcode>
                </plugin>
        </plugins>
        <phrases>
                <phrasetype name="GLOBAL" fieldname="global">
                        <phrase name="xperience_points_misc_vbookie" date="0" username="Phalynx" version="1.0.0"><![CDATA[Vbookie Points]]></phrase>
                </phrasetype>
                <phrasetype name="vBulletin Settings" fieldname="vbsettings">
                        <phrase name="setting_xperience_points_vbookie_desc" date="1205333644" username="Phalynx" version="1.0.0"><![CDATA[How many points should be given for Vbookie?]]></phrase>
                        <phrase name="setting_xperience_points_vbookie_title" date="1205333644" username="Phalynx" version="1.0.0"><![CDATA[Points for Vbookie]]></phrase>
                </phrasetype>
        </phrases>
        <options>
                <settinggroup name="xperience_points" displayorder="7502">
                        <setting varname="xperience_points_vbookie" displayorder="300">
                                <defaultvalue>2</defaultvalue>
                        </setting>
                </settinggroup>
        </options>
</product>


Lynne 01-06-2010 01:49 PM

Questions/Problems regarding modifications need to be asked in the modification thread. That is where the support for modifications is - not out here in the main forums. Please note that if a modification is unsupported (or even if it says it is supported), you may be on your own if you chose to install it.


All times are GMT. The time now is 01:13 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.01039 seconds
  • Memory Usage 1,740KB
  • 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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