PDA

View Full Version : [uCash/uShop] Transactions Addon With a 'message'


TyleR
04-04-2005, 10:00 PM
Hi

This is my first 'hack' per-say (released ;)), so do bear with me :p

This is a hack I had made for my site, for some weird reason I have no answer to :rolleyes: ..anyways, it will add an option for your users to add a message when he/she donates to another person on your board, and displays transactions based on a userid input (e.g. transaction.php?userid=1), the default showing the transactions done by the person currently logged in, and a global transaction, showing all donations made on your board :)

BIG Thanks goes to Deaths (https://vborg.vbsupport.ru/member.php?action=getinfo&username=Deaths) for the help he provided me on in putting this hack together.

ChangeLog
Version 1.2 (11/7/05)
Added "View {username}'s Transations" link into postbit(_legacy)
Fixed Page Generation issues
Phrase added to show error message if no transactions exist
Made the install file a bit easier to understand :)

That about sums it all up..please click INSTALL (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=79434) if you use this hack :)

Deaths
04-05-2005, 07:48 PM
My pleasure mate :).

TyleR
04-05-2005, 07:49 PM
also: if anyone knows how to cut down an image (screenshot), i'll post them :)..it said my ss was too big =\

Polo
04-05-2005, 11:37 PM
also: if anyone knows how to cut down an image (screenshot), i'll post them :)..it said my ss was too big =\
save the images in gif format...

Polo
04-05-2005, 11:50 PM
also: if anyone knows how to cut down an image (screenshot), i'll post them :)..it said my ss was too big =\
save the images in gif format...

TyleR
04-06-2005, 12:18 AM
save the images in gif format...

Tried to..same message (File Too Big...) :(

Marco van Herwaarden
04-06-2005, 06:06 AM
Thanks for sharing. 2 remarks:
- You can set this to be an addon in the hack details page.
- You are creating a possible SQL insertion. First you do a globalize to an integer for the userid, this is good and would force it to be an integer and removing the SQL insertion possibility. In the query however you are using the $_REQUEST['userid'], making it possible to use a non integer value. Best would be to change this to simple $userid.

Deaths
04-06-2005, 07:21 AM
Hmm, I told him to do so, he must've forgotten :D

TyleR
04-06-2005, 07:55 AM
umm..it's in there?

globalize($_REQUEST, array('userid' => INT));

Marco van Herwaarden
04-06-2005, 08:07 AM
umm..it's in there?

globalize($_REQUEST, array('userid' => INT));
Yes like i said it is in there, but so is:
$getuser = $DB_site->query('SELECT * from ' . TABLE_PREFIX . 'utt_store_history WHERE userid="' . $_REQUEST['userid'] . '" AND action="Donate" ORDER BY historyid DESC');

change "' . $_REQUEST['userid'] . '" to a simple $userid

TyleR
04-06-2005, 08:12 AM
Changed & Updated. Thanks Marco ;)

Marco van Herwaarden
04-06-2005, 08:25 AM
Looking save now :D

Just one tip for future coding:
$getuser = $DB_site->query('SELECT * from ' . TABLE_PREFIX . 'utt_store_history WHERE userid="' . $userid . '" AND action="Donate" ORDER BY historyid DESC');

There is no need to stop the string and insert a variable if you use double-quotes (") around the the string. Also numerical var's in a query don't need to be quoted at all, and if quoting alphanumerical data best to use single quotes ('). So the above line could also be written as:
$getuser = $DB_site->query("SELECT * from " . TABLE_PREFIX . "utt_store_history WHERE userid=$userid AND action='Donate' ORDER BY historyid DESC");

Vevina
04-07-2005, 03:20 PM
sweet installed :)

TyleR
04-08-2005, 02:03 AM
heh ;)

TyleR
04-08-2005, 11:42 AM
if anyone can 'teach' me the pagination, please send me a PM :)

TyleR
04-08-2005, 03:42 PM
woo, thanks Deaths..this now has pagination :D

Updating the zip & sending out an update now :)

Vevina
04-08-2005, 07:43 PM
This is awesome just what i wanted ThankYou :)

