Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #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
  #2  
Old 01-06-2010, 01:49 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:41 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.05926 seconds
  • Memory Usage 2,178KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete