The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Благодарность от: | ||
N8 |
Comments |
#142
|
|||
|
|||
I wrote a UserCP plug-in that shows all details of ptpnt purchases.
|
#143
|
||||
|
||||
Mind posting the code?
|
#144
|
|||
|
|||
Here's you go. Crude, and should be cleaned up, but it works for my purposes.
I sure wish Calorie would update this mod. It's one of very few things holding me back from vB4 Here's what the output looks like:Attachment 134403 Here's the script: (I put a link to this in the misc section of the UserCP sidebar.) Code:
<?php // ####################### SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // #################### DEFINE IMPORTANT CONSTANTS ####################### define('THIS_SCRIPT', 'ptpnt_stat'); define('CSRF_PROTECTION', true); // ################### PRE-CACHE TEMPLATES AND DATA ###################### // get special phrase groups $phrasegroups = array('user'); // pre-cache templates used by all actions $globaltemplates = array('USERCP_SHELL','usercp_nav_folderbit'); // ######################### REQUIRE BACK-END ############################ require_once('./global.php'); // ######################## START MAIN SCRIPT ############################ if ($vbulletin->userinfo['userid'] == 0) { print_no_permission(); } $userid = intval($vbulletin->userinfo['userid']); $threadstatus = ""; $result=$db->query_read("SELECT f.title AS forum, sum(p.totalthreads) AS 'threads', sum(p.totalpaid) AS cost, sum(p.livethreads) AS live FROM ptpnt_buythread p left join forum f on p.forumid=f.forumid where p.userid=" . $userid . " GROUP BY f.forumid"); If (mysql_num_rows($result)){ while( $buy = $db->fetch_array( $result ) ) { $threadstatus .= "<tr><td>$buy[forum]</td><td>$buy[threads]</td><td>$buy[cost]</td><td>$buy[live]</td></tr></tr>"; } $result=$db->query_read("SELECT f.title AS forum, p.totalthreads AS 'threads', p.totalpaid AS cost, From_Unixtime(p.dateline, '%b %d %Y %r') AS purchased FROM ptpnt_buythread p left join forum f ON p.forumid=f.forumid WHERE p.userid=" . $userid . " ORDER BY p.dateline desc"); $history = ""; while( $buy = $db->fetch_array( $result ) ) { $history .= "<tr><td>$buy[forum]</td><td>$buy[threads]</td><td>$buy[cost]</td><td>$buy[purchased]</td></tr></tr>"; } } eval('$ptpnt_stat = "' . fetch_template('ptpnt_stat') . '";'); // start the navbar $navbits = array('usercp.php' . $vbulletin->session->vars['sessionurl_q'] => $vbphrase['user_control_panel']); $navbits['ptpnt_stat.php' . $vbulletin->session->vars['sessionurl_q']] = 'Purchased Thread Status'; $navbits[''] = 'Purchased Thread Status'; // build the cp nav require_once(DIR . '/includes/functions_user.php'); construct_usercp_nav(); $navbits = construct_navbits($navbits); eval('$navbar = "' . fetch_template('navbar') . '";'); // eval('$HTML = "' . fetch_template($ptpnt_stat) . '";'); $HTML = $ptpnt_stat; eval('print_output("' . fetch_template('USERCP_SHELL') . '");'); ?> Code:
<div align="center"> <if condition="$history"> <h2>Thread Credit Status</h2> <table class='ptpnt'> <tr> <th>Forum</th> <th>Total Credits</th> <th>Total Cost</th> <th>Balance</th> </tr> $threadstatus </table> <h3>Thread Credit Purchase History</h3> <table class='ptpnt'> <tr> <th>Forum</th> <th>Credits Purchased</th> <th>Total Cost</th> <th>Purchase Date</th> </tr> $history </table> <else /> <h3>You have not purchased any threads.</h3> </if> </div> Here's the query I execute directly when I need to know monthly totals: Code:
SELECT DISTINCT FROM_UNIXTIME(dateline,"%M, %Y") AS month, sum(totalpaid) as TotalPaid FROM ptpnt_buythread GROUP BY month ORDER BY dateline |
#145
|
||||
|
||||
Thanks a lot man, I didn't feel like writing that out myself
I'm thinking I may hire someone to port this over to VB4 within the next couple months, I'll post the updated code when I have that done. |
#146
|
|||
|
|||
If anyone can update this hack for 4.0 please email me at adam@dcg.com, I will gladly pay for it. I will also pay very well as I need this updated.
|
#147
|
|||
|
|||
I'd contribute as well. It's the last thing keeping me from vB4.
|
#148
|
|||
|
|||
Anyone try this using vb4 ? Does it work?
|
#149
|
|||
|
|||
I had it modified and it is working perfectly for me on vb4.
|
#150
|
||||
|
||||
Very Nice Site, dcg!
|
#151
|
||||
|
||||
can someone please post it for 4X
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|