Deaths
04-09-2005, 08:03 AM
No problem mate ;).

jzewatsky
04-09-2005, 08:17 PM
I'm not clear on where the message is shown when a user donates to another user. Also, does the option to leave a message when donating extend to using Admin Donate?

Thanks for all you work.

redcow
04-10-2005, 12:03 PM
thanks

TyleR
04-10-2005, 09:52 PM
@jzewatsky: It doesnt extend to the admin donate as of yet, this is planned in the next version which will also feature an automated PM on donations..And the messeges show on the transaction page provided in the zip file.

@redcow: No problem :)

snowlion
04-11-2005, 01:21 AM
@jzewatsky: It doesnt extend to the admin donate as of yet, this is planned in the next version which will also feature an automated PM on donations..And the messeges show on the transaction page provided in the zip file.



I hoped come fast !

TyleR
04-14-2005, 06:17 PM
i've almost got vB's PM system figured out..the admin donation reasons are done, but the zip wont be updated til the auto-pm's are figured out...hopefully this will be done either Tomorrow or Saturday (US East Coast time)

a123
04-14-2005, 07:39 PM
Nice!!!

thanks a lot. :)

Also can admin edits your transactions or global transactions?

Brandon Sheley
04-16-2005, 03:27 AM
thx for the mod Tyler
my users love, and a pm add-on would be fantasic :)

TyleR
04-16-2005, 05:23 AM
@a123: No, that's not something this mod can do, sorry.

@Brandon: No prob's ..just trying to work out how im gonna get all these sql queries done after a donation/admin donation, lol. :p

kobescoresagain
04-16-2005, 05:49 PM
can this hack have an automatic reason? I have traderratings connected with ucash. I would like it to say in the reason (Trade with x user) Can it be done? Thanks

TyleR
04-16-2005, 07:40 PM
@kobescoresagain: I could psossibly do something of the sort :)

kobescoresagain
04-16-2005, 08:43 PM
that would be awesome if you could do that.

Hellspire
04-23-2005, 02:16 AM
Um one thing in regard to the manner in which you are doing your queries and the way that they said to fix it.


// rather than
"select * from ".$table." where userid='".$userid."'"
// or
"select * from $table where userid=$userid
// you should do it this way, rembering that this, after all a string, and is parsed as such, before being sent as a query, thus:
"select * from $table where userid='$userid'
// or for something complicated the following:
"select * from $table where specialrow='specialid{$userid}'"


I know that this is really a mute issue, but using variables directly without quotes for a varchar or other entry would have problems if there is a space, or whatever, thus having them encapsulated with single- or escaped double- quotes, would be the proper way to avoid this problem.


Nice hack btw.

a123
04-27-2005, 07:51 PM
How to add pm function. thanks. :)

TyleR
04-28-2005, 12:27 AM
im half way with the sql queries for the auto-pm..should have it done by midday tomorrow to early evening..:)

The admin donation part is already incorperated into the hack now, so this is all thats left.

a123
05-02-2005, 12:17 AM
:) :)

Vevina
05-02-2005, 12:53 AM
installed the update for admin donate but its still not showing how much was donated?

Admin Donate 05-01-2005 09:47 PM 0% 0 0.00 Webmaster

kobescoresagain
05-02-2005, 03:33 PM
Where can you find the update for the admin donate? Also has teh bug been tweaked yet? If not I will wait til it is to update. Thanks for the hard work Tyler

a123
05-06-2005, 01:41 AM
still wait...:)

fly
05-06-2005, 06:04 PM
im half way with the sql queries for the auto-pm..should have it done by midday tomorrow to early evening..:)

The admin donation part is already incorperated into the hack now, so this is all thats left.
If you're still working on that part, check out the thread I made here. I got a ton of help on it.

https://vborg.vbsupport.ru/showthread.php?t=76576

a123
05-11-2005, 11:19 PM
TyleR, hope you can finish the auto-pm of ushop donation soon. I really want this function.

Thanks for your time. :)

mindbuster
05-19-2005, 05:50 PM
TyleR, hope you can finish the auto-pm of ushop donation soon. I really want this function.

