View Single Post
  #1  
Old 01-06-2010, 10:43 AM
joshskeety joshskeety is offline
 
Join Date: May 2004
Location: Virginia
Posts: 139
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02344 seconds
  • Memory Usage 1,799KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete