The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I can't post in the other forum, because I don't have a license.. Although I wrote a mod for my friend and testing it on his forum I can't get it to work.
Code:
<?xml version="1.0" encoding="ISO-8859-1"?> <product productid="postthismonth" active="1"> <title>cheechm - Posts this month</title> <description>cheechm - Posts this month</description> <version>1.0</version> <plugins> <plugin active="1" product="vbulletin"> <title><![CDATA[Posts This Month Mod]]></title> <hookname>template_groups</hookname> <phpcode>$only['ch_'] = 'Posts This Month';</phpcode> </plugin> <plugin active="1" product="poststhismonth"> <title><![CDATA[cheechm - Posts this month]]></title> <hookname>cache_templates</hookname> <phpcode><![CDATA[ if ($vbulletin->options['ch_ptm_enable']) { $globaltemplates = array_merge($globaltemplates, array('ch_poststhismonth')); }]]></phpcode> </plugin> <plugin active="1" product="poststhismonth"> <title><![CDATA[cheechm's Mods]]></title> <hookname>global_start</hookname> <phpcode><![CDATA[ if ($vbulletin->options['ch_ptm_enable']) { $ch_user = $vbulletin->userinfo['username']; // Connect to THT database mysql_connect("localhost", "root", "**") or die(mysql_error()); mysql_select_db("vb_test") or die(mysql_error()); // Get a specific result from the "tht_user" table $ch_result = mysql_query("SELECT * FROM user WHERE username='$ch_user' ") or die(mysql_error()); // get the first (and hopefully only) entry from the result $ch_row = mysql_fetch_array( $result ); // Print out the contents of each row into a table $ch_previous_post = $row['posts']; mysql_close(); $result = $db->query_read("SELECT posts FROM " . TABLE_PREFIX . "user WHERE username = '$ch_user'"); // get the first (and hopefully only) entry from the result $array = $db->fetch_array($result); // Save to variable $ch_total_post = $array['posts']; $ch_months_posts = $ch_total_post - $ch_previous_post; eval('$poststhismonth = "' . fetch_template('ch_posts_this_month') . '";'); } }]]></phpcode> </plugin> </plugins> <templates> <template name="ch_poststhismonth" templatetype="template" date="1209819618" username="cheechm" version="1.0"><![CDATA[ <if condition="$vboptions[ch_ptm_enable]"> $vbphrase[ch_ptm_phrase] <phrase 1="$ch_months_posts">$vbphrase[ch_ptm]</phrase> </if>]]></template> </templates> <phrases> <phrasetype name="GLOBAL" fieldname="global"> <phrase name="ch_ptm" username="cheechm"><![CDATA[{1}]]></phrase> </phrasetype> <phrasetype name="vBulletin Settings" fieldname="vbsettings"> <phrase name="settinggroup_chptm" username="cheechm"><![CDATA[Posts This Month Mod]]></phrase> <phrase name="setting_ch_ptm_enable_title" username="cheechm"><![CDATA[Hack Options]]></phrase> <phrase name="setting_ch_ptm_enable_desc" username="cheechm"><![CDATA[Enable Hack?]]></phrase> <phrase name="setting_ch_ptm_phrase_title" username="cheechm"><![CDATA[Phrase Options]]></phrase> <phrase name="setting_ch_ptm_phrase_desc" username="cheechm"><![CDATA[Posts this month phrase]]></phrase> </phrasetype> </phrases> <options> <settinggroup name="chptm" displayorder="2"> <setting varname="ch_ptm_enable" displayorder="10"> <datatype>number</datatype> <optioncode>yesno</optioncode> <defaultvalue>1</defaultvalue> </setting> <setting varname="ch_ptm_phrase" displayorder="11"> <datatype>free</datatype> <defaultvalue><![CDATA[Posts this month:]]></defaultvalue> </setting> </settinggroup> </options> </product> Thanks PS: I can't view code! ![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|