Thanks for your time. :)

Yes, ill wait with installing this until auto-pm is ready :)

Then ill defineatly click install :)

owner
05-29-2005, 11:31 AM
Ok guyz ive got this hack installed but iam getting this annying problem...

In the messege zone .. it says 23 or sum numbers whenever someone posts a msg or at times ... the reciever's name is left empty or for example i was donating to a user and my name pops up ? wierd ... HELP

a123
06-18-2005, 04:06 PM
can supporters give some support? thanks.

MUDERCOOL
07-07-2005, 12:40 AM
hi, I installed it and it's working, great hack, thank you very much. also, it shows the admin donates that's another great point about it. but I think I have a problem with the "reason" because it seems working properly but in the end it doesn't show what's the reason..

do you have any fix or any possible reason for this?

KevinL
07-07-2005, 10:13 AM
I dont have this line:

$_REQUEST['userid'] = intval($_REQUEST['userid']);

SHARKY
07-10-2005, 01:26 AM
i am having this error when i try to donate

Parse error: parse error, unexpected T_IF in /home/researc/public_html/uttstore/action.donate.php on line 110

$vbphrase['uttstore_inputs_points_donate_reason'] = "Why would you like to donate?";

(in if ($_REQUEST['step'] == "3") ) Find:

$_REQUEST['userid'] = intval($_REQUEST['userid']);

this is the code it has to do with

MUDERCOOL
07-16-2005, 05:03 PM
umm seems the friends are a little bit busy..

TyleR
08-13-2005, 12:32 AM
sorry for my tardiness folks, i have been having computer problems latelty...Okie dokie..

SHARKY: remove this line from it: (in if ($_REQUEST['step'] == "3") ) Find:

KevinL: send me your action.donate.php to t_o_n_o_69[at]yahoo[dot]com

again, sorry for the tardiness, and any other problems, please feel free to ask for help..im getting back to adding the sql functions this weekend if I can find time.

TyleR

a123
09-13-2005, 11:11 PM
still waiting for the pm function...

paul41598
09-15-2005, 02:03 PM
This hack messes up the "send a gift" hack. Now when I send a gift to anyone, it doesnt show the username in the users history. Its blank

TyleR
09-26-2005, 03:58 PM
@a123:Sorry, I just don't have the time lately for adding on to this hack.

@paul41598: Sorry, i only tested it as a standalone with ucash/ushop 0.95c without any other addons installed, so don't kow.

@HHU: If there was any bugs in it, i'd know, trust me..mine was working fine before i upgraded to vB 3.5 and had to uninstall ucash/ushop.

Lottis
09-26-2005, 05:25 PM
This works fine with my uCash. Have no affect on it.

HHU
09-26-2005, 05:52 PM
@a123:Sorry, I just don't have the time lately for adding on to this hack.

@paul41598: Sorry, i only tested it as a standalone with ucash/ushop 0.95c without any other addons installed, so don't kow.

@HHU: If there was any bugs in it, i'd know, trust me..mine was working fine before i upgraded to vB 3.5 and had to uninstall ucash/ushop.

Really, because I'm not the only person in the thread having this problem...

Edit: So it's showing some peoples names, but not others...

HHU
09-27-2005, 02:52 AM
And didn't have this problem before I installed it... the bank is subtracting money from accounts and just deleting it

http://img334.imageshack.us/img334/7146/bank3mg.jpg

And everybody depositing money , its going to other users...

Please help me fix this because it wasn't like this at all before I installed this.

Thanks

TyleR
09-27-2005, 02:55 AM
Really, because I'm not the only person in the thread having this problem...

So far you're the first one with this problem..if anyone else has the problem then speak now..because I didnt edit the actions.bank.php file..so you did something to it yourself, sorry.

HHU
09-27-2005, 03:00 AM
Well... what could it be so I can correct the problem.. or how would I uninstall the changes created by "trans_install.php"?

If you can help me out with that... it would be appreciated

TyleR
09-27-2005, 03:05 AM
trans_install.php only added the templates and sql queries (added another colum to ucash_history, i believe)..to uninstall it, just simply go backwards in the install file and replace the code :)

HHU
09-27-2005, 04:07 PM
Ok... well I uploaded the original action.donate and functions_uttstore and everything is back working correctly again..

Only thing I could think is theres one variation with your instructions and my file:

This is what it looks like for me (The part you wanted changed) - action.donate.php:

'points' => array(
'topphrase' => 'Input $vbphrase[ucs_points]',
'mainphrase' => '$vbphrase[uttstore_inputs_points_donate]',
'type' => 'input',
'size' => 10,
'value' => '',
'chidden' => 'standard',
'cdisplay' => 'standard',
'cphrase' => '$vbphrase[ucs_points]',
'datatype' => "STR_NOHTML",
'eval' => '. . .'
)

And yours in the install file says it should look like:

'points' => array(

'topphrase' => 'Input $vbphrase[ucs_points]',

'mainphrase' => '$vbphrase[uttstore_inputs_points_donate]',

'type' => 'input',

'size' => 10,

'value' => '',

'chidden' => 'standard',

'cdisplay' => 'standard',

'cphrase' => '$vbphrase[ucs_points]',

'datatype' => "POINTS",

'eval' => '. . .'

)

So the datatypes are different... not sure if that would affect anything

TyleR
09-28-2005, 02:09 AM
nope, shouldnt have any effect at all.

HHU
09-28-2005, 02:12 AM
Wierd... because everythings working fine now...

hbalagh1
09-28-2005, 05:58 PM
can't wait for the pm feature, ive seen it in action on a couple of forums :)

slank
09-28-2005, 08:46 PM
pm/email feature would be great i agree, i used to use it on one forum and always had fun sending stupid remarks, people loved it :D

a123
09-28-2005, 08:58 PM
Thanks TyleR,

this hack will be the hottest hack if you can add the pm feature. :)

a123
09-29-2005, 07:28 PM
<a href="https://vborg.vbsupport.ru/showthread.php?t=83447&highlight=pm+donate" target="_blank">https://vborg.vbsupport.ru/showt...ight=pm+donate</a>

this one is good. it worked once (pm). but I changed some and then it did not work anymore.....................

As for the "global transaction" - is there any feature to limit others so only admin can see it?

TyleR
09-29-2005, 07:53 PM
https://vborg.vbsupport.ru/showthread.php?t=83447&highlight=pm+donate

this one is good. it worked once (pm). but I changed some and then it did not work anymore.....................

As for the "global transaction" - is there any feature to limit others so only admin can see it?

i'll have a look into that tonight :)

To make it only for admins, add:

if ( $bbuserinfo['usergroupid'] != 6 )
{
print_no_permission();
}

after:

if ( $_REQUEST['do'] == 'global' )
{

in transaction.php ;)

a123
09-29-2005, 08:07 PM
excellent. :) thanks.

TyleR
09-30-2005, 02:33 AM
alright im implementing that PM function..if it works, then the zip will be updated in the morning. :)

HHU
09-30-2005, 07:12 AM
Now I don't know here...

The hack messed up everything to do with ushop when I had the reasons field.. as soon as it was removed, things are back to normal... still have transactions, they work fine.. but the reasons field something there made ushop screwey

TyleR
10-01-2005, 02:14 AM
Now I don't know here...

The hack messed up everything to do with ushop when I had the reasons field.. as soon as it was removed, things are back to normal... still have transactions, they work fine.. but the reasons field something there made ushop screwey

Dunno, because like I stated in a previous post, the area you shop is acting screwey in isnt a file I have edited..so kinda weird..

Anyways, i havent been able to tes the PM function as of yet, but will do so tonight..if it works as should be, i'll update the file before tomorrow morning.

TyleR
10-01-2005, 05:41 PM
hmmm...it isnt working (the pm implement)...im still looking into exactly why it isnt, but so far, no luck :(

a123
10-02-2005, 05:51 PM
sorry to hear that. thanks for your hard work. :)

TyleR
10-04-2005, 05:42 PM
Well, i've been updating the coding and adding some features, aswell as fixing minor bug's.

Fixed pages coming up blank when no transactions exist.

Fixed too many page numbers showing up on /transaction.php?userid=1, etc. when only about 2 transactions exist.

Added phrase for error message when no transactions exist.

Added transactions for user's in posbit under points.

if you wish to follow the development of this addon, please PM me for the link :)

-- TyleR

TyleR
11-07-2005, 03:27 PM
sorry for the long wait people..files updated, new zip added :)

- Tyler

CP,
11-10-2005, 12:40 AM
hi this is what i ahd received after i had clicked on the done button...., ??? can somebody explain?

TyleR
11-10-2005, 03:04 AM
that's alright, just ignore it :)

Just means you already have the 'reason' field in your db table..thats all :)

- Tyler

Alphawolf83
11-25-2005, 08:02 AM
Hello,

first to say great hack! But it would be much better if I could solve the following problem. :p
I installed it and I am able to transfer some points to another user. But the transaction doesn't appear in the transactions list. :(
Neither in the personal transactions list nor in the global transactions list.

I just get following error:
No Transactions Were Found, Sorry. Go Back To The Previous Page

Could anyone help me out? What do you need for helping me?

Thanks,
Oli

TyleR
11-25-2005, 03:23 PM
Mind PM'ing me your URL so I can test it myself?

Thanks,

Tyler

Alphawolf83
11-29-2005, 04:21 PM
Mind PM'ing me your URL so I can test it myself?

Thanks,

Tyler
Yes, the next few days I'll PM'ing you my URL, thanks!

But does it work on 3.0.7? In the hack description you wrote vb version 3.0.9...

TyleR
11-29-2005, 05:28 PM
it should work on 3.0.6-3.0.10 :)

Alphawolf83
12-12-2005, 05:52 PM
First sorry for the long time it tooks for me to reply. :nervous:

So you are able to test it yourself. What kind of permissions do you need for this? I'll PM you the accountinfos once you reply to this post. :)

Thanks!

sn8k
01-04-2006, 06:35 PM
this hack will be the hottest hack if you can add the pm feature. :)
I think I have this firgured out... let me test it for awhile and then I'll post up the hack :D

It's been working on my forums for a few weeks, but I am going to try to add the addon message for donating points... right now I have it done to only add the message in the PM when sending gifts.

Mark K.......

Alphawolf83
01-04-2006, 06:39 PM
First sorry for the long time it tooks for me to reply. :nervous:

So you are able to test it yourself. What kind of permissions do you need for this? I'll PM you the accountinfos once you reply to this post. :)

Thanks!
TyleR? :( ;)

TyleR
01-08-2006, 07:10 PM
Ack, sorry, been busy again

I dont really need admin access..just need to see the file you're using ;)

(uploading a copy of transaction.php to transaction.php.txt) :)

Alphawolf83
01-09-2006, 01:02 PM
Here's the transaction.php (see attachment).

If this is not helpful to find the problem, what could be another source of error?
I mean the uCash hack works in the main, but only the transactions are not shown in the transactions list. :ermm:

Alphawolf83
01-12-2006, 12:46 PM
Sorry for double post, but I found the problem ans solved it. :)
Thanks TyleR for the support!

cOuNtErFiET
02-02-2006, 10:47 PM
so was the PM integration ever added to this hack or no?

jzewatsky
02-03-2006, 02:10 AM
Tyler,

Thank you so much for continuing to work on this hack. I personally have been waiting to install it until you had to PM part worked out. Searching through threads, I found this thread (https://vborg.vbsupport.ru/showthread.php?t=83447&highlight=pm+donate ) in which tomdude9 (https://vborg.vbsupport.ru/member.php?userid=106621) figured out that if you change the <form action="ushop.php" method="post"> line in the 'uttstore_standard_confirmation' template to the following (slightly edited from his origional post):

<!--replace XXX with the donate function's ID number-->
<if condition="$_REQUEST[actionid] == 'XXX'">
<form action="private.php" name="private" method="post">
<input type="hidden" class="bginput" name="recipients" value="$_FIELDS[username]" />
<input type="hidden" class="bginput" name="title" value="$_FIELDS[points] POINTS RECIEVED" />
<input type="hidden" name="message" value="$_FIELDS[username],

I have just donated $_FIELDS[points] points to you.

Sincerely, $bbuserinfo[username]">
<!--feel free to change this message but preserve the spacing, line breaks won't parse-->
<input type="hidden" name="s" value="" />
<input type="hidden" name="do" value="insertpm" />
<input type="hidden" name="pmid" value="" />
<input type="hidden" name="forward" value="" />
<input type="hidden" name="receipt" value="0" />
</form></if>
<form action="ushop.php" method="post" onsubmit="document.private.submit()">


You automatically send a PM to the user when you donate to them. I was wondering if the variable that you use for the "reason" would be useable in the PM message.

I am by no means a coder, tomdude9 (https://vborg.vbsupport.ru/member.php?userid=106621) should recieve all credit for the auto PM. All I did is change it a bit to make it work for me and share it with you all.

Please keep me posted on if this works out, I'd love to install this hack for my users!!

Thanks again for your support!

cOuNtErFiET
02-03-2006, 06:41 AM
i was on a board that had this, when you donated it sent a pm with the reason for donation if there was one entered, if there wasn't one entered then it put the "so and so donated this much sucessfully" to your PM so i know it can be done and the owner of this board his name was Tyler so im thinking might be the same one or the tylers seem to know what they are doing...lol

jzewatsky
02-04-2006, 12:13 AM
Well, I've played with it a little more and have found that if you use the variable '$_FIELDS[reason]' it will include the reason for the donation in a PM when added to the code above. Again I really dont know what I am doing with this, use at your own risk.

I've also used the code above with admin_donate and the gifts hack. I can send the name of the gift and the reason for the gift in the PM. For the admin donate, I can send the amount donated, but the reason is not working. Any help would be great!

cOuNtErFiET
02-06-2006, 03:31 AM
wow that sounds like your on the right path can you tell me where to enter the code to send a pm with the reason....im a little confused with what you have posted, and also don't want to go messing with the code cause idk what im doing with php coding yet...lol and ty for continuing to work on this hack, i felt we were abandoned...lol tyler must be busy

cOuNtErFiET
02-06-2006, 03:33 AM
also maybe a reason in the admin donate part of the ushop i noticed this isn't incorporated...

jzewatsky
02-06-2006, 09:35 AM
No prob Counterfiet,

1st install the "Transactions with a message" hack.

2nd follow the directions here https://vborg.vbsupport.ru/showthread.php?t=83447&highlight=pm+donate finding the code <form action="ushop.php" method="post"> in the "uttstore_standard_confirmation" template. Replace that with <!--replace XXX with the donate function's ID number-->
<if condition="$_REQUEST[actionid] == 'XXX'">
<form action="private.php" name="private" method="post">
<input type="hidden" class="bginput" name="recipients" value="$_FIELDS[username]" />
<input type="hidden" class="bginput" name="title" value="$_FIELDS[points] POINTS RECIEVED" />
<input type="hidden" name="message" value="$_FIELDS[username],

I have just donated $_FIELDS[points] points to you because $_FIELDS[reason].

Sincerely, $bbuserinfo[username]">
<!--feel free to change this message but preserve the spacing, line breaks won't parse-->
<input type="hidden" name="s" value="" />
<input type="hidden" name="do" value="insertpm" />
<input type="hidden" name="pmid" value="" />
<input type="hidden" name="forward" value="" />
<input type="hidden" name="receipt" value="0" />
</form></if>
<form action="ushop.php" method="post" onsubmit="document.private.submit()">

Be sure to change the XXX to the action ID number of your donate action.

The PM part will work for other actions, just copy the code above below the code for the first action and change the # in the XXX and only include the line <form action="ushop.php" method="post" onsubmit="document.private.submit()"> in the last action in the template. Unfortunately, I have not figured out how to include the "$_FIELDS[reason]" in the admin donate.

I hope this helps...if anyone can help me explain better or figure out the admin donate issue please help. I know that most of you have moved on to 3.5 but some of us rookies are afraid to start over at square 1.

Thanks and good luck!